3 #define UHFS_FIXDBLK 0xfffffffc 4 #define UHFS_DEADBLK 0xfffffffd 5 #define UHFS_EOCHBLK 0xfffffffe 6 #define UHFS_FREEBLK 0xffffffff 8 #define UHFS_ATTRDIR 0x01 9 #define UHFS_ATTRHIDDEN 0x02 10 #define UHFS_ATTRARCHIVE 0x04 11 #define UHFS_ATTRSYSTEM 0x08 12 #define UHFS_ATTREXEC 0x10 13 #define UHFS_ATTRWRITE 0x20 14 #define UHFS_ATTRREAD 0x40 15 #define UHFS_ATTRFREE 0x80 17 #define UHFS_RDONLY 0x0001 18 #define UHFS_WRONLY 0x0002 19 #define UHFS_RDWR 0x0003 20 #define UHFS_CREAT 0x0004 21 #define UHFS_APPEND 0x0008 22 #define UHFS_SYNC 0x0010 23 #define UHFS_NONBLOCK 0x0020 24 #define UHFS_EOF 0x4000 25 #define UHFS_OPENFILE 0x8000 30 UHFS_ENOTMOUNTED = -1001,
31 UHFS_EALREADYMOUNTED = -1002,
32 UHFS_EINVSECTORSIZE = -1003,
33 UHFS_EINVBLOCKSIZE = -1004,
34 UHFS_ESTORAGEFULL = -1005,
35 UHFS_EPATHNOTFOUND = -1006,
36 UHFS_ENOTADIR = -1007,
37 UHFS_ENOTAFILE = -1008,
38 UHFS_EFILEEXISTS = -1009,
39 UHFS_EFILENOTOPEN = -1010,
40 UHFS_EDIRNOTEMPTY = -1011
47 uint32_t reserved : 8;
51 uint32_t millisecond : 7;
55 uint32_t reserved : 8;
63 int8_t volume_label[16];
67 uint32_t root_dir_block;
68 uint32_t metadata_block;
76 uint32_t metadata_block;
107 int32_t hf_mkfs(
struct device *dev, uint32_t blk_size);
108 int32_t hf_mount(
struct device *dev);
109 int32_t hf_umount(
struct device *dev);
110 int32_t hf_getfree(
struct device *dev);
111 int32_t hf_getlabel(
struct device *dev, int8_t *label);
112 int32_t hf_setlabel(
struct device *dev, int8_t *label);
115 int32_t hf_mkdir(
struct device *dev, int8_t *path);
116 struct file * hf_opendir(
struct device *dev, int8_t *path);
117 int32_t hf_closedir(
struct file *desc);
119 int32_t hf_rmdir(
struct device *dev, int8_t *path);
122 int32_t hf_create(
struct device *dev, int8_t *path);
123 int32_t hf_unlink(
struct device *dev, int8_t *path);
124 int64_t hf_size(
struct device *dev, int8_t *path);
125 int32_t hf_rename(
struct device *dev, int8_t *path, int8_t *newname);
126 int32_t hf_chmod(
struct device *dev, int8_t *path, int8_t mode);
127 int32_t hf_touch(
struct device *dev, int8_t *path,
struct fs_date *ndate,
struct fs_time *ntime);
130 struct file * hf_fopen(
struct device *dev, int8_t *path, int8_t *mode);
131 int32_t hf_fclose(
struct file *desc);
132 int64_t hf_fread(
void *buf, int32_t isize, int32_t items,
struct file *desc);
133 int64_t hf_fwrite(
void *buf, int32_t isize, int32_t items,
struct file *desc);
134 int32_t hf_fseek(
struct file *desc, int64_t offset, int32_t whence);
135 int64_t hf_ftell(
struct file *desc);
136 int32_t hf_feof(
struct file *desc);