1use 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#[doc(alias = "CFCharacterSetRef")]
18#[repr(C)]
19pub struct CFCharacterSet {
20 inner: [u8; 0],
21 _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
22}
23
24cf_type!(
25 unsafe impl CFCharacterSet {}
26);
27#[cfg(feature = "objc2")]
28cf_objc2_type!(
29 unsafe impl RefEncode<"__CFCharacterSet"> for CFCharacterSet {}
30);
31
32#[doc(alias = "CFMutableCharacterSetRef")]
38#[repr(C)]
39pub struct CFMutableCharacterSet {
40 inner: [u8; 0],
41 _p: UnsafeCell<PhantomData<(*const UnsafeCell<()>, PhantomPinned)>>,
42}
43
44cf_type!(
45 unsafe impl CFMutableCharacterSet: CFCharacterSet {}
46);
47#[cfg(feature = "objc2")]
48cf_objc2_type!(
49 unsafe impl RefEncode<"__CFCharacterSet"> for CFMutableCharacterSet {}
50);
51
52#[repr(transparent)]
57#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
58pub struct CFCharacterSetPredefinedSet(pub CFIndex);
59impl CFCharacterSetPredefinedSet {
60 #[doc(alias = "kCFCharacterSetControl")]
61 pub const Control: Self = Self(1);
62 #[doc(alias = "kCFCharacterSetWhitespace")]
63 pub const Whitespace: Self = Self(2);
64 #[doc(alias = "kCFCharacterSetWhitespaceAndNewline")]
65 pub const WhitespaceAndNewline: Self = Self(3);
66 #[doc(alias = "kCFCharacterSetDecimalDigit")]
67 pub const DecimalDigit: Self = Self(4);
68 #[doc(alias = "kCFCharacterSetLetter")]
69 pub const Letter: Self = Self(5);
70 #[doc(alias = "kCFCharacterSetLowercaseLetter")]
71 pub const LowercaseLetter: Self = Self(6);
72 #[doc(alias = "kCFCharacterSetUppercaseLetter")]
73 pub const UppercaseLetter: Self = Self(7);
74 #[doc(alias = "kCFCharacterSetNonBase")]
75 pub const NonBase: Self = Self(8);
76 #[doc(alias = "kCFCharacterSetDecomposable")]
77 pub const Decomposable: Self = Self(9);
78 #[doc(alias = "kCFCharacterSetAlphaNumeric")]
79 pub const AlphaNumeric: Self = Self(10);
80 #[doc(alias = "kCFCharacterSetPunctuation")]
81 pub const Punctuation: Self = Self(11);
82 #[doc(alias = "kCFCharacterSetCapitalizedLetter")]
83 pub const CapitalizedLetter: Self = Self(13);
84 #[doc(alias = "kCFCharacterSetSymbol")]
85 pub const Symbol: Self = Self(14);
86 #[doc(alias = "kCFCharacterSetNewline")]
87 pub const Newline: Self = Self(15);
88 #[doc(alias = "kCFCharacterSetIllegal")]
89 pub const Illegal: Self = Self(12);
90}
91
92#[cfg(feature = "objc2")]
93unsafe impl Encode for CFCharacterSetPredefinedSet {
94 const ENCODING: Encoding = CFIndex::ENCODING;
95}
96
97#[cfg(feature = "objc2")]
98unsafe impl RefEncode for CFCharacterSetPredefinedSet {
99 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
100}
101
102unsafe impl ConcreteType for CFCharacterSet {
103 #[doc(alias = "CFCharacterSetGetTypeID")]
105 #[inline]
106 fn type_id() -> CFTypeID {
107 extern "C-unwind" {
108 fn CFCharacterSetGetTypeID() -> CFTypeID;
109 }
110 unsafe { CFCharacterSetGetTypeID() }
111 }
112}
113
114impl CFCharacterSet {
115 #[doc(alias = "CFCharacterSetGetPredefined")]
125 #[inline]
126 pub fn predefined(
127 the_set_identifier: CFCharacterSetPredefinedSet,
128 ) -> Option<CFRetained<CFCharacterSet>> {
129 extern "C-unwind" {
130 fn CFCharacterSetGetPredefined(
131 the_set_identifier: CFCharacterSetPredefinedSet,
132 ) -> Option<NonNull<CFCharacterSet>>;
133 }
134 let ret = unsafe { CFCharacterSetGetPredefined(the_set_identifier) };
135 ret.map(|ret| unsafe { CFRetained::retain(ret) })
136 }
137
138 #[doc(alias = "CFCharacterSetCreateWithCharactersInRange")]
159 #[inline]
160 pub unsafe fn with_characters_in_range(
161 alloc: Option<&CFAllocator>,
162 the_range: CFRange,
163 ) -> Option<CFRetained<CFCharacterSet>> {
164 extern "C-unwind" {
165 fn CFCharacterSetCreateWithCharactersInRange(
166 alloc: Option<&CFAllocator>,
167 the_range: CFRange,
168 ) -> Option<NonNull<CFCharacterSet>>;
169 }
170 let ret = unsafe { CFCharacterSetCreateWithCharactersInRange(alloc, the_range) };
171 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
172 }
173
174 #[doc(alias = "CFCharacterSetCreateWithCharactersInString")]
194 #[inline]
195 pub unsafe fn with_characters_in_string(
196 alloc: Option<&CFAllocator>,
197 the_string: Option<&CFString>,
198 ) -> Option<CFRetained<CFCharacterSet>> {
199 extern "C-unwind" {
200 fn CFCharacterSetCreateWithCharactersInString(
201 alloc: Option<&CFAllocator>,
202 the_string: Option<&CFString>,
203 ) -> Option<NonNull<CFCharacterSet>>;
204 }
205 let ret = unsafe { CFCharacterSetCreateWithCharactersInString(alloc, the_string) };
206 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
207 }
208
209 #[doc(alias = "CFCharacterSetCreateWithBitmapRepresentation")]
240 #[cfg(feature = "CFData")]
241 #[inline]
242 pub unsafe fn with_bitmap_representation(
243 alloc: Option<&CFAllocator>,
244 the_data: Option<&CFData>,
245 ) -> Option<CFRetained<CFCharacterSet>> {
246 extern "C-unwind" {
247 fn CFCharacterSetCreateWithBitmapRepresentation(
248 alloc: Option<&CFAllocator>,
249 the_data: Option<&CFData>,
250 ) -> Option<NonNull<CFCharacterSet>>;
251 }
252 let ret = unsafe { CFCharacterSetCreateWithBitmapRepresentation(alloc, the_data) };
253 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
254 }
255
256 #[doc(alias = "CFCharacterSetCreateInvertedSet")]
275 #[inline]
276 pub unsafe fn new_inverted_set(
277 alloc: Option<&CFAllocator>,
278 the_set: Option<&CFCharacterSet>,
279 ) -> Option<CFRetained<CFCharacterSet>> {
280 extern "C-unwind" {
281 fn CFCharacterSetCreateInvertedSet(
282 alloc: Option<&CFAllocator>,
283 the_set: Option<&CFCharacterSet>,
284 ) -> Option<NonNull<CFCharacterSet>>;
285 }
286 let ret = unsafe { CFCharacterSetCreateInvertedSet(alloc, the_set) };
287 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
288 }
289
290 #[doc(alias = "CFCharacterSetIsSupersetOfSet")]
302 #[inline]
303 pub unsafe fn is_superset_of_set(&self, the_otherset: Option<&CFCharacterSet>) -> bool {
304 extern "C-unwind" {
305 fn CFCharacterSetIsSupersetOfSet(
306 the_set: &CFCharacterSet,
307 the_otherset: Option<&CFCharacterSet>,
308 ) -> Boolean;
309 }
310 let ret = unsafe { CFCharacterSetIsSupersetOfSet(self, the_otherset) };
311 ret != 0
312 }
313
314 #[doc(alias = "CFCharacterSetHasMemberInPlane")]
323 #[inline]
324 pub unsafe fn has_member_in_plane(&self, the_plane: CFIndex) -> bool {
325 extern "C-unwind" {
326 fn CFCharacterSetHasMemberInPlane(
327 the_set: &CFCharacterSet,
328 the_plane: CFIndex,
329 ) -> Boolean;
330 }
331 let ret = unsafe { CFCharacterSetHasMemberInPlane(self, the_plane) };
332 ret != 0
333 }
334}
335
336impl CFMutableCharacterSet {
337 #[doc(alias = "CFCharacterSetCreateMutable")]
351 #[inline]
352 pub unsafe fn new(alloc: Option<&CFAllocator>) -> Option<CFRetained<CFMutableCharacterSet>> {
353 extern "C-unwind" {
354 fn CFCharacterSetCreateMutable(
355 alloc: Option<&CFAllocator>,
356 ) -> Option<NonNull<CFMutableCharacterSet>>;
357 }
358 let ret = unsafe { CFCharacterSetCreateMutable(alloc) };
359 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
360 }
361}
362
363impl CFCharacterSet {
364 #[doc(alias = "CFCharacterSetCreateCopy")]
383 #[inline]
384 pub unsafe fn new_copy(
385 alloc: Option<&CFAllocator>,
386 the_set: Option<&CFCharacterSet>,
387 ) -> Option<CFRetained<CFCharacterSet>> {
388 extern "C-unwind" {
389 fn CFCharacterSetCreateCopy(
390 alloc: Option<&CFAllocator>,
391 the_set: Option<&CFCharacterSet>,
392 ) -> Option<NonNull<CFCharacterSet>>;
393 }
394 let ret = unsafe { CFCharacterSetCreateCopy(alloc, the_set) };
395 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
396 }
397}
398
399impl CFMutableCharacterSet {
400 #[doc(alias = "CFCharacterSetCreateMutableCopy")]
419 #[inline]
420 pub unsafe fn new_copy(
421 alloc: Option<&CFAllocator>,
422 the_set: Option<&CFCharacterSet>,
423 ) -> Option<CFRetained<CFMutableCharacterSet>> {
424 extern "C-unwind" {
425 fn CFCharacterSetCreateMutableCopy(
426 alloc: Option<&CFAllocator>,
427 the_set: Option<&CFCharacterSet>,
428 ) -> Option<NonNull<CFMutableCharacterSet>>;
429 }
430 let ret = unsafe { CFCharacterSetCreateMutableCopy(alloc, the_set) };
431 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
432 }
433}
434
435impl CFCharacterSet {
436 #[doc(alias = "CFCharacterSetIsCharacterMember")]
448 #[inline]
449 pub fn is_character_member(&self, the_char: UniChar) -> bool {
450 extern "C-unwind" {
451 fn CFCharacterSetIsCharacterMember(
452 the_set: &CFCharacterSet,
453 the_char: UniChar,
454 ) -> Boolean;
455 }
456 let ret = unsafe { CFCharacterSetIsCharacterMember(self, the_char) };
457 ret != 0
458 }
459
460 #[doc(alias = "CFCharacterSetIsLongCharacterMember")]
470 #[inline]
471 pub fn is_long_character_member(&self, the_char: UTF32Char) -> bool {
472 extern "C-unwind" {
473 fn CFCharacterSetIsLongCharacterMember(
474 the_set: &CFCharacterSet,
475 the_char: UTF32Char,
476 ) -> Boolean;
477 }
478 let ret = unsafe { CFCharacterSetIsLongCharacterMember(self, the_char) };
479 ret != 0
480 }
481
482 #[doc(alias = "CFCharacterSetCreateBitmapRepresentation")]
504 #[cfg(feature = "CFData")]
505 #[inline]
506 pub unsafe fn new_bitmap_representation(
507 alloc: Option<&CFAllocator>,
508 the_set: Option<&CFCharacterSet>,
509 ) -> Option<CFRetained<CFData>> {
510 extern "C-unwind" {
511 fn CFCharacterSetCreateBitmapRepresentation(
512 alloc: Option<&CFAllocator>,
513 the_set: Option<&CFCharacterSet>,
514 ) -> Option<NonNull<CFData>>;
515 }
516 let ret = unsafe { CFCharacterSetCreateBitmapRepresentation(alloc, the_set) };
517 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
518 }
519}
520
521impl CFMutableCharacterSet {
522 #[doc(alias = "CFCharacterSetAddCharactersInRange")]
538 #[inline]
539 pub unsafe fn add_characters_in_range(
540 the_set: Option<&CFMutableCharacterSet>,
541 the_range: CFRange,
542 ) {
543 extern "C-unwind" {
544 fn CFCharacterSetAddCharactersInRange(
545 the_set: Option<&CFMutableCharacterSet>,
546 the_range: CFRange,
547 );
548 }
549 unsafe { CFCharacterSetAddCharactersInRange(the_set, the_range) }
550 }
551
552 #[doc(alias = "CFCharacterSetRemoveCharactersInRange")]
568 #[inline]
569 pub unsafe fn remove_characters_in_range(
570 the_set: Option<&CFMutableCharacterSet>,
571 the_range: CFRange,
572 ) {
573 extern "C-unwind" {
574 fn CFCharacterSetRemoveCharactersInRange(
575 the_set: Option<&CFMutableCharacterSet>,
576 the_range: CFRange,
577 );
578 }
579 unsafe { CFCharacterSetRemoveCharactersInRange(the_set, the_range) }
580 }
581
582 #[doc(alias = "CFCharacterSetAddCharactersInString")]
597 #[inline]
598 pub unsafe fn add_characters_in_string(
599 the_set: Option<&CFMutableCharacterSet>,
600 the_string: Option<&CFString>,
601 ) {
602 extern "C-unwind" {
603 fn CFCharacterSetAddCharactersInString(
604 the_set: Option<&CFMutableCharacterSet>,
605 the_string: Option<&CFString>,
606 );
607 }
608 unsafe { CFCharacterSetAddCharactersInString(the_set, the_string) }
609 }
610
611 #[doc(alias = "CFCharacterSetRemoveCharactersInString")]
626 #[inline]
627 pub unsafe fn remove_characters_in_string(
628 the_set: Option<&CFMutableCharacterSet>,
629 the_string: Option<&CFString>,
630 ) {
631 extern "C-unwind" {
632 fn CFCharacterSetRemoveCharactersInString(
633 the_set: Option<&CFMutableCharacterSet>,
634 the_string: Option<&CFString>,
635 );
636 }
637 unsafe { CFCharacterSetRemoveCharactersInString(the_set, the_string) }
638 }
639
640 #[doc(alias = "CFCharacterSetUnion")]
656 #[inline]
657 pub unsafe fn union(
658 the_set: Option<&CFMutableCharacterSet>,
659 the_other_set: Option<&CFCharacterSet>,
660 ) {
661 extern "C-unwind" {
662 fn CFCharacterSetUnion(
663 the_set: Option<&CFMutableCharacterSet>,
664 the_other_set: Option<&CFCharacterSet>,
665 );
666 }
667 unsafe { CFCharacterSetUnion(the_set, the_other_set) }
668 }
669
670 #[doc(alias = "CFCharacterSetIntersect")]
686 #[inline]
687 pub unsafe fn intersect(
688 the_set: Option<&CFMutableCharacterSet>,
689 the_other_set: Option<&CFCharacterSet>,
690 ) {
691 extern "C-unwind" {
692 fn CFCharacterSetIntersect(
693 the_set: Option<&CFMutableCharacterSet>,
694 the_other_set: Option<&CFCharacterSet>,
695 );
696 }
697 unsafe { CFCharacterSetIntersect(the_set, the_other_set) }
698 }
699
700 #[doc(alias = "CFCharacterSetInvert")]
710 #[inline]
711 pub unsafe fn invert(the_set: Option<&CFMutableCharacterSet>) {
712 extern "C-unwind" {
713 fn CFCharacterSetInvert(the_set: Option<&CFMutableCharacterSet>);
714 }
715 unsafe { CFCharacterSetInvert(the_set) }
716 }
717}
718
719#[deprecated = "renamed to `CFCharacterSet::predefined`"]
720#[inline]
721pub extern "C-unwind" fn CFCharacterSetGetPredefined(
722 the_set_identifier: CFCharacterSetPredefinedSet,
723) -> Option<CFRetained<CFCharacterSet>> {
724 extern "C-unwind" {
725 fn CFCharacterSetGetPredefined(
726 the_set_identifier: CFCharacterSetPredefinedSet,
727 ) -> Option<NonNull<CFCharacterSet>>;
728 }
729 let ret = unsafe { CFCharacterSetGetPredefined(the_set_identifier) };
730 ret.map(|ret| unsafe { CFRetained::retain(ret) })
731}
732
733#[deprecated = "renamed to `CFCharacterSet::with_characters_in_range`"]
734#[inline]
735pub unsafe extern "C-unwind" fn CFCharacterSetCreateWithCharactersInRange(
736 alloc: Option<&CFAllocator>,
737 the_range: CFRange,
738) -> Option<CFRetained<CFCharacterSet>> {
739 extern "C-unwind" {
740 fn CFCharacterSetCreateWithCharactersInRange(
741 alloc: Option<&CFAllocator>,
742 the_range: CFRange,
743 ) -> Option<NonNull<CFCharacterSet>>;
744 }
745 let ret = unsafe { CFCharacterSetCreateWithCharactersInRange(alloc, the_range) };
746 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
747}
748
749#[deprecated = "renamed to `CFCharacterSet::with_characters_in_string`"]
750#[inline]
751pub unsafe extern "C-unwind" fn CFCharacterSetCreateWithCharactersInString(
752 alloc: Option<&CFAllocator>,
753 the_string: Option<&CFString>,
754) -> Option<CFRetained<CFCharacterSet>> {
755 extern "C-unwind" {
756 fn CFCharacterSetCreateWithCharactersInString(
757 alloc: Option<&CFAllocator>,
758 the_string: Option<&CFString>,
759 ) -> Option<NonNull<CFCharacterSet>>;
760 }
761 let ret = unsafe { CFCharacterSetCreateWithCharactersInString(alloc, the_string) };
762 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
763}
764
765#[cfg(feature = "CFData")]
766#[deprecated = "renamed to `CFCharacterSet::with_bitmap_representation`"]
767#[inline]
768pub unsafe extern "C-unwind" fn CFCharacterSetCreateWithBitmapRepresentation(
769 alloc: Option<&CFAllocator>,
770 the_data: Option<&CFData>,
771) -> Option<CFRetained<CFCharacterSet>> {
772 extern "C-unwind" {
773 fn CFCharacterSetCreateWithBitmapRepresentation(
774 alloc: Option<&CFAllocator>,
775 the_data: Option<&CFData>,
776 ) -> Option<NonNull<CFCharacterSet>>;
777 }
778 let ret = unsafe { CFCharacterSetCreateWithBitmapRepresentation(alloc, the_data) };
779 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
780}
781
782#[deprecated = "renamed to `CFCharacterSet::new_inverted_set`"]
783#[inline]
784pub unsafe extern "C-unwind" fn CFCharacterSetCreateInvertedSet(
785 alloc: Option<&CFAllocator>,
786 the_set: Option<&CFCharacterSet>,
787) -> Option<CFRetained<CFCharacterSet>> {
788 extern "C-unwind" {
789 fn CFCharacterSetCreateInvertedSet(
790 alloc: Option<&CFAllocator>,
791 the_set: Option<&CFCharacterSet>,
792 ) -> Option<NonNull<CFCharacterSet>>;
793 }
794 let ret = unsafe { CFCharacterSetCreateInvertedSet(alloc, the_set) };
795 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
796}
797
798#[deprecated = "renamed to `CFCharacterSet::is_superset_of_set`"]
799#[inline]
800pub unsafe extern "C-unwind" fn CFCharacterSetIsSupersetOfSet(
801 the_set: &CFCharacterSet,
802 the_otherset: Option<&CFCharacterSet>,
803) -> bool {
804 extern "C-unwind" {
805 fn CFCharacterSetIsSupersetOfSet(
806 the_set: &CFCharacterSet,
807 the_otherset: Option<&CFCharacterSet>,
808 ) -> Boolean;
809 }
810 let ret = unsafe { CFCharacterSetIsSupersetOfSet(the_set, the_otherset) };
811 ret != 0
812}
813
814#[deprecated = "renamed to `CFCharacterSet::has_member_in_plane`"]
815#[inline]
816pub unsafe extern "C-unwind" fn CFCharacterSetHasMemberInPlane(
817 the_set: &CFCharacterSet,
818 the_plane: CFIndex,
819) -> bool {
820 extern "C-unwind" {
821 fn CFCharacterSetHasMemberInPlane(the_set: &CFCharacterSet, the_plane: CFIndex) -> Boolean;
822 }
823 let ret = unsafe { CFCharacterSetHasMemberInPlane(the_set, the_plane) };
824 ret != 0
825}
826
827#[deprecated = "renamed to `CFMutableCharacterSet::new`"]
828#[inline]
829pub unsafe extern "C-unwind" fn CFCharacterSetCreateMutable(
830 alloc: Option<&CFAllocator>,
831) -> Option<CFRetained<CFMutableCharacterSet>> {
832 extern "C-unwind" {
833 fn CFCharacterSetCreateMutable(
834 alloc: Option<&CFAllocator>,
835 ) -> Option<NonNull<CFMutableCharacterSet>>;
836 }
837 let ret = unsafe { CFCharacterSetCreateMutable(alloc) };
838 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
839}
840
841#[deprecated = "renamed to `CFCharacterSet::new_copy`"]
842#[inline]
843pub unsafe extern "C-unwind" fn CFCharacterSetCreateCopy(
844 alloc: Option<&CFAllocator>,
845 the_set: Option<&CFCharacterSet>,
846) -> Option<CFRetained<CFCharacterSet>> {
847 extern "C-unwind" {
848 fn CFCharacterSetCreateCopy(
849 alloc: Option<&CFAllocator>,
850 the_set: Option<&CFCharacterSet>,
851 ) -> Option<NonNull<CFCharacterSet>>;
852 }
853 let ret = unsafe { CFCharacterSetCreateCopy(alloc, the_set) };
854 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
855}
856
857#[deprecated = "renamed to `CFMutableCharacterSet::new_copy`"]
858#[inline]
859pub unsafe extern "C-unwind" fn CFCharacterSetCreateMutableCopy(
860 alloc: Option<&CFAllocator>,
861 the_set: Option<&CFCharacterSet>,
862) -> Option<CFRetained<CFMutableCharacterSet>> {
863 extern "C-unwind" {
864 fn CFCharacterSetCreateMutableCopy(
865 alloc: Option<&CFAllocator>,
866 the_set: Option<&CFCharacterSet>,
867 ) -> Option<NonNull<CFMutableCharacterSet>>;
868 }
869 let ret = unsafe { CFCharacterSetCreateMutableCopy(alloc, the_set) };
870 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
871}
872
873#[deprecated = "renamed to `CFCharacterSet::is_character_member`"]
874#[inline]
875pub extern "C-unwind" fn CFCharacterSetIsCharacterMember(
876 the_set: &CFCharacterSet,
877 the_char: UniChar,
878) -> bool {
879 extern "C-unwind" {
880 fn CFCharacterSetIsCharacterMember(the_set: &CFCharacterSet, the_char: UniChar) -> Boolean;
881 }
882 let ret = unsafe { CFCharacterSetIsCharacterMember(the_set, the_char) };
883 ret != 0
884}
885
886#[deprecated = "renamed to `CFCharacterSet::is_long_character_member`"]
887#[inline]
888pub extern "C-unwind" fn CFCharacterSetIsLongCharacterMember(
889 the_set: &CFCharacterSet,
890 the_char: UTF32Char,
891) -> bool {
892 extern "C-unwind" {
893 fn CFCharacterSetIsLongCharacterMember(
894 the_set: &CFCharacterSet,
895 the_char: UTF32Char,
896 ) -> Boolean;
897 }
898 let ret = unsafe { CFCharacterSetIsLongCharacterMember(the_set, the_char) };
899 ret != 0
900}
901
902#[cfg(feature = "CFData")]
903#[deprecated = "renamed to `CFCharacterSet::new_bitmap_representation`"]
904#[inline]
905pub unsafe extern "C-unwind" fn CFCharacterSetCreateBitmapRepresentation(
906 alloc: Option<&CFAllocator>,
907 the_set: Option<&CFCharacterSet>,
908) -> Option<CFRetained<CFData>> {
909 extern "C-unwind" {
910 fn CFCharacterSetCreateBitmapRepresentation(
911 alloc: Option<&CFAllocator>,
912 the_set: Option<&CFCharacterSet>,
913 ) -> Option<NonNull<CFData>>;
914 }
915 let ret = unsafe { CFCharacterSetCreateBitmapRepresentation(alloc, the_set) };
916 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
917}
918
919extern "C-unwind" {
920 #[deprecated = "renamed to `CFMutableCharacterSet::add_characters_in_range`"]
921 pub fn CFCharacterSetAddCharactersInRange(
922 the_set: Option<&CFMutableCharacterSet>,
923 the_range: CFRange,
924 );
925}
926
927extern "C-unwind" {
928 #[deprecated = "renamed to `CFMutableCharacterSet::remove_characters_in_range`"]
929 pub fn CFCharacterSetRemoveCharactersInRange(
930 the_set: Option<&CFMutableCharacterSet>,
931 the_range: CFRange,
932 );
933}
934
935extern "C-unwind" {
936 #[deprecated = "renamed to `CFMutableCharacterSet::add_characters_in_string`"]
937 pub fn CFCharacterSetAddCharactersInString(
938 the_set: Option<&CFMutableCharacterSet>,
939 the_string: Option<&CFString>,
940 );
941}
942
943extern "C-unwind" {
944 #[deprecated = "renamed to `CFMutableCharacterSet::remove_characters_in_string`"]
945 pub fn CFCharacterSetRemoveCharactersInString(
946 the_set: Option<&CFMutableCharacterSet>,
947 the_string: Option<&CFString>,
948 );
949}
950
951extern "C-unwind" {
952 #[deprecated = "renamed to `CFMutableCharacterSet::union`"]
953 pub fn CFCharacterSetUnion(
954 the_set: Option<&CFMutableCharacterSet>,
955 the_other_set: Option<&CFCharacterSet>,
956 );
957}
958
959extern "C-unwind" {
960 #[deprecated = "renamed to `CFMutableCharacterSet::intersect`"]
961 pub fn CFCharacterSetIntersect(
962 the_set: Option<&CFMutableCharacterSet>,
963 the_other_set: Option<&CFCharacterSet>,
964 );
965}
966
967extern "C-unwind" {
968 #[deprecated = "renamed to `CFMutableCharacterSet::invert`"]
969 pub fn CFCharacterSetInvert(the_set: Option<&CFMutableCharacterSet>);
970}