Skip to content

Commit f254527

Browse files
committed
Updated ZMQ to 4.1.2
Recompiled them under VC140 to remove the Visual Studio 2013 dependency
1 parent 7beac8e commit f254527

File tree

11 files changed

+326
-189
lines changed

11 files changed

+326
-189
lines changed

lib/libzmq-d.lib

454 Bytes
Binary file not shown.

lib/libzmq.lib

578 Bytes
Binary file not shown.

lib64/libzmq-d_64.lib

250 Bytes
Binary file not shown.

lib64/libzmq_64.lib

374 Bytes
Binary file not shown.

libzmq-d.dll

369 KB
Binary file not shown.

libzmq-d_64.dll

475 KB
Binary file not shown.

libzmq.dll

30 KB
Binary file not shown.

libzmq_64.dll

51.5 KB
Binary file not shown.

win32/external/zmq/zmq.h

+110-63
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2007-2013 Contributors as noted in the AUTHORS file
2+
Copyright (c) 2007-2015 Contributors as noted in the AUTHORS file
33
44
This file is part of 0MQ.
55
@@ -30,8 +30,8 @@
3030

3131
/* Version macros for compile-time API version detection */
3232
#define ZMQ_VERSION_MAJOR 4
33-
#define ZMQ_VERSION_MINOR 0
34-
#define ZMQ_VERSION_PATCH 4
33+
#define ZMQ_VERSION_MINOR 1
34+
#define ZMQ_VERSION_PATCH 2
3535

3636
#define ZMQ_MAKE_VERSION(major, minor, patch) \
3737
((major) * 10000 + (minor) * 100 + (patch))
@@ -71,18 +71,9 @@ extern "C" {
7171
#endif
7272

7373
/* Define integer types needed for event interface */
74+
#define ZMQ_DEFINED_STDINT 1
7475
#if defined ZMQ_HAVE_SOLARIS || defined ZMQ_HAVE_OPENVMS
7576
# include <inttypes.h>
76-
#elif defined _MSC_VER && _MSC_VER < 1600
77-
# ifndef int32_t
78-
typedef __int32 int32_t;
79-
# endif
80-
# ifndef uint16_t
81-
typedef unsigned __int16 uint16_t;
82-
# endif
83-
# ifndef uint8_t
84-
typedef unsigned __int8 uint8_t;
85-
# endif
8677
#else
8778
# include <stdint.h>
8879
#endif
@@ -158,9 +149,6 @@ typedef unsigned __int8 uint8_t;
158149
#define ETERM (ZMQ_HAUSNUMERO + 53)
159150
#define EMTHREAD (ZMQ_HAUSNUMERO + 54)
160151

161-
/* Run-time API version detection */
162-
ZMQ_EXPORT void zmq_version (int *major, int *minor, int *patch);
163-
164152
/* This function retrieves the errno as it is known to 0MQ library. The goal */
165153
/* of this function is to make the code 100% portable, including where 0MQ */
166154
/* compiled with certain CRT library (on Windows) is linked to an */
@@ -170,6 +158,9 @@ ZMQ_EXPORT int zmq_errno (void);
170158
/* Resolves system errors and 0MQ errors to human-readable string. */
171159
ZMQ_EXPORT const char *zmq_strerror (int errnum);
172160

161+
/* Run-time API version detection */
162+
ZMQ_EXPORT void zmq_version (int *major, int *minor, int *patch);
163+
173164
/******************************************************************************/
174165
/* 0MQ infrastructure (a.k.a. context) initialisation & termination. */
175166
/******************************************************************************/
@@ -178,10 +169,15 @@ ZMQ_EXPORT const char *zmq_strerror (int errnum);
178169
/* Context options */
179170
#define ZMQ_IO_THREADS 1
180171
#define ZMQ_MAX_SOCKETS 2
172+
#define ZMQ_SOCKET_LIMIT 3
173+
#define ZMQ_THREAD_PRIORITY 3
174+
#define ZMQ_THREAD_SCHED_POLICY 4
181175

182176
/* Default for new contexts */
183177
#define ZMQ_IO_THREADS_DFLT 1
184178
#define ZMQ_MAX_SOCKETS_DFLT 1023
179+
#define ZMQ_THREAD_PRIORITY_DFLT -1
180+
#define ZMQ_THREAD_SCHED_POLICY_DFLT -1
185181

186182
ZMQ_EXPORT void *zmq_ctx_new (void);
187183
ZMQ_EXPORT int zmq_ctx_term (void *context);
@@ -199,7 +195,7 @@ ZMQ_EXPORT int zmq_ctx_destroy (void *context);
199195
/* 0MQ message definition. */
200196
/******************************************************************************/
201197

202-
typedef struct zmq_msg_t {unsigned char _ [32];} zmq_msg_t;
198+
typedef struct zmq_msg_t {unsigned char _ [64];} zmq_msg_t;
203199

204200
typedef void (zmq_free_fn) (void *data, void *hint);
205201

@@ -215,8 +211,9 @@ ZMQ_EXPORT int zmq_msg_copy (zmq_msg_t *dest, zmq_msg_t *src);
215211
ZMQ_EXPORT void *zmq_msg_data (zmq_msg_t *msg);
216212
ZMQ_EXPORT size_t zmq_msg_size (zmq_msg_t *msg);
217213
ZMQ_EXPORT int zmq_msg_more (zmq_msg_t *msg);
218-
ZMQ_EXPORT int zmq_msg_get (zmq_msg_t *msg, int option);
219-
ZMQ_EXPORT int zmq_msg_set (zmq_msg_t *msg, int option, int optval);
214+
ZMQ_EXPORT int zmq_msg_get (zmq_msg_t *msg, int property);
215+
ZMQ_EXPORT int zmq_msg_set (zmq_msg_t *msg, int property, int optval);
216+
ZMQ_EXPORT const char *zmq_msg_gets (zmq_msg_t *msg, const char *property);
220217

221218

222219
/******************************************************************************/
@@ -270,7 +267,6 @@ ZMQ_EXPORT int zmq_msg_set (zmq_msg_t *msg, int option, int optval);
270267
#define ZMQ_TCP_KEEPALIVE_CNT 35
271268
#define ZMQ_TCP_KEEPALIVE_IDLE 36
272269
#define ZMQ_TCP_KEEPALIVE_INTVL 37
273-
#define ZMQ_TCP_ACCEPT_FILTER 38
274270
#define ZMQ_IMMEDIATE 39
275271
#define ZMQ_XPUB_VERBOSE 40
276272
#define ZMQ_ROUTER_RAW 41
@@ -288,9 +284,21 @@ ZMQ_EXPORT int zmq_msg_set (zmq_msg_t *msg, int option, int optval);
288284
#define ZMQ_REQ_RELAXED 53
289285
#define ZMQ_CONFLATE 54
290286
#define ZMQ_ZAP_DOMAIN 55
287+
#define ZMQ_ROUTER_HANDOVER 56
288+
#define ZMQ_TOS 57
289+
#define ZMQ_CONNECT_RID 61
290+
#define ZMQ_GSSAPI_SERVER 62
291+
#define ZMQ_GSSAPI_PRINCIPAL 63
292+
#define ZMQ_GSSAPI_SERVICE_PRINCIPAL 64
293+
#define ZMQ_GSSAPI_PLAINTEXT 65
294+
#define ZMQ_HANDSHAKE_IVL 66
295+
#define ZMQ_SOCKS_PROXY 68
296+
#define ZMQ_XPUB_NODROP 69
291297

292298
/* Message options */
293299
#define ZMQ_MORE 1
300+
#define ZMQ_SRCFD 2
301+
#define ZMQ_SHARED 3
294302

295303
/* Send/recv options. */
296304
#define ZMQ_DONTWAIT 1
@@ -300,8 +308,13 @@ ZMQ_EXPORT int zmq_msg_set (zmq_msg_t *msg, int option, int optval);
300308
#define ZMQ_NULL 0
301309
#define ZMQ_PLAIN 1
302310
#define ZMQ_CURVE 2
311+
#define ZMQ_GSSAPI 3
303312

304313
/* Deprecated options and aliases */
314+
#define ZMQ_TCP_ACCEPT_FILTER 38
315+
#define ZMQ_IPC_FILTER_PID 58
316+
#define ZMQ_IPC_FILTER_UID 59
317+
#define ZMQ_IPC_FILTER_GID 60
305318
#define ZMQ_IPV4ONLY 31
306319
#define ZMQ_DELAY_ATTACH_ON_CONNECT ZMQ_IMMEDIATE
307320
#define ZMQ_NOBLOCK ZMQ_DONTWAIT
@@ -312,34 +325,20 @@ ZMQ_EXPORT int zmq_msg_set (zmq_msg_t *msg, int option, int optval);
312325
/* 0MQ socket events and monitoring */
313326
/******************************************************************************/
314327

315-
/* Socket transport events (tcp and ipc only) */
316-
#define ZMQ_EVENT_CONNECTED 1
317-
#define ZMQ_EVENT_CONNECT_DELAYED 2
318-
#define ZMQ_EVENT_CONNECT_RETRIED 4
319-
320-
#define ZMQ_EVENT_LISTENING 8
321-
#define ZMQ_EVENT_BIND_FAILED 16
322-
323-
#define ZMQ_EVENT_ACCEPTED 32
324-
#define ZMQ_EVENT_ACCEPT_FAILED 64
325-
326-
#define ZMQ_EVENT_CLOSED 128
327-
#define ZMQ_EVENT_CLOSE_FAILED 256
328-
#define ZMQ_EVENT_DISCONNECTED 512
329-
#define ZMQ_EVENT_MONITOR_STOPPED 1024
330-
331-
#define ZMQ_EVENT_ALL ( ZMQ_EVENT_CONNECTED | ZMQ_EVENT_CONNECT_DELAYED | \
332-
ZMQ_EVENT_CONNECT_RETRIED | ZMQ_EVENT_LISTENING | \
333-
ZMQ_EVENT_BIND_FAILED | ZMQ_EVENT_ACCEPTED | \
334-
ZMQ_EVENT_ACCEPT_FAILED | ZMQ_EVENT_CLOSED | \
335-
ZMQ_EVENT_CLOSE_FAILED | ZMQ_EVENT_DISCONNECTED | \
336-
ZMQ_EVENT_MONITOR_STOPPED)
337-
338-
/* Socket event data */
339-
typedef struct {
340-
uint16_t event; // id of the event as bitfield
341-
int32_t value ; // value is either error code, fd or reconnect interval
342-
} zmq_event_t;
328+
/* Socket transport events (TCP and IPC only) */
329+
330+
#define ZMQ_EVENT_CONNECTED 0x0001
331+
#define ZMQ_EVENT_CONNECT_DELAYED 0x0002
332+
#define ZMQ_EVENT_CONNECT_RETRIED 0x0004
333+
#define ZMQ_EVENT_LISTENING 0x0008
334+
#define ZMQ_EVENT_BIND_FAILED 0x0010
335+
#define ZMQ_EVENT_ACCEPTED 0x0020
336+
#define ZMQ_EVENT_ACCEPT_FAILED 0x0040
337+
#define ZMQ_EVENT_CLOSED 0x0080
338+
#define ZMQ_EVENT_CLOSE_FAILED 0x0100
339+
#define ZMQ_EVENT_DISCONNECTED 0x0200
340+
#define ZMQ_EVENT_MONITOR_STOPPED 0x0400
341+
#define ZMQ_EVENT_ALL 0xFFFF
343342

344343
ZMQ_EXPORT void *zmq_socket (void *, int type);
345344
ZMQ_EXPORT int zmq_close (void *s);
@@ -356,14 +355,6 @@ ZMQ_EXPORT int zmq_send_const (void *s, const void *buf, size_t len, int flags);
356355
ZMQ_EXPORT int zmq_recv (void *s, void *buf, size_t len, int flags);
357356
ZMQ_EXPORT int zmq_socket_monitor (void *s, const char *addr, int events);
358357

359-
ZMQ_EXPORT int zmq_sendmsg (void *s, zmq_msg_t *msg, int flags);
360-
ZMQ_EXPORT int zmq_recvmsg (void *s, zmq_msg_t *msg, int flags);
361-
362-
/* Experimental */
363-
struct iovec;
364-
365-
ZMQ_EXPORT int zmq_sendiov (void *s, struct iovec *iov, size_t count, int flags);
366-
ZMQ_EXPORT int zmq_recviov (void *s, struct iovec *iov, size_t *count, int flags);
367358

368359
/******************************************************************************/
369360
/* I/O multiplexing. */
@@ -373,7 +364,7 @@ ZMQ_EXPORT int zmq_recviov (void *s, struct iovec *iov, size_t *count, int flags
373364
#define ZMQ_POLLOUT 2
374365
#define ZMQ_POLLERR 4
375366

376-
typedef struct
367+
typedef struct zmq_pollitem_t
377368
{
378369
void *socket;
379370
#if defined _WIN32
@@ -389,22 +380,78 @@ typedef struct
389380

390381
ZMQ_EXPORT int zmq_poll (zmq_pollitem_t *items, int nitems, long timeout);
391382

392-
/* Built-in message proxy (3-way) */
383+
/******************************************************************************/
384+
/* Message proxying */
385+
/******************************************************************************/
393386

394387
ZMQ_EXPORT int zmq_proxy (void *frontend, void *backend, void *capture);
388+
ZMQ_EXPORT int zmq_proxy_steerable (void *frontend, void *backend, void *capture, void *control);
395389

396-
/* Encode a binary key as printable text using ZMQ RFC 32 */
397-
ZMQ_EXPORT char *zmq_z85_encode (char *dest, uint8_t *data, size_t size);
390+
/******************************************************************************/
391+
/* Probe library capabilities */
392+
/******************************************************************************/
398393

399-
/* Encode a binary key from printable text per ZMQ RFC 32 */
400-
ZMQ_EXPORT uint8_t *zmq_z85_decode (uint8_t *dest, char *string);
394+
#define ZMQ_HAS_CAPABILITIES 1
395+
ZMQ_EXPORT int zmq_has (const char *capability);
401396

402397
/* Deprecated aliases */
403398
#define ZMQ_STREAMER 1
404399
#define ZMQ_FORWARDER 2
405400
#define ZMQ_QUEUE 3
406-
/* Deprecated method */
401+
402+
/* Deprecated methods */
407403
ZMQ_EXPORT int zmq_device (int type, void *frontend, void *backend);
404+
ZMQ_EXPORT int zmq_sendmsg (void *s, zmq_msg_t *msg, int flags);
405+
ZMQ_EXPORT int zmq_recvmsg (void *s, zmq_msg_t *msg, int flags);
406+
407+
408+
/******************************************************************************/
409+
/* Encryption functions */
410+
/******************************************************************************/
411+
412+
/* Encode data with Z85 encoding. Returns encoded data */
413+
ZMQ_EXPORT char *zmq_z85_encode (char *dest, const uint8_t *data, size_t size);
414+
415+
/* Decode data with Z85 encoding. Returns decoded data */
416+
ZMQ_EXPORT uint8_t *zmq_z85_decode (uint8_t *dest, const char *string);
417+
418+
/* Generate z85-encoded public and private keypair with libsodium. */
419+
/* Returns 0 on success. */
420+
ZMQ_EXPORT int zmq_curve_keypair (char *z85_public_key, char *z85_secret_key);
421+
422+
423+
/******************************************************************************/
424+
/* These functions are not documented by man pages -- use at your own risk. */
425+
/* If you need these to be part of the formal ZMQ API, then (a) write a man */
426+
/* page, and (b) write a test case in tests. */
427+
/******************************************************************************/
428+
429+
struct iovec;
430+
431+
ZMQ_EXPORT int zmq_sendiov (void *s, struct iovec *iov, size_t count, int flags);
432+
ZMQ_EXPORT int zmq_recviov (void *s, struct iovec *iov, size_t *count, int flags);
433+
434+
/* Helper functions are used by perf tests so that they don't have to care */
435+
/* about minutiae of time-related functions on different OS platforms. */
436+
437+
/* Starts the stopwatch. Returns the handle to the watch. */
438+
ZMQ_EXPORT void *zmq_stopwatch_start (void);
439+
440+
/* Stops the stopwatch. Returns the number of microseconds elapsed since */
441+
/* the stopwatch was started. */
442+
ZMQ_EXPORT unsigned long zmq_stopwatch_stop (void *watch_);
443+
444+
/* Sleeps for specified number of seconds. */
445+
ZMQ_EXPORT void zmq_sleep (int seconds_);
446+
447+
typedef void (zmq_thread_fn) (void*);
448+
449+
/* Start a thread. Returns a handle to the thread. */
450+
ZMQ_EXPORT void *zmq_threadstart (zmq_thread_fn* func, void* arg);
451+
452+
/* Wait for thread to complete then free up resources. */
453+
ZMQ_EXPORT void zmq_threadclose (void* thread);
454+
408455

409456
#undef ZMQ_EXPORT
410457

0 commit comments

Comments
 (0)