diff options
author | Fedor Indutny <fedor@indutny.com> | 2016-05-26 00:27:08 -0400 |
---|---|---|
committer | Fedor Indutny <fedor@indutny.com> | 2016-05-26 00:27:08 -0400 |
commit | 5649bb2eeffbd6b7b074e63cf72ae064b10fcd0d (patch) | |
tree | 8101ec65a3b11a0492b6a4c26fbd492e24b05bb3 | |
parent | 9b0a792a84b8c6fca6f94c740061bdd46b502290 (diff) | |
download | uv_link_t-5649bb2eeffbd6b7b074e63cf72ae064b10fcd0d.tar.gz |
src: shuffle files around
-rw-r--r-- | include/uv_link_t.h (renamed from include/uv_link.h) | 5 | ||||
-rw-r--r-- | src/common.h | 2 | ||||
-rw-r--r-- | src/uv_link_source_t.c (renamed from src/uv_link_source.c) | 7 | ||||
-rw-r--r-- | src/uv_link_t.c (renamed from src/uv_link.c) | 6 | ||||
-rw-r--r-- | test/src/test-common.h | 2 | ||||
-rw-r--r-- | test/src/test-uv-link-source-t.c | 1 | ||||
-rw-r--r-- | uv_link_t.gyp | 4 |
7 files changed, 15 insertions, 12 deletions
diff --git a/include/uv_link.h b/include/uv_link_t.h index f835fd2..45a179c 100644 --- a/include/uv_link.h +++ b/include/uv_link_t.h @@ -6,7 +6,6 @@ typedef struct uv_link_s uv_link_t; typedef struct uv_link_source_s uv_link_source_t; -typedef void (*uv_link_close_cb)(uv_link_t* link); typedef void (*uv_link_alloc_cb)(uv_link_t* link, size_t suggested_size, uv_buf_t* buf); @@ -46,7 +45,7 @@ struct uv_link_source_s { }; UV_EXTERN int uv_link_init(uv_loop_t* loop, uv_link_t* link); -UV_EXTERN int uv_link_close(uv_link_t* link, uv_link_close_cb close_cb); +UV_EXTERN void uv_link_close(uv_link_t* link); UV_EXTERN int uv_link_chain(uv_link_t* from, uv_link_t* to); UV_EXTERN int uv_link_unchain(uv_link_t* from, uv_link_t* to); @@ -57,6 +56,6 @@ UV_EXTERN int uv_link_unchain(uv_link_t* from, uv_link_t* to); UV_EXTERN int uv_link_source_init(uv_loop_t* loop, uv_link_source_t* source, uv_stream_t* stream); -UV_EXTERN int uv_link_source_destroy(uv_link_source_t* source); +UV_EXTERN void uv_link_source_close(uv_link_source_t* source); #endif /* INCLUDE_UV_LINK_H_ */ diff --git a/src/common.h b/src/common.h index 8c5725d..6d19477 100644 --- a/src/common.h +++ b/src/common.h @@ -1,6 +1,8 @@ #ifndef SRC_COMMON_H_ #define SRC_COMMON_H_ +#include "uv_link_t.h" + #define container_of(ptr, type, member) \ ((type *) ((char *) (ptr) - offsetof(type, member))) diff --git a/src/uv_link_source.c b/src/uv_link_source_t.c index 181a060..c58e8ec 100644 --- a/src/uv_link_source.c +++ b/src/uv_link_source_t.c @@ -1,7 +1,5 @@ #include <stdlib.h> -#include "uv_link.h" - #include "common.h" typedef struct uv_link_source_write_s uv_link_source_write_t; @@ -154,7 +152,8 @@ int uv_link_source_init(uv_loop_t* loop, } -int uv_link_source_destroy(uv_link_source_t* source) { +void uv_link_source_close(uv_link_source_t* source) { + uv_link_close(&source->link); + source->stream = NULL; - return 0; } diff --git a/src/uv_link.c b/src/uv_link_t.c index e4199cf..891640c 100644 --- a/src/uv_link.c +++ b/src/uv_link_t.c @@ -1,10 +1,12 @@ #include <string.h> -#include "uv_link.h" - #include "common.h" int uv_link_init(uv_loop_t* loop, uv_link_t* link) { memset(link, 0, sizeof(*link)); return 0; } + + +void uv_link_close(uv_link_t* link) { +} diff --git a/test/src/test-common.h b/test/src/test-common.h index 10e40a2..1a3e79d 100644 --- a/test/src/test-common.h +++ b/test/src/test-common.h @@ -6,7 +6,7 @@ #include <errno.h> #include "uv.h" -#include "uv_link.h" +#include "uv_link_t.h" #include "test-list.h" diff --git a/test/src/test-uv-link-source-t.c b/test/src/test-uv-link-source-t.c index a1d91df..64ab200 100644 --- a/test/src/test-uv-link-source-t.c +++ b/test/src/test-uv-link-source-t.c @@ -114,6 +114,7 @@ TEST_IMPL(uv_link_source_t) { test_writes(); test_reads(); + uv_link_source_close(&source); uv_close((uv_handle_t*) &pair_right, NULL); CHECK_EQ(close(fds[0]), 0, "close(fds[0])"); diff --git a/uv_link_t.gyp b/uv_link_t.gyp index 6b00b43..7e881e0 100644 --- a/uv_link_t.gyp +++ b/uv_link_t.gyp @@ -15,8 +15,8 @@ ], "sources": [ - "src/uv_link.c", - "src/uv_link_source.c", + "src/uv_link_t.c", + "src/uv_link_source_t.c", ], }], } |