czmq-ffi-gen 0.13.0-x64-mingw32 → 0.14.1-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +13 -0
  3. data/lib/czmq-ffi-gen/czmq/ffi.rb +224 -698
  4. data/lib/czmq-ffi-gen/czmq/ffi/zactor.rb +40 -7
  5. data/lib/czmq-ffi-gen/czmq/ffi/zargs.rb +259 -0
  6. data/lib/czmq-ffi-gen/czmq/ffi/zarmour.rb +3 -3
  7. data/lib/czmq-ffi-gen/czmq/ffi/zcert.rb +15 -6
  8. data/lib/czmq-ffi-gen/czmq/ffi/zcertstore.rb +25 -11
  9. data/lib/czmq-ffi-gen/czmq/ffi/zchunk.rb +18 -18
  10. data/lib/czmq-ffi-gen/czmq/ffi/zclock.rb +6 -6
  11. data/lib/czmq-ffi-gen/czmq/ffi/zconfig.rb +27 -17
  12. data/lib/czmq-ffi-gen/czmq/ffi/zdigest.rb +4 -4
  13. data/lib/czmq-ffi-gen/czmq/ffi/zdir.rb +36 -36
  14. data/lib/czmq-ffi-gen/czmq/ffi/zdir_patch.rb +1 -1
  15. data/lib/czmq-ffi-gen/czmq/ffi/zfile.rb +27 -19
  16. data/lib/czmq-ffi-gen/czmq/ffi/zframe.rb +22 -21
  17. data/lib/czmq-ffi-gen/czmq/ffi/zhash.rb +54 -54
  18. data/lib/czmq-ffi-gen/czmq/ffi/zhashx.rb +82 -80
  19. data/lib/czmq-ffi-gen/czmq/ffi/ziflist.rb +30 -0
  20. data/lib/czmq-ffi-gen/czmq/ffi/zlist.rb +30 -30
  21. data/lib/czmq-ffi-gen/czmq/ffi/zlistx.rb +44 -44
  22. data/lib/czmq-ffi-gen/czmq/ffi/zloop.rb +39 -39
  23. data/lib/czmq-ffi-gen/czmq/ffi/zmsg.rb +46 -46
  24. data/lib/czmq-ffi-gen/czmq/ffi/zpoller.rb +16 -16
  25. data/lib/czmq-ffi-gen/czmq/ffi/zproc.rb +237 -34
  26. data/lib/czmq-ffi-gen/czmq/ffi/zsock.rb +1201 -973
  27. data/lib/czmq-ffi-gen/czmq/ffi/zstr.rb +58 -19
  28. data/lib/czmq-ffi-gen/czmq/ffi/zsys.rb +836 -0
  29. data/lib/czmq-ffi-gen/czmq/ffi/ztimerset.rb +6 -6
  30. data/lib/czmq-ffi-gen/czmq/ffi/ztrie.rb +10 -10
  31. data/lib/czmq-ffi-gen/czmq/ffi/zuuid.rb +4 -4
  32. data/lib/czmq-ffi-gen/gem_version.rb +1 -1
  33. data/lib/czmq-ffi-gen/vendor.rb +9 -1
  34. data/vendor/local/bin/inproc_lat.exe +0 -0
  35. data/vendor/local/bin/inproc_thr.exe +0 -0
  36. data/vendor/local/bin/libczmq.dll +0 -0
  37. data/vendor/local/bin/libzmq.dll +0 -0
  38. data/vendor/local/bin/local_lat.exe +0 -0
  39. data/vendor/local/bin/local_thr.exe +0 -0
  40. data/vendor/local/bin/remote_lat.exe +0 -0
  41. data/vendor/local/bin/remote_thr.exe +0 -0
  42. data/vendor/local/bin/zmakecert.exe +0 -0
  43. data/vendor/local/include/czmq_library.h +18 -9
  44. data/vendor/local/include/czmq_prelude.h +104 -16
  45. data/vendor/local/include/zactor.h +25 -7
  46. data/vendor/local/include/zarmour.h +3 -3
  47. data/vendor/local/include/zcert.h +11 -6
  48. data/vendor/local/include/zcertstore.h +18 -9
  49. data/vendor/local/include/zchunk.h +18 -18
  50. data/vendor/local/include/zclock.h +6 -6
  51. data/vendor/local/include/zconfig.h +25 -16
  52. data/vendor/local/include/zdigest.h +4 -4
  53. data/vendor/local/include/zdir.h +36 -36
  54. data/vendor/local/include/zdir_patch.h +1 -1
  55. data/vendor/local/include/zfile.h +27 -19
  56. data/vendor/local/include/zframe.h +22 -21
  57. data/vendor/local/include/zgossip.h +5 -5
  58. data/vendor/local/include/zgossip_engine.inc +103 -22
  59. data/vendor/local/include/zgossip_msg.h +28 -30
  60. data/vendor/local/include/zhash.h +53 -53
  61. data/vendor/local/include/zhashx.h +75 -73
  62. data/vendor/local/include/ziflist.h +22 -1
  63. data/vendor/local/include/zlist.h +28 -28
  64. data/vendor/local/include/zlistx.h +41 -41
  65. data/vendor/local/include/zloop.h +36 -36
  66. data/vendor/local/include/zmsg.h +46 -46
  67. data/vendor/local/include/zpoller.h +16 -16
  68. data/vendor/local/include/zsock.h +414 -364
  69. data/vendor/local/include/zsock_option.inc +234 -1062
  70. data/vendor/local/include/zstr.h +44 -19
  71. data/vendor/local/include/zsys.h +63 -19
  72. data/vendor/local/include/zuuid.h +4 -4
  73. data/vendor/local/lib/libczmq.dll.a +0 -0
  74. data/vendor/local/lib/liblibzmq.dll.a +0 -0
  75. data/vendor/local/lib/pkgconfig/libczmq.pc +1 -1
  76. metadata +6 -3
@@ -9,13 +9,13 @@ module CZMQ
9
9
  # working with single message frames
10
10
  # @note This class is 100% generated using zproject.
11
11
  class Zframe
12
- #
12
+ #
13
13
  MORE = 1
14
14
 
15
- #
15
+ #
16
16
  REUSE = 2
17
17
 
18
- #
18
+ #
19
19
  DONTWAIT = 4
20
20
 
21
21
  # Raised when one tries to use an instance of {Zframe} after
@@ -83,8 +83,8 @@ module CZMQ
83
83
  end
84
84
 
85
85
  # Create a new frame. If size is not null, allocates the frame data
86
- # to the specified size. If additionally, data is not null, copies
87
- # size octets from the specified data into the frame body.
86
+ # to the specified size. If additionally, data is not null, copies
87
+ # size octets from the specified data into the frame body.
88
88
  # @param data [::FFI::Pointer, #to_ptr]
89
89
  # @param size [Integer, #to_int, #to_i]
90
90
  # @return [CZMQ::Zframe]
@@ -109,9 +109,9 @@ module CZMQ
109
109
  __new ptr
110
110
  end
111
111
 
112
- # Receive frame from socket, returns zframe_t object or NULL if the recv
112
+ # Receive frame from socket, returns zframe_t object or NULL if the recv
113
113
  # was interrupted. Does a blocking recv, if you want to not block then use
114
- # zpoller or zloop.
114
+ # zpoller or zloop.
115
115
  # @param source [::FFI::Pointer, #to_ptr]
116
116
  # @return [CZMQ::Zframe]
117
117
  def self.recv(source)
@@ -130,7 +130,7 @@ module CZMQ
130
130
  end
131
131
 
132
132
  # Send a frame to a socket, destroy frame after sending.
133
- # Return -1 on error, 0 on success.
133
+ # Return -1 on error, 0 on success.
134
134
  #
135
135
  # @param self_p [#__ptr_give_ref]
136
136
  # @param dest [::FFI::Pointer, #to_ptr]
@@ -163,8 +163,9 @@ module CZMQ
163
163
  result
164
164
  end
165
165
 
166
- # Return meta data property for frame
167
- # Caller must free string when finished with it.
166
+ # Return meta data property for frame
167
+ # The caller shall not modify or free the returned value, which shall be
168
+ # owned by the message.
168
169
  #
169
170
  # @param property [String, #to_s, nil]
170
171
  # @return [String]
@@ -176,7 +177,7 @@ module CZMQ
176
177
  end
177
178
 
178
179
  # Create a new frame that duplicates an existing frame. If frame is null,
179
- # or memory was exhausted, returns null.
180
+ # or memory was exhausted, returns null.
180
181
  #
181
182
  # @return [Zframe]
182
183
  def dup()
@@ -188,7 +189,7 @@ module CZMQ
188
189
  end
189
190
 
190
191
  # Return frame data encoded as printable hex string, useful for 0MQ UUIDs.
191
- # Caller must free string when finished with it.
192
+ # Caller must free string when finished with it.
192
193
  #
193
194
  # @return [::FFI::AutoPointer]
194
195
  def strhex()
@@ -200,7 +201,7 @@ module CZMQ
200
201
  end
201
202
 
202
203
  # Return frame data copied into freshly allocated string
203
- # Caller must free string when finished with it.
204
+ # Caller must free string when finished with it.
204
205
  #
205
206
  # @return [::FFI::AutoPointer]
206
207
  def strdup()
@@ -223,7 +224,7 @@ module CZMQ
223
224
  end
224
225
 
225
226
  # Return frame MORE indicator (1 or 0), set when reading frame from socket
226
- # or by the zframe_set_more() method
227
+ # or by the zframe_set_more() method
227
228
  #
228
229
  # @return [Integer]
229
230
  def more()
@@ -234,7 +235,7 @@ module CZMQ
234
235
  end
235
236
 
236
237
  # Set frame MORE indicator (1 or 0). Note this is NOT used when sending
237
- # frame to socket, you have to specify flag explicitly.
238
+ # frame to socket, you have to specify flag explicitly.
238
239
  #
239
240
  # @param more [Integer, #to_int, #to_i]
240
241
  # @return [void]
@@ -247,7 +248,7 @@ module CZMQ
247
248
  end
248
249
 
249
250
  # Return frame routing ID, if the frame came from a ZMQ_SERVER socket.
250
- # Else returns zero.
251
+ # Else returns zero.
251
252
  #
252
253
  # @return [Integer]
253
254
  def routing_id()
@@ -258,7 +259,7 @@ module CZMQ
258
259
  end
259
260
 
260
261
  # Set routing ID on frame. This is used if/when the frame is sent to a
261
- # ZMQ_SERVER socket.
262
+ # ZMQ_SERVER socket.
262
263
  #
263
264
  # @param routing_id [Integer, #to_int, #to_i]
264
265
  # @return [void]
@@ -281,8 +282,8 @@ module CZMQ
281
282
  end
282
283
 
283
284
  # Set group on frame. This is used if/when the frame is sent to a
284
- # ZMQ_RADIO socket.
285
- # Return -1 on error, 0 on success.
285
+ # ZMQ_RADIO socket.
286
+ # Return -1 on error, 0 on success.
286
287
  #
287
288
  # @param group [String, #to_s, nil]
288
289
  # @return [Integer]
@@ -294,7 +295,7 @@ module CZMQ
294
295
  end
295
296
 
296
297
  # Return TRUE if two frames have identical size and data
297
- # If either frame is NULL, equality is always false.
298
+ # If either frame is NULL, equality is always false.
298
299
  #
299
300
  # @param other [Zframe, #__ptr]
300
301
  # @return [Boolean]
@@ -319,7 +320,7 @@ module CZMQ
319
320
  result
320
321
  end
321
322
 
322
- # Send message to zsys log sink (may be stdout, or system facility as
323
+ # Send message to zsys log sink (may be stdout, or system facility as
323
324
  # configured by zsys_set_logstream). Prefix shows before frame, if not null.
324
325
  #
325
326
  # @param prefix [String, #to_s, nil]
@@ -76,7 +76,7 @@ module CZMQ
76
76
  # Create a new callback of the following type:
77
77
  # Callback function for zhash_freefn method
78
78
  # typedef void (zhash_free_fn) (
79
- # void *data);
79
+ # void *data);
80
80
  #
81
81
  # @note WARNING: If your Ruby code doesn't retain a reference to the
82
82
  # FFI::Function object after passing it to a C function call,
@@ -97,8 +97,8 @@ module CZMQ
97
97
  end
98
98
 
99
99
  # Unpack binary frame into a new hash table. Packed data must follow format
100
- # defined by zhash_pack. Hash table is set to autofree. An empty frame
101
- # unpacks to an empty hash table.
100
+ # defined by zhash_pack. Hash table is set to autofree. An empty frame
101
+ # unpacks to an empty hash table.
102
102
  # @param frame [Zframe, #__ptr]
103
103
  # @return [CZMQ::Zhash]
104
104
  def self.unpack(frame)
@@ -117,9 +117,9 @@ module CZMQ
117
117
  result
118
118
  end
119
119
 
120
- # Insert item into hash table with specified key and item.
120
+ # Insert item into hash table with specified key and item.
121
121
  # If key is already present returns -1 and leaves existing item unchanged
122
- # Returns 0 on success.
122
+ # Returns 0 on success.
123
123
  #
124
124
  # @param key [String, #to_s, nil]
125
125
  # @param item [::FFI::Pointer, #to_ptr]
@@ -131,8 +131,8 @@ module CZMQ
131
131
  result
132
132
  end
133
133
 
134
- # Update item into hash table with specified key and item.
135
- # If key is already present, destroys old item and inserts new one.
134
+ # Update item into hash table with specified key and item.
135
+ # If key is already present, destroys old item and inserts new one.
136
136
  # Use free_fn method to ensure deallocator is properly called on item.
137
137
  #
138
138
  # @param key [String, #to_s, nil]
@@ -146,7 +146,7 @@ module CZMQ
146
146
  end
147
147
 
148
148
  # Remove an item specified by key from the hash table. If there was no such
149
- # item, this function does nothing.
149
+ # item, this function does nothing.
150
150
  #
151
151
  # @param key [String, #to_s, nil]
152
152
  # @return [void]
@@ -169,7 +169,7 @@ module CZMQ
169
169
  end
170
170
 
171
171
  # Reindexes an item from an old key to a new key. If there was no such
172
- # item, does nothing. Returns 0 if successful, else -1.
172
+ # item, does nothing. Returns 0 if successful, else -1.
173
173
  #
174
174
  # @param old_key [String, #to_s, nil]
175
175
  # @param new_key [String, #to_s, nil]
@@ -182,10 +182,10 @@ module CZMQ
182
182
  end
183
183
 
184
184
  # Set a free function for the specified hash table item. When the item is
185
- # destroyed, the free function, if any, is called on that item.
186
- # Use this when hash items are dynamically allocated, to ensure that
187
- # you don't have memory leaks. You can pass 'free' or NULL as a free_fn.
188
- # Returns the item, or NULL if there is no such item.
185
+ # destroyed, the free function, if any, is called on that item.
186
+ # Use this when hash items are dynamically allocated, to ensure that
187
+ # you don't have memory leaks. You can pass 'free' or NULL as a free_fn.
188
+ # Returns the item, or NULL if there is no such item.
189
189
  #
190
190
  # @param key [String, #to_s, nil]
191
191
  # @param free_fn [::FFI::Pointer, #to_ptr]
@@ -207,10 +207,10 @@ module CZMQ
207
207
  result
208
208
  end
209
209
 
210
- # Make copy of hash table; if supplied table is null, returns null.
211
- # Does not copy items themselves. Rebuilds new table so may be slow on
210
+ # Make copy of hash table; if supplied table is null, returns null.
211
+ # Does not copy items themselves. Rebuilds new table so may be slow on
212
212
  # very large tables. NOTE: only works with item values that are strings
213
- # since there's no other way to know how to duplicate the item value.
213
+ # since there's no other way to know how to duplicate the item value.
214
214
  #
215
215
  # @return [Zhash]
216
216
  def dup()
@@ -232,10 +232,10 @@ module CZMQ
232
232
  result
233
233
  end
234
234
 
235
- # Simple iterator; returns first item in hash table, in no given order,
236
- # or NULL if the table is empty. This method is simpler to use than the
235
+ # Simple iterator; returns first item in hash table, in no given order,
236
+ # or NULL if the table is empty. This method is simpler to use than the
237
237
  # foreach() method, which is deprecated. To access the key for this item
238
- # use zhash_cursor(). NOTE: do NOT modify the table while iterating.
238
+ # use zhash_cursor(). NOTE: do NOT modify the table while iterating.
239
239
  #
240
240
  # @return [::FFI::Pointer]
241
241
  def first()
@@ -245,12 +245,12 @@ module CZMQ
245
245
  result
246
246
  end
247
247
 
248
- # Simple iterator; returns next item in hash table, in no given order,
248
+ # Simple iterator; returns next item in hash table, in no given order,
249
249
  # or NULL if the last item was already returned. Use this together with
250
- # zhash_first() to process all items in a hash table. If you need the
251
- # items in sorted order, use zhash_keys() and then zlist_sort(). To
252
- # access the key for this item use zhash_cursor(). NOTE: do NOT modify
253
- # the table while iterating.
250
+ # zhash_first() to process all items in a hash table. If you need the
251
+ # items in sorted order, use zhash_keys() and then zlist_sort(). To
252
+ # access the key for this item use zhash_cursor(). NOTE: do NOT modify
253
+ # the table while iterating.
254
254
  #
255
255
  # @return [::FFI::Pointer]
256
256
  def next()
@@ -261,9 +261,9 @@ module CZMQ
261
261
  end
262
262
 
263
263
  # After a successful first/next method, returns the key for the item that
264
- # was returned. This is a constant string that you may not modify or
265
- # deallocate, and which lasts as long as the item in the hash. After an
266
- # unsuccessful first/next, returns NULL.
264
+ # was returned. This is a constant string that you may not modify or
265
+ # deallocate, and which lasts as long as the item in the hash. After an
266
+ # unsuccessful first/next, returns NULL.
267
267
  #
268
268
  # @return [String]
269
269
  def cursor()
@@ -273,9 +273,9 @@ module CZMQ
273
273
  result
274
274
  end
275
275
 
276
- # Add a comment to hash table before saving to disk. You can add as many
276
+ # Add a comment to hash table before saving to disk. You can add as many
277
277
  # comment lines as you like. These comment lines are discarded when loading
278
- # the file. If you use a null format, all comments are deleted.
278
+ # the file. If you use a null format, all comments are deleted.
279
279
  #
280
280
  # @param format [String, #to_s, nil]
281
281
  # @param args [Array<Object>] see https://github.com/ffi/ffi/wiki/examples#using-varargs
@@ -289,24 +289,24 @@ module CZMQ
289
289
 
290
290
  # Serialize hash table to a binary frame that can be sent in a message.
291
291
  # The packed format is compatible with the 'dictionary' type defined in
292
- # http://rfc.zeromq.org/spec:35/FILEMQ, and implemented by zproto:
293
- #
294
- # ; A list of name/value pairs
295
- # dictionary = dict-count *( dict-name dict-value )
296
- # dict-count = number-4
297
- # dict-value = longstr
298
- # dict-name = string
299
- #
300
- # ; Strings are always length + text contents
301
- # longstr = number-4 *VCHAR
302
- # string = number-1 *VCHAR
303
- #
304
- # ; Numbers are unsigned integers in network byte order
305
- # number-1 = 1OCTET
306
- # number-4 = 4OCTET
307
- #
308
- # Comments are not included in the packed data. Item values MUST be
309
- # strings.
292
+ # http://rfc.zeromq.org/spec:35/FILEMQ, and implemented by zproto:
293
+ #
294
+ # ; A list of name/value pairs
295
+ # dictionary = dict-count *( dict-name dict-value )
296
+ # dict-count = number-4
297
+ # dict-value = longstr
298
+ # dict-name = string
299
+ #
300
+ # ; Strings are always length + text contents
301
+ # longstr = number-4 *VCHAR
302
+ # string = number-1 *VCHAR
303
+ #
304
+ # ; Numbers are unsigned integers in network byte order
305
+ # number-1 = 1OCTET
306
+ # number-4 = 4OCTET
307
+ #
308
+ # Comments are not included in the packed data. Item values MUST be
309
+ # strings.
310
310
  #
311
311
  # @return [Zframe]
312
312
  def pack()
@@ -318,8 +318,8 @@ module CZMQ
318
318
  end
319
319
 
320
320
  # Save hash table to a text file in name=value format. Hash values must be
321
- # printable strings; keys may not contain '=' character. Returns 0 if OK,
322
- # else -1 if a file error occurred.
321
+ # printable strings; keys may not contain '=' character. Returns 0 if OK,
322
+ # else -1 if a file error occurred.
323
323
  #
324
324
  # @param filename [String, #to_s, nil]
325
325
  # @return [Integer]
@@ -330,9 +330,9 @@ module CZMQ
330
330
  result
331
331
  end
332
332
 
333
- # Load hash table from a text file in name=value format; hash table must
333
+ # Load hash table from a text file in name=value format; hash table must
334
334
  # already exist. Hash values must printable strings; keys may not contain
335
- # '=' character. Returns 0 if OK, else -1 if a file was not readable.
335
+ # '=' character. Returns 0 if OK, else -1 if a file was not readable.
336
336
  #
337
337
  # @param filename [String, #to_s, nil]
338
338
  # @return [Integer]
@@ -345,8 +345,8 @@ module CZMQ
345
345
 
346
346
  # When a hash table was loaded from a file by zhash_load, this method will
347
347
  # reload the file if it has been modified since, and is "stable", i.e. not
348
- # still changing. Returns 0 if OK, -1 if there was an error reloading the
349
- # file.
348
+ # still changing. Returns 0 if OK, -1 if there was an error reloading the
349
+ # file.
350
350
  #
351
351
  # @return [Integer]
352
352
  def refresh()
@@ -357,7 +357,7 @@ module CZMQ
357
357
  end
358
358
 
359
359
  # Set hash for automatic value destruction. Note that this assumes that
360
- # values are NULL-terminated strings. Do not use with different types.
360
+ # values are NULL-terminated strings. Do not use with different types.
361
361
  #
362
362
  # @return [void]
363
363
  def autofree()
@@ -76,7 +76,7 @@ module CZMQ
76
76
  # Create a new callback of the following type:
77
77
  # Destroy an item
78
78
  # typedef void (zhashx_destructor_fn) (
79
- # void **item);
79
+ # void **item);
80
80
  #
81
81
  # @note WARNING: If your Ruby code doesn't retain a reference to the
82
82
  # FFI::Function object after passing it to a C function call,
@@ -92,7 +92,7 @@ module CZMQ
92
92
  # Create a new callback of the following type:
93
93
  # Duplicate an item
94
94
  # typedef void * (zhashx_duplicator_fn) (
95
- # const void *item);
95
+ # const void *item);
96
96
  #
97
97
  # @note WARNING: If your Ruby code doesn't retain a reference to the
98
98
  # FFI::Function object after passing it to a C function call,
@@ -107,7 +107,7 @@ module CZMQ
107
107
 
108
108
  # Create a new callback of the following type:
109
109
  # Compare two items, for sorting
110
- # typedef int (zhashx_comparator_fn) (
110
+ # typedef int (zhashx_comparator_fn) (
111
111
  # const void *item1, const void *item2);
112
112
  #
113
113
  # @note WARNING: If your Ruby code doesn't retain a reference to the
@@ -125,7 +125,7 @@ module CZMQ
125
125
  # Create a new callback of the following type:
126
126
  # Destroy an item.
127
127
  # typedef void (zhashx_free_fn) (
128
- # void *data);
128
+ # void *data);
129
129
  #
130
130
  # @note WARNING: If your Ruby code doesn't retain a reference to the
131
131
  # FFI::Function object after passing it to a C function call,
@@ -141,7 +141,7 @@ module CZMQ
141
141
  # Create a new callback of the following type:
142
142
  # Hash function for keys.
143
143
  # typedef size_t (zhashx_hash_fn) (
144
- # const void *key);
144
+ # const void *key);
145
145
  #
146
146
  # @note WARNING: If your Ruby code doesn't retain a reference to the
147
147
  # FFI::Function object after passing it to a C function call,
@@ -156,10 +156,10 @@ module CZMQ
156
156
  end
157
157
 
158
158
  # Create a new callback of the following type:
159
- # Serializes an item to a longstr.
159
+ # Serializes an item to a longstr.
160
160
  # The caller takes ownership of the newly created object.
161
161
  # typedef char * (zhashx_serializer_fn) (
162
- # const void *item);
162
+ # const void *item);
163
163
  #
164
164
  # @note WARNING: If your Ruby code doesn't retain a reference to the
165
165
  # FFI::Function object after passing it to a C function call,
@@ -173,10 +173,10 @@ module CZMQ
173
173
  end
174
174
 
175
175
  # Create a new callback of the following type:
176
- # Deserializes a longstr into an item.
176
+ # Deserializes a longstr into an item.
177
177
  # The caller takes ownership of the newly created object.
178
178
  # typedef void * (zhashx_deserializer_fn) (
179
- # const char *item_str);
179
+ # const char *item_str);
180
180
  #
181
181
  # @note WARNING: If your Ruby code doesn't retain a reference to the
182
182
  # FFI::Function object after passing it to a C function call,
@@ -197,8 +197,8 @@ module CZMQ
197
197
  end
198
198
 
199
199
  # Unpack binary frame into a new hash table. Packed data must follow format
200
- # defined by zhashx_pack. Hash table is set to autofree. An empty frame
201
- # unpacks to an empty hash table.
200
+ # defined by zhashx_pack. Hash table is set to autofree. An empty frame
201
+ # unpacks to an empty hash table.
202
202
  # @param frame [Zframe, #__ptr]
203
203
  # @return [CZMQ::Zhashx]
204
204
  def self.unpack(frame)
@@ -208,7 +208,7 @@ module CZMQ
208
208
  end
209
209
 
210
210
  # Same as unpack but uses a user-defined deserializer function to convert
211
- # a longstr back into item format.
211
+ # a longstr back into item format.
212
212
  # @param frame [Zframe, #__ptr]
213
213
  # @param deserializer [::FFI::Pointer, #to_ptr]
214
214
  # @return [CZMQ::Zhashx]
@@ -228,9 +228,9 @@ module CZMQ
228
228
  result
229
229
  end
230
230
 
231
- # Insert item into hash table with specified key and item.
231
+ # Insert item into hash table with specified key and item.
232
232
  # If key is already present returns -1 and leaves existing item unchanged
233
- # Returns 0 on success.
233
+ # Returns 0 on success.
234
234
  #
235
235
  # @param key [::FFI::Pointer, #to_ptr]
236
236
  # @param item [::FFI::Pointer, #to_ptr]
@@ -244,9 +244,9 @@ module CZMQ
244
244
 
245
245
  # Update or insert item into hash table with specified key and item. If the
246
246
  # key is already present, destroys old item and inserts new one. If you set
247
- # a container item destructor, this is called on the old value. If the key
248
- # was not already present, inserts a new item. Sets the hash cursor to the
249
- # new item.
247
+ # a container item destructor, this is called on the old value. If the key
248
+ # was not already present, inserts a new item. Sets the hash cursor to the
249
+ # new item.
250
250
  #
251
251
  # @param key [::FFI::Pointer, #to_ptr]
252
252
  # @param item [::FFI::Pointer, #to_ptr]
@@ -259,7 +259,7 @@ module CZMQ
259
259
  end
260
260
 
261
261
  # Remove an item specified by key from the hash table. If there was no such
262
- # item, this function does nothing.
262
+ # item, this function does nothing.
263
263
  #
264
264
  # @param key [::FFI::Pointer, #to_ptr]
265
265
  # @return [void]
@@ -270,9 +270,9 @@ module CZMQ
270
270
  result
271
271
  end
272
272
 
273
- # Delete all items from the hash table. If the key destructor is
273
+ # Delete all items from the hash table. If the key destructor is
274
274
  # set, calls it on every key. If the item destructor is set, calls
275
- # it on every item.
275
+ # it on every item.
276
276
  #
277
277
  # @return [void]
278
278
  def purge()
@@ -294,7 +294,7 @@ module CZMQ
294
294
  end
295
295
 
296
296
  # Reindexes an item from an old key to a new key. If there was no such
297
- # item, does nothing. Returns 0 if successful, else -1.
297
+ # item, does nothing. Returns 0 if successful, else -1.
298
298
  #
299
299
  # @param old_key [::FFI::Pointer, #to_ptr]
300
300
  # @param new_key [::FFI::Pointer, #to_ptr]
@@ -307,10 +307,10 @@ module CZMQ
307
307
  end
308
308
 
309
309
  # Set a free function for the specified hash table item. When the item is
310
- # destroyed, the free function, if any, is called on that item.
311
- # Use this when hash items are dynamically allocated, to ensure that
312
- # you don't have memory leaks. You can pass 'free' or NULL as a free_fn.
313
- # Returns the item, or NULL if there is no such item.
310
+ # destroyed, the free function, if any, is called on that item.
311
+ # Use this when hash items are dynamically allocated, to ensure that
312
+ # you don't have memory leaks. You can pass 'free' or NULL as a free_fn.
313
+ # Returns the item, or NULL if there is no such item.
314
314
  #
315
315
  # @param key [::FFI::Pointer, #to_ptr]
316
316
  # @param free_fn [::FFI::Pointer, #to_ptr]
@@ -332,9 +332,9 @@ module CZMQ
332
332
  result
333
333
  end
334
334
 
335
- # Return a zlistx_t containing the keys for the items in the
335
+ # Return a zlistx_t containing the keys for the items in the
336
336
  # table. Uses the key_duplicator to duplicate all keys and sets the
337
- # key_destructor as destructor for the list.
337
+ # key_destructor as destructor for the list.
338
338
  #
339
339
  # @return [Zlistx]
340
340
  def keys()
@@ -345,9 +345,9 @@ module CZMQ
345
345
  result
346
346
  end
347
347
 
348
- # Return a zlistx_t containing the values for the items in the
348
+ # Return a zlistx_t containing the values for the items in the
349
349
  # table. Uses the duplicator to duplicate all items and sets the
350
- # destructor as destructor for the list.
350
+ # destructor as destructor for the list.
351
351
  #
352
352
  # @return [Zlistx]
353
353
  def values()
@@ -358,10 +358,10 @@ module CZMQ
358
358
  result
359
359
  end
360
360
 
361
- # Simple iterator; returns first item in hash table, in no given order,
362
- # or NULL if the table is empty. This method is simpler to use than the
361
+ # Simple iterator; returns first item in hash table, in no given order,
362
+ # or NULL if the table is empty. This method is simpler to use than the
363
363
  # foreach() method, which is deprecated. To access the key for this item
364
- # use zhashx_cursor(). NOTE: do NOT modify the table while iterating.
364
+ # use zhashx_cursor(). NOTE: do NOT modify the table while iterating.
365
365
  #
366
366
  # @return [::FFI::Pointer]
367
367
  def first()
@@ -371,12 +371,12 @@ module CZMQ
371
371
  result
372
372
  end
373
373
 
374
- # Simple iterator; returns next item in hash table, in no given order,
374
+ # Simple iterator; returns next item in hash table, in no given order,
375
375
  # or NULL if the last item was already returned. Use this together with
376
- # zhashx_first() to process all items in a hash table. If you need the
377
- # items in sorted order, use zhashx_keys() and then zlistx_sort(). To
376
+ # zhashx_first() to process all items in a hash table. If you need the
377
+ # items in sorted order, use zhashx_keys() and then zlistx_sort(). To
378
378
  # access the key for this item use zhashx_cursor(). NOTE: do NOT modify
379
- # the table while iterating.
379
+ # the table while iterating.
380
380
  #
381
381
  # @return [::FFI::Pointer]
382
382
  def next()
@@ -387,9 +387,9 @@ module CZMQ
387
387
  end
388
388
 
389
389
  # After a successful first/next method, returns the key for the item that
390
- # was returned. This is a constant string that you may not modify or
391
- # deallocate, and which lasts as long as the item in the hash. After an
392
- # unsuccessful first/next, returns NULL.
390
+ # was returned. This is a constant string that you may not modify or
391
+ # deallocate, and which lasts as long as the item in the hash. After an
392
+ # unsuccessful first/next, returns NULL.
393
393
  #
394
394
  # @return [::FFI::Pointer]
395
395
  def cursor()
@@ -399,9 +399,9 @@ module CZMQ
399
399
  result
400
400
  end
401
401
 
402
- # Add a comment to hash table before saving to disk. You can add as many
402
+ # Add a comment to hash table before saving to disk. You can add as many
403
403
  # comment lines as you like. These comment lines are discarded when loading
404
- # the file. If you use a null format, all comments are deleted.
404
+ # the file. If you use a null format, all comments are deleted.
405
405
  #
406
406
  # @param format [String, #to_s, nil]
407
407
  # @param args [Array<Object>] see https://github.com/ffi/ffi/wiki/examples#using-varargs
@@ -414,8 +414,8 @@ module CZMQ
414
414
  end
415
415
 
416
416
  # Save hash table to a text file in name=value format. Hash values must be
417
- # printable strings; keys may not contain '=' character. Returns 0 if OK,
418
- # else -1 if a file error occurred.
417
+ # printable strings; keys may not contain '=' character. Returns 0 if OK,
418
+ # else -1 if a file error occurred.
419
419
  #
420
420
  # @param filename [String, #to_s, nil]
421
421
  # @return [Integer]
@@ -426,9 +426,9 @@ module CZMQ
426
426
  result
427
427
  end
428
428
 
429
- # Load hash table from a text file in name=value format; hash table must
429
+ # Load hash table from a text file in name=value format; hash table must
430
430
  # already exist. Hash values must printable strings; keys may not contain
431
- # '=' character. Returns 0 if OK, else -1 if a file was not readable.
431
+ # '=' character. Returns 0 if OK, else -1 if a file was not readable.
432
432
  #
433
433
  # @param filename [String, #to_s, nil]
434
434
  # @return [Integer]
@@ -440,9 +440,9 @@ module CZMQ
440
440
  end
441
441
 
442
442
  # When a hash table was loaded from a file by zhashx_load, this method will
443
- # reload the file if it has been modified since, and is "stable", i.e. not
444
- # still changing. Returns 0 if OK, -1 if there was an error reloading the
445
- # file.
443
+ # reload the file if it has been modified since, and is "stable", i.e. not
444
+ # still changing. Returns 0 if OK, -1 if there was an error reloading the
445
+ # file.
446
446
  #
447
447
  # @return [Integer]
448
448
  def refresh()
@@ -454,24 +454,24 @@ module CZMQ
454
454
 
455
455
  # Serialize hash table to a binary frame that can be sent in a message.
456
456
  # The packed format is compatible with the 'dictionary' type defined in
457
- # http://rfc.zeromq.org/spec:35/FILEMQ, and implemented by zproto:
458
- #
459
- # ; A list of name/value pairs
460
- # dictionary = dict-count *( dict-name dict-value )
461
- # dict-count = number-4
462
- # dict-value = longstr
463
- # dict-name = string
464
- #
465
- # ; Strings are always length + text contents
466
- # longstr = number-4 *VCHAR
467
- # string = number-1 *VCHAR
468
- #
469
- # ; Numbers are unsigned integers in network byte order
470
- # number-1 = 1OCTET
471
- # number-4 = 4OCTET
472
- #
473
- # Comments are not included in the packed data. Item values MUST be
474
- # strings.
457
+ # http://rfc.zeromq.org/spec:35/FILEMQ, and implemented by zproto:
458
+ #
459
+ # ; A list of name/value pairs
460
+ # dictionary = dict-count *( dict-name dict-value )
461
+ # dict-count = number-4
462
+ # dict-value = longstr
463
+ # dict-name = string
464
+ #
465
+ # ; Strings are always length + text contents
466
+ # longstr = number-4 *VCHAR
467
+ # string = number-1 *VCHAR
468
+ #
469
+ # ; Numbers are unsigned integers in network byte order
470
+ # number-1 = 1OCTET
471
+ # number-4 = 4OCTET
472
+ #
473
+ # Comments are not included in the packed data. Item values MUST be
474
+ # strings.
475
475
  #
476
476
  # @return [Zframe]
477
477
  def pack()
@@ -483,7 +483,7 @@ module CZMQ
483
483
  end
484
484
 
485
485
  # Same as pack but uses a user-defined serializer function to convert items
486
- # into longstr.
486
+ # into longstr.
487
487
  #
488
488
  # @param serializer [::FFI::Pointer, #to_ptr]
489
489
  # @return [Zframe]
@@ -495,9 +495,9 @@ module CZMQ
495
495
  result
496
496
  end
497
497
 
498
- # Make a copy of the list; items are duplicated if you set a duplicator
499
- # for the list, otherwise not. Copying a null reference returns a null
500
- # reference. Note that this method's behavior changed slightly for CZMQ
498
+ # Make a copy of the list; items are duplicated if you set a duplicator
499
+ # for the list, otherwise not. Copying a null reference returns a null
500
+ # reference. Note that this method's behavior changed slightly for CZMQ
501
501
  # v3.x, as it does not set nor respect autofree. It does however let you
502
502
  # duplicate any hash table safely. The old behavior is in zhashx_dup_v2.
503
503
  #
@@ -511,7 +511,7 @@ module CZMQ
511
511
  end
512
512
 
513
513
  # Set a user-defined deallocator for hash items; by default items are not
514
- # freed when the hash is destroyed.
514
+ # freed when the hash is destroyed.
515
515
  #
516
516
  # @param destructor [::FFI::Pointer, #to_ptr]
517
517
  # @return [void]
@@ -523,7 +523,7 @@ module CZMQ
523
523
  end
524
524
 
525
525
  # Set a user-defined duplicator for hash items; by default items are not
526
- # copied when the hash is duplicated.
526
+ # copied when the hash is duplicated.
527
527
  #
528
528
  # @param duplicator [::FFI::Pointer, #to_ptr]
529
529
  # @return [void]
@@ -535,7 +535,7 @@ module CZMQ
535
535
  end
536
536
 
537
537
  # Set a user-defined deallocator for keys; by default keys are freed
538
- # when the hash is destroyed using free().
538
+ # when the hash is destroyed using free().
539
539
  #
540
540
  # @param destructor [::FFI::Pointer, #to_ptr]
541
541
  # @return [void]
@@ -547,7 +547,7 @@ module CZMQ
547
547
  end
548
548
 
549
549
  # Set a user-defined duplicator for keys; by default keys are duplicated
550
- # using strdup.
550
+ # using strdup.
551
551
  #
552
552
  # @param duplicator [::FFI::Pointer, #to_ptr]
553
553
  # @return [void]
@@ -559,7 +559,9 @@ module CZMQ
559
559
  end
560
560
 
561
561
  # Set a user-defined comparator for keys; by default keys are
562
- # compared using strcmp.
562
+ # compared using strcmp.
563
+ # The callback function should return zero (0) on matching
564
+ # items.
563
565
  #
564
566
  # @param comparator [::FFI::Pointer, #to_ptr]
565
567
  # @return [void]
@@ -570,8 +572,8 @@ module CZMQ
570
572
  result
571
573
  end
572
574
 
573
- # Set a user-defined comparator for keys; by default keys are
574
- # compared using strcmp.
575
+ # Set a user-defined hash function for keys; by default keys are
576
+ # hashed by a modified Bernstein hashing function.
575
577
  #
576
578
  # @param hasher [::FFI::Pointer, #to_ptr]
577
579
  # @return [void]
@@ -582,10 +584,10 @@ module CZMQ
582
584
  result
583
585
  end
584
586
 
585
- # Make copy of hash table; if supplied table is null, returns null.
586
- # Does not copy items themselves. Rebuilds new table so may be slow on
587
+ # Make copy of hash table; if supplied table is null, returns null.
588
+ # Does not copy items themselves. Rebuilds new table so may be slow on
587
589
  # very large tables. NOTE: only works with item values that are strings
588
- # since there's no other way to know how to duplicate the item value.
590
+ # since there's no other way to know how to duplicate the item value.
589
591
  #
590
592
  # @return [Zhashx]
591
593
  def dup_v2()