PLookupName
PLookupName Return the addresses of all entities with a specified name
#include <AppleTalk.h> AppleTalk Manager
OSErr PLookupName( thePBptr, async);
MPPPBPtr thePBptr; pointer to an NBPparms structure
Boolean async; 0=await completion; 1=immediate return
returns Error Code; 0=no error
PLookupName returns the addresses of all entities with a specified name.
thePBptr is a pointer to an NBPparms structure.
Out-In Name Type Size Offset Description
Æ csCode short 2 26 always lookupName
Æ interval char 1 28 retry interval
´ count char 1 29 retry count
Æ entityPtr Ptr 4 30 pointer to entity name
Æ retBuffPtr Ptr 4 34 pointer to buffer
Æ retBuffSize short 2 40 buffer size in bytes
Æ maxToGet short 2 40 matches to get
¨ numGotten short 2 42 matches found
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
nbpBuffOvr (-1024) Buffer overflow

Notes: PLookupName returns the addresses of all entities with a specified name.
entityPtr points to the entity's name (built using NBPSetEntity).
Meta- characters are allowed in the entity name. retBuffPtr and retBuffSize
contain the location and size of an area of memory in which the tuples
describing the entity names and their corresponding addresses should be
returned. maxToGet indicates the maiximum number of matching names to
find addresses for; the actual number of addresses found is returned in
numGotten. interval and count contain the retry interval and the retry
count. PLookupName completes when either the number of matches is
equal to or greater than maxToGet, or the retry count has been exceeded.
The count field is decremented for each retransmission.
numGotten is first set to 0 and then incremented with each match found.
You can test the value in this field, and can start examining the received
address in the buffer while the lookup continues.
Use NBPExtract to extract entity names from the buffer pointed to by
retBuffPtr.
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.