Thomas Heijligen | d1e0457 | 2023-11-27 14:28:55 +0000 | [diff] [blame^] | 1 | #ifndef FS_H |
| 2 | #define FS_H |
| 3 | |
| 4 | /** devopen |
| 5 | * @param name Filename to be used as blockdevice |
| 6 | * @param reopen Unused, set NULL |
| 7 | * @return 1 on success, 0 on failure !CAUTION |
| 8 | */ |
| 9 | int devopen(const char *name, int *reopen); |
| 10 | |
| 11 | /** devclose |
| 12 | */ |
| 13 | void devclose(void); |
| 14 | |
| 15 | /** devread |
| 16 | * @param sector 512 byte sector of the block device |
| 17 | * @param byte_offset Offset in the block |
| 18 | * @param byte_len Buffer length |
| 19 | * @param buf Buffer |
| 20 | * @return 1 on sucess, 0 on failure !CAUTION |
| 21 | */ |
| 22 | int devread(unsigned long sector, unsigned long byte_offset, |
| 23 | unsigned long byte_len, void *buf); |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | void dev_set_partition(unsigned long start, unsigned long size); |
| 30 | void dev_get_partition(unsigned long *start, unsigned long *size); |
| 31 | |
| 32 | int file_open(const char *filename); |
| 33 | int file_read(void *buf, unsigned long len); |
| 34 | unsigned long file_seek(unsigned long offset); |
| 35 | unsigned long file_size(void); |
| 36 | void file_set_size(unsigned long size); |
| 37 | void file_close(void); |
| 38 | |
| 39 | #endif /* FS_H */ |