From: Cyrill Gorcunov <gorcunov@gmail.com>
To: tml <tarantool-patches@dev.tarantool.org>
Cc: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>,
Alexander Turenko <alexander.turenko@tarantool.org>
Subject: [Tarantool-patches] [PATCH v4 4/6] box/func: export func_split_name helper
Date: Thu, 1 Oct 2020 16:51:11 +0300 [thread overview]
Message-ID: <20201001135113.329664-5-gorcunov@gmail.com> (raw)
In-Reply-To: <20201001135113.329664-1-gorcunov@gmail.com>
To reuse this functionality in next patch.
Part-of #4642
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
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 <fcntl.h>
#include <dlfcn.h>
-/**
- * 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
next prev parent reply other threads:[~2020-10-01 13:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-01 13:51 [Tarantool-patches] [PATCH v4 0/6] box/func: implement cfunc Lua module Cyrill Gorcunov
2020-10-01 13:51 ` [Tarantool-patches] [PATCH v4 1/6] box/func: factor out c function entry structure Cyrill Gorcunov
2020-10-01 13:51 ` [Tarantool-patches] [PATCH v4 2/6] box/func: provide module_sym_call Cyrill Gorcunov
2020-10-01 13:51 ` [Tarantool-patches] [PATCH v4 3/6] box/func: more detailed error in module reloading Cyrill Gorcunov
2020-10-01 13:51 ` Cyrill Gorcunov [this message]
2020-10-01 13:51 ` [Tarantool-patches] [PATCH v4 5/6] box/func: implement cfunc Lua module Cyrill Gorcunov
2020-10-03 13:55 ` Vladislav Shpilevoy
2020-10-05 10:31 ` Cyrill Gorcunov
2020-10-05 21:59 ` Vladislav Shpilevoy
2020-10-06 12:55 ` Cyrill Gorcunov
2020-10-01 13:51 ` [Tarantool-patches] [PATCH v4 6/6] test: box/cfunc -- add simple module test Cyrill Gorcunov
2020-10-03 13:55 ` Vladislav Shpilevoy
2020-10-03 13:55 ` [Tarantool-patches] [PATCH v4 0/6] box/func: implement cfunc Lua module Vladislav Shpilevoy
2020-10-05 11:51 ` Cyrill Gorcunov
2020-10-05 21:59 ` Vladislav Shpilevoy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201001135113.329664-5-gorcunov@gmail.com \
--to=gorcunov@gmail.com \
--cc=alexander.turenko@tarantool.org \
--cc=tarantool-patches@dev.tarantool.org \
--cc=v.shpilevoy@tarantool.org \
--subject='Re: [Tarantool-patches] [PATCH v4 4/6] box/func: export func_split_name helper' \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox