Mac OS 9
Disks.h
Go to the documentation of this file.
1 
19 #ifndef __DISKS__
20 #define __DISKS__
21 
22 #ifndef __MACTYPES__
23 #include <MacTypes.h>
24 #endif
25 
26 #ifndef __OSUTILS__
27 #include <OSUtils.h>
28 #endif
29 
30 #ifndef __FILES__
31 #include <Files.h>
32 #endif
33 
34 #if PRAGMA_ONCE
35 #pragma once
36 #endif
37 
38 #ifdef __cplusplus
39 extern "C"
40 {
41 #endif
42 
43 #if PRAGMA_IMPORT
44 #pragma import on
45 #endif
46 
47 #if PRAGMA_STRUCT_ALIGN
48 #pragma options align = mac68k
49 #elif PRAGMA_STRUCT_PACKPUSH
50 #pragma pack(push, 2)
51 #elif PRAGMA_STRUCT_PACK
52 #pragma pack(2)
53 #endif
54 
55  enum
56  {
57  sony = 0,
58  hard20 = 1
59  };
60 
61  /* Disk Driver Status csCodes */
62  enum
63  {
64  kReturnFormatList = 6, /* .Sony */
65  kDriveStatus = 8,
66  kMFMStatus = 10
67  };
68 
69  /* Disk Driver Control csCodes */
70  enum
71  {
72  kVerify = 5,
73  kFormat = 6,
74  kEject = 7,
75  kSetTagBuffer = 8, /* .Sony */
76  kTrackCache = 9, /* .Sony */
77  kDriveIcon = 21,
78  kMediaIcon = 22,
79  kDriveInfo = 23,
80  kRawTrack = 18244 /* .Sony: �diagnostic� raw track dump */
81  };
82 
99  struct DrvSts
100  {
101  short track; /* current track */
102  char writeProt; /* bit 7 = 1 if volume is locked */
103  char diskInPlace; /* disk in drive */
104  char installed; /* drive installed */
105  char sides; /* -1 for 2-sided, 0 for 1-sided */
106  QElemPtr qLink; /* next queue entry */
107  short qType; /* 1 for HD20 */
108  short dQDrive; /* drive number */
109  short dQRefNum; /* driver reference number */
110  short dQFSID; /* file system ID */
111  char twoSideFmt; /* after 1st rd/wrt: 0=1 side, -1=2 side */
112  char needsFlush; /* -1 for MacPlus drive */
113  short diskErrs; /* soft error count */
114  };
115  typedef struct DrvSts DrvSts;
116  struct DrvSts2
117  {
118  short track;
119  char writeProt;
120  char diskInPlace;
121  char installed;
122  char sides;
123  QElemPtr qLink;
124  short qType;
125  short dQDrive;
126  short dQRefNum;
127  short dQFSID;
128  short driveSize;
129  short driveS1;
130  short driveType;
131  short driveManf;
132  short driveChar;
133  char driveMisc;
134  };
135  typedef struct DrvSts2 DrvSts2;
136 /* Macros to get a DrvSts pointer or a DrvSts2 pointer from a DrvQEl pointer. */
137 /* Note: If you use these macros, your source file must include stddef.h to get
138  * offsetof */
139 #define GetDrvStsPtrFromDrvQElPtr(driveQElement) \
140  ((DrvSts *)((BytePtr)driveQElement - offsetof(DrvSts, qLink)))
141 #define GetDrvSts2PtrFromDrvQElPtr(driveQElement) \
142  ((DrvSts2 *)((BytePtr)driveQElement - offsetof(DrvSts2, qLink)))
143  enum
144  {
145  kdqManualEjectBit = 5
146  };
147 
148 #if CALL_NOT_IN_CARBON
149 #if CALL_NOT_IN_CARBON
158  OSErr
159  DiskEject(short drvNum);
160 
169  OSErr
170  SetTagBuffer(void *buffPtr);
171 
180  OSErr
181  DriveStatus(short drvNum, DrvSts *status);
182 
183 #endif /* CALL_NOT_IN_CARBON */
184 
185 #endif /* CALL_NOT_IN_CARBON */
186 
187 #if CALL_NOT_IN_CARBON
188 
204  void
205  AddDrive(short drvrRefNum, short drvNum, DrvQElPtr qEl);
206 
207 #endif /* CALL_NOT_IN_CARBON */
208 
209 #if CALL_NOT_IN_CARBON
210 #if CALL_NOT_IN_CARBON
211 
247  long totBlks;
248  Boolean locked, oneSide, empty;
249  qhp = GetDrvQHdr(); /* address of queue header */
250  qep = (DrvQEl *)qhp->qHead; /* address of a queue element */
251  printf("Drv# FileSys Blocks locked 1-sided empty\n");
252  do
253  {
254  bp = (Byte *)qep;
255  bp -= 4; /* point to structure prefix bytes */
256  </ pre>
257  * \copyright THINK Reference © 1991 - 1992 Symantec Corporation
258  * \non_carbon_cfm in InterfaceLib 7.1 and
259  later
260  * \carbon_lib not available * \mac_os_x not available *
261  /
262  QHdrPtr
263  GetDrvQHdr(void);
264 
265 #endif /* CALL_NOT_IN_CARBON */
266 
267 #endif /* CALL_NOT_IN_CARBON */
268 
269  /*��������������������������������������������������������������������������������������������������*/
270  /* Obsolete definitions */
271  /*��������������������������������������������������������������������������������������������������*/
272  /* Status csCode previously defined in Devices.h/p/a.
273  * This is obsolete and the new name should be used instead.
274  */
275  enum
276  {
277  drvStsCode = kDriveStatus /* status call code for drive status */
278  };
279 
280  /* Control csCodes previously defined in Devices.h/p/a.
281  * These are obsolete and the new names should be used instead.
282  */
283  enum
284  {
285  ejectCode = kEject, /* control call eject code */
286  tgBuffCode = kSetTagBuffer /* set tag buffer code */
287  };
288 
289  /* Control csCodes previously defined in DriverGestalt.h/p/a.
290  * These are obsolete and the new names should be used instead.
291  */
292  enum
293  {
294  VerifyCmd = kVerify,
295  FormatCmd = kFormat,
296  EjectCmd = kEject
297  };
298 
299 #if PRAGMA_STRUCT_ALIGN
300 #pragma options align = reset
301 #elif PRAGMA_STRUCT_PACKPUSH
302 #pragma pack(pop)
303 #elif PRAGMA_STRUCT_PACK
304 #pragma pack()
305 #endif
306 
307 #ifdef PRAGMA_IMPORT_OFF
308 #pragma import off
309 #elif PRAGMA_IMPORT
310 #pragma import reset
311 #endif
312 
313 #ifdef __cplusplus
314  }
315 #endif
316 
317 #endif /* __DISKS__ */
318  */*/
long totBlks
Obtain pointer to the drive queue header.
Definition: Disks.h:247
OSErr DiskEject(short drvNum)
OSErr SetTagBuffer(void *buffPtr)
void AddDrive(short drvrRefNum, short drvNum, DrvQElPtr qEl)
Add a drive to the drive queue.
OSErr DriveStatus(short drvNum, DrvSts *status)
File Manager (MFS, HFS, and HFS+) Interfaces.
printf("First vcb is at = %lx\n", qhp->qHead)
Obtain pointer to the volume control block queue header.
Basic Macintosh data types.
unsigned char Boolean
Definition: MacTypes.h:318
OS Utilities Interfaces.
Definition: Files.h:1429
Definition: Disks.h:117
Definition: Disks.h:100
Definition: OSUtils.h:131
Definition: OSUtils.h:154