view src/interface/SysRead.h @ 135:0c24464a66d8

introduce protoype sysread interface
author anatofuz
date Thu, 12 Dec 2019 12:57:29 +0900
parents c690327cabc8
children e3dd8f96c2fb f49d1bb1b947
line wrap: on
line source

typedef struct SysRead<Type, Impl>{
   union  Data* sys_read;
   union Data* impl;
   int num;
   char* addr;
   struct file* file;
   int r;
   struct pipe* pipe;
   __code read(Impl* sys_read, union Data* impl, char* addr, int n, __code (*next)(int ret));
   //__code ret(Impl* cbc_sys_file, UInteger* num);
   __code next(...);
   //__code cbc_fileread1(Impl* sys_read, int r);
   __code cbc_fileread(Impl* sys_read, struct file* file, char* addr, int n, __code (*next)(int ret));
   __code cbc_piperead(Impl* sys_read, struct pipe *p, char *addr, int n, __code (*next)(int ret));
   //__code cbc_piperead1(Impl* sys_read, struct pipe* p);
   //__code cbc_piperead2(Impl* sys_read, int i, int n,struct pipe* p);
   //__code cbc_piperead3(Impl* sys_read, struct pipe* p, int i);
} SysRead;

/*
 * cbc_piperead cbc_filereのAPIは微妙な違いしかない
 * union Dataから実装の型を見てキャストすると良さそう
 */