/*
zmq_atomic_counter_dec	0x1003cda0	0x0003cda0	1 (0x1)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_atomic_counter_destroy	0x1003cdc0	0x0003cdc0	2 (0x2)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_atomic_counter_inc	0x1003cdf0	0x0003cdf0	3 (0x3)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_atomic_counter_new	0x1003ce10	0x0003ce10	4 (0x4)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_atomic_counter_set	0x1003ce70	0x0003ce70	5 (0x5)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_atomic_counter_value	0x1003ce80	0x0003ce80	6 (0x6)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_curve_keypair	0x1003ce90	0x0003ce90	16 (0x10)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_curve_public	0x1003cef0	0x0003cef0	17 (0x11)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_device	0x1003bfb0	0x0003bfb0	18 (0x12)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_errno	0x1003c010	0x0003c010	20 (0x14)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_getsockopt	0x1003c020	0x0003c020	21 (0x15)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_has	0x1003c060	0x0003c060	22 (0x16)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_init	0x1003c0b0	0x0003c0b0	23 (0x17)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_msg_close	0x1003c0f0	0x0003c0f0	24 (0x18)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_msg_copy	0x1003c100	0x0003c100	25 (0x19)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_msg_data	0x1003c110	0x0003c110	26 (0x1a)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_msg_get	0x1003c120	0x0003c120	27 (0x1b)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_msg_gets	0x1003c1a0	0x0003c1a0	28 (0x1c)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_msg_init	0x1003c250	0x0003c250	29 (0x1d)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_msg_init_data	0x1003c260	0x0003c260	30 (0x1e)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_msg_init_size	0x1003c280	0x0003c280	31 (0x1f)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_msg_more	0x1003c290	0x0003c290	32 (0x20)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_msg_move	0x1003c2b0	0x0003c2b0	33 (0x21)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_msg_recv	0x1003c2c0	0x0003c2c0	34 (0x22)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_msg_send	0x1003c300	0x0003c300	35 (0x23)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_msg_set	0x1003c360	0x0003c360	36 (0x24)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_msg_size	0x1003c370	0x0003c370	37 (0x25)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_poll	0x1003c380	0x0003c380	38 (0x26)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_proxy	0x1003c390	0x0003c390	39 (0x27)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_proxy_steerable	0x1003c3d0	0x0003c3d0	40 (0x28)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_recv	0x1003c400	0x0003c400	41 (0x29)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_recviov	0x1003c5d0	0x0003c5d0	42 (0x2a)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_sendiov	0x1003cae0	0x0003cae0	46 (0x2e)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_sendmsg	0x1003cc80	0x0003cc80	47 (0x2f)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_setsockopt	0x1003cca0	0x0003cca0	48 (0x30)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_sleep	0x1003cf60	0x0003cf60	49 (0x31)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_stopwatch_start	0x1003cf80	0x0003cf80	52 (0x34)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_stopwatch_stop	0x1003cfe0	0x0003cfe0	53 (0x35)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_strerror	0x1003cd60	0x0003cd60	54 (0x36)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_term	0x1003cd70	0x0003cd70	55 (0x37)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_threadclose	0x1003d010	0x0003d010	56 (0x38)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_threadstart	0x1003d030	0x0003d030	57 (0x39)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_version	0x1003cd80	0x0003cd80	59 (0x3b)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_z85_decode	0x1003d080	0x0003d080	60 (0x3c)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_z85_encode	0x1003d140	0x0003d140	61 (0x3d)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	


zmq_version;libzmq!zmq_version
*
#include <windows.h>

void __stdcall zmq_version(int *m,int *n,int *l)  // line 101
API(zmq_version,libzmq);

void main (void) {
  //verbose = 7;
  int v1;
  int v2;
  int v3;
  zmq_version(v1,v2,v3);
  printf("\nversion: %d.%d.%d",v1,v2,v3);
}
*/
#include <windows.h>

#define intptr_t int
#define uintptr_t uint
#define size_t int

//------------------------------------------ Contex ----------------------------------------------------
//--- Context options
#define ZMQ_IO_THREADS              1
#define ZMQ_MAX_SOCKETS             2
#define ZMQ_SOCKET_LIMIT            3
#define ZMQ_THREAD_PRIORITY         3
#define ZMQ_THREAD_SCHED_POLICY     4
#define ZMQ_MAX_MSGSZ               5

//--- Default for new contexts
#define ZMQ_IO_THREADS_DFLT         1
#define ZMQ_MAX_SOCKETS_DFLT        1023
#define ZMQ_THREAD_PRIORITY_DFLT    -1
#define ZMQ_THREAD_SCHED_POLICY_DFLT -1

/*
zmq_ctx_destroy	0x1003cd70	0x0003cd70	10 (0xa)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
+zmq_ctx_get	0x1003bd00	0x0003bd00	11 (0xb)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
+zmq_ctx_new	0x1003bd40	0x0003bd40	12 (0xc)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
+zmq_ctx_set	0x1003be70	0x0003be70	13 (0xd)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
+zmq_ctx_shutdown	0x1003beb0	0x0003beb0	14 (0xe)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
+zmq_ctx_term	0x1003bef0	0x0003bef0	15 (0xf)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	

*/
intptr_t __cdecl zmq_ctx_term(intptr_t context);
API(zmq_ctx_term,libzmq)

intptr_t __cdecl zmq_ctx_shutdown(intptr_t context);
API(zmq_ctx_shutdown,libzmq)

intptr_t __cdecl zmq_ctx_destroy(intptr_t context);
API(zmq_ctx_destroy,libzmq)

intptr_t __cdecl zmq_ctx_set(intptr_t context,intptr_t option,intptr_t optval);
API(zmq_ctx_set,libzmq)

intptr_t __cdecl zmq_ctx_get(intptr_t context,intptr_t option);
API(zmq_ctx_get,libzmq)

intptr_t __cdecl zmq_ctx_new(void);
API(zmq_ctx_new,libzmq)


//-----------------------------------------------------Socket----

//--- Socket types
#define ZMQ_PAIR 0
#define ZMQ_PUB 1
#define ZMQ_SUB 2
#define ZMQ_REQ 3
#define ZMQ_REP 4
#define ZMQ_DEALER 5
#define ZMQ_ROUTER 6
#define ZMQ_PULL 7
#define ZMQ_PUSH 8
#define ZMQ_XPUB 9
#define ZMQ_XSUB 10
#define ZMQ_STREAM 11

//--- Message options
#define ZMQ_MORE 1
#define ZMQ_SRCFD 2  // Deprecated
#define ZMQ_SHARED 3

//--- Send/recv options
#define ZMQ_DONTWAIT 1
#define ZMQ_SNDMORE 2

//--- Socket transport events (TCP, IPC and TIPC only)
#define ZMQ_EVENT_CONNECTED         0x0001
#define ZMQ_EVENT_CONNECT_DELAYED   0x0002
#define ZMQ_EVENT_CONNECT_RETRIED   0x0004
#define ZMQ_EVENT_LISTENING         0x0008
#define ZMQ_EVENT_BIND_FAILED       0x0010
#define ZMQ_EVENT_ACCEPTED          0x0020
#define ZMQ_EVENT_ACCEPT_FAILED     0x0040
#define ZMQ_EVENT_CLOSED            0x0080
#define ZMQ_EVENT_CLOSE_FAILED      0x0100
#define ZMQ_EVENT_DISCONNECTED      0x0200
#define ZMQ_EVENT_MONITOR_STOPPED   0x0400
#define ZMQ_EVENT_ALL               0xFFFF

//--- I/O multiplexing
#define ZMQ_POLLIN 1
#define ZMQ_POLLOUT 2
// We only use 0MQ sockets on Windows
// So POLLERR and POLLPRI is of no use
#define ZMQ_POLLERR 4
#define ZMQ_POLLPRI 8

#define ZMQ_POLLITEMS_DFLT 16




//+------------------------------------------------------------------+
//| Sockets                                                          |
//+------------------------------------------------------------------+
/*
zmq_bind	0x1003bc40	0x0003bc40	7 (0x7)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_close	0x1003bc80	0x0003bc80	8 (0x8)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_connect	0x1003bcc0	0x0003bcc0	9 (0x9)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_socket	0x1003cce0	0x0003cce0	50 (0x32)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_unbind	0x1003bfd0	0x0003bfd0	58 (0x3a)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_disconnect	0x1003bfd0	0x0003bfd0	19 (0x13)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_recvmsg	0x1003c870	0x0003c870	43 (0x2b)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_send	0x1003c890	0x0003c890	44 (0x2c)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_send_const	0x1003c9c0	0x0003c9c0	45 (0x2d)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	
zmq_socket_monitor	0x1003cd20	0x0003cd20	51 (0x33)	libzmq.dll	E:\tmp\ZorroBeta\libzmq.dll	Exported Function	

 */
intptr_t __cdecl zmq_bind(intptr_t s,const char *);
API(zmq_bind,libzmq)

intptr_t __cdecl zmq_close(intptr_t s);
API(zmq_close,libzmq)

intptr_t __cdecl zmq_connect(intptr_t s,const char *);
API(zmq_connect,libzmq)

intptr_t __cdecl zmq_socket(intptr_t context,int type);
API(zmq_socket,libzmq)


intptr_t __cdecl zmq_unbind(intptr_t s,const char *);
API(zmq_unbind,libzmq)

intptr_t __cdecl zmq_disconnect(intptr_t s,const char *);
API(zmq_disconnect,libzmq)

intptr_t __cdecl zmq_send(intptr_t s,const char *,size_t len,intptr_t flags);
API(zmq_send,libzmq)

intptr_t __cdecl zmq_send_const(intptr_t s,const char *,size_t len,intptr_t flags);
API(zmq_send_const,libzmq)

intptr_t __cdecl zmq_recv(intptr_t s,char *,size_t len,intptr_t flags);
API(zmq_recv,libzmq)

intptr_t __cdecl zmq_socket_monitor(intptr_t s,const char *,intptr_t events);
API(zmq_socket_monitor,libzmq)

//+------------------------------------------------------------------+
//| Message                                                          |
//+------------------------------------------------------------------+
//int zmq_msg_send(zmq_msg_t &msg,intptr_t s,int flags);
//int zmq_msg_recv(zmq_msg_t &msg,intptr_t s,int flags);
//+------------------------------------------------------------------+
//| I/O multiplexing                                                 |
//+------------------------------------------------------------------+
//int zmq_poll(PollItem &items[],int nitems,long timeout);
//+------------------------------------------------------------------+
//| Message proxying                                                 |
//+------------------------------------------------------------------+
//int zmq_proxy(intptr_t frontend_ref,intptr_t backend_ref,intptr_t capture_ref);
//int zmq_proxy_steerable(intptr_t frontend_ref,intptr_t backend_ref,intptr_t capture_ref,intptr_t control_ref);


void __cdecl zmq_version(intptr_t*, intptr_t*, intptr_t*);  
API(zmq_version,libzmq)

