home *** CD-ROM | disk | FTP | other *** search
/ AMIGA PD 1 / AMIGA-PD-1.iso / Programme_zum_Heft / Programmieren / Kurztests / PascalPCQ / Include / Libraries / FileHandler.i < prev    next >
Text File  |  1990-08-28  |  5KB  |  115 lines

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