#ifndef FATINTERNAL_H_
#define FATINTERNAL_H_

#define FAT_READONLY


typedef enum{
    PARTITION_FAT16=6
}PARTITION_TYPE;

typedef struct{
    bool bMount;
    //
    unsigned int PartitionStartSecter;
    unsigned int BPB_BytsPerSec;
    unsigned int BPB_SecPerCluster;
    unsigned int BPB_RsvdSecCnt;
    unsigned int BPB_NumFATs;
    unsigned int BPB_RootEntCnt;
    unsigned int BPB_FATSz;
    //
    unsigned int nBytesPerCluster;
    unsigned int FatEntrySecter;
    unsigned int RootDirectoryEntrySecter;
    unsigned int DataEntrySecter;
    //
#ifdef FAT_READONLY    
    char *szFatTable; // read into memory for speedup
#endif    
    
}VOLUME_INFO;

typedef enum{
    CLUSTER_UNUSED,
    CLUSTER_RESERVED,
    CLUSTER_BAD,
    CLUSTER_LAST_INFILE,
    CLUSTER_NEXT_INFILE
}CLUSTER_TYPE;


#define ATTR_IBUTE_VOLUME_BIT       (0x01)
#define ATTRIBUTE_DIRECTORY_BIT    (0x01 << 1)
#define ATTRIBUTE_SYSTEM_BIT       (0x01 << 2)
#define ATTRIBUTE_READONLY_BIT     (0x01 << 3)
#define ATTRIBUTE_ARCHIVE_BIT      (0x01 << 4)
#define ATTRIBUTE__BIT             (0x01 << 5)

#define ATTR_READ_ONLY 0x01
#define ATTR_HIDDEN 0x02
#define ATTR_SYSTEM 0x04
#define ATTR_VOLUME_ID 0x08
#define ATTR_DIRECTORY 0x10
#define ATTR_ARCHIVE 0x20
#define ATTR_LONG_NAME (ATTR_READ_ONLY |ATTR_HIDDEN |ATTR_SYSTEM |ATTR_VOLUME_ID)



#endif /*FATINTERNAL_H_*/
