diff options
author | Fedor Indutny <fedor@indutny.com> | 2016-05-31 20:35:31 -0400 |
---|---|---|
committer | Fedor Indutny <fedor@indutny.com> | 2016-05-31 20:35:31 -0400 |
commit | 29721feb45e5bc66d9198d37e1d4723974d85a13 (patch) | |
tree | ae882a35730ec92e1e7c08a5178f69e6bd4a9717 | |
parent | 087b8ef36bea5f6225e4b4a2c0119ba05a489641 (diff) | |
download | uv_link_t-29721feb45e5bc66d9198d37e1d4723974d85a13.tar.gz |
example: simplify using default methods
-rw-r--r-- | example/src/middle.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/example/src/middle.c b/example/src/middle.c index 6bd4e85..57c6e5b 100644 --- a/example/src/middle.c +++ b/example/src/middle.c @@ -4,22 +4,6 @@ #include "uv_link_t.h" -static int read_start_impl(uv_link_t* link) { - return uv_link_read_start(link->parent); -} - - -static int read_stop_impl(uv_link_t* link) { - return uv_link_read_stop(link->parent); -} - - -static void close_impl(uv_link_t* link, uv_link_t* source, - uv_link_close_cb cb) { - cb(source); -} - - static void alloc_cb_override(uv_link_t* link, size_t suggested_size, uv_buf_t* buf) { @@ -57,9 +41,9 @@ static void read_cb_override(uv_link_t* link, uv_link_methods_t middle_methods = { - .read_start = read_start_impl, - .read_stop = read_stop_impl, - .close = close_impl, + .read_start = uv_link_default_read_start, + .read_stop = uv_link_default_read_stop, + .close = uv_link_default_close, /* Other doesn't matter in this example */ .alloc_cb_override = alloc_cb_override, |