2
* Copyright (c) 2000-2003 Apple Computer, Inc. All rights reserved.
4
* @APPLE_LICENSE_HEADER_START@
6
* This file contains Original Code and/or Modifications of Original Code
7
* as defined in and that are subject to the Apple Public Source License
8
* Version 2.0 (the 'License'). You may not use this file except in
9
* compliance with the License. Please obtain a copy of the License at
10
* http://www.opensource.apple.com/apsl/ and read it before using this
13
* The Original Code and all software distributed under the License are
14
* distributed on an 'AS IS' basis, WITHOUT WARRANTY of ANY KIND, EITHER
15
* EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16
* INCLUDING WITHOUT LIMITATION, ANY WARRANTIES of MERCHANTABILITY,
17
* FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18
* Please see the License for the specific language governing rights and
19
* limitations under the License.
21
* @APPLE_LICENSE_HEADER_END@
23
{ Pascal Translation: Peter N Lewis, <peter@stairways.com.au>, 2004 }
27
Modified for use with Free Pascal
29
Please report any bugs to <gpc@microbizz.nl>
38
unit SCDynamicStoreCopySpecific;
40
{$setc UNIVERSAL_INTERFACES_VERSION := $0342}
41
{$setc GAP_INTERFACES_VERSION := $0200}
43
{$ifc not defined USE_CFSTR_CONSTANT_MACROS}
44
{$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
47
{$ifc defined CPUPOWERPC and defined CPUI386}
48
{$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
50
{$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
51
{$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
54
{$ifc not defined __ppc__ and defined CPUPOWERPC}
59
{$ifc not defined __i386__ and defined CPUI386}
65
{$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
66
{$error Conflicting definitions for __ppc__ and __i386__}
69
{$ifc defined __ppc__ and __ppc__}
70
{$setc TARGET_CPU_PPC := TRUE}
71
{$setc TARGET_CPU_X86 := FALSE}
72
{$elifc defined __i386__ and __i386__}
73
{$setc TARGET_CPU_PPC := FALSE}
74
{$setc TARGET_CPU_X86 := TRUE}
76
{$error Neither __ppc__ nor __i386__ is defined.}
78
{$setc TARGET_CPU_PPC_64 := FALSE}
80
{$ifc defined FPC_BIG_ENDIAN}
81
{$setc TARGET_RT_BIG_ENDIAN := TRUE}
82
{$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
83
{$elifc defined FPC_LITTLE_ENDIAN}
84
{$setc TARGET_RT_BIG_ENDIAN := FALSE}
85
{$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
87
{$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
89
{$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
90
{$setc CALL_NOT_IN_CARBON := FALSE}
91
{$setc OLDROUTINENAMES := FALSE}
92
{$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
93
{$setc OPAQUE_UPP_TYPES := TRUE}
94
{$setc OTCARBONAPPLICATION := TRUE}
95
{$setc OTKERNEL := FALSE}
96
{$setc PM_USE_SESSION_APIS := TRUE}
97
{$setc TARGET_API_MAC_CARBON := TRUE}
98
{$setc TARGET_API_MAC_OS8 := FALSE}
99
{$setc TARGET_API_MAC_OSX := TRUE}
100
{$setc TARGET_CARBON := TRUE}
101
{$setc TARGET_CPU_68K := FALSE}
102
{$setc TARGET_CPU_MIPS := FALSE}
103
{$setc TARGET_CPU_SPARC := FALSE}
104
{$setc TARGET_OS_MAC := TRUE}
105
{$setc TARGET_OS_UNIX := FALSE}
106
{$setc TARGET_OS_WIN32 := FALSE}
107
{$setc TARGET_RT_MAC_68881 := FALSE}
108
{$setc TARGET_RT_MAC_CFM := FALSE}
109
{$setc TARGET_RT_MAC_MACHO := TRUE}
110
{$setc TYPED_FUNCTION_POINTERS := TRUE}
111
{$setc TYPE_BOOL := FALSE}
112
{$setc TYPE_EXTENDED := FALSE}
113
{$setc TYPE_LONGLONG := TRUE}
114
uses MacTypes,CFBase,SCDynamicStore,MacOSXPosix,CFString,CFDictionary;
118
@header SCDynamicStoreCopySpecific
119
The following APIs allow an application to determine specific
120
configuration information about the current system (e.g. the
121
computer/sharing name, the currently logged in user, etc).
125
@function SCDynamicStoreCopyComputerName
126
@discussion Gets the current computer/host name.
127
@param store An SCDynamicStoreRef that should be used for communication
129
If NULL, a temporary session will be used.
130
@param nameEncoding A pointer to memory that, if non-NULL, will be
131
filled with the encoding associated with the computer/host name.
132
@result The current computer/host name;
133
NULL if the name has not been set or if an error was encountered.
134
You must release the returned value.
136
function SCDynamicStoreCopyComputerName( store: SCDynamicStoreRef; nameEncoding: CFStringEncodingPtr ): CFStringRef; external name '_SCDynamicStoreCopyComputerName';
139
@function SCDynamicStoreCopyConsoleUser
140
@discussion Gets the name, user ID, and group ID of the currently
142
@param store An SCDynamicStoreRef that should be used for communication
144
If NULL, a temporary session will be used.
145
@param uid A pointer to memory that will be filled with the user ID
146
of the current "Console" user. If NULL, this value will not
148
@param gid A pointer to memory that will be filled with the group ID
149
of the current "Console" user. If NULL, this value will not be
151
@result The current user logged into the system;
152
NULL if no user is logged in or if an error was encountered.
153
You must release the returned value.
155
function SCDynamicStoreCopyConsoleUser( store: SCDynamicStoreRef; uid: uid_t_ptr; gid: gid_t_ptr ): CFStringRef; external name '_SCDynamicStoreCopyConsoleUser';
158
@function SCDynamicStoreCopyLocalHostName
159
@discussion Gets the current local host name.
161
See SCDynamicStoreKeyCreateHostNames() for notification
163
@param store An SCDynamicStoreRef that should be used for communication
165
If NULL, a temporary session will be used.
166
@result The current local host name;
167
NULL if the name has not been set or if an error was encountered.
168
You must release the returned value.
170
function SCDynamicStoreCopyLocalHostName( store: SCDynamicStoreRef ): CFStringRef; external name '_SCDynamicStoreCopyLocalHostName';
173
@function SCDynamicStoreCopyLocation
174
@discussion Gets the current "location" identifier.
175
@param store An SCDynamicStoreRef that should be used for communication
177
If NULL, a temporary session will be used.
178
@result A string representing the current "location" identifier;
179
NULL if no "location" identifier has been defined or if an error
181
You must release the returned value.
183
function SCDynamicStoreCopyLocation( store: SCDynamicStoreRef ): CFStringRef; external name '_SCDynamicStoreCopyLocation';
186
@function SCDynamicStoreCopyProxies
187
@discussion Gets the current internet proxy settings.
188
@param store An SCDynamicStoreRef that should be used for communication
190
If NULL, a temporary session will be used.
191
@result A dictionary with key/value pairs representing the current
192
internet proxy settings (HTTP, FTP, etc);
193
NULL if no proxy settings have been defined or if an error was encountered.
194
You must release the returned value.
196
function SCDynamicStoreCopyProxies( store: SCDynamicStoreRef ): CFDictionaryRef; external name '_SCDynamicStoreCopyProxies';