blob: cf7f003bd65b41d7fd0a62d08b8628b09c0e4fd4 [file] [log] [blame]
Thomas Heijligend1e04572023-11-27 14:28:55 +00001#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 */
9int devopen(const char *name, int *reopen);
10
11/** devclose
12 */
13void 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 */
22int devread(unsigned long sector, unsigned long byte_offset,
23 unsigned long byte_len, void *buf);
24
25
26
27
28
29void dev_set_partition(unsigned long start, unsigned long size);
30void dev_get_partition(unsigned long *start, unsigned long *size);
31
32int file_open(const char *filename);
33int file_read(void *buf, unsigned long len);
34unsigned long file_seek(unsigned long offset);
35unsigned long file_size(void);
36void file_set_size(unsigned long size);
37void file_close(void);
38
39#endif /* FS_H */