feat: a file system mapping for pci devices
[lunaix-os.git] / lunaix-os / includes / lunaix / fs / twifs.h
1 #ifndef __LUNAIX_TWIFS_H
2 #define __LUNAIX_TWIFS_H
3
4 #include <lunaix/fs.h>
5
6 struct twifs_node
7 {
8     struct hstr name;
9     inode_t ino_id;
10     void* data;
11     uint32_t itype;
12     char name_val[VFS_NAME_MAXLEN];
13     struct llist_header children;
14     struct llist_header siblings;
15     struct
16     {
17         int (*write)(struct v_inode* inode,
18                      void* buffer,
19                      size_t len,
20                      size_t fpos);
21         int (*read)(struct v_inode* inode,
22                     void* buffer,
23                     size_t len,
24                     size_t fpos);
25     } ops;
26 };
27
28 void
29 twifs_init();
30
31 struct twifs_node*
32 twifs_file_node(struct twifs_node* parent, const char* fmt, ...);
33
34 struct twifs_node*
35 twifs_dir_node(struct twifs_node* parent, const char* fmt, ...);
36
37 int
38 twifs_rm_node(struct twifs_node* node);
39
40 #endif /* __LUNAIX_TWIFS_H */