annotate src/impl/fs_impl.cbc @ 233:08a367c3124a

add FileSystem files
author menikon
date Wed, 29 Jan 2020 15:58:12 +0900
parents
children 29841ed2e11c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
233
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
1 #include "../context.h"
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
2 #interface "fs.h"
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
3
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
4 // ----
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
5 // typedef struct fs_impl<Impl, Isa> impl fs{
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
6 // union Data* fs_impl;
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
7 //
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
8 //
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
9 //
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
10 //
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
11 // } fs_impl;
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
12 // ----
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
13
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
14 fs* createfs_impl(struct Context* cbc_context) {
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
15 struct fs* fs = new fs();
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
16 struct fs_impl* fs_impl = new fs_impl();
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
17 fs->fs = (union Data*)fs_impl;
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
18 fs_impl->fs_impl = NULL;
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
19 fs->readsb = C_readsbfs_impl;
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
20 fs->iinit = C_iinitfs_impl;
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
21 fs->ialloc = C_iallocfs_impl;
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
22 fs->iupdate = C_iupdatefs_impl;
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
23 fs->idup = C_idupfs_impl;
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
24 fs->ilock = C_ilockfs_impl;
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
25 fs->iunlock = C_iunlockfs_impl;
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
26 fs->iput = C_iputfs_impl;
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
27 fs->iunlockput = C_iunlockputfs_impl;
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
28 fs->stati = C_statifs_impl;
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
29 fs->readi = C_readifs_impl;
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
30 fs->writei = C_writeifs_impl;
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
31 fs->namecmp = C_namecmpfs_impl;
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
32 fs->dirlookup = C_dirlookupfs_impl;
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
33 fs->next = C_nextfs_impl;
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
34 fs->namei = C_nameifs_impl;
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
35 fs->nameiparent = C_nameiparentfs_impl;
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
36 return fs;
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
37 }
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
38 __code readsbfs_impl(struct fs_impl* fs, int dev, struct superblock* sb, __code next(...)) {
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
39
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
40 goto next(...);
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
41 }
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
42
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
43 __code iinitfs_impl(struct fs_impl* fs, __code next(...)) {
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
44
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
45 goto next(...);
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
46 }
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
47
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
48 __code iallocfs_impl(struct fs_impl* fs, uint dev, short type, __code next(...)) {
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
49
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
50 goto next(...);
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
51 }
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
52
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
53 __code iupdatefs_impl(struct fs_impl* fs, struct inode* ip, __code next(...)) {
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
54
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
55 goto next(...);
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
56 }
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
57
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
58 __code idupfs_impl(struct fs_impl* fs, struct inode* ip, __code next(...)) {
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
59
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
60 goto next(...);
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
61 }
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
62
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
63 __code ilockfs_impl(struct fs_impl* fs, struct inode* ip, __code next(...)) {
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
64
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
65 goto next(...);
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
66 }
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
67
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
68 __code iunlockfs_impl(struct fs_impl* fs, struct inode* ip, __code next(...)) {
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
69
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
70 goto next(...);
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
71 }
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
72
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
73 __code iputfs_impl(struct fs_impl* fs, struct inode* ip, __code next(...)) {
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
74
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
75 goto next(...);
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
76 }
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
77
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
78 __code iunlockputfs_impl(struct fs_impl* fs, struct inode* ip, __code next(...)) {
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
79
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
80 goto next(...);
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
81 }
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
82
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
83 __code statifs_impl(struct fs_impl* fs , struct inode* ip, struct stat* st, __code next(...)) {
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
84
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
85 goto next(...);
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
86 }
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
87
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
88 __code readifs_impl(struct fs_impl* fs, struct inode* ip, char* dst, uint off, uint n, __code next(...)) {
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
89
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
90 goto next(...);
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
91 }
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
92
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
93 __code writeifs_impl(struct fs_impl* fs, struct inode* ip, char* src, uint off, uint n, __code next(...)) {
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
94
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
95 goto next(...);
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
96 }
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
97
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
98 __code namecmpfs_impl(struct fs_impl* fs, const char* s, const char* t, __code next(...)) {
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
99
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
100 goto next(...);
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
101 }
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
102
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
103 __code dirlookupfs_impl(struct inode* dp, char* name, uint* poff, __code next(...)) {
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
104
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
105 goto next(...);
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
106 }
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
107
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
108 __code nextfs_impl(...)) {
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
109
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
110 }
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
111
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
112 __code nameifs_impl(struct fs_impl* fs, char* path, __code next(...)) {
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
113
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
114 goto next(...);
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
115 }
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
116
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
117 __code nameiparentfs_impl(struct fs_impl* fs, char* path, char* name, __code next(...)) {
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
118
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
119 goto next(...);
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
120 }
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
121
08a367c3124a add FileSystem files
menikon
parents:
diff changeset
122