Important: The information in this document is obsolete and should not be used for new development.
Calling a Format I/O Function
To indicate to the Edition Manager which format I/O function to use, use theCallFormatIOProcfunction.
err := CallFormatIOProc (selector, PB, routine);Set theselectorparameter to one of the format I/O verbs. The format I/O verbs include
The
ioHasFormat
ioReadFormat
ioNewFormat
ioWriteFormat
PBparameter of theCallFormatIOProcfunction contains a format I/O parameter block.
TYPE FormatIOParamBlock = RECORD ioRefNum: LongInt; {reference number} format: FormatType; {edition format type} formatIndex: LongInt; {opener-specific enumeration } { of formats} offset: LongInt; {offset into format} buffPtr: Ptr; {data starts here} buffLen: LongInt; {length of data} END;Theroutineparameter of theCallFormatIOProcfunction is a pointer to a format
I/O function.The following list shows which fields of
FormatIOParamBlockare used by the format I/O verbs:
Format I/O verb Parameter Description Called by ioHasFormat --> ioRefNum I/O reference number returned by opener. EditionHasFormat,GetStandardFormats, andReadEditionfunctions--> format Check for this format. <-- formatIndex An optional enumeration of the supplied format. <-- buffLen If found, return the length size or -1 if size is unknown. <-- Return value A noErrornoTypeErrcode.ioReadFormat --> ioRefNum I/O reference number returned by opener. ReadEditionandGetStandardFormatsfunctions--> format Get this format. --> formatIndex Value returned by ioHasFormat.--> offset Read format beginning from this offset. --> buffPtr Put data beginning here. <-> buffLen Specify buffer length to read, and return actual amount received. <-- Return value A noErrcode, or appropriate error code.ioNewFormat --> ioRefNum I/O reference number returned by opener. SetEditionFormatMarkandWriteEditionfunctions--> format Create this format. <-- formatIndex An optional enumeration of the supplied format. <-- Return value A noErrcode, or appropriate error code.ioWriteFormat --> ioRefNum I/O reference number returned by opener. WriteEditionfunction--> format Get this format. --> formatIndex Value returned by ioNewFormat.--> offset Write format beginning from this offset. --> buffPtrGet data beginning here. <-> buffLenSpecify buffer length to write. <-- Return value A noErrcode or appropriate error code.The marks for each format are kept by the Edition Manager. The format I/O function only needs to be able to read or write, beginning at any offset. If you know that your application always reads an entire format sequentially, you can ignore the offset.
 
  
  
 