Disks.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:5k
源码类别:

多媒体编程

开发平台:

Visual C++

  1. /*
  2.      File:       Disks.h
  3.  
  4.      Contains:   Disk Driver Interfaces.
  5.  
  6.      Version:    Technology: System 7.5
  7.                  Release:    QuickTime 6.0.2
  8.  
  9.      Copyright:  (c) 1985-2001 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:      For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __DISKS__
  18. #define __DISKS__
  19. #ifndef __MACTYPES__
  20. #include "MacTypes.h"
  21. #endif
  22. #ifndef __OSUTILS__
  23. #include "OSUtils.h"
  24. #endif
  25. #if PRAGMA_ONCE
  26. #pragma once
  27. #endif
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. #if PRAGMA_IMPORT
  32. #pragma import on
  33. #endif
  34. #if PRAGMA_STRUCT_ALIGN
  35.     #pragma options align=mac68k
  36. #elif PRAGMA_STRUCT_PACKPUSH
  37.     #pragma pack(push, 2)
  38. #elif PRAGMA_STRUCT_PACK
  39.     #pragma pack(2)
  40. #endif
  41. enum {
  42.     sony                        = 0,
  43.     hard20                      = 1
  44. };
  45. /* Disk Driver Status csCodes */
  46. enum {
  47.     kReturnFormatList           = 6,                            /* .Sony */
  48.     kDriveStatus                = 8,
  49.     kMFMStatus                  = 10
  50. };
  51. /* Disk Driver Control csCodes */
  52. enum {
  53.     kVerify                     = 5,
  54.     kFormat                     = 6,
  55.     kEject                      = 7,
  56.     kSetTagBuffer               = 8,                            /* .Sony */
  57.     kTrackCache                 = 9,                            /* .Sony */
  58.     kDriveIcon                  = 21,
  59.     kMediaIcon                  = 22,
  60.     kDriveInfo                  = 23,
  61.     kRawTrack                   = 18244                         /* .Sony: "diagnostic" raw track dump */
  62. };
  63. /*
  64.     Note:
  65.     qLink is usually the first field in queues, but back in the MacPlus
  66.     days, the DrvSts record needed to be expanded.  In order to do this without
  67.     breaking disk drivers that already added stuff to the end, the fields
  68.     where added to the beginning.  This was originally done in assembly language
  69.     and the record was defined to start at a negative offset, so that the qLink
  70.     field would end up at offset zero.  When the C and pascal interfaces where
  71.     made, they could not support negative record offsets, so qLink was no longer
  72.     the first field.  Universal Interfaces are auto generated and don't support
  73.     negative offsets for any language, so DrvSts in Disks.a has qLinks at a
  74.     none zero offset.  Assembly code which switches to Universal Interfaces will
  75.     need to compensate for that.
  76. */
  77. struct DrvSts {
  78.     short                           track;                      /* current track */
  79.     char                            writeProt;                  /* bit 7 = 1 if volume is locked */
  80.     char                            diskInPlace;                /* disk in drive */
  81.     char                            installed;                  /* drive installed */
  82.     char                            sides;                      /* -1 for 2-sided, 0 for 1-sided */
  83.     QElemPtr                        qLink;                      /* next queue entry */
  84.     short                           qType;                      /* 1 for HD20 */
  85.     short                           dQDrive;                    /* drive number */
  86.     short                           dQRefNum;                   /* driver reference number */
  87.     short                           dQFSID;                     /* file system ID */
  88.     char                            twoSideFmt;                 /* after 1st rd/wrt: 0=1 side, -1=2 side */
  89.     char                            needsFlush;                 /* -1 for MacPlus drive */
  90.     short                           diskErrs;                   /* soft error count */
  91. };
  92. typedef struct DrvSts                   DrvSts;
  93. struct DrvSts2 {
  94.     short                           track;
  95.     char                            writeProt;
  96.     char                            diskInPlace;
  97.     char                            installed;
  98.     char                            sides;
  99.     QElemPtr                        qLink;
  100.     short                           qType;
  101.     short                           dQDrive;
  102.     short                           dQRefNum;
  103.     short                           dQFSID;
  104.     short                           driveSize;
  105.     short                           driveS1;
  106.     short                           driveType;
  107.     short                           driveManf;
  108.     short                           driveChar;
  109.     char                            driveMisc;
  110. };
  111. typedef struct DrvSts2                  DrvSts2;
  112. enum {
  113.     kdqManualEjectBit           = 5
  114. };
  115. #if CALL_NOT_IN_CARBON
  116. #if CALL_NOT_IN_CARBON
  117. EXTERN_API( OSErr )
  118. DiskEject                       (short                  drvNum);
  119. EXTERN_API( OSErr )
  120. SetTagBuffer                    (void *                 buffPtr);
  121. EXTERN_API( OSErr )
  122. DriveStatus                     (short                  drvNum,
  123.                                  DrvSts *               status);
  124. #endif  /* CALL_NOT_IN_CARBON */
  125. #endif  /* CALL_NOT_IN_CARBON */
  126. #if PRAGMA_STRUCT_ALIGN
  127.     #pragma options align=reset
  128. #elif PRAGMA_STRUCT_PACKPUSH
  129.     #pragma pack(pop)
  130. #elif PRAGMA_STRUCT_PACK
  131.     #pragma pack()
  132. #endif
  133. #ifdef PRAGMA_IMPORT_OFF
  134. #pragma import off
  135. #elif PRAGMA_IMPORT
  136. #pragma import reset
  137. #endif
  138. #ifdef __cplusplus
  139. }
  140. #endif
  141. #endif /* __DISKS__ */