Mercurial > hg > Members > menikon > CbC_xv6
changeset 194:4cfff673e1f6
add inodefiles
author | menikon <e165723@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 22 Jan 2020 00:46:46 +0900 |
parents | a961a3378174 |
children | 6e28bd30e8a7 |
files | src/impl/file_impl_inode.cbc src/impl/inode.h |
diffstat | 2 files changed, 39 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/impl/file_impl_inode.cbc Wed Jan 22 00:46:46 2020 +0900 @@ -0,0 +1,36 @@ +#include "../context.h" +#interface "file.h" + +// ---- +// typedef struct inode<Impl, Isa> impl file { +// +// } inode; +// ---- + +file* createinode(struct Context* cbc_context) { + struct file* file = new file(); + struct inode* inode = new inode(); + file->file = (union Data*)inode; + file->st = NULL; + file->addr = NULL; + file->n = 0; + file->fd = 0; + file->read = C_readinode; + file->write = C_writeinode; + file->close = C_closeinode; + return file; +} +__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(...); +}