changeset 347:ea5ee6e71a3b

add io interface
author anatofuz
date Mon, 02 Mar 2020 14:24:17 +0900
parents 36ed64fea8c1
children 1616cb02ecec
files src/impl/ConsoleIO.h src/interface/IO.h src/interface/io.h
diffstat 3 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/impl/ConsoleIO.h	Mon Mar 02 14:24:17 2020 +0900
@@ -0,0 +1,5 @@
+typedef struct ConsoleIO <Type, Isa> impl IO {
+  __code consoleread1(Type* IO, int n, int target, char* dst, struct inode* ip, __code next(...));
+  __code consoleread2(Type* IO, struct inode*  ip, __code next(...));
+  __code next(....);
+} ConsoleIO;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/interface/IO.h	Mon Mar 02 14:24:17 2020 +0900
@@ -0,0 +1,6 @@
+typedef struct IO <Type, Impl> {
+    __code read(Impl* io, struct file* file, char* addr, __code next(...));
+    __code write(Impl* io, struct file* file, char* addr, int n, __code next(...));
+    __code close(Impl* io, struct file* file, int fd, __code next(...));
+    __code next(...);
+} IO; 
--- a/src/interface/io.h	Mon Mar 02 14:19:49 2020 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-typedef struct IO <Type, Impl> {
-    __code read(Impl* io, char* addr, __code next(...));
-    __code write(Impl* io, char* addr, int n, __code next(...));
-    __code close(Impl* io,int fd, __code next(...));
-    __code next(...);
-} IO;