]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SCDynamicStoreCopySpecific.h
b1baeaaa5b879d72932bc536a35974c09d67031d
[apple/configd.git] / SystemConfiguration.fproj / SCDynamicStoreCopySpecific.h
1 /*
2 * Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * file.
14 *
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25
26 #ifndef _SCDYNAMICSTORECOPYSPECIFIC_H
27 #define _SCDYNAMICSTORECOPYSPECIFIC_H
28
29 #include <sys/cdefs.h>
30 #include <CoreFoundation/CoreFoundation.h>
31 #include <SystemConfiguration/SCDynamicStore.h>
32
33
34 /*!
35 @header SCDynamicStoreCopySpecific
36 The following APIs allow an application to determine specific
37 configuration information about the current system (e.g. the
38 computer/sharing name, the currently logged in user, etc).
39 */
40
41
42 __BEGIN_DECLS
43
44 /*!
45 @function SCDynamicStoreCopyComputerName
46 @discussion Gets the current computer/host name.
47 @param store An SCDynamicStoreRef that should be used for communication
48 with the server.
49 If NULL, a temporary session will be used.
50 @param nameEncoding A pointer to memory that, if non-NULL, will be
51 filled with the encoding associated with the computer/host name.
52 @result The current computer/host name;
53 NULL if the name has not been set or if an error was encountered.
54 You must release the returned value.
55 */
56 CFStringRef
57 SCDynamicStoreCopyComputerName (
58 SCDynamicStoreRef store,
59 CFStringEncoding *nameEncoding
60 );
61
62 /*!
63 @function SCDynamicStoreCopyConsoleUser
64 @discussion Gets the name, user ID, and group ID of the currently
65 logged in user.
66 @param store An SCDynamicStoreRef that should be used for communication
67 with the server.
68 If NULL, a temporary session will be used.
69 @param uid A pointer to memory that will be filled with the user ID
70 of the current "Console" user. If NULL, this value will not
71 be returned.
72 @param gid A pointer to memory that will be filled with the group ID
73 of the current "Console" user. If NULL, this value will not be
74 returned.
75 @result The current user logged into the system;
76 NULL if no user is logged in or if an error was encountered.
77 You must release the returned value.
78 */
79 CFStringRef
80 SCDynamicStoreCopyConsoleUser (
81 SCDynamicStoreRef store,
82 uid_t *uid,
83 gid_t *gid
84 );
85
86 /*!
87 @function SCDynamicStoreCopyLocalHostName
88 @discussion Gets the current local host name.
89
90 See SCDynamicStoreKeyCreateHostNames() for notification
91 key information.
92 @param store An SCDynamicStoreRef that should be used for communication
93 with the server.
94 If NULL, a temporary session will be used.
95 @result The current local host name;
96 NULL if the name has not been set or if an error was encountered.
97 You must release the returned value.
98 */
99 CFStringRef
100 SCDynamicStoreCopyLocalHostName (
101 SCDynamicStoreRef store
102 );
103
104 /*!
105 @function SCDynamicStoreCopyLocation
106 @discussion Gets the current "location" identifier.
107 @param store An SCDynamicStoreRef that should be used for communication
108 with the server.
109 If NULL, a temporary session will be used.
110 @result A string representing the current "location" identifier;
111 NULL if no "location" identifier has been defined or if an error
112 was encountered.
113 You must release the returned value.
114 */
115 CFStringRef
116 SCDynamicStoreCopyLocation (
117 SCDynamicStoreRef store
118 );
119
120 /*!
121 @function SCDynamicStoreCopyProxies
122 @discussion Gets the current internet proxy settings.
123 @param store An SCDynamicStoreRef that should be used for communication
124 with the server.
125 If NULL, a temporary session will be used.
126 @result A dictionary with key/value pairs representing the current
127 internet proxy settings (HTTP, FTP, etc);
128 NULL if no proxy settings have been defined or if an error was encountered.
129 You must release the returned value.
130 */
131 CFDictionaryRef
132 SCDynamicStoreCopyProxies (
133 SCDynamicStoreRef store
134 );
135
136 __END_DECLS
137
138 #endif /* _SCDYNAMICSTORECOPYSPECIFIC_H */