From 924164e6a7b4a97d248a07928b8b9f22bf5aec0b Mon Sep 17 00:00:00 2001 From: Björn Stenberg Date: Fri, 3 May 2002 15:35:51 +0000 Subject: Changed to global 'bpb' struct git-svn-id: svn://svn.rockbox.org/rockbox/trunk@411 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/fat.h | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-) (limited to 'firmware/drivers/fat.h') diff --git a/firmware/drivers/fat.h b/firmware/drivers/fat.h index faec5384dd..3e8875f3e7 100644 --- a/firmware/drivers/fat.h +++ b/firmware/drivers/fat.h @@ -85,7 +85,7 @@ struct fat_direntry #define FAT_ATTR_DIRECTORY 0x10 #define FAT_ATTR_ARCHIVE 0x20 -struct fat_dirent +struct fat_dir { int entry; unsigned int cached_sec; @@ -93,7 +93,7 @@ struct fat_dirent unsigned char cached_buf[SECTOR_SIZE]; }; -struct fat_fileent +struct fat_file { int firstcluster; /* first cluster in file */ int nextcluster; /* cluster of last access */ @@ -101,32 +101,20 @@ struct fat_fileent int sectornum; /* sector number in this cluster */ }; -extern int fat_mount(struct bpb *bpb, int startsector); +/* global FAT info struct */ +extern struct bpb fat_bpb; + +extern int fat_mount(int startsector); #ifdef DISK_WRITE -extern int fat_create_file(struct bpb *bpb, - unsigned int currdir, - char *name); -extern int fat_create_dir(struct bpb *bpb, - unsigned int currdir, - char *name); +extern int fat_create_file(unsigned int currdir, char *name); +extern int fat_create_dir(unsigned int currdir, char *name); #endif -extern int fat_open(struct bpb *bpb, - unsigned int cluster, - struct fat_fileent *ent); -extern int fat_read(struct bpb *bpb, - struct fat_fileent *ent, - int sectorcount, - void* buf ); -extern int fat_seek(struct bpb *bpb, - struct fat_fileent *ent, - int sector ); +extern int fat_open(unsigned int cluster, struct fat_file *ent); +extern int fat_read(struct fat_file *ent, int sectorcount, void* buf ); +extern int fat_seek(struct fat_file *ent, int sector ); -extern int fat_opendir(struct bpb *bpb, - struct fat_dirent *ent, - unsigned int currdir); -extern int fat_getnext(struct bpb *bpb, - struct fat_dirent *ent, - struct fat_direntry *entry); +extern int fat_opendir(struct fat_dir *ent, unsigned int currdir); +extern int fat_getnext(struct fat_dir *ent, struct fat_direntry *entry); #endif -- cgit v1.2.3