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 94C15469719 for ; Fri, 9 Oct 2020 00:37:00 +0300 (MSK) Received: by mail-lj1-f195.google.com with SMTP id d24so4439473ljg.10 for ; Thu, 08 Oct 2020 14:37:00 -0700 (PDT) From: Cyrill Gorcunov Date: Fri, 9 Oct 2020 00:36:06 +0300 Message-Id: <20201008213608.1022476-5-gorcunov@gmail.com> In-Reply-To: <20201008213608.1022476-1-gorcunov@gmail.com> References: <20201008213608.1022476-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v5 4/6] box/func: export func_split_name helper List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml Cc: Vladislav Shpilevoy To reuse this functionality in next patch. Part-of #4642 Signed-off-by: Cyrill Gorcunov --- src/box/func.c | 20 +------------------- src/box/func.h | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/box/func.c b/src/box/func.c index 89796310f..ba98f0f9e 100644 --- a/src/box/func.c +++ b/src/box/func.c @@ -44,18 +44,6 @@ #include #include -/** - * Parsed symbol and package names. - */ -struct func_name { - /** Null-terminated symbol name, e.g. "func" for "mod.submod.func" */ - const char *sym; - /** Package name, e.g. "mod.submod" for "mod.submod.func" */ - const char *package; - /** A pointer to the last character in ->package + 1 */ - const char *package_end; -}; - struct func_c { /** Function object base class. */ struct func base; @@ -64,13 +52,7 @@ struct func_c { struct module_sym mod_sym; }; -/*** - * Split function name to symbol and package names. - * For example, str = foo.bar.baz => sym = baz, package = foo.bar - * @param str function name, e.g. "module.submodule.function". - * @param[out] name parsed symbol and package names. - */ -static void +void func_split_name(const char *str, struct func_name *name) { name->package = str; diff --git a/src/box/func.h b/src/box/func.h index 35f4e320c..92caef9cc 100644 --- a/src/box/func.h +++ b/src/box/func.h @@ -107,6 +107,27 @@ struct func { struct access access[BOX_USER_MAX]; }; +/** + * Parsed symbol and package names. + */ +struct func_name { + /** Null-terminated symbol name, e.g. "func" for "mod.submod.func" */ + const char *sym; + /** Package name, e.g. "mod.submod" for "mod.submod.func" */ + const char *package; + /** A pointer to the last character in ->package + 1 */ + const char *package_end; +}; + +/*** + * Split function name to symbol and package names. + * For example, str = foo.bar.baz => sym = baz, package = foo.bar + * @param str function name, e.g. "module.submodule.function". + * @param[out] name parsed symbol and package names. + */ +void +func_split_name(const char *str, struct func_name *name); + /** * Initialize modules subsystem. */ -- 2.26.2