- struct io_plan *(*next)(struct io_conn *, void *arg);
- void (*finish)(struct io_conn *, void *arg);
- void *conn_arg;
-};
-
-enum io_state {
- /* These wait for something to input */
- READ,
- 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. */
-};
-
-static inline enum io_state from_ioplan(struct io_plan *op)
-{
- return (enum io_state)(long)op;
-}
-
-struct io_state_read {
- char *buf;
- size_t len;
-};
-
-struct io_state_write {
- const char *buf;
- size_t len;
-};
-
-struct io_state_readpart {
- char *buf;
- size_t *lenp;
-};
-
-struct io_state_writepart {
- const char *buf;
- size_t *lenp;