]> git.ozlabs.org Git - ccan/blobdiff - ccan/io/test/run-12-bidir.c
ccan/io: use explicit IO callback functions, instead of io_state values.
[ccan] / ccan / io / test / run-12-bidir.c
index f9cf4e591148fe9e66e2defacf86457f2728cfa2..eb4f4f0551f71804396131ae23f148a87699770d 100644 (file)
@@ -18,13 +18,13 @@ static void finish_ok(struct io_conn *conn, struct data *d)
        d->state++;
 }
 
        d->state++;
 }
 
-static struct io_op *write_out(struct io_conn *conn, struct data *d)
+static struct io_plan *write_out(struct io_conn *conn, struct data *d)
 {
        d->state++;
 {
        d->state++;
-       return io_write(d->wbuf, sizeof(d->wbuf), io_next(conn, io_close, d));
+       return io_write(conn, d->wbuf, sizeof(d->wbuf), io_close, d);
 }
 
 }
 
-static struct io_op *start_ok(struct io_conn *conn, struct data *d)
+static struct io_plan *start_ok(struct io_conn *conn, struct data *d)
 {
        ok1(d->state == 0);
        d->state++;
 {
        ok1(d->state == 0);
        d->state++;
@@ -33,7 +33,7 @@ static struct io_op *start_ok(struct io_conn *conn, struct data *d)
 
        memset(d->wbuf, 7, sizeof(d->wbuf));
        ok1(io_duplex(conn, write_out, finish_ok, d));
 
        memset(d->wbuf, 7, sizeof(d->wbuf));
        ok1(io_duplex(conn, write_out, finish_ok, d));
-       return io_read(d->buf, sizeof(d->buf), io_next(conn, io_close, d));
+       return io_read(conn, d->buf, sizeof(d->buf), io_close, d);
 }
 
 static int make_listen_fd(const char *port, struct addrinfo **info)
 }
 
 static int make_listen_fd(const char *port, struct addrinfo **info)