-#define io_connect(fd, addr, cb, arg) \
- io_debug(io_connect_((fd), (addr), \
- typesafe_cb_preargs(struct io_plan, void *, \
- (cb), (arg), \
- struct io_conn *), \
- (arg)))
-struct io_plan io_connect_(int fd, const struct addrinfo *addr,
- struct io_plan (*cb)(struct io_conn *, void*),
- void *arg);
-
-/**
- * io_wait - plan to wait for something.
- * @wait: the address to wait on.
- * @cb: function to call after waiting.
- * @arg: @cb argument
- *
- * This indicates the connection is idle: io_wake() will be called later to
- * restart the connection.
- *
- * Example:
- * struct io_conn *sleeper;
- * unsigned int counter = 0;
- * sleeper = io_new_conn(open("/dev/null", O_RDONLY),
- * io_wait(&counter, io_close_cb, NULL));
- * if (!sleeper)
- * exit(1);
- */
-#define io_wait(wait, cb, arg) \
- io_debug(io_wait_(wait, \
- typesafe_cb_preargs(struct io_plan, void *, \
- (cb), (arg), \
- struct io_conn *), \
- (arg)))
+#define io_connect(conn, addr, next, arg) \
+ io_connect_((conn), (addr), \
+ typesafe_cb_preargs(struct io_plan *, void *, \
+ (next), (arg), \
+ struct io_conn *), \
+ (arg))