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
@@ -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]