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


SGetCString

You can use the SGetCString function to determine the value of a string pointed to by the offset field of an sResource entry.

FUNCTION SGetCString (spBlkPtr: SpBlockPtr): OSErr;
spBlkPtr
A pointer to a Slot Manager parameter block.
<--spResultPtrA pointer to a copy of the cString data structure.
-->spsPointerPtrA pointer to an sResource (described in "The sResource," beginning on page 2-7).
-->spIDSignedByteThe ID of the sResource entry.
XspSizeLongInt 
XspOffsetDataLongInt 
XspByteLanesSignedByte 
XspFlagsSignedByte 

DESCRIPTION
The SGetCString function returns a copy of the cString data structure pointed to by the offset field of an sResource entry.

You provide a pointer to the sResource in the spsPointer field and specify the ID of the entry in the spID field.

The SGetCString function allocates a memory buffer, copies the value of the cString data structure into it, and returns a pointer to it in the spResult field. You should dispose of this pointer by using the Memory Manager procedure DisposePtr.

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

SPECIAL CONSIDERATIONS
The SGetCString function allocates memory; your application should not call this function at interrupt time.

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

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$0003
Registers on exit
D0Result code

RESULT CODES
noErr0No error
smNoMoresRsrcs-344Requested sResource not found
SEE ALSO
For more information about the cString data structure, see "Firmware," beginning on page 2-7.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996