NBPRegister
ATNBPRecHandle abRecord; handle to an ATNBPRec Boolean async; 0=await completion; 1=immediate return NBPRegister is part of the AppleTalk alternate interface. It is recommended that you use the preferred call, PRegisterName instead. NBPRegister adds the name and address of an entity to the node's names table.
abRecord is a handle to an ATNBPRec structure. The relevant fields are as follows:
¨ abResult short 2 2 Result code
Æ abUserReference long 4 4 For your use
Æ nbpEntityPtr Ptr 4 0 Pointer to entity name Æ nbpBufPtr Ptr 4 4 Pointer to buffer ÆnpbAddress.aSocket AddrBlock 4 14 Socket address async is a Boolean value. Use FALSE for normal ( synchronous) operation or TRUE to enqueue the request and resume control immediately. See Async I/O.
noErr (0) No error
nbpDuplicate (-1027) Duplicate name already exists
Notes: NBPRegisteradds the name and address of an entity to the node's names table. NBPEntityPtr points to a variable of type EntityName containing the entity's name. If the name is already registered, NBPRegister returns the result code nbpDuplicate. NBPAddress indicates the socket from
which the name should be registered. NBPBufPtr and nbpBufSize specify the
location and size of a buffer for NBP to use internally.
While the variable of the type EntityName is declared as three 32-byte strings, only the actual characters of the name are placed in the buffer
pointed to by nbpBufPtr. For this reason, nbpBufSizer needs only to be
equal to the actual length of the name, plus an additional 12 bytes for use by
NBP.
Warning: This buffer must not be altered or released until the name is
removed from the names table via an NBPRemove call. If you allocate the buffer through a NewHandle call, you must lock it as long as the name is registered.
The zone filed of the entity name must be set to the meta-character "*".