X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fio%2Fio_plan.h;h=61d762454463b0f12868ff5a74fcdccbaa265f32;hb=e4fbff960f8d384ee793259ff6e13bb798114c98;hp=57c7b976bdaee4d07fb76057d38afd02875c4ce5;hpb=13b38a7282c6043d6abe310e5a16d6610ed7a1c1;p=ccan diff --git a/ccan/io/io_plan.h b/ccan/io/io_plan.h index 57c7b976..61d76245 100644 --- a/ccan/io/io_plan.h +++ b/ccan/io/io_plan.h @@ -9,7 +9,8 @@ struct io_conn; * @io: function to call when fd is available for @pollflag. * @next: function to call after @io returns true. * @next_arg: argument to @next. - * @u: scratch area for I/O. + * @u1: scratch area for I/O. + * @u2: scratch area for I/O. * * When the fd is POLLIN or POLLOUT (according to @pollflag), @io is * called. If it returns -1, io_close() becomed the new plan (and errno @@ -27,38 +28,19 @@ struct io_plan { void *next_arg; union { - struct { - char *buf; - size_t len; - } read; - struct { - const char *buf; - size_t len; - } write; - struct { - char *buf; - size_t *lenp; - } readpart; - struct { - const char *buf; - size_t *lenp; - } writepart; - struct { - int saved_errno; - } close; - struct { - void *p; - size_t len; - } ptr_len; - struct { - void *p1; - void *p2; - } ptr_ptr; - struct { - size_t len1; - size_t len2; - } len_len; - } u; + char *cp; + void *vp; + const void *const_vp; + size_t s; + char c[sizeof(size_t)]; + } u1; + union { + char *p; + void *vp; + const void *const_vp; + size_t s; + char c[sizeof(size_t)]; + } u2; }; #ifdef DEBUG