objc2_core_foundation/generated/
CFXMLParser.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::*;
9
10use crate::*;
11
12/// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfxmlparser?language=objc)
13#[repr(C)]
14pub struct CFXMLParser {
15    inner: [u8; 0],
16    _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
17}
18
19cf_type!(
20    #[encoding_name = "__CFXMLParser"]
21    unsafe impl CFXMLParser {}
22);
23
24/// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfxmlparseroptions?language=objc)
25// NS_OPTIONS
26#[cfg(feature = "CFBase")]
27#[repr(transparent)]
28#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
29pub struct CFXMLParserOptions(pub CFOptionFlags);
30#[cfg(feature = "CFBase")]
31bitflags::bitflags! {
32    impl CFXMLParserOptions: CFOptionFlags {
33        #[doc(alias = "kCFXMLParserValidateDocument")]
34        const ValidateDocument = 1<<0;
35        #[doc(alias = "kCFXMLParserSkipMetaData")]
36        const SkipMetaData = 1<<1;
37        #[doc(alias = "kCFXMLParserReplacePhysicalEntities")]
38        const ReplacePhysicalEntities = 1<<2;
39        #[doc(alias = "kCFXMLParserSkipWhitespace")]
40        const SkipWhitespace = 1<<3;
41        #[doc(alias = "kCFXMLParserResolveExternalEntities")]
42        const ResolveExternalEntities = 1<<4;
43        #[doc(alias = "kCFXMLParserAddImpliedAttributes")]
44        const AddImpliedAttributes = 1<<5;
45        #[doc(alias = "kCFXMLParserAllOptions")]
46        const AllOptions = 0x00FFFFFF;
47        #[doc(alias = "kCFXMLParserNoOptions")]
48        const NoOptions = 0;
49    }
50}
51
52#[cfg(all(feature = "CFBase", feature = "objc2"))]
53unsafe impl Encode for CFXMLParserOptions {
54    const ENCODING: Encoding = CFOptionFlags::ENCODING;
55}
56
57#[cfg(all(feature = "CFBase", feature = "objc2"))]
58unsafe impl RefEncode for CFXMLParserOptions {
59    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
60}
61
62/// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfxmlparserstatuscode?language=objc)
63// NS_OPTIONS
64#[cfg(feature = "CFBase")]
65#[repr(transparent)]
66#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
67pub struct CFXMLParserStatusCode(pub CFIndex);
68#[cfg(feature = "CFBase")]
69bitflags::bitflags! {
70    impl CFXMLParserStatusCode: CFIndex {
71        #[doc(alias = "kCFXMLStatusParseNotBegun")]
72        const StatusParseNotBegun = -2;
73        #[doc(alias = "kCFXMLStatusParseInProgress")]
74        const StatusParseInProgress = -1;
75        #[doc(alias = "kCFXMLStatusParseSuccessful")]
76        const StatusParseSuccessful = 0;
77        #[doc(alias = "kCFXMLErrorUnexpectedEOF")]
78        const ErrorUnexpectedEOF = 1;
79        #[doc(alias = "kCFXMLErrorUnknownEncoding")]
80        const ErrorUnknownEncoding = 2;
81        #[doc(alias = "kCFXMLErrorEncodingConversionFailure")]
82        const ErrorEncodingConversionFailure = 3;
83        #[doc(alias = "kCFXMLErrorMalformedProcessingInstruction")]
84        const ErrorMalformedProcessingInstruction = 4;
85        #[doc(alias = "kCFXMLErrorMalformedDTD")]
86        const ErrorMalformedDTD = 5;
87        #[doc(alias = "kCFXMLErrorMalformedName")]
88        const ErrorMalformedName = 6;
89        #[doc(alias = "kCFXMLErrorMalformedCDSect")]
90        const ErrorMalformedCDSect = 7;
91        #[doc(alias = "kCFXMLErrorMalformedCloseTag")]
92        const ErrorMalformedCloseTag = 8;
93        #[doc(alias = "kCFXMLErrorMalformedStartTag")]
94        const ErrorMalformedStartTag = 9;
95        #[doc(alias = "kCFXMLErrorMalformedDocument")]
96        const ErrorMalformedDocument = 10;
97        #[doc(alias = "kCFXMLErrorElementlessDocument")]
98        const ErrorElementlessDocument = 11;
99        #[doc(alias = "kCFXMLErrorMalformedComment")]
100        const ErrorMalformedComment = 12;
101        #[doc(alias = "kCFXMLErrorMalformedCharacterReference")]
102        const ErrorMalformedCharacterReference = 13;
103        #[doc(alias = "kCFXMLErrorMalformedParsedCharacterData")]
104        const ErrorMalformedParsedCharacterData = 14;
105        #[doc(alias = "kCFXMLErrorNoData")]
106        const ErrorNoData = 15;
107    }
108}
109
110#[cfg(all(feature = "CFBase", feature = "objc2"))]
111unsafe impl Encode for CFXMLParserStatusCode {
112    const ENCODING: Encoding = CFIndex::ENCODING;
113}
114
115#[cfg(all(feature = "CFBase", feature = "objc2"))]
116unsafe impl RefEncode for CFXMLParserStatusCode {
117    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
118}
119
120/// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfxmlparsercreatexmlstructurecallback?language=objc)
121#[cfg(feature = "CFXMLNode")]
122pub type CFXMLParserCreateXMLStructureCallBack = Option<
123    unsafe extern "C-unwind" fn(*mut CFXMLParser, *const CFXMLNode, *mut c_void) -> *mut c_void,
124>;
125
126/// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfxmlparseraddchildcallback?language=objc)
127pub type CFXMLParserAddChildCallBack =
128    Option<unsafe extern "C-unwind" fn(*mut CFXMLParser, *mut c_void, *mut c_void, *mut c_void)>;
129
130/// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfxmlparserendxmlstructurecallback?language=objc)
131pub type CFXMLParserEndXMLStructureCallBack =
132    Option<unsafe extern "C-unwind" fn(*mut CFXMLParser, *mut c_void, *mut c_void)>;
133
134/// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfxmlparserresolveexternalentitycallback?language=objc)
135#[cfg(all(
136    feature = "CFBase",
137    feature = "CFData",
138    feature = "CFURL",
139    feature = "CFXMLNode"
140))]
141pub type CFXMLParserResolveExternalEntityCallBack = Option<
142    unsafe extern "C-unwind" fn(
143        *mut CFXMLParser,
144        *mut CFXMLExternalID,
145        *mut c_void,
146    ) -> *const CFData,
147>;
148
149/// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfxmlparserhandleerrorcallback?language=objc)
150#[cfg(feature = "CFBase")]
151pub type CFXMLParserHandleErrorCallBack = Option<
152    unsafe extern "C-unwind" fn(*mut CFXMLParser, CFXMLParserStatusCode, *mut c_void) -> Boolean,
153>;
154
155/// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfxmlparsercallbacks?language=objc)
156#[cfg(all(
157    feature = "CFBase",
158    feature = "CFData",
159    feature = "CFURL",
160    feature = "CFXMLNode"
161))]
162#[repr(C)]
163#[derive(Clone, Copy, Debug, PartialEq)]
164pub struct CFXMLParserCallBacks {
165    pub version: CFIndex,
166    pub createXMLStructure: CFXMLParserCreateXMLStructureCallBack,
167    pub addChild: CFXMLParserAddChildCallBack,
168    pub endXMLStructure: CFXMLParserEndXMLStructureCallBack,
169    pub resolveExternalEntity: CFXMLParserResolveExternalEntityCallBack,
170    pub handleError: CFXMLParserHandleErrorCallBack,
171}
172
173#[cfg(all(
174    feature = "CFBase",
175    feature = "CFData",
176    feature = "CFURL",
177    feature = "CFXMLNode",
178    feature = "objc2"
179))]
180unsafe impl Encode for CFXMLParserCallBacks {
181    const ENCODING: Encoding = Encoding::Struct(
182        "?",
183        &[
184            <CFIndex>::ENCODING,
185            <CFXMLParserCreateXMLStructureCallBack>::ENCODING,
186            <CFXMLParserAddChildCallBack>::ENCODING,
187            <CFXMLParserEndXMLStructureCallBack>::ENCODING,
188            <CFXMLParserResolveExternalEntityCallBack>::ENCODING,
189            <CFXMLParserHandleErrorCallBack>::ENCODING,
190        ],
191    );
192}
193
194#[cfg(all(
195    feature = "CFBase",
196    feature = "CFData",
197    feature = "CFURL",
198    feature = "CFXMLNode",
199    feature = "objc2"
200))]
201unsafe impl RefEncode for CFXMLParserCallBacks {
202    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
203}
204
205/// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfxmlparserretaincallback?language=objc)
206pub type CFXMLParserRetainCallBack =
207    Option<unsafe extern "C-unwind" fn(*const c_void) -> *const c_void>;
208
209/// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfxmlparserreleasecallback?language=objc)
210pub type CFXMLParserReleaseCallBack = Option<unsafe extern "C-unwind" fn(*const c_void)>;
211
212/// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfxmlparsercopydescriptioncallback?language=objc)
213#[cfg(feature = "CFBase")]
214pub type CFXMLParserCopyDescriptionCallBack =
215    Option<unsafe extern "C-unwind" fn(*const c_void) -> *const CFString>;
216
217/// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/cfxmlparsercontext?language=objc)
218#[cfg(feature = "CFBase")]
219#[repr(C)]
220#[derive(Clone, Copy, Debug, PartialEq)]
221pub struct CFXMLParserContext {
222    pub version: CFIndex,
223    pub info: *mut c_void,
224    pub retain: CFXMLParserRetainCallBack,
225    pub release: CFXMLParserReleaseCallBack,
226    pub copyDescription: CFXMLParserCopyDescriptionCallBack,
227}
228
229#[cfg(all(feature = "CFBase", feature = "objc2"))]
230unsafe impl Encode for CFXMLParserContext {
231    const ENCODING: Encoding = Encoding::Struct(
232        "?",
233        &[
234            <CFIndex>::ENCODING,
235            <*mut c_void>::ENCODING,
236            <CFXMLParserRetainCallBack>::ENCODING,
237            <CFXMLParserReleaseCallBack>::ENCODING,
238            <CFXMLParserCopyDescriptionCallBack>::ENCODING,
239        ],
240    );
241}
242
243#[cfg(all(feature = "CFBase", feature = "objc2"))]
244unsafe impl RefEncode for CFXMLParserContext {
245    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
246}
247
248#[cfg(feature = "CFBase")]
249unsafe impl ConcreteType for CFXMLParser {
250    #[doc(alias = "CFXMLParserGetTypeID")]
251    #[inline]
252    fn type_id() -> CFTypeID {
253        extern "C-unwind" {
254            fn CFXMLParserGetTypeID() -> CFTypeID;
255        }
256        unsafe { CFXMLParserGetTypeID() }
257    }
258}
259
260#[cfg(all(
261    feature = "CFBase",
262    feature = "CFData",
263    feature = "CFURL",
264    feature = "CFXMLNode"
265))]
266#[deprecated = "CFXMLParser is deprecated, use NSXMLParser, NSXMLDocument or libxml2 library instead"]
267#[inline]
268pub unsafe extern "C-unwind" fn CFXMLParserCreate(
269    allocator: Option<&CFAllocator>,
270    xml_data: Option<&CFData>,
271    data_source: Option<&CFURL>,
272    parse_options: CFOptionFlags,
273    version_of_nodes: CFIndex,
274    call_backs: *mut CFXMLParserCallBacks,
275    context: *mut CFXMLParserContext,
276) -> Option<CFRetained<CFXMLParser>> {
277    extern "C-unwind" {
278        fn CFXMLParserCreate(
279            allocator: Option<&CFAllocator>,
280            xml_data: Option<&CFData>,
281            data_source: Option<&CFURL>,
282            parse_options: CFOptionFlags,
283            version_of_nodes: CFIndex,
284            call_backs: *mut CFXMLParserCallBacks,
285            context: *mut CFXMLParserContext,
286        ) -> Option<NonNull<CFXMLParser>>;
287    }
288    let ret = unsafe {
289        CFXMLParserCreate(
290            allocator,
291            xml_data,
292            data_source,
293            parse_options,
294            version_of_nodes,
295            call_backs,
296            context,
297        )
298    };
299    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
300}
301
302#[cfg(all(
303    feature = "CFBase",
304    feature = "CFData",
305    feature = "CFURL",
306    feature = "CFXMLNode"
307))]
308#[deprecated = "CFXMLParser is deprecated, use NSXMLParser, NSXMLDocument or libxml2 library instead"]
309#[inline]
310pub unsafe extern "C-unwind" fn CFXMLParserCreateWithDataFromURL(
311    allocator: Option<&CFAllocator>,
312    data_source: Option<&CFURL>,
313    parse_options: CFOptionFlags,
314    version_of_nodes: CFIndex,
315    call_backs: *mut CFXMLParserCallBacks,
316    context: *mut CFXMLParserContext,
317) -> Option<CFRetained<CFXMLParser>> {
318    extern "C-unwind" {
319        fn CFXMLParserCreateWithDataFromURL(
320            allocator: Option<&CFAllocator>,
321            data_source: Option<&CFURL>,
322            parse_options: CFOptionFlags,
323            version_of_nodes: CFIndex,
324            call_backs: *mut CFXMLParserCallBacks,
325            context: *mut CFXMLParserContext,
326        ) -> Option<NonNull<CFXMLParser>>;
327    }
328    let ret = unsafe {
329        CFXMLParserCreateWithDataFromURL(
330            allocator,
331            data_source,
332            parse_options,
333            version_of_nodes,
334            call_backs,
335            context,
336        )
337    };
338    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
339}
340
341extern "C-unwind" {
342    #[cfg(feature = "CFBase")]
343    #[deprecated = "CFXMLParser is deprecated, use NSXMLParser, NSXMLDocument or libxml2 library instead"]
344    pub fn CFXMLParserGetContext(parser: &CFXMLParser, context: *mut CFXMLParserContext);
345}
346
347extern "C-unwind" {
348    #[cfg(all(
349        feature = "CFBase",
350        feature = "CFData",
351        feature = "CFURL",
352        feature = "CFXMLNode"
353    ))]
354    #[deprecated = "CFXMLParser is deprecated, use NSXMLParser, NSXMLDocument or libxml2 library instead"]
355    pub fn CFXMLParserGetCallBacks(parser: &CFXMLParser, call_backs: *mut CFXMLParserCallBacks);
356}
357
358#[cfg(feature = "CFURL")]
359#[deprecated = "CFXMLParser is deprecated, use NSXMLParser, NSXMLDocument or libxml2 library instead"]
360#[inline]
361pub unsafe extern "C-unwind" fn CFXMLParserGetSourceURL(
362    parser: &CFXMLParser,
363) -> Option<CFRetained<CFURL>> {
364    extern "C-unwind" {
365        fn CFXMLParserGetSourceURL(parser: &CFXMLParser) -> Option<NonNull<CFURL>>;
366    }
367    let ret = unsafe { CFXMLParserGetSourceURL(parser) };
368    ret.map(|ret| unsafe { CFRetained::retain(ret) })
369}
370
371extern "C-unwind" {
372    #[cfg(feature = "CFBase")]
373    #[deprecated = "CFXMLParser is deprecated, use NSXMLParser, NSXMLDocument or libxml2 library instead"]
374    pub fn CFXMLParserGetLocation(parser: &CFXMLParser) -> CFIndex;
375}
376
377extern "C-unwind" {
378    #[cfg(feature = "CFBase")]
379    #[deprecated = "CFXMLParser is deprecated, use NSXMLParser, NSXMLDocument or libxml2 library instead"]
380    pub fn CFXMLParserGetLineNumber(parser: &CFXMLParser) -> CFIndex;
381}
382
383extern "C-unwind" {
384    #[deprecated = "CFXMLParser is deprecated, use NSXMLParser, NSXMLDocument or libxml2 library instead"]
385    pub fn CFXMLParserGetDocument(parser: &CFXMLParser) -> *mut c_void;
386}
387
388extern "C-unwind" {
389    #[cfg(feature = "CFBase")]
390    #[deprecated = "CFXMLParser is deprecated, use NSXMLParser, NSXMLDocument or libxml2 library instead"]
391    pub fn CFXMLParserGetStatusCode(parser: &CFXMLParser) -> CFXMLParserStatusCode;
392}
393
394#[cfg(feature = "CFBase")]
395#[deprecated = "CFXMLParser is deprecated, use NSXMLParser, NSXMLDocument or libxml2 library instead"]
396#[inline]
397pub unsafe extern "C-unwind" fn CFXMLParserCopyErrorDescription(
398    parser: &CFXMLParser,
399) -> Option<CFRetained<CFString>> {
400    extern "C-unwind" {
401        fn CFXMLParserCopyErrorDescription(parser: &CFXMLParser) -> Option<NonNull<CFString>>;
402    }
403    let ret = unsafe { CFXMLParserCopyErrorDescription(parser) };
404    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
405}
406
407extern "C-unwind" {
408    #[cfg(feature = "CFBase")]
409    #[deprecated = "CFXMLParser is deprecated, use NSXMLParser, NSXMLDocument or libxml2 library instead"]
410    pub fn CFXMLParserAbort(
411        parser: &CFXMLParser,
412        error_code: CFXMLParserStatusCode,
413        error_description: Option<&CFString>,
414    );
415}
416
417#[deprecated = "CFXMLParser is deprecated, use NSXMLParser, NSXMLDocument or libxml2 library instead"]
418#[inline]
419pub unsafe extern "C-unwind" fn CFXMLParserParse(parser: &CFXMLParser) -> bool {
420    extern "C-unwind" {
421        fn CFXMLParserParse(parser: &CFXMLParser) -> Boolean;
422    }
423    let ret = unsafe { CFXMLParserParse(parser) };
424    ret != 0
425}
426
427#[cfg(all(
428    feature = "CFBase",
429    feature = "CFData",
430    feature = "CFTree",
431    feature = "CFURL",
432    feature = "CFXMLNode"
433))]
434#[deprecated = "CFXMLParser is deprecated, use NSXMLParser, NSXMLDocument or libxml2 library instead"]
435#[inline]
436pub unsafe extern "C-unwind" fn CFXMLTreeCreateFromData(
437    allocator: Option<&CFAllocator>,
438    xml_data: Option<&CFData>,
439    data_source: Option<&CFURL>,
440    parse_options: CFOptionFlags,
441    version_of_nodes: CFIndex,
442) -> Option<CFRetained<CFXMLTree>> {
443    extern "C-unwind" {
444        fn CFXMLTreeCreateFromData(
445            allocator: Option<&CFAllocator>,
446            xml_data: Option<&CFData>,
447            data_source: Option<&CFURL>,
448            parse_options: CFOptionFlags,
449            version_of_nodes: CFIndex,
450        ) -> Option<NonNull<CFXMLTree>>;
451    }
452    let ret = unsafe {
453        CFXMLTreeCreateFromData(
454            allocator,
455            xml_data,
456            data_source,
457            parse_options,
458            version_of_nodes,
459        )
460    };
461    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
462}
463
464#[cfg(all(
465    feature = "CFBase",
466    feature = "CFData",
467    feature = "CFDictionary",
468    feature = "CFTree",
469    feature = "CFURL",
470    feature = "CFXMLNode"
471))]
472#[deprecated = "CFXMLParser is deprecated, use NSXMLParser, NSXMLDocument or libxml2 library instead"]
473#[inline]
474pub unsafe extern "C-unwind" fn CFXMLTreeCreateFromDataWithError(
475    allocator: Option<&CFAllocator>,
476    xml_data: Option<&CFData>,
477    data_source: Option<&CFURL>,
478    parse_options: CFOptionFlags,
479    version_of_nodes: CFIndex,
480    error_dict: *mut *const CFDictionary,
481) -> Option<CFRetained<CFXMLTree>> {
482    extern "C-unwind" {
483        fn CFXMLTreeCreateFromDataWithError(
484            allocator: Option<&CFAllocator>,
485            xml_data: Option<&CFData>,
486            data_source: Option<&CFURL>,
487            parse_options: CFOptionFlags,
488            version_of_nodes: CFIndex,
489            error_dict: *mut *const CFDictionary,
490        ) -> Option<NonNull<CFXMLTree>>;
491    }
492    let ret = unsafe {
493        CFXMLTreeCreateFromDataWithError(
494            allocator,
495            xml_data,
496            data_source,
497            parse_options,
498            version_of_nodes,
499            error_dict,
500        )
501    };
502    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
503}
504
505#[cfg(all(
506    feature = "CFBase",
507    feature = "CFTree",
508    feature = "CFURL",
509    feature = "CFXMLNode"
510))]
511#[deprecated = "CFXMLParser is deprecated, use NSXMLParser, NSXMLDocument or libxml2 library instead"]
512#[inline]
513pub unsafe extern "C-unwind" fn CFXMLTreeCreateWithDataFromURL(
514    allocator: Option<&CFAllocator>,
515    data_source: Option<&CFURL>,
516    parse_options: CFOptionFlags,
517    version_of_nodes: CFIndex,
518) -> Option<CFRetained<CFXMLTree>> {
519    extern "C-unwind" {
520        fn CFXMLTreeCreateWithDataFromURL(
521            allocator: Option<&CFAllocator>,
522            data_source: Option<&CFURL>,
523            parse_options: CFOptionFlags,
524            version_of_nodes: CFIndex,
525        ) -> Option<NonNull<CFXMLTree>>;
526    }
527    let ret = unsafe {
528        CFXMLTreeCreateWithDataFromURL(allocator, data_source, parse_options, version_of_nodes)
529    };
530    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
531}
532
533#[cfg(all(
534    feature = "CFBase",
535    feature = "CFData",
536    feature = "CFTree",
537    feature = "CFXMLNode"
538))]
539#[deprecated = "CFXMLParser is deprecated, use NSXMLParser, NSXMLDocument or libxml2 library instead"]
540#[inline]
541pub unsafe extern "C-unwind" fn CFXMLTreeCreateXMLData(
542    allocator: Option<&CFAllocator>,
543    xml_tree: Option<&CFXMLTree>,
544) -> Option<CFRetained<CFData>> {
545    extern "C-unwind" {
546        fn CFXMLTreeCreateXMLData(
547            allocator: Option<&CFAllocator>,
548            xml_tree: Option<&CFXMLTree>,
549        ) -> Option<NonNull<CFData>>;
550    }
551    let ret = unsafe { CFXMLTreeCreateXMLData(allocator, xml_tree) };
552    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
553}
554
555#[cfg(all(feature = "CFBase", feature = "CFDictionary"))]
556#[inline]
557pub unsafe extern "C-unwind" fn CFXMLCreateStringByEscapingEntities(
558    allocator: Option<&CFAllocator>,
559    string: Option<&CFString>,
560    entities_dictionary: Option<&CFDictionary>,
561) -> Option<CFRetained<CFString>> {
562    extern "C-unwind" {
563        fn CFXMLCreateStringByEscapingEntities(
564            allocator: Option<&CFAllocator>,
565            string: Option<&CFString>,
566            entities_dictionary: Option<&CFDictionary>,
567        ) -> Option<NonNull<CFString>>;
568    }
569    let ret =
570        unsafe { CFXMLCreateStringByEscapingEntities(allocator, string, entities_dictionary) };
571    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
572}
573
574#[cfg(all(feature = "CFBase", feature = "CFDictionary"))]
575#[inline]
576pub unsafe extern "C-unwind" fn CFXMLCreateStringByUnescapingEntities(
577    allocator: Option<&CFAllocator>,
578    string: Option<&CFString>,
579    entities_dictionary: Option<&CFDictionary>,
580) -> Option<CFRetained<CFString>> {
581    extern "C-unwind" {
582        fn CFXMLCreateStringByUnescapingEntities(
583            allocator: Option<&CFAllocator>,
584            string: Option<&CFString>,
585            entities_dictionary: Option<&CFDictionary>,
586        ) -> Option<NonNull<CFString>>;
587    }
588    let ret =
589        unsafe { CFXMLCreateStringByUnescapingEntities(allocator, string, entities_dictionary) };
590    ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
591}
592
593extern "C" {
594    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcfxmltreeerrordescription?language=objc)
595    #[cfg(feature = "CFBase")]
596    pub static kCFXMLTreeErrorDescription: Option<&'static CFString>;
597}
598
599extern "C" {
600    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcfxmltreeerrorlinenumber?language=objc)
601    #[cfg(feature = "CFBase")]
602    pub static kCFXMLTreeErrorLineNumber: Option<&'static CFString>;
603}
604
605extern "C" {
606    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcfxmltreeerrorlocation?language=objc)
607    #[cfg(feature = "CFBase")]
608    pub static kCFXMLTreeErrorLocation: Option<&'static CFString>;
609}
610
611extern "C" {
612    /// [Apple's documentation](https://developer.apple.com/documentation/corefoundation/kcfxmltreeerrorstatuscode?language=objc)
613    #[cfg(feature = "CFBase")]
614    pub static kCFXMLTreeErrorStatusCode: Option<&'static CFString>;
615}