SCDynamicStoreKey Reference

Framework
Declared in
SCDynamicStoreKey.h

Overview

The SCDynamicStoreKey programming interface provides convenience functions that an application can use to create a correctly formatted dynamic store key for accessing specific items in the dynamic store. An application can then use the resulting string in any function that requires a dynamic store key.

Functions

SCDynamicStoreKeyCreate

Creates a dynamic store key using the specified format.

CFStringRef SCDynamicStoreKeyCreate (
   CFAllocatorRef allocator,
   CFStringRef fmt,
   ...
);
Parameters
allocator

The allocator that should be used to allocate memory for this key. This parameter may be NULL in which case the current default allocator is used. If this value is not a valid CFAllocatorRef, the behavior is undefined.

fmt

The description of the format for this key.

Return Value

A string containing the formatted key.

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

SCDynamicStoreKeyCreateComputerName

Creates a key that can be used to receive notifications when the current computer name changes.

CFStringRef SCDynamicStoreKeyCreateComputerName (
   CFAllocatorRef allocator
);
Parameters
allocator

The allocator that should be used to allocate memory for this key. This parameter may be NULL in which case the current default allocator is used. If this value is not a valid CFAllocatorRef, the behavior is undefined.

Return Value

A notification string for the current computer or host name.

Discussion

Use this key with the SCDynamicStoreSetNotificationKeys function.

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

SCDynamicStoreKeyCreateConsoleUser

Creates a key that can be used to receive notifications when the current console user changes.

CFStringRef SCDynamicStoreKeyCreateConsoleUser (
   CFAllocatorRef allocator
);
Parameters
allocator

The allocator that should be used to allocate memory for this key. This parameter may be NULL in which case the current default allocator is used. If this value is not a valid CFAllocatorRef, the behavior is undefined.

Return Value

A notification string for the current console user.

Discussion

Use this key with the SCDynamicStoreSetNotificationKeys function.

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

SCDynamicStoreKeyCreateHostNames

Creates a key that can be used to receive notifications when the HostNames entity changes.

CFStringRef SCDynamicStoreKeyCreateHostNames (
   CFAllocatorRef allocator
);
Parameters
allocator

The allocator that should be used to allocate memory for this key. This parameter may be NULL in which case the current default allocator is used. If this value is not a valid CFAllocatorRef, the behavior is undefined.

Return Value

A notification string for the HostNames entity.

Discussion

Use this key with the SCDynamicStoreSetNotificationKeys function. Note that the HostNames entity includes the local host name.

Availability
  • Available in OS X v10.2 and later.
Declared In
SCDynamicStoreKey.h

SCDynamicStoreKeyCreateLocation

Creates a key that can be used to receive notifications when the location identifier changes.

CFStringRef SCDynamicStoreKeyCreateLocation (
   CFAllocatorRef allocator
);
Parameters
allocator

The allocator that should be used to allocate memory for this key. This parameter may be NULL in which case the current default allocator is used. If this value is not a valid CFAllocatorRef, the behavior is undefined.

Return Value

A notification string for the current location identifier.

Discussion

Use this key with the SCDynamicStoreSetNotificationKeys function.

Availability
  • Available in OS X v10.2 and later.
Declared In
SCDynamicStoreKey.h

SCDynamicStoreKeyCreateNetworkGlobalEntity

Creates a dynamic store key that can be used to access a specific global (as opposed to a per-service or per-interface) network configuration entity.

CFStringRef SCDynamicStoreKeyCreateNetworkGlobalEntity (
   CFAllocatorRef allocator,
   CFStringRef domain,
   CFStringRef entity
);
Parameters
allocator

The allocator that should be used to allocate memory for this key. This parameter may be NULL in which case the current default allocator is used. If this value is not a valid CFAllocatorRef, the behavior is undefined.

domain

The desired domain, such as the requested configuration or the current state.

entity

The specific global entity, such as IPv4 or DNS.

Return Value

A string containing the formatted key.

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

SCDynamicStoreKeyCreateNetworkInterface

Creates a dynamic store key that can be used to access the network interface configuration information in the dynamic store.

CFStringRef SCDynamicStoreKeyCreateNetworkInterface (
   CFAllocatorRef allocator,
   CFStringRef domain
);
Parameters
allocator

The allocator that should be used to allocate memory for this key. This parameter may be NULL in which case the current default allocator is used. If this value is not a valid CFAllocatorRef, the behavior is undefined.

domain

The desired domain, such as the requested configuration or the current state.

Return Value

A string containing the formatted key.

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

SCDynamicStoreKeyCreateNetworkInterfaceEntity

Creates a dynamic store key that can be used to access the per-interface network configuration information in the dynamic store.

CFStringRef SCDynamicStoreKeyCreateNetworkInterfaceEntity (
   CFAllocatorRef allocator,
   CFStringRef domain,
   CFStringRef ifname,
   CFStringRef entity
);
Parameters
allocator

The allocator that should be used to allocate memory for this key. This parameter may be NULL in which case the current default allocator is used. If this value is not a valid CFAllocatorRef, the behavior is undefined.

domain

The desired domain, such as the requested configuration or the current state.

ifname

The interface name or a regular expression pattern.

entity

The specific global entity, such as IPv4 or DNS.

Return Value

A string containing the formatted key.

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

SCDynamicStoreKeyCreateNetworkServiceEntity

Creates a dynamic store key that can be used to access the per-service network configuration information.

CFStringRef SCDynamicStoreKeyCreateNetworkServiceEntity (
   CFAllocatorRef allocator,
   CFStringRef domain,
   CFStringRef serviceID,
   CFStringRef entity
);
Parameters
allocator

The allocator that should be used to allocate memory for this key. This parameter may be NULL in which case the current default allocator is used. If this value is not a valid CFAllocatorRef, the behavior is undefined.

domain

The desired domain, such as the requested configuration or the current state.

serviceID

The service ID or a regular expression pattern.

entity

The specific global entity, such as IPv4 or DNS.

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

SCDynamicStoreKeyCreateProxies

Creates a key that can be used to receive notifications when the current network proxy settings are changed.

CFStringRef SCDynamicStoreKeyCreateProxies (
   CFAllocatorRef allocator
);
Parameters
allocator

The allocator that should be used to allocate memory for this key. This parameter may be NULL in which case the current default allocator is used. If this value is not a valid CFAllocatorRef, the behavior is undefined.

Return Value

A notification string for the current proxy settings.

Discussion

Use this key with the SCDynamicStoreSetNotificationKeys function.

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