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
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
/* automatically generated by rust-bindgen 0.55.1 */

pub const XMPP_NS_CLIENT: &'static [u8; 14usize] = b"jabber:client\0";
pub const XMPP_NS_COMPONENT: &'static [u8; 24usize] = b"jabber:component:accept\0";
pub const XMPP_NS_STREAMS: &'static [u8; 33usize] = b"http://etherx.jabber.org/streams\0";
pub const XMPP_NS_STREAMS_IETF: &'static [u8; 36usize] = b"urn:ietf:params:xml:ns:xmpp-streams\0";
pub const XMPP_NS_STANZAS_IETF: &'static [u8; 36usize] = b"urn:ietf:params:xml:ns:xmpp-stanzas\0";
pub const XMPP_NS_TLS: &'static [u8; 32usize] = b"urn:ietf:params:xml:ns:xmpp-tls\0";
pub const XMPP_NS_SASL: &'static [u8; 33usize] = b"urn:ietf:params:xml:ns:xmpp-sasl\0";
pub const XMPP_NS_BIND: &'static [u8; 33usize] = b"urn:ietf:params:xml:ns:xmpp-bind\0";
pub const XMPP_NS_SESSION: &'static [u8; 36usize] = b"urn:ietf:params:xml:ns:xmpp-session\0";
pub const XMPP_NS_AUTH: &'static [u8; 15usize] = b"jabber:iq:auth\0";
pub const XMPP_NS_DISCO_INFO: &'static [u8; 38usize] = b"http://jabber.org/protocol/disco#info\0";
pub const XMPP_NS_DISCO_ITEMS: &'static [u8; 39usize] = b"http://jabber.org/protocol/disco#items\0";
pub const XMPP_NS_ROSTER: &'static [u8; 17usize] = b"jabber:iq:roster\0";
pub const XMPP_NS_REGISTER: &'static [u8; 19usize] = b"jabber:iq:register\0";
pub const XMPP_EOK: i32 = 0;
pub const XMPP_EMEM: i32 = -1;
pub const XMPP_EINVOP: i32 = -2;
pub const XMPP_EINT: i32 = -3;
pub const XMPP_CONN_FLAG_DISABLE_TLS: u32 = 1;
pub const XMPP_CONN_FLAG_MANDATORY_TLS: u32 = 2;
pub const XMPP_CONN_FLAG_LEGACY_SSL: u32 = 4;
pub const XMPP_CONN_FLAG_TRUST_TLS: u32 = 8;
pub const XMPP_CONN_FLAG_LEGACY_AUTH: u32 = 16;
pub const XMPP_SHA1_DIGEST_SIZE: u32 = 20;
extern "C" {
    pub fn xmpp_initialize();
}
extern "C" {
    pub fn xmpp_shutdown();
}
extern "C" {
    pub fn xmpp_version_check(
        major: ::std::os::raw::c_int,
        minor: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
pub type xmpp_mem_t = _xmpp_mem_t;
pub type xmpp_log_t = _xmpp_log_t;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _xmpp_ctx_t {
    _unused: [u8; 0],
}
pub type xmpp_ctx_t = _xmpp_ctx_t;
extern "C" {
    pub fn xmpp_ctx_new(mem: *const xmpp_mem_t, log: *const xmpp_log_t) -> *mut xmpp_ctx_t;
}
extern "C" {
    pub fn xmpp_ctx_free(ctx: *mut xmpp_ctx_t);
}
extern "C" {
    pub fn xmpp_free(ctx: *const xmpp_ctx_t, p: *mut ::std::os::raw::c_void);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _xmpp_mem_t {
    pub alloc: ::std::option::Option<
        unsafe extern "C" fn(
            size: usize,
            userdata: *mut ::std::os::raw::c_void,
        ) -> *mut ::std::os::raw::c_void,
    >,
    pub free: ::std::option::Option<
        unsafe extern "C" fn(p: *mut ::std::os::raw::c_void, userdata: *mut ::std::os::raw::c_void),
    >,
    pub realloc: ::std::option::Option<
        unsafe extern "C" fn(
            p: *mut ::std::os::raw::c_void,
            size: usize,
            userdata: *mut ::std::os::raw::c_void,
        ) -> *mut ::std::os::raw::c_void,
    >,
    pub userdata: *mut ::std::os::raw::c_void,
}
#[test]
fn bindgen_test_layout__xmpp_mem_t() {
    assert_eq!(
        ::std::mem::size_of::<_xmpp_mem_t>(),
        32usize,
        concat!("Size of: ", stringify!(_xmpp_mem_t))
    );
    assert_eq!(
        ::std::mem::align_of::<_xmpp_mem_t>(),
        8usize,
        concat!("Alignment of ", stringify!(_xmpp_mem_t))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<_xmpp_mem_t>())).alloc as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(_xmpp_mem_t),
            "::",
            stringify!(alloc)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<_xmpp_mem_t>())).free as *const _ as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(_xmpp_mem_t),
            "::",
            stringify!(free)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<_xmpp_mem_t>())).realloc as *const _ as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(_xmpp_mem_t),
            "::",
            stringify!(realloc)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<_xmpp_mem_t>())).userdata as *const _ as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(_xmpp_mem_t),
            "::",
            stringify!(userdata)
        )
    );
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum xmpp_log_level_t {
    XMPP_LEVEL_DEBUG = 0,
    XMPP_LEVEL_INFO = 1,
    XMPP_LEVEL_WARN = 2,
    XMPP_LEVEL_ERROR = 3,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum xmpp_conn_type_t {
    XMPP_UNKNOWN = 0,
    XMPP_CLIENT = 1,
    XMPP_COMPONENT = 2,
}
pub type xmpp_log_handler = ::std::option::Option<
    unsafe extern "C" fn(
        userdata: *mut ::std::os::raw::c_void,
        level: xmpp_log_level_t,
        area: *const ::std::os::raw::c_char,
        msg: *const ::std::os::raw::c_char,
    ),
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _xmpp_log_t {
    pub handler: xmpp_log_handler,
    pub userdata: *mut ::std::os::raw::c_void,
}
#[test]
fn bindgen_test_layout__xmpp_log_t() {
    assert_eq!(
        ::std::mem::size_of::<_xmpp_log_t>(),
        16usize,
        concat!("Size of: ", stringify!(_xmpp_log_t))
    );
    assert_eq!(
        ::std::mem::align_of::<_xmpp_log_t>(),
        8usize,
        concat!("Alignment of ", stringify!(_xmpp_log_t))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<_xmpp_log_t>())).handler as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(_xmpp_log_t),
            "::",
            stringify!(handler)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<_xmpp_log_t>())).userdata as *const _ as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(_xmpp_log_t),
            "::",
            stringify!(userdata)
        )
    );
}
extern "C" {
    pub fn xmpp_get_default_logger(level: xmpp_log_level_t) -> *mut xmpp_log_t;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _xmpp_conn_t {
    _unused: [u8; 0],
}
pub type xmpp_conn_t = _xmpp_conn_t;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _xmpp_stanza_t {
    _unused: [u8; 0],
}
pub type xmpp_stanza_t = _xmpp_stanza_t;
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum xmpp_conn_event_t {
    XMPP_CONN_CONNECT = 0,
    XMPP_CONN_RAW_CONNECT = 1,
    XMPP_CONN_DISCONNECT = 2,
    XMPP_CONN_FAIL = 3,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum xmpp_error_type_t {
    XMPP_SE_BAD_FORMAT = 0,
    XMPP_SE_BAD_NS_PREFIX = 1,
    XMPP_SE_CONFLICT = 2,
    XMPP_SE_CONN_TIMEOUT = 3,
    XMPP_SE_HOST_GONE = 4,
    XMPP_SE_HOST_UNKNOWN = 5,
    XMPP_SE_IMPROPER_ADDR = 6,
    XMPP_SE_INTERNAL_SERVER_ERROR = 7,
    XMPP_SE_INVALID_FROM = 8,
    XMPP_SE_INVALID_ID = 9,
    XMPP_SE_INVALID_NS = 10,
    XMPP_SE_INVALID_XML = 11,
    XMPP_SE_NOT_AUTHORIZED = 12,
    XMPP_SE_POLICY_VIOLATION = 13,
    XMPP_SE_REMOTE_CONN_FAILED = 14,
    XMPP_SE_RESOURCE_CONSTRAINT = 15,
    XMPP_SE_RESTRICTED_XML = 16,
    XMPP_SE_SEE_OTHER_HOST = 17,
    XMPP_SE_SYSTEM_SHUTDOWN = 18,
    XMPP_SE_UNDEFINED_CONDITION = 19,
    XMPP_SE_UNSUPPORTED_ENCODING = 20,
    XMPP_SE_UNSUPPORTED_STANZA_TYPE = 21,
    XMPP_SE_UNSUPPORTED_VERSION = 22,
    XMPP_SE_XML_NOT_WELL_FORMED = 23,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct xmpp_stream_error_t {
    pub type_: xmpp_error_type_t,
    pub text: *mut ::std::os::raw::c_char,
    pub stanza: *mut xmpp_stanza_t,
}
#[test]
fn bindgen_test_layout_xmpp_stream_error_t() {
    assert_eq!(
        ::std::mem::size_of::<xmpp_stream_error_t>(),
        24usize,
        concat!("Size of: ", stringify!(xmpp_stream_error_t))
    );
    assert_eq!(
        ::std::mem::align_of::<xmpp_stream_error_t>(),
        8usize,
        concat!("Alignment of ", stringify!(xmpp_stream_error_t))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<xmpp_stream_error_t>())).type_ as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(xmpp_stream_error_t),
            "::",
            stringify!(type_)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<xmpp_stream_error_t>())).text as *const _ as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(xmpp_stream_error_t),
            "::",
            stringify!(text)
        )
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<xmpp_stream_error_t>())).stanza as *const _ as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(xmpp_stream_error_t),
            "::",
            stringify!(stanza)
        )
    );
}
pub type xmpp_conn_handler = ::std::option::Option<
    unsafe extern "C" fn(
        conn: *mut xmpp_conn_t,
        event: xmpp_conn_event_t,
        error: ::std::os::raw::c_int,
        stream_error: *mut xmpp_stream_error_t,
        userdata: *mut ::std::os::raw::c_void,
    ),
>;
extern "C" {
    pub fn xmpp_send_error(
        conn: *mut xmpp_conn_t,
        type_: xmpp_error_type_t,
        text: *mut ::std::os::raw::c_char,
    );
}
extern "C" {
    pub fn xmpp_conn_new(ctx: *mut xmpp_ctx_t) -> *mut xmpp_conn_t;
}
extern "C" {
    pub fn xmpp_conn_clone(conn: *mut xmpp_conn_t) -> *mut xmpp_conn_t;
}
extern "C" {
    pub fn xmpp_conn_release(conn: *mut xmpp_conn_t) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_conn_get_flags(conn: *const xmpp_conn_t) -> ::std::os::raw::c_long;
}
extern "C" {
    pub fn xmpp_conn_set_flags(
        conn: *mut xmpp_conn_t,
        flags: ::std::os::raw::c_long,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_conn_get_jid(conn: *const xmpp_conn_t) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn xmpp_conn_get_bound_jid(conn: *const xmpp_conn_t) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn xmpp_conn_set_jid(conn: *mut xmpp_conn_t, jid: *const ::std::os::raw::c_char);
}
extern "C" {
    pub fn xmpp_conn_get_pass(conn: *const xmpp_conn_t) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn xmpp_conn_set_pass(conn: *mut xmpp_conn_t, pass: *const ::std::os::raw::c_char);
}
extern "C" {
    pub fn xmpp_conn_get_context(conn: *mut xmpp_conn_t) -> *mut xmpp_ctx_t;
}
extern "C" {
    pub fn xmpp_conn_disable_tls(conn: *mut xmpp_conn_t);
}
extern "C" {
    pub fn xmpp_conn_is_secured(conn: *mut xmpp_conn_t) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_conn_set_keepalive(
        conn: *mut xmpp_conn_t,
        timeout: ::std::os::raw::c_int,
        interval: ::std::os::raw::c_int,
    );
}
extern "C" {
    pub fn xmpp_conn_is_connecting(conn: *mut xmpp_conn_t) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_conn_is_connected(conn: *mut xmpp_conn_t) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_conn_is_disconnected(conn: *mut xmpp_conn_t) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_connect_client(
        conn: *mut xmpp_conn_t,
        altdomain: *const ::std::os::raw::c_char,
        altport: ::std::os::raw::c_ushort,
        callback: xmpp_conn_handler,
        userdata: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_connect_component(
        conn: *mut xmpp_conn_t,
        server: *const ::std::os::raw::c_char,
        port: ::std::os::raw::c_ushort,
        callback: xmpp_conn_handler,
        userdata: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_connect_raw(
        conn: *mut xmpp_conn_t,
        altdomain: *const ::std::os::raw::c_char,
        altport: ::std::os::raw::c_ushort,
        callback: xmpp_conn_handler,
        userdata: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_conn_open_stream_default(conn: *mut xmpp_conn_t) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_conn_open_stream(
        conn: *mut xmpp_conn_t,
        attributes: *mut *mut ::std::os::raw::c_char,
        attributes_len: usize,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_conn_tls_start(conn: *mut xmpp_conn_t) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_disconnect(conn: *mut xmpp_conn_t);
}
extern "C" {
    pub fn xmpp_send(conn: *mut xmpp_conn_t, stanza: *mut xmpp_stanza_t);
}
extern "C" {
    pub fn xmpp_send_raw_string(conn: *mut xmpp_conn_t, fmt: *const ::std::os::raw::c_char, ...);
}
extern "C" {
    pub fn xmpp_send_raw(conn: *mut xmpp_conn_t, data: *const ::std::os::raw::c_char, len: usize);
}
pub type xmpp_timed_handler = ::std::option::Option<
    unsafe extern "C" fn(
        conn: *mut xmpp_conn_t,
        userdata: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int,
>;
extern "C" {
    pub fn xmpp_timed_handler_add(
        conn: *mut xmpp_conn_t,
        handler: xmpp_timed_handler,
        period: ::std::os::raw::c_ulong,
        userdata: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn xmpp_timed_handler_delete(conn: *mut xmpp_conn_t, handler: xmpp_timed_handler);
}
pub type xmpp_global_timed_handler = ::std::option::Option<
    unsafe extern "C" fn(
        ctx: *mut xmpp_ctx_t,
        userdata: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int,
>;
extern "C" {
    pub fn xmpp_global_timed_handler_add(
        ctx: *mut xmpp_ctx_t,
        handler: xmpp_global_timed_handler,
        period: ::std::os::raw::c_ulong,
        userdata: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn xmpp_global_timed_handler_delete(
        ctx: *mut xmpp_ctx_t,
        handler: xmpp_global_timed_handler,
    );
}
pub type xmpp_handler = ::std::option::Option<
    unsafe extern "C" fn(
        conn: *mut xmpp_conn_t,
        stanza: *mut xmpp_stanza_t,
        userdata: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int,
>;
extern "C" {
    pub fn xmpp_handler_add(
        conn: *mut xmpp_conn_t,
        handler: xmpp_handler,
        ns: *const ::std::os::raw::c_char,
        name: *const ::std::os::raw::c_char,
        type_: *const ::std::os::raw::c_char,
        userdata: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn xmpp_handler_delete(conn: *mut xmpp_conn_t, handler: xmpp_handler);
}
extern "C" {
    pub fn xmpp_id_handler_add(
        conn: *mut xmpp_conn_t,
        handler: xmpp_handler,
        id: *const ::std::os::raw::c_char,
        userdata: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn xmpp_id_handler_delete(
        conn: *mut xmpp_conn_t,
        handler: xmpp_handler,
        id: *const ::std::os::raw::c_char,
    );
}
extern "C" {
    pub fn xmpp_stanza_new(ctx: *mut xmpp_ctx_t) -> *mut xmpp_stanza_t;
}
extern "C" {
    pub fn xmpp_stanza_new_from_string(
        ctx: *mut xmpp_ctx_t,
        str_: *const ::std::os::raw::c_char,
    ) -> *mut xmpp_stanza_t;
}
extern "C" {
    pub fn xmpp_stanza_clone(stanza: *mut xmpp_stanza_t) -> *mut xmpp_stanza_t;
}
extern "C" {
    pub fn xmpp_stanza_copy(stanza: *const xmpp_stanza_t) -> *mut xmpp_stanza_t;
}
extern "C" {
    pub fn xmpp_stanza_release(stanza: *mut xmpp_stanza_t) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_stanza_get_context(stanza: *const xmpp_stanza_t) -> *mut xmpp_ctx_t;
}
extern "C" {
    pub fn xmpp_stanza_is_text(stanza: *mut xmpp_stanza_t) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_stanza_is_tag(stanza: *mut xmpp_stanza_t) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_stanza_to_text(
        stanza: *mut xmpp_stanza_t,
        buf: *mut *mut ::std::os::raw::c_char,
        buflen: *mut usize,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_stanza_get_children(stanza: *mut xmpp_stanza_t) -> *mut xmpp_stanza_t;
}
extern "C" {
    pub fn xmpp_stanza_get_child_by_name(
        stanza: *mut xmpp_stanza_t,
        name: *const ::std::os::raw::c_char,
    ) -> *mut xmpp_stanza_t;
}
extern "C" {
    pub fn xmpp_stanza_get_child_by_ns(
        stanza: *mut xmpp_stanza_t,
        ns: *const ::std::os::raw::c_char,
    ) -> *mut xmpp_stanza_t;
}
extern "C" {
    pub fn xmpp_stanza_get_child_by_name_and_ns(
        stanza: *mut xmpp_stanza_t,
        name: *const ::std::os::raw::c_char,
        ns: *const ::std::os::raw::c_char,
    ) -> *mut xmpp_stanza_t;
}
extern "C" {
    pub fn xmpp_stanza_get_next(stanza: *mut xmpp_stanza_t) -> *mut xmpp_stanza_t;
}
extern "C" {
    pub fn xmpp_stanza_add_child(
        stanza: *mut xmpp_stanza_t,
        child: *mut xmpp_stanza_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_stanza_add_child_ex(
        stanza: *mut xmpp_stanza_t,
        child: *mut xmpp_stanza_t,
        do_clone: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_stanza_get_attribute(
        stanza: *mut xmpp_stanza_t,
        name: *const ::std::os::raw::c_char,
    ) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn xmpp_stanza_get_attribute_count(stanza: *mut xmpp_stanza_t) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_stanza_get_attributes(
        stanza: *mut xmpp_stanza_t,
        attr: *mut *const ::std::os::raw::c_char,
        attrlen: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_stanza_get_text(stanza: *mut xmpp_stanza_t) -> *mut ::std::os::raw::c_char;
}
extern "C" {
    pub fn xmpp_stanza_get_text_ptr(stanza: *mut xmpp_stanza_t) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn xmpp_stanza_get_name(stanza: *mut xmpp_stanza_t) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn xmpp_stanza_set_attribute(
        stanza: *mut xmpp_stanza_t,
        key: *const ::std::os::raw::c_char,
        value: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_stanza_set_name(
        stanza: *mut xmpp_stanza_t,
        name: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_stanza_set_text(
        stanza: *mut xmpp_stanza_t,
        text: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_stanza_set_text_with_size(
        stanza: *mut xmpp_stanza_t,
        text: *const ::std::os::raw::c_char,
        size: usize,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_stanza_del_attribute(
        stanza: *mut xmpp_stanza_t,
        name: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_stanza_get_ns(stanza: *mut xmpp_stanza_t) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn xmpp_stanza_get_type(stanza: *mut xmpp_stanza_t) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn xmpp_stanza_get_id(stanza: *mut xmpp_stanza_t) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn xmpp_stanza_get_to(stanza: *mut xmpp_stanza_t) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn xmpp_stanza_get_from(stanza: *mut xmpp_stanza_t) -> *const ::std::os::raw::c_char;
}
extern "C" {
    pub fn xmpp_stanza_set_ns(
        stanza: *mut xmpp_stanza_t,
        ns: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_stanza_set_id(
        stanza: *mut xmpp_stanza_t,
        id: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_stanza_set_type(
        stanza: *mut xmpp_stanza_t,
        type_: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_stanza_set_to(
        stanza: *mut xmpp_stanza_t,
        to: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_stanza_set_from(
        stanza: *mut xmpp_stanza_t,
        from: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_stanza_reply(stanza: *mut xmpp_stanza_t) -> *mut xmpp_stanza_t;
}
extern "C" {
    pub fn xmpp_stanza_reply_error(
        stanza: *mut xmpp_stanza_t,
        error_type: *const ::std::os::raw::c_char,
        condition: *const ::std::os::raw::c_char,
        text: *const ::std::os::raw::c_char,
    ) -> *mut xmpp_stanza_t;
}
extern "C" {
    pub fn xmpp_message_new(
        ctx: *mut xmpp_ctx_t,
        type_: *const ::std::os::raw::c_char,
        to: *const ::std::os::raw::c_char,
        id: *const ::std::os::raw::c_char,
    ) -> *mut xmpp_stanza_t;
}
extern "C" {
    pub fn xmpp_message_get_body(msg: *mut xmpp_stanza_t) -> *mut ::std::os::raw::c_char;
}
extern "C" {
    pub fn xmpp_message_set_body(
        msg: *mut xmpp_stanza_t,
        text: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn xmpp_iq_new(
        ctx: *mut xmpp_ctx_t,
        type_: *const ::std::os::raw::c_char,
        id: *const ::std::os::raw::c_char,
    ) -> *mut xmpp_stanza_t;
}
extern "C" {
    pub fn xmpp_presence_new(ctx: *mut xmpp_ctx_t) -> *mut xmpp_stanza_t;
}
extern "C" {
    pub fn xmpp_error_new(
        ctx: *mut xmpp_ctx_t,
        type_: xmpp_error_type_t,
        text: *const ::std::os::raw::c_char,
    ) -> *mut xmpp_stanza_t;
}
extern "C" {
    pub fn xmpp_jid_new(
        ctx: *mut xmpp_ctx_t,
        node: *const ::std::os::raw::c_char,
        domain: *const ::std::os::raw::c_char,
        resource: *const ::std::os::raw::c_char,
    ) -> *mut ::std::os::raw::c_char;
}
extern "C" {
    pub fn xmpp_jid_bare(
        ctx: *mut xmpp_ctx_t,
        jid: *const ::std::os::raw::c_char,
    ) -> *mut ::std::os::raw::c_char;
}
extern "C" {
    pub fn xmpp_jid_node(
        ctx: *mut xmpp_ctx_t,
        jid: *const ::std::os::raw::c_char,
    ) -> *mut ::std::os::raw::c_char;
}
extern "C" {
    pub fn xmpp_jid_domain(
        ctx: *mut xmpp_ctx_t,
        jid: *const ::std::os::raw::c_char,
    ) -> *mut ::std::os::raw::c_char;
}
extern "C" {
    pub fn xmpp_jid_resource(
        ctx: *mut xmpp_ctx_t,
        jid: *const ::std::os::raw::c_char,
    ) -> *mut ::std::os::raw::c_char;
}
extern "C" {
    pub fn xmpp_run_once(ctx: *mut xmpp_ctx_t, timeout: ::std::os::raw::c_ulong);
}
extern "C" {
    pub fn xmpp_run(ctx: *mut xmpp_ctx_t);
}
extern "C" {
    pub fn xmpp_stop(ctx: *mut xmpp_ctx_t);
}
extern "C" {
    pub fn xmpp_ctx_set_timeout(ctx: *mut xmpp_ctx_t, timeout: ::std::os::raw::c_ulong);
}
extern "C" {
    pub fn xmpp_uuid_gen(ctx: *mut xmpp_ctx_t) -> *mut ::std::os::raw::c_char;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _xmpp_sha1_t {
    _unused: [u8; 0],
}
pub type xmpp_sha1_t = _xmpp_sha1_t;
extern "C" {
    pub fn xmpp_sha1(
        ctx: *mut xmpp_ctx_t,
        data: *const ::std::os::raw::c_uchar,
        len: usize,
    ) -> *mut ::std::os::raw::c_char;
}
extern "C" {
    pub fn xmpp_sha1_digest(
        data: *const ::std::os::raw::c_uchar,
        len: usize,
        digest: *mut ::std::os::raw::c_uchar,
    );
}
extern "C" {
    pub fn xmpp_sha1_new(ctx: *mut xmpp_ctx_t) -> *mut xmpp_sha1_t;
}
extern "C" {
    pub fn xmpp_sha1_free(sha1: *mut xmpp_sha1_t);
}
extern "C" {
    pub fn xmpp_sha1_update(
        sha1: *mut xmpp_sha1_t,
        data: *const ::std::os::raw::c_uchar,
        len: usize,
    );
}
extern "C" {
    pub fn xmpp_sha1_final(sha1: *mut xmpp_sha1_t);
}
extern "C" {
    pub fn xmpp_sha1_to_string(
        sha1: *mut xmpp_sha1_t,
        s: *mut ::std::os::raw::c_char,
        slen: usize,
    ) -> *mut ::std::os::raw::c_char;
}
extern "C" {
    pub fn xmpp_sha1_to_string_alloc(sha1: *mut xmpp_sha1_t) -> *mut ::std::os::raw::c_char;
}
extern "C" {
    pub fn xmpp_sha1_to_digest(sha1: *mut xmpp_sha1_t, digest: *mut ::std::os::raw::c_uchar);
}
extern "C" {
    pub fn xmpp_base64_encode(
        ctx: *mut xmpp_ctx_t,
        data: *const ::std::os::raw::c_uchar,
        len: usize,
    ) -> *mut ::std::os::raw::c_char;
}
extern "C" {
    pub fn xmpp_base64_decode_str(
        ctx: *mut xmpp_ctx_t,
        base64: *const ::std::os::raw::c_char,
        len: usize,
    ) -> *mut ::std::os::raw::c_char;
}
extern "C" {
    pub fn xmpp_base64_decode_bin(
        ctx: *mut xmpp_ctx_t,
        base64: *const ::std::os::raw::c_char,
        len: usize,
        out: *mut *mut ::std::os::raw::c_uchar,
        outlen: *mut usize,
    );
}