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 / Finding sResources


SNextTypeSRsrc

You can use the SNextTypeSRsrc function to step through sResources of one type.

FUNCTION SNextTypeSRsrc (spBlkPtr: SpBlockPtr): OSErr;
spBlkPtr
A pointer to a Slot Manager parameter block.
<--spsPointerPtrA pointer to an sResource (described in "The sResource," beginning on page 2-7).
<--spRefNumIntegerThe slot resource table reference number.
<-->spCategoryIntegerThe Category field of the sRsrcType entry (described on page 2-10).
<-->spCTypeIntegerThe cType field of the sRsrcType entry.
<-->spDrvrSWIntegerThe DrSW field of the sRsrcType entry.
<-->spDrvrHWIntegerThe DrHW field of the sRsrcType entry.
-->spTBMaskSignedByteThe type bit mask for sRsrcType fields.
<-->spSlotSignedByteThe slot number.
<-->spIdSignedByteThe sResource ID.
<-->spExtDevSignedByteThe external device identifier.
<--spHWDevSignedByteThe hardware device identifier.

DESCRIPTION
The SNextTypeSRsrc function allows you to find the next sResource, as does the SNextSRsrc function, but the SNextTypeSRsrc function skips disabled sResources.

You indicate the sResource you want returned by identifying the slot number, sResource ID, and device ID in the spSlot, spID, and spExtDev fields of the Slot Manager parameter block you point to in the spBlkPtr parameter. You specify the type of the sResource with the spCategory, spCType, spDrvrSW, and spDrvrHW fields. You must also use the spTBMask to specify which of these sRsrcType entry fields should not be included in the search:

The SNextTypeSRsrc function returns values in the spSlot, spID, and spExtDev fields corresponding to the sResource that it found.

The SNextTypeSRsrc function also returns a pointer to the sResource in the spsPointer field and returns other information about the sResource in the spIOReserved, spRefNum, spCategory, spCType, spDrvrSW, and spDrvrHW fields.

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

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

RESULT CODES
noErr0No error
smNoMoresRsrcs-344Requested sResource not found
SEE ALSO
For information on enabling and disabling sResources, see "Enabling and Disabling sResources" on page 2-18 and the description of the SetSRsrcState function on page 2-51.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
3 JUL 1996