changeset 231:08cd784ddbc0

rename inode.h
author menikon
date Sat, 25 Jan 2020 20:37:53 +0900
parents 4265c6e825af
children a7fc5edea925
files src/CMakeLists.txt src/impl/file_impl_inode.cbc src/impl/inode.h src/impl/inode_impl.h
diffstat 4 files changed, 23 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/src/CMakeLists.txt	Sat Jan 25 19:02:35 2020 +0900
+++ b/src/CMakeLists.txt	Sat Jan 25 20:37:53 2020 +0900
@@ -129,6 +129,7 @@
 	string.c arm.c asm.S bio.c buddy.c console.cbc exec.c file.cbc fs.c log.c main.c memide.c pipe.cbc proc.cbc spinlock.cbc 
 	start.c swtch.S syscall.cbc sysfile.cbc sysproc.c trap_asm.S trap.c vm.c device/picirq.c device/timer.c device/uart.c 
   SingleLinkedStack.cbc entry.S impl/vm_impl.cbc impl/vm_impl_private.cbc
+ impl/file_impl_inode.cbc
 )
 
 # sys_read_impl.cbc
--- a/src/impl/file_impl_inode.cbc	Sat Jan 25 19:02:35 2020 +0900
+++ b/src/impl/file_impl_inode.cbc	Sat Jan 25 20:37:53 2020 +0900
@@ -1,28 +1,26 @@
 #include "../../context.h"
 #interface "file.h"
+#interface "inode_impl.h"
 
 // ----
-// typedef struct inode<Impl, Isa> impl file {
+// typedef struct inode_impl<Impl, Isa> impl file {
 //
-// } inode;
+// } inode_impl;
 // ----
 
 file* createinode(struct Context* cbc_context) {
     struct file* file  = new file();
-    struct inode* ip = new ip();
-    file->file = (union Data*)inode;
-    file->st = NULL;
-    file->addr = NULL;
-    file->n  = 0;
-    file->fd  = 0;
-    file->stat = C_statinode;
-    file->cbc_stat = C_cbc_statinode;
-    file->read = C_readinode;
-    file->write = C_writeinode;
-    file->close = C_closeinode;
+    struct inode_impl* inode_impl = new inode_impl();
+    file->file = (union Data*)inode_impl;
+    inode_impl->st = NULL;
+    inode_impl->ip = NULL;
+    file->statinode = C_statinode_impl;
+    inode_impl->cbc_statinode = C_cbc_statinode_impl;
+    file->read = C_readinode_impl;
+    file->write = C_writeinode_impl;
+    file->close = C_closeinode_impl;
     return file;
 }
-
 __code statinode(struct inode* ip, struct stat* st, __code next(int ret, ...)) { //:skip
 
     goto cbc_statinode(ip, st, next(ret, ...));
--- a/src/impl/inode.h	Sat Jan 25 19:02:35 2020 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-typedef struct inode<Impl, Isa> impl file {
-
-
-
-
-
-__code cbc_statinode((struct inode* ip, struct stat* st, __code next(...));
-} inode;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/impl/inode_impl.h	Sat Jan 25 20:37:53 2020 +0900
@@ -0,0 +1,10 @@
+typedef struct inode_impl<Impl, Isa> impl file {
+
+struct inode* ip;
+struct stat* st;
+
+__code cbc_statinode((struct inode* ip, struct stat* st, __code next(int ret, ...));
+
+__code next(...);
+
+} inode_impl;