1use core::ptr::NonNull;
4#[cfg(feature = "objc2-core-foundation")]
5use objc2_core_foundation::*;
6
7use crate::*;
8
9#[cfg(feature = "objc2-core-foundation")]
10unsafe impl ConcreteType for ODNodeRef {
11 #[doc(alias = "ODNodeGetTypeID")]
17 #[inline]
18 fn type_id() -> CFTypeID {
19 extern "C-unwind" {
20 fn ODNodeGetTypeID() -> CFTypeID;
21 }
22 unsafe { ODNodeGetTypeID() }
23 }
24}
25
26impl ODNodeRef {
27 #[doc(alias = "ODNodeCreateWithNodeType")]
48 #[cfg(all(
49 feature = "CFOpenDirectoryConstants",
50 feature = "objc2-core-foundation"
51 ))]
52 #[inline]
53 pub unsafe fn with_node_type(
54 allocator: Option<&CFAllocator>,
55 session: Option<&ODSessionRef>,
56 node_type: ODNodeType,
57 error: *mut *mut CFError,
58 ) -> Option<CFRetained<ODNodeRef>> {
59 extern "C-unwind" {
60 fn ODNodeCreateWithNodeType(
61 allocator: Option<&CFAllocator>,
62 session: Option<&ODSessionRef>,
63 node_type: ODNodeType,
64 error: *mut *mut CFError,
65 ) -> Option<NonNull<ODNodeRef>>;
66 }
67 let ret = unsafe { ODNodeCreateWithNodeType(allocator, session, node_type, error) };
68 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
69 }
70
71 #[doc(alias = "ODNodeCreateWithName")]
93 #[cfg(feature = "objc2-core-foundation")]
94 #[inline]
95 pub unsafe fn with_name(
96 allocator: Option<&CFAllocator>,
97 session: Option<&ODSessionRef>,
98 node_name: Option<&CFString>,
99 error: *mut *mut CFError,
100 ) -> Option<CFRetained<ODNodeRef>> {
101 extern "C-unwind" {
102 fn ODNodeCreateWithName(
103 allocator: Option<&CFAllocator>,
104 session: Option<&ODSessionRef>,
105 node_name: Option<&CFString>,
106 error: *mut *mut CFError,
107 ) -> Option<NonNull<ODNodeRef>>;
108 }
109 let ret = unsafe { ODNodeCreateWithName(allocator, session, node_name, error) };
110 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
111 }
112
113 #[doc(alias = "ODNodeCreateCopy")]
132 #[cfg(feature = "objc2-core-foundation")]
133 #[inline]
134 pub unsafe fn new_copy(
135 allocator: Option<&CFAllocator>,
136 node: Option<&ODNodeRef>,
137 error: *mut *mut CFError,
138 ) -> Option<CFRetained<ODNodeRef>> {
139 extern "C-unwind" {
140 fn ODNodeCreateCopy(
141 allocator: Option<&CFAllocator>,
142 node: Option<&ODNodeRef>,
143 error: *mut *mut CFError,
144 ) -> Option<NonNull<ODNodeRef>>;
145 }
146 let ret = unsafe { ODNodeCreateCopy(allocator, node, error) };
147 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
148 }
149
150 #[doc(alias = "ODNodeCopySubnodeNames")]
165 #[cfg(feature = "objc2-core-foundation")]
166 #[inline]
167 pub unsafe fn subnode_names(&self, error: *mut *mut CFError) -> Option<CFRetained<CFArray>> {
168 extern "C-unwind" {
169 fn ODNodeCopySubnodeNames(
170 node: &ODNodeRef,
171 error: *mut *mut CFError,
172 ) -> Option<NonNull<CFArray>>;
173 }
174 let ret = unsafe { ODNodeCopySubnodeNames(self, error) };
175 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
176 }
177
178 #[doc(alias = "ODNodeCopyUnreachableSubnodeNames")]
194 #[cfg(feature = "objc2-core-foundation")]
195 #[inline]
196 pub unsafe fn unreachable_subnode_names(
197 &self,
198 error: *mut *mut CFError,
199 ) -> Option<CFRetained<CFArray>> {
200 extern "C-unwind" {
201 fn ODNodeCopyUnreachableSubnodeNames(
202 node: &ODNodeRef,
203 error: *mut *mut CFError,
204 ) -> Option<NonNull<CFArray>>;
205 }
206 let ret = unsafe { ODNodeCopyUnreachableSubnodeNames(self, error) };
207 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
208 }
209
210 #[doc(alias = "ODNodeGetName")]
218 #[cfg(feature = "objc2-core-foundation")]
219 #[inline]
220 pub unsafe fn name(&self) -> Option<CFRetained<CFString>> {
221 extern "C-unwind" {
222 fn ODNodeGetName(node: &ODNodeRef) -> Option<NonNull<CFString>>;
223 }
224 let ret = unsafe { ODNodeGetName(self) };
225 ret.map(|ret| unsafe { CFRetained::retain(ret) })
226 }
227
228 #[doc(alias = "ODNodeCopyDetails")]
247 #[cfg(feature = "objc2-core-foundation")]
248 #[inline]
249 pub unsafe fn details(
250 &self,
251 keys: Option<&CFArray>,
252 error: *mut *mut CFError,
253 ) -> Option<CFRetained<CFDictionary>> {
254 extern "C-unwind" {
255 fn ODNodeCopyDetails(
256 node: &ODNodeRef,
257 keys: Option<&CFArray>,
258 error: *mut *mut CFError,
259 ) -> Option<NonNull<CFDictionary>>;
260 }
261 let ret = unsafe { ODNodeCopyDetails(self, keys, error) };
262 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
263 }
264
265 #[doc(alias = "ODNodeCopySupportedRecordTypes")]
280 #[cfg(feature = "objc2-core-foundation")]
281 #[inline]
282 pub unsafe fn supported_record_types(
283 &self,
284 error: *mut *mut CFError,
285 ) -> Option<CFRetained<CFArray>> {
286 extern "C-unwind" {
287 fn ODNodeCopySupportedRecordTypes(
288 node: &ODNodeRef,
289 error: *mut *mut CFError,
290 ) -> Option<NonNull<CFArray>>;
291 }
292 let ret = unsafe { ODNodeCopySupportedRecordTypes(self, error) };
293 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
294 }
295
296 #[doc(alias = "ODNodeCopySupportedAttributes")]
315 #[cfg(all(
316 feature = "CFOpenDirectoryConstants",
317 feature = "objc2-core-foundation"
318 ))]
319 #[inline]
320 pub unsafe fn supported_attributes(
321 &self,
322 record_type: Option<&ODRecordType>,
323 error: *mut *mut CFError,
324 ) -> Option<CFRetained<CFArray>> {
325 extern "C-unwind" {
326 fn ODNodeCopySupportedAttributes(
327 node: &ODNodeRef,
328 record_type: Option<&ODRecordType>,
329 error: *mut *mut CFError,
330 ) -> Option<NonNull<CFArray>>;
331 }
332 let ret = unsafe { ODNodeCopySupportedAttributes(self, record_type, error) };
333 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
334 }
335
336 #[doc(alias = "ODNodeSetCredentials")]
363 #[cfg(all(
364 feature = "CFOpenDirectoryConstants",
365 feature = "objc2-core-foundation"
366 ))]
367 #[inline]
368 pub unsafe fn set_credentials(
369 &self,
370 record_type: Option<&ODRecordType>,
371 record_name: Option<&CFString>,
372 password: Option<&CFString>,
373 error: *mut *mut CFError,
374 ) -> bool {
375 extern "C-unwind" {
376 fn ODNodeSetCredentials(
377 node: &ODNodeRef,
378 record_type: Option<&ODRecordType>,
379 record_name: Option<&CFString>,
380 password: Option<&CFString>,
381 error: *mut *mut CFError,
382 ) -> bool;
383 }
384 unsafe { ODNodeSetCredentials(self, record_type, record_name, password, error) }
385 }
386
387 #[doc(alias = "ODNodeSetCredentialsExtended")]
422 #[cfg(all(
423 feature = "CFOpenDirectoryConstants",
424 feature = "objc2-core-foundation"
425 ))]
426 #[inline]
427 pub unsafe fn set_credentials_extended(
428 &self,
429 record_type: Option<&ODRecordType>,
430 auth_type: Option<&ODAuthenticationType>,
431 auth_items: Option<&CFArray>,
432 out_auth_items: *mut *const CFArray,
433 out_context: *mut *const ODContextRef,
434 error: *mut *mut CFError,
435 ) -> bool {
436 extern "C-unwind" {
437 fn ODNodeSetCredentialsExtended(
438 node: &ODNodeRef,
439 record_type: Option<&ODRecordType>,
440 auth_type: Option<&ODAuthenticationType>,
441 auth_items: Option<&CFArray>,
442 out_auth_items: *mut *const CFArray,
443 out_context: *mut *const ODContextRef,
444 error: *mut *mut CFError,
445 ) -> bool;
446 }
447 unsafe {
448 ODNodeSetCredentialsExtended(
449 self,
450 record_type,
451 auth_type,
452 auth_items,
453 out_auth_items,
454 out_context,
455 error,
456 )
457 }
458 }
459
460 #[doc(alias = "ODNodeSetCredentialsUsingKerberosCache")]
469 #[cfg(feature = "objc2-core-foundation")]
470 #[deprecated]
471 #[inline]
472 pub unsafe fn set_credentials_using_kerberos_cache(
473 &self,
474 cache_name: Option<&CFString>,
475 error: *mut *mut CFError,
476 ) -> bool {
477 extern "C-unwind" {
478 fn ODNodeSetCredentialsUsingKerberosCache(
479 node: &ODNodeRef,
480 cache_name: Option<&CFString>,
481 error: *mut *mut CFError,
482 ) -> bool;
483 }
484 unsafe { ODNodeSetCredentialsUsingKerberosCache(self, cache_name, error) }
485 }
486
487 #[doc(alias = "ODNodeCreateRecord")]
517 #[cfg(all(
518 feature = "CFOpenDirectoryConstants",
519 feature = "objc2-core-foundation"
520 ))]
521 #[inline]
522 pub unsafe fn create_record(
523 &self,
524 record_type: Option<&ODRecordType>,
525 record_name: Option<&CFString>,
526 attribute_dict: Option<&CFDictionary>,
527 error: *mut *mut CFError,
528 ) -> Option<CFRetained<ODRecordRef>> {
529 extern "C-unwind" {
530 fn ODNodeCreateRecord(
531 node: &ODNodeRef,
532 record_type: Option<&ODRecordType>,
533 record_name: Option<&CFString>,
534 attribute_dict: Option<&CFDictionary>,
535 error: *mut *mut CFError,
536 ) -> Option<NonNull<ODRecordRef>>;
537 }
538 let ret =
539 unsafe { ODNodeCreateRecord(self, record_type, record_name, attribute_dict, error) };
540 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
541 }
542
543 #[doc(alias = "ODNodeCopyRecord")]
571 #[cfg(all(
572 feature = "CFOpenDirectoryConstants",
573 feature = "objc2-core-foundation"
574 ))]
575 #[inline]
576 pub unsafe fn copy_record(
577 &self,
578 record_type: Option<&ODRecordType>,
579 record_name: Option<&CFString>,
580 attributes: Option<&CFType>,
581 error: *mut *mut CFError,
582 ) -> Option<CFRetained<ODRecordRef>> {
583 extern "C-unwind" {
584 fn ODNodeCopyRecord(
585 node: &ODNodeRef,
586 record_type: Option<&ODRecordType>,
587 record_name: Option<&CFString>,
588 attributes: Option<&CFType>,
589 error: *mut *mut CFError,
590 ) -> Option<NonNull<ODRecordRef>>;
591 }
592 let ret = unsafe { ODNodeCopyRecord(self, record_type, record_name, attributes, error) };
593 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
594 }
595
596 #[doc(alias = "ODNodeCustomCall")]
615 #[cfg(feature = "objc2-core-foundation")]
616 #[inline]
617 pub unsafe fn custom_call(
618 &self,
619 custom_code: CFIndex,
620 data: Option<&CFData>,
621 error: *mut *mut CFError,
622 ) -> Option<CFRetained<CFData>> {
623 extern "C-unwind" {
624 fn ODNodeCustomCall(
625 node: &ODNodeRef,
626 custom_code: CFIndex,
627 data: Option<&CFData>,
628 error: *mut *mut CFError,
629 ) -> Option<NonNull<CFData>>;
630 }
631 let ret = unsafe { ODNodeCustomCall(self, custom_code, data, error) };
632 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
633 }
634
635 #[doc(alias = "ODNodeCustomFunction")]
663 #[cfg(feature = "objc2-core-foundation")]
664 #[inline]
665 pub unsafe fn custom_function(
666 &self,
667 function: Option<&CFString>,
668 payload: Option<&CFType>,
669 error: *mut *mut CFError,
670 ) -> Option<CFRetained<CFType>> {
671 extern "C-unwind" {
672 fn ODNodeCustomFunction(
673 node: &ODNodeRef,
674 function: Option<&CFString>,
675 payload: Option<&CFType>,
676 error: *mut *mut CFError,
677 ) -> Option<NonNull<CFType>>;
678 }
679 let ret = unsafe { ODNodeCustomFunction(self, function, payload, error) };
680 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
681 }
682
683 #[doc(alias = "ODNodeCopyPolicies")]
697 #[cfg(feature = "objc2-core-foundation")]
698 #[deprecated = "use ODNodeCopyAccountPolicies"]
699 #[inline]
700 pub unsafe fn policies(&self, error: *mut *mut CFError) -> Option<CFRetained<CFDictionary>> {
701 extern "C-unwind" {
702 fn ODNodeCopyPolicies(
703 node: &ODNodeRef,
704 error: *mut *mut CFError,
705 ) -> Option<NonNull<CFDictionary>>;
706 }
707 let ret = unsafe { ODNodeCopyPolicies(self, error) };
708 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
709 }
710
711 #[doc(alias = "ODNodeCopySupportedPolicies")]
727 #[cfg(feature = "objc2-core-foundation")]
728 #[deprecated]
729 #[inline]
730 pub unsafe fn supported_policies(
731 &self,
732 error: *mut *mut CFError,
733 ) -> Option<CFRetained<CFDictionary>> {
734 extern "C-unwind" {
735 fn ODNodeCopySupportedPolicies(
736 node: &ODNodeRef,
737 error: *mut *mut CFError,
738 ) -> Option<NonNull<CFDictionary>>;
739 }
740 let ret = unsafe { ODNodeCopySupportedPolicies(self, error) };
741 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
742 }
743
744 #[doc(alias = "ODNodeSetPolicies")]
762 #[cfg(feature = "objc2-core-foundation")]
763 #[deprecated = "use ODNodeSetAccountPolicies"]
764 #[inline]
765 pub unsafe fn set_policies(
766 &self,
767 policies: Option<&CFDictionary>,
768 error: *mut *mut CFError,
769 ) -> bool {
770 extern "C-unwind" {
771 fn ODNodeSetPolicies(
772 node: &ODNodeRef,
773 policies: Option<&CFDictionary>,
774 error: *mut *mut CFError,
775 ) -> bool;
776 }
777 unsafe { ODNodeSetPolicies(self, policies, error) }
778 }
779
780 #[doc(alias = "ODNodeSetPolicy")]
801 #[cfg(all(
802 feature = "CFOpenDirectoryConstants",
803 feature = "objc2-core-foundation"
804 ))]
805 #[deprecated = "use ODNodeAddAccountPolicy"]
806 #[inline]
807 pub unsafe fn set_policy(
808 &self,
809 policy_type: Option<&ODPolicyType>,
810 value: Option<&CFType>,
811 error: *mut *mut CFError,
812 ) -> bool {
813 extern "C-unwind" {
814 fn ODNodeSetPolicy(
815 node: &ODNodeRef,
816 policy_type: Option<&ODPolicyType>,
817 value: Option<&CFType>,
818 error: *mut *mut CFError,
819 ) -> bool;
820 }
821 unsafe { ODNodeSetPolicy(self, policy_type, value, error) }
822 }
823
824 #[doc(alias = "ODNodeRemovePolicy")]
841 #[cfg(all(
842 feature = "CFOpenDirectoryConstants",
843 feature = "objc2-core-foundation"
844 ))]
845 #[deprecated = "use ODNodeRemoveAccountPolicy"]
846 #[inline]
847 pub unsafe fn remove_policy(
848 &self,
849 policy_type: Option<&ODPolicyType>,
850 error: *mut *mut CFError,
851 ) -> bool {
852 extern "C-unwind" {
853 fn ODNodeRemovePolicy(
854 node: &ODNodeRef,
855 policy_type: Option<&ODPolicyType>,
856 error: *mut *mut CFError,
857 ) -> bool;
858 }
859 unsafe { ODNodeRemovePolicy(self, policy_type, error) }
860 }
861
862 #[doc(alias = "ODNodeAddAccountPolicy")]
893 #[cfg(all(
894 feature = "CFOpenDirectoryConstants",
895 feature = "objc2-core-foundation"
896 ))]
897 #[inline]
898 pub unsafe fn add_account_policy(
899 &self,
900 policy: Option<&CFDictionary>,
901 category: Option<&ODPolicyCategoryType>,
902 error: *mut *mut CFError,
903 ) -> bool {
904 extern "C-unwind" {
905 fn ODNodeAddAccountPolicy(
906 node: &ODNodeRef,
907 policy: Option<&CFDictionary>,
908 category: Option<&ODPolicyCategoryType>,
909 error: *mut *mut CFError,
910 ) -> bool;
911 }
912 unsafe { ODNodeAddAccountPolicy(self, policy, category, error) }
913 }
914
915 #[doc(alias = "ODNodeRemoveAccountPolicy")]
937 #[cfg(all(
938 feature = "CFOpenDirectoryConstants",
939 feature = "objc2-core-foundation"
940 ))]
941 #[inline]
942 pub unsafe fn remove_account_policy(
943 &self,
944 policy: Option<&CFDictionary>,
945 category: Option<&ODPolicyCategoryType>,
946 error: *mut *mut CFError,
947 ) -> bool {
948 extern "C-unwind" {
949 fn ODNodeRemoveAccountPolicy(
950 node: &ODNodeRef,
951 policy: Option<&CFDictionary>,
952 category: Option<&ODPolicyCategoryType>,
953 error: *mut *mut CFError,
954 ) -> bool;
955 }
956 unsafe { ODNodeRemoveAccountPolicy(self, policy, category, error) }
957 }
958
959 #[doc(alias = "ODNodeSetAccountPolicies")]
988 #[cfg(feature = "objc2-core-foundation")]
989 #[inline]
990 pub unsafe fn set_account_policies(
991 &self,
992 policies: Option<&CFDictionary>,
993 error: *mut *mut CFError,
994 ) -> bool {
995 extern "C-unwind" {
996 fn ODNodeSetAccountPolicies(
997 node: &ODNodeRef,
998 policies: Option<&CFDictionary>,
999 error: *mut *mut CFError,
1000 ) -> bool;
1001 }
1002 unsafe { ODNodeSetAccountPolicies(self, policies, error) }
1003 }
1004
1005 #[doc(alias = "ODNodeCopyAccountPolicies")]
1021 #[cfg(feature = "objc2-core-foundation")]
1022 #[inline]
1023 pub unsafe fn account_policies(
1024 &self,
1025 error: *mut *mut CFError,
1026 ) -> Option<CFRetained<CFDictionary>> {
1027 extern "C-unwind" {
1028 fn ODNodeCopyAccountPolicies(
1029 node: &ODNodeRef,
1030 error: *mut *mut CFError,
1031 ) -> Option<NonNull<CFDictionary>>;
1032 }
1033 let ret = unsafe { ODNodeCopyAccountPolicies(self, error) };
1034 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1035 }
1036
1037 #[doc(alias = "ODNodePasswordContentCheck")]
1066 #[cfg(feature = "objc2-core-foundation")]
1067 #[inline]
1068 pub unsafe fn password_content_check(
1069 &self,
1070 password: Option<&CFString>,
1071 record_name: Option<&CFString>,
1072 error: *mut *mut CFError,
1073 ) -> bool {
1074 extern "C-unwind" {
1075 fn ODNodePasswordContentCheck(
1076 node: &ODNodeRef,
1077 password: Option<&CFString>,
1078 record_name: Option<&CFString>,
1079 error: *mut *mut CFError,
1080 ) -> bool;
1081 }
1082 unsafe { ODNodePasswordContentCheck(self, password, record_name, error) }
1083 }
1084}
1085
1086#[cfg(all(
1087 feature = "CFOpenDirectoryConstants",
1088 feature = "objc2-core-foundation"
1089))]
1090#[deprecated = "renamed to `ODNodeRef::with_node_type`"]
1091#[inline]
1092pub unsafe extern "C-unwind" fn ODNodeCreateWithNodeType(
1093 allocator: Option<&CFAllocator>,
1094 session: Option<&ODSessionRef>,
1095 node_type: ODNodeType,
1096 error: *mut *mut CFError,
1097) -> Option<CFRetained<ODNodeRef>> {
1098 extern "C-unwind" {
1099 fn ODNodeCreateWithNodeType(
1100 allocator: Option<&CFAllocator>,
1101 session: Option<&ODSessionRef>,
1102 node_type: ODNodeType,
1103 error: *mut *mut CFError,
1104 ) -> Option<NonNull<ODNodeRef>>;
1105 }
1106 let ret = unsafe { ODNodeCreateWithNodeType(allocator, session, node_type, error) };
1107 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1108}
1109
1110#[cfg(feature = "objc2-core-foundation")]
1111#[deprecated = "renamed to `ODNodeRef::with_name`"]
1112#[inline]
1113pub unsafe extern "C-unwind" fn ODNodeCreateWithName(
1114 allocator: Option<&CFAllocator>,
1115 session: Option<&ODSessionRef>,
1116 node_name: Option<&CFString>,
1117 error: *mut *mut CFError,
1118) -> Option<CFRetained<ODNodeRef>> {
1119 extern "C-unwind" {
1120 fn ODNodeCreateWithName(
1121 allocator: Option<&CFAllocator>,
1122 session: Option<&ODSessionRef>,
1123 node_name: Option<&CFString>,
1124 error: *mut *mut CFError,
1125 ) -> Option<NonNull<ODNodeRef>>;
1126 }
1127 let ret = unsafe { ODNodeCreateWithName(allocator, session, node_name, error) };
1128 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1129}
1130
1131#[cfg(feature = "objc2-core-foundation")]
1132#[deprecated = "renamed to `ODNodeRef::new_copy`"]
1133#[inline]
1134pub unsafe extern "C-unwind" fn ODNodeCreateCopy(
1135 allocator: Option<&CFAllocator>,
1136 node: Option<&ODNodeRef>,
1137 error: *mut *mut CFError,
1138) -> Option<CFRetained<ODNodeRef>> {
1139 extern "C-unwind" {
1140 fn ODNodeCreateCopy(
1141 allocator: Option<&CFAllocator>,
1142 node: Option<&ODNodeRef>,
1143 error: *mut *mut CFError,
1144 ) -> Option<NonNull<ODNodeRef>>;
1145 }
1146 let ret = unsafe { ODNodeCreateCopy(allocator, node, error) };
1147 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1148}
1149
1150#[cfg(feature = "objc2-core-foundation")]
1151#[deprecated = "renamed to `ODNodeRef::subnode_names`"]
1152#[inline]
1153pub unsafe extern "C-unwind" fn ODNodeCopySubnodeNames(
1154 node: &ODNodeRef,
1155 error: *mut *mut CFError,
1156) -> Option<CFRetained<CFArray>> {
1157 extern "C-unwind" {
1158 fn ODNodeCopySubnodeNames(
1159 node: &ODNodeRef,
1160 error: *mut *mut CFError,
1161 ) -> Option<NonNull<CFArray>>;
1162 }
1163 let ret = unsafe { ODNodeCopySubnodeNames(node, error) };
1164 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1165}
1166
1167#[cfg(feature = "objc2-core-foundation")]
1168#[deprecated = "renamed to `ODNodeRef::unreachable_subnode_names`"]
1169#[inline]
1170pub unsafe extern "C-unwind" fn ODNodeCopyUnreachableSubnodeNames(
1171 node: &ODNodeRef,
1172 error: *mut *mut CFError,
1173) -> Option<CFRetained<CFArray>> {
1174 extern "C-unwind" {
1175 fn ODNodeCopyUnreachableSubnodeNames(
1176 node: &ODNodeRef,
1177 error: *mut *mut CFError,
1178 ) -> Option<NonNull<CFArray>>;
1179 }
1180 let ret = unsafe { ODNodeCopyUnreachableSubnodeNames(node, error) };
1181 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1182}
1183
1184#[cfg(feature = "objc2-core-foundation")]
1185#[deprecated = "renamed to `ODNodeRef::name`"]
1186#[inline]
1187pub unsafe extern "C-unwind" fn ODNodeGetName(node: &ODNodeRef) -> Option<CFRetained<CFString>> {
1188 extern "C-unwind" {
1189 fn ODNodeGetName(node: &ODNodeRef) -> Option<NonNull<CFString>>;
1190 }
1191 let ret = unsafe { ODNodeGetName(node) };
1192 ret.map(|ret| unsafe { CFRetained::retain(ret) })
1193}
1194
1195#[cfg(feature = "objc2-core-foundation")]
1196#[deprecated = "renamed to `ODNodeRef::details`"]
1197#[inline]
1198pub unsafe extern "C-unwind" fn ODNodeCopyDetails(
1199 node: &ODNodeRef,
1200 keys: Option<&CFArray>,
1201 error: *mut *mut CFError,
1202) -> Option<CFRetained<CFDictionary>> {
1203 extern "C-unwind" {
1204 fn ODNodeCopyDetails(
1205 node: &ODNodeRef,
1206 keys: Option<&CFArray>,
1207 error: *mut *mut CFError,
1208 ) -> Option<NonNull<CFDictionary>>;
1209 }
1210 let ret = unsafe { ODNodeCopyDetails(node, keys, error) };
1211 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1212}
1213
1214#[cfg(feature = "objc2-core-foundation")]
1215#[deprecated = "renamed to `ODNodeRef::supported_record_types`"]
1216#[inline]
1217pub unsafe extern "C-unwind" fn ODNodeCopySupportedRecordTypes(
1218 node: &ODNodeRef,
1219 error: *mut *mut CFError,
1220) -> Option<CFRetained<CFArray>> {
1221 extern "C-unwind" {
1222 fn ODNodeCopySupportedRecordTypes(
1223 node: &ODNodeRef,
1224 error: *mut *mut CFError,
1225 ) -> Option<NonNull<CFArray>>;
1226 }
1227 let ret = unsafe { ODNodeCopySupportedRecordTypes(node, error) };
1228 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1229}
1230
1231#[cfg(all(
1232 feature = "CFOpenDirectoryConstants",
1233 feature = "objc2-core-foundation"
1234))]
1235#[deprecated = "renamed to `ODNodeRef::supported_attributes`"]
1236#[inline]
1237pub unsafe extern "C-unwind" fn ODNodeCopySupportedAttributes(
1238 node: &ODNodeRef,
1239 record_type: Option<&ODRecordType>,
1240 error: *mut *mut CFError,
1241) -> Option<CFRetained<CFArray>> {
1242 extern "C-unwind" {
1243 fn ODNodeCopySupportedAttributes(
1244 node: &ODNodeRef,
1245 record_type: Option<&ODRecordType>,
1246 error: *mut *mut CFError,
1247 ) -> Option<NonNull<CFArray>>;
1248 }
1249 let ret = unsafe { ODNodeCopySupportedAttributes(node, record_type, error) };
1250 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1251}
1252
1253extern "C-unwind" {
1254 #[cfg(all(
1255 feature = "CFOpenDirectoryConstants",
1256 feature = "objc2-core-foundation"
1257 ))]
1258 #[deprecated = "renamed to `ODNodeRef::set_credentials`"]
1259 pub fn ODNodeSetCredentials(
1260 node: &ODNodeRef,
1261 record_type: Option<&ODRecordType>,
1262 record_name: Option<&CFString>,
1263 password: Option<&CFString>,
1264 error: *mut *mut CFError,
1265 ) -> bool;
1266}
1267
1268extern "C-unwind" {
1269 #[cfg(all(
1270 feature = "CFOpenDirectoryConstants",
1271 feature = "objc2-core-foundation"
1272 ))]
1273 #[deprecated = "renamed to `ODNodeRef::set_credentials_extended`"]
1274 pub fn ODNodeSetCredentialsExtended(
1275 node: &ODNodeRef,
1276 record_type: Option<&ODRecordType>,
1277 auth_type: Option<&ODAuthenticationType>,
1278 auth_items: Option<&CFArray>,
1279 out_auth_items: *mut *const CFArray,
1280 out_context: *mut *const ODContextRef,
1281 error: *mut *mut CFError,
1282 ) -> bool;
1283}
1284
1285extern "C-unwind" {
1286 #[cfg(feature = "objc2-core-foundation")]
1287 #[deprecated = "renamed to `ODNodeRef::set_credentials_using_kerberos_cache`"]
1288 pub fn ODNodeSetCredentialsUsingKerberosCache(
1289 node: &ODNodeRef,
1290 cache_name: Option<&CFString>,
1291 error: *mut *mut CFError,
1292 ) -> bool;
1293}
1294
1295#[cfg(all(
1296 feature = "CFOpenDirectoryConstants",
1297 feature = "objc2-core-foundation"
1298))]
1299#[deprecated = "renamed to `ODNodeRef::create_record`"]
1300#[inline]
1301pub unsafe extern "C-unwind" fn ODNodeCreateRecord(
1302 node: &ODNodeRef,
1303 record_type: Option<&ODRecordType>,
1304 record_name: Option<&CFString>,
1305 attribute_dict: Option<&CFDictionary>,
1306 error: *mut *mut CFError,
1307) -> Option<CFRetained<ODRecordRef>> {
1308 extern "C-unwind" {
1309 fn ODNodeCreateRecord(
1310 node: &ODNodeRef,
1311 record_type: Option<&ODRecordType>,
1312 record_name: Option<&CFString>,
1313 attribute_dict: Option<&CFDictionary>,
1314 error: *mut *mut CFError,
1315 ) -> Option<NonNull<ODRecordRef>>;
1316 }
1317 let ret = unsafe { ODNodeCreateRecord(node, record_type, record_name, attribute_dict, error) };
1318 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1319}
1320
1321#[cfg(all(
1322 feature = "CFOpenDirectoryConstants",
1323 feature = "objc2-core-foundation"
1324))]
1325#[deprecated = "renamed to `ODNodeRef::copy_record`"]
1326#[inline]
1327pub unsafe extern "C-unwind" fn ODNodeCopyRecord(
1328 node: &ODNodeRef,
1329 record_type: Option<&ODRecordType>,
1330 record_name: Option<&CFString>,
1331 attributes: Option<&CFType>,
1332 error: *mut *mut CFError,
1333) -> Option<CFRetained<ODRecordRef>> {
1334 extern "C-unwind" {
1335 fn ODNodeCopyRecord(
1336 node: &ODNodeRef,
1337 record_type: Option<&ODRecordType>,
1338 record_name: Option<&CFString>,
1339 attributes: Option<&CFType>,
1340 error: *mut *mut CFError,
1341 ) -> Option<NonNull<ODRecordRef>>;
1342 }
1343 let ret = unsafe { ODNodeCopyRecord(node, record_type, record_name, attributes, error) };
1344 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1345}
1346
1347#[cfg(feature = "objc2-core-foundation")]
1348#[deprecated = "renamed to `ODNodeRef::custom_call`"]
1349#[inline]
1350pub unsafe extern "C-unwind" fn ODNodeCustomCall(
1351 node: &ODNodeRef,
1352 custom_code: CFIndex,
1353 data: Option<&CFData>,
1354 error: *mut *mut CFError,
1355) -> Option<CFRetained<CFData>> {
1356 extern "C-unwind" {
1357 fn ODNodeCustomCall(
1358 node: &ODNodeRef,
1359 custom_code: CFIndex,
1360 data: Option<&CFData>,
1361 error: *mut *mut CFError,
1362 ) -> Option<NonNull<CFData>>;
1363 }
1364 let ret = unsafe { ODNodeCustomCall(node, custom_code, data, error) };
1365 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1366}
1367
1368#[cfg(feature = "objc2-core-foundation")]
1369#[deprecated = "renamed to `ODNodeRef::custom_function`"]
1370#[inline]
1371pub unsafe extern "C-unwind" fn ODNodeCustomFunction(
1372 node: &ODNodeRef,
1373 function: Option<&CFString>,
1374 payload: Option<&CFType>,
1375 error: *mut *mut CFError,
1376) -> Option<CFRetained<CFType>> {
1377 extern "C-unwind" {
1378 fn ODNodeCustomFunction(
1379 node: &ODNodeRef,
1380 function: Option<&CFString>,
1381 payload: Option<&CFType>,
1382 error: *mut *mut CFError,
1383 ) -> Option<NonNull<CFType>>;
1384 }
1385 let ret = unsafe { ODNodeCustomFunction(node, function, payload, error) };
1386 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1387}
1388
1389#[cfg(feature = "objc2-core-foundation")]
1390#[deprecated = "renamed to `ODNodeRef::policies`"]
1391#[inline]
1392pub unsafe extern "C-unwind" fn ODNodeCopyPolicies(
1393 node: &ODNodeRef,
1394 error: *mut *mut CFError,
1395) -> Option<CFRetained<CFDictionary>> {
1396 extern "C-unwind" {
1397 fn ODNodeCopyPolicies(
1398 node: &ODNodeRef,
1399 error: *mut *mut CFError,
1400 ) -> Option<NonNull<CFDictionary>>;
1401 }
1402 let ret = unsafe { ODNodeCopyPolicies(node, error) };
1403 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1404}
1405
1406#[cfg(feature = "objc2-core-foundation")]
1407#[deprecated = "renamed to `ODNodeRef::supported_policies`"]
1408#[inline]
1409pub unsafe extern "C-unwind" fn ODNodeCopySupportedPolicies(
1410 node: &ODNodeRef,
1411 error: *mut *mut CFError,
1412) -> Option<CFRetained<CFDictionary>> {
1413 extern "C-unwind" {
1414 fn ODNodeCopySupportedPolicies(
1415 node: &ODNodeRef,
1416 error: *mut *mut CFError,
1417 ) -> Option<NonNull<CFDictionary>>;
1418 }
1419 let ret = unsafe { ODNodeCopySupportedPolicies(node, error) };
1420 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1421}
1422
1423extern "C-unwind" {
1424 #[cfg(feature = "objc2-core-foundation")]
1425 #[deprecated = "renamed to `ODNodeRef::set_policies`"]
1426 pub fn ODNodeSetPolicies(
1427 node: &ODNodeRef,
1428 policies: Option<&CFDictionary>,
1429 error: *mut *mut CFError,
1430 ) -> bool;
1431}
1432
1433extern "C-unwind" {
1434 #[cfg(all(
1435 feature = "CFOpenDirectoryConstants",
1436 feature = "objc2-core-foundation"
1437 ))]
1438 #[deprecated = "renamed to `ODNodeRef::set_policy`"]
1439 pub fn ODNodeSetPolicy(
1440 node: &ODNodeRef,
1441 policy_type: Option<&ODPolicyType>,
1442 value: Option<&CFType>,
1443 error: *mut *mut CFError,
1444 ) -> bool;
1445}
1446
1447extern "C-unwind" {
1448 #[cfg(all(
1449 feature = "CFOpenDirectoryConstants",
1450 feature = "objc2-core-foundation"
1451 ))]
1452 #[deprecated = "renamed to `ODNodeRef::remove_policy`"]
1453 pub fn ODNodeRemovePolicy(
1454 node: &ODNodeRef,
1455 policy_type: Option<&ODPolicyType>,
1456 error: *mut *mut CFError,
1457 ) -> bool;
1458}
1459
1460extern "C-unwind" {
1461 #[cfg(all(
1462 feature = "CFOpenDirectoryConstants",
1463 feature = "objc2-core-foundation"
1464 ))]
1465 #[deprecated = "renamed to `ODNodeRef::add_account_policy`"]
1466 pub fn ODNodeAddAccountPolicy(
1467 node: &ODNodeRef,
1468 policy: Option<&CFDictionary>,
1469 category: Option<&ODPolicyCategoryType>,
1470 error: *mut *mut CFError,
1471 ) -> bool;
1472}
1473
1474extern "C-unwind" {
1475 #[cfg(all(
1476 feature = "CFOpenDirectoryConstants",
1477 feature = "objc2-core-foundation"
1478 ))]
1479 #[deprecated = "renamed to `ODNodeRef::remove_account_policy`"]
1480 pub fn ODNodeRemoveAccountPolicy(
1481 node: &ODNodeRef,
1482 policy: Option<&CFDictionary>,
1483 category: Option<&ODPolicyCategoryType>,
1484 error: *mut *mut CFError,
1485 ) -> bool;
1486}
1487
1488extern "C-unwind" {
1489 #[cfg(feature = "objc2-core-foundation")]
1490 #[deprecated = "renamed to `ODNodeRef::set_account_policies`"]
1491 pub fn ODNodeSetAccountPolicies(
1492 node: &ODNodeRef,
1493 policies: Option<&CFDictionary>,
1494 error: *mut *mut CFError,
1495 ) -> bool;
1496}
1497
1498#[cfg(feature = "objc2-core-foundation")]
1499#[deprecated = "renamed to `ODNodeRef::account_policies`"]
1500#[inline]
1501pub unsafe extern "C-unwind" fn ODNodeCopyAccountPolicies(
1502 node: &ODNodeRef,
1503 error: *mut *mut CFError,
1504) -> Option<CFRetained<CFDictionary>> {
1505 extern "C-unwind" {
1506 fn ODNodeCopyAccountPolicies(
1507 node: &ODNodeRef,
1508 error: *mut *mut CFError,
1509 ) -> Option<NonNull<CFDictionary>>;
1510 }
1511 let ret = unsafe { ODNodeCopyAccountPolicies(node, error) };
1512 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
1513}
1514
1515extern "C-unwind" {
1516 #[cfg(feature = "objc2-core-foundation")]
1517 #[deprecated = "renamed to `ODNodeRef::password_content_check`"]
1518 pub fn ODNodePasswordContentCheck(
1519 node: &ODNodeRef,
1520 password: Option<&CFString>,
1521 record_name: Option<&CFString>,
1522 error: *mut *mut CFError,
1523 ) -> bool;
1524}