changeset 293:a7fc5edea925

tweak
author menikon
date Sat, 25 Jan 2020 22:40:03 +0900
parents 08cd784ddbc0
children 08a367c3124a
files src/impl/file_impl_inode.cbc src/impl/inode_impl.h src/interface/file.dg
diffstat 3 files changed, 13 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- 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, Isa> 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(...);
 }
--- 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;
--- 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 <Impl> {
     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;