From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 4844746970E for ; Fri, 31 Jan 2020 22:25:21 +0300 (MSK) Received: by mail-lj1-f195.google.com with SMTP id o15so2713912ljg.6 for ; Fri, 31 Jan 2020 11:25:21 -0800 (PST) From: Cyrill Gorcunov Date: Fri, 31 Jan 2020 22:25:02 +0300 Message-Id: <20200131192504.12142-2-gorcunov@gmail.com> In-Reply-To: <20200131192504.12142-1-gorcunov@gmail.com> References: <20200131192504.12142-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v10 1/3] coio: export helpers List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml There is no reason to hide functions. In particular we will use these helpers in popen code. Part-of #4031 Signed-off-by: Cyrill Gorcunov --- src/box/applier.cc | 2 +- src/lib/core/coio.h | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/box/applier.cc b/src/box/applier.cc index ae3d281a5..ecfe0771b 100644 --- a/src/box/applier.cc +++ b/src/box/applier.cc @@ -1009,7 +1009,7 @@ applier_disconnect(struct applier *applier, enum applier_state state) applier->writer = NULL; } - coio_close(loop(), &applier->io); + coio_close_io(loop(), &applier->io); /* Clear all unparsed input. */ ibuf_reinit(&applier->ibuf); fiber_gc(); diff --git a/src/lib/core/coio.h b/src/lib/core/coio.h index 6a2337689..c323955d7 100644 --- a/src/lib/core/coio.h +++ b/src/lib/core/coio.h @@ -32,9 +32,16 @@ */ #include "fiber.h" #include "trivia/util.h" -#if defined(__cplusplus) + #include "evio.h" +#if defined(__cplusplus) +extern "C" { +#endif /* defined(__cplusplus) */ + +struct sockaddr; +struct uri; + /** * Co-operative I/O * Yield the current fiber until IO is ready. @@ -70,8 +77,12 @@ coio_accept(struct ev_io *coio, struct sockaddr *addr, socklen_t addrlen, void coio_create(struct ev_io *coio, int fd); +/* + * Due to name conflict with coio_close in API_EXPORT + * we have to use coio_close_io() instead of plain coio_close(). + */ static inline void -coio_close(ev_loop *loop, struct ev_io *coio) +coio_close_io(ev_loop *loop, struct ev_io *coio) { return evio_close(loop, coio); } @@ -185,9 +196,6 @@ coio_stat_stat_timeout(ev_stat *stat, ev_tstamp delay); int coio_waitpid(pid_t pid); -extern "C" { -#endif /* defined(__cplusplus) */ - /** \cond public */ enum { -- 2.20.1