objc2_system_configuration/generated/
SCPreferencesPath.rs1use core::ptr::NonNull;
4use objc2_core_foundation::*;
5
6use crate::*;
7
8#[cfg(feature = "SCPreferences")]
18#[inline]
19pub unsafe extern "C-unwind" fn SCPreferencesPathCreateUniqueChild(
20 prefs: &SCPreferences,
21 prefix: &CFString,
22) -> Option<CFRetained<CFString>> {
23 extern "C-unwind" {
24 fn SCPreferencesPathCreateUniqueChild(
25 prefs: &SCPreferences,
26 prefix: &CFString,
27 ) -> Option<NonNull<CFString>>;
28 }
29 let ret = unsafe { SCPreferencesPathCreateUniqueChild(prefs, prefix) };
30 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
31}
32
33#[cfg(feature = "SCPreferences")]
43#[inline]
44pub unsafe extern "C-unwind" fn SCPreferencesPathGetValue(
45 prefs: &SCPreferences,
46 path: &CFString,
47) -> Option<CFRetained<CFDictionary>> {
48 extern "C-unwind" {
49 fn SCPreferencesPathGetValue(
50 prefs: &SCPreferences,
51 path: &CFString,
52 ) -> Option<NonNull<CFDictionary>>;
53 }
54 let ret = unsafe { SCPreferencesPathGetValue(prefs, path) };
55 ret.map(|ret| unsafe { CFRetained::retain(ret) })
56}
57
58#[cfg(feature = "SCPreferences")]
68#[inline]
69pub unsafe extern "C-unwind" fn SCPreferencesPathGetLink(
70 prefs: &SCPreferences,
71 path: &CFString,
72) -> Option<CFRetained<CFString>> {
73 extern "C-unwind" {
74 fn SCPreferencesPathGetLink(
75 prefs: &SCPreferences,
76 path: &CFString,
77 ) -> Option<NonNull<CFString>>;
78 }
79 let ret = unsafe { SCPreferencesPathGetLink(prefs, path) };
80 ret.map(|ret| unsafe { CFRetained::retain(ret) })
81}
82
83#[cfg(feature = "SCPreferences")]
94#[inline]
95pub unsafe extern "C-unwind" fn SCPreferencesPathSetValue(
96 prefs: &SCPreferences,
97 path: &CFString,
98 value: &CFDictionary,
99) -> bool {
100 extern "C-unwind" {
101 fn SCPreferencesPathSetValue(
102 prefs: &SCPreferences,
103 path: &CFString,
104 value: &CFDictionary,
105 ) -> Boolean;
106 }
107 let ret = unsafe { SCPreferencesPathSetValue(prefs, path, value) };
108 ret != 0
109}
110
111#[cfg(feature = "SCPreferences")]
123#[inline]
124pub unsafe extern "C-unwind" fn SCPreferencesPathSetLink(
125 prefs: &SCPreferences,
126 path: &CFString,
127 link: &CFString,
128) -> bool {
129 extern "C-unwind" {
130 fn SCPreferencesPathSetLink(
131 prefs: &SCPreferences,
132 path: &CFString,
133 link: &CFString,
134 ) -> Boolean;
135 }
136 let ret = unsafe { SCPreferencesPathSetLink(prefs, path, link) };
137 ret != 0
138}
139
140#[cfg(feature = "SCPreferences")]
148#[inline]
149pub unsafe extern "C-unwind" fn SCPreferencesPathRemoveValue(
150 prefs: &SCPreferences,
151 path: &CFString,
152) -> bool {
153 extern "C-unwind" {
154 fn SCPreferencesPathRemoveValue(prefs: &SCPreferences, path: &CFString) -> Boolean;
155 }
156 let ret = unsafe { SCPreferencesPathRemoveValue(prefs, path) };
157 ret != 0
158}