Otcfgsetentityname – Apple Network Setup User Manual

Page 81

Advertising
background image

C H A P T E R 3

Network Setup Reference

Network Setup Functions

81

W AR N I N G

The

OTCfgGetEntityName

function does not return the

user-visible name of the entity. Instead,

OTCfgGetEntityName

returns an internal name in

entityName

. To get the

user-visible name, call

OTCfgGetPrefs

(page 86) passing

kOTCfgUserVisibleNamePref

in the

prefsType

parameter or

call

OTCfgGetEntityLogicalName

(page 79) if that function is

available.

OTCfgSetEntityName

3

Sets the user-visible name of an entity.

OSStatus OTCfgSetEntityName (CfgDatabaseRef dbRef,

const CfgEntityRef* entityRef,

ConstStr255Param entityName,

CfgEntityRef* newEntityRef);

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 name is to be set. To obtain the
entity reference for an entity, call

OTCfgGetEntitiesList

(page 74). If

entityRef

does not refer to a valid entity,

OTCfgSetEntityName

returns the error

kCfgEntityNotFoundErr

.

entityName

On input, a value of type

ConstStr255Param

that specifies the

new user-visible name for the entity.

newEntityRef

On input, a pointer to a value of type

CfgEntityRef

(page 99).

On output,

newEntityRef

points to a new entity reference that

represents the renamed entity. Your application should use

newEntityRef

for future references to the renamed entity.

function result A value of

noErr

indicates that

OTCfgSetEntityName

returned

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

Advertising