czmq-ffi-gen 0.16.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -18
- data/lib/czmq-ffi-gen/czmq/ffi.rb +58 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zcertstore.rb +10 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zframe.rb +17 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zmsg.rb +16 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zosc.rb +487 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zsock.rb +485 -0
- data/lib/czmq-ffi-gen/czmq/ffi/zsys.rb +50 -0
- data/lib/czmq-ffi-gen/gem_version.rb +1 -1
- data/lib/czmq-ffi-gen/versions.rb +0 -3
- metadata +13 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54df901872241cd24a89cf112ef7c5ad4d70add201cdb0530711e3164f59b7a1
|
4
|
+
data.tar.gz: 160874a60cb895fd1e958a3859cb72c945b2702fbe0a5a48c49f22effba3643d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e351142eac434718b4c43ab75254265858507aebfef8a26b306c0d25c40c20bb622b927806ff206c8d7071a86425b4b97c852a8493ef48589a5c2d1d3b2db687
|
7
|
+
data.tar.gz: cd5ef8113db2134e84a4d36ecb5c99ecf81aef397b354db2786a63c5659a35c2a5767ceb110ffc83da6e75ea647dd1fecd09678c619132829b3ff17d940a20bd
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
![Specs status](https://github.com/paddor/czmq-ffi-gen/workflows/Specs/badge.svg)
|
2
2
|
|
3
3
|
# Generated CZMQ::FFI
|
4
4
|
|
@@ -42,27 +42,13 @@ for the API documentation **for the released gem**.
|
|
42
42
|
|
43
43
|
## Requirements
|
44
44
|
|
45
|
-
* CZMQ >= 4.
|
46
|
-
* ZMQ >= 4.
|
45
|
+
* CZMQ >= 4.2
|
46
|
+
* ZMQ >= 4.3
|
47
47
|
|
48
|
-
|
49
|
-
* [libsodium](https://github.com/jedisct1/libsodium)
|
50
|
-
|
51
|
-
On macOS using homebrew, run:
|
48
|
+
On macOS using Homebrew, run:
|
52
49
|
|
53
50
|
$ brew install czmq
|
54
51
|
|
55
|
-
If you're running Linux, go check [this page](http://zeromq.org/distro:_start)
|
56
|
-
to get more help. Make sure to install CZMQ, not only ZMQ.
|
57
|
-
|
58
|
-
### Supported Rubies
|
59
|
-
|
60
|
-
The latest MRI (currently the 2.6 series) is tested on CI.
|
61
|
-
|
62
|
-
The following *SHOULD* work, but are untested:
|
63
|
-
* Rubinius
|
64
|
-
* JRuby 9000
|
65
|
-
|
66
52
|
|
67
53
|
## Installation
|
68
54
|
|
@@ -135,6 +135,7 @@ module CZMQ
|
|
135
135
|
attach_function :zcertstore_empty, [:pointer], :void, **opts
|
136
136
|
attach_function :zcertstore_print, [:pointer], :void, **opts
|
137
137
|
attach_function :zcertstore_certs, [:pointer], :pointer, **opts
|
138
|
+
attach_function :zcertstore_state, [:pointer], :pointer, **opts
|
138
139
|
attach_function :zcertstore_test, [:bool], :void, **opts
|
139
140
|
|
140
141
|
require_relative 'ffi/zcertstore'
|
@@ -307,6 +308,7 @@ module CZMQ
|
|
307
308
|
attach_function :zframe_eq, [:pointer, :pointer], :bool, **opts
|
308
309
|
attach_function :zframe_reset, [:pointer, :pointer, :size_t], :void, **opts
|
309
310
|
attach_function :zframe_print, [:pointer, :string], :void, **opts
|
311
|
+
attach_function :zframe_print_n, [:pointer, :string, :size_t], :void, **opts
|
310
312
|
attach_function :zframe_is, [:pointer], :bool, **opts
|
311
313
|
attach_function :zframe_test, [:bool], :void, **opts
|
312
314
|
|
@@ -501,6 +503,7 @@ module CZMQ
|
|
501
503
|
attach_function :zmsg_encode, [:pointer], :pointer, **opts
|
502
504
|
attach_function :zmsg_dup, [:pointer], :pointer, **opts
|
503
505
|
attach_function :zmsg_print, [:pointer], :void, **opts
|
506
|
+
attach_function :zmsg_print_n, [:pointer, :size_t], :void, **opts
|
504
507
|
attach_function :zmsg_eq, [:pointer, :pointer], :bool, **opts
|
505
508
|
attach_function :zmsg_signal, [:pointer], :int, **opts
|
506
509
|
attach_function :zmsg_is, [:pointer], :bool, **opts
|
@@ -564,6 +567,7 @@ module CZMQ
|
|
564
567
|
attach_function :zsock_new_dish, [:string], :pointer, **opts
|
565
568
|
attach_function :zsock_new_gather, [:string], :pointer, **opts
|
566
569
|
attach_function :zsock_new_scatter, [:string], :pointer, **opts
|
570
|
+
attach_function :zsock_new_dgram, [:string], :pointer, **opts
|
567
571
|
attach_function :zsock_destroy, [:pointer], :void, **opts
|
568
572
|
attach_function :zsock_bind, [:pointer, :string, :varargs], :int, **opts
|
569
573
|
attach_function :zsock_endpoint, [:pointer], :string, **opts
|
@@ -589,6 +593,23 @@ module CZMQ
|
|
589
593
|
attach_function :zsock_is, [:pointer], :bool, **opts
|
590
594
|
attach_function :zsock_resolve, [:pointer], :pointer, **opts
|
591
595
|
attach_function :zsock_has_in, [:pointer], :bool, **opts
|
596
|
+
attach_function :zsock_set_only_first_subscribe, [:pointer, :int], :void, **opts
|
597
|
+
attach_function :zsock_set_hello_msg, [:pointer, :pointer], :void, **opts
|
598
|
+
attach_function :zsock_set_disconnect_msg, [:pointer, :pointer], :void, **opts
|
599
|
+
attach_function :zsock_set_wss_trust_system, [:pointer, :int], :void, **opts
|
600
|
+
attach_function :zsock_set_wss_hostname, [:pointer, :string], :void, **opts
|
601
|
+
attach_function :zsock_set_wss_trust_pem, [:pointer, :string], :void, **opts
|
602
|
+
attach_function :zsock_set_wss_cert_pem, [:pointer, :string], :void, **opts
|
603
|
+
attach_function :zsock_set_wss_key_pem, [:pointer, :string], :void, **opts
|
604
|
+
attach_function :zsock_out_batch_size, [:pointer], :int, **opts
|
605
|
+
attach_function :zsock_set_out_batch_size, [:pointer, :int], :void, **opts
|
606
|
+
attach_function :zsock_in_batch_size, [:pointer], :int, **opts
|
607
|
+
attach_function :zsock_set_in_batch_size, [:pointer, :int], :void, **opts
|
608
|
+
attach_function :zsock_socks_password, [:pointer], :pointer, **opts
|
609
|
+
attach_function :zsock_set_socks_password, [:pointer, :string], :void, **opts
|
610
|
+
attach_function :zsock_socks_username, [:pointer], :pointer, **opts
|
611
|
+
attach_function :zsock_set_socks_username, [:pointer, :string], :void, **opts
|
612
|
+
attach_function :zsock_set_xpub_manual_last_value, [:pointer, :int], :void, **opts
|
592
613
|
attach_function :zsock_router_notify, [:pointer], :int, **opts
|
593
614
|
attach_function :zsock_set_router_notify, [:pointer, :int], :void, **opts
|
594
615
|
attach_function :zsock_multicast_loop, [:pointer], :int, **opts
|
@@ -819,12 +840,17 @@ module CZMQ
|
|
819
840
|
attach_function :zsys_pipehwm, [], :size_t, **opts
|
820
841
|
attach_function :zsys_set_ipv6, [:int], :void, **opts
|
821
842
|
attach_function :zsys_ipv6, [], :int, **opts
|
843
|
+
attach_function :zsys_ipv6_available, [], :bool, **opts
|
822
844
|
attach_function :zsys_set_interface, [:string], :void, **opts
|
823
845
|
attach_function :zsys_interface, [], :string, **opts
|
824
846
|
attach_function :zsys_set_ipv6_address, [:string], :void, **opts
|
825
847
|
attach_function :zsys_ipv6_address, [], :string, **opts
|
826
848
|
attach_function :zsys_set_ipv6_mcast_address, [:string], :void, **opts
|
827
849
|
attach_function :zsys_ipv6_mcast_address, [], :string, **opts
|
850
|
+
attach_function :zsys_set_ipv4_mcast_address, [:string], :void, **opts
|
851
|
+
attach_function :zsys_ipv4_mcast_address, [], :string, **opts
|
852
|
+
attach_function :zsys_set_mcast_ttl, [:char], :void, **opts
|
853
|
+
attach_function :zsys_mcast_ttl, [], :char, **opts
|
828
854
|
attach_function :zsys_set_auto_use_fd, [:int], :void, **opts
|
829
855
|
attach_function :zsys_auto_use_fd, [], :int, **opts
|
830
856
|
attach_function :zsys_zprintf, [:string, :pointer], :pointer, **opts
|
@@ -951,6 +977,38 @@ module CZMQ
|
|
951
977
|
attach_function :zhttp_response_test, [:bool], :void, **opts
|
952
978
|
|
953
979
|
require_relative 'ffi/zhttp_response'
|
980
|
+
|
981
|
+
attach_function :zosc_new, [:string], :pointer, **opts
|
982
|
+
attach_function :zosc_fromframe, [:pointer], :pointer, **opts
|
983
|
+
attach_function :zosc_frommem, [:pointer, :size_t], :pointer, **opts
|
984
|
+
attach_function :zosc_create, [:string, :string, :varargs], :pointer, **opts
|
985
|
+
attach_function :zosc_destroy, [:pointer], :void, **opts
|
986
|
+
attach_function :zosc_size, [:pointer], :size_t, **opts
|
987
|
+
attach_function :zosc_data, [:pointer], :pointer, **opts
|
988
|
+
attach_function :zosc_address, [:pointer], :string, **opts
|
989
|
+
attach_function :zosc_format, [:pointer], :string, **opts
|
990
|
+
attach_function :zosc_append, [:pointer, :string, :varargs], :int, **opts
|
991
|
+
attach_function :zosc_retr, [:pointer, :string, :varargs], :int, **opts
|
992
|
+
attach_function :zosc_dup, [:pointer], :pointer, **opts
|
993
|
+
attach_function :zosc_pack, [:pointer], :pointer, **opts
|
994
|
+
attach_function :zosc_packx, [:pointer], :pointer, **opts
|
995
|
+
attach_function :zosc_unpack, [:pointer], :pointer, **opts
|
996
|
+
attach_function :zosc_print, [:pointer], :void, **opts
|
997
|
+
attach_function :zosc_is, [:pointer], :bool, **opts
|
998
|
+
attach_function :zosc_first, [:pointer, :pointer], :pointer, **opts
|
999
|
+
attach_function :zosc_next, [:pointer, :pointer], :pointer, **opts
|
1000
|
+
attach_function :zosc_last, [:pointer, :pointer], :pointer, **opts
|
1001
|
+
attach_function :zosc_pop_int32, [:pointer, :pointer], :int, **opts
|
1002
|
+
attach_function :zosc_pop_int64, [:pointer, :pointer], :int, **opts
|
1003
|
+
attach_function :zosc_pop_float, [:pointer, :pointer], :int, **opts
|
1004
|
+
attach_function :zosc_pop_double, [:pointer, :pointer], :int, **opts
|
1005
|
+
attach_function :zosc_pop_string, [:pointer, :pointer], :int, **opts
|
1006
|
+
attach_function :zosc_pop_char, [:pointer, :pointer], :int, **opts
|
1007
|
+
attach_function :zosc_pop_bool, [:pointer, :pointer], :int, **opts
|
1008
|
+
attach_function :zosc_pop_midi, [:pointer, :pointer], :int, **opts
|
1009
|
+
attach_function :zosc_test, [:bool], :void, **opts
|
1010
|
+
|
1011
|
+
require_relative 'ffi/zosc'
|
954
1012
|
end
|
955
1013
|
end
|
956
1014
|
end
|
@@ -205,6 +205,16 @@ module CZMQ
|
|
205
205
|
result
|
206
206
|
end
|
207
207
|
|
208
|
+
# Return the state stored in certstore
|
209
|
+
#
|
210
|
+
# @return [::FFI::Pointer]
|
211
|
+
def state()
|
212
|
+
raise DestroyedError unless @ptr
|
213
|
+
self_p = @ptr
|
214
|
+
result = ::CZMQ::FFI.zcertstore_state(self_p)
|
215
|
+
result
|
216
|
+
end
|
217
|
+
|
208
218
|
# Self test of this class
|
209
219
|
#
|
210
220
|
# @param verbose [Boolean]
|
@@ -351,6 +351,7 @@ module CZMQ
|
|
351
351
|
|
352
352
|
# Send message to zsys log sink (may be stdout, or system facility as
|
353
353
|
# configured by zsys_set_logstream). Prefix shows before frame, if not null.
|
354
|
+
# Long messages are truncated.
|
354
355
|
#
|
355
356
|
# @param prefix [String, #to_s, nil]
|
356
357
|
# @return [void]
|
@@ -361,6 +362,22 @@ module CZMQ
|
|
361
362
|
result
|
362
363
|
end
|
363
364
|
|
365
|
+
# Send message to zsys log sink (may be stdout, or system facility as
|
366
|
+
# configured by zsys_set_logstream). Prefix shows before frame, if not null.
|
367
|
+
# Message length is specified; no truncation unless length is zero.
|
368
|
+
# Backwards compatible with zframe_print when length is zero.
|
369
|
+
#
|
370
|
+
# @param prefix [String, #to_s, nil]
|
371
|
+
# @param length [Integer, #to_int, #to_i]
|
372
|
+
# @return [void]
|
373
|
+
def print_n(prefix, length)
|
374
|
+
raise DestroyedError unless @ptr
|
375
|
+
self_p = @ptr
|
376
|
+
length = Integer(length)
|
377
|
+
result = ::CZMQ::FFI.zframe_print_n(self_p, prefix, length)
|
378
|
+
result
|
379
|
+
end
|
380
|
+
|
364
381
|
# Probe the supplied object, and report if it looks like a zframe_t.
|
365
382
|
#
|
366
383
|
# @param self_ [::FFI::Pointer, #to_ptr]
|
@@ -454,6 +454,7 @@ module CZMQ
|
|
454
454
|
|
455
455
|
# Send message to zsys log sink (may be stdout, or system facility as
|
456
456
|
# configured by zsys_set_logstream).
|
457
|
+
# Long messages are truncated.
|
457
458
|
#
|
458
459
|
# @return [void]
|
459
460
|
def print()
|
@@ -463,6 +464,21 @@ module CZMQ
|
|
463
464
|
result
|
464
465
|
end
|
465
466
|
|
467
|
+
# Send message to zsys log sink (may be stdout, or system facility as
|
468
|
+
# configured by zsys_set_logstream).
|
469
|
+
# Message length is specified; no truncation unless length is zero.
|
470
|
+
# Backwards compatible with zframe_print when length is zero.
|
471
|
+
#
|
472
|
+
# @param size [Integer, #to_int, #to_i]
|
473
|
+
# @return [void]
|
474
|
+
def print_n(size)
|
475
|
+
raise DestroyedError unless @ptr
|
476
|
+
self_p = @ptr
|
477
|
+
size = Integer(size)
|
478
|
+
result = ::CZMQ::FFI.zmsg_print_n(self_p, size)
|
479
|
+
result
|
480
|
+
end
|
481
|
+
|
466
482
|
# Return true if the two messages have the same number of frames and each
|
467
483
|
# frame in the first message is identical to the corresponding frame in the
|
468
484
|
# other message. As with zframe_eq, return false if either message is NULL.
|
@@ -0,0 +1,487 @@
|
|
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
|
+
# Create and decode Open Sound Control messages. (OSC)
|
10
|
+
#
|
11
|
+
# OSC is a serialisation format (and usually transported over UDP) which is
|
12
|
+
# supported by many applications and appliances. It is a de facto protocol
|
13
|
+
# for networking sound synthesizers, computers, and other multimedia devices
|
14
|
+
# for purposes such as musical performance or show control. It is also often
|
15
|
+
# used for rapid prototyping purposes due to the support by many applications
|
16
|
+
# and frameworks in this field. With ZeroMQ's DGRAM sockets it is possible
|
17
|
+
# to use ZeroMQ to send and receive OSC messages which can be understood by
|
18
|
+
# any device supporting OSC.
|
19
|
+
#
|
20
|
+
# Example creating an OSC message:
|
21
|
+
#
|
22
|
+
# zosc_t* conm = zosc_create("/someaddress", "iihfdscF",
|
23
|
+
# 1, 2, 3, 3.14, 6.283185307179586, "greetings", 'q');
|
24
|
+
#
|
25
|
+
# Decoding a message:
|
26
|
+
#
|
27
|
+
# int rc = zosc_retr(oscmsg, "iihfdscF", &intx, &inty, &intz, &floatz,
|
28
|
+
# &doublez, &strings, &charq, &someBool);
|
29
|
+
#
|
30
|
+
# See the class's test method for more examples how to use the class.
|
31
|
+
# @note This class is 100% generated using zproject.
|
32
|
+
class Zosc
|
33
|
+
# Raised when one tries to use an instance of {Zosc} after
|
34
|
+
# the internal pointer to the native object has been nullified.
|
35
|
+
class DestroyedError < RuntimeError; end
|
36
|
+
|
37
|
+
# Boilerplate for self pointer, initializer, and finalizer
|
38
|
+
class << self
|
39
|
+
alias :__new :new
|
40
|
+
end
|
41
|
+
# Attaches the pointer _ptr_ to this instance and defines a finalizer for
|
42
|
+
# it if necessary.
|
43
|
+
# @param ptr [::FFI::Pointer]
|
44
|
+
# @param finalize [Boolean]
|
45
|
+
def initialize(ptr, finalize = true)
|
46
|
+
@ptr = ptr
|
47
|
+
if @ptr.null?
|
48
|
+
@ptr = nil # Remove null pointers so we don't have to test for them.
|
49
|
+
elsif finalize
|
50
|
+
@finalizer = self.class.create_finalizer_for @ptr
|
51
|
+
ObjectSpace.define_finalizer self, @finalizer
|
52
|
+
end
|
53
|
+
end
|
54
|
+
# @param ptr [::FFI::Pointer]
|
55
|
+
# @return [Proc]
|
56
|
+
def self.create_finalizer_for(ptr)
|
57
|
+
Proc.new do
|
58
|
+
ptr_ptr = ::FFI::MemoryPointer.new :pointer
|
59
|
+
ptr_ptr.write_pointer ptr
|
60
|
+
::CZMQ::FFI.zosc_destroy ptr_ptr
|
61
|
+
end
|
62
|
+
end
|
63
|
+
# @return [Boolean]
|
64
|
+
def null?
|
65
|
+
!@ptr or @ptr.null?
|
66
|
+
end
|
67
|
+
# Return internal pointer
|
68
|
+
# @return [::FFI::Pointer]
|
69
|
+
def __ptr
|
70
|
+
raise DestroyedError unless @ptr
|
71
|
+
@ptr
|
72
|
+
end
|
73
|
+
# So external Libraries can just pass the Object to a FFI function which expects a :pointer
|
74
|
+
alias_method :to_ptr, :__ptr
|
75
|
+
# Nullify internal pointer and return pointer pointer.
|
76
|
+
# @note This detaches the current instance from the native object
|
77
|
+
# and thus makes it unusable.
|
78
|
+
# @return [::FFI::MemoryPointer] the pointer pointing to a pointer
|
79
|
+
# pointing to the native object
|
80
|
+
def __ptr_give_ref
|
81
|
+
raise DestroyedError unless @ptr
|
82
|
+
ptr_ptr = ::FFI::MemoryPointer.new :pointer
|
83
|
+
ptr_ptr.write_pointer @ptr
|
84
|
+
__undef_finalizer if @finalizer
|
85
|
+
@ptr = nil
|
86
|
+
ptr_ptr
|
87
|
+
end
|
88
|
+
# Undefines the finalizer for this object.
|
89
|
+
# @note Only use this if you need to and can guarantee that the native
|
90
|
+
# object will be freed by other means.
|
91
|
+
# @return [void]
|
92
|
+
def __undef_finalizer
|
93
|
+
ObjectSpace.undefine_finalizer self
|
94
|
+
@finalizer = nil
|
95
|
+
end
|
96
|
+
|
97
|
+
# Create a new empty OSC message with the specified address string.
|
98
|
+
# @param address [String, #to_s, nil]
|
99
|
+
# @return [CZMQ::Zosc]
|
100
|
+
def self.new(address)
|
101
|
+
ptr = ::CZMQ::FFI.zosc_new(address)
|
102
|
+
__new ptr
|
103
|
+
end
|
104
|
+
|
105
|
+
# Create a new OSC message from the specified zframe. Takes ownership of
|
106
|
+
# the zframe.
|
107
|
+
# @param frame [Zframe, #__ptr]
|
108
|
+
# @return [CZMQ::Zosc]
|
109
|
+
def self.fromframe(frame)
|
110
|
+
frame = frame.__ptr if frame
|
111
|
+
ptr = ::CZMQ::FFI.zosc_fromframe(frame)
|
112
|
+
__new ptr
|
113
|
+
end
|
114
|
+
|
115
|
+
# Create a new zosc message from memory. Take ownership of the memory
|
116
|
+
# and calling free on the data after construction.
|
117
|
+
# @param data [::FFI::Pointer, #to_ptr]
|
118
|
+
# @param size [Integer, #to_int, #to_i]
|
119
|
+
# @return [CZMQ::Zosc]
|
120
|
+
def self.frommem(data, size)
|
121
|
+
size = Integer(size)
|
122
|
+
ptr = ::CZMQ::FFI.zosc_frommem(data, size)
|
123
|
+
__new ptr
|
124
|
+
end
|
125
|
+
|
126
|
+
# Create a new zosc message from the given format and arguments.
|
127
|
+
# The format type tags are as follows:
|
128
|
+
# i - 32bit integer
|
129
|
+
# h - 64bit integer
|
130
|
+
# f - 32bit floating point number (IEEE)
|
131
|
+
# d - 64bit (double) floating point number
|
132
|
+
# s - string (NULL terminated)
|
133
|
+
# t = timetag: an OSC timetag in NTP format (uint64_t)
|
134
|
+
# S - symbol
|
135
|
+
# c - char
|
136
|
+
# m - 4 byte midi packet (8 digits hexadecimal)
|
137
|
+
# T - TRUE (no value required)
|
138
|
+
# F - FALSE (no value required)
|
139
|
+
# N - NIL (no value required)
|
140
|
+
# I - Impulse (for triggers) or INFINITUM (no value required)
|
141
|
+
# b - binary blob
|
142
|
+
# @param address [String, #to_s, nil]
|
143
|
+
# @param format [String, #to_s, nil]
|
144
|
+
# @param args [Array<Object>]
|
145
|
+
# @return [CZMQ::Zosc]
|
146
|
+
def self.create(address, format, *args)
|
147
|
+
ptr = ::CZMQ::FFI.zosc_create(address, format, *args)
|
148
|
+
__new ptr
|
149
|
+
end
|
150
|
+
|
151
|
+
# Destroy an OSC message
|
152
|
+
#
|
153
|
+
# @return [void]
|
154
|
+
def destroy()
|
155
|
+
return unless @ptr
|
156
|
+
self_p = __ptr_give_ref
|
157
|
+
result = ::CZMQ::FFI.zosc_destroy(self_p)
|
158
|
+
result
|
159
|
+
end
|
160
|
+
|
161
|
+
# Return chunk data size
|
162
|
+
#
|
163
|
+
# @return [Integer]
|
164
|
+
def size()
|
165
|
+
raise DestroyedError unless @ptr
|
166
|
+
self_p = @ptr
|
167
|
+
result = ::CZMQ::FFI.zosc_size(self_p)
|
168
|
+
result
|
169
|
+
end
|
170
|
+
|
171
|
+
# Return OSC chunk data. Caller does not own the data!
|
172
|
+
#
|
173
|
+
# @return [::FFI::Pointer]
|
174
|
+
def data()
|
175
|
+
raise DestroyedError unless @ptr
|
176
|
+
self_p = @ptr
|
177
|
+
result = ::CZMQ::FFI.zosc_data(self_p)
|
178
|
+
result
|
179
|
+
end
|
180
|
+
|
181
|
+
# Return the OSC address string
|
182
|
+
#
|
183
|
+
# @return [String]
|
184
|
+
def address()
|
185
|
+
raise DestroyedError unless @ptr
|
186
|
+
self_p = @ptr
|
187
|
+
result = ::CZMQ::FFI.zosc_address(self_p)
|
188
|
+
result
|
189
|
+
end
|
190
|
+
|
191
|
+
# Return the OSC format of the message.
|
192
|
+
# i - 32bit integer
|
193
|
+
# h - 64bit integer
|
194
|
+
# f - 32bit floating point number (IEEE)
|
195
|
+
# d - 64bit (double) floating point number
|
196
|
+
# s - string (NULL terminated)
|
197
|
+
# t = timetag: an OSC timetag in NTP format (uint64_t)
|
198
|
+
# S - symbol
|
199
|
+
# c - char
|
200
|
+
# m - 4 byte midi packet (8 digits hexadecimal)
|
201
|
+
# T - TRUE (no value required)
|
202
|
+
# F - FALSE (no value required)
|
203
|
+
# N - NIL (no value required)
|
204
|
+
# I - Impulse (for triggers) or INFINITUM (no value required)
|
205
|
+
# b - binary blob
|
206
|
+
#
|
207
|
+
# @return [String]
|
208
|
+
def format()
|
209
|
+
raise DestroyedError unless @ptr
|
210
|
+
self_p = @ptr
|
211
|
+
result = ::CZMQ::FFI.zosc_format(self_p)
|
212
|
+
result
|
213
|
+
end
|
214
|
+
|
215
|
+
# Append data to the osc message. The format describes the data that
|
216
|
+
# needs to be appended in the message. This essentially relocates all
|
217
|
+
# data!
|
218
|
+
# The format type tags are as follows:
|
219
|
+
# i - 32bit integer
|
220
|
+
# h - 64bit integer
|
221
|
+
# f - 32bit floating point number (IEEE)
|
222
|
+
# d - 64bit (double) floating point number
|
223
|
+
# s - string (NULL terminated)
|
224
|
+
# t = timetag: an OSC timetag in NTP format (uint64_t)
|
225
|
+
# S - symbol
|
226
|
+
# c - char
|
227
|
+
# m - 4 byte midi packet (8 digits hexadecimal)
|
228
|
+
# T - TRUE (no value required)
|
229
|
+
# F - FALSE (no value required)
|
230
|
+
# N - NIL (no value required)
|
231
|
+
# I - Impulse (for triggers) or INFINITUM (no value required)
|
232
|
+
# b - binary blob
|
233
|
+
#
|
234
|
+
# @param format [String, #to_s, nil]
|
235
|
+
# @param args [Array<Object>] see https://github.com/ffi/ffi/wiki/examples#using-varargs
|
236
|
+
# @return [Integer]
|
237
|
+
def append(format, *args)
|
238
|
+
raise DestroyedError unless @ptr
|
239
|
+
self_p = @ptr
|
240
|
+
result = ::CZMQ::FFI.zosc_append(self_p, format, *args)
|
241
|
+
result
|
242
|
+
end
|
243
|
+
|
244
|
+
# Retrieve the values provided by the given format. Note that zosc_retr
|
245
|
+
# creates the objects and the caller must destroy them when finished.
|
246
|
+
# The supplied pointers do not need to be initialized. Returns 0 if
|
247
|
+
# successful, or -1 if it failed to retrieve a value in which case the
|
248
|
+
# pointers are not modified. If an argument pointer is NULL is skips the
|
249
|
+
# value. See the format method for a detailed list op type tags for the
|
250
|
+
# format string.
|
251
|
+
#
|
252
|
+
# @param format [String, #to_s, nil]
|
253
|
+
# @param args [Array<Object>] see https://github.com/ffi/ffi/wiki/examples#using-varargs
|
254
|
+
# @return [Integer]
|
255
|
+
def retr(format, *args)
|
256
|
+
raise DestroyedError unless @ptr
|
257
|
+
self_p = @ptr
|
258
|
+
result = ::CZMQ::FFI.zosc_retr(self_p, format, *args)
|
259
|
+
result
|
260
|
+
end
|
261
|
+
|
262
|
+
# Create copy of the message, as new chunk object. Returns a fresh zosc_t
|
263
|
+
# object, or null if there was not enough heap memory. If chunk is null,
|
264
|
+
# returns null.
|
265
|
+
#
|
266
|
+
# @return [Zosc]
|
267
|
+
def dup()
|
268
|
+
raise DestroyedError unless @ptr
|
269
|
+
self_p = @ptr
|
270
|
+
result = ::CZMQ::FFI.zosc_dup(self_p)
|
271
|
+
result = Zosc.__new result, true
|
272
|
+
result
|
273
|
+
end
|
274
|
+
|
275
|
+
# Transform zosc into a zframe that can be sent in a message.
|
276
|
+
#
|
277
|
+
# @return [Zframe]
|
278
|
+
def pack()
|
279
|
+
raise DestroyedError unless @ptr
|
280
|
+
self_p = @ptr
|
281
|
+
result = ::CZMQ::FFI.zosc_pack(self_p)
|
282
|
+
result = Zframe.__new result, true
|
283
|
+
result
|
284
|
+
end
|
285
|
+
|
286
|
+
# Transform zosc into a zframe that can be sent in a message.
|
287
|
+
# Take ownership of the chunk.
|
288
|
+
#
|
289
|
+
# @param self_p [#__ptr_give_ref]
|
290
|
+
# @return [Zframe]
|
291
|
+
def self.packx(self_p)
|
292
|
+
self_p = self_p.__ptr_give_ref
|
293
|
+
result = ::CZMQ::FFI.zosc_packx(self_p)
|
294
|
+
result = Zframe.__new result, true
|
295
|
+
result
|
296
|
+
end
|
297
|
+
|
298
|
+
# Transform a zframe into a zosc.
|
299
|
+
#
|
300
|
+
# @param frame [Zframe, #__ptr]
|
301
|
+
# @return [Zosc]
|
302
|
+
def self.unpack(frame)
|
303
|
+
frame = frame.__ptr if frame
|
304
|
+
result = ::CZMQ::FFI.zosc_unpack(frame)
|
305
|
+
result = Zosc.__new result, true
|
306
|
+
result
|
307
|
+
end
|
308
|
+
|
309
|
+
# Dump OSC message to stdout, for debugging and tracing.
|
310
|
+
#
|
311
|
+
# @return [void]
|
312
|
+
def print()
|
313
|
+
raise DestroyedError unless @ptr
|
314
|
+
self_p = @ptr
|
315
|
+
result = ::CZMQ::FFI.zosc_print(self_p)
|
316
|
+
result
|
317
|
+
end
|
318
|
+
|
319
|
+
# Probe the supplied object, and report if it looks like a zosc_t.
|
320
|
+
#
|
321
|
+
# @param self_ [::FFI::Pointer, #to_ptr]
|
322
|
+
# @return [Boolean]
|
323
|
+
def self.is(self_)
|
324
|
+
result = ::CZMQ::FFI.zosc_is(self_)
|
325
|
+
result
|
326
|
+
end
|
327
|
+
|
328
|
+
# Return a pointer to the item at the head of the OSC data.
|
329
|
+
# Sets the given char argument to the type tag of the data.
|
330
|
+
# If the message is empty, returns NULL and the sets the
|
331
|
+
# given char to NULL.
|
332
|
+
#
|
333
|
+
# @param type [::FFI::Pointer, #to_ptr]
|
334
|
+
# @return [::FFI::Pointer]
|
335
|
+
def first(type)
|
336
|
+
raise DestroyedError unless @ptr
|
337
|
+
self_p = @ptr
|
338
|
+
result = ::CZMQ::FFI.zosc_first(self_p, type)
|
339
|
+
result
|
340
|
+
end
|
341
|
+
|
342
|
+
# Return the next item of the OSC message. If the list is empty, returns
|
343
|
+
# NULL. To move to the start of the OSC message call zosc_first ().
|
344
|
+
#
|
345
|
+
# @param type [::FFI::Pointer, #to_ptr]
|
346
|
+
# @return [::FFI::Pointer]
|
347
|
+
def next(type)
|
348
|
+
raise DestroyedError unless @ptr
|
349
|
+
self_p = @ptr
|
350
|
+
result = ::CZMQ::FFI.zosc_next(self_p, type)
|
351
|
+
result
|
352
|
+
end
|
353
|
+
|
354
|
+
# Return a pointer to the item at the tail of the OSC message.
|
355
|
+
# Sets the given char argument to the type tag of the data. If
|
356
|
+
# the message is empty, returns NULL.
|
357
|
+
#
|
358
|
+
# @param type [::FFI::Pointer, #to_ptr]
|
359
|
+
# @return [::FFI::Pointer]
|
360
|
+
def last(type)
|
361
|
+
raise DestroyedError unless @ptr
|
362
|
+
self_p = @ptr
|
363
|
+
result = ::CZMQ::FFI.zosc_last(self_p, type)
|
364
|
+
result
|
365
|
+
end
|
366
|
+
|
367
|
+
# Set the provided 32 bit integer from value at the current cursor position in the message.
|
368
|
+
# If the type tag at the current position does not correspond it will fail and
|
369
|
+
# return -1. Returns 0 on success.
|
370
|
+
#
|
371
|
+
# @param val [::FFI::Pointer, #to_ptr]
|
372
|
+
# @return [Integer]
|
373
|
+
def pop_int32(val)
|
374
|
+
raise DestroyedError unless @ptr
|
375
|
+
self_p = @ptr
|
376
|
+
result = ::CZMQ::FFI.zosc_pop_int32(self_p, val)
|
377
|
+
result
|
378
|
+
end
|
379
|
+
|
380
|
+
# Set the provided 64 bit integer from the value at the current cursor position in the message.
|
381
|
+
# If the type tag at the current position does not correspond it will fail and
|
382
|
+
# return -1. Returns 0 on success.
|
383
|
+
#
|
384
|
+
# @param val [::FFI::Pointer, #to_ptr]
|
385
|
+
# @return [Integer]
|
386
|
+
def pop_int64(val)
|
387
|
+
raise DestroyedError unless @ptr
|
388
|
+
self_p = @ptr
|
389
|
+
result = ::CZMQ::FFI.zosc_pop_int64(self_p, val)
|
390
|
+
result
|
391
|
+
end
|
392
|
+
|
393
|
+
# Set the provided float from the value at the current cursor position in the message.
|
394
|
+
# If the type tag at the current position does not correspond it will fail and
|
395
|
+
# return -1. Returns 0 on success.
|
396
|
+
#
|
397
|
+
# @param val [::FFI::Pointer, #to_ptr]
|
398
|
+
# @return [Integer]
|
399
|
+
def pop_float(val)
|
400
|
+
raise DestroyedError unless @ptr
|
401
|
+
self_p = @ptr
|
402
|
+
result = ::CZMQ::FFI.zosc_pop_float(self_p, val)
|
403
|
+
result
|
404
|
+
end
|
405
|
+
|
406
|
+
# Set the provided double from the value at the current cursor position in the message.
|
407
|
+
# If the type tag at the current position does not correspond it will fail and
|
408
|
+
# return -1. Returns 0 on success.
|
409
|
+
#
|
410
|
+
# @param val [::FFI::Pointer, #to_ptr]
|
411
|
+
# @return [Integer]
|
412
|
+
def pop_double(val)
|
413
|
+
raise DestroyedError unless @ptr
|
414
|
+
self_p = @ptr
|
415
|
+
result = ::CZMQ::FFI.zosc_pop_double(self_p, val)
|
416
|
+
result
|
417
|
+
end
|
418
|
+
|
419
|
+
# Set the provided string from the value at the current cursor position in the message.
|
420
|
+
# If the type tag at the current position does not correspond it will fail and
|
421
|
+
# return -1. Returns 0 on success. Caller owns the string!
|
422
|
+
#
|
423
|
+
# @param val [::FFI::Pointer, #to_ptr]
|
424
|
+
# @return [Integer]
|
425
|
+
def pop_string(val)
|
426
|
+
raise DestroyedError unless @ptr
|
427
|
+
self_p = @ptr
|
428
|
+
result = ::CZMQ::FFI.zosc_pop_string(self_p, val)
|
429
|
+
result
|
430
|
+
end
|
431
|
+
|
432
|
+
# Set the provided char from the value at the current cursor position in the message.
|
433
|
+
# If the type tag at the current position does not correspond it will fail and
|
434
|
+
# return -1. Returns 0 on success.
|
435
|
+
#
|
436
|
+
# @param val [::FFI::Pointer, #to_ptr]
|
437
|
+
# @return [Integer]
|
438
|
+
def pop_char(val)
|
439
|
+
raise DestroyedError unless @ptr
|
440
|
+
self_p = @ptr
|
441
|
+
result = ::CZMQ::FFI.zosc_pop_char(self_p, val)
|
442
|
+
result
|
443
|
+
end
|
444
|
+
|
445
|
+
# Set the provided boolean from the type tag in the message. Booleans are not represented
|
446
|
+
# in the data in the message, only in the type tag. If the type tag at the current
|
447
|
+
# position does not correspond it will fail and return -1. Returns 0 on success.
|
448
|
+
#
|
449
|
+
# @param val [::FFI::Pointer, #to_ptr]
|
450
|
+
# @return [Integer]
|
451
|
+
def pop_bool(val)
|
452
|
+
raise DestroyedError unless @ptr
|
453
|
+
self_p = @ptr
|
454
|
+
result = ::CZMQ::FFI.zosc_pop_bool(self_p, val)
|
455
|
+
result
|
456
|
+
end
|
457
|
+
|
458
|
+
# Set the provided 4 bytes (unsigned 32bit int) from the value at the current
|
459
|
+
# cursor position in the message. If the type tag at the current position does
|
460
|
+
# not correspond it will fail and return -1. Returns 0 on success.
|
461
|
+
#
|
462
|
+
# @param val [::FFI::Pointer, #to_ptr]
|
463
|
+
# @return [Integer]
|
464
|
+
def pop_midi(val)
|
465
|
+
raise DestroyedError unless @ptr
|
466
|
+
self_p = @ptr
|
467
|
+
result = ::CZMQ::FFI.zosc_pop_midi(self_p, val)
|
468
|
+
result
|
469
|
+
end
|
470
|
+
|
471
|
+
# Self test of this class.
|
472
|
+
#
|
473
|
+
# @param verbose [Boolean]
|
474
|
+
# @return [void]
|
475
|
+
def self.test(verbose)
|
476
|
+
verbose = !(0==verbose||!verbose) # boolean
|
477
|
+
result = ::CZMQ::FFI.zosc_test(verbose)
|
478
|
+
result
|
479
|
+
end
|
480
|
+
end
|
481
|
+
end
|
482
|
+
end
|
483
|
+
|
484
|
+
################################################################################
|
485
|
+
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
|
486
|
+
# Read the zproject/README.md for information about making permanent changes. #
|
487
|
+
################################################################################
|