czmq-ffi-gen 0.14.1 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a14dcb22cecec46e3fdfa9ad58d541ea1d79fe74
4
- data.tar.gz: c00ab4471a0bb69abd1ed415120a07845c4bb40e
3
+ metadata.gz: 385ee7e824a0e1dff718d374dd1edb70859e55ab
4
+ data.tar.gz: f9d3e26d677f11dbf6cb0b0f59094570d52f508f
5
5
  SHA512:
6
- metadata.gz: 8b868d2bfc6e91798c0c773f5a09670e829b01310d3c227129f5c8db235c9169c2d1689dcab906ed2a269153863266c56d6d01ea319298e825700056ea800141
7
- data.tar.gz: 46582e36161d3b6d4db4a94b9c2fac3df86463c91cb3e57f74031e6a0d861cd4d2d2b50fe96af479119f9a789c6cb5089868bc3882410e31702f050e985b0d0d
6
+ metadata.gz: 30d3bfdcab57c11a91739058f9244acb38538ab698d9cb9e81feef8fc9e1a9918ad6c23bcf1c6eb55b106befbeac8b6dffc1363f665cd4d46320a89d2de472e4
7
+ data.tar.gz: 7c7802743eaf98e517f09b1b88ed22e9a6b86bbe532bf69679bda5ff2fc72ab4afa06951fe1153b4f8a947e6b90b35288436b679b4854c156d2d2851cda5669c
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ 0.15.0 (03/04/2018)
2
+ -----
3
+ * update CZMQ low-level binding to include fixed errno for unsupported features (ENOTSUP)
4
+
1
5
  0.14.1 (11/29/2017)
2
6
  -----
3
7
  * update CZMQ low-level binding to include fixes for zmonitor events
@@ -204,6 +204,7 @@ module CZMQ
204
204
  attach_function :zconfig_str_load, [:string], :pointer, **opts
205
205
  attach_function :zconfig_str_save, [:pointer], :pointer, **opts
206
206
  attach_function :zconfig_has_changed, [:pointer], :bool, **opts
207
+ attach_function :zconfig_remove_subtree, [:pointer], :void, **opts
207
208
  attach_function :zconfig_remove, [:pointer], :void, **opts
208
209
  attach_function :zconfig_fprint, [:pointer, :pointer], :void, **opts
209
210
  attach_function :zconfig_print, [:pointer], :void, **opts
@@ -515,7 +516,9 @@ module CZMQ
515
516
 
516
517
  attach_function :zproc_new, [], :pointer, **opts
517
518
  attach_function :zproc_destroy, [:pointer], :void, **opts
519
+ attach_function :zproc_args, [:pointer], :pointer, **opts
518
520
  attach_function :zproc_set_args, [:pointer, :pointer], :void, **opts
521
+ attach_function :zproc_set_argsx, [:pointer, :string, :varargs], :void, **opts
519
522
  attach_function :zproc_set_env, [:pointer, :pointer], :void, **opts
520
523
  attach_function :zproc_set_stdin, [:pointer, :pointer], :void, **opts
521
524
  attach_function :zproc_set_stdout, [:pointer, :pointer], :void, **opts
@@ -531,24 +534,6 @@ module CZMQ
531
534
  attach_function :zproc_actor, [:pointer], :pointer, **opts
532
535
  attach_function :zproc_kill, [:pointer, :int], :void, **opts
533
536
  attach_function :zproc_set_verbose, [:pointer, :bool], :void, **opts
534
- attach_function :zproc_czmq_version, [], :int, **opts
535
- attach_function :zproc_interrupted, [], :bool, **opts
536
- attach_function :zproc_has_curve, [], :bool, **opts
537
- attach_function :zproc_hostname, [], :pointer, **opts
538
- attach_function :zproc_daemonize, [:string], :void, **opts
539
- attach_function :zproc_run_as, [:string, :string, :string], :void, **opts
540
- attach_function :zproc_set_io_threads, [:size_t], :void, **opts
541
- attach_function :zproc_set_max_sockets, [:size_t], :void, **opts
542
- attach_function :zproc_set_biface, [:string], :void, **opts
543
- attach_function :zproc_biface, [], :string, **opts
544
- attach_function :zproc_set_log_ident, [:string], :void, **opts
545
- attach_function :zproc_set_log_sender, [:string], :void, **opts
546
- attach_function :zproc_set_log_system, [:bool], :void, **opts
547
- attach_function :zproc_log_error, [:string, :varargs], :void, **opts
548
- attach_function :zproc_log_warning, [:string, :varargs], :void, **opts
549
- attach_function :zproc_log_notice, [:string, :varargs], :void, **opts
550
- attach_function :zproc_log_info, [:string, :varargs], :void, **opts
551
- attach_function :zproc_log_debug, [:string, :varargs], :void, **opts
552
537
  attach_function :zproc_test, [:bool], :void, **opts
553
538
 
554
539
  require_relative 'ffi/zproc'
@@ -763,6 +748,8 @@ module CZMQ
763
748
  attach_function :zsys_handler_set, [:pointer], :void, **opts
764
749
  attach_function :zsys_handler_reset, [], :void, **opts
765
750
  attach_function :zsys_catch_interrupts, [], :void, **opts
751
+ attach_function :zsys_is_interrupted, [], :bool, **opts
752
+ attach_function :zsys_set_interrupted, [], :void, **opts
766
753
  attach_function :zsys_file_exists, [:string], :bool, **opts
767
754
  attach_function :zsys_file_modified, [:string], :pointer, **opts
768
755
  attach_function :zsys_file_mode, [:string], :int, **opts
@@ -5,7 +5,7 @@
5
5
 
6
6
  module CZMQ
7
7
  module FFI
8
- VERSION = '4.0.3'
8
+ VERSION = '4.1.1'
9
9
  end
10
10
  end
11
11
 
@@ -95,8 +95,8 @@ module CZMQ
95
95
  #
96
96
  # An example - to send $KTHXBAI string
97
97
  #
98
- # if (zstr_send (self->pipe, "$KTHXBAI") == 0)
99
- # zsock_wait (self->pipe);
98
+ # if (zstr_send (self, "$KTHXBAI") == 0)
99
+ # zsock_wait (self);
100
100
  # typedef void (zactor_destructor_fn) (
101
101
  # zactor_t *self);
102
102
  #
@@ -402,12 +402,22 @@ module CZMQ
402
402
  result
403
403
  end
404
404
 
405
- # Destroy subtree (child)
405
+ # Destroy subtree (all children)
406
406
  #
407
407
  # @return [void]
408
- def remove()
408
+ def remove_subtree()
409
409
  raise DestroyedError unless @ptr
410
410
  self_p = @ptr
411
+ result = ::CZMQ::FFI.zconfig_remove_subtree(self_p)
412
+ result
413
+ end
414
+
415
+ # Destroy node and subtree (all children)
416
+ #
417
+ # @param self_p [#__ptr_give_ref]
418
+ # @return [void]
419
+ def self.remove(self_p)
420
+ self_p = self_p.__ptr_give_ref
411
421
  result = ::CZMQ::FFI.zconfig_remove(self_p)
412
422
  result
413
423
  end
@@ -92,28 +92,53 @@ module CZMQ
92
92
  result
93
93
  end
94
94
 
95
+ # Return command line arguments (the first item is the executable) or
96
+ # NULL if not set.
97
+ #
98
+ # @return [Zlist]
99
+ def args()
100
+ raise DestroyedError unless @ptr
101
+ self_p = @ptr
102
+ result = ::CZMQ::FFI.zproc_args(self_p)
103
+ result = Zlist.__new result, true
104
+ result
105
+ end
106
+
95
107
  # Setup the command line arguments, the first item must be an (absolute) filename
96
108
  # to run.
97
109
  #
98
- # @param args [Zlistx, #__ptr]
110
+ # @param arguments [#__ptr_give_ref]
99
111
  # @return [void]
100
- def set_args(args)
112
+ def set_args(arguments)
101
113
  raise DestroyedError unless @ptr
102
114
  self_p = @ptr
103
- args = args.__ptr if args
104
- result = ::CZMQ::FFI.zproc_set_args(self_p, args)
115
+ arguments = arguments.__ptr_give_ref
116
+ result = ::CZMQ::FFI.zproc_set_args(self_p, arguments)
117
+ result
118
+ end
119
+
120
+ # Setup the command line arguments, the first item must be an (absolute) filename
121
+ # to run. Variadic function, must be NULL terminated.
122
+ #
123
+ # @param arguments [String, #to_s, nil]
124
+ # @param args [Array<Object>] see https://github.com/ffi/ffi/wiki/examples#using-varargs
125
+ # @return [void]
126
+ def set_argsx(arguments, *args)
127
+ raise DestroyedError unless @ptr
128
+ self_p = @ptr
129
+ result = ::CZMQ::FFI.zproc_set_argsx(self_p, arguments, *args)
105
130
  result
106
131
  end
107
132
 
108
133
  # Setup the environment variables for the process.
109
134
  #
110
- # @param args [Zhashx, #__ptr]
135
+ # @param arguments [#__ptr_give_ref]
111
136
  # @return [void]
112
- def set_env(args)
137
+ def set_env(arguments)
113
138
  raise DestroyedError unless @ptr
114
139
  self_p = @ptr
115
- args = args.__ptr if args
116
- result = ::CZMQ::FFI.zproc_set_env(self_p, args)
140
+ arguments = arguments.__ptr_give_ref
141
+ result = ::CZMQ::FFI.zproc_set_env(self_p, arguments)
117
142
  result
118
143
  end
119
144
 
@@ -189,7 +214,7 @@ module CZMQ
189
214
  result
190
215
  end
191
216
 
192
- # Starts the process.
217
+ # Starts the process, return just before execve/CreateProcess.
193
218
  #
194
219
  # @return [Integer]
195
220
  def run()
@@ -275,209 +300,6 @@ module CZMQ
275
300
  result
276
301
  end
277
302
 
278
- # Returns CZMQ version as a single 6-digit integer encoding the major
279
- # version (x 10000), the minor version (x 100) and the patch.
280
- #
281
- # @return [Integer]
282
- def self.czmq_version()
283
- result = ::CZMQ::FFI.zproc_czmq_version()
284
- result
285
- end
286
-
287
- # Returns true if the process received a SIGINT or SIGTERM signal.
288
- # It is good practice to use this method to exit any infinite loop
289
- # processing messages.
290
- #
291
- # @return [Boolean]
292
- def self.interrupted()
293
- result = ::CZMQ::FFI.zproc_interrupted()
294
- result
295
- end
296
-
297
- # Returns true if the underlying libzmq supports CURVE security.
298
- #
299
- # @return [Boolean]
300
- def self.has_curve()
301
- result = ::CZMQ::FFI.zproc_has_curve()
302
- result
303
- end
304
-
305
- # Return current host name, for use in public tcp:// endpoints.
306
- # If the host name is not resolvable, returns NULL.
307
- #
308
- # @return [::FFI::AutoPointer]
309
- def self.hostname()
310
- result = ::CZMQ::FFI.zproc_hostname()
311
- result = ::FFI::AutoPointer.new(result, LibC.method(:free))
312
- result
313
- end
314
-
315
- # Move the current process into the background. The precise effect
316
- # depends on the operating system. On POSIX boxes, moves to a specified
317
- # working directory (if specified), closes all file handles, reopens
318
- # stdin, stdout, and stderr to the null device, and sets the process to
319
- # ignore SIGHUP. On Windows, does nothing. Returns 0 if OK, -1 if there
320
- # was an error.
321
- #
322
- # @param workdir [String, #to_s, nil]
323
- # @return [void]
324
- def self.daemonize(workdir)
325
- result = ::CZMQ::FFI.zproc_daemonize(workdir)
326
- result
327
- end
328
-
329
- # Drop the process ID into the lockfile, with exclusive lock, and
330
- # switch the process to the specified group and/or user. Any of the
331
- # arguments may be null, indicating a no-op. Returns 0 on success,
332
- # -1 on failure. Note if you combine this with zsys_daemonize, run
333
- # after, not before that method, or the lockfile will hold the wrong
334
- # process ID.
335
- #
336
- # @param lockfile [String, #to_s, nil]
337
- # @param group [String, #to_s, nil]
338
- # @param user [String, #to_s, nil]
339
- # @return [void]
340
- def self.run_as(lockfile, group, user)
341
- result = ::CZMQ::FFI.zproc_run_as(lockfile, group, user)
342
- result
343
- end
344
-
345
- # Configure the number of I/O threads that ZeroMQ will use. A good
346
- # rule of thumb is one thread per gigabit of traffic in or out. The
347
- # default is 1, sufficient for most applications. If the environment
348
- # variable ZSYS_IO_THREADS is defined, that provides the default.
349
- # Note that this method is valid only before any socket is created.
350
- #
351
- # @param io_threads [Integer, #to_int, #to_i]
352
- # @return [void]
353
- def self.set_io_threads(io_threads)
354
- io_threads = Integer(io_threads)
355
- result = ::CZMQ::FFI.zproc_set_io_threads(io_threads)
356
- result
357
- end
358
-
359
- # Configure the number of sockets that ZeroMQ will allow. The default
360
- # is 1024. The actual limit depends on the system, and you can query it
361
- # by using zsys_socket_limit (). A value of zero means "maximum".
362
- # Note that this method is valid only before any socket is created.
363
- #
364
- # @param max_sockets [Integer, #to_int, #to_i]
365
- # @return [void]
366
- def self.set_max_sockets(max_sockets)
367
- max_sockets = Integer(max_sockets)
368
- result = ::CZMQ::FFI.zproc_set_max_sockets(max_sockets)
369
- result
370
- end
371
-
372
- # Set network interface name to use for broadcasts, particularly zbeacon.
373
- # This lets the interface be configured for test environments where required.
374
- # For example, on Mac OS X, zbeacon cannot bind to 255.255.255.255 which is
375
- # the default when there is no specified interface. If the environment
376
- # variable ZSYS_INTERFACE is set, use that as the default interface name.
377
- # Setting the interface to "*" means "use all available interfaces".
378
- #
379
- # @param value [String, #to_s, nil]
380
- # @return [void]
381
- def self.set_biface(value)
382
- result = ::CZMQ::FFI.zproc_set_biface(value)
383
- result
384
- end
385
-
386
- # Return network interface to use for broadcasts, or "" if none was set.
387
- #
388
- # @return [String]
389
- def self.biface()
390
- result = ::CZMQ::FFI.zproc_biface()
391
- result
392
- end
393
-
394
- # Set log identity, which is a string that prefixes all log messages sent
395
- # by this process. The log identity defaults to the environment variable
396
- # ZSYS_LOGIDENT, if that is set.
397
- #
398
- # @param value [String, #to_s, nil]
399
- # @return [void]
400
- def self.set_log_ident(value)
401
- result = ::CZMQ::FFI.zproc_set_log_ident(value)
402
- result
403
- end
404
-
405
- # Sends log output to a PUB socket bound to the specified endpoint. To
406
- # collect such log output, create a SUB socket, subscribe to the traffic
407
- # you care about, and connect to the endpoint. Log traffic is sent as a
408
- # single string frame, in the same format as when sent to stdout. The
409
- # log system supports a single sender; multiple calls to this method will
410
- # bind the same sender to multiple endpoints. To disable the sender, call
411
- # this method with a null argument.
412
- #
413
- # @param endpoint [String, #to_s, nil]
414
- # @return [void]
415
- def self.set_log_sender(endpoint)
416
- result = ::CZMQ::FFI.zproc_set_log_sender(endpoint)
417
- result
418
- end
419
-
420
- # Enable or disable logging to the system facility (syslog on POSIX boxes,
421
- # event log on Windows). By default this is disabled.
422
- #
423
- # @param logsystem [Boolean]
424
- # @return [void]
425
- def self.set_log_system(logsystem)
426
- logsystem = !(0==logsystem||!logsystem) # boolean
427
- result = ::CZMQ::FFI.zproc_set_log_system(logsystem)
428
- result
429
- end
430
-
431
- # Log error condition - highest priority
432
- #
433
- # @param format [String, #to_s, nil]
434
- # @param args [Array<Object>] see https://github.com/ffi/ffi/wiki/examples#using-varargs
435
- # @return [void]
436
- def self.log_error(format, *args)
437
- result = ::CZMQ::FFI.zproc_log_error(format, *args)
438
- result
439
- end
440
-
441
- # Log warning condition - high priority
442
- #
443
- # @param format [String, #to_s, nil]
444
- # @param args [Array<Object>] see https://github.com/ffi/ffi/wiki/examples#using-varargs
445
- # @return [void]
446
- def self.log_warning(format, *args)
447
- result = ::CZMQ::FFI.zproc_log_warning(format, *args)
448
- result
449
- end
450
-
451
- # Log normal, but significant, condition - normal priority
452
- #
453
- # @param format [String, #to_s, nil]
454
- # @param args [Array<Object>] see https://github.com/ffi/ffi/wiki/examples#using-varargs
455
- # @return [void]
456
- def self.log_notice(format, *args)
457
- result = ::CZMQ::FFI.zproc_log_notice(format, *args)
458
- result
459
- end
460
-
461
- # Log informational message - low priority
462
- #
463
- # @param format [String, #to_s, nil]
464
- # @param args [Array<Object>] see https://github.com/ffi/ffi/wiki/examples#using-varargs
465
- # @return [void]
466
- def self.log_info(format, *args)
467
- result = ::CZMQ::FFI.zproc_log_info(format, *args)
468
- result
469
- end
470
-
471
- # Log debug-level message - lowest priority
472
- #
473
- # @param format [String, #to_s, nil]
474
- # @param args [Array<Object>] see https://github.com/ffi/ffi/wiki/examples#using-varargs
475
- # @return [void]
476
- def self.log_debug(format, *args)
477
- result = ::CZMQ::FFI.zproc_log_debug(format, *args)
478
- result
479
- end
480
-
481
303
  # Self test of this class.
482
304
  #
483
305
  # @param verbose [Boolean]
@@ -197,6 +197,26 @@ module CZMQ
197
197
  result
198
198
  end
199
199
 
200
+ # Check if default interrupt handler of Ctrl-C or SIGTERM was called.
201
+ # Does not work if ZSYS_SIGHANDLER is false and code does not call
202
+ # set interrupted on signal.
203
+ #
204
+ # @return [Boolean]
205
+ def self.is_interrupted()
206
+ result = ::CZMQ::FFI.zsys_is_interrupted()
207
+ result
208
+ end
209
+
210
+ # Set interrupted flag. This is done by default signal handler, however
211
+ # this can be handy for language bindings or cases without default
212
+ # signal handler.
213
+ #
214
+ # @return [void]
215
+ def self.set_interrupted()
216
+ result = ::CZMQ::FFI.zsys_set_interrupted()
217
+ result
218
+ end
219
+
200
220
  # Return 1 if file exists, else zero
201
221
  #
202
222
  # @param filename [String, #to_s, nil]
@@ -1,5 +1,5 @@
1
1
  module CZMQ
2
2
  module FFI
3
- GEM_VERSION = "0.14.1"
3
+ GEM_VERSION = "0.15.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: czmq-ffi-gen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.1
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrik Wenger
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-11-29 00:00:00.000000000 Z
11
+ date: 2018-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi