czmq-ffi-gen 0.9.1-x86-mingw32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,48 @@
1
+ /*
2
+ Copyright (c) 2007-2016 Contributors as noted in the AUTHORS file
3
+
4
+ This file is part of libzmq, the ZeroMQ core engine in C++.
5
+
6
+ libzmq is free software; you can redistribute it and/or modify it under
7
+ the terms of the GNU Lesser General Public License (LGPL) as published
8
+ by the Free Software Foundation; either version 3 of the License, or
9
+ (at your option) any later version.
10
+
11
+ As a special exception, the Contributors give you permission to link
12
+ this library with independent modules to produce an executable,
13
+ regardless of the license terms of these independent modules, and to
14
+ copy and distribute the resulting executable under terms of your choice,
15
+ provided that you also meet, for each linked independent module, the
16
+ terms and conditions of the license of that module. An independent
17
+ module is a module which is not derived from or based on this library.
18
+ If you modify this library, you must extend this exception to your
19
+ version of the library.
20
+
21
+ libzmq is distributed in the hope that it will be useful, but WITHOUT
22
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
23
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
24
+ License for more details.
25
+
26
+ You should have received a copy of the GNU Lesser General Public License
27
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
28
+ */
29
+
30
+ /* This file is deprecated, and all its functionality provided by zmq.h */
31
+ /* Note that -Wpedantic compilation requires GCC to avoid using its custom
32
+ extensions such as #warning, hence the trick below. Also, pragmas for
33
+ warnings or other messages are not standard, not portable, and not all
34
+ compilers even have an equivalent concept.
35
+ So in the worst case, this include file is treated as silently empty. */
36
+
37
+ #if defined(__clang__) || defined(__GNUC__) || defined(__GNUG__) || defined(_MSC_VER)
38
+ #if defined(__GNUC__) || defined(__GNUG__)
39
+ #pragma GCC diagnostic push
40
+ #pragma GCC diagnostic warning "-Wcpp"
41
+ #pragma GCC diagnostic ignored "-Werror"
42
+ #pragma GCC diagnostic ignored "-Wall"
43
+ #endif
44
+ #pragma message("Warning: zmq_utils.h is deprecated. All its functionality is provided by zmq.h.")
45
+ #if defined(__GNUC__) || defined(__GNUG__)
46
+ #pragma GCC diagnostic pop
47
+ #endif
48
+ #endif
@@ -0,0 +1,280 @@
1
+ /* =========================================================================
2
+ zmsg - working with multipart messages
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 __ZMSG_H_INCLUDED__
15
+ #define __ZMSG_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/zmsg.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
+ // Create a new empty message object
29
+ CZMQ_EXPORT zmsg_t *
30
+ zmsg_new (void);
31
+
32
+ // Receive message from socket, returns zmsg_t object or NULL if the recv
33
+ // was interrupted. Does a blocking recv. If you want to not block then use
34
+ // the zloop class or zmsg_recv_nowait or zmq_poll to check for socket input
35
+ // before receiving.
36
+ CZMQ_EXPORT zmsg_t *
37
+ zmsg_recv (void *source);
38
+
39
+ // Load/append an open file into new message, return the message.
40
+ // Returns NULL if the message could not be loaded.
41
+ CZMQ_EXPORT zmsg_t *
42
+ zmsg_load (FILE *file);
43
+
44
+ // Decodes a serialized message frame created by zmsg_encode () and returns
45
+ // a new zmsg_t object. Returns NULL if the frame was badly formatted or
46
+ // there was insufficient memory to work.
47
+ CZMQ_EXPORT zmsg_t *
48
+ zmsg_decode (zframe_t *frame);
49
+
50
+ // Generate a signal message encoding the given status. A signal is a short
51
+ // message carrying a 1-byte success/failure code (by convention, 0 means
52
+ // OK). Signals are encoded to be distinguishable from "normal" messages.
53
+ CZMQ_EXPORT zmsg_t *
54
+ zmsg_new_signal (byte status);
55
+
56
+ // Destroy a message object and all frames it contains
57
+ CZMQ_EXPORT void
58
+ zmsg_destroy (zmsg_t **self_p);
59
+
60
+ // Send message to destination socket, and destroy the message after sending
61
+ // it successfully. If the message has no frames, sends nothing but destroys
62
+ // the message anyhow. Nullifies the caller's reference to the message (as
63
+ // it is a destructor).
64
+ CZMQ_EXPORT int
65
+ zmsg_send (zmsg_t **self_p, void *dest);
66
+
67
+ // Send message to destination socket as part of a multipart sequence, and
68
+ // destroy the message after sending it successfully. Note that after a
69
+ // zmsg_sendm, you must call zmsg_send or another method that sends a final
70
+ // message part. If the message has no frames, sends nothing but destroys
71
+ // the message anyhow. Nullifies the caller's reference to the message (as
72
+ // it is a destructor).
73
+ CZMQ_EXPORT int
74
+ zmsg_sendm (zmsg_t **self_p, void *dest);
75
+
76
+ // Return size of message, i.e. number of frames (0 or more).
77
+ CZMQ_EXPORT size_t
78
+ zmsg_size (zmsg_t *self);
79
+
80
+ // Return total size of all frames in message.
81
+ CZMQ_EXPORT size_t
82
+ zmsg_content_size (zmsg_t *self);
83
+
84
+ // Push frame to the front of the message, i.e. before all other frames.
85
+ // Message takes ownership of frame, will destroy it when message is sent.
86
+ // Returns 0 on success, -1 on error. Deprecates zmsg_push, which did not
87
+ // nullify the caller's frame reference.
88
+ CZMQ_EXPORT int
89
+ zmsg_prepend (zmsg_t *self, zframe_t **frame_p);
90
+
91
+ // Add frame to the end of the message, i.e. after all other frames.
92
+ // Message takes ownership of frame, will destroy it when message is sent.
93
+ // Returns 0 on success. Deprecates zmsg_add, which did not nullify the
94
+ // caller's frame reference.
95
+ CZMQ_EXPORT int
96
+ zmsg_append (zmsg_t *self, zframe_t **frame_p);
97
+
98
+ // Remove first frame from message, if any. Returns frame, or NULL.
99
+ // Caller owns return value and must destroy it when done.
100
+ CZMQ_EXPORT zframe_t *
101
+ zmsg_pop (zmsg_t *self);
102
+
103
+ // Push block of memory to front of message, as a new frame.
104
+ // Returns 0 on success, -1 on error.
105
+ CZMQ_EXPORT int
106
+ zmsg_pushmem (zmsg_t *self, const void *data, size_t size);
107
+
108
+ // Add block of memory to the end of the message, as a new frame.
109
+ // Returns 0 on success, -1 on error.
110
+ CZMQ_EXPORT int
111
+ zmsg_addmem (zmsg_t *self, const void *data, size_t size);
112
+
113
+ // Push string as new frame to front of message.
114
+ // Returns 0 on success, -1 on error.
115
+ CZMQ_EXPORT int
116
+ zmsg_pushstr (zmsg_t *self, const char *string);
117
+
118
+ // Push string as new frame to end of message.
119
+ // Returns 0 on success, -1 on error.
120
+ CZMQ_EXPORT int
121
+ zmsg_addstr (zmsg_t *self, const char *string);
122
+
123
+ // Push formatted string as new frame to front of message.
124
+ // Returns 0 on success, -1 on error.
125
+ CZMQ_EXPORT int
126
+ zmsg_pushstrf (zmsg_t *self, const char *format, ...) CHECK_PRINTF (2);
127
+
128
+ // Push formatted string as new frame to end of message.
129
+ // Returns 0 on success, -1 on error.
130
+ CZMQ_EXPORT int
131
+ zmsg_addstrf (zmsg_t *self, const char *format, ...) CHECK_PRINTF (2);
132
+
133
+ // Pop frame off front of message, return as fresh string. If there were
134
+ // no more frames in the message, returns NULL.
135
+ // Caller owns return value and must destroy it when done.
136
+ CZMQ_EXPORT char *
137
+ zmsg_popstr (zmsg_t *self);
138
+
139
+ // Push encoded message as a new frame. Message takes ownership of
140
+ // submessage, so the original is destroyed in this call. Returns 0 on
141
+ // success, -1 on error.
142
+ CZMQ_EXPORT int
143
+ zmsg_addmsg (zmsg_t *self, zmsg_t **msg_p);
144
+
145
+ // Remove first submessage from message, if any. Returns zmsg_t, or NULL if
146
+ // decoding was not successful.
147
+ // Caller owns return value and must destroy it when done.
148
+ CZMQ_EXPORT zmsg_t *
149
+ zmsg_popmsg (zmsg_t *self);
150
+
151
+ // Remove specified frame from list, if present. Does not destroy frame.
152
+ CZMQ_EXPORT void
153
+ zmsg_remove (zmsg_t *self, zframe_t *frame);
154
+
155
+ // Set cursor to first frame in message. Returns frame, or NULL, if the
156
+ // message is empty. Use this to navigate the frames as a list.
157
+ CZMQ_EXPORT zframe_t *
158
+ zmsg_first (zmsg_t *self);
159
+
160
+ // Return the next frame. If there are no more frames, returns NULL. To move
161
+ // to the first frame call zmsg_first(). Advances the cursor.
162
+ CZMQ_EXPORT zframe_t *
163
+ zmsg_next (zmsg_t *self);
164
+
165
+ // Return the last frame. If there are no frames, returns NULL.
166
+ CZMQ_EXPORT zframe_t *
167
+ zmsg_last (zmsg_t *self);
168
+
169
+ // Save message to an open file, return 0 if OK, else -1. The message is
170
+ // saved as a series of frames, each with length and data. Note that the
171
+ // file is NOT guaranteed to be portable between operating systems, not
172
+ // versions of CZMQ. The file format is at present undocumented and liable
173
+ // to arbitrary change.
174
+ CZMQ_EXPORT int
175
+ zmsg_save (zmsg_t *self, FILE *file);
176
+
177
+ // Serialize multipart message to a single message frame. Use this method
178
+ // to send structured messages across transports that do not support
179
+ // multipart data. Allocates and returns a new frame containing the
180
+ // serialized message. To decode a serialized message frame, use
181
+ // zmsg_decode ().
182
+ // Caller owns return value and must destroy it when done.
183
+ CZMQ_EXPORT zframe_t *
184
+ zmsg_encode (zmsg_t *self);
185
+
186
+ // Create copy of message, as new message object. Returns a fresh zmsg_t
187
+ // object. If message is null, or memory was exhausted, returns null.
188
+ // Caller owns return value and must destroy it when done.
189
+ CZMQ_EXPORT zmsg_t *
190
+ zmsg_dup (zmsg_t *self);
191
+
192
+ // Send message to zsys log sink (may be stdout, or system facility as
193
+ // configured by zsys_set_logstream).
194
+ CZMQ_EXPORT void
195
+ zmsg_print (zmsg_t *self);
196
+
197
+ // Return true if the two messages have the same number of frames and each
198
+ // frame in the first message is identical to the corresponding frame in the
199
+ // other message. As with zframe_eq, return false if either message is NULL.
200
+ CZMQ_EXPORT bool
201
+ zmsg_eq (zmsg_t *self, zmsg_t *other);
202
+
203
+ // Return signal value, 0 or greater, if message is a signal, -1 if not.
204
+ CZMQ_EXPORT int
205
+ zmsg_signal (zmsg_t *self);
206
+
207
+ // Probe the supplied object, and report if it looks like a zmsg_t.
208
+ CZMQ_EXPORT bool
209
+ zmsg_is (void *self);
210
+
211
+ // Self test of this class.
212
+ CZMQ_EXPORT void
213
+ zmsg_test (bool verbose);
214
+
215
+ #ifdef CZMQ_BUILD_DRAFT_API
216
+ // *** Draft method, for development use, may change without warning ***
217
+ // Return message routing ID, if the message came from a ZMQ_SERVER socket.
218
+ // Else returns zero.
219
+ CZMQ_EXPORT uint32_t
220
+ zmsg_routing_id (zmsg_t *self);
221
+
222
+ // *** Draft method, for development use, may change without warning ***
223
+ // Set routing ID on message. This is used if/when the message is sent to a
224
+ // ZMQ_SERVER socket.
225
+ CZMQ_EXPORT void
226
+ zmsg_set_routing_id (zmsg_t *self, uint32_t routing_id);
227
+
228
+ #endif // CZMQ_BUILD_DRAFT_API
229
+ // @end
230
+
231
+
232
+ // DEPRECATED as over-engineered, poor style
233
+ // Pop frame off front of message, caller now owns frame
234
+ // If next frame is empty, pops and destroys that empty frame.
235
+ CZMQ_EXPORT zframe_t *
236
+ zmsg_unwrap (zmsg_t *self);
237
+
238
+ // DEPRECATED as poor style -- callers should use zloop or zpoller
239
+ // Receive message from socket, returns zmsg_t object, or NULL either if
240
+ // there was no input waiting, or the recv was interrupted.
241
+ CZMQ_EXPORT zmsg_t *
242
+ zmsg_recv_nowait (void *source);
243
+
244
+ // DEPRECATED as unsafe -- does not nullify frame reference.
245
+ // Push frame plus empty frame to front of message, before first frame.
246
+ // Message takes ownership of frame, will destroy it when message is sent.
247
+ CZMQ_EXPORT void
248
+ zmsg_wrap (zmsg_t *self, zframe_t *frame);
249
+
250
+ // DEPRECATED - will be removed for next + 1 stable release
251
+ // Add frame to the front of the message, i.e. before all other frames.
252
+ // Message takes ownership of frame, will destroy it when message is sent.
253
+ // Returns 0 on success, -1 on error.
254
+ CZMQ_EXPORT int
255
+ zmsg_push (zmsg_t *self, zframe_t *frame);
256
+
257
+ // DEPRECATED - will be removed for next stable release
258
+ CZMQ_EXPORT int
259
+ zmsg_add (zmsg_t *self, zframe_t *frame);
260
+
261
+ // DEPRECATED as inconsistent; breaks principle that logging should all go
262
+ // to a single destination.
263
+ // Print message to open stream
264
+ // Truncates to first 10 frames, for readability.
265
+ CZMQ_EXPORT void
266
+ zmsg_fprint (zmsg_t *self, FILE *file);
267
+
268
+ // Compiler hints
269
+ CZMQ_EXPORT int zmsg_addstrf (zmsg_t *self, const char *format, ...) CHECK_PRINTF (2);
270
+ CZMQ_EXPORT int zmsg_pushstrf (zmsg_t *self, const char *format, ...) CHECK_PRINTF (2);
271
+
272
+ #ifdef __cplusplus
273
+ }
274
+ #endif
275
+
276
+ // Deprecated method aliases
277
+ #define zmsg_dump(s) zmsg_print(s)
278
+ #define zmsg_dump_to_stream(s,F) zmsg_fprint(s,F)
279
+
280
+ #endif
@@ -0,0 +1,55 @@
1
+ /* =========================================================================
2
+ zmutex - working with mutexes
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 __ZMUTEX_H_INCLUDED__
15
+ #define __ZMUTEX_H_INCLUDED__
16
+
17
+ #ifdef __cplusplus
18
+ extern "C" {
19
+ #endif
20
+
21
+ // @interface
22
+ // This is a deprecated class, and will be removed over time. It is
23
+ // provided in stable builds to support old applications. You should
24
+ // stop using this class, and migrate any code that is still using it.
25
+
26
+ // Create a new mutex container
27
+ CZMQ_EXPORT zmutex_t *
28
+ zmutex_new (void);
29
+
30
+ // Destroy a mutex container
31
+ CZMQ_EXPORT void
32
+ zmutex_destroy (zmutex_t **self_p);
33
+
34
+ // Lock mutex
35
+ CZMQ_EXPORT void
36
+ zmutex_lock (zmutex_t *self);
37
+
38
+ // Unlock mutex
39
+ CZMQ_EXPORT void
40
+ zmutex_unlock (zmutex_t *self);
41
+
42
+ // Try to lock mutex
43
+ CZMQ_EXPORT int
44
+ zmutex_try_lock (zmutex_t *self);
45
+
46
+ // Self test of this class.
47
+ CZMQ_EXPORT void
48
+ zmutex_test (bool verbose);
49
+ // @end
50
+
51
+ #ifdef __cplusplus
52
+ }
53
+ #endif
54
+
55
+ #endif
@@ -0,0 +1,92 @@
1
+ /* =========================================================================
2
+ zpoller - trivial socket poller class
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 __zpoller_H_INCLUDED__
15
+ #define __zpoller_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/zpoller.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
+ // Create new poller, specifying zero or more readers. The list of
29
+ // readers ends in a NULL. Each reader can be a zsock_t instance, a
30
+ // zactor_t instance, a libzmq socket (void *), or a file handle.
31
+ CZMQ_EXPORT zpoller_t *
32
+ zpoller_new (void *reader, ...);
33
+
34
+ // Destroy a poller
35
+ CZMQ_EXPORT void
36
+ zpoller_destroy (zpoller_t **self_p);
37
+
38
+ // Add a reader to be polled. Returns 0 if OK, -1 on failure. The reader may
39
+ // be a libzmq void * socket, a zsock_t instance, or a zactor_t instance.
40
+ CZMQ_EXPORT int
41
+ zpoller_add (zpoller_t *self, void *reader);
42
+
43
+ // Remove a reader from the poller; returns 0 if OK, -1 on failure. The reader
44
+ // must have been passed during construction, or in an zpoller_add () call.
45
+ CZMQ_EXPORT int
46
+ zpoller_remove (zpoller_t *self, void *reader);
47
+
48
+ // Poll the registered readers for I/O, return first reader that has input.
49
+ // The reader will be a libzmq void * socket, or a zsock_t or zactor_t
50
+ // instance as specified in zpoller_new/zpoller_add. The timeout should be
51
+ // zero or greater, or -1 to wait indefinitely. Socket priority is defined
52
+ // by their order in the poll list. If you need a balanced poll, use the low
53
+ // level zmq_poll method directly. If the poll call was interrupted (SIGINT),
54
+ // or the ZMQ context was destroyed, or the timeout expired, returns NULL.
55
+ // You can test the actual exit condition by calling zpoller_expired () and
56
+ // zpoller_terminated (). The timeout is in msec.
57
+ CZMQ_EXPORT void *
58
+ zpoller_wait (zpoller_t *self, int timeout);
59
+
60
+ // Return true if the last zpoller_wait () call ended because the timeout
61
+ // expired, without any error.
62
+ CZMQ_EXPORT bool
63
+ zpoller_expired (zpoller_t *self);
64
+
65
+ // Return true if the last zpoller_wait () call ended because the process
66
+ // was interrupted, or the parent context was destroyed.
67
+ CZMQ_EXPORT bool
68
+ zpoller_terminated (zpoller_t *self);
69
+
70
+ // Self test of this class.
71
+ CZMQ_EXPORT void
72
+ zpoller_test (bool verbose);
73
+
74
+ #ifdef CZMQ_BUILD_DRAFT_API
75
+ // *** Draft method, for development use, may change without warning ***
76
+ // By default the poller stops if the process receives a SIGINT or SIGTERM
77
+ // signal. This makes it impossible to shut-down message based architectures
78
+ // like zactors. This method lets you switch off break handling. The default
79
+ // nonstop setting is off (false).
80
+ CZMQ_EXPORT void
81
+ zpoller_set_nonstop (zpoller_t *self, bool nonstop);
82
+
83
+ #endif // CZMQ_BUILD_DRAFT_API
84
+ // @end
85
+
86
+
87
+ #ifdef __cplusplus
88
+ }
89
+ #endif
90
+
91
+ #endif
92
+