czmq-ffi-gen 0.13.0 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +8 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zactor.rb +40 -7
- data/lib/czmq-ffi-gen/czmq/ffi/zargs.rb +259 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zarmour.rb +3 -3
- data/lib/czmq-ffi-gen/czmq/ffi/zcert.rb +15 -6
- data/lib/czmq-ffi-gen/czmq/ffi/zcertstore.rb +25 -11
- data/lib/czmq-ffi-gen/czmq/ffi/zchunk.rb +18 -18
- data/lib/czmq-ffi-gen/czmq/ffi/zclock.rb +6 -6
- data/lib/czmq-ffi-gen/czmq/ffi/zconfig.rb +27 -17
- data/lib/czmq-ffi-gen/czmq/ffi/zdigest.rb +4 -4
- data/lib/czmq-ffi-gen/czmq/ffi/zdir.rb +36 -36
- data/lib/czmq-ffi-gen/czmq/ffi/zdir_patch.rb +1 -1
- data/lib/czmq-ffi-gen/czmq/ffi/zfile.rb +27 -19
- data/lib/czmq-ffi-gen/czmq/ffi/zframe.rb +22 -21
- data/lib/czmq-ffi-gen/czmq/ffi/zhash.rb +54 -54
- data/lib/czmq-ffi-gen/czmq/ffi/zhashx.rb +82 -80
- data/lib/czmq-ffi-gen/czmq/ffi/ziflist.rb +30 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zlist.rb +30 -30
- data/lib/czmq-ffi-gen/czmq/ffi/zlistx.rb +44 -44
- data/lib/czmq-ffi-gen/czmq/ffi/zloop.rb +39 -39
- data/lib/czmq-ffi-gen/czmq/ffi/zmsg.rb +46 -46
- data/lib/czmq-ffi-gen/czmq/ffi/zpoller.rb +16 -16
- data/lib/czmq-ffi-gen/czmq/ffi/zproc.rb +237 -34
- data/lib/czmq-ffi-gen/czmq/ffi/zsock.rb +1201 -973
- data/lib/czmq-ffi-gen/czmq/ffi/zstr.rb +58 -19
- data/lib/czmq-ffi-gen/czmq/ffi/zsys.rb +836 -0
- data/lib/czmq-ffi-gen/czmq/ffi/ztimerset.rb +6 -6
- data/lib/czmq-ffi-gen/czmq/ffi/ztrie.rb +10 -10
- data/lib/czmq-ffi-gen/czmq/ffi/zuuid.rb +4 -4
- data/lib/czmq-ffi-gen/czmq/ffi.rb +224 -698
- data/lib/czmq-ffi-gen/gem_version.rb +1 -1
- data/lib/czmq-ffi-gen/vendor.rb +9 -1
- metadata +5 -3
@@ -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]
|
@@ -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()
|
@@ -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
|
-
#
|
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]
|