alhc 0.2.2

Async Lightweight HTTP Client: A async http client library that using system library to reduce binary size if possible. (Currently under heavy development)
Documentation
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
#![allow(unused)]
#![allow(non_snake_case)]

use core_foundation::array::*;
use core_foundation::data::*;
use core_foundation::dictionary::*;
use core_foundation::runloop::*;
use core_foundation::string::*;
use core_foundation::url::*;

#[repr(C)]
pub struct __CFAllocator(::core::ffi::c_void);
#[repr(C)]
pub struct __CFError(::core::ffi::c_void);
#[repr(C)]
pub struct __CFReadStream(::core::ffi::c_void);
#[repr(C)]
pub struct __CFWriteStream(::core::ffi::c_void);
#[repr(C)]
pub struct __CFHost(::core::ffi::c_void);
#[repr(C)]
pub struct __CFNetService(::core::ffi::c_void);
#[repr(C)]
pub struct __CFNetServiceMonitor(::core::ffi::c_void);
#[repr(C)]
pub struct __CFNetServiceBrowser(::core::ffi::c_void);
#[repr(C)]
pub struct __CFHTTPMessage(::core::ffi::c_void);
#[repr(C)]
pub struct _CFHTTPAuthentication(::core::ffi::c_void);
#[repr(C)]
pub struct __CFNetDiagnostic(::core::ffi::c_void);

/* automatically generated by rust-bindgen 0.62.0 */

pub type UInt8 = ::core::ffi::c_uchar;
pub type SInt32 = ::core::ffi::c_int;
pub type Boolean = ::core::ffi::c_uchar;
pub type CFTypeID = ::core::ffi::c_ulong;
pub type CFOptionFlags = ::core::ffi::c_ulong;
pub type CFIndex = ::core::ffi::c_long;
pub type CFTypeRef = *const ::core::ffi::c_void;
pub type CFStringRef = *const __CFString;
pub type CFAllocatorRef = *const __CFAllocator;
pub type CFAllocatorRetainCallBack = ::core::option::Option<
    unsafe extern "C" fn(info: *const ::core::ffi::c_void) -> *const ::core::ffi::c_void,
>;
pub type CFAllocatorReleaseCallBack =
    ::core::option::Option<unsafe extern "C" fn(info: *const ::core::ffi::c_void)>;
pub type CFAllocatorCopyDescriptionCallBack =
    ::core::option::Option<unsafe extern "C" fn(info: *const ::core::ffi::c_void) -> CFStringRef>;
pub type CFArrayRef = *const __CFArray;
pub type CFDictionaryRef = *const __CFDictionary;
pub type CFTimeInterval = f64;
pub type CFDataRef = *const __CFData;
pub type CFErrorRef = *mut __CFError;
pub type CFURLRef = *const __CFURL;
pub type CFRunLoopRef = *mut __CFRunLoop;
pub type CFRunLoopSourceRef = *mut __CFRunLoopSource;
pub type CFReadStreamRef = *mut __CFReadStream;
pub type CFWriteStreamRef = *mut __CFWriteStream;
pub type CFNetworkErrors = ::core::ffi::c_int;
pub type CFHostRef = *mut __CFHost;
pub type CFHostInfoType = ::core::ffi::c_int;
pub type CFHostClientCallBack = ::core::option::Option<
    unsafe extern "C" fn(
        theHost: CFHostRef,
        typeInfo: CFHostInfoType,
        error: *const CFStreamError,
        info: *mut ::core::ffi::c_void,
    ),
>;
pub type CFNetServiceRef = *mut __CFNetService;
pub type CFNetServiceMonitorRef = *mut __CFNetServiceMonitor;
pub type CFNetServiceBrowserRef = *mut __CFNetServiceBrowser;
pub type CFNetServicesError = ::core::ffi::c_int;
pub type CFNetServiceMonitorType = ::core::ffi::c_int;
pub type CFNetServiceRegisterFlags = CFOptionFlags;
pub type CFNetServiceBrowserFlags = CFOptionFlags;
pub type CFNetServiceClientCallBack = ::core::option::Option<
    unsafe extern "C" fn(
        theService: CFNetServiceRef,
        error: *mut CFStreamError,
        info: *mut ::core::ffi::c_void,
    ),
>;
pub type CFNetServiceMonitorClientCallBack = ::core::option::Option<
    unsafe extern "C" fn(
        theMonitor: CFNetServiceMonitorRef,
        theService: CFNetServiceRef,
        typeInfo: CFNetServiceMonitorType,
        rdata: CFDataRef,
        error: *mut CFStreamError,
        info: *mut ::core::ffi::c_void,
    ),
>;
pub type CFNetServiceBrowserClientCallBack = ::core::option::Option<
    unsafe extern "C" fn(
        browser: CFNetServiceBrowserRef,
        flags: CFOptionFlags,
        domainOrService: CFTypeRef,
        error: *mut CFStreamError,
        info: *mut ::core::ffi::c_void,
    ),
>;
pub type CFHTTPMessageRef = *mut __CFHTTPMessage;
pub type CFStreamErrorHTTP = ::core::ffi::c_int;
pub type CFHTTPAuthenticationRef = *mut _CFHTTPAuthentication;
pub type CFStreamErrorHTTPAuthentication = ::core::ffi::c_int;
pub type CFNetDiagnosticRef = *mut __CFNetDiagnostic;
pub type CFNetDiagnosticStatusValues = ::core::ffi::c_int;
pub type CFNetDiagnosticStatus = CFIndex;
pub type CFProxyAutoConfigurationResultCallback = ::core::option::Option<
    unsafe extern "C" fn(
        client: *mut ::core::ffi::c_void,
        proxyList: CFArrayRef,
        error: CFErrorRef,
    ),
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CFStreamError {
    pub domain: CFIndex,
    pub error: SInt32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct CFStreamClientContext {
    pub version: CFIndex,
    pub info: *mut ::core::ffi::c_void,
    pub retain: ::core::option::Option<
        unsafe extern "C" fn(info: *mut ::core::ffi::c_void) -> *mut ::core::ffi::c_void,
    >,
    pub release: ::core::option::Option<unsafe extern "C" fn(info: *mut ::core::ffi::c_void)>,
    pub copyDescription:
        ::core::option::Option<unsafe extern "C" fn(info: *mut ::core::ffi::c_void) -> CFStringRef>,
}
#[repr(C, packed(2))]
pub struct CFHostClientContext {
    pub version: CFIndex,
    pub info: *mut ::core::ffi::c_void,
    pub retain: CFAllocatorRetainCallBack,
    pub release: CFAllocatorReleaseCallBack,
    pub copyDescription: CFAllocatorCopyDescriptionCallBack,
}
#[repr(C, packed(2))]
pub struct CFNetServiceClientContext {
    pub version: CFIndex,
    pub info: *mut ::core::ffi::c_void,
    pub retain: CFAllocatorRetainCallBack,
    pub release: CFAllocatorReleaseCallBack,
    pub copyDescription: CFAllocatorCopyDescriptionCallBack,
}
#[test]
fn bindgen_test_layout_CFStreamError() {
    const UNINIT: ::core::mem::MaybeUninit<CFStreamError> = ::core::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::core::mem::size_of::<CFStreamError>(),
        16usize,
        concat!("Size of: ", stringify!(CFStreamError))
    );
    assert_eq!(
        ::core::mem::align_of::<CFStreamError>(),
        8usize,
        concat!("Alignment of ", stringify!(CFStreamError))
    );
    assert_eq!(
        unsafe { ::core::ptr::addr_of!((*ptr).domain) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(CFStreamError),
            "::",
            stringify!(domain)
        )
    );
    assert_eq!(
        unsafe { ::core::ptr::addr_of!((*ptr).error) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(CFStreamError),
            "::",
            stringify!(error)
        )
    );
}
#[test]
fn bindgen_test_layout_CFStreamClientContext() {
    const UNINIT: ::core::mem::MaybeUninit<CFStreamClientContext> =
        ::core::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::core::mem::size_of::<CFStreamClientContext>(),
        40usize,
        concat!("Size of: ", stringify!(CFStreamClientContext))
    );
    assert_eq!(
        ::core::mem::align_of::<CFStreamClientContext>(),
        8usize,
        concat!("Alignment of ", stringify!(CFStreamClientContext))
    );
    assert_eq!(
        unsafe { ::core::ptr::addr_of!((*ptr).version) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(CFStreamClientContext),
            "::",
            stringify!(version)
        )
    );
    assert_eq!(
        unsafe { ::core::ptr::addr_of!((*ptr).info) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(CFStreamClientContext),
            "::",
            stringify!(info)
        )
    );
    assert_eq!(
        unsafe { ::core::ptr::addr_of!((*ptr).retain) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(CFStreamClientContext),
            "::",
            stringify!(retain)
        )
    );
    assert_eq!(
        unsafe { ::core::ptr::addr_of!((*ptr).release) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(CFStreamClientContext),
            "::",
            stringify!(release)
        )
    );
    assert_eq!(
        unsafe { ::core::ptr::addr_of!((*ptr).copyDescription) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(CFStreamClientContext),
            "::",
            stringify!(copyDescription)
        )
    );
}
#[test]
fn bindgen_test_layout_CFHostClientContext() {
    const UNINIT: ::core::mem::MaybeUninit<CFHostClientContext> =
        ::core::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::core::mem::size_of::<CFHostClientContext>(),
        40usize,
        concat!("Size of: ", stringify!(CFHostClientContext))
    );
    assert_eq!(
        ::core::mem::align_of::<CFHostClientContext>(),
        2usize,
        concat!("Alignment of ", stringify!(CFHostClientContext))
    );
    assert_eq!(
        unsafe { ::core::ptr::addr_of!((*ptr).version) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(CFHostClientContext),
            "::",
            stringify!(version)
        )
    );
    assert_eq!(
        unsafe { ::core::ptr::addr_of!((*ptr).info) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(CFHostClientContext),
            "::",
            stringify!(info)
        )
    );
    assert_eq!(
        unsafe { ::core::ptr::addr_of!((*ptr).retain) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(CFHostClientContext),
            "::",
            stringify!(retain)
        )
    );
    assert_eq!(
        unsafe { ::core::ptr::addr_of!((*ptr).release) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(CFHostClientContext),
            "::",
            stringify!(release)
        )
    );
    assert_eq!(
        unsafe { ::core::ptr::addr_of!((*ptr).copyDescription) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(CFHostClientContext),
            "::",
            stringify!(copyDescription)
        )
    );
}
#[test]
fn bindgen_test_layout_CFNetServiceClientContext() {
    const UNINIT: ::core::mem::MaybeUninit<CFNetServiceClientContext> =
        ::core::mem::MaybeUninit::uninit();
    let ptr = UNINIT.as_ptr();
    assert_eq!(
        ::core::mem::size_of::<CFNetServiceClientContext>(),
        40usize,
        concat!("Size of: ", stringify!(CFNetServiceClientContext))
    );
    assert_eq!(
        ::core::mem::align_of::<CFNetServiceClientContext>(),
        2usize,
        concat!("Alignment of ", stringify!(CFNetServiceClientContext))
    );
    assert_eq!(
        unsafe { ::core::ptr::addr_of!((*ptr).version) as usize - ptr as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(CFNetServiceClientContext),
            "::",
            stringify!(version)
        )
    );
    assert_eq!(
        unsafe { ::core::ptr::addr_of!((*ptr).info) as usize - ptr as usize },
        8usize,
        concat!(
            "Offset of field: ",
            stringify!(CFNetServiceClientContext),
            "::",
            stringify!(info)
        )
    );
    assert_eq!(
        unsafe { ::core::ptr::addr_of!((*ptr).retain) as usize - ptr as usize },
        16usize,
        concat!(
            "Offset of field: ",
            stringify!(CFNetServiceClientContext),
            "::",
            stringify!(retain)
        )
    );
    assert_eq!(
        unsafe { ::core::ptr::addr_of!((*ptr).release) as usize - ptr as usize },
        24usize,
        concat!(
            "Offset of field: ",
            stringify!(CFNetServiceClientContext),
            "::",
            stringify!(release)
        )
    );
    assert_eq!(
        unsafe { ::core::ptr::addr_of!((*ptr).copyDescription) as usize - ptr as usize },
        32usize,
        concat!(
            "Offset of field: ",
            stringify!(CFNetServiceClientContext),
            "::",
            stringify!(copyDescription)
        )
    );
}

#[link(name = "CFNetwork", kind = "framework")]
extern "C" {
    pub static kCFErrorDomainCFNetwork: CFStringRef;
    pub static kCFErrorDomainWinSock: CFStringRef;
    pub static kCFURLErrorFailingURLErrorKey: CFStringRef;
    pub static kCFURLErrorFailingURLStringErrorKey: CFStringRef;
    pub static kCFGetAddrInfoFailureKey: CFStringRef;
    pub static kCFSOCKSStatusCodeKey: CFStringRef;
    pub static kCFSOCKSVersionKey: CFStringRef;
    pub static kCFSOCKSNegotiationMethodKey: CFStringRef;
    pub static kCFDNSServiceFailureKey: CFStringRef;
    pub static kCFFTPStatusCodeKey: CFStringRef;
    pub static kCFStreamErrorDomainNetDB: SInt32;
    pub static kCFStreamErrorDomainSystemConfiguration: SInt32;
    pub fn CFHostGetTypeID() -> CFTypeID;
    pub fn CFHostCreateWithName(allocator: CFAllocatorRef, hostname: CFStringRef) -> CFHostRef;
    pub fn CFHostCreateWithAddress(allocator: CFAllocatorRef, addr: CFDataRef) -> CFHostRef;
    pub fn CFHostCreateCopy(alloc: CFAllocatorRef, host: CFHostRef) -> CFHostRef;
    pub fn CFHostStartInfoResolution(
        theHost: CFHostRef,
        info: CFHostInfoType,
        error: *mut CFStreamError,
    ) -> Boolean;
    pub fn CFHostGetAddressing(theHost: CFHostRef, hasBeenResolved: *mut Boolean) -> CFArrayRef;
    pub fn CFHostGetNames(theHost: CFHostRef, hasBeenResolved: *mut Boolean) -> CFArrayRef;
    pub fn CFHostGetReachability(theHost: CFHostRef, hasBeenResolved: *mut Boolean) -> CFDataRef;
    pub fn CFHostCancelInfoResolution(theHost: CFHostRef, info: CFHostInfoType);
    pub fn CFHostSetClient(
        theHost: CFHostRef,
        clientCB: CFHostClientCallBack,
        clientContext: *mut CFHostClientContext,
    ) -> Boolean;
    pub fn CFHostScheduleWithRunLoop(
        theHost: CFHostRef,
        runLoop: CFRunLoopRef,
        runLoopMode: CFStringRef,
    );
    pub fn CFHostUnscheduleFromRunLoop(
        theHost: CFHostRef,
        runLoop: CFRunLoopRef,
        runLoopMode: CFStringRef,
    );
    pub static kCFStreamErrorDomainMach: SInt32;
    pub static kCFStreamErrorDomainNetServices: SInt32;
    pub fn CFNetServiceGetTypeID() -> CFTypeID;
    pub fn CFNetServiceMonitorGetTypeID() -> CFTypeID;
    pub fn CFNetServiceBrowserGetTypeID() -> CFTypeID;
    pub fn CFNetServiceCreate(
        alloc: CFAllocatorRef,
        domain: CFStringRef,
        serviceType: CFStringRef,
        name: CFStringRef,
        port: SInt32,
    ) -> CFNetServiceRef;
    pub fn CFNetServiceCreateCopy(
        alloc: CFAllocatorRef,
        service: CFNetServiceRef,
    ) -> CFNetServiceRef;
    pub fn CFNetServiceGetDomain(theService: CFNetServiceRef) -> CFStringRef;
    pub fn CFNetServiceGetType(theService: CFNetServiceRef) -> CFStringRef;
    pub fn CFNetServiceGetName(theService: CFNetServiceRef) -> CFStringRef;
    pub fn CFNetServiceRegisterWithOptions(
        theService: CFNetServiceRef,
        options: CFOptionFlags,
        error: *mut CFStreamError,
    ) -> Boolean;
    pub fn CFNetServiceResolveWithTimeout(
        theService: CFNetServiceRef,
        timeout: CFTimeInterval,
        error: *mut CFStreamError,
    ) -> Boolean;
    pub fn CFNetServiceCancel(theService: CFNetServiceRef);
    pub fn CFNetServiceGetTargetHost(theService: CFNetServiceRef) -> CFStringRef;
    pub fn CFNetServiceGetPortNumber(theService: CFNetServiceRef) -> SInt32;
    pub fn CFNetServiceGetAddressing(theService: CFNetServiceRef) -> CFArrayRef;
    pub fn CFNetServiceGetTXTData(theService: CFNetServiceRef) -> CFDataRef;
    pub fn CFNetServiceSetTXTData(theService: CFNetServiceRef, txtRecord: CFDataRef) -> Boolean;
    pub fn CFNetServiceCreateDictionaryWithTXTData(
        alloc: CFAllocatorRef,
        txtRecord: CFDataRef,
    ) -> CFDictionaryRef;
    pub fn CFNetServiceCreateTXTDataWithDictionary(
        alloc: CFAllocatorRef,
        keyValuePairs: CFDictionaryRef,
    ) -> CFDataRef;
    pub fn CFNetServiceSetClient(
        theService: CFNetServiceRef,
        clientCB: CFNetServiceClientCallBack,
        clientContext: *mut CFNetServiceClientContext,
    ) -> Boolean;
    pub fn CFNetServiceScheduleWithRunLoop(
        theService: CFNetServiceRef,
        runLoop: CFRunLoopRef,
        runLoopMode: CFStringRef,
    );
    pub fn CFNetServiceUnscheduleFromRunLoop(
        theService: CFNetServiceRef,
        runLoop: CFRunLoopRef,
        runLoopMode: CFStringRef,
    );
    pub fn CFNetServiceMonitorCreate(
        alloc: CFAllocatorRef,
        theService: CFNetServiceRef,
        clientCB: CFNetServiceMonitorClientCallBack,
        clientContext: *mut CFNetServiceClientContext,
    ) -> CFNetServiceMonitorRef;
    pub fn CFNetServiceMonitorInvalidate(monitor: CFNetServiceMonitorRef);
    pub fn CFNetServiceMonitorStart(
        monitor: CFNetServiceMonitorRef,
        recordType: CFNetServiceMonitorType,
        error: *mut CFStreamError,
    ) -> Boolean;
    pub fn CFNetServiceMonitorStop(monitor: CFNetServiceMonitorRef, error: *mut CFStreamError);
    pub fn CFNetServiceMonitorScheduleWithRunLoop(
        monitor: CFNetServiceMonitorRef,
        runLoop: CFRunLoopRef,
        runLoopMode: CFStringRef,
    );
    pub fn CFNetServiceMonitorUnscheduleFromRunLoop(
        monitor: CFNetServiceMonitorRef,
        runLoop: CFRunLoopRef,
        runLoopMode: CFStringRef,
    );
    pub fn CFNetServiceBrowserCreate(
        alloc: CFAllocatorRef,
        clientCB: CFNetServiceBrowserClientCallBack,
        clientContext: *mut CFNetServiceClientContext,
    ) -> CFNetServiceBrowserRef;
    pub fn CFNetServiceBrowserInvalidate(browser: CFNetServiceBrowserRef);
    pub fn CFNetServiceBrowserSearchForDomains(
        browser: CFNetServiceBrowserRef,
        registrationDomains: Boolean,
        error: *mut CFStreamError,
    ) -> Boolean;
    pub fn CFNetServiceBrowserSearchForServices(
        browser: CFNetServiceBrowserRef,
        domain: CFStringRef,
        serviceType: CFStringRef,
        error: *mut CFStreamError,
    ) -> Boolean;
    pub fn CFNetServiceBrowserStopSearch(
        browser: CFNetServiceBrowserRef,
        error: *mut CFStreamError,
    );
    pub fn CFNetServiceBrowserScheduleWithRunLoop(
        browser: CFNetServiceBrowserRef,
        runLoop: CFRunLoopRef,
        runLoopMode: CFStringRef,
    );
    pub fn CFNetServiceBrowserUnscheduleFromRunLoop(
        browser: CFNetServiceBrowserRef,
        runLoop: CFRunLoopRef,
        runLoopMode: CFStringRef,
    );
    pub fn CFNetServiceRegister(theService: CFNetServiceRef, error: *mut CFStreamError) -> Boolean;
    pub fn CFNetServiceResolve(theService: CFNetServiceRef, error: *mut CFStreamError) -> Boolean;
    pub static kCFStreamPropertySSLContext: CFStringRef;
    pub static kCFStreamPropertySSLPeerTrust: CFStringRef;
    pub static kCFStreamSSLValidatesCertificateChain: CFStringRef;
    pub static kCFStreamPropertySSLSettings: CFStringRef;
    pub static kCFStreamSSLLevel: CFStringRef;
    pub static kCFStreamSSLPeerName: CFStringRef;
    pub static kCFStreamSSLCertificates: CFStringRef;
    pub static kCFStreamSSLIsServer: CFStringRef;
    pub static kCFStreamNetworkServiceType: CFStringRef;
    pub static kCFStreamNetworkServiceTypeVideo: CFStringRef;
    pub static kCFStreamNetworkServiceTypeVoice: CFStringRef;
    pub static kCFStreamNetworkServiceTypeBackground: CFStringRef;
    pub static kCFStreamNetworkServiceTypeResponsiveData: CFStringRef;
    pub static kCFStreamNetworkServiceTypeCallSignaling: CFStringRef;
    pub static kCFStreamNetworkServiceTypeAVStreaming: CFStringRef;
    pub static kCFStreamNetworkServiceTypeResponsiveAV: CFStringRef;
    pub static kCFStreamNetworkServiceTypeVoIP: CFStringRef;
    pub static kCFStreamPropertyNoCellular: CFStringRef;
    pub static kCFStreamPropertyConnectionIsCellular: CFStringRef;
    pub static kCFStreamPropertyAllowExpensiveNetworkAccess: CFStringRef;
    pub static kCFStreamPropertyConnectionIsExpensive: CFStringRef;
    pub static kCFStreamPropertyAllowConstrainedNetworkAccess: CFStringRef;
    pub static kCFStreamErrorDomainWinSock: CFIndex;
    pub static kCFStreamPropertyProxyLocalBypass: CFStringRef;
    pub static kCFStreamPropertySocketRemoteHost: CFStringRef;
    pub static kCFStreamPropertySocketRemoteNetService: CFStringRef;
    pub static kCFStreamPropertySocketExtendedBackgroundIdleMode: CFStringRef;
    pub fn CFStreamCreatePairWithSocketToCFHost(
        alloc: CFAllocatorRef,
        host: CFHostRef,
        port: SInt32,
        readStream: *mut CFReadStreamRef,
        writeStream: *mut CFWriteStreamRef,
    );
    pub fn CFStreamCreatePairWithSocketToNetService(
        alloc: CFAllocatorRef,
        service: CFNetServiceRef,
        readStream: *mut CFReadStreamRef,
        writeStream: *mut CFWriteStreamRef,
    );
    pub static kCFStreamPropertySSLPeerCertificates: CFStringRef;
    pub static kCFStreamSSLAllowsExpiredCertificates: CFStringRef;
    pub static kCFStreamSSLAllowsExpiredRoots: CFStringRef;
    pub static kCFStreamSSLAllowsAnyRoot: CFStringRef;
    pub static kCFStreamErrorDomainFTP: SInt32;
    pub static kCFStreamPropertyFTPUserName: CFStringRef;
    pub static kCFStreamPropertyFTPPassword: CFStringRef;
    pub static kCFStreamPropertyFTPUsePassiveMode: CFStringRef;
    pub static kCFStreamPropertyFTPResourceSize: CFStringRef;
    pub static kCFStreamPropertyFTPFetchResourceInfo: CFStringRef;
    pub static kCFStreamPropertyFTPFileTransferOffset: CFStringRef;
    pub static kCFStreamPropertyFTPAttemptPersistentConnection: CFStringRef;
    pub static kCFStreamPropertyFTPProxy: CFStringRef;
    pub static kCFStreamPropertyFTPProxyHost: CFStringRef;
    pub static kCFStreamPropertyFTPProxyPort: CFStringRef;
    pub static kCFStreamPropertyFTPProxyUser: CFStringRef;
    pub static kCFStreamPropertyFTPProxyPassword: CFStringRef;
    pub static kCFFTPResourceMode: CFStringRef;
    pub static kCFFTPResourceName: CFStringRef;
    pub static kCFFTPResourceOwner: CFStringRef;
    pub static kCFFTPResourceGroup: CFStringRef;
    pub static kCFFTPResourceLink: CFStringRef;
    pub static kCFFTPResourceSize: CFStringRef;
    pub static kCFFTPResourceType: CFStringRef;
    pub static kCFFTPResourceModDate: CFStringRef;
    pub fn CFReadStreamCreateWithFTPURL(alloc: CFAllocatorRef, ftpURL: CFURLRef)
        -> CFReadStreamRef;
    pub fn CFFTPCreateParsedResourceListing(
        alloc: CFAllocatorRef,
        buffer: *const UInt8,
        bufferLength: CFIndex,
        parsed: *mut CFDictionaryRef,
    ) -> CFIndex;
    pub fn CFWriteStreamCreateWithFTPURL(
        alloc: CFAllocatorRef,
        ftpURL: CFURLRef,
    ) -> CFWriteStreamRef;
    pub static kCFHTTPVersion1_0: CFStringRef;
    pub static kCFHTTPVersion1_1: CFStringRef;
    pub static kCFHTTPVersion2_0: CFStringRef;
    pub static kCFHTTPVersion3_0: CFStringRef;
    pub static kCFHTTPAuthenticationSchemeBasic: CFStringRef;
    pub static kCFHTTPAuthenticationSchemeDigest: CFStringRef;
    pub static kCFHTTPAuthenticationSchemeNTLM: CFStringRef;
    pub static kCFHTTPAuthenticationSchemeKerberos: CFStringRef;
    pub static kCFHTTPAuthenticationSchemeNegotiate: CFStringRef;
    pub static kCFHTTPAuthenticationSchemeNegotiate2: CFStringRef;
    pub static kCFHTTPAuthenticationSchemeXMobileMeAuthToken: CFStringRef;
    pub fn CFHTTPMessageGetTypeID() -> CFTypeID;
    pub fn CFHTTPMessageCreateRequest(
        alloc: CFAllocatorRef,
        requestMethod: CFStringRef,
        url: CFURLRef,
        httpVersion: CFStringRef,
    ) -> CFHTTPMessageRef;
    pub fn CFHTTPMessageCreateResponse(
        alloc: CFAllocatorRef,
        statusCode: CFIndex,
        statusDescription: CFStringRef,
        httpVersion: CFStringRef,
    ) -> CFHTTPMessageRef;
    pub fn CFHTTPMessageCreateEmpty(alloc: CFAllocatorRef, isRequest: Boolean) -> CFHTTPMessageRef;
    pub fn CFHTTPMessageCreateCopy(
        alloc: CFAllocatorRef,
        message: CFHTTPMessageRef,
    ) -> CFHTTPMessageRef;
    pub fn CFHTTPMessageIsRequest(message: CFHTTPMessageRef) -> Boolean;
    pub fn CFHTTPMessageCopyVersion(message: CFHTTPMessageRef) -> CFStringRef;
    pub fn CFHTTPMessageCopyBody(message: CFHTTPMessageRef) -> CFDataRef;
    pub fn CFHTTPMessageSetBody(message: CFHTTPMessageRef, bodyData: CFDataRef);
    pub fn CFHTTPMessageCopyHeaderFieldValue(
        message: CFHTTPMessageRef,
        headerField: CFStringRef,
    ) -> CFStringRef;
    pub fn CFHTTPMessageCopyAllHeaderFields(message: CFHTTPMessageRef) -> CFDictionaryRef;
    pub fn CFHTTPMessageSetHeaderFieldValue(
        message: CFHTTPMessageRef,
        headerField: CFStringRef,
        value: CFStringRef,
    );
    pub fn CFHTTPMessageAppendBytes(
        message: CFHTTPMessageRef,
        newBytes: *const UInt8,
        numBytes: CFIndex,
    ) -> Boolean;
    pub fn CFHTTPMessageIsHeaderComplete(message: CFHTTPMessageRef) -> Boolean;
    pub fn CFHTTPMessageCopySerializedMessage(message: CFHTTPMessageRef) -> CFDataRef;
    pub fn CFHTTPMessageCopyRequestURL(request: CFHTTPMessageRef) -> CFURLRef;
    pub fn CFHTTPMessageCopyRequestMethod(request: CFHTTPMessageRef) -> CFStringRef;
    pub fn CFHTTPMessageAddAuthentication(
        request: CFHTTPMessageRef,
        authenticationFailureResponse: CFHTTPMessageRef,
        username: CFStringRef,
        password: CFStringRef,
        authenticationScheme: CFStringRef,
        forProxy: Boolean,
    ) -> Boolean;
    pub fn CFHTTPMessageGetResponseStatusCode(response: CFHTTPMessageRef) -> CFIndex;
    pub fn CFHTTPMessageCopyResponseStatusLine(response: CFHTTPMessageRef) -> CFStringRef;
    pub static kCFStreamErrorDomainHTTP: SInt32;
    pub static kCFStreamPropertyHTTPResponseHeader: CFStringRef;
    pub static kCFStreamPropertyHTTPFinalURL: CFStringRef;
    pub static kCFStreamPropertyHTTPFinalRequest: CFStringRef;
    pub static kCFStreamPropertyHTTPProxy: CFStringRef;
    pub static kCFStreamPropertyHTTPProxyHost: CFStringRef;
    pub static kCFStreamPropertyHTTPProxyPort: CFStringRef;
    pub static kCFStreamPropertyHTTPSProxyHost: CFStringRef;
    pub static kCFStreamPropertyHTTPSProxyPort: CFStringRef;
    pub static kCFStreamPropertyHTTPShouldAutoredirect: CFStringRef;
    pub static kCFStreamPropertyHTTPAttemptPersistentConnection: CFStringRef;
    pub static kCFStreamPropertyHTTPRequestBytesWrittenCount: CFStringRef;
    pub fn CFReadStreamCreateForHTTPRequest(
        alloc: CFAllocatorRef,
        request: CFHTTPMessageRef,
    ) -> CFReadStreamRef;
    pub fn CFReadStreamCreateForStreamedHTTPRequest(
        alloc: CFAllocatorRef,
        requestHeaders: CFHTTPMessageRef,
        requestBody: CFReadStreamRef,
    ) -> CFReadStreamRef;
    pub static kCFHTTPAuthenticationUsername: CFStringRef;
    pub static kCFHTTPAuthenticationPassword: CFStringRef;
    pub static kCFHTTPAuthenticationAccountDomain: CFStringRef;
    pub fn CFHTTPAuthenticationGetTypeID() -> CFTypeID;
    pub fn CFHTTPAuthenticationCreateFromResponse(
        alloc: CFAllocatorRef,
        response: CFHTTPMessageRef,
    ) -> CFHTTPAuthenticationRef;
    pub fn CFHTTPAuthenticationIsValid(
        auth: CFHTTPAuthenticationRef,
        error: *mut CFStreamError,
    ) -> Boolean;
    pub fn CFHTTPAuthenticationAppliesToRequest(
        auth: CFHTTPAuthenticationRef,
        request: CFHTTPMessageRef,
    ) -> Boolean;
    pub fn CFHTTPAuthenticationRequiresOrderedRequests(auth: CFHTTPAuthenticationRef) -> Boolean;
    pub fn CFHTTPMessageApplyCredentials(
        request: CFHTTPMessageRef,
        auth: CFHTTPAuthenticationRef,
        username: CFStringRef,
        password: CFStringRef,
        error: *mut CFStreamError,
    ) -> Boolean;
    pub fn CFHTTPMessageApplyCredentialDictionary(
        request: CFHTTPMessageRef,
        auth: CFHTTPAuthenticationRef,
        dict: CFDictionaryRef,
        error: *mut CFStreamError,
    ) -> Boolean;
    pub fn CFHTTPAuthenticationCopyRealm(auth: CFHTTPAuthenticationRef) -> CFStringRef;
    pub fn CFHTTPAuthenticationCopyDomains(auth: CFHTTPAuthenticationRef) -> CFArrayRef;
    pub fn CFHTTPAuthenticationCopyMethod(auth: CFHTTPAuthenticationRef) -> CFStringRef;
    pub fn CFHTTPAuthenticationRequiresUserNameAndPassword(
        auth: CFHTTPAuthenticationRef,
    ) -> Boolean;
    pub fn CFHTTPAuthenticationRequiresAccountDomain(auth: CFHTTPAuthenticationRef) -> Boolean;
    pub fn CFNetDiagnosticCreateWithStreams(
        alloc: CFAllocatorRef,
        readStream: CFReadStreamRef,
        writeStream: CFWriteStreamRef,
    ) -> CFNetDiagnosticRef;
    pub fn CFNetDiagnosticCreateWithURL(alloc: CFAllocatorRef, url: CFURLRef)
        -> CFNetDiagnosticRef;
    pub fn CFNetDiagnosticSetName(details: CFNetDiagnosticRef, name: CFStringRef);
    pub fn CFNetDiagnosticDiagnoseProblemInteractively(
        details: CFNetDiagnosticRef,
    ) -> CFNetDiagnosticStatus;
    pub fn CFNetDiagnosticCopyNetworkStatusPassively(
        details: CFNetDiagnosticRef,
        description: *mut CFStringRef,
    ) -> CFNetDiagnosticStatus;
    pub fn CFNetworkCopySystemProxySettings() -> CFDictionaryRef;
    pub fn CFNetworkCopyProxiesForURL(url: CFURLRef, proxySettings: CFDictionaryRef) -> CFArrayRef;
    pub fn CFNetworkCopyProxiesForAutoConfigurationScript(
        proxyAutoConfigurationScript: CFStringRef,
        targetURL: CFURLRef,
        error: *mut CFErrorRef,
    ) -> CFArrayRef;
    pub fn CFNetworkExecuteProxyAutoConfigurationScript(
        proxyAutoConfigurationScript: CFStringRef,
        targetURL: CFURLRef,
        cb: CFProxyAutoConfigurationResultCallback,
        clientContext: *mut CFStreamClientContext,
    ) -> CFRunLoopSourceRef;
    pub fn CFNetworkExecuteProxyAutoConfigurationURL(
        proxyAutoConfigURL: CFURLRef,
        targetURL: CFURLRef,
        cb: CFProxyAutoConfigurationResultCallback,
        clientContext: *mut CFStreamClientContext,
    ) -> CFRunLoopSourceRef;
    pub static kCFProxyTypeKey: CFStringRef;
    pub static kCFProxyHostNameKey: CFStringRef;
    pub static kCFProxyPortNumberKey: CFStringRef;
    pub static kCFProxyAutoConfigurationURLKey: CFStringRef;
    pub static kCFProxyAutoConfigurationJavaScriptKey: CFStringRef;
    pub static kCFProxyUsernameKey: CFStringRef;
    pub static kCFProxyPasswordKey: CFStringRef;
    pub static kCFProxyTypeNone: CFStringRef;
    pub static kCFProxyTypeHTTP: CFStringRef;
    pub static kCFProxyTypeHTTPS: CFStringRef;
    pub static kCFProxyTypeSOCKS: CFStringRef;
    pub static kCFProxyTypeFTP: CFStringRef;
    pub static kCFProxyTypeAutoConfigurationURL: CFStringRef;
    pub static kCFProxyTypeAutoConfigurationJavaScript: CFStringRef;
    pub static kCFProxyAutoConfigurationHTTPResponseKey: CFStringRef;
    pub static kCFNetworkProxiesExceptionsList: CFStringRef;
    pub static kCFNetworkProxiesExcludeSimpleHostnames: CFStringRef;
    pub static kCFNetworkProxiesFTPEnable: CFStringRef;
    pub static kCFNetworkProxiesFTPPassive: CFStringRef;
    pub static kCFNetworkProxiesFTPPort: CFStringRef;
    pub static kCFNetworkProxiesFTPProxy: CFStringRef;
    pub static kCFNetworkProxiesGopherEnable: CFStringRef;
    pub static kCFNetworkProxiesGopherPort: CFStringRef;
    pub static kCFNetworkProxiesGopherProxy: CFStringRef;
    pub static kCFNetworkProxiesHTTPEnable: CFStringRef;
    pub static kCFNetworkProxiesHTTPPort: CFStringRef;
    pub static kCFNetworkProxiesHTTPProxy: CFStringRef;
    pub static kCFNetworkProxiesHTTPSEnable: CFStringRef;
    pub static kCFNetworkProxiesHTTPSPort: CFStringRef;
    pub static kCFNetworkProxiesHTTPSProxy: CFStringRef;
    pub static kCFNetworkProxiesRTSPEnable: CFStringRef;
    pub static kCFNetworkProxiesRTSPPort: CFStringRef;
    pub static kCFNetworkProxiesRTSPProxy: CFStringRef;
    pub static kCFNetworkProxiesSOCKSEnable: CFStringRef;
    pub static kCFNetworkProxiesSOCKSPort: CFStringRef;
    pub static kCFNetworkProxiesSOCKSProxy: CFStringRef;
    pub static kCFNetworkProxiesProxyAutoConfigEnable: CFStringRef;
    pub static kCFNetworkProxiesProxyAutoConfigURLString: CFStringRef;
    pub static kCFNetworkProxiesProxyAutoConfigJavaScript: CFStringRef;
    pub static kCFNetworkProxiesProxyAutoDiscoveryEnable: CFStringRef;
}