[Tarantool-patches] [PATCH 34/43] build: export src/box/txn.c symbols

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


Exports functions visible to the public C API and used by
src/box/lua/schema.lua via FFI.

Part of #2971
---
 extra/exports |  8 --------
 src/box/txn.c | 16 ++++++++++++++++
 src/exports.c |  2 ++
 3 files changed, 18 insertions(+), 8 deletions(-)

diff --git a/extra/exports b/extra/exports
index 1e7a1a49f..515887bcb 100644
--- a/extra/exports
+++ b/extra/exports
@@ -2,14 +2,6 @@
 
 # Module API
 
-box_txn
-box_txn_begin
-box_txn_commit
-box_txn_savepoint
-box_txn_rollback
-box_txn_rollback_to_savepoint
-box_txn_alloc
-box_txn_id
 box_key_def_new
 box_key_def_delete
 box_tuple_format_default
diff --git a/src/box/txn.c b/src/box/txn.c
index 488aa4bdd..3e2b8cab1 100644
--- a/src/box/txn.c
+++ b/src/box/txn.c
@@ -941,3 +941,19 @@ txn_on_yield(struct trigger *trigger, void *event)
 	txn_set_flag(txn, TXN_IS_ABORTED_BY_YIELD);
 	return 0;
 }
+
+void **
+box_txn_export_syms(void)
+{
+	static void *syms[] = {
+		(void *)box_txn,
+		(void *)box_txn_alloc,
+		(void *)box_txn_begin,
+		(void *)box_txn_commit,
+		(void *)box_txn_id,
+		(void *)box_txn_rollback,
+		(void *)box_txn_rollback_to_savepoint,
+		(void *)box_txn_savepoint,
+	};
+	return syms;
+}
diff --git a/src/exports.c b/src/exports.c
index cd409fae5..bb55ab7fa 100644
--- a/src/exports.c
+++ b/src/exports.c
@@ -52,6 +52,7 @@ EXPORT(base64_export_syms);
 EXPORT(box_lua_export_syms);
 EXPORT(box_schema_export_syms);
 EXPORT(box_space_export_syms);
+EXPORT(box_txn_export_syms);
 EXPORT(clock_export_syms);
 EXPORT(coio_export_syms);
 EXPORT(crc32_export_syms);
@@ -81,6 +82,7 @@ export_syms(void)
 		box_lua_export_syms,
 		box_schema_export_syms,
 		box_space_export_syms,
+		box_txn_export_syms,
 		clock_export_syms,
 		coio_export_syms,
 		crc32_export_syms,
-- 
2.21.1 (Apple Git-122.3)



More information about the Tarantool-patches mailing list