syslinux-3.08-2 sources from FC4
[bootcd.git] / syslinux / libfat / libfatint.h
1 #ident "$Id: libfatint.h,v 1.2 2004/12/15 20:29:17 hpa Exp $"
2 /* ----------------------------------------------------------------------- *
3  *   
4  *   Copyright 2004 H. Peter Anvin - All Rights Reserved
5  *
6  *   This program is free software; you can redistribute it and/or modify
7  *   it under the terms of the GNU General Public License as published by
8  *   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
9  *   Boston MA 02111-1307, USA; either version 2 of the License, or
10  *   (at your option) any later version; incorporated herein by reference.
11  *
12  * ----------------------------------------------------------------------- */
13
14 /*
15  * libfatint.h
16  *
17  * Internals for the libfat filesystem
18  */
19
20 #ifndef LIBFATINT_H
21 #define LIBFATINT_H
22
23 #include "libfat.h"
24 #include "fat.h"
25
26 struct libfat_sector {
27   libfat_sector_t n;            /* Sector number */
28   struct libfat_sector *next;   /* Next in list */
29   char data[LIBFAT_SECTOR_SIZE];
30 };
31
32 enum fat_type {
33   FAT12,
34   FAT16,
35   FAT28
36 };
37
38 struct libfat_filesystem {
39   int (*read)(intptr_t, void *, size_t, libfat_sector_t);
40   intptr_t readptr;
41  
42   enum fat_type fat_type;
43   unsigned int clustsize;
44   int clustshift;
45   int32_t endcluster;           /* Highest legal cluster number + 1 */
46   int32_t rootcluster;          /* Root directory cluster */
47
48   libfat_sector_t fat;          /* Start of FAT */
49   libfat_sector_t rootdir;      /* Start of root directory */
50   libfat_sector_t data;         /* Start of data area */
51   libfat_sector_t end;          /* End of filesystem */
52
53   struct libfat_sector *sectors;
54 };
55
56 #endif /* LIBFATINT_H */