# HG changeset patch # User menikon # Date 1579959603 -32400 # Node ID a7fc5edea92523482a2612866194484438f908b9 # Parent 08cd784ddbc0f86dc79bd999dac9e9179974f670 tweak diff -r 08cd784ddbc0 -r a7fc5edea925 src/impl/file_impl_inode.cbc --- a/src/impl/file_impl_inode.cbc Sat Jan 25 20:37:53 2020 +0900 +++ b/src/impl/file_impl_inode.cbc Sat Jan 25 22:40:03 2020 +0900 @@ -1,6 +1,6 @@ #include "../../context.h" -#interface "file.h" -#interface "inode_impl.h" +#interface "file.dg" + // ---- // typedef struct inode_impl impl file { @@ -14,11 +14,11 @@ file->file = (union Data*)inode_impl; inode_impl->st = NULL; inode_impl->ip = NULL; - file->statinode = C_statinode_impl; + file->stat = C_statinode; inode_impl->cbc_statinode = C_cbc_statinode_impl; - file->read = C_readinode_impl; - file->write = C_writeinode_impl; - file->close = C_closeinode_impl; + file->read = C_readinode; + file->write = C_writeinode; + file->close = C_closeinode; return file; } __code statinode(struct inode* ip, struct stat* st, __code next(int ret, ...)) { //:skip @@ -26,7 +26,7 @@ goto cbc_statinode(ip, st, next(ret, ...)); } -__code cbc_statinode((struct inode* ip, struct stat* st, __code next(int ret, ...)){ +__code cbc_statinode_impl(struct inode* ip, struct stat* st, __code next(int ret, ...)){ goto next(...); } diff -r 08cd784ddbc0 -r a7fc5edea925 src/impl/inode_impl.h --- a/src/impl/inode_impl.h Sat Jan 25 20:37:53 2020 +0900 +++ b/src/impl/inode_impl.h Sat Jan 25 22:40:03 2020 +0900 @@ -2,9 +2,10 @@ struct inode* ip; struct stat* st; +int ret; -__code cbc_statinode((struct inode* ip, struct stat* st, __code next(int ret, ...)); +__code cbc_statinode(struct inode* ip, struct stat* st, __code next(int ret, ...)); -__code next(...); +//__code next(...); } inode_impl; diff -r 08cd784ddbc0 -r a7fc5edea925 src/interface/file.dg --- a/src/interface/file.dg Sat Jan 25 20:37:53 2020 +0900 +++ b/src/interface/file.dg Sat Jan 25 22:40:03 2020 +0900 @@ -1,5 +1,6 @@ typedef struct file { union Data* file; + union Data* inode_impl; enum { FD_NONE, FD_PIPE, FD_INODE } type; int ref; // reference count char readable; @@ -11,7 +12,9 @@ char* addr; int n; int fd; + __code stat(struct inode* ip, struct stat* st, __code next(...)); __code read(Impl* file, char* addr, __code next(...)); __code write(Impl* file, char* addr, int n, __code next(...)); __code close(Impl* file,int fd, __code next(...)); + __code next(...); } file;