SCDynamicStoreCopySpecific Reference

Framework
Declared in
SCDynamicStoreCopySpecific.h

Overview

The functions of the SCDynamicStoreCopySpecific programming interface allow an application to determine specific configuration information about the current system (for example, the computer or sharing name or the currently logged-in user). Note that these functions follow Core Foundation function-name conventions. A function that has "Create" or "Copy" in its name returns a reference you must release with the CFRelease function.

Functions

SCDynamicStoreCopyComputerName

Returns the current computer name.

CFStringRef SCDynamicStoreCopyComputerName (
   SCDynamicStoreRef store,
   CFStringEncoding *nameEncoding
);
Parameters
store

The dynamic store session that should be used for communication with the server. Pass NULL to use a temporary session.

nameEncoding

A pointer to memory that, on output, is filled with the encoding associated with the computer or host name, if it is non-NULL.

Return Value

The current computer name, or NULL if the name has not been set or if an error occurred. You must release the return value.

Availability
  • Available in OS X v10.1 and later.
Declared In
SCDynamicStoreCopySpecific.h

SCDynamicStoreCopyConsoleUser

Returns information about the user currently logged into the system.

CFStringRef SCDynamicStoreCopyConsoleUser (
   SCDynamicStoreRef store,
   uid_t *uid,
   gid_t *gid
);
Parameters
store

The dynamic store session that should be used for communication with the server. Pass NULL to use a temporary session.

uid

A pointer to memory that, on output, is filled with the user ID of the currently logged-in user. If NULL, this value is not returned.

gid

A pointer to memory that, on output, is filled with the group ID of the currently logged-in user. If NULL, this value is not returned.

Return Value

Returns the name, user ID, and group ID of the user currently logged into the system, or NULL if no user is logged in or if an error occurred. You must release the returned values.

Discussion

Note that this function only provides information about the primary console. It does not provide any details about console sessions that have fast user switched out or about other consoles.

Availability
  • Available in OS X v10.1 and later.
Declared In
SCDynamicStoreCopySpecific.h

SCDynamicStoreCopyLocalHostName

Returns the current local host name.

CFStringRef SCDynamicStoreCopyLocalHostName (
   SCDynamicStoreRef store
);
Parameters
store

The dynamic store session that should be used for communication with the server. Pass NULL to use a temporary session.

Return Value

Returns the current local host name, or NULL if the name has not been set or if an error occurred. You must release the return value.

Availability
  • Available in OS X v10.1 and later.
Declared In
SCDynamicStoreCopySpecific.h

SCDynamicStoreCopyLocation

Returns the current location identifier.

CFStringRef SCDynamicStoreCopyLocation (
   SCDynamicStoreRef store
);
Parameters
store

The dynamic store session that should be used for communication with the server. Pass NULL to use a temporary session.

Return Value

Returns the current location identifier, or NULL if no location identifier has been defined or if an error occurred. You must release the returned value.

Availability
  • Available in OS X v10.1 and later.
Declared In
SCDynamicStoreCopySpecific.h

SCDynamicStoreCopyProxies

Returns the key-value pairs that represent the current internet proxy settings.

CFDictionaryRef SCDynamicStoreCopyProxies (
   SCDynamicStoreRef store
);
Parameters
store

The dynamic store session that should be used for communication with the server. Pass NULL to use a temporary session.

Return Value

A dictionary of key-value pairs that represent the current internet proxy settings, or NULL if no proxy settings have been defined or if an error occurred. You must release the returned value.

Discussion

The returned proxy settings dictionary can include the following key-value pairs:

Key

Type

Description

kSCPropNetProxiesExceptionsList

A CFArray of CFString objects

Host name patterns that should bypass the proxy

kSCPropNetProxiesHTTPEnable

A CFNumber with the value 0 or 1

Enables or disables the use of an HTTP proxy

kSCPropNetProxiesHTTPProxy

CFString

The proxy host

kSCPropNetProxiesHTTPPort

CFNumber

The proxy port number

kSCPropNetProxiesHTTPSEnable

A CFNumber with the value 0 or 1

Enables or disables the use of an HTTPS proxy

kSCPropNetProxiesHTTPSProxy

CFString

The proxy host

kSCPropNetProxiesHTTPSPort

CFNumber

The proxy port number

kSCPropNetProxiesFTPEnable

A CFNumber with the value 0 or 1

Enables or disables the use of an FTP proxy

kSCPropNetProxiesFTPProxy

CFString

The proxy host

kSCPropNetProxiesFTPPort

CFNumber

The proxy port number

kSCPropNetProxiesFTPPassive

A CFNumber with the value 0 or 1

Enables or disables passive mode operation for use behind connection filtering firewalls

Availability
  • Available in OS X v10.1 and later.
Declared In
SCDynamicStoreCopySpecific.h