diff options
Diffstat (limited to 'include/uv_link_t.h')
-rw-r--r-- | include/uv_link_t.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/include/uv_link_t.h b/include/uv_link_t.h index 63e2410..2adaac3 100644 --- a/include/uv_link_t.h +++ b/include/uv_link_t.h @@ -14,8 +14,8 @@ typedef void (*uv_link_alloc_cb)(uv_link_t* link, typedef void (*uv_link_read_cb)(uv_link_t* link, ssize_t nread, const uv_buf_t* buf); -typedef void (*uv_link_write_cb)(uv_link_t* source, int status); -typedef void (*uv_link_shutdown_cb)(uv_link_t* source, int status); +typedef void (*uv_link_write_cb)(uv_link_t* source, int status, void* arg); +typedef void (*uv_link_shutdown_cb)(uv_link_t* source, int status, void* arg); struct uv_link_methods_s { int (*read_start)(uv_link_t* link); @@ -26,12 +26,16 @@ struct uv_link_methods_s { const uv_buf_t bufs[], unsigned int nbufs, uv_stream_t* send_handle, - uv_link_write_cb cb); + uv_link_write_cb cb, + void* arg); int (*try_write)(uv_link_t* link, const uv_buf_t bufs[], unsigned int nbufs); - int (*shutdown)(uv_link_t* link, uv_link_t* source, uv_link_shutdown_cb cb); + int (*shutdown)(uv_link_t* link, + uv_link_t* source, + uv_link_shutdown_cb cb, + void* arg); /* Overriding callbacks */ uv_link_alloc_cb alloc_cb_override; @@ -86,8 +90,9 @@ static int uv_link_write(uv_link_t* link, const uv_buf_t bufs[], unsigned int nbufs, uv_stream_t* send_handle, - uv_link_write_cb cb) { - return link->methods->write(link, source, bufs, nbufs, send_handle, cb); + uv_link_write_cb cb, + void* arg) { + return link->methods->write(link, source, bufs, nbufs, send_handle, cb, arg); } @@ -99,8 +104,9 @@ static int uv_link_try_write(uv_link_t* link, static int uv_link_shutdown(uv_link_t* link, uv_link_t* source, - uv_link_shutdown_cb cb) { - return link->methods->shutdown(link, source, cb); + uv_link_shutdown_cb cb, + void* arg) { + return link->methods->shutdown(link, source, cb, arg); } /* Link Source */ |