GetMyZone
Boolean async; 0=await completion; 1=immediate return GetMyZone returns only the AppleTalk zone name of the node on which the application is running.
thePBptr is a pointer to an XPPParamBlock structure. The relevant fields are as follows:
¨ ioResult short 2 16 Result code
Æ csCode short 2 26 Routine selector; always xCall
Æ xppSubCode short 2 28 Routine selector; zipGetMyZone
Æ xppTimeOut char 1 30 Retry interval in seconds
Æ xppRetry char 1 31 Retry count
Æ zipBuffPtr long 4 34 Pointer to data buffer
Æ zipInfoField 70 bytes 70 42 For use by ZIP; first word set to 0
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
noBridgeErr (-93) No Router is available
reqFailed (-1096) Request to contact router failed; retry count
exceeded
tooManyReqs (-1097) Too many concurrent requests
noDataArea (-1104) Too many outstanding ATP calls
Notes: The GetMyZone function returns only the AppleTalk zone name of the node on which your application is running.
The ioResult field returns the result of the function. If you call the
function asynchronously, the function sets this field to 1 as soon as it
begins execution, and it changes the field to the actual result code when it
completes execution. The csCode and xppSubCode fields are routine selectors
and are automatically set by the high-level language interface to xCall and
zipGetMyZone for this function. The xppTimeOut field specifies the amount
obtain the data. A value of 3 or 4 for the xppTimeOut field generally gives
good results. The xppRetry field specifies the number of times
reqFailed (request failed) result code. A value of 3 or 4 for the xppRetry
field usually works well.
The zipBuffPtr field is a pointer to a 33-byte data buffer that you must allocate. ZIP returns the zone name into this buffer as a high-level language
string. The zipInfoField field is a 70-byte data buffer that you must allocate
for use by ZIP. You must set the first word of this buffer to 0 before you
// Assuming inclusion of
#include <AppleTalk.h>
void doGetMyZone (void);
void DoError (OSErr myErr); void doGetMyZone ()
{
char myZoneName[33];
myXPPPB.XCALL.xppTimeout = 3; // timeout period for .XPP
myXPPPB.XCALL. xppRetry = 4; // retry count
myXPPPB.XCALL.zipBuffPtr = myZoneName;// zone name returned
// here
myXPPPB.XCALL. zipInfoField[0] = 0;
myXPPPB.XCALL. zipInfoField[1] = 0; // first word is 0 the first
// time through
myErr = GetMyZone(&myXPPPB, FALSE); if (myErr != noErr)
DoError( myErr);
//there's an error
}