objc2_system_configuration/generated/
SCDynamicStoreKey.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ptr::NonNull;
4use objc2_core_foundation::*;
5
6use crate::*;
7
8/// Creates a dynamic store key that can be used to access
9/// a specific global (as opposed to a per-service or per-interface)
10/// network configuration entity.
11///
12/// Parameter `allocator`: The CFAllocator that should be used to allocate
13/// memory for this key.
14/// This parameter may be NULL in which case the current
15/// default CFAllocator is used. If this reference is not
16/// a valid CFAllocator, the behavior is undefined.
17///
18/// Parameter `domain`: A string specifying the desired domain, such as the
19/// requested configuration (kSCDynamicStoreDomainSetup) or the
20/// actual state (kSCDynamicStoreDomainState).
21///
22/// Parameter `entity`: A string containing the specific global entity, such
23/// as IPv4 (kSCEntNetIPv4) or DNS (kSCEntNetDNS).
24///
25/// Returns: Returns a string containing the formatted key.
26#[inline]
27pub unsafe extern "C-unwind" fn SCDynamicStoreKeyCreateNetworkGlobalEntity(
28    allocator: Option<&CFAllocator>,
29    domain: &CFString,
30    entity: &CFString,
31) -> CFRetained<CFString> {
32    extern "C-unwind" {
33        fn SCDynamicStoreKeyCreateNetworkGlobalEntity(
34            allocator: Option<&CFAllocator>,
35            domain: &CFString,
36            entity: &CFString,
37        ) -> Option<NonNull<CFString>>;
38    }
39    let ret = unsafe { SCDynamicStoreKeyCreateNetworkGlobalEntity(allocator, domain, entity) };
40    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
41    unsafe { CFRetained::from_raw(ret) }
42}
43
44/// Creates a dynamic store key that can be used to access
45/// the network interface configuration information stored in
46/// the dynamic store.
47///
48/// Parameter `allocator`: The CFAllocator that should be used to allocate
49/// memory for this key.
50/// This parameter may be NULL in which case the current
51/// default CFAllocator is used. If this reference is not
52/// a valid CFAllocator, the behavior is undefined.
53///
54/// Parameter `domain`: A string specifying the desired domain, such as the
55/// requested configuration (kSCDynamicStoreDomainSetup) or the
56/// actual state (kSCDynamicStoreDomainState).
57///
58/// Returns: Returns a string containing the formatted key.
59#[inline]
60pub unsafe extern "C-unwind" fn SCDynamicStoreKeyCreateNetworkInterface(
61    allocator: Option<&CFAllocator>,
62    domain: &CFString,
63) -> CFRetained<CFString> {
64    extern "C-unwind" {
65        fn SCDynamicStoreKeyCreateNetworkInterface(
66            allocator: Option<&CFAllocator>,
67            domain: &CFString,
68        ) -> Option<NonNull<CFString>>;
69    }
70    let ret = unsafe { SCDynamicStoreKeyCreateNetworkInterface(allocator, domain) };
71    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
72    unsafe { CFRetained::from_raw(ret) }
73}
74
75/// Creates a dynamic store key that can be used to access
76/// the per-interface network configuration information stored in
77/// the dynamic store.
78///
79/// Parameter `allocator`: The CFAllocator that should be used to allocate
80/// memory for this key.
81/// This parameter may be NULL in which case the current
82/// default CFAllocator is used. If this reference is not
83/// a valid CFAllocator, the behavior is undefined.
84///
85/// Parameter `domain`: A string specifying the desired domain, such as the
86/// requested configuration (kSCDynamicStoreDomainSetup) or the
87/// actual state (kSCDynamicStoreDomainState).
88///
89/// Parameter `ifname`: A string containing the interface name or a regular
90/// expression pattern.
91///
92/// Parameter `entity`: A string containing the specific global entity, such
93/// as IPv4 (kSCEntNetIPv4) or DNS (kSCEntNetDNS).
94///
95/// Returns: Returns a string containing the formatted key.
96#[inline]
97pub unsafe extern "C-unwind" fn SCDynamicStoreKeyCreateNetworkInterfaceEntity(
98    allocator: Option<&CFAllocator>,
99    domain: &CFString,
100    ifname: &CFString,
101    entity: Option<&CFString>,
102) -> CFRetained<CFString> {
103    extern "C-unwind" {
104        fn SCDynamicStoreKeyCreateNetworkInterfaceEntity(
105            allocator: Option<&CFAllocator>,
106            domain: &CFString,
107            ifname: &CFString,
108            entity: Option<&CFString>,
109        ) -> Option<NonNull<CFString>>;
110    }
111    let ret =
112        unsafe { SCDynamicStoreKeyCreateNetworkInterfaceEntity(allocator, domain, ifname, entity) };
113    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
114    unsafe { CFRetained::from_raw(ret) }
115}
116
117/// Creates a dynamic store key that can be used to access
118/// the per-service network configuration information stored in
119/// the dynamic store.
120///
121/// Parameter `allocator`: The CFAllocator that should be used to allocate
122/// memory for this key.
123/// This parameter may be NULL in which case the current
124/// default CFAllocator is used. If this reference is not
125/// a valid CFAllocator, the behavior is undefined.
126///
127/// Parameter `domain`: A string specifying the desired domain, such as the
128/// requested configuration (kSCDynamicStoreDomainSetup) or the
129/// actual state (kSCDynamicStoreDomainState).
130///
131/// Parameter `serviceID`: A string containing the service ID or a regular
132/// expression pattern.
133///
134/// Parameter `entity`: A string containing the specific global entity, such
135/// as IPv4 (kSCEntNetIPv4) or DNS (kSCEntNetDNS).
136///
137/// Returns: Returns a string containing the formatted key.
138#[inline]
139pub unsafe extern "C-unwind" fn SCDynamicStoreKeyCreateNetworkServiceEntity(
140    allocator: Option<&CFAllocator>,
141    domain: &CFString,
142    service_id: &CFString,
143    entity: Option<&CFString>,
144) -> CFRetained<CFString> {
145    extern "C-unwind" {
146        fn SCDynamicStoreKeyCreateNetworkServiceEntity(
147            allocator: Option<&CFAllocator>,
148            domain: &CFString,
149            service_id: &CFString,
150            entity: Option<&CFString>,
151        ) -> Option<NonNull<CFString>>;
152    }
153    let ret = unsafe {
154        SCDynamicStoreKeyCreateNetworkServiceEntity(allocator, domain, service_id, entity)
155    };
156    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
157    unsafe { CFRetained::from_raw(ret) }
158}
159
160/// Creates a key that can be used in conjuntion with
161/// SCDynamicStoreSetNotificationKeys function to receive
162/// notifications when the current computer name changes.
163///
164/// Parameter `allocator`: The CFAllocator that should be used to allocate
165/// memory for this key.
166/// This parameter may be NULL in which case the current
167/// default CFAllocator is used. If this reference is not
168/// a valid CFAllocator, the behavior is undefined.
169///
170/// Returns: Returns a notification string for the current computer or
171/// host name.
172#[inline]
173pub unsafe extern "C-unwind" fn SCDynamicStoreKeyCreateComputerName(
174    allocator: Option<&CFAllocator>,
175) -> CFRetained<CFString> {
176    extern "C-unwind" {
177        fn SCDynamicStoreKeyCreateComputerName(
178            allocator: Option<&CFAllocator>,
179        ) -> Option<NonNull<CFString>>;
180    }
181    let ret = unsafe { SCDynamicStoreKeyCreateComputerName(allocator) };
182    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
183    unsafe { CFRetained::from_raw(ret) }
184}
185
186/// Creates a key that can be used in conjunction with
187/// SCDynamicStoreSetNotificationKeys function to receive
188/// notifications when the current console user changes.
189///
190/// Parameter `allocator`: The CFAllocator that should be used to allocate
191/// memory for this key.
192/// This parameter may be NULL in which case the current
193/// default CFAllocator is used. If this reference is not
194/// a valid CFAllocator, the behavior is undefined.
195///
196/// Returns: Returns a notification string for the current console user.
197#[inline]
198pub unsafe extern "C-unwind" fn SCDynamicStoreKeyCreateConsoleUser(
199    allocator: Option<&CFAllocator>,
200) -> CFRetained<CFString> {
201    extern "C-unwind" {
202        fn SCDynamicStoreKeyCreateConsoleUser(
203            allocator: Option<&CFAllocator>,
204        ) -> Option<NonNull<CFString>>;
205    }
206    let ret = unsafe { SCDynamicStoreKeyCreateConsoleUser(allocator) };
207    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
208    unsafe { CFRetained::from_raw(ret) }
209}
210
211/// Creates a key that can be used in conjunction with the
212/// SCDynamicStoreSetNotificationKeys function to receive
213/// notifications when the HostNames entity changes.  The
214/// HostNames entity includes the local host name.
215///
216/// Parameter `allocator`: The CFAllocator that should be used to allocate
217/// memory for this key.
218/// This parameter may be NULL in which case the current
219/// default CFAllocator is used. If this reference is not
220/// a valid CFAllocator, the behavior is undefined.
221///
222/// Returns: Returns a notification string for the HostNames entity.
223#[inline]
224pub unsafe extern "C-unwind" fn SCDynamicStoreKeyCreateHostNames(
225    allocator: Option<&CFAllocator>,
226) -> CFRetained<CFString> {
227    extern "C-unwind" {
228        fn SCDynamicStoreKeyCreateHostNames(
229            allocator: Option<&CFAllocator>,
230        ) -> Option<NonNull<CFString>>;
231    }
232    let ret = unsafe { SCDynamicStoreKeyCreateHostNames(allocator) };
233    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
234    unsafe { CFRetained::from_raw(ret) }
235}
236
237/// Creates a key that can be used in conjunction with the
238/// SCDynamicStoreSetNotificationKeys function to receive
239/// notifications when the location identifier changes.
240///
241/// Parameter `allocator`: The CFAllocator that should be used to allocate
242/// memory for this key.
243/// This parameter may be NULL in which case the current
244/// default CFAllocator is used. If this reference is not
245/// a valid CFAllocator, the behavior is undefined.
246///
247/// Returns: Returns a notification string for the current location
248/// identifier.
249#[inline]
250pub unsafe extern "C-unwind" fn SCDynamicStoreKeyCreateLocation(
251    allocator: Option<&CFAllocator>,
252) -> CFRetained<CFString> {
253    extern "C-unwind" {
254        fn SCDynamicStoreKeyCreateLocation(
255            allocator: Option<&CFAllocator>,
256        ) -> Option<NonNull<CFString>>;
257    }
258    let ret = unsafe { SCDynamicStoreKeyCreateLocation(allocator) };
259    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
260    unsafe { CFRetained::from_raw(ret) }
261}
262
263/// Creates a key that can be used in conjunction with
264/// the SCDynamicStoreSetNotificationKeys function to receive
265/// notifications when the current network proxy settings
266/// (such as HTTP or FTP) are changed.
267///
268/// Parameter `allocator`: The CFAllocator that should be used to allocate
269/// memory for this key.
270/// This parameter may be NULL in which case the current
271/// default CFAllocator is used. If this reference is not
272/// a valid CFAllocator, the behavior is undefined.
273///
274/// Returns: Returns a notification string for the current proxy settings.
275#[inline]
276pub unsafe extern "C-unwind" fn SCDynamicStoreKeyCreateProxies(
277    allocator: Option<&CFAllocator>,
278) -> CFRetained<CFString> {
279    extern "C-unwind" {
280        fn SCDynamicStoreKeyCreateProxies(
281            allocator: Option<&CFAllocator>,
282        ) -> Option<NonNull<CFString>>;
283    }
284    let ret = unsafe { SCDynamicStoreKeyCreateProxies(allocator) };
285    let ret = ret.expect("function was marked as returning non-null, but actually returned NULL");
286    unsafe { CFRetained::from_raw(ret) }
287}