diff options
Diffstat (limited to 'firmware/drivers/fat.h')
-rw-r--r-- | firmware/drivers/fat.h | 38 |
1 files changed, 13 insertions, 25 deletions
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 | |||
85 | #define FAT_ATTR_DIRECTORY 0x10 | 85 | #define FAT_ATTR_DIRECTORY 0x10 |
86 | #define FAT_ATTR_ARCHIVE 0x20 | 86 | #define FAT_ATTR_ARCHIVE 0x20 |
87 | 87 | ||
88 | struct fat_dirent | 88 | struct fat_dir |
89 | { | 89 | { |
90 | int entry; | 90 | int entry; |
91 | unsigned int cached_sec; | 91 | unsigned int cached_sec; |
@@ -93,7 +93,7 @@ struct fat_dirent | |||
93 | unsigned char cached_buf[SECTOR_SIZE]; | 93 | unsigned char cached_buf[SECTOR_SIZE]; |
94 | }; | 94 | }; |
95 | 95 | ||
96 | struct fat_fileent | 96 | struct fat_file |
97 | { | 97 | { |
98 | int firstcluster; /* first cluster in file */ | 98 | int firstcluster; /* first cluster in file */ |
99 | int nextcluster; /* cluster of last access */ | 99 | int nextcluster; /* cluster of last access */ |
@@ -101,32 +101,20 @@ struct fat_fileent | |||
101 | int sectornum; /* sector number in this cluster */ | 101 | int sectornum; /* sector number in this cluster */ |
102 | }; | 102 | }; |
103 | 103 | ||
104 | extern int fat_mount(struct bpb *bpb, int startsector); | 104 | /* global FAT info struct */ |
105 | extern struct bpb fat_bpb; | ||
106 | |||
107 | extern int fat_mount(int startsector); | ||
105 | 108 | ||
106 | #ifdef DISK_WRITE | 109 | #ifdef DISK_WRITE |
107 | extern int fat_create_file(struct bpb *bpb, | 110 | extern int fat_create_file(unsigned int currdir, char *name); |
108 | unsigned int currdir, | 111 | extern int fat_create_dir(unsigned int currdir, char *name); |
109 | char *name); | ||
110 | extern int fat_create_dir(struct bpb *bpb, | ||
111 | unsigned int currdir, | ||
112 | char *name); | ||
113 | #endif | 112 | #endif |
114 | extern int fat_open(struct bpb *bpb, | 113 | extern int fat_open(unsigned int cluster, struct fat_file *ent); |
115 | unsigned int cluster, | 114 | extern int fat_read(struct fat_file *ent, int sectorcount, void* buf ); |
116 | struct fat_fileent *ent); | 115 | extern int fat_seek(struct fat_file *ent, int sector ); |
117 | extern int fat_read(struct bpb *bpb, | ||
118 | struct fat_fileent *ent, | ||
119 | int sectorcount, | ||
120 | void* buf ); | ||
121 | extern int fat_seek(struct bpb *bpb, | ||
122 | struct fat_fileent *ent, | ||
123 | int sector ); | ||
124 | 116 | ||
125 | extern int fat_opendir(struct bpb *bpb, | 117 | extern int fat_opendir(struct fat_dir *ent, unsigned int currdir); |
126 | struct fat_dirent *ent, | 118 | extern int fat_getnext(struct fat_dir *ent, struct fat_direntry *entry); |
127 | unsigned int currdir); | ||
128 | extern int fat_getnext(struct bpb *bpb, | ||
129 | struct fat_dirent *ent, | ||
130 | struct fat_direntry *entry); | ||
131 | 119 | ||
132 | #endif | 120 | #endif |