home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / TRSICAT.LZX / CATS_CD2_TRSI / Inc&AD1.3 / Includes / libraries / filehandler.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-12  |  4.9 KB  |  121 lines

  1. #ifndef LIBRARIES_FILEHANDLER_H
  2. #define LIBRARIES_FILEHANDLER_H
  3. /*
  4. **    $Filename: libraries/filehandler.h $
  5. **    $Release: 1.3 $
  6. **
  7. **    device and file handler specific code for AmigaDOS 
  8. **
  9. **    (C) Copyright 1986,1987,1988 Commodore-Amiga, Inc.
  10. **        All Rights Reserved
  11. */
  12.  
  13. #ifndef      EXEC_TYPES_H
  14. #include "exec/types.h"
  15. #endif     !EXEC_TYPES_H
  16.  
  17. #ifndef      EXEC_PORTS_H
  18. #include "exec/ports.h"
  19. #endif     !EXEC_PORTS_H
  20.  
  21. #ifndef      LIBRARIES_DOS_H
  22. #include "libraries/dos.h"
  23. #endif     !LIBRARIES_DOS_H
  24.  
  25.  
  26. /* The disk "environment" is a longword array that describes the
  27.  * disk geometry.  It is variable sized, with the length at the beginning.
  28.  * Here are the constants for a standard geometry.
  29.  */
  30.  
  31. struct DosEnvec {
  32.     ULONG de_TableSize;         /* Size of Environment vector */
  33.     ULONG de_SizeBlock;         /* in longwords: standard value is 128 */
  34.     ULONG de_SecOrg;         /* not used; must be 0 */
  35.     ULONG de_Surfaces;         /* # of heads (surfaces). drive specific */
  36.     ULONG de_SectorPerBlock; /* not used; must be 1 */
  37.     ULONG de_BlocksPerTrack; /* blocks per track. drive specific */
  38.     ULONG de_Reserved;         /* DOS reserved blocks at start of partition. */
  39.     ULONG de_PreAlloc;         /* DOS reserved blocks at end of partition */
  40.     ULONG de_Interleave;     /* usually 0 */
  41.     ULONG de_LowCyl;         /* starting cylinder. typically 0 */
  42.     ULONG de_HighCyl;         /* max cylinder. drive specific */
  43.     ULONG de_NumBuffers;     /* Initial # DOS of buffers.  */
  44.     ULONG de_BufMemType;     /* type of mem to allocate for buffers */
  45.     ULONG de_MaxTransfer;    /* Max number of bytes to transfer at a time */
  46.     ULONG de_Mask;         /* Address Mask to block out certain memory */
  47.     LONG  de_BootPri;         /* Boot priority for autoboot */
  48.     ULONG de_DosType;         /* ASCII (HEX) string showing filesystem type;
  49.                   * 0X444F5300 is old filesystem,
  50.                   * 0X444F5301 is fast file system */
  51. };
  52.  
  53. /* these are the offsets into the array */
  54.  
  55. #define DE_TABLESIZE    0    /* standard value is 11 */
  56. #define DE_SIZEBLOCK    1    /* in longwords: standard value is 128 */
  57. #define DE_SECORG    2    /* not used; must be 0 */
  58. #define DE_NUMHEADS    3    /* # of heads (surfaces). drive specific */
  59. #define DE_SECSPERBLK    4    /* not used; must be 1 */
  60. #define DE_BLKSPERTRACK 5    /* blocks per track. drive specific */
  61. #define DE_RESERVEDBLKS 6    /* unavailable blocks at start.     usually 2 */
  62. #define DE_PREFAC    7    /* not used; must be 0 */
  63. #define DE_INTERLEAVE    8    /* usually 0 */
  64. #define DE_LOWCYL    9    /* starting cylinder. typically 0 */
  65. #define DE_UPPERCYL    10    /* max cylinder.  drive specific */
  66. #define DE_NUMBUFFERS    11    /* starting # of buffers.  typically 5 */
  67. #define DE_MEMBUFTYPE    12    /* type of mem to allocate for buffers. */
  68. #define DE_BUFMEMTYPE    12    /* same as above, better name
  69.                  * 1 is public, 3 is chip, 5 is fast */
  70. #define DE_MAXTRANSFER    13    /* Max number bytes to transfer at a time */
  71. #define DE_MASK        14    /* Address Mask to block out certain memory */
  72. #define DE_BOOTPRI    15    /* Boot priority for autoboot */
  73. #define DE_DOSTYPE    16    /* ASCII (HEX) string showing filesystem type;
  74.                  * 0X444F5300 is old filesystem,
  75.                  * 0X444F5301 is fast file system */
  76.  
  77. /* The file system startup message is linked into a device node's startup
  78. ** field.  It contains a pointer to the above environment, plus the
  79. ** information needed to do an exec OpenDevice().
  80. */
  81. struct FileSysStartupMsg {
  82.     ULONG    fssm_Unit;    /* exec unit number for this device */
  83.     BSTR    fssm_Device;    /* null terminated bstring to the device name */
  84.     BPTR    fssm_Environ;    /* ptr to environment table (see above) */
  85.     ULONG    fssm_Flags;    /* flags for OpenDevice() */
  86. };
  87.  
  88.  
  89. /* The include file "libraries/dosextens.h" has a DeviceList structure.
  90.  * The "device list" can have one of three different things linked onto
  91.  * it.    Dosextens defines the structure for a volume.  DLT_DIRECTORY
  92.  * is for an assigned directory.  The following structure is for
  93.  * a dos "device" (DLT_DEVICE).
  94. */
  95.  
  96. struct DeviceNode {
  97.     BPTR    dn_Next;    /* singly linked list */
  98.     ULONG    dn_Type;    /* always 0 for dos "devices" */
  99.     struct MsgPort *dn_Task;    /* standard dos "task" field.  If this is
  100.                  * null when the node is accesses, a task
  101.                  * will be started up */
  102.     BPTR    dn_Lock;    /* not used for devices -- leave null */
  103.     BSTR    dn_Handler;    /* filename to loadseg (if seglist is null) */
  104.     ULONG    dn_StackSize;    /* stacksize to use when starting task */
  105.     LONG    dn_Priority;    /* task priority when starting task */
  106.     BPTR    dn_Startup;    /* startup msg: FileSysStartupMsg for disks */
  107.     BPTR    dn_SegList;    /* code to run to start new task (if necessary).
  108.                  * if null then dn_Handler will be loaded. */
  109.     BPTR    dn_GlobalVec;    /* BCPL global vector to use when starting
  110.                  * a task.  -1 means that dn_SegList is not
  111.                  * for a bcpl program, so the dos won't
  112.                  * try and construct one.  0 tell the
  113.                  * dos that you obey BCPL linkage rules,
  114.                  * and that it should construct a global
  115.                  * vector for you.
  116.                  */
  117.     BSTR    dn_Name;    /* the node name, e.g. '\3','D','F','3' */
  118. };
  119.  
  120. #endif    /* LIBRARIES_FILEHANDLER_H */
  121.