Mercurial > hg > Members > menikon > CbC_xv6
view src/impl/file_impl_inode.cbc @ 232:a7fc5edea925
tweak
author | menikon |
---|---|
date | Sat, 25 Jan 2020 22:40:03 +0900 |
parents | 08cd784ddbc0 |
children |
line wrap: on
line source
#include "../../context.h" #interface "file.dg" // ---- // typedef struct inode_impl<Impl, Isa> impl file { // // } inode_impl; // ---- file* createinode(struct Context* cbc_context) { struct file* file = new file(); struct inode_impl* inode_impl = new inode_impl(); file->file = (union Data*)inode_impl; inode_impl->st = NULL; inode_impl->ip = NULL; file->stat = C_statinode; inode_impl->cbc_statinode = C_cbc_statinode_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 goto cbc_statinode(ip, st, next(ret, ...)); } __code cbc_statinode_impl(struct inode* ip, struct stat* st, __code next(int ret, ...)){ goto next(...); } __code readinode(struct inode* file, char* addr, __code next(...)) { goto next(...); } __code writeinode(struct inode* file, char* addr, int n, __code next(...)) { goto next(...); } __code closeinode(struct inode* file,int fd, __code next(...)) { goto next(...); }