PRegisterName
PRegisterName Add the name and address of an entity to names table
#include <AppleTalk.h> AppleTalk Manager
OSErr PRegisterName( thePBptr, async);
MPPPBPtr thePBptr; pointer to an NBPparms structure
Boolean async; 0=await completion; 1=immediate return
returns Error Code; 0=no error
PRegisterName adds the name and address of an entity to the node's names
table.
thePBptr is a pointer to an NBPparms structure.
Out-In Name Type Size Offset Description
Æ csCode short 2 26 always registerName
Æ interval char 1 28 retry interval
´ count char 1 29 retry count
Æ ntQElPtr Ptr 4 30 names table element pointer
Æ verifyFlag char 1 34 set if verify needed
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.
Returns: an operating system Error Code. It will be one of:
noErr (0) No error
nbpDuplicate (-1027) Duplicate name already exists
nbpNISErr (-1029) Error opening names information socket

Notes: ntQElPtr points to a names table entry containing the entity's name and
internet address (built using NBPSetNTE). Meta- characters aren't
allowed in the object and type fields of the entity name; the zone field,
however, must contain the meta-character "*". If verifyFlag is TRUE,
PRegisterName checks on the network to see if the name is already in
use, and returns a result code of nbpDuplicate if so. interval and count
contain the retry interval in eight-tick units and the retry count. When a
retry is made, the count field is modified.
Warning: The names table entry passes to PRegisterName remains the
property of NBP until removed from the names table. Don't
attempt to remove or modify it. If you've allocated memory
using a NewHandle call, you must lock it as long as the name is
registered.
Warning: verifyFlag should normally be set before calling
PRegisterName.
When an entity wants to communicate via an AppleTalk network, it should
call PRegisterName to place its name and internet address in the names
table. When an entity no longer wants to communicate on the network, or is
being shut down, it should call PLookupName, which returns a list of all
entities with the name you specify. If you already know the address of an
entity, and want only to confirm that it still exists, call PConfirmName.
PConfirmName is more efficient than PLookupName in terms of
network traffic.