fat.h revision 7e7bd3dccbfe8f79e25e5c1554b5bc3a9aaca321
/*
libparted
Copyright (C) 1998-2001, 2007 Free Software Foundation, Inc.
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef FAT_H_INCLUDED
#define FAT_H_INCLUDED
#if ENABLE_NLS
# include <libintl.h>
#else
#endif /* ENABLE_NLS */
#include <stdlib.h>
#include <fcntl.h>
typedef uint32_t FatCluster;
typedef int32_t FatFragment;
enum _FatType {
};
typedef struct _FatSpecific FatSpecific;
typedef struct _FatDirEntry FatDirEntry;
/* FIXME: YUCKY */
#include "table.h"
#include "bootsector.h"
#include "context.h"
#include "fatio.h"
#include "traverse.h"
#include "calc.h"
#include "count.h"
#include "clstdup.h"
#ifdef __sun
#define __attribute__(X) /*nothing*/
#endif /* __sun */
#ifdef __sun
#pragma pack(1)
#endif
char name[8];
};
#ifdef __sun
#pragma pack()
#endif
struct _FatSpecific {
int logical_sector_size; /* illogical sector size :-) */
int sectors_per_track; /* BIOS CHS stuff (S) */
int heads; /* BIOS CHS stuff (H) */
int cluster_size;
int fat_table_count;
int root_dir_entry_count; /* non-FAT32 */
char* buffer;
int frag_size;
};
#define FAT_ROOT 0
#define DELETED_FLAG 0xe5
#define READONLY_ATTR 0x01
#define HIDDEN_ATTR 0x02
#define SYSTEM_ATTR 0x04
#define VOLUME_LABEL_ATTR 0x08
#define VFAT_ATTR 0x0f
#define DIRECTORY_ATTR 0x10
#define ARCH_ATTR 0x20
#define MAX_FAT12_CLUSTERS 4086
#define MAX_FAT16_CLUSTERS 65526
#define MAX_FAT32_CLUSTERS 2000000
#define FAT_ROOT_DIR_ENTRY_COUNT 512
extern PedFileSystemType fat16_type;
extern PedFileSystemType fat32_type;
#endif /* FAT_H_INCLUDED */