forked from erickt/rust-zmq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ffi.rs
652 lines (651 loc) · 20.3 KB
/
ffi.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
/* automatically generated by rust-bindgen */
pub const ZMQ_VERSION_MAJOR: u32 = 4;
pub const ZMQ_VERSION_MINOR: u32 = 3;
pub const ZMQ_VERSION_PATCH: u32 = 1;
pub const ZMQ_DEFINED_STDINT: u32 = 1;
pub const ZMQ_HAUSNUMERO: u32 = 156384712;
pub const ZMQ_IO_THREADS: u32 = 1;
pub const ZMQ_MAX_SOCKETS: u32 = 2;
pub const ZMQ_SOCKET_LIMIT: u32 = 3;
pub const ZMQ_THREAD_PRIORITY: u32 = 3;
pub const ZMQ_THREAD_SCHED_POLICY: u32 = 4;
pub const ZMQ_MAX_MSGSZ: u32 = 5;
pub const ZMQ_MSG_T_SIZE: u32 = 6;
pub const ZMQ_THREAD_AFFINITY_CPU_ADD: u32 = 7;
pub const ZMQ_THREAD_AFFINITY_CPU_REMOVE: u32 = 8;
pub const ZMQ_THREAD_NAME_PREFIX: u32 = 9;
pub const ZMQ_IO_THREADS_DFLT: u32 = 1;
pub const ZMQ_MAX_SOCKETS_DFLT: u32 = 1023;
pub const ZMQ_THREAD_PRIORITY_DFLT: i32 = -1;
pub const ZMQ_THREAD_SCHED_POLICY_DFLT: i32 = -1;
pub const ZMQ_PAIR: u32 = 0;
pub const ZMQ_PUB: u32 = 1;
pub const ZMQ_SUB: u32 = 2;
pub const ZMQ_REQ: u32 = 3;
pub const ZMQ_REP: u32 = 4;
pub const ZMQ_DEALER: u32 = 5;
pub const ZMQ_ROUTER: u32 = 6;
pub const ZMQ_PULL: u32 = 7;
pub const ZMQ_PUSH: u32 = 8;
pub const ZMQ_XPUB: u32 = 9;
pub const ZMQ_XSUB: u32 = 10;
pub const ZMQ_STREAM: u32 = 11;
pub const ZMQ_XREQ: u32 = 5;
pub const ZMQ_XREP: u32 = 6;
pub const ZMQ_AFFINITY: u32 = 4;
pub const ZMQ_ROUTING_ID: u32 = 5;
pub const ZMQ_SUBSCRIBE: u32 = 6;
pub const ZMQ_UNSUBSCRIBE: u32 = 7;
pub const ZMQ_RATE: u32 = 8;
pub const ZMQ_RECOVERY_IVL: u32 = 9;
pub const ZMQ_SNDBUF: u32 = 11;
pub const ZMQ_RCVBUF: u32 = 12;
pub const ZMQ_RCVMORE: u32 = 13;
pub const ZMQ_FD: u32 = 14;
pub const ZMQ_EVENTS: u32 = 15;
pub const ZMQ_TYPE: u32 = 16;
pub const ZMQ_LINGER: u32 = 17;
pub const ZMQ_RECONNECT_IVL: u32 = 18;
pub const ZMQ_BACKLOG: u32 = 19;
pub const ZMQ_RECONNECT_IVL_MAX: u32 = 21;
pub const ZMQ_MAXMSGSIZE: u32 = 22;
pub const ZMQ_SNDHWM: u32 = 23;
pub const ZMQ_RCVHWM: u32 = 24;
pub const ZMQ_MULTICAST_HOPS: u32 = 25;
pub const ZMQ_RCVTIMEO: u32 = 27;
pub const ZMQ_SNDTIMEO: u32 = 28;
pub const ZMQ_LAST_ENDPOINT: u32 = 32;
pub const ZMQ_ROUTER_MANDATORY: u32 = 33;
pub const ZMQ_TCP_KEEPALIVE: u32 = 34;
pub const ZMQ_TCP_KEEPALIVE_CNT: u32 = 35;
pub const ZMQ_TCP_KEEPALIVE_IDLE: u32 = 36;
pub const ZMQ_TCP_KEEPALIVE_INTVL: u32 = 37;
pub const ZMQ_IMMEDIATE: u32 = 39;
pub const ZMQ_XPUB_VERBOSE: u32 = 40;
pub const ZMQ_ROUTER_RAW: u32 = 41;
pub const ZMQ_IPV6: u32 = 42;
pub const ZMQ_MECHANISM: u32 = 43;
pub const ZMQ_PLAIN_SERVER: u32 = 44;
pub const ZMQ_PLAIN_USERNAME: u32 = 45;
pub const ZMQ_PLAIN_PASSWORD: u32 = 46;
pub const ZMQ_CURVE_SERVER: u32 = 47;
pub const ZMQ_CURVE_PUBLICKEY: u32 = 48;
pub const ZMQ_CURVE_SECRETKEY: u32 = 49;
pub const ZMQ_CURVE_SERVERKEY: u32 = 50;
pub const ZMQ_PROBE_ROUTER: u32 = 51;
pub const ZMQ_REQ_CORRELATE: u32 = 52;
pub const ZMQ_REQ_RELAXED: u32 = 53;
pub const ZMQ_CONFLATE: u32 = 54;
pub const ZMQ_ZAP_DOMAIN: u32 = 55;
pub const ZMQ_ROUTER_HANDOVER: u32 = 56;
pub const ZMQ_TOS: u32 = 57;
pub const ZMQ_CONNECT_ROUTING_ID: u32 = 61;
pub const ZMQ_GSSAPI_SERVER: u32 = 62;
pub const ZMQ_GSSAPI_PRINCIPAL: u32 = 63;
pub const ZMQ_GSSAPI_SERVICE_PRINCIPAL: u32 = 64;
pub const ZMQ_GSSAPI_PLAINTEXT: u32 = 65;
pub const ZMQ_HANDSHAKE_IVL: u32 = 66;
pub const ZMQ_SOCKS_PROXY: u32 = 68;
pub const ZMQ_XPUB_NODROP: u32 = 69;
pub const ZMQ_BLOCKY: u32 = 70;
pub const ZMQ_XPUB_MANUAL: u32 = 71;
pub const ZMQ_XPUB_WELCOME_MSG: u32 = 72;
pub const ZMQ_STREAM_NOTIFY: u32 = 73;
pub const ZMQ_INVERT_MATCHING: u32 = 74;
pub const ZMQ_HEARTBEAT_IVL: u32 = 75;
pub const ZMQ_HEARTBEAT_TTL: u32 = 76;
pub const ZMQ_HEARTBEAT_TIMEOUT: u32 = 77;
pub const ZMQ_XPUB_VERBOSER: u32 = 78;
pub const ZMQ_CONNECT_TIMEOUT: u32 = 79;
pub const ZMQ_TCP_MAXRT: u32 = 80;
pub const ZMQ_THREAD_SAFE: u32 = 81;
pub const ZMQ_MULTICAST_MAXTPDU: u32 = 84;
pub const ZMQ_VMCI_BUFFER_SIZE: u32 = 85;
pub const ZMQ_VMCI_BUFFER_MIN_SIZE: u32 = 86;
pub const ZMQ_VMCI_BUFFER_MAX_SIZE: u32 = 87;
pub const ZMQ_VMCI_CONNECT_TIMEOUT: u32 = 88;
pub const ZMQ_USE_FD: u32 = 89;
pub const ZMQ_GSSAPI_PRINCIPAL_NAMETYPE: u32 = 90;
pub const ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE: u32 = 91;
pub const ZMQ_BINDTODEVICE: u32 = 92;
pub const ZMQ_MORE: u32 = 1;
pub const ZMQ_SHARED: u32 = 3;
pub const ZMQ_DONTWAIT: u32 = 1;
pub const ZMQ_SNDMORE: u32 = 2;
pub const ZMQ_NULL: u32 = 0;
pub const ZMQ_PLAIN: u32 = 1;
pub const ZMQ_CURVE: u32 = 2;
pub const ZMQ_GSSAPI: u32 = 3;
pub const ZMQ_GROUP_MAX_LENGTH: u32 = 15;
pub const ZMQ_IDENTITY: u32 = 5;
pub const ZMQ_CONNECT_RID: u32 = 61;
pub const ZMQ_TCP_ACCEPT_FILTER: u32 = 38;
pub const ZMQ_IPC_FILTER_PID: u32 = 58;
pub const ZMQ_IPC_FILTER_UID: u32 = 59;
pub const ZMQ_IPC_FILTER_GID: u32 = 60;
pub const ZMQ_IPV4ONLY: u32 = 31;
pub const ZMQ_DELAY_ATTACH_ON_CONNECT: u32 = 39;
pub const ZMQ_NOBLOCK: u32 = 1;
pub const ZMQ_FAIL_UNROUTABLE: u32 = 33;
pub const ZMQ_ROUTER_BEHAVIOR: u32 = 33;
pub const ZMQ_SRCFD: u32 = 2;
pub const ZMQ_GSSAPI_NT_HOSTBASED: u32 = 0;
pub const ZMQ_GSSAPI_NT_USER_NAME: u32 = 1;
pub const ZMQ_GSSAPI_NT_KRB5_PRINCIPAL: u32 = 2;
pub const ZMQ_EVENT_CONNECTED: u32 = 1;
pub const ZMQ_EVENT_CONNECT_DELAYED: u32 = 2;
pub const ZMQ_EVENT_CONNECT_RETRIED: u32 = 4;
pub const ZMQ_EVENT_LISTENING: u32 = 8;
pub const ZMQ_EVENT_BIND_FAILED: u32 = 16;
pub const ZMQ_EVENT_ACCEPTED: u32 = 32;
pub const ZMQ_EVENT_ACCEPT_FAILED: u32 = 64;
pub const ZMQ_EVENT_CLOSED: u32 = 128;
pub const ZMQ_EVENT_CLOSE_FAILED: u32 = 256;
pub const ZMQ_EVENT_DISCONNECTED: u32 = 512;
pub const ZMQ_EVENT_MONITOR_STOPPED: u32 = 1024;
pub const ZMQ_EVENT_ALL: u32 = 65535;
pub const ZMQ_EVENT_HANDSHAKE_FAILED_NO_DETAIL: u32 = 2048;
pub const ZMQ_EVENT_HANDSHAKE_SUCCEEDED: u32 = 4096;
pub const ZMQ_EVENT_HANDSHAKE_FAILED_PROTOCOL: u32 = 8192;
pub const ZMQ_EVENT_HANDSHAKE_FAILED_AUTH: u32 = 16384;
pub const ZMQ_PROTOCOL_ERROR_ZMTP_UNSPECIFIED: u32 = 268435456;
pub const ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND: u32 = 268435457;
pub const ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_SEQUENCE: u32 = 268435458;
pub const ZMQ_PROTOCOL_ERROR_ZMTP_KEY_EXCHANGE: u32 = 268435459;
pub const ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_UNSPECIFIED: u32 = 268435473;
pub const ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_MESSAGE: u32 = 268435474;
pub const ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_HELLO: u32 = 268435475;
pub const ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_INITIATE: u32 = 268435476;
pub const ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_ERROR: u32 = 268435477;
pub const ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_READY: u32 = 268435478;
pub const ZMQ_PROTOCOL_ERROR_ZMTP_MALFORMED_COMMAND_WELCOME: u32 = 268435479;
pub const ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_METADATA: u32 = 268435480;
pub const ZMQ_PROTOCOL_ERROR_ZMTP_CRYPTOGRAPHIC: u32 = 285212673;
pub const ZMQ_PROTOCOL_ERROR_ZMTP_MECHANISM_MISMATCH: u32 = 285212674;
pub const ZMQ_PROTOCOL_ERROR_ZAP_UNSPECIFIED: u32 = 536870912;
pub const ZMQ_PROTOCOL_ERROR_ZAP_MALFORMED_REPLY: u32 = 536870913;
pub const ZMQ_PROTOCOL_ERROR_ZAP_BAD_REQUEST_ID: u32 = 536870914;
pub const ZMQ_PROTOCOL_ERROR_ZAP_BAD_VERSION: u32 = 536870915;
pub const ZMQ_PROTOCOL_ERROR_ZAP_INVALID_STATUS_CODE: u32 = 536870916;
pub const ZMQ_PROTOCOL_ERROR_ZAP_INVALID_METADATA: u32 = 536870917;
pub const ZMQ_POLLIN: u32 = 1;
pub const ZMQ_POLLOUT: u32 = 2;
pub const ZMQ_POLLERR: u32 = 4;
pub const ZMQ_POLLPRI: u32 = 8;
pub const ZMQ_POLLITEMS_DFLT: u32 = 16;
pub const ZMQ_HAS_CAPABILITIES: u32 = 1;
pub const ZMQ_STREAMER: u32 = 1;
pub const ZMQ_FORWARDER: u32 = 2;
pub const ZMQ_QUEUE: u32 = 3;
pub type __uint8_t = ::std::os::raw::c_uchar;
extern "C" {
pub fn zmq_errno() -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_strerror(errnum_: ::std::os::raw::c_int) -> *const ::std::os::raw::c_char;
}
extern "C" {
pub fn zmq_version(
major_: *mut ::std::os::raw::c_int,
minor_: *mut ::std::os::raw::c_int,
patch_: *mut ::std::os::raw::c_int,
);
}
extern "C" {
pub fn zmq_ctx_new() -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn zmq_ctx_term(context_: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_ctx_shutdown(context_: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_ctx_set(
context_: *mut ::std::os::raw::c_void,
option_: ::std::os::raw::c_int,
optval_: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_ctx_get(
context_: *mut ::std::os::raw::c_void,
option_: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_init(io_threads_: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn zmq_term(context_: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_ctx_destroy(context_: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[repr(align(8))]
#[derive(Copy, Clone)]
pub struct zmq_msg_t {
pub __: [::std::os::raw::c_uchar; 64usize],
}
#[test]
fn bindgen_test_layout_zmq_msg_t() {
assert_eq!(
::std::mem::size_of::<zmq_msg_t>(),
64usize,
concat!("Size of: ", stringify!(zmq_msg_t))
);
assert_eq!(
::std::mem::align_of::<zmq_msg_t>(),
8usize,
concat!("Alignment of ", stringify!(zmq_msg_t))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<zmq_msg_t>())).__ as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(zmq_msg_t),
"::",
stringify!(__)
)
);
}
impl Default for zmq_msg_t {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
pub type zmq_free_fn = ::std::option::Option<
unsafe extern "C" fn(data_: *mut ::std::os::raw::c_void, hint_: *mut ::std::os::raw::c_void),
>;
extern "C" {
pub fn zmq_msg_init(msg_: *mut zmq_msg_t) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_msg_init_size(msg_: *mut zmq_msg_t, size_: usize) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_msg_init_data(
msg_: *mut zmq_msg_t,
data_: *mut ::std::os::raw::c_void,
size_: usize,
ffn_: zmq_free_fn,
hint_: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_msg_send(
msg_: *mut zmq_msg_t,
s_: *mut ::std::os::raw::c_void,
flags_: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_msg_recv(
msg_: *mut zmq_msg_t,
s_: *mut ::std::os::raw::c_void,
flags_: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_msg_close(msg_: *mut zmq_msg_t) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_msg_move(dest_: *mut zmq_msg_t, src_: *mut zmq_msg_t) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_msg_copy(dest_: *mut zmq_msg_t, src_: *mut zmq_msg_t) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_msg_data(msg_: *mut zmq_msg_t) -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn zmq_msg_size(msg_: *const zmq_msg_t) -> usize;
}
extern "C" {
pub fn zmq_msg_more(msg_: *const zmq_msg_t) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_msg_get(
msg_: *const zmq_msg_t,
property_: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_msg_set(
msg_: *mut zmq_msg_t,
property_: ::std::os::raw::c_int,
optval_: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_msg_gets(
msg_: *const zmq_msg_t,
property_: *const ::std::os::raw::c_char,
) -> *const ::std::os::raw::c_char;
}
extern "C" {
pub fn zmq_socket(
arg1: *mut ::std::os::raw::c_void,
type_: ::std::os::raw::c_int,
) -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn zmq_close(s_: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_setsockopt(
s_: *mut ::std::os::raw::c_void,
option_: ::std::os::raw::c_int,
optval_: *const ::std::os::raw::c_void,
optvallen_: usize,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_getsockopt(
s_: *mut ::std::os::raw::c_void,
option_: ::std::os::raw::c_int,
optval_: *mut ::std::os::raw::c_void,
optvallen_: *mut usize,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_bind(
s_: *mut ::std::os::raw::c_void,
addr_: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_connect(
s_: *mut ::std::os::raw::c_void,
addr_: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_unbind(
s_: *mut ::std::os::raw::c_void,
addr_: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_disconnect(
s_: *mut ::std::os::raw::c_void,
addr_: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_send(
s_: *mut ::std::os::raw::c_void,
buf_: *const ::std::os::raw::c_void,
len_: usize,
flags_: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_send_const(
s_: *mut ::std::os::raw::c_void,
buf_: *const ::std::os::raw::c_void,
len_: usize,
flags_: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_recv(
s_: *mut ::std::os::raw::c_void,
buf_: *mut ::std::os::raw::c_void,
len_: usize,
flags_: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_socket_monitor(
s_: *mut ::std::os::raw::c_void,
addr_: *const ::std::os::raw::c_char,
events_: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct zmq_pollitem_t {
pub socket: *mut ::std::os::raw::c_void,
pub fd: ::std::os::raw::c_int,
pub events: ::std::os::raw::c_short,
pub revents: ::std::os::raw::c_short,
}
#[test]
fn bindgen_test_layout_zmq_pollitem_t() {
assert_eq!(
::std::mem::size_of::<zmq_pollitem_t>(),
16usize,
concat!("Size of: ", stringify!(zmq_pollitem_t))
);
assert_eq!(
::std::mem::align_of::<zmq_pollitem_t>(),
8usize,
concat!("Alignment of ", stringify!(zmq_pollitem_t))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<zmq_pollitem_t>())).socket as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(zmq_pollitem_t),
"::",
stringify!(socket)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<zmq_pollitem_t>())).fd as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(zmq_pollitem_t),
"::",
stringify!(fd)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<zmq_pollitem_t>())).events as *const _ as usize },
12usize,
concat!(
"Offset of field: ",
stringify!(zmq_pollitem_t),
"::",
stringify!(events)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<zmq_pollitem_t>())).revents as *const _ as usize },
14usize,
concat!(
"Offset of field: ",
stringify!(zmq_pollitem_t),
"::",
stringify!(revents)
)
);
}
impl Default for zmq_pollitem_t {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
extern "C" {
pub fn zmq_poll(
items_: *mut zmq_pollitem_t,
nitems_: ::std::os::raw::c_int,
timeout_: ::std::os::raw::c_long,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_proxy(
frontend_: *mut ::std::os::raw::c_void,
backend_: *mut ::std::os::raw::c_void,
capture_: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_proxy_steerable(
frontend_: *mut ::std::os::raw::c_void,
backend_: *mut ::std::os::raw::c_void,
capture_: *mut ::std::os::raw::c_void,
control_: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_has(capability_: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_device(
type_: ::std::os::raw::c_int,
frontend_: *mut ::std::os::raw::c_void,
backend_: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_sendmsg(
s_: *mut ::std::os::raw::c_void,
msg_: *mut zmq_msg_t,
flags_: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_recvmsg(
s_: *mut ::std::os::raw::c_void,
msg_: *mut zmq_msg_t,
flags_: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct iovec {
_unused: [u8; 0],
}
extern "C" {
pub fn zmq_sendiov(
s_: *mut ::std::os::raw::c_void,
iov_: *mut iovec,
count_: usize,
flags_: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_recviov(
s_: *mut ::std::os::raw::c_void,
iov_: *mut iovec,
count_: *mut usize,
flags_: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_z85_encode(
dest_: *mut ::std::os::raw::c_char,
data_: *const u8,
size_: usize,
) -> *mut ::std::os::raw::c_char;
}
extern "C" {
pub fn zmq_z85_decode(dest_: *mut u8, string_: *const ::std::os::raw::c_char) -> *mut u8;
}
extern "C" {
pub fn zmq_curve_keypair(
z85_public_key_: *mut ::std::os::raw::c_char,
z85_secret_key_: *mut ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_curve_public(
z85_public_key_: *mut ::std::os::raw::c_char,
z85_secret_key_: *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_atomic_counter_new() -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn zmq_atomic_counter_set(
counter_: *mut ::std::os::raw::c_void,
value_: ::std::os::raw::c_int,
);
}
extern "C" {
pub fn zmq_atomic_counter_inc(counter_: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_atomic_counter_dec(counter_: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_atomic_counter_value(counter_: *mut ::std::os::raw::c_void)
-> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_atomic_counter_destroy(counter_p_: *mut *mut ::std::os::raw::c_void);
}
pub type zmq_timer_fn = ::std::option::Option<
unsafe extern "C" fn(timer_id: ::std::os::raw::c_int, arg: *mut ::std::os::raw::c_void),
>;
extern "C" {
pub fn zmq_timers_new() -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn zmq_timers_destroy(timers_p: *mut *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_timers_add(
timers: *mut ::std::os::raw::c_void,
interval: usize,
handler: zmq_timer_fn,
arg: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_timers_cancel(
timers: *mut ::std::os::raw::c_void,
timer_id: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_timers_set_interval(
timers: *mut ::std::os::raw::c_void,
timer_id: ::std::os::raw::c_int,
interval: usize,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_timers_reset(
timers: *mut ::std::os::raw::c_void,
timer_id: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_timers_timeout(timers: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_long;
}
extern "C" {
pub fn zmq_timers_execute(timers: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn zmq_stopwatch_start() -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn zmq_stopwatch_intermediate(
watch_: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_ulong;
}
extern "C" {
pub fn zmq_stopwatch_stop(watch_: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_ulong;
}
extern "C" {
pub fn zmq_sleep(seconds_: ::std::os::raw::c_int);
}
pub type zmq_thread_fn =
::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>;
extern "C" {
pub fn zmq_threadstart(
func_: zmq_thread_fn,
arg_: *mut ::std::os::raw::c_void,
) -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn zmq_threadclose(thread_: *mut ::std::os::raw::c_void);
}