Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!brutus.cs.uiuc.edu!wuarchive!wugate!uunet!intercon!amanda@intercon.uu.net From: amanda@intercon.uu.net (Amanda Walker) Newsgroups: comp.sys.mac.programmer Subject: Re: Slot Manager/Active Slots Message-ID: <1376@intercon.UUCP> Date: 16 Aug 89 21:03:09 GMT References: <18671@princeton.Princeton.EDU> <3610@internal.Apple.COM> Sender: news@intercon.UUCP Reply-To: amanda@intercon.uu.net (Amanda Walker) Organization: InterCon Systems Corporation Lines: 59 Here's some slightly more interesting code: it will not only tell you what slots have cards in them, but what those cards are. This will compile into an MPW tool under MPW C 3.0: ------------------------- #include#include #include main() { int i; SpBlock spb; long l; for (i = 0; i < 16; i++) { // for each possible slot: spb.spSlot = i; spb.spID = 1; spb.spExtDev = 0; if (!SRsrcInfo(&spb)) { // if there is anything there, printf("Slot %d:\n", i); // tell us which slot we're on. spb.spID = sRsrcName; if (!SGetCString(&spb)) { // if it has a name, print it. printf(" %s\n", (char *) spb.spResult); } spb.spID = vendorInfo; if (!SFindStruct(&spb)) { // print vendor info spb.spID = vendorId; if (!SGetCString(&spb)) { // print the vendor name printf(" Vendor: %s\n", (char *) spb.spResult); } spb.spID = serialNum; if (!SGetCString(&spb)) { printf(" Serial Number: %s\n", (char *) spb.spResult); } spb.spID = revLevel; if (!SGetCString(&spb)) { printf(" Revision: %s\n", (char *) spb.spResult); } spb.spID = partNum; if (!SGetCString(&spb)) { printf(" Part Number: %s\n", (char *) spb.spResult); } spb.spID = date; if (!SGetCString(&spb)) { printf(" Revision Date: %s\n", (char *) spb.spResult); } } } } } ------------------------- Enjoy, -- Amanda Walker InterCon Systems Corporation -- amanda@intercon.uu.net | ...!uunet!intercon!amanda