home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 6 File / 06-File.zip / fst03f.zip / fat.h < prev    next >
C/C++ Source or Header  |  1996-01-09  |  2KB  |  92 lines

  1. /* fat.h -- FAT definitions
  2.    Copyright (c) 1995-1996 by Eberhard Mattes
  3.  
  4. This file is part of fst.
  5.  
  6. fst is free software; you can redistribute it and/or modify it
  7. under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2, or (at your option)
  9. any later version.
  10.  
  11. fst is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with fst; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 59 Temple Place - Suite 330,
  19. Boston, MA 02111-1307, USA.  */
  20.  
  21.  
  22. #pragma pack(1)
  23.  
  24. typedef struct
  25. {
  26.   BYTE name[8+3];
  27.   BYTE attr;
  28.   BYTE reserved[8];
  29.   USHORT ea;
  30.   USHORT time;
  31.   USHORT date;
  32.   USHORT cluster;
  33.   ULONG size;
  34. } FAT_DIRENT;
  35.  
  36. typedef struct
  37. {
  38.   BYTE flag;
  39.   USHORT name1[5];
  40.   BYTE attr;
  41.   BYTE reserved;
  42.   BYTE checksum;
  43.   USHORT name2[6];
  44.   USHORT cluster;
  45.   USHORT name3[2];
  46. } VFAT_DIRENT;
  47.  
  48. typedef union
  49. {
  50.   BYTE raw[512];
  51.   struct
  52.     {
  53.       BYTE   jump[3];
  54.       BYTE   oem[8];
  55.       USHORT bytes_per_sector;
  56.       BYTE   sectors_per_cluster;
  57.       USHORT reserved_sectors;
  58.       BYTE   fats;
  59.       USHORT root_entries;
  60.       USHORT sectors;
  61.       BYTE   media;
  62.       USHORT sectors_per_fat;
  63.       USHORT sectors_per_track;
  64.       USHORT heads;
  65.       USHORT hidden_sectors_lo;
  66.       USHORT hidden_sectors_hi;
  67.       ULONG  large_sectors;
  68.       BYTE   drive_no;
  69.       BYTE   reserved;
  70.       BYTE   extended_sig;
  71.       ULONG  vol_id;
  72.       BYTE   vol_label[11];
  73.       BYTE   vol_type[8];
  74.     } boot;
  75.   struct
  76.     {
  77.       BYTE   magic[2];          /* "ED" */
  78.       USHORT unused[15];
  79.       USHORT table[240];
  80.     } ea1;
  81.   struct
  82.     {
  83.       BYTE    magic[2];         /* "EA" */
  84.       USHORT  rel_cluster;
  85.       ULONG   need_eas;
  86.       BYTE    name[14];
  87.       BYTE    unknown[4];
  88.       FEALIST fealist;
  89.     } ea3;
  90.   } FAT_SECTOR;
  91. #pragma pack()
  92.