PPC Toolbox Parameter Blocks
PPC Toolbox functions require a pointer to a PPC parameter block. You must fill out any fields of the parameter block that the specific
The qLink, csCode, intUse, intUsePtr, and reserved fields of the
PPCParamBlockRec are used internally by the PPC Toolbox. Your application should not rely on the PPC Toolbox to preserve these fields across calls. Your application transfers ownership of the PPC Toolbox parameter block (and any buffers or records pointed to by the PPC Toolbox parameter block) to the PPC Toolbox until a PPC function is complete. Once the function completes, ownership of the parameter block (and any buffers or records it
points to) is transferred back to your application. If a PPC Toolbox function is executed asynchronously, your program cannot alter memory that might be
A PPC Toolbox function that is executed asynchronously must specify NIL or the address of a completion routine in the ioCompletion field of the
PPC parameter block. The ioResult field should be used to determine the
actual result code when an asynchronously executed PPC Toolbox function completes.
If you specify a completion routine in the ioCompletion field, it is called at
interrupt time when the PPC Toolbox function completes execution. Warning: Completion routines execute at the interrupt level and must
preserve all registers other than A0, A1, and D0-D2. (Note that most
commercial high-level languages do this automatically.) Your completion
indirectly, and it can't depend on the validity of handles to unlocked blocks. The
PPC Toolbox pre serves the application global register A5. You can write completion routines in C, Pascal, or assembly language. A
completion routine declared in Think C is:
pascal void MyCompletionRoutine (PPCParamBlockPtr Pb);
The pb parameter points to the PPC parameter block passed to the