SGetTypeSRsrc
SpBlockPtr spBlkPtr ; address of 56-byte Slot Parameter Block
structure
SGetTypeSRsrc returns information either about the next sResource data structure of the matching type it finds in the same slot or about the next
sResource data structure of the matching type it finds in any higher- numbered
slot.
spBlkPtr is the address of a 56-byte Slot Parameter Block structure.
The relevant fields are as follows:
Out-In Name Type Size Offset Description
¨ spsPointer Ptr 4 4 Structure pointer ´ spParamData long 4 24 input: fall, foneslot flags
output: sResource enabled or disabled
¨ spRefNum short 2 38 Slot Resource Table RefNum
´ spCategory short 2 40 sResource_Type: Category field
´ spCType short 2 42 sResource_Type: cType field
´ spDrvrSW short 2 44 sResource_Type: DrvrSW field
´ spDrvrHW short 2 46 sResource_Type: DrvrHW field
´ spSlot char 1 49 Slot number
´ spID char 1 50 ID of the sResource
´ spExtDev char 1 51 ID of external device
¨ spHWDev char 1 52 ID of hardware device
noErr (0) No error
Notes: When you specify an sResource data structure and specify which
resource-type fields to match, the SGetTypeSRsrc function returns information either about the next sResource data structure of the matching
type it finds in the same slot or about the next sResource data structure of
the matching type it finds in any higher- numbered slot. It performs the
SGetTypeSRsrc function, you set the fall and foneslot flags to specify which type of search the function is to perform.
You specify an sResource data structure with the spSlot, spID, and
spExtDev fields. You must also use the spTBMask field to specify which fields of the sRsrcType entry in the sResource data structure should not be
included in the search, as follows:
• Set bit 0 to ignore the DrvrHW field.
• Set bit 1 to ignore the DrvrSW field.
• Set bit 2 to ignore the cType field.
• Set bit 3 to ignore the Category field.
In addition, you must clear the fall flag of the spParamData field (bit 0) to
0 to search only enabled sResource data structures or set the fall flag to 1 to
search both enabled and disabled sResource data structures. Set the foneslot
flag (bit 1) to 1 to search only the specified slot or clear it to 0 to search
all slots.
spExtDev fields specifying the sResource data structure that it found, and
it returns in the spsPointer field a pointer to the sResource data structure.
sResource data structure in the spRefNum, spCategory, spCType,
spDrvrSW, spDrvrHW, and spHwDev fields. In addition, the function
returns 0 in the spParamData field if the sResource data structure is
enabled or 1 if it is disabled.
This routine can return the non-fatal error:
smNoMoresRsrcs (-344) No more sResources.