Mac Developer Library

Developer

SystemConfiguration Framework Reference SCDynamicStoreCopySpecific Reference

Options
Deployment Target:

On This Page
Language:

SCDynamicStoreCopySpecific Reference

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Swift

import SystemConfiguration

Objective-C

@import SystemConfiguration;

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

  • Returns the current computer name.

    Declaration

    Swift

    func SCDynamicStoreCopyComputerName(_ store: SCDynamicStore!, _ nameEncoding: UnsafeMutablePointer<CFStringEncoding>) -> Unmanaged<CFString>!

    Objective-C

    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.

    Import Statement

    Objective-C

    @import SystemConfiguration;

    Swift

    import SystemConfiguration

    Availability

    Available in OS X v10.1 and later.

  • Returns information about the user currently logged into the system.

    Declaration

    Swift

    func SCDynamicStoreCopyConsoleUser(_ store: SCDynamicStore!, _ uid: UnsafeMutablePointer<uid_t>, _ gid: UnsafeMutablePointer<gid_t>) -> Unmanaged<CFString>!

    Objective-C

    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.

    Import Statement

    Objective-C

    @import SystemConfiguration;

    Swift

    import SystemConfiguration

    Availability

    Available in OS X v10.1 and later.

  • Returns the current local host name.

    Declaration

    Swift

    func SCDynamicStoreCopyLocalHostName(_ store: SCDynamicStore!) -> Unmanaged<CFString>!

    Objective-C

    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.

    Import Statement

    Objective-C

    @import SystemConfiguration;

    Swift

    import SystemConfiguration

    Availability

    Available in OS X v10.1 and later.

  • Returns the current location identifier.

    Declaration

    Swift

    func SCDynamicStoreCopyLocation(_ store: SCDynamicStore!) -> Unmanaged<CFString>!

    Objective-C

    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.

    Import Statement

    Objective-C

    @import SystemConfiguration;

    Swift

    import SystemConfiguration

    Availability

    Available in OS X v10.1 and later.

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

    Declaration

    Swift

    func SCDynamicStoreCopyProxies(_ store: SCDynamicStore!) -> Unmanaged<CFDictionary>!

    Objective-C

    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

    Import Statement

    Objective-C

    @import SystemConfiguration;

    Swift

    import SystemConfiguration

    Availability

    Available in OS X v10.1 and later.