229
|
1 #include "../../context.h"
|
194
|
2 #interface "file.h"
|
231
|
3 #interface "inode_impl.h"
|
194
|
4
|
|
5 // ----
|
231
|
6 // typedef struct inode_impl<Impl, Isa> impl file {
|
194
|
7 //
|
231
|
8 // } inode_impl;
|
194
|
9 // ----
|
|
10
|
|
11 file* createinode(struct Context* cbc_context) {
|
|
12 struct file* file = new file();
|
231
|
13 struct inode_impl* inode_impl = new inode_impl();
|
|
14 file->file = (union Data*)inode_impl;
|
|
15 inode_impl->st = NULL;
|
|
16 inode_impl->ip = NULL;
|
|
17 file->statinode = C_statinode_impl;
|
|
18 inode_impl->cbc_statinode = C_cbc_statinode_impl;
|
|
19 file->read = C_readinode_impl;
|
|
20 file->write = C_writeinode_impl;
|
|
21 file->close = C_closeinode_impl;
|
194
|
22 return file;
|
|
23 }
|
230
|
24 __code statinode(struct inode* ip, struct stat* st, __code next(int ret, ...)) { //:skip
|
229
|
25
|
230
|
26 goto cbc_statinode(ip, st, next(ret, ...));
|
229
|
27 }
|
|
28
|
230
|
29 __code cbc_statinode((struct inode* ip, struct stat* st, __code next(int ret, ...)){
|
|
30
|
|
31 goto next(...);
|
229
|
32 }
|
|
33
|
194
|
34 __code readinode(struct inode* file, char* addr, __code next(...)) {
|
|
35
|
|
36 goto next(...);
|
|
37 }
|
|
38
|
|
39 __code writeinode(struct inode* file, char* addr, int n, __code next(...)) {
|
|
40
|
|
41 goto next(...);
|
|
42 }
|
|
43
|
|
44 __code closeinode(struct inode* file,int fd, __code next(...)) {
|
|
45
|
230
|
46 goto next(...);
|
194
|
47 }
|
198
|
48
|