Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Networking /
Chapter 6 - AppleTalk Transaction Protocol (ATP) / ATP Reference
Routines / Building a Buffer Data Structure


BuildBDS

From the buffer that you supply, the BuildBDS function creates a buffer data structure (BDS) to be used to hold data for ATP functions that send and receive response data.

FUNCTION BuildBDS (buffPtr: Ptr; bdsPtr: Ptr; 
                  buffSize: Integer): Integer;
buffPtr
A pointer to a data buffer.
buffSize
The length in bytes of the buffer data structure.
DESCRIPTION
The PSendResponse, PSendRequest, and PNSendRequest functions require a buffer data structure of a specific format to be used to hold the response data. You can use the BuildBDS function to create this data structure, or you can build it yourself from Pascal.

The BuildBDS function creates a buffer data structure consisting of an array of elements--one for each response packet--to be used to hold response data. You pass
this function a pointer to the memory to be used for this buffer and the size in bytes
of the memory. You should allocate enough memory to hold the response data that
you are either sending or receiving. Because an entire response message cannot exceed 4624 bytes, the amount of memory that you allocate for this data structure should not exceed this size.

BuildBDS creates up to eight elements for a buffer data structure. If you provide the maximum space of 4624 bytes, BuildBDS returns eight elements; if the response message is shorter and you specify fewer bytes, BuildBDS returns the equivalent number of elements. BuildBDS returns as a function result the number of buffer data structure elements that it creates. For more information about the BDS data structure,
see "The Buffer Data Structure" on page 6-20.

RESULT CODES
noErr0No error
paramErr-50Version number is too high
SEE ALSO
See "PSendResponse" on page 6-34, "PSendRequest" on page 6-24, and "PNSendRequest" on page 6-27 for more information about the functions that
require a buffer data structure.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996