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.
Files changed (34) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +8 -0
  3. data/lib/czmq-ffi-gen/czmq/ffi/zactor.rb +40 -7
  4. data/lib/czmq-ffi-gen/czmq/ffi/zargs.rb +259 -0
  5. data/lib/czmq-ffi-gen/czmq/ffi/zarmour.rb +3 -3
  6. data/lib/czmq-ffi-gen/czmq/ffi/zcert.rb +15 -6
  7. data/lib/czmq-ffi-gen/czmq/ffi/zcertstore.rb +25 -11
  8. data/lib/czmq-ffi-gen/czmq/ffi/zchunk.rb +18 -18
  9. data/lib/czmq-ffi-gen/czmq/ffi/zclock.rb +6 -6
  10. data/lib/czmq-ffi-gen/czmq/ffi/zconfig.rb +27 -17
  11. data/lib/czmq-ffi-gen/czmq/ffi/zdigest.rb +4 -4
  12. data/lib/czmq-ffi-gen/czmq/ffi/zdir.rb +36 -36
  13. data/lib/czmq-ffi-gen/czmq/ffi/zdir_patch.rb +1 -1
  14. data/lib/czmq-ffi-gen/czmq/ffi/zfile.rb +27 -19
  15. data/lib/czmq-ffi-gen/czmq/ffi/zframe.rb +22 -21
  16. data/lib/czmq-ffi-gen/czmq/ffi/zhash.rb +54 -54
  17. data/lib/czmq-ffi-gen/czmq/ffi/zhashx.rb +82 -80
  18. data/lib/czmq-ffi-gen/czmq/ffi/ziflist.rb +30 -0
  19. data/lib/czmq-ffi-gen/czmq/ffi/zlist.rb +30 -30
  20. data/lib/czmq-ffi-gen/czmq/ffi/zlistx.rb +44 -44
  21. data/lib/czmq-ffi-gen/czmq/ffi/zloop.rb +39 -39
  22. data/lib/czmq-ffi-gen/czmq/ffi/zmsg.rb +46 -46
  23. data/lib/czmq-ffi-gen/czmq/ffi/zpoller.rb +16 -16
  24. data/lib/czmq-ffi-gen/czmq/ffi/zproc.rb +237 -34
  25. data/lib/czmq-ffi-gen/czmq/ffi/zsock.rb +1201 -973
  26. data/lib/czmq-ffi-gen/czmq/ffi/zstr.rb +58 -19
  27. data/lib/czmq-ffi-gen/czmq/ffi/zsys.rb +836 -0
  28. data/lib/czmq-ffi-gen/czmq/ffi/ztimerset.rb +6 -6
  29. data/lib/czmq-ffi-gen/czmq/ffi/ztrie.rb +10 -10
  30. data/lib/czmq-ffi-gen/czmq/ffi/zuuid.rb +4 -4
  31. data/lib/czmq-ffi-gen/czmq/ffi.rb +224 -698
  32. data/lib/czmq-ffi-gen/gem_version.rb +1 -1
  33. data/lib/czmq-ffi-gen/vendor.rb +9 -1
  34. metadata +5 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6513e81d88e575dca1b7746d5e1a9bf22ac47426
4
- data.tar.gz: 10a74a54e3db24ba434d0b0cfd0b559fd554714b
3
+ metadata.gz: b634e62bd8c72143a970934c9725f5a9067e3952
4
+ data.tar.gz: fbdaeaab8b805c156b252795cf03c6e65302fafd
5
5
  SHA512:
6
- metadata.gz: ecb3895cc443b32b04e37f2d66649c35c601416cf33c467b3034ddc4c002b43ffda221a14e991ef0106acd96b0560067b953b150f81e5100b48ef65f3a8d8408
7
- data.tar.gz: f62d6bf5f1a1b47ba4b049a7339a69edd9dd402c3f1f41d44aa0ed38616ba2c1e57f7ea1413b715022c2a08082636bc2b3c0490a5645bec51c1a55805babb588
6
+ metadata.gz: f152c3f1db2a4a823e42eebe5dbe3f2695a9efdb13b460e04d11a504fed55a4fb25ab36f5bdc17beb1f529cfedc93e9d7e9d29b0b6e317da95d59864d056ff35
7
+ data.tar.gz: a6d4854e57cbb1c266be6b3e4069ef6b32b806b6d13c372d294e4394ca94f8493122193a6281ac3a33c5490ea0ad936632692527c54915500efb650554c56bb3
data/CHANGES.md CHANGED
@@ -1,3 +1,11 @@
1
+ 0.14.0 (11/27/2017)
2
+ -----
3
+ * on Windows with RubyInstaller2: fix loading libczmq
4
+ (thanks to Christian Boos)
5
+ * update CZMQ low-level binding to include the improvements on robustness
6
+ (zeromq/zproject#1010)
7
+ * CI: use recent rubies, but don't test MRI 2.1 anymore
8
+
1
9
  0.13.0 (01/01/2017)
2
10
  -----
3
11
  * update CZMQ low-level binding to v4.0.2 to fix #7
@@ -75,7 +75,7 @@ module CZMQ
75
75
 
76
76
  # Create a new callback of the following type:
77
77
  # Actors get a pipe and arguments from caller
78
- # typedef void (zactor_fn) (
78
+ # typedef void (zactor_fn) (
79
79
  # zsock_t *pipe, void *args);
80
80
  #
81
81
  # @note WARNING: If your Ruby code doesn't retain a reference to the
@@ -90,6 +90,28 @@ module CZMQ
90
90
  end
91
91
  end
92
92
 
93
+ # Create a new callback of the following type:
94
+ # Function to be called on zactor_destroy. Default behavior is to send zmsg_t with string "$TERM" in a first frame.
95
+ #
96
+ # An example - to send $KTHXBAI string
97
+ #
98
+ # if (zstr_send (self->pipe, "$KTHXBAI") == 0)
99
+ # zsock_wait (self->pipe);
100
+ # typedef void (zactor_destructor_fn) (
101
+ # zactor_t *self);
102
+ #
103
+ # @note WARNING: If your Ruby code doesn't retain a reference to the
104
+ # FFI::Function object after passing it to a C function call,
105
+ # it may be garbage collected while C still holds the pointer,
106
+ # potentially resulting in a segmentation fault.
107
+ def self.destructor_fn
108
+ ::FFI::Function.new :void, [:pointer], blocking: true do |self_|
109
+ self_ = Zactor.__new self_, false
110
+ result = yield self_
111
+ result
112
+ end
113
+ end
114
+
93
115
  # Create a new actor passing arbitrary arguments reference.
94
116
  # @param task [::FFI::Pointer, #to_ptr]
95
117
  # @param args [::FFI::Pointer, #to_ptr]
@@ -110,7 +132,7 @@ module CZMQ
110
132
  end
111
133
 
112
134
  # Send a zmsg message to the actor, take ownership of the message
113
- # and destroy when it has been sent.
135
+ # and destroy when it has been sent.
114
136
  #
115
137
  # @param msg_p [#__ptr_give_ref]
116
138
  # @return [Integer]
@@ -122,9 +144,9 @@ module CZMQ
122
144
  result
123
145
  end
124
146
 
125
- # Receive a zmsg message from the actor. Returns NULL if the actor
147
+ # Receive a zmsg message from the actor. Returns NULL if the actor
126
148
  # was interrupted before the message could be received, or if there
127
- # was a timeout on the actor.
149
+ # was a timeout on the actor.
128
150
  #
129
151
  # @return [Zmsg]
130
152
  def recv()
@@ -145,8 +167,8 @@ module CZMQ
145
167
  end
146
168
 
147
169
  # Probe the supplied reference. If it looks like a zactor_t instance,
148
- # return the underlying libzmq actor handle; else if it looks like
149
- # a libzmq actor handle, return the supplied value.
170
+ # return the underlying libzmq actor handle; else if it looks like
171
+ # a libzmq actor handle, return the supplied value.
150
172
  #
151
173
  # @param self_ [::FFI::Pointer, #to_ptr]
152
174
  # @return [::FFI::Pointer]
@@ -156,7 +178,7 @@ module CZMQ
156
178
  end
157
179
 
158
180
  # Return the actor's zsock handle. Use this when you absolutely need
159
- # to work with the zsock instance rather than the actor.
181
+ # to work with the zsock instance rather than the actor.
160
182
  #
161
183
  # @return [Zsock]
162
184
  def sock()
@@ -167,6 +189,17 @@ module CZMQ
167
189
  result
168
190
  end
169
191
 
192
+ # Change default destructor by custom function. Actor MUST be able to handle new message instead of default $TERM.
193
+ #
194
+ # @param destructor [::FFI::Pointer, #to_ptr]
195
+ # @return [void]
196
+ def set_destructor(destructor)
197
+ raise DestroyedError unless @ptr
198
+ self_p = @ptr
199
+ result = ::CZMQ::FFI.zactor_set_destructor(self_p, destructor)
200
+ result
201
+ end
202
+
170
203
  # Self test of this class.
171
204
  #
172
205
  # @param verbose [Boolean]
@@ -0,0 +1,259 @@
1
+ ################################################################################
2
+ # THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
3
+ # Read the zproject/README.md for information about making permanent changes. #
4
+ ################################################################################
5
+
6
+ module CZMQ
7
+ module FFI
8
+
9
+ # Platform independent command line argument parsing helpers
10
+ #
11
+ # There are two kind of elements provided by this class
12
+ # foo --named-parameter --parameter with_value positional arguments -a gain-parameter
13
+ # zargs keeps poision only for arguments, parameters are to be accessed like hash.
14
+ #
15
+ # It DOES:
16
+ # * provide easy to use CLASS compatible API for accessing argv
17
+ # * is platform independent
18
+ # * provide getopt_long style -- argument, which delimits parameters from arguments
19
+ # * makes parameters positon independent
20
+ #
21
+ # It does NOT
22
+ # * change argv
23
+ # * provide a "declarative" way to define command line interface
24
+ #
25
+ # In future it SHALL
26
+ # * hide several formats of command line to one (-Idir, --include=dir,
27
+ # --include dir are the same from API pov)
28
+ # @note This class is 100% generated using zproject.
29
+ class Zargs
30
+ # Raised when one tries to use an instance of {Zargs} after
31
+ # the internal pointer to the native object has been nullified.
32
+ class DestroyedError < RuntimeError; end
33
+
34
+ # Boilerplate for self pointer, initializer, and finalizer
35
+ class << self
36
+ alias :__new :new
37
+ end
38
+ # Attaches the pointer _ptr_ to this instance and defines a finalizer for
39
+ # it if necessary.
40
+ # @param ptr [::FFI::Pointer]
41
+ # @param finalize [Boolean]
42
+ def initialize(ptr, finalize = true)
43
+ @ptr = ptr
44
+ if @ptr.null?
45
+ @ptr = nil # Remove null pointers so we don't have to test for them.
46
+ elsif finalize
47
+ @finalizer = self.class.create_finalizer_for @ptr
48
+ ObjectSpace.define_finalizer self, @finalizer
49
+ end
50
+ end
51
+ # @param ptr [::FFI::Pointer]
52
+ # @return [Proc]
53
+ def self.create_finalizer_for(ptr)
54
+ Proc.new do
55
+ ptr_ptr = ::FFI::MemoryPointer.new :pointer
56
+ ptr_ptr.write_pointer ptr
57
+ ::CZMQ::FFI.zargs_destroy ptr_ptr
58
+ end
59
+ end
60
+ # @return [Boolean]
61
+ def null?
62
+ !@ptr or @ptr.null?
63
+ end
64
+ # Return internal pointer
65
+ # @return [::FFI::Pointer]
66
+ def __ptr
67
+ raise DestroyedError unless @ptr
68
+ @ptr
69
+ end
70
+ # So external Libraries can just pass the Object to a FFI function which expects a :pointer
71
+ alias_method :to_ptr, :__ptr
72
+ # Nullify internal pointer and return pointer pointer.
73
+ # @note This detaches the current instance from the native object
74
+ # and thus makes it unusable.
75
+ # @return [::FFI::MemoryPointer] the pointer pointing to a pointer
76
+ # pointing to the native object
77
+ def __ptr_give_ref
78
+ raise DestroyedError unless @ptr
79
+ ptr_ptr = ::FFI::MemoryPointer.new :pointer
80
+ ptr_ptr.write_pointer @ptr
81
+ __undef_finalizer if @finalizer
82
+ @ptr = nil
83
+ ptr_ptr
84
+ end
85
+ # Undefines the finalizer for this object.
86
+ # @note Only use this if you need to and can guarantee that the native
87
+ # object will be freed by other means.
88
+ # @return [void]
89
+ def __undef_finalizer
90
+ ObjectSpace.undefine_finalizer self
91
+ @finalizer = nil
92
+ end
93
+
94
+ # Create a new zargs from command line arguments.
95
+ # @param argc [Integer, #to_int, #to_i]
96
+ # @param argv [::FFI::Pointer, #to_ptr]
97
+ # @return [CZMQ::Zargs]
98
+ def self.new(argc, argv)
99
+ argc = Integer(argc)
100
+ ptr = ::CZMQ::FFI.zargs_new(argc, argv)
101
+ __new ptr
102
+ end
103
+
104
+ # Destroy zargs instance.
105
+ #
106
+ # @return [void]
107
+ def destroy()
108
+ return unless @ptr
109
+ self_p = __ptr_give_ref
110
+ result = ::CZMQ::FFI.zargs_destroy(self_p)
111
+ result
112
+ end
113
+
114
+ # Return program name (argv[0])
115
+ #
116
+ # @return [String]
117
+ def progname()
118
+ raise DestroyedError unless @ptr
119
+ self_p = @ptr
120
+ result = ::CZMQ::FFI.zargs_progname(self_p)
121
+ result
122
+ end
123
+
124
+ # Return number of positional arguments
125
+ #
126
+ # @return [Integer]
127
+ def arguments()
128
+ raise DestroyedError unless @ptr
129
+ self_p = @ptr
130
+ result = ::CZMQ::FFI.zargs_arguments(self_p)
131
+ result
132
+ end
133
+
134
+ # Return first positional argument or NULL
135
+ #
136
+ # @return [String]
137
+ def first()
138
+ raise DestroyedError unless @ptr
139
+ self_p = @ptr
140
+ result = ::CZMQ::FFI.zargs_first(self_p)
141
+ result
142
+ end
143
+
144
+ # Return next positional argument or NULL
145
+ #
146
+ # @return [String]
147
+ def next()
148
+ raise DestroyedError unless @ptr
149
+ self_p = @ptr
150
+ result = ::CZMQ::FFI.zargs_next(self_p)
151
+ result
152
+ end
153
+
154
+ # Return first named parameter value, or NULL if there are no named
155
+ # parameters, or value for which zargs_param_empty (arg) returns true.
156
+ #
157
+ # @return [String]
158
+ def param_first()
159
+ raise DestroyedError unless @ptr
160
+ self_p = @ptr
161
+ result = ::CZMQ::FFI.zargs_param_first(self_p)
162
+ result
163
+ end
164
+
165
+ # Return next named parameter value, or NULL if there are no named
166
+ # parameters, or value for which zargs_param_empty (arg) returns true.
167
+ #
168
+ # @return [String]
169
+ def param_next()
170
+ raise DestroyedError unless @ptr
171
+ self_p = @ptr
172
+ result = ::CZMQ::FFI.zargs_param_next(self_p)
173
+ result
174
+ end
175
+
176
+ # Return current parameter name, or NULL if there are no named
177
+ # parameters.
178
+ #
179
+ # @return [String]
180
+ def param_name()
181
+ raise DestroyedError unless @ptr
182
+ self_p = @ptr
183
+ result = ::CZMQ::FFI.zargs_param_name(self_p)
184
+ result
185
+ end
186
+
187
+ # Return value of named parameter, NULL if no given parameter has
188
+ # been specified, or special value for wich zargs_param_empty ()
189
+ # returns true.
190
+ #
191
+ # @param keys [String, #to_s, nil]
192
+ # @return [String]
193
+ def param_lookup(keys)
194
+ raise DestroyedError unless @ptr
195
+ self_p = @ptr
196
+ result = ::CZMQ::FFI.zargs_param_lookup(self_p, keys)
197
+ result
198
+ end
199
+
200
+ # Return value of named parameter(s), NULL if no given parameter has
201
+ # been specified, or special value for wich zargs_param_empty ()
202
+ # returns true.
203
+ #
204
+ # @param keys [String, #to_s, nil]
205
+ # @param args [Array<Object>] see https://github.com/ffi/ffi/wiki/examples#using-varargs
206
+ # @return [String]
207
+ def param_lookupx(keys, *args)
208
+ raise DestroyedError unless @ptr
209
+ self_p = @ptr
210
+ result = ::CZMQ::FFI.zargs_param_lookupx(self_p, keys, *args)
211
+ result
212
+ end
213
+
214
+ # Returns true if there are --help -h arguments
215
+ #
216
+ # @return [Boolean]
217
+ def has_help()
218
+ raise DestroyedError unless @ptr
219
+ self_p = @ptr
220
+ result = ::CZMQ::FFI.zargs_has_help(self_p)
221
+ result
222
+ end
223
+
224
+ # Returns true if parameter did not have a value
225
+ #
226
+ # @param arg [String, #to_s, nil]
227
+ # @return [Boolean]
228
+ def self.param_empty(arg)
229
+ result = ::CZMQ::FFI.zargs_param_empty(arg)
230
+ result
231
+ end
232
+
233
+ # Print an instance of zargs.
234
+ #
235
+ # @return [void]
236
+ def print()
237
+ raise DestroyedError unless @ptr
238
+ self_p = @ptr
239
+ result = ::CZMQ::FFI.zargs_print(self_p)
240
+ result
241
+ end
242
+
243
+ # Self test of this class.
244
+ #
245
+ # @param verbose [Boolean]
246
+ # @return [void]
247
+ def self.test(verbose)
248
+ verbose = !(0==verbose||!verbose) # boolean
249
+ result = ::CZMQ::FFI.zargs_test(verbose)
250
+ result
251
+ end
252
+ end
253
+ end
254
+ end
255
+
256
+ ################################################################################
257
+ # THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
258
+ # Read the zproject/README.md for information about making permanent changes. #
259
+ ################################################################################
@@ -110,7 +110,7 @@ module CZMQ
110
110
 
111
111
  # Encode a stream of bytes into an armoured string. Returns the armoured
112
112
  # string, or NULL if there was insufficient memory available to allocate
113
- # a new string.
113
+ # a new string.
114
114
  #
115
115
  # @param data [::FFI::Pointer, #to_ptr]
116
116
  # @param size [Integer, #to_int, #to_i]
@@ -124,9 +124,9 @@ module CZMQ
124
124
  result
125
125
  end
126
126
 
127
- # Decode an armoured string into a chunk. The decoded output is
127
+ # Decode an armoured string into a chunk. The decoded output is
128
128
  # null-terminated, so it may be treated as a string, if that's what
129
- # it was prior to encoding.
129
+ # it was prior to encoding.
130
130
  #
131
131
  # @param data [String, #to_s, nil]
132
132
  # @return [Zchunk]
@@ -89,6 +89,15 @@ module CZMQ
89
89
  __new ptr
90
90
  end
91
91
 
92
+ # Accepts public/secret key text pair from caller
93
+ # @param public_txt [String, #to_s, nil]
94
+ # @param secret_txt [String, #to_s, nil]
95
+ # @return [CZMQ::Zcert]
96
+ def self.new_from_txt(public_txt, secret_txt)
97
+ ptr = ::CZMQ::FFI.zcert_new_from_txt(public_txt, secret_txt)
98
+ __new ptr
99
+ end
100
+
92
101
  # Load certificate from file
93
102
  # @param filename [String, #to_s, nil]
94
103
  # @return [CZMQ::Zcert]
@@ -172,7 +181,7 @@ module CZMQ
172
181
  end
173
182
 
174
183
  # Get metadata value from certificate; if the metadata value doesn't
175
- # exist, returns NULL.
184
+ # exist, returns NULL.
176
185
  #
177
186
  # @param name [String, #to_s, nil]
178
187
  # @return [String]
@@ -184,7 +193,7 @@ module CZMQ
184
193
  end
185
194
 
186
195
  # Get list of metadata fields from certificate. Caller is responsible for
187
- # destroying list. Caller should not modify the values of list items.
196
+ # destroying list. Caller should not modify the values of list items.
188
197
  #
189
198
  # @return [Zlist]
190
199
  def meta_keys()
@@ -195,7 +204,7 @@ module CZMQ
195
204
  result
196
205
  end
197
206
 
198
- # Save full certificate (public + secret) to file for persistent storage
207
+ # Save full certificate (public + secret) to file for persistent storage
199
208
  # This creates one public file and one secret file (filename + "_secret").
200
209
  #
201
210
  # @param filename [String, #to_s, nil]
@@ -230,8 +239,8 @@ module CZMQ
230
239
  end
231
240
 
232
241
  # Apply certificate to socket, i.e. use for CURVE security on socket.
233
- # If certificate was loaded from public file, the secret key will be
234
- # undefined, and this certificate will not work successfully.
242
+ # If certificate was loaded from public file, the secret key will be
243
+ # undefined, and this certificate will not work successfully.
235
244
  #
236
245
  # @param socket [::FFI::Pointer, #to_ptr]
237
246
  # @return [void]
@@ -243,7 +252,7 @@ module CZMQ
243
252
  end
244
253
 
245
254
  # Return copy of certificate; if certificate is NULL or we exhausted
246
- # heap memory, returns NULL.
255
+ # heap memory, returns NULL.
247
256
  #
248
257
  # @return [Zcert]
249
258
  def dup()
@@ -76,7 +76,7 @@ module CZMQ
76
76
  # Create a new callback of the following type:
77
77
  # Loaders retrieve certificates from an arbitrary source.
78
78
  # typedef void (zcertstore_loader) (
79
- # zcertstore_t *self);
79
+ # zcertstore_t *self);
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,
@@ -93,7 +93,7 @@ module CZMQ
93
93
  # Create a new callback of the following type:
94
94
  # Destructor for loader state.
95
95
  # typedef void (zcertstore_destructor) (
96
- # void **self_p);
96
+ # void **self_p);
97
97
  #
98
98
  # @note WARNING: If your Ruby code doesn't retain a reference to the
99
99
  # FFI::Function object after passing it to a C function call,
@@ -106,12 +106,12 @@ module CZMQ
106
106
  end
107
107
  end
108
108
 
109
- # Create a new certificate store from a disk directory, loading and
110
- # indexing all certificates in that location. The directory itself may be
109
+ # Create a new certificate store from a disk directory, loading and
110
+ # indexing all certificates in that location. The directory itself may be
111
111
  # absent, and created later, or modified at any time. The certificate store
112
- # is automatically refreshed on any zcertstore_lookup() call. If the
113
- # location is specified as NULL, creates a pure-memory store, which you
114
- # can work with by inserting certificates at runtime.
112
+ # is automatically refreshed on any zcertstore_lookup() call. If the
113
+ # location is specified as NULL, creates a pure-memory store, which you
114
+ # can work with by inserting certificates at runtime.
115
115
  # @param location [String, #to_s, nil]
116
116
  # @return [CZMQ::Zcertstore]
117
117
  def self.new(location)
@@ -120,7 +120,7 @@ module CZMQ
120
120
  end
121
121
 
122
122
  # Destroy a certificate store object in memory. Does not affect anything
123
- # stored on disk.
123
+ # stored on disk.
124
124
  #
125
125
  # @return [void]
126
126
  def destroy()
@@ -144,7 +144,7 @@ module CZMQ
144
144
  end
145
145
 
146
146
  # Look up certificate by public key, returns zcert_t object if found,
147
- # else returns NULL. The public key is provided in Z85 text format.
147
+ # else returns NULL. The public key is provided in Z85 text format.
148
148
  #
149
149
  # @param public_key [String, #to_s, nil]
150
150
  # @return [Zcert]
@@ -158,7 +158,7 @@ module CZMQ
158
158
 
159
159
  # Insert certificate into certificate store in memory. Note that this
160
160
  # does not save the certificate to disk. To do that, use zcert_save()
161
- # directly on the certificate. Takes ownership of zcert_t object.
161
+ # directly on the certificate. Takes ownership of zcert_t object.
162
162
  #
163
163
  # @param cert_p [#__ptr_give_ref]
164
164
  # @return [void]
@@ -171,7 +171,7 @@ module CZMQ
171
171
  end
172
172
 
173
173
  # Empty certificate hashtable. This wrapper exists to be friendly to bindings,
174
- # which don't usually have access to struct internals.
174
+ # which don't usually have access to struct internals.
175
175
  #
176
176
  # @return [void]
177
177
  def empty()
@@ -191,6 +191,20 @@ module CZMQ
191
191
  result
192
192
  end
193
193
 
194
+ # Return a list of all the certificates in the store.
195
+ # The caller takes ownership of the zlistx_t object and is responsible
196
+ # for destroying it. The caller does not take ownership of the zcert_t
197
+ # objects.
198
+ #
199
+ # @return [Zlistx]
200
+ def certs()
201
+ raise DestroyedError unless @ptr
202
+ self_p = @ptr
203
+ result = ::CZMQ::FFI.zcertstore_certs(self_p)
204
+ result = Zlistx.__new result, true
205
+ result
206
+ end
207
+
194
208
  # Self test of this class
195
209
  #
196
210
  # @param verbose [Boolean]
@@ -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()