size_t *lenp;
};
-enum io_result {
- RESULT_AGAIN,
- RESULT_FINISHED,
- RESULT_CLOSE
-};
-
-enum io_state {
- IO_IO,
- IO_IDLE,
- IO_FINISHED
-};
-
/**
* struct io_plan - returned from a setup function.
*
*/
struct io_plan {
int pollflag;
- enum io_state state;
- enum io_result (*io)(struct io_conn *conn);
+ /* Only NULL if idle. */
+ bool (*io)(int fd, struct io_plan *plan);
+ /* Only NULL if closing. */
struct io_plan (*next)(struct io_conn *, void *arg);
void *next_arg;