]> git.ozlabs.org Git - minimigmac.git/blob - pic/fat16.h
Initial commit
[minimigmac.git] / pic / fat16.h
1 #ifndef __FAT16_H__\r
2 #define __FAT16_H__\r
3 \r
4 /* Global sector buffer, data for read/write actions is stored here\r
5  *\r
6  * Any operation (init, open, seek and read) will clobber it. If you\r
7  * modify this buffer content, you _MUST_ either follow with a\r
8  * fat_file_write or a fat_inval_cache _BEFORE_ any other open, read\r
9  * or seek operation\r
10  */\r
11 extern unsigned char secbuf[512];\r
12 \r
13 /* Initialize, find first partition */\r
14 unsigned char fat_init(void);\r
15 \r
16 /* Open a file by name, one open file at a time, replace the previous one */\r
17 long fat_open(const unsigned char *name);\r
18 \r
19 /* Seek into file WARNING: Can clobber secbuf ! */\r
20 unsigned char fat_file_seek(unsigned long sector);\r
21 unsigned char fat_file_next_sector(void);\r
22 \r
23 /* Read and write current file sector */\r
24 unsigned char fat_file_read(void);\r
25 unsigned char fat_file_write(void);\r
26 \r
27 /* Invalidate sector cache */\r
28 void fat_inval_cache(void);\r
29 \r
30 #endif /* __FAT16_H__ */\r