Otcfggetprefstoc, E calling – Apple Network Setup User Manual

Page 89

Advertising
background image

C H A P T E R 3

Network Setup Reference

Network Setup Functions

89

OTCfgGetPrefsTOC

3

Gets a list of the preferences in an entity.

OSStatus OTCfgGetPrefsTOC (CfgEntityAccessID accessID.

ItemCount* itemCount,

CfgPrefsHeader prefsTOC[]);

accessID

On input, a value of type

CfgEntityAccessID

(page 100),

obtained by previously calling

OTCfgOpenPrefs

(page 84) that

identifies the entity whose preferences are to be obtained.

itemCount

On input, a pointer to a value of type

ItemCount

that specifies

the requested number of preferences.

On output,

itemCount

contains the number of preferences that were obtained.

prefsTOC

On input, an array of

CfgPrefsHeader

(page 100) structures. The

prefsTOC

parameter must have enough

CfgPrefsHeader

structures to store all of the preferences in the entity.

function result A value of

noErr

indicates that

OTCfgGetPrefsTOC

returned

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

DISCUSSION

The

OTCfgGetPrefsTOC

function obtains information about the specified number

preferences in the entity represented by

accessID

and stores them in the

prefsTOC

array.

Before you call

OTCfgPrefsTOC

, you must should find out how many preferences

are available by calling

OTCfgGetPrefsTOCCount

(page 88).

W AR N I N G

Early versions of Network Setup do not determine whether
there is enough space in

prefsTOC

(as specified on input by

itemCount

) and can write beyond the end of the array. You

should always call

OTCfgGetPrefsTOCCount

before calling

OTCfgGetPrefsTOC

. When you call

OTCfgGetPrefsTOC

, set

itemCount

to the value returned by

OTCfgGetPrefsTOCCount

in the

itemCount

parameter.

Advertising