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: Devices /
Chapter 2 - Slot Manager / Slot Manager Reference
Slot Manager Routines / Getting Information From sResources


SReadByte

You can use the SReadByte function to determine the value of the low-order byte of an sResource entry.

FUNCTION SReadByte (spBlkPtr: SpBlockPtr): OSErr;
spBlkPtr
A pointer to a Slot Manager parameter block.
<--spResultLongIntThe contents of the entry byte.
-->spsPointerPtrA pointer to an sResource (described in "The sResource," beginning on page 2-7).
-->spIDSignedByteThe ID of the sResource entry.
XspOffsetDataLongInt 
XspByteLanesSignedByte 

DESCRIPTION
The SReadByte function returns the low-order byte of the offset field of an entry in an sResource. You provide a pointer to the sResource in the spsPointer field and the ID of the entry in the spID field. The SReadByte function returns the value in the low-order byte of the spResult field.

SPECIAL CONSIDERATIONS
This function may alter the values of the spOffsetData and spByteLanes fields of the parameter block. Your application should not depend on the values returned in these fields.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the SReadByte function are
Trap macroSelector
_SlotManager$0000

You must set up register D0 with the routine selector and register A0 with the address of the Slot Manager parameter block. When _SlotManager returns, register D0 contains the result code.
Registers on entry
A0Address of the parameter block
D0$0000
Registers on exit
D0Result code

RESULT CODES
noErr0No error
smNoMoresRsrcs-344Requested sResource not found

Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996