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

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


Exports functions used by src/lua/socket.lua via FFI.

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

diff --git a/extra/exports b/extra/exports
index d81b4c05c..f034d3db1 100644
--- a/extra/exports
+++ b/extra/exports
@@ -2,8 +2,6 @@
 
 # FFI
 
-lbox_socket_local_resolve
-lbox_socket_nonblock
 base64_decode
 base64_encode
 base64_bufsize
diff --git a/src/exports.c b/src/exports.c
index 2638bcd47..fb8de55da 100644
--- a/src/exports.c
+++ b/src/exports.c
@@ -50,6 +50,7 @@
 
 EXPORT(clock_export_syms);
 EXPORT(scramble_export_syms);
+EXPORT(tarantool_lua_export_syms);
 
 void
 export_syms(void)
@@ -57,6 +58,7 @@ export_syms(void)
 	void *syms[] = {
 		clock_export_syms,
 		scramble_export_syms,
+		tarantool_lua_export_syms,
 	};
 	const int func_count = sizeof(syms) / sizeof(syms[0]);
 	for (int i = 0; i < func_count; ++i)
diff --git a/src/lua/init.c b/src/lua/init.c
index 28b6b2d62..823117d94 100644
--- a/src/lua/init.c
+++ b/src/lua/init.c
@@ -730,3 +730,19 @@ tarantool_lua_free()
 	}
 #endif
 }
+
+void **
+tarantool_lua_socket_export_syms(void);
+
+/**
+ * Aggregator of all symbols defined in src/lua.
+ */
+void **
+tarantool_lua_export_syms(void)
+{
+	static void *syms[] = {
+		/* Submodules. */
+		(void *)tarantool_lua_socket_export_syms,
+	};
+	return syms;
+}
diff --git a/src/lua/socket.c b/src/lua/socket.c
index e75a8802e..8225ad32a 100644
--- a/src/lua/socket.c
+++ b/src/lua/socket.c
@@ -1105,3 +1105,13 @@ tarantool_lua_socket_init(struct lua_State *L)
 
 	lua_pop(L, 1); /* socket.internal */
 }
+
+void **
+tarantool_lua_socket_export_syms(void)
+{
+	static void *syms[] = {
+		(void *)lbox_socket_local_resolve,
+		(void *)lbox_socket_nonblock,
+	};
+	return syms;
+}
-- 
2.21.1 (Apple Git-122.3)



More information about the Tarantool-patches mailing list