Otcfgsetprefs – Apple Network Setup User Manual
Page 87

C H A P T E R 3
Network Setup Reference
Network Setup Functions
87
DISCUSSION
The
OTCfgGetPrefs
function gets the value of the preference specified by
prefsType
in the entity represented by
accessID
and stores it in
data
.
Before calling
OTCfgGetPrefs
, you may call
obtain the size of the entity so that you can allocate a
data
parameter of the
appropriate size.
If the
data
parameter is too small to hold the value,
OTCfgGetPrefs
stores as
much of the value in
data
as possible and returns the error
kCFGErrDataTruncated
.
OTCfgSetPrefs
3
Sets the value of a preference.
OSStatus OTCCfgSetPrefs (CfgEntityAccessID accessID.
OSType prefsType,
const void* data,
ByteCount length);
accessID
On input, a value of type
obtained by previously calling
entity in which the preference represented by
accessID
resides
must itself reside in an area that has been opened for writing by
calling
prefsType
On input, a value of type
OSType
that identifies the preference to
set. If a preference of the type specified by
prefsType
already
exists
OTCfgSetPrefs
overwrites the value of the preference.
Otherwise,
OTCfgSetPrefs
creates the new preference.
data
On input, a pointer to the data that is to be set.
length
On input, a value of type
ByteCount
that contains the length in
bytes of the data in
data
.
function result A value of
noErr
indicates that
OTCfgSetPrefs
returned
successfully. For a list of other possible result codes, see “Result
Codes” (page 110).