home *** CD-ROM | disk | FTP | other *** search
/ Mac-Source 1994 July / Mac-Source_July_1994.iso / C and C++ / Science⁄Math / VideoToolbox / VideoToolboxSources / CardSlot.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-19  |  676 b   |  31 lines  |  [TEXT/KAHL]

  1. /* CardSlot.c
  2. Finds the first NuBus slot that contains a card of the given name.
  3. Returns -1 if there's no such card.
  4.  
  5. HISTORY:
  6. 1990 dgp wrote it.
  7. 8/24/91    dgp    Made compatible with THINK C 5.0.
  8. 11/23/92 dgp dropped obsolete support for THINK C 4.
  9. */
  10. #include "VideoToolbox.h"
  11.  
  12. OSErr CardSlot(char *cardName)
  13. {
  14.     SpBlock mySpBlock;
  15.     OSErr error;
  16.     int slot;
  17.     unsigned char name[128];
  18.     
  19.     for(slot=9;slot<16;slot++){
  20.         mySpBlock.spSlot=slot;
  21.         error=SCkCardStat(&mySpBlock);
  22.         if(!error){
  23.             mySpBlock.spID=1;
  24.             mySpBlock.spResult=(long) &name;
  25.             error=SReadDrvrName(&mySpBlock);
  26.             if(!error && !strcmp(cardName,PtoCstr(name)))return slot;
  27.         }
  28.     }
  29.     return -1;    /* no such card */
  30. }
  31.