RamDiskCommon.h

/*
**  Apple Macintosh Developer Technical Support
**
**  StandardFileIcons: A sample control panel changing behavior of StandardFile.
**
**  by Gordon Sheridan and Jim Luther
**  modified by Brian Bechtel
**
**  File:       RamDiskCommon.h
**
**  Copyright © 1992-1996 Apple Computer, Inc.
**  All rights reserved.
**
**  You may incorporate this sample code into your applications without
**  restriction, though the sample code has been provided "AS IS" and the
**  responsibility for its operation is 100% yours.  However, what you are
**  not permitted to do is to redistribute the source as "DTS Sample Code"
**  after having made changes. If you're going to re-distribute the source,
**  we require that you make it clear in the source that the code was
**  descended from Apple Sample Code, but that you've made changes.
**
** Change History (most recent first):
** 
**   <1.4>  970207      Quinn   Renamed to RamDiskCommon.h.  Now only contains stuff
**                              that actually needs to be shared.  The other stuff
**                              has been made private to the corresponding source file.
**   <4>    960807      BL¡B    Added DriverGestalt.h, set no OLDROUTINENAMES
**   <3>    10/14/93    JML     Added Panic debug macros and changed preprocessor constants
**                              to enums.
**   <2>     6/13/93    gs      Move dCtlFlag bits from RamDRVR.c and cleanup header.
**   <1>     8/24/92    gs      first checked in
**/
 
#ifndef OLDROUTINENAMES
#define OLDROUTINENAMES     0
#endif
 
#include <Types.h>
 
#if __DebugVersion
    extern  pascal  void    Panic       (unsigned char *    Message)    = 0xABFF;
    #define PanicIf(condition, message) if (condition) Panic(message)
#else
    #define Panic(param)
    #define PanicIf(param1,param2)
#endif
 
///////////////////////////////////////////////////////////////////////////
//
// Our driver specific _Control and _Status code.  Shared between
// the INIT and the DRVR.  Note that by saying we support DriverGestalt
// (in our dctlFlags) we guarantee that (amongst other things) our driver
// won't use control or status code below 128 for private calls.  Hence
// the choice of control codes here.
 
enum {
    setGlobalsCC = 128,     /* copy data pointed to by csParam to driver globals */
    getGlobalsSC = 128      /* return pointer to driver globals */
};
 
///////////////////////////////////////////////////////////////////////////
//
// Driver globals structure created by INIT and passed to DRVR.
 
struct DrvrGlobals
{
    Ptr         ramDisk;
    long        ramSize;
    short       driveNumber;
    Str255      volumeName;
    long        physicalIcon[kLargeIconSize/4]; /* IMPORTANT: icon and whereString must be  */
    Str255      locationStr;                    /* end-to-end in memory! */
    long        mediaIcon[kLargeIconSize/4];
    Boolean     driveNeedsFlush;
    NumVersion  driverVersion;
};
typedef struct DrvrGlobals DrvrGlobals, *DrvrGlobalsPtr, **DrvrGlobalsHandle;
 
///////////////////////////////////////////////////////////////////////////
//
// Configuration record, created and put into the resource fork by the cdev,
// read out and used by the INIT.
 
struct ConfigRec
{
    short       install;    /* boolean true/false */
    long        size;
    Str255      volumeName;
};
typedef struct ConfigRec ConfigRec, *ConfigRecPtr, **ConfigRecHandle;
 
///////////////////////////////////////////////////////////////////////////
//
// Common resource definitions.
 
enum {
    // RDcf
    rConfiguration = 0,             // Resource ID of the 'RDcf' configuration resource.
 
    // STR#
    rStringList     =   -4033,
        strLocationStr      = 1,    /* The "where" string used in the Get Info dialog */
        strDefaultNameStr   = 2     /* The initial default volume name */
};