Mac OS 9
Disks.h File Reference

Disk Driver Interfaces. More...

#include <MacTypes.h>
#include <OSUtils.h>
#include <Files.h>

Go to the source code of this file.

Data Structures

struct  DrvSts
 
struct  DrvSts2
 

Macros

#define GetDrvStsPtrFromDrvQElPtr(driveQElement)    ((DrvSts *)((BytePtr)driveQElement - offsetof(DrvSts, qLink)))
 
#define GetDrvSts2PtrFromDrvQElPtr(driveQElement)    ((DrvSts2 *)((BytePtr)driveQElement - offsetof(DrvSts2, qLink)))
 

Typedefs

typedef struct DrvSts DrvSts
 
typedef struct DrvSts2 DrvSts2
 

Enumerations

enum  { sony = 0 , hard20 = 1 }
 
enum  { kReturnFormatList = 6 , kDriveStatus = 8 , kMFMStatus = 10 }
 
enum  {
  kVerify = 5 , kFormat = 6 , kEject = 7 , kSetTagBuffer = 8 ,
  kTrackCache = 9 , kDriveIcon = 21 , kMediaIcon = 22 , kDriveInfo = 23 ,
  kRawTrack = 18244
}
 
enum  { kdqManualEjectBit = 5 }
 
enum  { drvStsCode = kDriveStatus }
 
enum  { ejectCode = kEject , tgBuffCode = kSetTagBuffer }
 
enum  { VerifyCmd = kVerify , FormatCmd = kFormat , EjectCmd = kEject }
 

Functions

OSErr DiskEject (short drvNum)
 
OSErr SetTagBuffer (void *buffPtr)
 
OSErr DriveStatus (short drvNum, DrvSts *status)
 
void AddDrive (short drvrRefNum, short drvNum, DrvQElPtr qEl)
 Add a drive to the drive queue. More...
 
 printf ("Drv# FileSys Blocks locked 1-sided empty\n")
 

Variables

long totBlks
 Obtain pointer to the drive queue header. More...
 
Boolean locked
 
Boolean oneSide
 
Boolean empty
 
 qhp = GetDrvQHdr()
 
 qep = (DrvQEl *)qhp->qHead
 
 do
 
 bp = 4
 
</pre > *par Copyright
 

Detailed Description

Disk Driver Interfaces.

Introduced In: System 7.5
Avaliable From: Universal Interfaces 3.4.1
Copyright: � 1985-2001 by Apple Computer, Inc., all rights reserved

For bug reports, consult the following page on the World Wide Web:

http://developer.apple.com/bugreporter/

Function Documentation

◆ AddDrive()

void AddDrive ( short  drvrRefNum,
short  drvNum,
DrvQElPtr  qEl 
)

Add a drive to the drive queue.

AddDrive adds a drive to the drive queue.
drvrRefNum driver reference number
drvNum drive number being added
qElpointer to DrvQEl structure
Returns
an operating system Error Code .
Copyright: THINK Reference © 1991-1992 Symantec Corporation
Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: not available
Mac OS X: not available

◆ DiskEject()

OSErr DiskEject ( short  drvNum)

DiskEject()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: not available
Mac OS X: not available

◆ DriveStatus()

OSErr DriveStatus ( short  drvNum,
DrvSts status 
)

DriveStatus()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: not available
Mac OS X: not available

◆ SetTagBuffer()

OSErr SetTagBuffer ( void *  buffPtr)

SetTagBuffer()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: not available
Mac OS X: not available

Variable Documentation

◆ do

do
Initial value:
{
bp = (Byte *)qep

◆ totBlks

long totBlks

Obtain pointer to the drive queue header.

GetDrvQHdr returns the address of the header of the standard Operating
System queue used to maintain the linked-list of disk drive information
records. There is one DrvQEl entry for each physical drive attached to the Mac.
Returns
a 32-bit QHdrPtr; the address of the 10-byte QHdr structure whose
qLink field points to the first DrvQEl structure in the queue.
Note
C programmers may prefer to get this address from the global variable
DrvQHdr (at 0x0308).
You can use this function to obtain information about drives attached to the
system; it may be the only way to get this collection of information. If you
need to monkey with this queue, you can use Enqueue and Dequeue .
In addition to the information in the DrvQEl structure, there are four
bytes of additional data that precede each element. The following describes
these prefix bytes:
OffsetDescription
-4(bit 7 set) = disk is locked (write-protected)
-30 = no disk in drive
1 or 2 = disk is in drive
8 = non-ejectable disk
FCh...FFh = disk was ejected within last 1.5 seconds
48h = non-ejectable disk, but driver expects a call
-2(used internally during system startup)
-1(bit 7 clear) = drive supports only single-sided media
The following example reads the elements of the drive queue and displays
information about all drives attached to the system.
Example
#include < Files.h>
#include < OSUtils.h >
QHdrPtr qhp; // address of a QHdr structure
DrvQEl qep;
  Byte *bp; / helps to decode prefix bytes