diff options
author | Christian Grothoff <christian@grothoff.org> | 2018-04-15 20:45:44 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2018-04-15 20:45:44 +0200 |
commit | 47a9a3c95de2dfadc431d34c1dc079d35d3d6d18 (patch) | |
tree | 3aaf6de1d53a8b2853e03e56e90f725f26184cfa /src/namestore/plugin_namestore_sqlite.c | |
parent | 284cfac7a521ad275b7536ce1075f62b6e45ea44 (diff) | |
download | gnunet-47a9a3c95de2dfadc431d34c1dc079d35d3d6d18.tar.gz gnunet-47a9a3c95de2dfadc431d34c1dc079d35d3d6d18.zip |
add transactions to namestore plugin API
Diffstat (limited to 'src/namestore/plugin_namestore_sqlite.c')
-rw-r--r-- | src/namestore/plugin_namestore_sqlite.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/namestore/plugin_namestore_sqlite.c b/src/namestore/plugin_namestore_sqlite.c index 5ad84688c..1ebb6bfc7 100644 --- a/src/namestore/plugin_namestore_sqlite.c +++ b/src/namestore/plugin_namestore_sqlite.c | |||
@@ -773,6 +773,47 @@ namestore_sqlite_zone_to_name (void *cls, | |||
773 | 773 | ||
774 | 774 | ||
775 | /** | 775 | /** |
776 | * Start a transaction. | ||
777 | * | ||
778 | * @param cls closure | ||
779 | * @return #GNUNET_OK on success, #GNUNET_NO if transactions are not supported, | ||
780 | * #GNUNET_SYSERR on internal errors | ||
781 | */ | ||
782 | static int | ||
783 | namestore_sqlite_begin_transaction (void *cls) | ||
784 | { | ||
785 | return GNUNET_NO; | ||
786 | } | ||
787 | |||
788 | |||
789 | /** | ||
790 | * Try to commit a transaction. | ||
791 | * | ||
792 | * @param cls closure | ||
793 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure | ||
794 | */ | ||
795 | static int | ||
796 | namestore_sqlite_commit_transaction (void *cls) | ||
797 | { | ||
798 | GNUNET_break (0); | ||
799 | return GNUNET_SYSERR; | ||
800 | } | ||
801 | |||
802 | |||
803 | /** | ||
804 | * Rollback a transaction. | ||
805 | * | ||
806 | * @param cls closure | ||
807 | */ | ||
808 | static void | ||
809 | namestore_sqlite_rollback_transaction (void *cls) | ||
810 | { | ||
811 | GNUNET_break (0); | ||
812 | } | ||
813 | |||
814 | |||
815 | |||
816 | /** | ||
776 | * Entry point for the plugin. | 817 | * Entry point for the plugin. |
777 | * | 818 | * |
778 | * @param cls the "struct GNUNET_NAMESTORE_PluginEnvironment*" | 819 | * @param cls the "struct GNUNET_NAMESTORE_PluginEnvironment*" |
@@ -800,6 +841,9 @@ libgnunet_plugin_namestore_sqlite_init (void *cls) | |||
800 | api->iterate_records = &namestore_sqlite_iterate_records; | 841 | api->iterate_records = &namestore_sqlite_iterate_records; |
801 | api->zone_to_name = &namestore_sqlite_zone_to_name; | 842 | api->zone_to_name = &namestore_sqlite_zone_to_name; |
802 | api->lookup_records = &namestore_sqlite_lookup_records; | 843 | api->lookup_records = &namestore_sqlite_lookup_records; |
844 | api->begin_transaction = &namestore_sqlite_begin_transaction; | ||
845 | api->commit_transaction = &namestore_sqlite_commit_transaction; | ||
846 | api->rollback_transaction = &namestore_sqlite_rollback_transaction; | ||
803 | LOG (GNUNET_ERROR_TYPE_INFO, | 847 | LOG (GNUNET_ERROR_TYPE_INFO, |
804 | _("Sqlite database running\n")); | 848 | _("Sqlite database running\n")); |
805 | return api; | 849 | return api; |