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

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


Exports functions visible to the public C API.

Part of #2971
---
 extra/exports   | 16 ----------------
 src/lua/init.c  |  4 ++++
 src/lua/utils.c | 24 ++++++++++++++++++++++++
 3 files changed, 28 insertions(+), 16 deletions(-)

diff --git a/extra/exports b/extra/exports
index cd28bb221..8a676e18b 100644
--- a/extra/exports
+++ b/extra/exports
@@ -2,26 +2,10 @@
 
 # Module API
 
-luaL_pushcdata
-luaL_checkcdata
-luaL_setcdatagc
-luaL_ctypeid
-luaL_cdef
-luaL_pushuint64
-luaL_pushint64
-luaL_checkuint64
-luaL_checkint64
-luaL_touint64
-luaL_toint64
 luaT_checktuple
 luaT_pushtuple
 luaT_istuple
 luaT_error
-luaT_call
-luaT_cpcall
-luaT_state
-luaT_tolstring
-luaL_iscallable
 box_txn
 box_txn_begin
 box_txn_commit
diff --git a/src/lua/init.c b/src/lua/init.c
index 65c1a04ec..6204961ba 100644
--- a/src/lua/init.c
+++ b/src/lua/init.c
@@ -746,6 +746,9 @@ tarantool_lua_socket_export_syms(void);
 void **
 tarantool_lua_tnt_iconv_export_syms(void);
 
+void **
+tarantool_lua_utils_export_syms(void);
+
 /**
  * Aggregator of all symbols defined in src/lua.
  */
@@ -759,6 +762,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_utils_export_syms,
 
 		/* Own symbols. */
 		(void *)tarantool_lua_slab_cache,
diff --git a/src/lua/utils.c b/src/lua/utils.c
index 54d18ac89..e99ddd71a 100644
--- a/src/lua/utils.c
+++ b/src/lua/utils.c
@@ -1288,3 +1288,27 @@ tarantool_lua_utils_init(struct lua_State *L)
 	assert(CTID_CONST_CHAR_PTR != 0);
 	return 0;
 }
+
+void **
+tarantool_lua_utils_export_syms(void)
+{
+	static void *syms[] = {
+		(void *)luaL_cdef,
+		(void *)luaL_checkcdata,
+		(void *)luaL_checkint64,
+		(void *)luaL_checkuint64,
+		(void *)luaL_ctypeid,
+		(void *)luaL_iscallable,
+		(void *)luaL_pushcdata,
+		(void *)luaL_pushint64,
+		(void *)luaL_pushuint64,
+		(void *)luaL_setcdatagc,
+		(void *)luaL_toint64,
+		(void *)luaL_touint64,
+		(void *)luaT_call,
+		(void *)luaT_cpcall,
+		(void *)luaT_state,
+		(void *)luaT_tolstring,
+	};
+	return syms;
+}
-- 
2.21.1 (Apple Git-122.3)



More information about the Tarantool-patches mailing list