czmq-ffi-gen 0.9.1-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +7 -0
  2. data/AUTHORS +1 -0
  3. data/CHANGES.md +88 -0
  4. data/Gemfile +2 -0
  5. data/LICENSE +14 -0
  6. data/README.md +112 -0
  7. data/lib/czmq-ffi-gen.rb +7 -0
  8. data/lib/czmq-ffi-gen/czmq/ffi.rb +1210 -0
  9. data/lib/czmq-ffi-gen/czmq/ffi/version.rb +15 -0
  10. data/lib/czmq-ffi-gen/czmq/ffi/zactor.rb +186 -0
  11. data/lib/czmq-ffi-gen/czmq/ffi/zarmour.rb +286 -0
  12. data/lib/czmq-ffi-gen/czmq/ffi/zcert.rb +307 -0
  13. data/lib/czmq-ffi-gen/czmq/ffi/zcertstore.rb +222 -0
  14. data/lib/czmq-ffi-gen/czmq/ffi/zchunk.rb +388 -0
  15. data/lib/czmq-ffi-gen/czmq/ffi/zclock.rb +140 -0
  16. data/lib/czmq-ffi-gen/czmq/ffi/zconfig.rb +442 -0
  17. data/lib/czmq-ffi-gen/czmq/ffi/zdigest.rb +156 -0
  18. data/lib/czmq-ffi-gen/czmq/ffi/zdir.rb +283 -0
  19. data/lib/czmq-ffi-gen/czmq/ffi/zdir_patch.rb +194 -0
  20. data/lib/czmq-ffi-gen/czmq/ffi/zfile.rb +353 -0
  21. data/lib/czmq-ffi-gen/czmq/ffi/zframe.rb +359 -0
  22. data/lib/czmq-ffi-gen/czmq/ffi/zhash.rb +416 -0
  23. data/lib/czmq-ffi-gen/czmq/ffi/zhashx.rb +659 -0
  24. data/lib/czmq-ffi-gen/czmq/ffi/ziflist.rb +189 -0
  25. data/lib/czmq-ffi-gen/czmq/ffi/zlist.rb +365 -0
  26. data/lib/czmq-ffi-gen/czmq/ffi/zlistx.rb +478 -0
  27. data/lib/czmq-ffi-gen/czmq/ffi/zloop.rb +396 -0
  28. data/lib/czmq-ffi-gen/czmq/ffi/zmsg.rb +515 -0
  29. data/lib/czmq-ffi-gen/czmq/ffi/zpoller.rb +194 -0
  30. data/lib/czmq-ffi-gen/czmq/ffi/zproc.rb +294 -0
  31. data/lib/czmq-ffi-gen/czmq/ffi/zsock.rb +3479 -0
  32. data/lib/czmq-ffi-gen/czmq/ffi/zstr.rb +203 -0
  33. data/lib/czmq-ffi-gen/czmq/ffi/ztimerset.rb +203 -0
  34. data/lib/czmq-ffi-gen/czmq/ffi/ztrie.rb +221 -0
  35. data/lib/czmq-ffi-gen/czmq/ffi/zuuid.rb +227 -0
  36. data/lib/czmq-ffi-gen/errors.rb +12 -0
  37. data/lib/czmq-ffi-gen/gem_version.rb +5 -0
  38. data/lib/czmq-ffi-gen/legacy.rb +16 -0
  39. data/lib/czmq-ffi-gen/libzmq.rb +18 -0
  40. data/lib/czmq-ffi-gen/signals.rb +27 -0
  41. data/lib/czmq-ffi-gen/vendor.rb +5 -0
  42. data/lib/czmq-ffi-gen/versions.rb +19 -0
  43. data/vendor/local/bin/inproc_lat.exe +0 -0
  44. data/vendor/local/bin/inproc_thr.exe +0 -0
  45. data/vendor/local/bin/libczmq.dll +0 -0
  46. data/vendor/local/bin/libgcc_s_sjlj-1.dll +0 -0
  47. data/vendor/local/bin/libstdc++-6.dll +0 -0
  48. data/vendor/local/bin/libzmq.dll +0 -0
  49. data/vendor/local/bin/local_lat.exe +0 -0
  50. data/vendor/local/bin/local_thr.exe +0 -0
  51. data/vendor/local/bin/remote_lat.exe +0 -0
  52. data/vendor/local/bin/remote_thr.exe +0 -0
  53. data/vendor/local/include/czmq.h +31 -0
  54. data/vendor/local/include/czmq_library.h +199 -0
  55. data/vendor/local/include/czmq_prelude.h +641 -0
  56. data/vendor/local/include/readme.txt +83 -0
  57. data/vendor/local/include/sha1.h +76 -0
  58. data/vendor/local/include/sha1.inc_c +335 -0
  59. data/vendor/local/include/slre.h +92 -0
  60. data/vendor/local/include/slre.inc_c +660 -0
  61. data/vendor/local/include/zactor.h +76 -0
  62. data/vendor/local/include/zarmour.h +114 -0
  63. data/vendor/local/include/zauth.h +100 -0
  64. data/vendor/local/include/zauth_v2.h +88 -0
  65. data/vendor/local/include/zbeacon.h +86 -0
  66. data/vendor/local/include/zbeacon_v2.h +75 -0
  67. data/vendor/local/include/zcert.h +136 -0
  68. data/vendor/local/include/zcertstore.h +100 -0
  69. data/vendor/local/include/zchunk.h +163 -0
  70. data/vendor/local/include/zclock.h +73 -0
  71. data/vendor/local/include/zconfig.h +185 -0
  72. data/vendor/local/include/zctx.h +107 -0
  73. data/vendor/local/include/zdigest.h +65 -0
  74. data/vendor/local/include/zdir.h +149 -0
  75. data/vendor/local/include/zdir_patch.h +82 -0
  76. data/vendor/local/include/zfile.h +177 -0
  77. data/vendor/local/include/zframe.h +176 -0
  78. data/vendor/local/include/zgossip.h +95 -0
  79. data/vendor/local/include/zgossip_engine.inc +927 -0
  80. data/vendor/local/include/zgossip_msg.h +129 -0
  81. data/vendor/local/include/zhash.h +195 -0
  82. data/vendor/local/include/zhash_primes.inc +329 -0
  83. data/vendor/local/include/zhashx.h +298 -0
  84. data/vendor/local/include/ziflist.h +77 -0
  85. data/vendor/local/include/zlist.h +158 -0
  86. data/vendor/local/include/zlistx.h +205 -0
  87. data/vendor/local/include/zloop.h +168 -0
  88. data/vendor/local/include/zmonitor.h +73 -0
  89. data/vendor/local/include/zmonitor_v2.h +56 -0
  90. data/vendor/local/include/zmq.h +617 -0
  91. data/vendor/local/include/zmq_utils.h +48 -0
  92. data/vendor/local/include/zmsg.h +280 -0
  93. data/vendor/local/include/zmutex.h +55 -0
  94. data/vendor/local/include/zpoller.h +92 -0
  95. data/vendor/local/include/zproc.h +168 -0
  96. data/vendor/local/include/zproxy.h +111 -0
  97. data/vendor/local/include/zproxy_v2.h +62 -0
  98. data/vendor/local/include/zrex.h +82 -0
  99. data/vendor/local/include/zsock.h +912 -0
  100. data/vendor/local/include/zsock_option.inc +4126 -0
  101. data/vendor/local/include/zsocket.h +110 -0
  102. data/vendor/local/include/zsockopt.h +256 -0
  103. data/vendor/local/include/zstr.h +110 -0
  104. data/vendor/local/include/zsys.h +386 -0
  105. data/vendor/local/include/zthread.h +50 -0
  106. data/vendor/local/include/ztimerset.h +90 -0
  107. data/vendor/local/include/ztrie.h +106 -0
  108. data/vendor/local/include/zuuid.h +96 -0
  109. data/vendor/local/lib/libczmq.dll.a +0 -0
  110. data/vendor/local/lib/liblibzmq.dll.a +0 -0
  111. data/vendor/local/lib/libzmq-static.a +0 -0
  112. data/vendor/local/lib/pkgconfig/libczmq.pc +23 -0
  113. data/vendor/local/lib/pkgconfig/libzmq.pc +11 -0
  114. data/vendor/local/share/zmq/AUTHORS.txt +147 -0
  115. data/vendor/local/share/zmq/COPYING.LESSER.txt +181 -0
  116. data/vendor/local/share/zmq/COPYING.txt +674 -0
  117. data/vendor/local/share/zmq/NEWS.txt +978 -0
  118. metadata +230 -0
@@ -0,0 +1,110 @@
1
+ /* =========================================================================
2
+ zsocket - working with 0MQ sockets
3
+
4
+ Copyright (c) the Contributors as noted in the AUTHORS file.
5
+ This file is part of CZMQ, the high-level C binding for 0MQ:
6
+ http://czmq.zeromq.org.
7
+
8
+ This Source Code Form is subject to the terms of the Mozilla Public
9
+ License, v. 2.0. If a copy of the MPL was not distributed with this
10
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
11
+ =========================================================================
12
+ */
13
+
14
+ #ifndef __ZSOCKET_H_INCLUDED__
15
+ #define __ZSOCKET_H_INCLUDED__
16
+
17
+ #ifdef __cplusplus
18
+ extern "C" {
19
+ #endif
20
+
21
+ // @interface
22
+ // This port range is defined by IANA for dynamic or private ports
23
+ // We use this when choosing a port for dynamic binding.
24
+ #define ZSOCKET_DYNFROM 0xc000
25
+ #define ZSOCKET_DYNTO 0xffff
26
+
27
+ // Callback function for zero-copy methods
28
+ typedef void (zsocket_free_fn) (void *data, void *arg);
29
+
30
+ // Create a new socket within our CZMQ context, replaces zmq_socket.
31
+ // Use this to get automatic management of the socket at shutdown.
32
+ // Note: SUB sockets do not automatically subscribe to everything; you
33
+ // must set filters explicitly.
34
+ CZMQ_EXPORT void *
35
+ zsocket_new (zctx_t *self, int type);
36
+
37
+ // Destroy a socket within our CZMQ context, replaces zmq_close.
38
+ CZMQ_EXPORT void
39
+ zsocket_destroy (zctx_t *ctx, void *self);
40
+
41
+ // Bind a socket to a formatted endpoint. If the port is specified as
42
+ // '*', binds to any free port from ZSOCKET_DYNFROM to ZSOCKET_DYNTO
43
+ // and returns the actual port number used. Otherwise asserts that the
44
+ // bind succeeded with the specified port number. Always returns the
45
+ // port number if successful.
46
+ CZMQ_EXPORT int
47
+ zsocket_bind (void *self, const char *format, ...);
48
+
49
+ // Unbind a socket from a formatted endpoint.
50
+ // Returns 0 if OK, -1 if the endpoint was invalid or the function
51
+ // isn't supported.
52
+ CZMQ_EXPORT int
53
+ zsocket_unbind (void *self, const char *format, ...);
54
+
55
+ // Connect a socket to a formatted endpoint
56
+ // Returns 0 if OK, -1 if the endpoint was invalid.
57
+ CZMQ_EXPORT int
58
+ zsocket_connect (void *self, const char *format, ...);
59
+
60
+ // Disconnect a socket from a formatted endpoint
61
+ // Returns 0 if OK, -1 if the endpoint was invalid or the function
62
+ // isn't supported.
63
+ CZMQ_EXPORT int
64
+ zsocket_disconnect (void *self, const char *format, ...);
65
+
66
+ // Poll for input events on the socket. Returns TRUE if there is input
67
+ // ready on the socket, else FALSE.
68
+ CZMQ_EXPORT bool
69
+ zsocket_poll (void *self, int msecs);
70
+
71
+ // Returns socket type as printable constant string
72
+ CZMQ_EXPORT const char *
73
+ zsocket_type_str (void *self);
74
+
75
+ // Send data over a socket as a single message frame.
76
+ // Accepts these flags: ZFRAME_MORE and ZFRAME_DONTWAIT.
77
+ // Returns -1 on error, 0 on success
78
+ CZMQ_EXPORT int
79
+ zsocket_sendmem (void *self, const void *data, size_t size, int flags);
80
+
81
+ // Send a signal over a socket. A signal is a zero-byte message.
82
+ // Signals are used primarily between threads, over pipe sockets.
83
+ // Returns -1 if there was an error sending the signal.
84
+ CZMQ_EXPORT int
85
+ zsocket_signal (void *self);
86
+
87
+ // Wait on a signal. Use this to coordinate between threads, over
88
+ // pipe pairs. Returns -1 on error, 0 on success.
89
+ CZMQ_EXPORT int
90
+ zsocket_wait (void *self);
91
+
92
+ // Self test of this class
93
+ CZMQ_EXPORT void
94
+ zsocket_test (bool verbose);
95
+ // @end
96
+
97
+ // Compiler hints
98
+ CZMQ_EXPORT int zsocket_bind (void *self, const char *format, ...) CHECK_PRINTF (2);
99
+ CZMQ_EXPORT int zsocket_unbind (void *self, const char *format, ...) CHECK_PRINTF (2);
100
+ CZMQ_EXPORT int zsocket_connect (void *self, const char *format, ...) CHECK_PRINTF (2);
101
+ CZMQ_EXPORT int zsocket_disconnect (void *self, const char *format, ...) CHECK_PRINTF (2);
102
+
103
+ // Emulation of widely-used 2.x socket options
104
+ CZMQ_EXPORT void zsocket_set_hwm (void *self, int hwm);
105
+
106
+ #ifdef __cplusplus
107
+ }
108
+ #endif
109
+
110
+ #endif
@@ -0,0 +1,256 @@
1
+ /* =========================================================================
2
+ zsockopt - get/set 0MQ socket options (deprecated)
3
+
4
+ ****************************************************
5
+ * GENERATED SOURCE CODE, DO NOT EDIT!! *
6
+ * TO CHANGE THIS, EDIT src/zsockopt.gsl *
7
+ * AND RUN `gsl sockopts` in src/. *
8
+ ****************************************************
9
+
10
+ Copyright (c) the Contributors as noted in the AUTHORS file.
11
+ This file is part of CZMQ, the high-level C binding for 0MQ:
12
+ http://czmq.zeromq.org.
13
+
14
+ This Source Code Form is subject to the terms of the Mozilla Public
15
+ License, v. 2.0. If a copy of the MPL was not distributed with this
16
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
17
+ =========================================================================
18
+ */
19
+
20
+ #ifndef __ZSOCKOPT_H_INCLUDED__
21
+ #define __ZSOCKOPT_H_INCLUDED__
22
+
23
+ #ifdef __cplusplus
24
+ extern "C" {
25
+ #endif
26
+
27
+ // @interface
28
+ #if (ZMQ_VERSION_MAJOR == 4)
29
+ // Get socket options
30
+ CZMQ_EXPORT int zsocket_heartbeat_ivl (void *zocket);
31
+ CZMQ_EXPORT int zsocket_heartbeat_ttl (void *zocket);
32
+ CZMQ_EXPORT int zsocket_heartbeat_timeout (void *zocket);
33
+ CZMQ_EXPORT int zsocket_use_fd (void *zocket);
34
+ CZMQ_EXPORT int zsocket_tos (void *zocket);
35
+ CZMQ_EXPORT char * zsocket_zap_domain (void *zocket);
36
+ CZMQ_EXPORT int zsocket_mechanism (void *zocket);
37
+ CZMQ_EXPORT int zsocket_plain_server (void *zocket);
38
+ CZMQ_EXPORT char * zsocket_plain_username (void *zocket);
39
+ CZMQ_EXPORT char * zsocket_plain_password (void *zocket);
40
+ CZMQ_EXPORT int zsocket_curve_server (void *zocket);
41
+ CZMQ_EXPORT char * zsocket_curve_publickey (void *zocket);
42
+ CZMQ_EXPORT char * zsocket_curve_secretkey (void *zocket);
43
+ CZMQ_EXPORT char * zsocket_curve_serverkey (void *zocket);
44
+ CZMQ_EXPORT int zsocket_gssapi_server (void *zocket);
45
+ CZMQ_EXPORT int zsocket_gssapi_plaintext (void *zocket);
46
+ CZMQ_EXPORT char * zsocket_gssapi_principal (void *zocket);
47
+ CZMQ_EXPORT char * zsocket_gssapi_service_principal (void *zocket);
48
+ CZMQ_EXPORT int zsocket_ipv6 (void *zocket);
49
+ CZMQ_EXPORT int zsocket_immediate (void *zocket);
50
+ CZMQ_EXPORT int zsocket_ipv4only (void *zocket);
51
+ CZMQ_EXPORT int zsocket_type (void *zocket);
52
+ CZMQ_EXPORT int zsocket_sndhwm (void *zocket);
53
+ CZMQ_EXPORT int zsocket_rcvhwm (void *zocket);
54
+ CZMQ_EXPORT int zsocket_affinity (void *zocket);
55
+ CZMQ_EXPORT char * zsocket_identity (void *zocket);
56
+ CZMQ_EXPORT int zsocket_rate (void *zocket);
57
+ CZMQ_EXPORT int zsocket_recovery_ivl (void *zocket);
58
+ CZMQ_EXPORT int zsocket_sndbuf (void *zocket);
59
+ CZMQ_EXPORT int zsocket_rcvbuf (void *zocket);
60
+ CZMQ_EXPORT int zsocket_linger (void *zocket);
61
+ CZMQ_EXPORT int zsocket_reconnect_ivl (void *zocket);
62
+ CZMQ_EXPORT int zsocket_reconnect_ivl_max (void *zocket);
63
+ CZMQ_EXPORT int zsocket_backlog (void *zocket);
64
+ CZMQ_EXPORT int zsocket_maxmsgsize (void *zocket);
65
+ CZMQ_EXPORT int zsocket_multicast_hops (void *zocket);
66
+ CZMQ_EXPORT int zsocket_rcvtimeo (void *zocket);
67
+ CZMQ_EXPORT int zsocket_sndtimeo (void *zocket);
68
+ CZMQ_EXPORT int zsocket_tcp_keepalive (void *zocket);
69
+ CZMQ_EXPORT int zsocket_tcp_keepalive_idle (void *zocket);
70
+ CZMQ_EXPORT int zsocket_tcp_keepalive_cnt (void *zocket);
71
+ CZMQ_EXPORT int zsocket_tcp_keepalive_intvl (void *zocket);
72
+ CZMQ_EXPORT char * zsocket_tcp_accept_filter (void *zocket);
73
+ CZMQ_EXPORT int zsocket_rcvmore (void *zocket);
74
+ CZMQ_EXPORT SOCKET zsocket_fd (void *zocket);
75
+ CZMQ_EXPORT int zsocket_events (void *zocket);
76
+ CZMQ_EXPORT char * zsocket_last_endpoint (void *zocket);
77
+
78
+ // Set socket options
79
+ CZMQ_EXPORT void zsocket_set_heartbeat_ivl (void *zocket, int heartbeat_ivl);
80
+ CZMQ_EXPORT void zsocket_set_heartbeat_ttl (void *zocket, int heartbeat_ttl);
81
+ CZMQ_EXPORT void zsocket_set_heartbeat_timeout (void *zocket, int heartbeat_timeout);
82
+ CZMQ_EXPORT void zsocket_set_use_fd (void *zocket, int use_fd);
83
+ CZMQ_EXPORT void zsocket_set_tos (void *zocket, int tos);
84
+ CZMQ_EXPORT void zsocket_set_router_handover (void *zocket, int router_handover);
85
+ CZMQ_EXPORT void zsocket_set_router_mandatory (void *zocket, int router_mandatory);
86
+ CZMQ_EXPORT void zsocket_set_probe_router (void *zocket, int probe_router);
87
+ CZMQ_EXPORT void zsocket_set_req_relaxed (void *zocket, int req_relaxed);
88
+ CZMQ_EXPORT void zsocket_set_req_correlate (void *zocket, int req_correlate);
89
+ CZMQ_EXPORT void zsocket_set_conflate (void *zocket, int conflate);
90
+ CZMQ_EXPORT void zsocket_set_zap_domain (void *zocket, const char * zap_domain);
91
+ CZMQ_EXPORT void zsocket_set_plain_server (void *zocket, int plain_server);
92
+ CZMQ_EXPORT void zsocket_set_plain_username (void *zocket, const char * plain_username);
93
+ CZMQ_EXPORT void zsocket_set_plain_password (void *zocket, const char * plain_password);
94
+ CZMQ_EXPORT void zsocket_set_curve_server (void *zocket, int curve_server);
95
+ CZMQ_EXPORT void zsocket_set_curve_publickey (void *zocket, const char * curve_publickey);
96
+ CZMQ_EXPORT void zsocket_set_curve_publickey_bin (void *zocket, const byte *curve_publickey);
97
+ CZMQ_EXPORT void zsocket_set_curve_secretkey (void *zocket, const char * curve_secretkey);
98
+ CZMQ_EXPORT void zsocket_set_curve_secretkey_bin (void *zocket, const byte *curve_secretkey);
99
+ CZMQ_EXPORT void zsocket_set_curve_serverkey (void *zocket, const char * curve_serverkey);
100
+ CZMQ_EXPORT void zsocket_set_curve_serverkey_bin (void *zocket, const byte *curve_serverkey);
101
+ CZMQ_EXPORT void zsocket_set_gssapi_server (void *zocket, int gssapi_server);
102
+ CZMQ_EXPORT void zsocket_set_gssapi_plaintext (void *zocket, int gssapi_plaintext);
103
+ CZMQ_EXPORT void zsocket_set_gssapi_principal (void *zocket, const char * gssapi_principal);
104
+ CZMQ_EXPORT void zsocket_set_gssapi_service_principal (void *zocket, const char * gssapi_service_principal);
105
+ CZMQ_EXPORT void zsocket_set_ipv6 (void *zocket, int ipv6);
106
+ CZMQ_EXPORT void zsocket_set_immediate (void *zocket, int immediate);
107
+ CZMQ_EXPORT void zsocket_set_router_raw (void *zocket, int router_raw);
108
+ CZMQ_EXPORT void zsocket_set_ipv4only (void *zocket, int ipv4only);
109
+ CZMQ_EXPORT void zsocket_set_delay_attach_on_connect (void *zocket, int delay_attach_on_connect);
110
+ CZMQ_EXPORT void zsocket_set_sndhwm (void *zocket, int sndhwm);
111
+ CZMQ_EXPORT void zsocket_set_rcvhwm (void *zocket, int rcvhwm);
112
+ CZMQ_EXPORT void zsocket_set_affinity (void *zocket, int affinity);
113
+ CZMQ_EXPORT void zsocket_set_subscribe (void *zocket, const char * subscribe);
114
+ CZMQ_EXPORT void zsocket_set_unsubscribe (void *zocket, const char * unsubscribe);
115
+ CZMQ_EXPORT void zsocket_set_identity (void *zocket, const char * identity);
116
+ CZMQ_EXPORT void zsocket_set_rate (void *zocket, int rate);
117
+ CZMQ_EXPORT void zsocket_set_recovery_ivl (void *zocket, int recovery_ivl);
118
+ CZMQ_EXPORT void zsocket_set_sndbuf (void *zocket, int sndbuf);
119
+ CZMQ_EXPORT void zsocket_set_rcvbuf (void *zocket, int rcvbuf);
120
+ CZMQ_EXPORT void zsocket_set_linger (void *zocket, int linger);
121
+ CZMQ_EXPORT void zsocket_set_reconnect_ivl (void *zocket, int reconnect_ivl);
122
+ CZMQ_EXPORT void zsocket_set_reconnect_ivl_max (void *zocket, int reconnect_ivl_max);
123
+ CZMQ_EXPORT void zsocket_set_backlog (void *zocket, int backlog);
124
+ CZMQ_EXPORT void zsocket_set_maxmsgsize (void *zocket, int maxmsgsize);
125
+ CZMQ_EXPORT void zsocket_set_multicast_hops (void *zocket, int multicast_hops);
126
+ CZMQ_EXPORT void zsocket_set_rcvtimeo (void *zocket, int rcvtimeo);
127
+ CZMQ_EXPORT void zsocket_set_sndtimeo (void *zocket, int sndtimeo);
128
+ CZMQ_EXPORT void zsocket_set_xpub_verbose (void *zocket, int xpub_verbose);
129
+ CZMQ_EXPORT void zsocket_set_tcp_keepalive (void *zocket, int tcp_keepalive);
130
+ CZMQ_EXPORT void zsocket_set_tcp_keepalive_idle (void *zocket, int tcp_keepalive_idle);
131
+ CZMQ_EXPORT void zsocket_set_tcp_keepalive_cnt (void *zocket, int tcp_keepalive_cnt);
132
+ CZMQ_EXPORT void zsocket_set_tcp_keepalive_intvl (void *zocket, int tcp_keepalive_intvl);
133
+ CZMQ_EXPORT void zsocket_set_tcp_accept_filter (void *zocket, const char * tcp_accept_filter);
134
+ #endif
135
+
136
+ #if (ZMQ_VERSION_MAJOR == 3)
137
+ // Get socket options
138
+ CZMQ_EXPORT int zsocket_ipv4only (void *zocket);
139
+ CZMQ_EXPORT int zsocket_type (void *zocket);
140
+ CZMQ_EXPORT int zsocket_sndhwm (void *zocket);
141
+ CZMQ_EXPORT int zsocket_rcvhwm (void *zocket);
142
+ CZMQ_EXPORT int zsocket_affinity (void *zocket);
143
+ CZMQ_EXPORT char * zsocket_identity (void *zocket);
144
+ CZMQ_EXPORT int zsocket_rate (void *zocket);
145
+ CZMQ_EXPORT int zsocket_recovery_ivl (void *zocket);
146
+ CZMQ_EXPORT int zsocket_sndbuf (void *zocket);
147
+ CZMQ_EXPORT int zsocket_rcvbuf (void *zocket);
148
+ CZMQ_EXPORT int zsocket_linger (void *zocket);
149
+ CZMQ_EXPORT int zsocket_reconnect_ivl (void *zocket);
150
+ CZMQ_EXPORT int zsocket_reconnect_ivl_max (void *zocket);
151
+ CZMQ_EXPORT int zsocket_backlog (void *zocket);
152
+ CZMQ_EXPORT int zsocket_maxmsgsize (void *zocket);
153
+ CZMQ_EXPORT int zsocket_multicast_hops (void *zocket);
154
+ CZMQ_EXPORT int zsocket_rcvtimeo (void *zocket);
155
+ CZMQ_EXPORT int zsocket_sndtimeo (void *zocket);
156
+ CZMQ_EXPORT int zsocket_tcp_keepalive (void *zocket);
157
+ CZMQ_EXPORT int zsocket_tcp_keepalive_idle (void *zocket);
158
+ CZMQ_EXPORT int zsocket_tcp_keepalive_cnt (void *zocket);
159
+ CZMQ_EXPORT int zsocket_tcp_keepalive_intvl (void *zocket);
160
+ CZMQ_EXPORT char * zsocket_tcp_accept_filter (void *zocket);
161
+ CZMQ_EXPORT int zsocket_rcvmore (void *zocket);
162
+ CZMQ_EXPORT SOCKET zsocket_fd (void *zocket);
163
+ CZMQ_EXPORT int zsocket_events (void *zocket);
164
+ CZMQ_EXPORT char * zsocket_last_endpoint (void *zocket);
165
+
166
+ // Set socket options
167
+ CZMQ_EXPORT void zsocket_set_router_raw (void *zocket, int router_raw);
168
+ CZMQ_EXPORT void zsocket_set_ipv4only (void *zocket, int ipv4only);
169
+ CZMQ_EXPORT void zsocket_set_delay_attach_on_connect (void *zocket, int delay_attach_on_connect);
170
+ CZMQ_EXPORT void zsocket_set_sndhwm (void *zocket, int sndhwm);
171
+ CZMQ_EXPORT void zsocket_set_rcvhwm (void *zocket, int rcvhwm);
172
+ CZMQ_EXPORT void zsocket_set_affinity (void *zocket, int affinity);
173
+ CZMQ_EXPORT void zsocket_set_subscribe (void *zocket, const char * subscribe);
174
+ CZMQ_EXPORT void zsocket_set_unsubscribe (void *zocket, const char * unsubscribe);
175
+ CZMQ_EXPORT void zsocket_set_identity (void *zocket, const char * identity);
176
+ CZMQ_EXPORT void zsocket_set_rate (void *zocket, int rate);
177
+ CZMQ_EXPORT void zsocket_set_recovery_ivl (void *zocket, int recovery_ivl);
178
+ CZMQ_EXPORT void zsocket_set_sndbuf (void *zocket, int sndbuf);
179
+ CZMQ_EXPORT void zsocket_set_rcvbuf (void *zocket, int rcvbuf);
180
+ CZMQ_EXPORT void zsocket_set_linger (void *zocket, int linger);
181
+ CZMQ_EXPORT void zsocket_set_reconnect_ivl (void *zocket, int reconnect_ivl);
182
+ CZMQ_EXPORT void zsocket_set_reconnect_ivl_max (void *zocket, int reconnect_ivl_max);
183
+ CZMQ_EXPORT void zsocket_set_backlog (void *zocket, int backlog);
184
+ CZMQ_EXPORT void zsocket_set_maxmsgsize (void *zocket, int maxmsgsize);
185
+ CZMQ_EXPORT void zsocket_set_multicast_hops (void *zocket, int multicast_hops);
186
+ CZMQ_EXPORT void zsocket_set_rcvtimeo (void *zocket, int rcvtimeo);
187
+ CZMQ_EXPORT void zsocket_set_sndtimeo (void *zocket, int sndtimeo);
188
+ CZMQ_EXPORT void zsocket_set_xpub_verbose (void *zocket, int xpub_verbose);
189
+ CZMQ_EXPORT void zsocket_set_tcp_keepalive (void *zocket, int tcp_keepalive);
190
+ CZMQ_EXPORT void zsocket_set_tcp_keepalive_idle (void *zocket, int tcp_keepalive_idle);
191
+ CZMQ_EXPORT void zsocket_set_tcp_keepalive_cnt (void *zocket, int tcp_keepalive_cnt);
192
+ CZMQ_EXPORT void zsocket_set_tcp_keepalive_intvl (void *zocket, int tcp_keepalive_intvl);
193
+ CZMQ_EXPORT void zsocket_set_tcp_accept_filter (void *zocket, const char * tcp_accept_filter);
194
+ #endif
195
+
196
+ #if (ZMQ_VERSION_MAJOR == 2)
197
+ // Get socket options
198
+ CZMQ_EXPORT int zsocket_hwm (void *zocket);
199
+ CZMQ_EXPORT int zsocket_swap (void *zocket);
200
+ CZMQ_EXPORT int zsocket_affinity (void *zocket);
201
+ CZMQ_EXPORT char * zsocket_identity (void *zocket);
202
+ CZMQ_EXPORT int zsocket_rate (void *zocket);
203
+ CZMQ_EXPORT int zsocket_recovery_ivl (void *zocket);
204
+ CZMQ_EXPORT int zsocket_recovery_ivl_msec (void *zocket);
205
+ CZMQ_EXPORT int zsocket_mcast_loop (void *zocket);
206
+ # if (ZMQ_VERSION_MINOR == 2)
207
+ CZMQ_EXPORT int zsocket_rcvtimeo (void *zocket);
208
+ # endif
209
+ # if (ZMQ_VERSION_MINOR == 2)
210
+ CZMQ_EXPORT int zsocket_sndtimeo (void *zocket);
211
+ # endif
212
+ CZMQ_EXPORT int zsocket_sndbuf (void *zocket);
213
+ CZMQ_EXPORT int zsocket_rcvbuf (void *zocket);
214
+ CZMQ_EXPORT int zsocket_linger (void *zocket);
215
+ CZMQ_EXPORT int zsocket_reconnect_ivl (void *zocket);
216
+ CZMQ_EXPORT int zsocket_reconnect_ivl_max (void *zocket);
217
+ CZMQ_EXPORT int zsocket_backlog (void *zocket);
218
+ CZMQ_EXPORT int zsocket_type (void *zocket);
219
+ CZMQ_EXPORT int zsocket_rcvmore (void *zocket);
220
+ CZMQ_EXPORT SOCKET zsocket_fd (void *zocket);
221
+ CZMQ_EXPORT int zsocket_events (void *zocket);
222
+
223
+ // Set socket options
224
+ CZMQ_EXPORT void zsocket_set_hwm (void *zocket, int hwm);
225
+ CZMQ_EXPORT void zsocket_set_swap (void *zocket, int swap);
226
+ CZMQ_EXPORT void zsocket_set_affinity (void *zocket, int affinity);
227
+ CZMQ_EXPORT void zsocket_set_identity (void *zocket, const char * identity);
228
+ CZMQ_EXPORT void zsocket_set_rate (void *zocket, int rate);
229
+ CZMQ_EXPORT void zsocket_set_recovery_ivl (void *zocket, int recovery_ivl);
230
+ CZMQ_EXPORT void zsocket_set_recovery_ivl_msec (void *zocket, int recovery_ivl_msec);
231
+ CZMQ_EXPORT void zsocket_set_mcast_loop (void *zocket, int mcast_loop);
232
+ # if (ZMQ_VERSION_MINOR == 2)
233
+ CZMQ_EXPORT void zsocket_set_rcvtimeo (void *zocket, int rcvtimeo);
234
+ # endif
235
+ # if (ZMQ_VERSION_MINOR == 2)
236
+ CZMQ_EXPORT void zsocket_set_sndtimeo (void *zocket, int sndtimeo);
237
+ # endif
238
+ CZMQ_EXPORT void zsocket_set_sndbuf (void *zocket, int sndbuf);
239
+ CZMQ_EXPORT void zsocket_set_rcvbuf (void *zocket, int rcvbuf);
240
+ CZMQ_EXPORT void zsocket_set_linger (void *zocket, int linger);
241
+ CZMQ_EXPORT void zsocket_set_reconnect_ivl (void *zocket, int reconnect_ivl);
242
+ CZMQ_EXPORT void zsocket_set_reconnect_ivl_max (void *zocket, int reconnect_ivl_max);
243
+ CZMQ_EXPORT void zsocket_set_backlog (void *zocket, int backlog);
244
+ CZMQ_EXPORT void zsocket_set_subscribe (void *zocket, const char * subscribe);
245
+ CZMQ_EXPORT void zsocket_set_unsubscribe (void *zocket, const char * unsubscribe);
246
+ #endif
247
+
248
+ // Self test of this class
249
+ CZMQ_EXPORT void zsockopt_test (bool verbose);
250
+ // @end
251
+
252
+ #ifdef __cplusplus
253
+ }
254
+ #endif
255
+
256
+ #endif
@@ -0,0 +1,110 @@
1
+ /* =========================================================================
2
+ zstr - sending and receiving strings
3
+
4
+ Copyright (c) the Contributors as noted in the AUTHORS file.
5
+ This file is part of CZMQ, the high-level C binding for 0MQ:
6
+ http://czmq.zeromq.org.
7
+
8
+ This Source Code Form is subject to the terms of the Mozilla Public
9
+ License, v. 2.0. If a copy of the MPL was not distributed with this
10
+ file, You can obtain one at http://mozilla.org/MPL/2.0/.
11
+ =========================================================================
12
+ */
13
+
14
+ #ifndef __ZSTR_H_INCLUDED__
15
+ #define __ZSTR_H_INCLUDED__
16
+
17
+ #ifdef __cplusplus
18
+ extern "C" {
19
+ #endif
20
+
21
+ // @warning THE FOLLOWING @INTERFACE BLOCK IS AUTO-GENERATED BY ZPROJECT
22
+ // @warning Please edit the model at "api/zstr.api" to make changes.
23
+ // @interface
24
+ // This is a stable class, and may not change except for emergencies. It
25
+ // is provided in stable builds.
26
+ // This class has draft methods, which may change over time. They are not
27
+ // in stable releases, by default. Use --enable-drafts to enable.
28
+ // Receive C string from socket. Caller must free returned string using
29
+ // zstr_free(). Returns NULL if the context is being terminated or the
30
+ // process was interrupted.
31
+ // Caller owns return value and must destroy it when done.
32
+ CZMQ_EXPORT char *
33
+ zstr_recv (void *source);
34
+
35
+ // Receive a series of strings (until NULL) from multipart data.
36
+ // Each string is allocated and filled with string data; if there
37
+ // are not enough frames, unallocated strings are set to NULL.
38
+ // Returns -1 if the message could not be read, else returns the
39
+ // number of strings filled, zero or more. Free each returned string
40
+ // using zstr_free(). If not enough strings are provided, remaining
41
+ // multipart frames in the message are dropped.
42
+ CZMQ_EXPORT int
43
+ zstr_recvx (void *source, char **string_p, ...);
44
+
45
+ // Send a C string to a socket, as a frame. The string is sent without
46
+ // trailing null byte; to read this you can use zstr_recv, or a similar
47
+ // method that adds a null terminator on the received string. String
48
+ // may be NULL, which is sent as "".
49
+ CZMQ_EXPORT int
50
+ zstr_send (void *dest, const char *string);
51
+
52
+ // Send a C string to a socket, as zstr_send(), with a MORE flag, so that
53
+ // you can send further strings in the same multi-part message.
54
+ CZMQ_EXPORT int
55
+ zstr_sendm (void *dest, const char *string);
56
+
57
+ // Send a formatted string to a socket. Note that you should NOT use
58
+ // user-supplied strings in the format (they may contain '%' which
59
+ // will create security holes).
60
+ CZMQ_EXPORT int
61
+ zstr_sendf (void *dest, const char *format, ...) CHECK_PRINTF (2);
62
+
63
+ // Send a formatted string to a socket, as for zstr_sendf(), with a
64
+ // MORE flag, so that you can send further strings in the same multi-part
65
+ // message.
66
+ CZMQ_EXPORT int
67
+ zstr_sendfm (void *dest, const char *format, ...) CHECK_PRINTF (2);
68
+
69
+ // Send a series of strings (until NULL) as multipart data
70
+ // Returns 0 if the strings could be sent OK, or -1 on error.
71
+ CZMQ_EXPORT int
72
+ zstr_sendx (void *dest, const char *string, ...);
73
+
74
+ // Free a provided string, and nullify the parent pointer. Safe to call on
75
+ // a null pointer.
76
+ CZMQ_EXPORT void
77
+ zstr_free (char **string_p);
78
+
79
+ // Self test of this class.
80
+ CZMQ_EXPORT void
81
+ zstr_test (bool verbose);
82
+
83
+ #ifdef CZMQ_BUILD_DRAFT_API
84
+ // *** Draft method, for development use, may change without warning ***
85
+ // Accepts a void pointer and returns a fresh character string. If source
86
+ // is null, returns an empty string.
87
+ // Caller owns return value and must destroy it when done.
88
+ CZMQ_EXPORT char *
89
+ zstr_str (void *source);
90
+
91
+ #endif // CZMQ_BUILD_DRAFT_API
92
+ // @end
93
+
94
+
95
+ // DEPRECATED as poor style -- callers should use zloop or zpoller
96
+ // Receive C string from socket, if socket had input ready. Caller must
97
+ // free returned string using zstr_free. Returns NULL if there was no input
98
+ // waiting, or if the context was terminated. Use zctx_interrupted to exit
99
+ // any loop that relies on this method.
100
+ CZMQ_EXPORT char *
101
+ zstr_recv_nowait (void *source);
102
+
103
+ // Compiler hints
104
+ CZMQ_EXPORT int zstr_sendf (void *dest, const char *format, ...) CHECK_PRINTF (2);
105
+
106
+ #ifdef __cplusplus
107
+ }
108
+ #endif
109
+
110
+ #endif