Important: The information in this document is obsolete and should not be used for new development.
SGetCString
You can use theSGetCString
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.
<-- spResult
Ptr A pointer to a copy of the cString
data structure.--> spsPointer
Ptr A pointer to an sResource (described in "The sResource," beginning on page 2-7). --> spID
SignedByte The ID of the sResource entry. X spSize
LongInt X spOffsetData
LongInt X spByteLanes
SignedByte X spFlags
SignedByte DESCRIPTION
TheSGetCString
function returns a copy of thecString
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 thespID
field.The
SGetCString
function allocates a memory buffer, copies the value of thecString
data structure into it, and returns a pointer to it in thespResult
field. You should dispose of this pointer by using the Memory Manager procedureDisposePtr
.SPECIAL CONSIDERATIONS
TheSGetCString
function may alter the values of thespSize
,spOffsetData
,spByteLanes
, andspFlags
fields of the parameter block. Your application should not depend on the values returned in these fields.SPECIAL CONSIDERATIONS
TheSGetCString
function allocates memory; your application should not call this function at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theSGetCString
function are
Trap macro Selector _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 A0 Address of the parameter block D0 $0003
Registers on exit D0 Result code RESULT CODES
noErr 0 No error smNoMoresRsrcs -344 Requested sResource not found SEE ALSO
For more information about thecString
data structure, see "Firmware," beginning on page 2-7.