X-Git-Url: http://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fio%2Fbackend.h;h=2b41fa72864ca1df0ac16b2afa023e2cfcd1856c;hp=06427eb6fa37ea53aabfb47725211e8a448756b8;hb=a2dffefa5ef8d0cf71d99755c4640a8004679b1d;hpb=8d97cddd18f504409ddb66dfe396798c99c2dfbd diff --git a/ccan/io/backend.h b/ccan/io/backend.h index 06427eb6..2b41fa72 100644 --- a/ccan/io/backend.h +++ b/ccan/io/backend.h @@ -22,11 +22,15 @@ struct io_listener { }; enum io_state { - NEXT, /* eg starting, woken from idle, return from io_break. */ + /* These wait for something to input */ READ, - WRITE, READPART, + + /* These wait for room to output */ + WRITE, WRITEPART, + + NEXT, /* eg starting, woken from idle, return from io_break. */ IDLE, FINISHED, PROCESSING /* We expect them to change this now. */ @@ -61,6 +65,8 @@ struct io_state_writepart { struct io_conn { struct fd fd; + struct io_conn *duplex; + enum io_state state; union { struct io_state_read read; @@ -74,9 +80,9 @@ extern void *io_loop_return; bool add_listener(struct io_listener *l); bool add_conn(struct io_conn *c); +bool add_duplex(struct io_conn *c); void del_listener(struct io_listener *l); void backend_set_state(struct io_conn *conn, struct io_op *op); -struct io_op *do_writeable(struct io_conn *conn); -struct io_op *do_readable(struct io_conn *conn); +struct io_op *do_ready(struct io_conn *conn); #endif /* CCAN_IO_BACKEND_H */