From 61e1f5f3c972882b088c9e2727d35684101943ba Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 18 Apr 2011 13:01:50 -0700 Subject: [PATCH] s/oio_tcp_handle_init/oio_tcp_init/ --- oio-unix.c | 6 +++--- oio-win.c | 2 +- oio.h | 2 +- test/echo-server.c | 2 +- test/test-callback-stack.c | 4 ++-- test/test-ping-pong.c | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/oio-unix.c b/oio-unix.c index f89f46f6..28696851 100644 --- a/oio-unix.c +++ b/oio-unix.c @@ -121,7 +121,7 @@ int oio_run() { } -int oio_tcp_handle_init(oio_handle *handle, oio_close_cb close_cb, +int oio_tcp_init(oio_handle *handle, oio_close_cb close_cb, void* data) { handle->type = OIO_TCP; handle->close_cb = close_cb; @@ -203,7 +203,7 @@ int oio_tcp_open(oio_handle* handle, int fd) { ev_io_set(&handle->read_watcher, fd, EV_READ); ev_io_set(&handle->write_watcher, fd, EV_WRITE); - /* These should have been set up by oio_tcp_handle_init. */ + /* These should have been set up by oio_tcp_init. */ assert(handle->next_watcher.data == handle); assert(handle->write_watcher.data == handle); assert(handle->read_watcher.data == handle); @@ -263,7 +263,7 @@ int oio_accept(oio_handle* server, oio_handle* client, return -1; } - if (oio_tcp_handle_init(client, close_cb, data)) { + if (oio_tcp_init(client, close_cb, data)) { return -1; } diff --git a/oio-win.c b/oio-win.c index 494df56d..598756e0 100644 --- a/oio-win.c +++ b/oio-win.c @@ -343,7 +343,7 @@ static int oio_set_socket_options(SOCKET socket) { } -int oio_tcp_handle_init(oio_handle *handle, oio_close_cb close_cb, +int oio_tcp_init(oio_handle *handle, oio_close_cb close_cb, void* data) { handle->close_cb = close_cb; handle->data = data; diff --git a/oio.h b/oio.h index 1e443009..3414d09f 100644 --- a/oio.h +++ b/oio.h @@ -121,7 +121,7 @@ void oio_req_init(oio_req* req, oio_handle* handle, void* cb); /* TCP socket methods. */ /* Handle and callback bust be set by calling oio_req_init. */ -int oio_tcp_handle_init(oio_handle *handle, oio_close_cb close_cb, void* data); +int oio_tcp_init(oio_handle *handle, oio_close_cb close_cb, void* data); int oio_bind(oio_handle* handle, struct sockaddr* addr); int oio_connect(oio_req* req, struct sockaddr* addr); int oio_shutdown(oio_req* req); diff --git a/test/echo-server.c b/test/echo-server.c index b38af28d..d87412f4 100644 --- a/test/echo-server.c +++ b/test/echo-server.c @@ -105,7 +105,7 @@ int echo_start(int port) { struct sockaddr_in addr = oio_ip4_addr("0.0.0.0", port); int r; - r = oio_tcp_handle_init(&server, on_server_close, NULL); + r = oio_tcp_init(&server, on_server_close, NULL); if (r) { /* TODO: Error codes */ fprintf(stderr, "Socket creation error\n"); diff --git a/test/test-callback-stack.c b/test/test-callback-stack.c index 0eba57b2..3f3c35cc 100644 --- a/test/test-callback-stack.c +++ b/test/test-callback-stack.c @@ -42,8 +42,8 @@ TEST_IMPL(close_cb_stack) { oio_init(); - if (oio_tcp_handle_init(&handle, &close_cb, NULL)) { - FATAL("oio_tcp_handle_init failed"); + if (oio_tcp_init(&handle, &close_cb, NULL)) { + FATAL("oio_tcp_init failed"); } nested++; diff --git a/test/test-ping-pong.c b/test/test-ping-pong.c index 245c6d3d..0c13eaf1 100644 --- a/test/test-ping-pong.c +++ b/test/test-ping-pong.c @@ -139,7 +139,7 @@ void pinger_new() { pinger->buf.base = (char*)&pinger->read_buffer; /* Try to connec to the server and do NUM_PINGS ping-pongs. */ - r = oio_tcp_handle_init(&pinger->handle, pinger_on_close, (void*)pinger); + r = oio_tcp_init(&pinger->handle, pinger_on_close, (void*)pinger); ASSERT(!r); /* We are never doing multiple reads/connects at a time anyway. */