Important: The information in this document is obsolete and should not be used for new development.
NBPSetNTE
TheNBPSetNTE
procedure creates a new NBP names table entry to be added to the NBP names table through thePRegisterName
function.
PROCEDURE NBPSetNTE (ntePtr: Ptr; nbpObject,nbpType,nbpZone: Str32; socket: Integer);
ntePtr
- A pointer to a buffer that you provide that is at least 108 bytes long. The
NBPSetNTE
procedure fills this buffer with a names table entry based on the remaining parameter values that you specify. This buffer should be a record of typeNamesTableEntry
.nbpObject
- The object part of the name for the names table entry. This value can be up to 31 characters long. You cannot use any wildcard characters in this name. (An object name typically identifies the node and is commonly set to the Chooser name that the user specified.)
nbpType
- The type part of the name for the names table entry. This value can be up to 31 characters long. You cannot use any wildcard characters in this name. This part of an NBP name usually identifies the type of service to which the name is assigned.
nbpZone
- The zone part of the name for the names table entry. You must use an asterisk (*) for this name, indicating the local zone.
socket
- The number of the socket that was returned and assigned to your process when you opened a socket using one of the AppleTalk transport protocols. The NBP entity name is associated with the socket number that you specify.
DESCRIPTION
TheNBPSetNTE
procedure creates a names table entry that you can register with
the NBP names directory using thePRegisterName
function. When you callPRegisterName
to register the name, you must provide a pointer to the NBP names table entry that you created previously.Because the object, type, and zone names in a names table entry are packed data of arbitrary length, you cannot create this record in Pascal (which requires you to declare the length of character strings when you define the record). Use the
NBPSetNTE
procedure to create the names table entry.SPECIAL CONSIDERATIONS
The names table entry that you provide remains the property of NBP once you register it usingPRegisterName
and until you remove it using thePRemoveName
function. You can allocate a block of nonrelocatable memory for the names table entry buffer using the Memory Manager'sNewPtr
orNewPtrSys
function.If instead you use the
NewHandle
function to allocate the buffer memory, you must lock the memory before you callPRegisterName
to register the name because NBP adds the actual names table entry to the NBP names table for that node, and the names table entry remains part of the table until you remove it.ASSEMBLY-LANGUAGE INFORMATION
TheNBPSetNTE
procedure is implemented entirely in the MPW interface files. There is no assembly-language equivalent for this procedure.SEE ALSO
For the names table entry record format, see Figure 3-4 on page 3-8.For the NamesTableEntry data type declaration, see "Data Structures" on page 3-18.
For information on allocating memory, see Inside Macintosh: Memory.
The
PRegisterName
function is described next.