Carbon


HIOParam

Header: Files.h

struct HIOParam {
    QElemPtr qLink; 
    SInt16 qType; 
    SInt16 ioTrap; 
    Ptr ioCmdAddr; 
    IOCompletionUPP ioCompletion; 
    volatile OSErr ioResult; 
    StringPtr ioNamePtr; 
    SInt16 ioVRefNum; 
    SInt16 ioRefNum; 
    SInt8 ioVersNum; 
    SInt8 ioPermssn; 
    Ptr ioMisc; 
    Ptr ioBuffer; 
    SInt32 ioReqCount; 
    SInt32 ioActCount; 
    SInt16 ioPosMode; 
    SInt32 ioPosOffset;
};
typedef HIOParam HIOParamPtr;

Field descriptions

qLink

A pointer to the next entry in the file I/O queue. (This field is used internally by the File Manager to keep track of asynchronous calls awaiting execution.)

qType

The queue type. (This field is used internally by the File Manager.)

ioTrap

The trap number of the function that was called. (This field is used internally by the File Manager.)

ioCmdAddr

The address of the function that was called. (This field is used internally by the File Manager.)

ioCompletion

A pointer to a completion routine to be executed at the end of an asynchronous call. It should be NULL for asynchronous calls with no completion routine and is automatically set to NULL for all synchronous calls. See IOCompletionProcPtr for information about completion routines.

ioResult

The result code of the function. For synchronous calls, this field is the same as the result code of the function call itself. To determine when an asynchronous call has actually been completed, your application can poll this field; it’s set to a positive number when the call is made and receives the actual result code when the call is completed.

ioNamePtr

A pointer to a pathname. Whenever a function description specifies that ioNamePtr is used—whether for input, output, or both—it’s very important that you set this field to point to storage for a Str255 value (if you’re using a pathname) or to NULL (if you’re not).

ioVRefNum

A volume specification (volume reference number, working directory reference number, drive number, or 0 for default volume).

ioRefNum

The file reference number of an open file.

ioVersNum

A version number. This field is no longer used and you should always set it to 0.

ioPermssn

The access mode.

ioMisc

Depends on the function called. This field contains either a new logical end-of-file, a new version number, a pointer to an access path buffer, or a pointer to a new pathname. Because ioMisc is of type Ptr, you’ll need to perform type coercion to interpret the value of ioMisc correctly when it contains an end-of-file (a LongInt value) or version number (a SignedByte value).

ioBuffer

A pointer to a data buffer into which data is written by _Read calls and from which data is read by _Write calls.

ioReqCount

The requested number of bytes to be read, written, or allocated.

ioActCount

The number of bytes actually read, written, or allocated.

ioPosMode

The positioning mode for setting the mark. Bits 0 and 1 of this field indicate how to position the mark; you can use the constants described in “Positioning Mode Constants” to set or test their value.

You can set bit 4 of the ioPosMode field to request that the data be cached, and you can set bit 5 to request that the data not be cached. You can set bit 6 to request that any data written be immediately read; this ensures that the data written to a volume exactly matches the data in memory. To request a read-verify operation, add the rdVerify constant to the positioning mode.

You can set bit 7 to read a continuous stream of bytes, and place the ASCII code of a newline character in the high-order byte to terminate a read operation at the end of a line.

ioPosOffset

The offset to be used in conjunction with the positioning mode.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)