Main Page | Modules | Namespace List | Data Structures | Directories | File List | Namespace Members | Data Fields | Globals

fat.h File Reference

#include <stdlib.h>
#include "BSenv.h"
#include "fd32time.h"
#include "filesys.h"
#include "errno.h"
#include "devices.h"
#include "../../msd/MSDmanager.h"
#include "nls.h"

Data Structures

struct  __attribute__
struct  __attribute__
struct  __attribute__
struct  __attribute__

Defines

#define FATBUFFERS
#define FATLFN
#define FATWRITE
#define FAT_FD32DEV
#define FAT_MAX_NOF_OPEN_FILES   5
#define FAT_VOLSIG   0x46415456
#define FAT_FILSIG   0x46415446
#define FAT_MAX_FILES   20
#define FAT_MAX_BUFFERS   2
#define FAT_USE_INTERNAL_HEAP
#define FAT12_EOC(EntryValue)   (EntryValue >= 0x0FF8)
#define FAT16_EOC(EntryValue)   (EntryValue >= 0xFFF8)
#define FAT32_EOC(EntryValue)   (EntryValue >= 0x0FFFFFF8)
#define FAT12_BAD   0x0FF7
#define FAT16_BAD   0xFFF7
#define FAT32_BAD   0x0FFFFFF7
#define FREEENT   0xE5
#define ENDOFDIR   0x00
#define FAT_RET_EOF   -0xF7
#define FAT_FANOVOLID   0x37
#define OFF_LST_ACC_DATE_0   (sizeof(BYTE) * 14 + sizeof(WORD) * 2)
#define OFF_NAME0_4_0   (sizeof(BYTE))
#define OFF_NAME0_4_1   (OFF_NAME0_4_0 + 1)
#define OFF_NAME5_10_0   (sizeof(BYTE) * 4 + sizeof(WORD) * 5)
#define OFF_NAME5_10_1   (OFF_NAME5_10_0 + 1)
#define OFF_NAME11_12_0   (sizeof(BYTE) * 4 + sizeof(WORD) * 12)
#define OFF_NAME11_12_1   (OFF_NAME11_12_0 + 1)
#define FIRSTCLUSTER(D)   (((DWORD) D.FstClusHI << 16) + (DWORD) D.FstClusLO)
#define SAMEFILE(F1, F2)   (!memcmp(F1, F2, sizeof(tFileId)))
#define ISROOT(F)   (!FIRSTCLUSTER(F->DirEntry) && !F->DirEntrySector && (F->V->FatType != FAT32))

Enumerations

enum  tFatType { FAT12, FAT16, FAT32 }

Functions

int fat_get_attr (tFile *F, fd32_fs_attr_t *A)
int fat_set_attr (tFile *F, fd32_fs_attr_t *A)
int fat_flushall (tVolume *V)
int fat_writebuf (tVolume *V, int NumBuf)
int fat_readbuf (tVolume *V, DWORD Sector)
int fat_trashbuf (tVolume *V)
int fat_creat (tFile *Fp, tFile *Ff, char *Name, BYTE Attr, WORD AliasHint)
int fat_rename (tVolume *V, char *OldFullName, char *NewFullName)
int fat_unlink (tVolume *V, char *FileName, DWORD Flags)
int fat_rmdir (tVolume *V, char *DirName)
int fat_mkdir (tVolume *V, char *DirName)
int fat12_read_entry (tVolume *V, DWORD N, int FatNum, DWORD *Value)
int fat12_write_entry (tVolume *V, DWORD N, int FatNum, DWORD Value)
int fat12_unlink (tVolume *V, DWORD Cluster)
int fat16_read_entry (tVolume *V, DWORD N, int FatNum, DWORD *Value)
int fat16_write_entry (tVolume *V, DWORD N, int FatNum, DWORD Value)
int fat16_unlink (tVolume *V, DWORD Cluster)
int fat32_read_entry (tVolume *V, DWORD N, int FatNum, DWORD *Value)
int fat32_write_entry (tVolume *V, DWORD N, int FatNum, DWORD Value)
int fat32_unlink (tVolume *V, DWORD Cluster)
BYTE lfn_checksum (tDirEntry *D)
int gen_short_fname (tFile *Dir, char *LongName, BYTE *ShortName, WORD Hint)
int fat_build_fcb_name (const struct nls_operations *nls, BYTE *Dest, char *Source)
int fat_expand_fcb_name (const struct nls_operations *nls, char *Dest, const BYTE *Source, size_t size)
int fat_compare_fcb_names (BYTE *Name1, BYTE *Name2)
int fat_unmount (tVolume *V)
int fat_mount (DWORD hDev, tVolume **NewV)
int fat_partcheck (BYTE PartSig)
int fat_openfiles (tVolume *V)
int fat_isopen (tFileId *Fid)
int fat_syncentry (tFile *F)
void fat_syncpos (tFile *F)
tFilefat_getfile (DWORD FileId)
void fat_split_path (const char *FullPath, char *Path, char *Name)
int fat_open (tVolume *V, char *FileName, DWORD Mode, WORD Attr, WORD AliasHint, tFile **F)
int fat_reopendir (tVolume *V, tFindRes *Id, tFile **F)
int fat_fflush (tFile *F)
int fat_reopen (tFile *F)
int fat_close (tFile *F)
DWORD fat_first_sector_of_cluster (DWORD N, tVolume *V)
void fat_timestamps (WORD *Time, WORD *Date, BYTE *Hund)
int fat_lseek (tFile *F, long long int *Offset, int Origin)
int fat_get_fsinfo (fd32_fs_info_t *Fsi)
int fat_get_fsfree (fd32_getfsfree_t *F)
int fat_find (tFile *F, char *FileSpec, DWORD Flags, tFatFind *FindData)
int fat_readdir (tFile *P, fd32_fs_lfnfind_t *Entry)
int fat_findfirst (tVolume *v, const char *path, int attributes, fd32_fs_dosfind_t *find_data)
int fat_findnext (tVolume *v, fd32_fs_dosfind_t *find_data)
int fat_findfile (tFile *f, const char *name, int flags, fd32_fs_lfnfind_t *find_data)
int fat_lfn_findfirst (tVolume *v, const char *path, int attributes, fd32_fs_lfnfind_t *find_data)
int fat_lfn_findnext (tVolume *v, fd32_fs_lfnfind_t *find_data)
int fat_eof (tFile *F)
int fat_read (tFile *F, void *Buffer, int Size)
int fat_write (tFile *F, void *Buffer, int Size)
int fat_format (DWORD hDev)

Define Documentation

#define ENDOFDIR   0x00
 

#define FAT12_BAD   0x0FF7
 

#define FAT12_EOC EntryValue   )     (EntryValue >= 0x0FF8)
 

#define FAT16_BAD   0xFFF7
 

#define FAT16_EOC EntryValue   )     (EntryValue >= 0xFFF8)
 

#define FAT32_BAD   0x0FFFFFF7
 

#define FAT32_EOC EntryValue   )     (EntryValue >= 0x0FFFFFF8)
 

#define FAT_FANOVOLID   0x37
 

#define FAT_FD32DEV
 

#define FAT_FILSIG   0x46415446
 

#define FAT_MAX_BUFFERS   2
 

#define FAT_MAX_FILES   20
 

#define FAT_MAX_NOF_OPEN_FILES   5
 

#define FAT_RET_EOF   -0xF7
 

#define FAT_USE_INTERNAL_HEAP
 

#define FAT_VOLSIG   0x46415456
 

#define FATBUFFERS
 

#define FATLFN
 

#define FATWRITE
 

#define FIRSTCLUSTER  )     (((DWORD) D.FstClusHI << 16) + (DWORD) D.FstClusLO)
 

#define FREEENT   0xE5
 

#define ISROOT  )     (!FIRSTCLUSTER(F->DirEntry) && !F->DirEntrySector && (F->V->FatType != FAT32))
 

#define OFF_LST_ACC_DATE_0   (sizeof(BYTE) * 14 + sizeof(WORD) * 2)
 

#define OFF_NAME0_4_0   (sizeof(BYTE))
 

#define OFF_NAME0_4_1   (OFF_NAME0_4_0 + 1)
 

#define OFF_NAME11_12_0   (sizeof(BYTE) * 4 + sizeof(WORD) * 12)
 

#define OFF_NAME11_12_1   (OFF_NAME11_12_0 + 1)
 

#define OFF_NAME5_10_0   (sizeof(BYTE) * 4 + sizeof(WORD) * 5)
 

#define OFF_NAME5_10_1   (OFF_NAME5_10_0 + 1)
 

#define SAMEFILE F1,
F2   )     (!memcmp(F1, F2, sizeof(tFileId)))
 


Enumeration Type Documentation

enum tFatType
 

Enumeration values:
FAT12 
FAT16 
FAT32 


Function Documentation

int fat12_read_entry tVolume V,
DWORD  N,
int  FatNum,
DWORD Value
 

int fat12_unlink tVolume V,
DWORD  Cluster
 

int fat12_write_entry tVolume V,
DWORD  N,
int  FatNum,
DWORD  Value
 

int fat16_read_entry tVolume V,
DWORD  N,
int  FatNum,
DWORD Value
 

int fat16_unlink tVolume V,
DWORD  Cluster
 

int fat16_write_entry tVolume V,
DWORD  N,
int  FatNum,
DWORD  Value
 

int fat32_read_entry tVolume V,
DWORD  N,
int  FatNum,
DWORD Value
 

int fat32_unlink tVolume V,
DWORD  Cluster
 

int fat32_write_entry tVolume V,
DWORD  N,
int  FatNum,
DWORD  Value
 

int fat_build_fcb_name const struct nls_operations nls,
BYTE Dest,
char *  Source
 

int fat_close tFile F  ) 
 

int fat_compare_fcb_names BYTE Name1,
BYTE Name2
 

int fat_creat tFile Fp,
tFile Ff,
char *  Name,
BYTE  Attr,
WORD  AliasHint
 

int fat_eof tFile F  ) 
 

int fat_expand_fcb_name const struct nls_operations nls,
char *  Dest,
const BYTE Source,
size_t  size
 

int fat_fflush tFile F  ) 
 

int fat_find tFile F,
char *  FileSpec,
DWORD  Flags,
tFatFind FindData
 

int fat_findfile tFile f,
const char *  name,
int  flags,
fd32_fs_lfnfind_t *  find_data
 

int fat_findfirst tVolume v,
const char *  path,
int  attributes,
fd32_fs_dosfind_t *  find_data
 

int fat_findnext tVolume v,
fd32_fs_dosfind_t *  find_data
 

DWORD fat_first_sector_of_cluster DWORD  N,
tVolume V
 

int fat_flushall tVolume V  ) 
 

int fat_format DWORD  hDev  ) 
 

int fat_get_attr tFile F,
fd32_fs_attr_t A
 

int fat_get_fsfree fd32_getfsfree_t F  ) 
 

int fat_get_fsinfo fd32_fs_info_t Fsi  ) 
 

tFile* fat_getfile DWORD  FileId  ) 
 

int fat_isopen tFileId Fid  ) 
 

int fat_lfn_findfirst tVolume v,
const char *  path,
int  attributes,
fd32_fs_lfnfind_t *  find_data
 

int fat_lfn_findnext tVolume v,
fd32_fs_lfnfind_t *  find_data
 

int fat_lseek tFile F,
long long int *  Offset,
int  Origin
 

int fat_mkdir tVolume V,
char *  DirName
 

int fat_mount DWORD  hDev,
tVolume **  NewV
 

int fat_open tVolume V,
char *  FileName,
DWORD  Mode,
WORD  Attr,
WORD  AliasHint,
tFile **  F
 

int fat_openfiles tVolume V  ) 
 

int fat_partcheck BYTE  PartSig  ) 
 

int fat_read tFile F,
void *  Buffer,
int  Size
 

int fat_readbuf tVolume V,
DWORD  Sector
 

int fat_readdir tFile P,
fd32_fs_lfnfind_t *  Entry
 

int fat_rename tVolume V,
char *  OldFullName,
char *  NewFullName
 

int fat_reopen tFile F  ) 
 

int fat_reopendir tVolume V,
tFindRes *  Id,
tFile **  F
 

int fat_rmdir tVolume V,
char *  DirName
 

int fat_set_attr tFile F,
fd32_fs_attr_t A
 

void fat_split_path const char *  FullPath,
char *  Path,
char *  Name
 

int fat_syncentry tFile F  ) 
 

void fat_syncpos tFile F  ) 
 

void fat_timestamps WORD Time,
WORD Date,
BYTE Hund
 

int fat_trashbuf tVolume V  ) 
 

int fat_unlink tVolume V,
char *  FileName,
DWORD  Flags
 

int fat_unmount tVolume V  ) 
 

int fat_write tFile F,
void *  Buffer,
int  Size
 

int fat_writebuf tVolume V,
int  NumBuf
 

int gen_short_fname tFile Dir,
char *  LongName,
BYTE ShortName,
WORD  Hint
 

BYTE lfn_checksum tDirEntry *  D  ) 
 


Generated on Fri Feb 24 14:13:22 2006 for VDK Blacksheep by  doxygen 1.4.1