objc2_cf_network/generated/
CFHTTPMessage.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::cell::UnsafeCell;
4use core::ffi::*;
5use core::marker::{PhantomData, PhantomPinned};
6use core::ptr::NonNull;
7#[cfg(feature = "objc2")]
8use objc2::__framework_prelude::*;
9use objc2_core_foundation::*;
10
11use crate::*;
12
13extern "C" {
14    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfhttpversion1_0?language=objc)
15    pub static kCFHTTPVersion1_0: &'static CFString;
16}
17
18extern "C" {
19    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfhttpversion1_1?language=objc)
20    pub static kCFHTTPVersion1_1: &'static CFString;
21}
22
23extern "C" {
24    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfhttpversion2_0?language=objc)
25    pub static kCFHTTPVersion2_0: &'static CFString;
26}
27
28extern "C" {
29    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfhttpversion3_0?language=objc)
30    pub static kCFHTTPVersion3_0: &'static CFString;
31}
32
33extern "C" {
34    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfhttpauthenticationschemebasic?language=objc)
35    pub static kCFHTTPAuthenticationSchemeBasic: &'static CFString;
36}
37
38extern "C" {
39    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfhttpauthenticationschemedigest?language=objc)
40    pub static kCFHTTPAuthenticationSchemeDigest: &'static CFString;
41}
42
43extern "C" {
44    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfhttpauthenticationschementlm?language=objc)
45    pub static kCFHTTPAuthenticationSchemeNTLM: &'static CFString;
46}
47
48extern "C" {
49    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfhttpauthenticationschemekerberos?language=objc)
50    pub static kCFHTTPAuthenticationSchemeKerberos: &'static CFString;
51}
52
53extern "C" {
54    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfhttpauthenticationschemenegotiate?language=objc)
55    pub static kCFHTTPAuthenticationSchemeNegotiate: &'static CFString;
56}
57
58extern "C" {
59    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfhttpauthenticationschemenegotiate2?language=objc)
60    pub static kCFHTTPAuthenticationSchemeNegotiate2: &'static CFString;
61}
62
63extern "C" {
64    /// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/kcfhttpauthenticationschemexmobilemeauthtoken?language=objc)
65    pub static kCFHTTPAuthenticationSchemeXMobileMeAuthToken: &'static CFString;
66}
67
68/// [Apple's documentation](https://developer.apple.com/documentation/cfnetwork/cfhttpmessage?language=objc)
69#[doc(alias = "CFHTTPMessageRef")]
70#[repr(C)]
71pub struct CFHTTPMessage {
72    inner: [u8; 0],
73    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
74}
75
76cf_type!(
77    unsafe impl CFHTTPMessage {}
78);
79#[cfg(feature = "objc2")]
80cf_objc2_type!(
81    unsafe impl RefEncode<"__CFHTTPMessage"> for CFHTTPMessage {}
82);
83
84unsafe impl ConcreteType for CFHTTPMessage {
85    #[doc(alias = "CFHTTPMessageGetTypeID")]
86    #[inline]
87    fn type_id() -> CFTypeID {
88        extern "C-unwind" {
89            fn CFHTTPMessageGetTypeID() -> CFTypeID;
90        }
91        unsafe { CFHTTPMessageGetTypeID() }
92    }
93}
94
95impl CFHTTPMessage {
96    #[doc(alias = "CFHTTPMessageCreateRequest")]
97    #[inline]
98    pub unsafe fn new_request(
99        alloc: Option<&CFAllocator>,
100        request_method: &CFString,
101        url: &CFURL,
102        http_version: &CFString,
103    ) -> CFRetained<CFHTTPMessage> {
104        extern "C-unwind" {
105            fn CFHTTPMessageCreateRequest(
106                alloc: Option<&CFAllocator>,
107                request_method: &CFString,
108                url: &CFURL,
109                http_version: &CFString,
110            ) -> Option<NonNull<CFHTTPMessage>>;
111        }
112        let ret = unsafe { CFHTTPMessageCreateRequest(alloc, request_method, url, http_version) };
113        let ret =
114            ret.expect("function was marked as returning non-null, but actually returned NULL");
115        unsafe { CFRetained::from_raw(ret) }
116    }
117
118    #[doc(alias = "CFHTTPMessageCreateResponse")]
119    #[inline]
120    pub unsafe fn new_response(
121        alloc: Option<&CFAllocator>,
122        status_code: CFIndex,
123        status_description: Option<&CFString>,
124        http_version: &CFString,
125    ) -> CFRetained<CFHTTPMessage> {
126        extern "C-unwind" {
127            fn CFHTTPMessageCreateResponse(
128                alloc: Option<&CFAllocator>,
129                status_code: CFIndex,
130                status_description: Option<&CFString>,
131                http_version: &CFString,
132            ) -> Option<NonNull<CFHTTPMessage>>;
133        }
134        let ret = unsafe {
135            CFHTTPMessageCreateResponse(alloc, status_code, status_description, http_version)
136        };
137        let ret =
138            ret.expect("function was marked as returning non-null, but actually returned NULL");
139        unsafe { CFRetained::from_raw(ret) }
140    }
141
142    #[doc(alias = "CFHTTPMessageCreateEmpty")]
143    #[inline]
144    pub unsafe fn new_empty(
145        alloc: Option<&CFAllocator>,
146        is_request: bool,
147    ) -> CFRetained<CFHTTPMessage> {
148        extern "C-unwind" {
149            fn CFHTTPMessageCreateEmpty(
150                alloc: Option<&CFAllocator>,
151                is_request: Boolean,
152            ) -> Option<NonNull<CFHTTPMessage>>;
153        }
154        let ret = unsafe { CFHTTPMessageCreateEmpty(alloc, is_request as _) };
155        let ret =
156            ret.expect("function was marked as returning non-null, but actually returned NULL");
157        unsafe { CFRetained::from_raw(ret) }
158    }
159
160    #[doc(alias = "CFHTTPMessageCreateCopy")]
161    #[inline]
162    pub unsafe fn new_copy(
163        alloc: Option<&CFAllocator>,
164        message: &CFHTTPMessage,
165    ) -> CFRetained<CFHTTPMessage> {
166        extern "C-unwind" {
167            fn CFHTTPMessageCreateCopy(
168                alloc: Option<&CFAllocator>,
169                message: &CFHTTPMessage,
170            ) -> Option<NonNull<CFHTTPMessage>>;
171        }
172        let ret = unsafe { CFHTTPMessageCreateCopy(alloc, message) };
173        let ret =
174            ret.expect("function was marked as returning non-null, but actually returned NULL");
175        unsafe { CFRetained::from_raw(ret) }
176    }
177
178    #[doc(alias = "CFHTTPMessageIsRequest")]
179    #[inline]
180    pub unsafe fn is_request(&self) -> bool {
181        extern "C-unwind" {
182            fn CFHTTPMessageIsRequest(message: &CFHTTPMessage) -> Boolean;
183        }
184        let ret = unsafe { CFHTTPMessageIsRequest(self) };
185        ret != 0
186    }
187
188    #[doc(alias = "CFHTTPMessageCopyVersion")]
189    #[inline]
190    pub unsafe fn version(&self) -> CFRetained<CFString> {
191        extern "C-unwind" {
192            fn CFHTTPMessageCopyVersion(message: &CFHTTPMessage) -> Option<NonNull<CFString>>;
193        }
194        let ret = unsafe { CFHTTPMessageCopyVersion(self) };
195        let ret =
196            ret.expect("function was marked as returning non-null, but actually returned NULL");
197        unsafe { CFRetained::from_raw(ret) }
198    }
199
200    #[doc(alias = "CFHTTPMessageCopyBody")]
201    #[inline]
202    pub unsafe fn body(&self) -> Option<CFRetained<CFData>> {
203        extern "C-unwind" {
204            fn CFHTTPMessageCopyBody(message: &CFHTTPMessage) -> Option<NonNull<CFData>>;
205        }
206        let ret = unsafe { CFHTTPMessageCopyBody(self) };
207        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
208    }
209
210    #[doc(alias = "CFHTTPMessageSetBody")]
211    #[inline]
212    pub unsafe fn set_body(&self, body_data: &CFData) {
213        extern "C-unwind" {
214            fn CFHTTPMessageSetBody(message: &CFHTTPMessage, body_data: &CFData);
215        }
216        unsafe { CFHTTPMessageSetBody(self, body_data) }
217    }
218
219    #[doc(alias = "CFHTTPMessageCopyHeaderFieldValue")]
220    #[inline]
221    pub unsafe fn header_field_value(
222        &self,
223        header_field: &CFString,
224    ) -> Option<CFRetained<CFString>> {
225        extern "C-unwind" {
226            fn CFHTTPMessageCopyHeaderFieldValue(
227                message: &CFHTTPMessage,
228                header_field: &CFString,
229            ) -> Option<NonNull<CFString>>;
230        }
231        let ret = unsafe { CFHTTPMessageCopyHeaderFieldValue(self, header_field) };
232        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
233    }
234
235    #[doc(alias = "CFHTTPMessageCopyAllHeaderFields")]
236    #[inline]
237    pub unsafe fn all_header_fields(&self) -> Option<CFRetained<CFDictionary>> {
238        extern "C-unwind" {
239            fn CFHTTPMessageCopyAllHeaderFields(
240                message: &CFHTTPMessage,
241            ) -> Option<NonNull<CFDictionary>>;
242        }
243        let ret = unsafe { CFHTTPMessageCopyAllHeaderFields(self) };
244        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
245    }
246
247    #[doc(alias = "CFHTTPMessageSetHeaderFieldValue")]
248    #[inline]
249    pub unsafe fn set_header_field_value(&self, header_field: &CFString, value: Option<&CFString>) {
250        extern "C-unwind" {
251            fn CFHTTPMessageSetHeaderFieldValue(
252                message: &CFHTTPMessage,
253                header_field: &CFString,
254                value: Option<&CFString>,
255            );
256        }
257        unsafe { CFHTTPMessageSetHeaderFieldValue(self, header_field, value) }
258    }
259
260    /// # Safety
261    ///
262    /// `new_bytes` must be a valid pointer.
263    #[doc(alias = "CFHTTPMessageAppendBytes")]
264    #[inline]
265    pub unsafe fn append_bytes(&self, new_bytes: NonNull<u8>, num_bytes: CFIndex) -> bool {
266        extern "C-unwind" {
267            fn CFHTTPMessageAppendBytes(
268                message: &CFHTTPMessage,
269                new_bytes: NonNull<u8>,
270                num_bytes: CFIndex,
271            ) -> Boolean;
272        }
273        let ret = unsafe { CFHTTPMessageAppendBytes(self, new_bytes, num_bytes) };
274        ret != 0
275    }
276
277    #[doc(alias = "CFHTTPMessageIsHeaderComplete")]
278    #[inline]
279    pub unsafe fn is_header_complete(&self) -> bool {
280        extern "C-unwind" {
281            fn CFHTTPMessageIsHeaderComplete(message: &CFHTTPMessage) -> Boolean;
282        }
283        let ret = unsafe { CFHTTPMessageIsHeaderComplete(self) };
284        ret != 0
285    }
286
287    #[doc(alias = "CFHTTPMessageCopySerializedMessage")]
288    #[inline]
289    pub unsafe fn serialized_message(&self) -> Option<CFRetained<CFData>> {
290        extern "C-unwind" {
291            fn CFHTTPMessageCopySerializedMessage(
292                message: &CFHTTPMessage,
293            ) -> Option<NonNull<CFData>>;
294        }
295        let ret = unsafe { CFHTTPMessageCopySerializedMessage(self) };
296        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
297    }
298
299    /// ******************
300    #[doc(alias = "CFHTTPMessageCopyRequestURL")]
301    #[inline]
302    pub unsafe fn request_url(&self) -> Option<CFRetained<CFURL>> {
303        extern "C-unwind" {
304            fn CFHTTPMessageCopyRequestURL(request: &CFHTTPMessage) -> Option<NonNull<CFURL>>;
305        }
306        let ret = unsafe { CFHTTPMessageCopyRequestURL(self) };
307        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
308    }
309
310    #[doc(alias = "CFHTTPMessageCopyRequestMethod")]
311    #[inline]
312    pub unsafe fn request_method(&self) -> Option<CFRetained<CFString>> {
313        extern "C-unwind" {
314            fn CFHTTPMessageCopyRequestMethod(request: &CFHTTPMessage)
315                -> Option<NonNull<CFString>>;
316        }
317        let ret = unsafe { CFHTTPMessageCopyRequestMethod(self) };
318        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
319    }
320
321    #[doc(alias = "CFHTTPMessageAddAuthentication")]
322    #[inline]
323    pub unsafe fn add_authentication(
324        &self,
325        authentication_failure_response: Option<&CFHTTPMessage>,
326        username: &CFString,
327        password: &CFString,
328        authentication_scheme: Option<&CFString>,
329        for_proxy: bool,
330    ) -> bool {
331        extern "C-unwind" {
332            fn CFHTTPMessageAddAuthentication(
333                request: &CFHTTPMessage,
334                authentication_failure_response: Option<&CFHTTPMessage>,
335                username: &CFString,
336                password: &CFString,
337                authentication_scheme: Option<&CFString>,
338                for_proxy: Boolean,
339            ) -> Boolean;
340        }
341        let ret = unsafe {
342            CFHTTPMessageAddAuthentication(
343                self,
344                authentication_failure_response,
345                username,
346                password,
347                authentication_scheme,
348                for_proxy as _,
349            )
350        };
351        ret != 0
352    }
353
354    /// *******************
355    #[doc(alias = "CFHTTPMessageGetResponseStatusCode")]
356    #[inline]
357    pub unsafe fn response_status_code(&self) -> CFIndex {
358        extern "C-unwind" {
359            fn CFHTTPMessageGetResponseStatusCode(response: &CFHTTPMessage) -> CFIndex;
360        }
361        unsafe { CFHTTPMessageGetResponseStatusCode(self) }
362    }
363
364    #[doc(alias = "CFHTTPMessageCopyResponseStatusLine")]
365    #[inline]
366    pub unsafe fn response_status_line(&self) -> Option<CFRetained<CFString>> {
367        extern "C-unwind" {
368            fn CFHTTPMessageCopyResponseStatusLine(
369                response: &CFHTTPMessage,
370            ) -> Option<NonNull<CFString>>;
371        }
372        let ret = unsafe { CFHTTPMessageCopyResponseStatusLine(self) };
373        ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
374    }
375}
376
377#[deprecated = "renamed to `CFHTTPMessage::new_request`"]
378#[inline]
379pub unsafe extern "C-unwind" fn CFHTTPMessageCreateRequest(
380    alloc: Option<&CFAllocator>,
381    request_method: &CFString,
382    url: &CFURL,
383    http_version: &CFString,
384) -> CFRetained<CFHTTPMessage> {
385    extern "C-unwind" {
386        fn CFHTTPMessageCreateRequest(
387            alloc: Option<&CFAllocator>,
388            request_method: &CFString,
389            url: &CFURL,
390            http_version: &CFString,
391        ) -> Option<NonNull<CFHTTPMessage>>;
392    }
393    let ret = unsafe { CFHTTPMessageCreateRequest(alloc, request_method, url, http_version) };
394    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
395    unsafe { CFRetained::from_raw(ret) }
396}
397
398#[deprecated = "renamed to `CFHTTPMessage::new_response`"]
399#[inline]
400pub unsafe extern "C-unwind" fn CFHTTPMessageCreateResponse(
401    alloc: Option<&CFAllocator>,
402    status_code: CFIndex,
403    status_description: Option<&CFString>,
404    http_version: &CFString,
405) -> CFRetained<CFHTTPMessage> {
406    extern "C-unwind" {
407        fn CFHTTPMessageCreateResponse(
408            alloc: Option<&CFAllocator>,
409            status_code: CFIndex,
410            status_description: Option<&CFString>,
411            http_version: &CFString,
412        ) -> Option<NonNull<CFHTTPMessage>>;
413    }
414    let ret = unsafe {
415        CFHTTPMessageCreateResponse(alloc, status_code, status_description, http_version)
416    };
417    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
418    unsafe { CFRetained::from_raw(ret) }
419}
420
421#[deprecated = "renamed to `CFHTTPMessage::new_empty`"]
422#[inline]
423pub unsafe extern "C-unwind" fn CFHTTPMessageCreateEmpty(
424    alloc: Option<&CFAllocator>,
425    is_request: bool,
426) -> CFRetained<CFHTTPMessage> {
427    extern "C-unwind" {
428        fn CFHTTPMessageCreateEmpty(
429            alloc: Option<&CFAllocator>,
430            is_request: Boolean,
431        ) -> Option<NonNull<CFHTTPMessage>>;
432    }
433    let ret = unsafe { CFHTTPMessageCreateEmpty(alloc, is_request as _) };
434    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
435    unsafe { CFRetained::from_raw(ret) }
436}
437
438#[deprecated = "renamed to `CFHTTPMessage::new_copy`"]
439#[inline]
440pub unsafe extern "C-unwind" fn CFHTTPMessageCreateCopy(
441    alloc: Option<&CFAllocator>,
442    message: &CFHTTPMessage,
443) -> CFRetained<CFHTTPMessage> {
444    extern "C-unwind" {
445        fn CFHTTPMessageCreateCopy(
446            alloc: Option<&CFAllocator>,
447            message: &CFHTTPMessage,
448        ) -> Option<NonNull<CFHTTPMessage>>;
449    }
450    let ret = unsafe { CFHTTPMessageCreateCopy(alloc, message) };
451    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
452    unsafe { CFRetained::from_raw(ret) }
453}
454
455#[deprecated = "renamed to `CFHTTPMessage::is_request`"]
456#[inline]
457pub unsafe extern "C-unwind" fn CFHTTPMessageIsRequest(message: &CFHTTPMessage) -> bool {
458    extern "C-unwind" {
459        fn CFHTTPMessageIsRequest(message: &CFHTTPMessage) -> Boolean;
460    }
461    let ret = unsafe { CFHTTPMessageIsRequest(message) };
462    ret != 0
463}
464
465#[deprecated = "renamed to `CFHTTPMessage::version`"]
466#[inline]
467pub unsafe extern "C-unwind" fn CFHTTPMessageCopyVersion(
468    message: &CFHTTPMessage,
469) -> CFRetained<CFString> {
470    extern "C-unwind" {
471        fn CFHTTPMessageCopyVersion(message: &CFHTTPMessage) -> Option<NonNull<CFString>>;
472    }
473    let ret = unsafe { CFHTTPMessageCopyVersion(message) };
474    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
475    unsafe { CFRetained::from_raw(ret) }
476}
477
478#[deprecated = "renamed to `CFHTTPMessage::body`"]
479#[inline]
480pub unsafe extern "C-unwind" fn CFHTTPMessageCopyBody(
481    message: &CFHTTPMessage,
482) -> Option<CFRetained<CFData>> {
483    extern "C-unwind" {
484        fn CFHTTPMessageCopyBody(message: &CFHTTPMessage) -> Option<NonNull<CFData>>;
485    }
486    let ret = unsafe { CFHTTPMessageCopyBody(message) };
487    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
488}
489
490extern "C-unwind" {
491    #[deprecated = "renamed to `CFHTTPMessage::set_body`"]
492    pub fn CFHTTPMessageSetBody(message: &CFHTTPMessage, body_data: &CFData);
493}
494
495#[deprecated = "renamed to `CFHTTPMessage::header_field_value`"]
496#[inline]
497pub unsafe extern "C-unwind" fn CFHTTPMessageCopyHeaderFieldValue(
498    message: &CFHTTPMessage,
499    header_field: &CFString,
500) -> Option<CFRetained<CFString>> {
501    extern "C-unwind" {
502        fn CFHTTPMessageCopyHeaderFieldValue(
503            message: &CFHTTPMessage,
504            header_field: &CFString,
505        ) -> Option<NonNull<CFString>>;
506    }
507    let ret = unsafe { CFHTTPMessageCopyHeaderFieldValue(message, header_field) };
508    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
509}
510
511#[deprecated = "renamed to `CFHTTPMessage::all_header_fields`"]
512#[inline]
513pub unsafe extern "C-unwind" fn CFHTTPMessageCopyAllHeaderFields(
514    message: &CFHTTPMessage,
515) -> Option<CFRetained<CFDictionary>> {
516    extern "C-unwind" {
517        fn CFHTTPMessageCopyAllHeaderFields(
518            message: &CFHTTPMessage,
519        ) -> Option<NonNull<CFDictionary>>;
520    }
521    let ret = unsafe { CFHTTPMessageCopyAllHeaderFields(message) };
522    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
523}
524
525extern "C-unwind" {
526    #[deprecated = "renamed to `CFHTTPMessage::set_header_field_value`"]
527    pub fn CFHTTPMessageSetHeaderFieldValue(
528        message: &CFHTTPMessage,
529        header_field: &CFString,
530        value: Option<&CFString>,
531    );
532}
533
534#[deprecated = "renamed to `CFHTTPMessage::append_bytes`"]
535#[inline]
536pub unsafe extern "C-unwind" fn CFHTTPMessageAppendBytes(
537    message: &CFHTTPMessage,
538    new_bytes: NonNull<u8>,
539    num_bytes: CFIndex,
540) -> bool {
541    extern "C-unwind" {
542        fn CFHTTPMessageAppendBytes(
543            message: &CFHTTPMessage,
544            new_bytes: NonNull<u8>,
545            num_bytes: CFIndex,
546        ) -> Boolean;
547    }
548    let ret = unsafe { CFHTTPMessageAppendBytes(message, new_bytes, num_bytes) };
549    ret != 0
550}
551
552#[deprecated = "renamed to `CFHTTPMessage::is_header_complete`"]
553#[inline]
554pub unsafe extern "C-unwind" fn CFHTTPMessageIsHeaderComplete(message: &CFHTTPMessage) -> bool {
555    extern "C-unwind" {
556        fn CFHTTPMessageIsHeaderComplete(message: &CFHTTPMessage) -> Boolean;
557    }
558    let ret = unsafe { CFHTTPMessageIsHeaderComplete(message) };
559    ret != 0
560}
561
562#[deprecated = "renamed to `CFHTTPMessage::serialized_message`"]
563#[inline]
564pub unsafe extern "C-unwind" fn CFHTTPMessageCopySerializedMessage(
565    message: &CFHTTPMessage,
566) -> Option<CFRetained<CFData>> {
567    extern "C-unwind" {
568        fn CFHTTPMessageCopySerializedMessage(message: &CFHTTPMessage) -> Option<NonNull<CFData>>;
569    }
570    let ret = unsafe { CFHTTPMessageCopySerializedMessage(message) };
571    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
572}
573
574#[deprecated = "renamed to `CFHTTPMessage::request_url`"]
575#[inline]
576pub unsafe extern "C-unwind" fn CFHTTPMessageCopyRequestURL(
577    request: &CFHTTPMessage,
578) -> Option<CFRetained<CFURL>> {
579    extern "C-unwind" {
580        fn CFHTTPMessageCopyRequestURL(request: &CFHTTPMessage) -> Option<NonNull<CFURL>>;
581    }
582    let ret = unsafe { CFHTTPMessageCopyRequestURL(request) };
583    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
584}
585
586#[deprecated = "renamed to `CFHTTPMessage::request_method`"]
587#[inline]
588pub unsafe extern "C-unwind" fn CFHTTPMessageCopyRequestMethod(
589    request: &CFHTTPMessage,
590) -> Option<CFRetained<CFString>> {
591    extern "C-unwind" {
592        fn CFHTTPMessageCopyRequestMethod(request: &CFHTTPMessage) -> Option<NonNull<CFString>>;
593    }
594    let ret = unsafe { CFHTTPMessageCopyRequestMethod(request) };
595    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
596}
597
598#[deprecated = "renamed to `CFHTTPMessage::add_authentication`"]
599#[inline]
600pub unsafe extern "C-unwind" fn CFHTTPMessageAddAuthentication(
601    request: &CFHTTPMessage,
602    authentication_failure_response: Option<&CFHTTPMessage>,
603    username: &CFString,
604    password: &CFString,
605    authentication_scheme: Option<&CFString>,
606    for_proxy: bool,
607) -> bool {
608    extern "C-unwind" {
609        fn CFHTTPMessageAddAuthentication(
610            request: &CFHTTPMessage,
611            authentication_failure_response: Option<&CFHTTPMessage>,
612            username: &CFString,
613            password: &CFString,
614            authentication_scheme: Option<&CFString>,
615            for_proxy: Boolean,
616        ) -> Boolean;
617    }
618    let ret = unsafe {
619        CFHTTPMessageAddAuthentication(
620            request,
621            authentication_failure_response,
622            username,
623            password,
624            authentication_scheme,
625            for_proxy as _,
626        )
627    };
628    ret != 0
629}
630
631extern "C-unwind" {
632    #[deprecated = "renamed to `CFHTTPMessage::response_status_code`"]
633    pub fn CFHTTPMessageGetResponseStatusCode(response: &CFHTTPMessage) -> CFIndex;
634}
635
636#[deprecated = "renamed to `CFHTTPMessage::response_status_line`"]
637#[inline]
638pub unsafe extern "C-unwind" fn CFHTTPMessageCopyResponseStatusLine(
639    response: &CFHTTPMessage,
640) -> Option<CFRetained<CFString>> {
641    extern "C-unwind" {
642        fn CFHTTPMessageCopyResponseStatusLine(
643            response: &CFHTTPMessage,
644        ) -> Option<NonNull<CFString>>;
645    }
646    let ret = unsafe { CFHTTPMessageCopyResponseStatusLine(response) };
647    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
648}