ADC Home > Reference Library > Reference > Networking > System Configuration Framework Reference

 


SCPreferencesSetSpecific

Includes:
<sys/cdefs.h>
<CoreFoundation/CoreFoundation.h>
<SystemConfiguration/SCPreferences.h>

Overview

The functions in the SCPreferencesSetSpecific API allow an application to set specific configuration information about the current system (for example, the computer or sharing name).

To access configuration preferences, you must first establish a preferences session using the SCPreferencesCreate function.



Functions

SCPreferencesSetComputerName
SCPreferencesSetLocalHostName

SCPreferencesSetComputerName


Boolean SCPreferencesSetComputerName ( 
    SCPreferencesRef prefs, 
    CFStringRef name, 
    CFStringEncoding nameEncoding );  
Parameters
prefs
The preferences session.
name
The computer name to be set.
nameEncoding
The encoding associated with the computer name.
Return Value

Returns TRUE if successful; FALSE otherwise.

Discussion

Updates the computer name preference.

Note: To commit these changes to permanent storage you must call the SCPreferencesCommitChanges function. In addition, you must call the SCPreferencesApplyChanges function for the new name to become active.


SCPreferencesSetLocalHostName


Boolean SCPreferencesSetLocalHostName ( 
    SCPreferencesRef prefs, 
    CFStringRef name );  
Parameters
prefs
The preferences session.
name
The local host name to be set.

Note: this string must conform to the naming conventions of a DNS host name as specified in RFC 1034 (section 3.5).
Return Value

Returns TRUE if successful; FALSE otherwise.

Discussion

Updates the local host name.

Note: To commit these changes to permanent storage you must call the SCPreferencesCommitChanges function. In addition, you must call theSCPreferencesApplyChanges function for the new name to become active.


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.
Last Updated: 2008-03-11