comparison 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
comparison
equal deleted inserted replaced
230:4265c6e825af 231:08cd784ddbc0
1 #include "../../context.h" 1 #include "../../context.h"
2 #interface "file.h" 2 #interface "file.h"
3 #interface "inode_impl.h"
3 4
4 // ---- 5 // ----
5 // typedef struct inode<Impl, Isa> impl file { 6 // typedef struct inode_impl<Impl, Isa> impl file {
6 // 7 //
7 // } inode; 8 // } inode_impl;
8 // ---- 9 // ----
9 10
10 file* createinode(struct Context* cbc_context) { 11 file* createinode(struct Context* cbc_context) {
11 struct file* file = new file(); 12 struct file* file = new file();
12 struct inode* ip = new ip(); 13 struct inode_impl* inode_impl = new inode_impl();
13 file->file = (union Data*)inode; 14 file->file = (union Data*)inode_impl;
14 file->st = NULL; 15 inode_impl->st = NULL;
15 file->addr = NULL; 16 inode_impl->ip = NULL;
16 file->n = 0; 17 file->statinode = C_statinode_impl;
17 file->fd = 0; 18 inode_impl->cbc_statinode = C_cbc_statinode_impl;
18 file->stat = C_statinode; 19 file->read = C_readinode_impl;
19 file->cbc_stat = C_cbc_statinode; 20 file->write = C_writeinode_impl;
20 file->read = C_readinode; 21 file->close = C_closeinode_impl;
21 file->write = C_writeinode;
22 file->close = C_closeinode;
23 return file; 22 return file;
24 } 23 }
25
26 __code statinode(struct inode* ip, struct stat* st, __code next(int ret, ...)) { //:skip 24 __code statinode(struct inode* ip, struct stat* st, __code next(int ret, ...)) { //:skip
27 25
28 goto cbc_statinode(ip, st, next(ret, ...)); 26 goto cbc_statinode(ip, st, next(ret, ...));
29 } 27 }
30 28