annotate src/impl/file_impl_inode.cbc @ 231:08cd784ddbc0

rename inode.h
author menikon
date Sat, 25 Jan 2020 20:37:53 +0900
parents 4265c6e825af
children a7fc5edea925
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
229
menikon
parents: 198
diff changeset
1 #include "../../context.h"
194
4cfff673e1f6 add inodefiles
menikon <e165723@ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 #interface "file.h"
231
08cd784ddbc0 rename inode.h
menikon
parents: 230
diff changeset
3 #interface "inode_impl.h"
194
4cfff673e1f6 add inodefiles
menikon <e165723@ie.u-ryukyu.ac.jp>
parents:
diff changeset
4
4cfff673e1f6 add inodefiles
menikon <e165723@ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 // ----
231
08cd784ddbc0 rename inode.h
menikon
parents: 230
diff changeset
6 // typedef struct inode_impl<Impl, Isa> impl file {
194
4cfff673e1f6 add inodefiles
menikon <e165723@ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 //
231
08cd784ddbc0 rename inode.h
menikon
parents: 230
diff changeset
8 // } inode_impl;
194
4cfff673e1f6 add inodefiles
menikon <e165723@ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 // ----
4cfff673e1f6 add inodefiles
menikon <e165723@ie.u-ryukyu.ac.jp>
parents:
diff changeset
10
4cfff673e1f6 add inodefiles
menikon <e165723@ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 file* createinode(struct Context* cbc_context) {
4cfff673e1f6 add inodefiles
menikon <e165723@ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 struct file* file = new file();
231
08cd784ddbc0 rename inode.h
menikon
parents: 230
diff changeset
13 struct inode_impl* inode_impl = new inode_impl();
08cd784ddbc0 rename inode.h
menikon
parents: 230
diff changeset
14 file->file = (union Data*)inode_impl;
08cd784ddbc0 rename inode.h
menikon
parents: 230
diff changeset
15 inode_impl->st = NULL;
08cd784ddbc0 rename inode.h
menikon
parents: 230
diff changeset
16 inode_impl->ip = NULL;
08cd784ddbc0 rename inode.h
menikon
parents: 230
diff changeset
17 file->statinode = C_statinode_impl;
08cd784ddbc0 rename inode.h
menikon
parents: 230
diff changeset
18 inode_impl->cbc_statinode = C_cbc_statinode_impl;
08cd784ddbc0 rename inode.h
menikon
parents: 230
diff changeset
19 file->read = C_readinode_impl;
08cd784ddbc0 rename inode.h
menikon
parents: 230
diff changeset
20 file->write = C_writeinode_impl;
08cd784ddbc0 rename inode.h
menikon
parents: 230
diff changeset
21 file->close = C_closeinode_impl;
194
4cfff673e1f6 add inodefiles
menikon <e165723@ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 return file;
4cfff673e1f6 add inodefiles
menikon <e165723@ie.u-ryukyu.ac.jp>
parents:
diff changeset
23 }
230
menikon
parents: 229
diff changeset
24 __code statinode(struct inode* ip, struct stat* st, __code next(int ret, ...)) { //:skip
229
menikon
parents: 198
diff changeset
25
230
menikon
parents: 229
diff changeset
26 goto cbc_statinode(ip, st, next(ret, ...));
229
menikon
parents: 198
diff changeset
27 }
menikon
parents: 198
diff changeset
28
230
menikon
parents: 229
diff changeset
29 __code cbc_statinode((struct inode* ip, struct stat* st, __code next(int ret, ...)){
menikon
parents: 229
diff changeset
30
menikon
parents: 229
diff changeset
31 goto next(...);
229
menikon
parents: 198
diff changeset
32 }
menikon
parents: 198
diff changeset
33
194
4cfff673e1f6 add inodefiles
menikon <e165723@ie.u-ryukyu.ac.jp>
parents:
diff changeset
34 __code readinode(struct inode* file, char* addr, __code next(...)) {
4cfff673e1f6 add inodefiles
menikon <e165723@ie.u-ryukyu.ac.jp>
parents:
diff changeset
35
4cfff673e1f6 add inodefiles
menikon <e165723@ie.u-ryukyu.ac.jp>
parents:
diff changeset
36 goto next(...);
4cfff673e1f6 add inodefiles
menikon <e165723@ie.u-ryukyu.ac.jp>
parents:
diff changeset
37 }
4cfff673e1f6 add inodefiles
menikon <e165723@ie.u-ryukyu.ac.jp>
parents:
diff changeset
38
4cfff673e1f6 add inodefiles
menikon <e165723@ie.u-ryukyu.ac.jp>
parents:
diff changeset
39 __code writeinode(struct inode* file, char* addr, int n, __code next(...)) {
4cfff673e1f6 add inodefiles
menikon <e165723@ie.u-ryukyu.ac.jp>
parents:
diff changeset
40
4cfff673e1f6 add inodefiles
menikon <e165723@ie.u-ryukyu.ac.jp>
parents:
diff changeset
41 goto next(...);
4cfff673e1f6 add inodefiles
menikon <e165723@ie.u-ryukyu.ac.jp>
parents:
diff changeset
42 }
4cfff673e1f6 add inodefiles
menikon <e165723@ie.u-ryukyu.ac.jp>
parents:
diff changeset
43
4cfff673e1f6 add inodefiles
menikon <e165723@ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 __code closeinode(struct inode* file,int fd, __code next(...)) {
4cfff673e1f6 add inodefiles
menikon <e165723@ie.u-ryukyu.ac.jp>
parents:
diff changeset
45
230
menikon
parents: 229
diff changeset
46 goto next(...);
194
4cfff673e1f6 add inodefiles
menikon <e165723@ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 }
198
menikon <e165723@ie.u-ryukyu.ac.jp>
parents: 194
diff changeset
48