C H A P T E R 3

Network Setup Reference

OTCfgOpenPrefs

Opens an entity so that its preferences can be accessed.

OSStatus OTCCfgOpenPrefs (CfgDatabaseRef dbRef, const CfgEntityRef* entityRef, Boolean writer, CfgEntityAccessID* accessID);

dbRef

On input, a value of type CfgDatabaseRef (page 98) that

 

represents a database session previously opened by calling

 

OTCfgOpenDatabase (page 58).

entityRef

On input, a pointer to a value of type CfgEntityRef (page 99)

 

that represents the entity whose preferences are to be read or

 

written. If the entity does not exist, OTCfgOpenPrefs returns the

 

error kCfgErrEntityNotFound.

writer

On input, a Boolean value. If writer is TRUE, the entity

 

represented by entityRef must be in an area that was opened by

 

calling OTCfgBeginAreaModifications (page 63); otherwise,

 

OTCfgOpenPrefs returns the error kCfgErrLocked. If writer is

 

FALSE, the entity represented by entityRef must be in an open

 

area [opened by calling OTCfgBeginAreaModifications (page 63)

 

or OTCfgOpenArea (page 61)]; otherwise, OTCfgOpenPrefs returns

 

the error kCfgErrAreaNotOpen.

accessID

On input, a pointer to a value of type CfgEntityAccessID

 

(page 100). On output, use accessID in subsequent calls to get

 

and set preferences.

function result

A value of noErr indicates that OTCfgOpenPrefs returned

 

successfully. For a list of other possible result codes, see “Result

 

Codes” (page 110).

DISCUSSION

The OTCfgOpenPrefs function opens the specified entity so that your application can get or set the value of the preferences the entity contains.

If the value of the writer parameter is TRUE, you can set preferences as well as get preferences; otherwise, you can only get preferences.

84Network Setup Functions

Page 84
Image 84
Apple Network Setup manual OTCfgOpenPrefs