1 /* Licensed under LGPLv2.1+ - see LICENSE file for details */
7 * union io_plan_arg - scratch space for struct io_plan read/write fns.
14 char c[sizeof(size_t)];
18 /* As before calling next function. */
22 /* Waiting for io_wake */
26 /* Closing (both plans will be the same). */
31 * struct io_plan - one half of I/O to do
32 * @status: the status of this plan.
33 * @io: function to call when fd becomes read/writable, returns 0 to be
34 * called again, 1 if it's finished, and -1 on error (fd will be closed)
35 * @next: the next function which is called if io returns 1.
36 * @next_arg: the argument to @next
37 * @u1, @u2: scratch space for @io.
40 enum io_plan_status status;
42 int (*io)(int fd, struct io_plan *plan);
44 struct io_plan *(*next)(struct io_conn *, void *arg);
47 union io_plan_arg u1, u2;
50 /* Helper to get a conn's io_plan. */
51 struct io_plan *io_get_plan(struct io_conn *conn, enum io_direction dir);
53 #endif /* CCAN_IO_PLAN_H */