]> git.saurik.com Git - apple/configd.git/blob - SystemConfiguration.fproj/SCDConsoleUser.h
configd-24.1.tar.gz
[apple/configd.git] / SystemConfiguration.fproj / SCDConsoleUser.h
1 /*
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
11 *
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22
23 #ifndef _SCDCONSOLEUSER_H
24 #define _SCDCONSOLEUSER_H
25
26 #include <sys/cdefs.h>
27
28 /*!
29 @header SCDConsoleUser.h
30 The SystemConfiguration framework provides access to the data used
31 to configure a running system.
32
33 Specifically, the SCDConsoleUserXXX() API's allow an application
34 to determine (or set) the login/user currently using the
35 console.
36
37 The APIs provided by this framework communicate with the "configd"
38 daemon to obtain information regarding the systems current
39 configuration.
40 */
41
42
43 __BEGIN_DECLS
44
45 /*!
46 @function SCDKeyCreateConsoleUser
47 @discussion Creates a key which can be used by the SCDNotifierAdd()
48 function to receive notifications when the current "Console"
49 user changes.
50 @result A notification string for the current "Console" user.
51 */
52 CFStringRef SCDKeyCreateConsoleUser ();
53
54 /*!
55 @function SCDConsoleUserGet
56 @discussion Gets the name, user ID, and group ID of the currently
57 logged in user.
58 @param user A pointer to a character buffer of at least size
59 userlen. The returned name is null-terminated unless
60 in-sufficient space is provided.If NULL, this value
61 will not be returned.
62 @param userlen Pass an integer specifying the maximum size of the
63 user buffer.
64 @param uid A pointer to memory which will be filled with the user ID
65 of the current "Console" user. If NULL, this value will not
66 be returned.
67 @param gid A pointer to memory which will be filled with the group ID
68 of the current "Console" user. If NULL, this value will not be
69 returned.
70 @result A constant of type SCDStatus indicating the success (or failure) of
71 the call.
72 */
73 SCDStatus SCDConsoleUserGet (char *user,
74 int userlen,
75 uid_t *uid,
76 gid_t *gid);
77
78 /*!
79 @function SCDConsoleUserSet
80 @discussion Sets the name, user ID, and group ID of the currently
81 logged in user.
82 @param user A pointer to a character buffer containing the name of
83 the current "Console" user. If NULL, any current "Console"
84 user information will be reset.
85 @param uid The user ID of the current "Console" user.
86 @param gid The group ID of the current "Console" user.
87 @result A constant of type SCDStatus indicating the success (or failure) of
88 the call.
89 */
90 SCDStatus SCDConsoleUserSet (const char *user,
91 uid_t uid,
92 gid_t gid);
93
94 __END_DECLS
95
96 #endif /* _SCDCONSOLEUSER_H */