home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 February: Tool Chest / Dev.CD Feb 99 TC.toast / What's New? / Development Kits / Mac OS USB v1.1f3 DDK / Examples / USBSampleStorageDriver / SampleStorageDriverAPI.c < prev    next >
Encoding:
C/C++ Source or Header  |  1998-12-14  |  1.6 KB  |  79 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        SampleStorageDriverAPI.c
  3.  
  4.     Contains:    Sample Storage Class functions used by the Storage Class UT Driver
  5.  
  6.     Version:    1.1
  7.  
  8.     Copyright:    © 1998 by Apple Computer, Inc., all rights reserved.
  9.  
  10.  
  11. */
  12.  
  13.  
  14.  
  15. #include <Errors.h>
  16. #include "SampleStorageDriverAPI.h"
  17.  
  18. // Prototypes for the functions in the dispatch table for the Unit Table Driver
  19. EXTERN_API_C( OSStatus )
  20. StorageInitialize            (void);
  21.  
  22. EXTERN_API_C( OSStatus )
  23. StorageControl                (UInt32 theControlSelector, void *theControlData);
  24.  
  25. EXTERN_API_C( OSStatus )
  26. StorageStatus                (UInt32 theInfoSelector, void *theInfo);
  27.  
  28. EXTERN_API_C( OSStatus )
  29. StorageExecuteCommand        (StorageExecuteCommandPBPtr storageExecuteCommandPBPtr );
  30.  
  31.  
  32. OSStatus StorageInitialize(void)
  33. {
  34. OSStatus    status;
  35.  
  36.     status = StorageClassDriverInitialize();
  37.     
  38.     return status;
  39. }
  40.  
  41. OSStatus StorageControl(UInt32 theControlSelector, void * theControlData)
  42. {
  43. OSStatus    status;
  44.  
  45.     status = StorageClassDriverControl(theControlSelector, theControlData);
  46.  
  47.     return status;
  48. }
  49.  
  50. OSStatus StorageStatus(UInt32 theInfoSelector, void *theInfo)
  51. {
  52. #pragma unused (theInfoSelector, theInfo)
  53. OSStatus    status;
  54.  
  55.     status = StorageClassDriverStatus(theInfoSelector, theInfo);
  56.  
  57.     return status;
  58. }
  59.  
  60. OSStatus StorageExecuteCommand(StorageExecuteCommandPBPtr storageExecuteCommandPBPtr)
  61. {
  62. OSStatus    status;
  63.  
  64.     status = StorageClassDriverExecuteCommand(storageExecuteCommandPBPtr);
  65.     
  66.     return status;
  67. }
  68.  
  69.  
  70.  
  71. StorageClassDispatchTable TheStorageClassDispatchTable =
  72. {
  73.     (UInt32)                        kDispatchTableVersion,
  74.     (StorageInitializeProcPtr)        StorageInitialize,
  75.     (StorageControlProcPtr)            StorageControl,
  76.     (StorageStatusProcPtr)            StorageStatus,
  77.     (StorageExecuteCommandProcPtr)    StorageExecuteCommand
  78. };
  79.