annotate src/impl/PipeRead.cbc @ 104:9bfc4fbb5502

create PipeRead.cbc
author anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Wed, 20 Nov 2019 20:15:12 +0900
parents
children f1be2d5abc8a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
104
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 #include "../context.h";
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 #interface "SysRead.h";
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 // ----
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 // typedef struct PipeRead<Type, Isa> impl SysRead {
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 // struct CbCPipe *pipe;
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 // struct String *addr;
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 // struct Integer* i;
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 // } PipeRead;
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 // ----
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 SysRead* createPipeRead(struct Context* cbc_context) {
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 struct SysRead* sys_read = new SysRead();
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 struct PipeRead* pipeRead = new PipeRead();
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 sys_read->sys_read = (union Data*)pipeRead;
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 pipeRead->num = NULL;
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 sys_read->read = C_readPipeRead;
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 sys_read->ret = C_retPipeRead;
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 sys_read->next = C_nextPipeRead;
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20 return sys_read;
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 }
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 __code readPipeRead(__code next(...)) {
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
23
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
24 goto next(...);
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
25 }
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
26
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
27 __code retPipeRead(PipeRead* cbc_sys_file, UInteger* num) {
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
28
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
29 }
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
30
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
31 __code nextPipeRead(...) {
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
32
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
33 }
9bfc4fbb5502 create PipeRead.cbc
anatofuz <anatofuz@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
34