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
@@ -73,8 +73,8 @@ module CZMQ
73
73
  @finalizer = nil
74
74
  end
75
75
 
76
- # Create a new chunk of the specified size. If you specify the data, it
77
- # is copied into the chunk. If you do not specify the data, the chunk is
76
+ # Create a new chunk of the specified size. If you specify the data, it
77
+ # is copied into the chunk. If you do not specify the data, the chunk is
78
78
  # allocated and left empty, and you can then add data using zchunk_append.
79
79
  # @param data [::FFI::Pointer, #to_ptr]
80
80
  # @param size [Integer, #to_int, #to_i]
@@ -138,7 +138,7 @@ module CZMQ
138
138
  end
139
139
 
140
140
  # Set chunk data from user-supplied data; truncate if too large. Data may
141
- # be null. Returns actual size of chunk
141
+ # be null. Returns actual size of chunk
142
142
  #
143
143
  # @param data [::FFI::Pointer, #to_ptr]
144
144
  # @param size [Integer, #to_int, #to_i]
@@ -165,9 +165,9 @@ module CZMQ
165
165
  result
166
166
  end
167
167
 
168
- # Append user-supplied data to chunk, return resulting chunk size. If the
168
+ # Append user-supplied data to chunk, return resulting chunk size. If the
169
169
  # data would exceeded the available space, it is truncated. If you want to
170
- # grow the chunk to accommodate new data, use the zchunk_extend method.
170
+ # grow the chunk to accommodate new data, use the zchunk_extend method.
171
171
  #
172
172
  # @param data [::FFI::Pointer, #to_ptr]
173
173
  # @param size [Integer, #to_int, #to_i]
@@ -181,7 +181,7 @@ module CZMQ
181
181
  end
182
182
 
183
183
  # Append user-supplied data to chunk, return resulting chunk size. If the
184
- # data would exceeded the available space, the chunk grows in size.
184
+ # data would exceeded the available space, the chunk grows in size.
185
185
  #
186
186
  # @param data [::FFI::Pointer, #to_ptr]
187
187
  # @param size [Integer, #to_int, #to_i]
@@ -194,10 +194,10 @@ module CZMQ
194
194
  result
195
195
  end
196
196
 
197
- # Copy as much data from 'source' into the chunk as possible; returns the
198
- # new size of chunk. If all data from 'source' is used, returns exhausted
197
+ # Copy as much data from 'source' into the chunk as possible; returns the
198
+ # new size of chunk. If all data from 'source' is used, returns exhausted
199
199
  # on the source chunk. Source can be consumed as many times as needed until
200
- # it is exhausted. If source was already exhausted, does not change chunk.
200
+ # it is exhausted. If source was already exhausted, does not change chunk.
201
201
  #
202
202
  # @param source [Zchunk, #__ptr]
203
203
  # @return [Integer]
@@ -210,7 +210,7 @@ module CZMQ
210
210
  end
211
211
 
212
212
  # Returns true if the chunk was exhausted by consume methods, or if the
213
- # chunk has a size of zero.
213
+ # chunk has a size of zero.
214
214
  #
215
215
  # @return [Boolean]
216
216
  def exhausted()
@@ -243,9 +243,9 @@ module CZMQ
243
243
  result
244
244
  end
245
245
 
246
- # Try to slurp an entire file into a chunk. Will read up to maxsize of
247
- # the file. If maxsize is 0, will attempt to read the entire file and
248
- # fail with an assertion if that cannot fit into memory. Returns a new
246
+ # Try to slurp an entire file into a chunk. Will read up to maxsize of
247
+ # the file. If maxsize is 0, will attempt to read the entire file and
248
+ # fail with an assertion if that cannot fit into memory. Returns a new
249
249
  # chunk containing the file data, or NULL if the file could not be read.
250
250
  #
251
251
  # @param filename [String, #to_s, nil]
@@ -258,9 +258,9 @@ module CZMQ
258
258
  result
259
259
  end
260
260
 
261
- # Create copy of chunk, as new chunk object. Returns a fresh zchunk_t
261
+ # Create copy of chunk, as new chunk object. Returns a fresh zchunk_t
262
262
  # object, or null if there was not enough heap memory. If chunk is null,
263
- # returns null.
263
+ # returns null.
264
264
  #
265
265
  # @return [Zchunk]
266
266
  def dup()
@@ -272,7 +272,7 @@ module CZMQ
272
272
  end
273
273
 
274
274
  # Return chunk data encoded as printable hex string. Caller must free
275
- # string when finished with it.
275
+ # string when finished with it.
276
276
  #
277
277
  # @return [::FFI::AutoPointer]
278
278
  def strhex()
@@ -284,7 +284,7 @@ module CZMQ
284
284
  end
285
285
 
286
286
  # Return chunk data copied into freshly allocated string
287
- # Caller must free string when finished with it.
287
+ # Caller must free string when finished with it.
288
288
  #
289
289
  # @return [::FFI::AutoPointer]
290
290
  def strdup()
@@ -350,7 +350,7 @@ module CZMQ
350
350
  end
351
351
 
352
352
  # Dump message to stderr, for debugging and tracing.
353
- # See zchunk_fprint for details
353
+ # See zchunk_fprint for details
354
354
  #
355
355
  # @return [void]
356
356
  def print()
@@ -82,9 +82,9 @@ module CZMQ
82
82
  result
83
83
  end
84
84
 
85
- # Return current system clock as milliseconds. Note that this clock can
85
+ # Return current system clock as milliseconds. Note that this clock can
86
86
  # jump backwards (if the system clock is changed) so is unsafe to use for
87
- # timers and time offsets. Use zclock_mono for that instead.
87
+ # timers and time offsets. Use zclock_mono for that instead.
88
88
  #
89
89
  # @return [::FFI::Pointer]
90
90
  def self.time()
@@ -93,8 +93,8 @@ module CZMQ
93
93
  end
94
94
 
95
95
  # Return current monotonic clock in milliseconds. Use this when you compute
96
- # time offsets. The monotonic clock is not affected by system changes and
97
- # so will never be reset backwards, unlike a system clock.
96
+ # time offsets. The monotonic clock is not affected by system changes and
97
+ # so will never be reset backwards, unlike a system clock.
98
98
  #
99
99
  # @return [::FFI::Pointer]
100
100
  def self.mono()
@@ -103,8 +103,8 @@ module CZMQ
103
103
  end
104
104
 
105
105
  # Return current monotonic clock in microseconds. Use this when you compute
106
- # time offsets. The monotonic clock is not affected by system changes and
107
- # so will never be reset backwards, unlike a system clock.
106
+ # time offsets. The monotonic clock is not affected by system changes and
107
+ # so will never be reset backwards, unlike a system clock.
108
108
  #
109
109
  # @return [::FFI::Pointer]
110
110
  def self.usecs()
@@ -74,8 +74,8 @@ module CZMQ
74
74
  end
75
75
 
76
76
  # Create a new callback of the following type:
77
- #
78
- # typedef int (zconfig_fct) (
77
+ #
78
+ # typedef int (zconfig_fct) (
79
79
  # zconfig_t *self, void *arg, int level);
80
80
  #
81
81
  # @note WARNING: If your Ruby code doesn't retain a reference to the
@@ -101,9 +101,9 @@ module CZMQ
101
101
  __new ptr
102
102
  end
103
103
 
104
- # Load a config tree from a specified ZPL text file; returns a zconfig_t
104
+ # Load a config tree from a specified ZPL text file; returns a zconfig_t
105
105
  # reference for the root, if the file exists and is readable. Returns NULL
106
- # if the file does not exist.
106
+ # if the file does not exist.
107
107
  # @param filename [String, #to_s, nil]
108
108
  # @return [CZMQ::Zconfig]
109
109
  def self.load(filename)
@@ -112,7 +112,7 @@ module CZMQ
112
112
  end
113
113
 
114
114
  # Equivalent to zconfig_load, taking a format string instead of a fixed
115
- # filename.
115
+ # filename.
116
116
  # @param format [String, #to_s, nil]
117
117
  # @param args [Array<Object>]
118
118
  # @return [CZMQ::Zconfig]
@@ -164,7 +164,7 @@ module CZMQ
164
164
  end
165
165
 
166
166
  # Equivalent to zconfig_put, accepting a format specifier and variable
167
- # argument list, instead of a single string value.
167
+ # argument list, instead of a single string value.
168
168
  #
169
169
  # @param path [String, #to_s, nil]
170
170
  # @param format [String, #to_s, nil]
@@ -178,7 +178,7 @@ module CZMQ
178
178
  end
179
179
 
180
180
  # Get value for config item into a string value; leading slash is optional
181
- # and ignored.
181
+ # and ignored.
182
182
  #
183
183
  # @param path [String, #to_s, nil]
184
184
  # @param default_value [String, #to_s, nil]
@@ -201,10 +201,10 @@ module CZMQ
201
201
  result
202
202
  end
203
203
 
204
- # Set new value for config item. The new value may be a string, a printf
205
- # format, or NULL. Note that if string may possibly contain '%', or if it
204
+ # Set new value for config item. The new value may be a string, a printf
205
+ # format, or NULL. Note that if string may possibly contain '%', or if it
206
206
  # comes from an insecure source, you must use '%s' as the format, followed
207
- # by the string.
207
+ # by the string.
208
208
  #
209
209
  # @param format [String, #to_s, nil]
210
210
  # @param args [Array<Object>] see https://github.com/ffi/ffi/wiki/examples#using-varargs
@@ -264,7 +264,7 @@ module CZMQ
264
264
  end
265
265
 
266
266
  # Execute a callback for each config item in the tree; returns zero if
267
- # successful, else -1.
267
+ # successful, else -1.
268
268
  #
269
269
  # @param handler [::FFI::Pointer, #to_ptr]
270
270
  # @param arg [::FFI::Pointer, #to_ptr]
@@ -278,7 +278,7 @@ module CZMQ
278
278
 
279
279
  # Add comment to config item before saving to disk. You can add as many
280
280
  # comment lines as you like. If you use a null format, all comments are
281
- # deleted.
281
+ # deleted.
282
282
  #
283
283
  # @param format [String, #to_s, nil]
284
284
  # @param args [Array<Object>] see https://github.com/ffi/ffi/wiki/examples#using-varargs
@@ -302,7 +302,7 @@ module CZMQ
302
302
  end
303
303
 
304
304
  # Save a config tree to a specified ZPL text file, where a filename
305
- # "-" means dump to standard output.
305
+ # "-" means dump to standard output.
306
306
  #
307
307
  # @param filename [String, #to_s, nil]
308
308
  # @return [Integer]
@@ -314,7 +314,7 @@ module CZMQ
314
314
  end
315
315
 
316
316
  # Equivalent to zconfig_save, taking a format string instead of a fixed
317
- # filename.
317
+ # filename.
318
318
  #
319
319
  # @param format [String, #to_s, nil]
320
320
  # @param args [Array<Object>] see https://github.com/ffi/ffi/wiki/examples#using-varargs
@@ -337,8 +337,8 @@ module CZMQ
337
337
  end
338
338
 
339
339
  # Reload config tree from same file that it was previously loaded from.
340
- # Returns 0 if OK, -1 if there was an error (and then does not change
341
- # existing data).
340
+ # Returns 0 if OK, -1 if there was an error (and then does not change
341
+ # existing data).
342
342
  #
343
343
  # @param self_p [#__ptr_give_ref]
344
344
  # @return [Integer]
@@ -392,7 +392,7 @@ module CZMQ
392
392
  end
393
393
 
394
394
  # Return true if a configuration tree was loaded from a file and that
395
- # file has changed in since the tree was loaded.
395
+ # file has changed in since the tree was loaded.
396
396
  #
397
397
  # @return [Boolean]
398
398
  def has_changed()
@@ -402,6 +402,16 @@ module CZMQ
402
402
  result
403
403
  end
404
404
 
405
+ # Destroy subtree (child)
406
+ #
407
+ # @return [void]
408
+ def remove()
409
+ raise DestroyedError unless @ptr
410
+ self_p = @ptr
411
+ result = ::CZMQ::FFI.zconfig_remove(self_p)
412
+ result
413
+ end
414
+
405
415
  # Print the config file to open stream
406
416
  #
407
417
  # @param file [::FFI::Pointer, #to_ptr]
@@ -74,7 +74,7 @@ module CZMQ
74
74
  end
75
75
 
76
76
  # Constructor - creates new digest object, which you use to build up a
77
- # digest by repeatedly calling zdigest_update() on chunks of data.
77
+ # digest by repeatedly calling zdigest_update() on chunks of data.
78
78
  # @return [CZMQ::Zdigest]
79
79
  def self.new()
80
80
  ptr = ::CZMQ::FFI.zdigest_new()
@@ -105,7 +105,7 @@ module CZMQ
105
105
  end
106
106
 
107
107
  # Return final digest hash data. If built without crypto support,
108
- # returns NULL.
108
+ # returns NULL.
109
109
  #
110
110
  # @return [::FFI::Pointer]
111
111
  def data()
@@ -125,9 +125,9 @@ module CZMQ
125
125
  result
126
126
  end
127
127
 
128
- # Return digest as printable hex string; caller should not modify nor
128
+ # Return digest as printable hex string; caller should not modify nor
129
129
  # free this string. After calling this, you may not use zdigest_update()
130
- # on the same digest. If built without crypto support, returns NULL.
130
+ # on the same digest. If built without crypto support, returns NULL.
131
131
  #
132
132
  # @return [::FFI::Pointer]
133
133
  def string()
@@ -74,8 +74,8 @@ module CZMQ
74
74
  end
75
75
 
76
76
  # Create a new directory item that loads in the full tree of the specified
77
- # path, optionally located under some parent path. If parent is "-", then
78
- # loads only the top-level directory, and does not use parent as a path.
77
+ # path, optionally located under some parent path. If parent is "-", then
78
+ # loads only the top-level directory, and does not use parent as a path.
79
79
  # @param path [String, #to_s, nil]
80
80
  # @param parent [String, #to_s, nil]
81
81
  # @return [CZMQ::Zdir]
@@ -115,7 +115,7 @@ module CZMQ
115
115
  end
116
116
 
117
117
  # Return total hierarchy size, in bytes of data contained in all files
118
- # in the directory tree.
118
+ # in the directory tree.
119
119
  #
120
120
  # @return [::FFI::Pointer]
121
121
  def cursize()
@@ -136,8 +136,8 @@ module CZMQ
136
136
  end
137
137
 
138
138
  # Returns a sorted list of zfile objects; Each entry in the list is a pointer
139
- # to a zfile_t item already allocated in the zdir tree. Do not destroy the
140
- # original zdir tree until you are done with this list.
139
+ # to a zfile_t item already allocated in the zdir tree. Do not destroy the
140
+ # original zdir tree until you are done with this list.
141
141
  #
142
142
  # @return [Zlist]
143
143
  def list()
@@ -148,9 +148,9 @@ module CZMQ
148
148
  result
149
149
  end
150
150
 
151
- # Remove directory, optionally including all files that it contains, at
151
+ # Remove directory, optionally including all files that it contains, at
152
152
  # all levels. If force is false, will only remove the directory if empty.
153
- # If force is true, will remove all files and all subdirectories.
153
+ # If force is true, will remove all files and all subdirectories.
154
154
  #
155
155
  # @param force [Boolean]
156
156
  # @return [void]
@@ -162,10 +162,10 @@ module CZMQ
162
162
  result
163
163
  end
164
164
 
165
- # Calculate differences between two versions of a directory tree.
166
- # Returns a list of zdir_patch_t patches. Either older or newer may
165
+ # Calculate differences between two versions of a directory tree.
166
+ # Returns a list of zdir_patch_t patches. Either older or newer may
167
167
  # be null, indicating the directory is empty/absent. If alias is set,
168
- # generates virtual filename (minus path, plus alias).
168
+ # generates virtual filename (minus path, plus alias).
169
169
  #
170
170
  # @param older [Zdir, #__ptr]
171
171
  # @param newer [Zdir, #__ptr]
@@ -192,7 +192,7 @@ module CZMQ
192
192
  end
193
193
 
194
194
  # Load directory cache; returns a hash table containing the SHA-1 digests
195
- # of every file in the tree. The cache is saved between runs in .cache.
195
+ # of every file in the tree. The cache is saved between runs in .cache.
196
196
  #
197
197
  # @return [Zhash]
198
198
  def cache()
@@ -228,32 +228,32 @@ module CZMQ
228
228
  result
229
229
  end
230
230
 
231
- # Create a new zdir_watch actor instance:
232
- #
233
- # zactor_t *watch = zactor_new (zdir_watch, NULL);
234
- #
235
- # Destroy zdir_watch instance:
236
- #
237
- # zactor_destroy (&watch);
238
- #
239
- # Enable verbose logging of commands and activity:
240
- #
241
- # zstr_send (watch, "VERBOSE");
242
- #
243
- # Subscribe to changes to a directory path:
244
- #
245
- # zsock_send (watch, "ss", "SUBSCRIBE", "directory_path");
246
- #
247
- # Unsubscribe from changes to a directory path:
248
- #
231
+ # Create a new zdir_watch actor instance:
232
+ #
233
+ # zactor_t *watch = zactor_new (zdir_watch, NULL);
234
+ #
235
+ # Destroy zdir_watch instance:
236
+ #
237
+ # zactor_destroy (&watch);
238
+ #
239
+ # Enable verbose logging of commands and activity:
240
+ #
241
+ # zstr_send (watch, "VERBOSE");
242
+ #
243
+ # Subscribe to changes to a directory path:
244
+ #
245
+ # zsock_send (watch, "ss", "SUBSCRIBE", "directory_path");
246
+ #
247
+ # Unsubscribe from changes to a directory path:
248
+ #
249
249
  # zsock_send (watch, "ss", "UNSUBSCRIBE", "directory_path");
250
- #
251
- # Receive directory changes:
252
- # zsock_recv (watch, "sp", &path, &patches);
253
- #
254
- # // Delete the received data.
255
- # free (path);
256
- # zlist_destroy (&patches);
250
+ #
251
+ # Receive directory changes:
252
+ # zsock_recv (watch, "sp", &path, &patches);
253
+ #
254
+ # // Delete the received data.
255
+ # free (path);
256
+ # zlist_destroy (&patches);
257
257
  #
258
258
  # @param pipe [Zsock, #__ptr]
259
259
  # @param unused [::FFI::Pointer, #to_ptr]
@@ -103,7 +103,7 @@ module CZMQ
103
103
  end
104
104
 
105
105
  # Create copy of a patch. If the patch is null, or memory was exhausted,
106
- # returns null.
106
+ # returns null.
107
107
  #
108
108
  # @return [ZdirPatch]
109
109
  def dup()
@@ -77,7 +77,7 @@ module CZMQ
77
77
  # links, which are files with the extension ".ln". A symbolic link is a
78
78
  # text file containing one line, the filename of a target file. Reading
79
79
  # data from the symbolic link actually reads from the target file. Path
80
- # may be NULL, in which case it is not used.
80
+ # may be NULL, in which case it is not used.
81
81
  # @param path [String, #to_s, nil]
82
82
  # @param name [String, #to_s, nil]
83
83
  # @return [CZMQ::Zfile]
@@ -86,6 +86,14 @@ module CZMQ
86
86
  __new ptr
87
87
  end
88
88
 
89
+ # Create new temporary file for writing via tmpfile. File is automaticaly
90
+ # deleted on destroy
91
+ # @return [CZMQ::Zfile]
92
+ def self.tmp()
93
+ ptr = ::CZMQ::FFI.zfile_tmp()
94
+ __new ptr
95
+ end
96
+
89
97
  # Destroy a file item
90
98
  #
91
99
  # @return [void]
@@ -97,7 +105,7 @@ module CZMQ
97
105
  end
98
106
 
99
107
  # Duplicate a file item, returns a newly constructed item. If the file
100
- # is null, or memory was exhausted, returns null.
108
+ # is null, or memory was exhausted, returns null.
101
109
  #
102
110
  # @return [Zfile]
103
111
  def dup()
@@ -119,9 +127,9 @@ module CZMQ
119
127
  result
120
128
  end
121
129
 
122
- # Refresh file properties from disk; this is not done automatically
130
+ # Refresh file properties from disk; this is not done automatically
123
131
  # on access methods, otherwise it is not possible to compare directory
124
- # snapshots.
132
+ # snapshots.
125
133
  #
126
134
  # @return [void]
127
135
  def restat()
@@ -132,7 +140,7 @@ module CZMQ
132
140
  end
133
141
 
134
142
  # Return when the file was last modified. If you want this to reflect the
135
- # current situation, call zfile_restat before checking this property.
143
+ # current situation, call zfile_restat before checking this property.
136
144
  #
137
145
  # @return [::FFI::Pointer]
138
146
  def modified()
@@ -143,7 +151,7 @@ module CZMQ
143
151
  end
144
152
 
145
153
  # Return the last-known size of the file. If you want this to reflect the
146
- # current situation, call zfile_restat before checking this property.
154
+ # current situation, call zfile_restat before checking this property.
147
155
  #
148
156
  # @return [::FFI::Pointer]
149
157
  def cursize()
@@ -153,7 +161,7 @@ module CZMQ
153
161
  result
154
162
  end
155
163
 
156
- # Return true if the file is a directory. If you want this to reflect
164
+ # Return true if the file is a directory. If you want this to reflect
157
165
  # any external changes, call zfile_restat before checking this property.
158
166
  #
159
167
  # @return [Boolean]
@@ -176,8 +184,8 @@ module CZMQ
176
184
  end
177
185
 
178
186
  # Return true if the file is readable by this process. If you want this to
179
- # reflect any external changes, call zfile_restat before checking this
180
- # property.
187
+ # reflect any external changes, call zfile_restat before checking this
188
+ # property.
181
189
  #
182
190
  # @return [Boolean]
183
191
  def is_readable()
@@ -187,9 +195,9 @@ module CZMQ
187
195
  result
188
196
  end
189
197
 
190
- # Return true if the file is writeable by this process. If you want this
198
+ # Return true if the file is writeable by this process. If you want this
191
199
  # to reflect any external changes, call zfile_restat before checking this
192
- # property.
200
+ # property.
193
201
  #
194
202
  # @return [Boolean]
195
203
  def is_writeable()
@@ -200,7 +208,7 @@ module CZMQ
200
208
  end
201
209
 
202
210
  # Check if file has stopped changing and can be safely processed.
203
- # Updates the file statistics from disk at every call.
211
+ # Updates the file statistics from disk at every call.
204
212
  #
205
213
  # @return [Boolean]
206
214
  def is_stable()
@@ -211,7 +219,7 @@ module CZMQ
211
219
  end
212
220
 
213
221
  # Return true if the file was changed on disk since the zfile_t object
214
- # was created, or the last zfile_restat() call made on it.
222
+ # was created, or the last zfile_restat() call made on it.
215
223
  #
216
224
  # @return [Boolean]
217
225
  def has_changed()
@@ -231,7 +239,7 @@ module CZMQ
231
239
  result
232
240
  end
233
241
 
234
- # Open file for reading
242
+ # Open file for reading
235
243
  # Returns 0 if OK, -1 if not found or not accessible
236
244
  #
237
245
  # @return [Integer]
@@ -242,9 +250,9 @@ module CZMQ
242
250
  result
243
251
  end
244
252
 
245
- # Open file for writing, creating directory if needed
253
+ # Open file for writing, creating directory if needed
246
254
  # File is created if necessary; chunks can be written to file at any
247
- # location. Returns 0 if OK, -1 if error.
255
+ # location. Returns 0 if OK, -1 if error.
248
256
  #
249
257
  # @return [Integer]
250
258
  def output()
@@ -255,7 +263,7 @@ module CZMQ
255
263
  end
256
264
 
257
265
  # Read chunk from file at specified position. If this was the last chunk,
258
- # sets the eof property. Returns a null chunk in case of error.
266
+ # sets the eof property. Returns a null chunk in case of error.
259
267
  #
260
268
  # @param bytes [Integer, #to_int, #to_i]
261
269
  # @param offset [::FFI::Pointer, #to_ptr]
@@ -280,7 +288,7 @@ module CZMQ
280
288
  end
281
289
 
282
290
  # Write chunk to file at specified position
283
- # Return 0 if OK, else -1
291
+ # Return 0 if OK, else -1
284
292
  #
285
293
  # @param chunk [Zchunk, #__ptr]
286
294
  # @param offset [::FFI::Pointer, #to_ptr]
@@ -294,7 +302,7 @@ module CZMQ
294
302
  end
295
303
 
296
304
  # Read next line of text from file. Returns a pointer to the text line,
297
- # or NULL if there was nothing more to read from the file.
305
+ # or NULL if there was nothing more to read from the file.
298
306
  #
299
307
  # @return [String]
300
308
  def readln()