home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_07_04 / v7n4039a.txt < prev    next >
Text File  |  1988-09-13  |  3KB  |  70 lines

  1. #ifndef BYTE_DEF
  2. typedef unsigned char byte;
  3. typedef unsigned short word;
  4. #define BYTE_DEF
  5. #endif
  6.  
  7. /*------------------------------------------------------*/
  8. /*  This is the structure of a ProDos directory entry.  */
  9. /*  Reference: "Beneath Apple ProDOS", Worth & Lechner  */
  10. /*------------------------------------------------------*/
  11. struct pro_dir {
  12.     byte typ_len;            /* Hi Nibble-> Type of entry, Lo->length of fname */
  13.     byte fname[15];            /* File name */
  14.     byte type;                /* File Type */
  15.     word key_ptr;           /* File "key block", block number */
  16.     word fsize;             /* File size in blocks (includes index blocks */
  17.     byte file_len[3];       /* File length in bytes (data only) */
  18.     word date;              /* Creation date */
  19.     word time;                /* Creation time */
  20.     byte version;            /* Version of ProDOS created under */
  21.     byte min_vers;            /* minimum version of ProDOS supported */
  22.     byte permiss;            /* Read/Write etc... permissions */
  23.     word aux_type;            /* Auxillary file type (or misc use) */
  24.     word moddate;           /* last modified date and time */
  25.     word modtime;            
  26.     word head_ptr;          /* Pointer to Key block of the directory */
  27. };
  28.  
  29. /*----------------------------------------------------------------------*/
  30. /* This is the structure of a ProDOS directory block.                   */
  31. /*  Reference: "Beneath Apple ProDOS", Worth & Lechner                  */
  32. /*----------------------------------------------------------------------*/
  33. struct pro_block {
  34.     word prev;                /* Sector of previous directory block */
  35.     word next;                /* Sector of next directory block */
  36.     struct pro_dir dir[13]; /* 13 directory entries           */
  37. };
  38.  
  39. /*----------------------------------------------------------------------*/
  40. /* This is the structure of the ProDOS Volume directory entry.          */
  41. /* The volume entry is the first directory entry of the (dir[0])        */
  42. /* ProDOS root directory.                                               */
  43. /*  Reference: "Beneath Apple ProDOS", Worth & Lechner                  */
  44. /*----------------------------------------------------------------------*/
  45. struct vol_entry {
  46.     byte typ_len;        /* type of entry and length of volume name */
  47.     byte vol_name[15];    /* Volume name */
  48.     byte reserve[8];    /* Reserved for future use. */
  49.     word date;            /* Volume creation date */
  50.     word time;            /* Volume creation time */
  51.     byte version;        /* Version of ProDOS volume was created under */
  52.     byte min_vers;        /* Mininum version of ProDOS supported */
  53.     byte permiss;        /* Read/Write/Archive permission's etc... */
  54.     byte entry_len;        /* Len of each entry in Volume directory (0x27) */
  55.     byte entries_per_blk;    /* No. of entries per block. (0x0d) */
  56.     word file_cnt;        /* Number of active directory entries. */
  57.     word bit_map_ptr;    /* Block No. of first Volume bit map block */
  58.     word total_blks;    /* Total number of blocks in Volume */
  59. };
  60.  
  61. /*----------------------------------------------------------------------*/
  62. /* This is the structure of the Volume directory block.                 */
  63. /*----------------------------------------------------------------------*/
  64. struct pro_volume {
  65.     word prev;
  66.     word next;
  67.     struct vol_entry vol;
  68.     struct pro_dir dir[12];
  69. };
  70.