PPCWriteSync
PPCWrite
Write to an application during a PPC session PPCWritePBPtr pb; Pointer to PPC parameter block
Boolean async; if TRUE, use asynchronous communications On entry A0: pointer to a parameter block
D0: selector (6)
On exit D0: result code
Parameter block
Æ 12 ioCompletion long address of a completion routine
Æ 40 sessRefNum long session reference number
Æ 44 bufferLength long length of data buffer
¨ 48 actualLength long actual length of data written
Æ 52 bufferPtr long pointer to data buffer
Æ 56 more char TRUE if more data in this block to be written Æ 58 userData long application-specific data
Æ 62 blockCreator long creator of block written
Æ 66 blockType long type of block written
Use the PPCWrite function to write message blocks during a session. If your application calls this function asynchronously, you must specify in
the ioCompletion field either the address of a completion routine or NIL. If
ioCompletion is NIL, you should poll the ioResult field of the
PPC parameter block (from your application's main event loop) to determine
whether the PPC Toolbox has completed the requested operation. A value in the ioResult field other than 1 indicates that the call is complete. Note that it is
unsafe to poll the ioResult field at interrupt time since the PPC Toolbox may be in the process of completing a call.
If you call the PPCWrite function asynchronously, you must not change any of the fields in the parameter block until the call completes. The buffer pointed
PPC Toolbox until the call completes. These objects must not be de allocated or moved in memory while the call is in progress.
The sessRefNum field specifies a session identifier. This must be a valid
session reference number returned from a previous PPCStart, The bufferLength and bufferPtr fields specify the length and location of a
buffer the message block is sent to. If the PPCWrite function returns a noErr result code, the actualLength field returns the actual size of the message block
that was written.
Set the more field to TRUE to indicate that you will be using another PPCWrite function to append data to this message block. Set the more field to FALSE to indicate that this is the end of the data in this message block. The initiating port can specify any information in the userData field. The
PPCRead function reports this data to the responding port upon its completion.
Set the userData, blockCreator, and blockType fields for each message block
that you create. These fields can give the receiving application information
about how to process the contents of the message block. They are ignored when
you append information to a message block. Set the more field to TRUE to append additional data to a message block; otherwise, set this field to FALSE. You should execute the PPCWrite function asynchronously. noErr (0) No error
notInitErr (-900) PPC Toolbox has not been initialized yet noGlobalsErr (-904) System unable to allocate memory, critical error
noSessionErr (-908) Invalid session reference number
badReqErr (-909) Invalid state for this operation
sessClosedErr (-917) The session has closed