objc2_system_configuration/generated/SCDynamicStoreCopySpecific.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/// Gets the current computer name.
9///
10/// Parameter `store`: An SCDynamicStoreRef representing the dynamic store
11/// session that should be used for communication with the server.
12/// If NULL, a temporary session will be used.
13///
14/// Parameter `nameEncoding`: A pointer to memory that, if non-NULL, will be
15/// filled with the encoding associated with the computer or
16/// host name.
17///
18/// Returns: Returns the current computer name;
19/// NULL if the name has not been set or if an error was encountered.
20/// You must release the returned value.
21#[cfg(feature = "SCDynamicStore")]
22#[inline]
23pub unsafe extern "C-unwind" fn SCDynamicStoreCopyComputerName(
24 store: Option<&SCDynamicStore>,
25 name_encoding: *mut CFStringEncoding,
26) -> Option<CFRetained<CFString>> {
27 extern "C-unwind" {
28 fn SCDynamicStoreCopyComputerName(
29 store: Option<&SCDynamicStore>,
30 name_encoding: *mut CFStringEncoding,
31 ) -> Option<NonNull<CFString>>;
32 }
33 let ret = unsafe { SCDynamicStoreCopyComputerName(store, name_encoding) };
34 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
35}
36
37/// Gets the name, user ID, and group ID of the currently
38/// logged-in user.
39///
40/// Note: this function only provides information about the
41/// primary console. It does not provide any details
42/// about console sessions that have fast user switched
43/// out or about other consoles.
44///
45/// Parameter `store`: An SCDynamicStoreRef representing the dynamic store
46/// session that should be used for communication with the server.
47/// If NULL, a temporary session will be used.
48///
49/// Parameter `uid`: A pointer to memory that will be filled with the user ID
50/// of the current console user. If NULL, this value will not
51/// be returned.
52///
53/// Parameter `gid`: A pointer to memory that will be filled with the group ID
54/// of the current console user. If NULL, this value will not be
55/// returned.
56///
57/// Returns: Returns the user currently logged into the system;
58/// NULL if no user is logged in or if an error was encountered.
59/// You must release the returned value.
60#[cfg(all(feature = "SCDynamicStore", feature = "libc"))]
61#[inline]
62pub unsafe extern "C-unwind" fn SCDynamicStoreCopyConsoleUser(
63 store: Option<&SCDynamicStore>,
64 uid: *mut libc::uid_t,
65 gid: *mut libc::gid_t,
66) -> Option<CFRetained<CFString>> {
67 extern "C-unwind" {
68 fn SCDynamicStoreCopyConsoleUser(
69 store: Option<&SCDynamicStore>,
70 uid: *mut libc::uid_t,
71 gid: *mut libc::gid_t,
72 ) -> Option<NonNull<CFString>>;
73 }
74 let ret = unsafe { SCDynamicStoreCopyConsoleUser(store, uid, gid) };
75 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
76}
77
78/// Gets the current local host name.
79///
80/// Parameter `store`: An SCDynamicStoreRef representing the dynamic store
81/// session that should be used for communication with the server.
82/// If NULL, a temporary session will be used.
83///
84/// Returns: Returns the current local host name;
85/// NULL if the name has not been set or if an error was encountered.
86/// You must release the returned value.
87#[cfg(feature = "SCDynamicStore")]
88#[inline]
89pub unsafe extern "C-unwind" fn SCDynamicStoreCopyLocalHostName(
90 store: Option<&SCDynamicStore>,
91) -> Option<CFRetained<CFString>> {
92 extern "C-unwind" {
93 fn SCDynamicStoreCopyLocalHostName(
94 store: Option<&SCDynamicStore>,
95 ) -> Option<NonNull<CFString>>;
96 }
97 let ret = unsafe { SCDynamicStoreCopyLocalHostName(store) };
98 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
99}
100
101/// Gets the current location identifier.
102///
103/// Parameter `store`: An SCDynamicStoreRef representing the dynamic store
104/// session that should be used for communication with the server.
105/// If NULL, a temporary session will be used.
106///
107/// Returns: Returns a string representing the current location identifier;
108/// NULL if no location identifier has been defined or if an error
109/// was encountered.
110/// You must release the returned value.
111#[cfg(feature = "SCDynamicStore")]
112#[inline]
113pub unsafe extern "C-unwind" fn SCDynamicStoreCopyLocation(
114 store: Option<&SCDynamicStore>,
115) -> Option<CFRetained<CFString>> {
116 extern "C-unwind" {
117 fn SCDynamicStoreCopyLocation(store: Option<&SCDynamicStore>) -> Option<NonNull<CFString>>;
118 }
119 let ret = unsafe { SCDynamicStoreCopyLocation(store) };
120 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
121}
122
123/// Gets the current internet proxy settings.
124/// The returned proxy settings dictionary includes:
125///
126/// <TABLE
127/// BORDER>
128/// <TR
129/// >
130/// <TH
131/// >key
132/// </TD
133/// >
134/// <TH
135/// >type
136/// </TD
137/// >
138/// <TH
139/// >description
140/// </TD
141/// >
142/// </TR
143/// >
144/// <TR
145/// >
146/// <TD
147/// >kSCPropNetProxiesExceptionsList
148/// </TD
149/// >
150/// <TD
151/// >CFArray[CFString]
152/// </TD
153/// >
154/// <TD
155/// >Host name patterns which should bypass the proxy
156/// </TD
157/// >
158/// </TR
159/// >
160/// <TR
161/// >
162/// <TD
163/// >kSCPropNetProxiesHTTPEnable
164/// </TD
165/// >
166/// <TD
167/// >CFNumber (0 or 1)
168/// </TD
169/// >
170/// <TD
171/// >Enables/disables the use of an HTTP proxy
172/// </TD
173/// >
174/// </TR
175/// >
176/// <TR
177/// >
178/// <TD
179/// >kSCPropNetProxiesHTTPProxy
180/// </TD
181/// >
182/// <TD
183/// >CFString
184/// </TD
185/// >
186/// <TD
187/// >The proxy host
188/// </TD
189/// >
190/// </TR
191/// >
192/// <TR
193/// >
194/// <TD
195/// >kSCPropNetProxiesHTTPPort
196/// </TD
197/// >
198/// <TD
199/// >CFNumber
200/// </TD
201/// >
202/// <TD
203/// >The proxy port number
204/// </TD
205/// >
206/// </TR
207/// >
208/// <TR
209/// >
210/// <TD
211/// >kSCPropNetProxiesHTTPSEnable
212/// </TD
213/// >
214/// <TD
215/// >CFNumber (0 or 1)
216/// </TD
217/// >
218/// <TD
219/// >Enables/disables the use of an HTTPS proxy
220/// </TD
221/// >
222/// </TR
223/// >
224/// <TR
225/// >
226/// <TD
227/// >kSCPropNetProxiesHTTPSProxy
228/// </TD
229/// >
230/// <TD
231/// >CFString
232/// </TD
233/// >
234/// <TD
235/// >The proxy host
236/// </TD
237/// >
238/// </TR
239/// >
240/// <TR
241/// >
242/// <TD
243/// >kSCPropNetProxiesHTTPSPort
244/// </TD
245/// >
246/// <TD
247/// >CFNumber
248/// </TD
249/// >
250/// <TD
251/// >The proxy port number
252/// </TD
253/// >
254/// </TR
255/// >
256/// <TR
257/// >
258/// <TD
259/// >kSCPropNetProxiesFTPEnable
260/// </TD
261/// >
262/// <TD
263/// >CFNumber (0 or 1)
264/// </TD
265/// >
266/// <TD
267/// >Enables/disables the use of an FTP proxy
268/// </TD
269/// >
270/// </TR
271/// >
272/// <TR
273/// >
274/// <TD
275/// >kSCPropNetProxiesFTPProxy
276/// </TD
277/// >
278/// <TD
279/// >CFString
280/// </TD
281/// >
282/// <TD
283/// >The proxy host
284/// </TD
285/// >
286/// </TR
287/// >
288/// <TR
289/// >
290/// <TD
291/// >kSCPropNetProxiesFTPPort
292/// </TD
293/// >
294/// <TD
295/// >CFNumber
296/// </TD
297/// >
298/// <TD
299/// >The proxy port number
300/// </TD
301/// >
302/// </TR
303/// >
304/// <TR
305/// >
306/// <TD
307/// >kSCPropNetProxiesFTPPassive
308/// </TD
309/// >
310/// <TD
311/// >CFNumber (0 or 1)
312/// </TD
313/// >
314/// <TD
315/// >Enable passive mode operation for use behind connection
316/// filter-ing firewalls.
317/// </TD
318/// >
319/// </TR
320/// >
321/// </TABLE
322/// >
323///
324/// Other key-value pairs are defined in the SCSchemaDefinitions.h
325/// header file.
326///
327/// Parameter `store`: An SCDynamicStoreRef representing the dynamic store
328/// session that should be used for communication with the server.
329/// If NULL, a temporary session will be used.
330///
331/// Returns: Returns a dictionary containing key-value pairs that represent
332/// the current internet proxy settings;
333/// NULL if no proxy settings have been defined or if an error
334/// was encountered.
335/// You must release the returned value.
336#[cfg(feature = "SCDynamicStore")]
337#[inline]
338pub unsafe extern "C-unwind" fn SCDynamicStoreCopyProxies(
339 store: Option<&SCDynamicStore>,
340) -> Option<CFRetained<CFDictionary>> {
341 extern "C-unwind" {
342 fn SCDynamicStoreCopyProxies(
343 store: Option<&SCDynamicStore>,
344 ) -> Option<NonNull<CFDictionary>>;
345 }
346 let ret = unsafe { SCDynamicStoreCopyProxies(store) };
347 ret.map(|ret| unsafe { CFRetained::from_raw(ret) })
348}