Otcfgbeginareamodifications – Apple Network Setup User Manual

Page 63

Advertising
background image

C H A P T E R 3

Network Setup Reference

Network Setup Functions

63

OTCfgBeginAreaModifications

3

Creates a temporary area for modifying an area.

OSStatus OTCfgBeginAreaModifications (CfgDatabaseRef dbRef,

CfgAreaID readAreaID,

CfgAreaID* writeAreaID);

dbRef

On input, a value of type

CfgDatabaseRef

(page 98) that

represents a database session previously opened by calling

OTCfgOpenDatabase

(page 58).

readAreaID

On input, a value of type

CfgAreaID

(page 98) obtained by

calling

OTCfgGetCurrentArea

(page 60). If the area specified by

readAreaID

does not exist,

OTCfgBeginAreaModifications

returns

kCfgErrAreaNotFound

.

writeAreaID

On input, a pointer to a value of type

CfgAreaID

(page 98). On

output,

writeAreaID

points to a new area ID that your

application should use to modify, delete, enumerate, or read
data in the area.

function result A value of

noErr

indicates that

OTCfgBeginAreaModifications

returned successfully. For a list of other possible result codes,
see “Result Codes” (page 110).

DISCUSSION

The

OTCfgBeginAreaModifications

function creates a temporary area and returns

in the

writeAreaID

parameter an area ID for it. The area ID for the temporary

area can be passed as a parameter to subsequent calls for creating or modifying
entities in the temporary area.

If you need to read the area’s original, unmodified data, you can continue using

readAreaID

to do so.

IMPORTANT

Only one program can open an area of writing at any one
time. If another program has already opened the area for
writing,

OTCfgBeginAreaModifications

returns

kCfgErrConfigLocked

.

Advertising