From 47a9a3c95de2dfadc431d34c1dc079d35d3d6d18 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 15 Apr 2018 20:45:44 +0200 Subject: add transactions to namestore plugin API --- src/include/gnunet_namestore_plugin.h | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) (limited to 'src/include/gnunet_namestore_plugin.h') diff --git a/src/include/gnunet_namestore_plugin.h b/src/include/gnunet_namestore_plugin.h index 11f16b97a..d1c68cd23 100644 --- a/src/include/gnunet_namestore_plugin.h +++ b/src/include/gnunet_namestore_plugin.h @@ -88,7 +88,7 @@ struct GNUNET_NAMESTORE_PluginFunctions const char *label, unsigned int rd_count, const struct GNUNET_GNSRECORD_Data *rd); - + /** * Lookup records in the datastore for which we are the authority. * @@ -145,6 +145,35 @@ struct GNUNET_NAMESTORE_PluginFunctions void *iter_cls); + /** + * Start a transaction. + * + * @param cls closure + * @return #GNUNET_OK on success, #GNUNET_NO if transactions are not supported, + * #GNUNET_SYSERR on internal errors + */ + int + (*begin_transaction) (void *cls); + + + /** + * Try to commit a transaction. + * + * @param cls closure + * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure + */ + int + (*commit_transaction) (void *cls); + + + /** + * Rollback a transaction. + * + * @param cls closure + */ + void + (*rollback_transaction) (void *cls); + }; -- cgit v1.2.3