From 3a23aaa21c7f8f0b28f15dcb5331471891760280 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 29 Mar 2011 19:57:11 -0700 Subject: [PATCH] ol_handle_new -> ol_tcp_handle_new --- ol-unix.c | 4 ++-- ol.h | 7 ++++++- test/echo-server.c | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ol-unix.c b/ol-unix.c index 6c4a1daa..93f3d179 100644 --- a/ol-unix.c +++ b/ol-unix.c @@ -54,7 +54,7 @@ int ol_run() { } -ol_handle* ol_handle_new(ol_close_cb close_cb, void* data) { +ol_handle* ol_tcp_handle_new(ol_close_cb close_cb, void* data) { ol_handle *handle = calloc(sizeof(ol_handle), 1); handle->close_cb = close_cb; handle->data = data; @@ -127,7 +127,7 @@ int ol_tcp_init_fd(int fd) { ol_handle* ol_tcp_open(ol_handle* parent, int fd) { - ol_handle* h = ol_handle_new(NULL, NULL); + ol_handle* h = ol_tcp_handle_new(NULL, NULL); if (!h) { return NULL; } diff --git a/ol.h b/ol.h index cb8e3da8..881c0a5a 100644 --- a/ol.h +++ b/ol.h @@ -80,7 +80,12 @@ const char* ol_err_str(ol_err err); void ol_init(); int ol_run(); -ol_handle* ol_handle_new(ol_close_cb close_cb, void* data); +ol_handle* ol_tcp_handle_new(ol_close_cb close_cb, void* data); +/* TODO: + * ol_named_pipe_handle_new + * ol_file_handle_new + * ol_tty_handle_new + */ /* TCP server methods. */ int ol_bind(ol_handle* handle, struct sockaddr* addr); diff --git a/test/echo-server.c b/test/echo-server.c index d7234540..7a0ab5c2 100644 --- a/test/echo-server.c +++ b/test/echo-server.c @@ -89,7 +89,7 @@ int main(int argc, char** argv) { ol_init(); - server = ol_handle_new(on_close, NULL); + server = ol_tcp_handle_new(on_close, NULL); addr = ol_ip4_addr("0.0.0.0", 8000);