- struct io_plan *(*next)(struct io_conn *, void *arg);
- void (*finish)(struct io_conn *, void *arg);
- void *conn_arg;
-};
-
-enum io_result {
- RESULT_AGAIN,
- RESULT_FINISHED,
- RESULT_CLOSE
-};
-
-enum io_state {
- IO_IO,
- IO_NEXT, /* eg starting, woken from idle, return from io_break. */
- IO_IDLE,
- IO_FINISHED
-};
-
-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;