[Tarantool-patches] [PATCH 17/43] build: export src/lib/uuid/tt_uuid.c symbols

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


Exports functions and a variable used by src/lua/uuid.lua via FFI.

Part of #2971
---
 extra/exports          |  7 -------
 src/exports.c          |  2 ++
 src/lib/uuid/tt_uuid.c | 15 +++++++++++++++
 3 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/extra/exports b/extra/exports
index 34c5d2df6..b81ca4492 100644
--- a/extra/exports
+++ b/extra/exports
@@ -7,13 +7,6 @@ ibuf_reinit
 ibuf_destroy
 ibuf_reserve_slow
 
-uuid_nil
-tt_uuid_create
-tt_uuid_str
-tt_uuid_is_equal
-tt_uuid_is_nil
-tt_uuid_bswap
-tt_uuid_from_string
 log_level
 log_format
 uri_parse
diff --git a/src/exports.c b/src/exports.c
index fbfde5632..37570d40e 100644
--- a/src/exports.c
+++ b/src/exports.c
@@ -59,6 +59,7 @@ EXPORT(salad_guava_export_syms);
 EXPORT(scramble_export_syms);
 EXPORT(tarantool_lua_export_syms);
 EXPORT(title_export_syms);
+EXPORT(tt_uuid_export_syms);
 
 void
 export_syms(void)
@@ -75,6 +76,7 @@ export_syms(void)
 		scramble_export_syms,
 		tarantool_lua_export_syms,
 		title_export_syms,
+		tt_uuid_export_syms,
 	};
 	const int func_count = sizeof(syms) / sizeof(syms[0]);
 	for (int i = 0; i < func_count; ++i)
diff --git a/src/lib/uuid/tt_uuid.c b/src/lib/uuid/tt_uuid.c
index 1bd2e2cfe..182bd09c9 100644
--- a/src/lib/uuid/tt_uuid.c
+++ b/src/lib/uuid/tt_uuid.c
@@ -99,3 +99,18 @@ tt_uuid_from_strl(const char *in, size_t len, struct tt_uuid *uu)
 	snprintf(buf, sizeof(buf), "%.*s", (int) len, in);
 	return tt_uuid_from_string(buf, uu);
 }
+
+void **
+tt_uuid_export_syms(void)
+{
+	static void *syms[] = {
+		(void *)tt_uuid_bswap,
+		(void *)tt_uuid_create,
+		(void *)tt_uuid_from_string,
+		(void *)tt_uuid_is_equal,
+		(void *)tt_uuid_is_nil,
+		(void *)tt_uuid_str,
+		(void *)&uuid_nil,
+	};
+	return syms;
+}
-- 
2.21.1 (Apple Git-122.3)



More information about the Tarantool-patches mailing list