[Tarantool-patches] [PATCH 42/43] build: export src/lua/string.c symbols

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Sun Apr 12 03:13:25 MSK 2020


Exports a function used by src/lua/string.lua via FFI.

Part of #2971
---
 extra/exports    | 4 ----
 src/lua/init.c   | 4 ++++
 src/lua/string.c | 9 +++++++++
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/extra/exports b/extra/exports
index 5db526d2c..2341b0861 100644
--- a/extra/exports
+++ b/extra/exports
@@ -1,9 +1,5 @@
 # Symbols exported by the main Tarantool executable
 
-# Module API
-
-string_strip_helper
-
 # Lua / LuaJIT
 
 lua_newstate
diff --git a/src/lua/init.c b/src/lua/init.c
index daa685f57..f115bd2c9 100644
--- a/src/lua/init.c
+++ b/src/lua/init.c
@@ -746,6 +746,9 @@ tarantool_lua_msgpack_export_syms(void);
 void **
 tarantool_lua_socket_export_syms(void);
 
+void **
+tarantool_lua_string_export_syms(void);
+
 void **
 tarantool_lua_tnt_iconv_export_syms(void);
 
@@ -766,6 +769,7 @@ tarantool_lua_export_syms(void)
 		(void *)tarantool_lua_msgpack_export_syms,
 		(void *)tarantool_lua_socket_export_syms,
 		(void *)tarantool_lua_tnt_iconv_export_syms,
+		(void *)tarantool_lua_string_export_syms,
 		(void *)tarantool_lua_utils_export_syms,
 
 		/* Own symbols. */
diff --git a/src/lua/string.c b/src/lua/string.c
index c140299ff..d265697ea 100644
--- a/src/lua/string.c
+++ b/src/lua/string.c
@@ -115,3 +115,12 @@ string_strip_helper(const char *inp, size_t inp_len, const char *chars,
 
 	*newlen = inp_len - skipped;
 }
+
+void **
+tarantool_lua_string_export_syms(void)
+{
+	static void *syms[] = {
+		string_strip_helper,
+	};
+	return syms;
+}
-- 
2.21.1 (Apple Git-122.3)



More information about the Tarantool-patches mailing list