commit 7385b9f7baeeb2b1023bc869b7adace9dae3f896 parent f7d61a876473f5e53126818dc88453839ad1d49c Author: Christian Grothoff <christian@grothoff.org> Date: Wed, 20 Nov 2024 15:16:24 +0100 fix donau ftbfs Diffstat:
63 files changed, 169 insertions(+), 115 deletions(-)
diff --git a/.gitignore b/.gitignore @@ -34,3 +34,6 @@ contrib/sigp/donau_signatures.h *.tmp tmp-last-response.* *.ist +src/pq/test_pq +donau_config.h +donau_config.h.in diff --git a/aclocal.m4 b/aclocal.m4 @@ -14,8 +14,8 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, -[m4_warning([this file was generated for autoconf 2.71. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.72],, +[m4_warning([this file was generated for autoconf 2.72. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) diff --git a/doc/doxygen/Makefile.in b/doc/doxygen/Makefile.in @@ -108,7 +108,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/taler_config.h +CONFIG_HEADER = $(top_builddir)/donau_config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) diff --git a/src/donau-tools/donau-dbinit.c b/src/donau-tools/donau-dbinit.c @@ -19,12 +19,38 @@ * @author Florian Dold * @author Christian Grothoff */ -#include <taler/platform.h> +#include "donau_config.h" #include <gnunet/gnunet_util_lib.h> #include "donaudb_lib.h" #include "donau_util.h" +/* LSB-style exit status codes */ +#ifndef EXIT_INVALIDARGUMENT +/** + * Command-line arguments are invalid. + * Restarting useless. + */ +#define EXIT_INVALIDARGUMENT 2 +#endif + +#ifndef EXIT_NOPERMISSION +/** + * Permissions needed to run are not available. + * Restarting useless. + */ +#define EXIT_NOPERMISSION 4 +#endif + +#ifndef EXIT_NOTINSTALLED +/** + * Key resources are not installed. + * Restarting useless. + */ +#define EXIT_NOTINSTALLED 5 +#endif + + /** * Return value from main(). */ @@ -54,7 +80,6 @@ run (void *cls, (void) cls; (void) args; (void) cfgfile; - if (NULL == (plugin = DONAUDB_plugin_load (cfg))) { @@ -111,11 +136,8 @@ main (int argc, }; enum GNUNET_GenericReturnValue ret; - /* force linker to link against libtalerutil; if we do - not do this, the linker may "optimize" libtalerutil - away and skip #DONAU_OS_init(), which we do need */ - DONAU_OS_init (); ret = GNUNET_PROGRAM_run ( + DONAU_project_data (), argc, argv, "donau-dbinit", gettext_noop ("Initialize Donau database"), diff --git a/src/donau/donau-httpd.c b/src/donau/donau-httpd.c @@ -18,7 +18,7 @@ * @brief Serve the HTTP interface of the donau * @author Johannes Casaburi */ -#include <taler/platform.h> +#include "donau_config.h" #include <gnunet/gnunet_util_lib.h> #include <jansson.h> #include <microhttpd.h> @@ -41,6 +41,25 @@ #include "donaudb_plugin.h" #include <gnunet/gnunet_mhd_compat.h> +/* LSB-style exit status codes */ +#ifndef EXIT_INVALIDARGUMENT +/** + * Command-line arguments are invalid. + * Restarting useless. + */ +#define EXIT_INVALIDARGUMENT 2 +#endif + + +#ifndef EXIT_NOTCONFIGURED +/** + * Key configuration settings are missing or invalid. + * Restarting useless. + */ +#define EXIT_NOTCONFIGURED 6 +#endif + + /** * Backlog for listen operation on unix domain sockets. */ @@ -55,7 +74,7 @@ * Above what request latency do we start to log? */ #define WARN_LATENCY GNUNET_TIME_relative_multiply ( \ - GNUNET_TIME_UNIT_MILLISECONDS, 500) + GNUNET_TIME_UNIT_MILLISECONDS, 500) /** * Are clients allowed to request /keys for times other than the @@ -733,10 +752,11 @@ donau_serve_process_config (void) if (GNUNET_OK != TALER_config_get_currency (DH_cfg, + "donau", &DH_currency)) { GNUNET_log_config_missing (GNUNET_ERROR_TYPE_ERROR, - "taler", + "donau", "CURRENCY"); return GNUNET_SYSERR; } @@ -753,7 +773,7 @@ donau_serve_process_config (void) if (cfd > 8) { GNUNET_log_config_invalid (GNUNET_ERROR_TYPE_ERROR, - "taler", + "donau", "CURRENCY_FRACTION_DIGITS", "Value must be below 8"); return GNUNET_SYSERR; @@ -1024,12 +1044,14 @@ main (int argc, GNUNET_GETOPT_option_timetravel ('T', "timetravel"), GNUNET_GETOPT_option_help ( + DONAU_project_data (), "HTTP server providing a RESTful API to access a Taler donau"), GNUNET_GETOPT_OPTION_END }; enum GNUNET_GenericReturnValue ret; - DONAU_OS_init (); - ret = GNUNET_PROGRAM_run (argc, argv, + + ret = GNUNET_PROGRAM_run (DONAU_project_data (), + argc, argv, "donau-httpd", "Taler donau HTTP service", options, diff --git a/src/donau/donau-httpd_batch-issue.c b/src/donau/donau-httpd_batch-issue.c @@ -18,7 +18,7 @@ * @brief Handle request to issue receipts. * @author Lukas Matyja */ -#include <taler/platform.h> +#include <donau_config.h> #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> #include <jansson.h> diff --git a/src/donau/donau-httpd_batch-submit.c b/src/donau/donau-httpd_batch-submit.c @@ -18,7 +18,7 @@ * @brief Handle request to insert a submitted receipt. * @author Johannes Casaburi */ -#include "taler/platform.h" +#include "donau_config.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> #include <jansson.h> diff --git a/src/donau/donau-httpd_charities_get.c b/src/donau/donau-httpd_charities_get.c @@ -18,7 +18,7 @@ * @brief Return charities * @author Johannes Casaburi */ -#include <taler/platform.h> +#include <donau_config.h> #include <gnunet/gnunet_util_lib.h> #include <jansson.h> #include <microhttpd.h> diff --git a/src/donau/donau-httpd_charity_delete.c b/src/donau/donau-httpd_charity_delete.c @@ -18,7 +18,7 @@ * @brief Handle DELETE /charitys/$CHARITY_ID requests. * @author Johannes Casaburi */ -#include "taler/platform.h" +#include "donau_config.h" #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> #include <jansson.h> diff --git a/src/donau/donau-httpd_charity_get.c b/src/donau/donau-httpd_charity_get.c @@ -18,7 +18,7 @@ * @brief Return summary information about a charity * @author Johannes Casaburi */ -#include <taler/platform.h> +#include <donau_config.h> #include <gnunet/gnunet_util_lib.h> #include <jansson.h> #include <microhttpd.h> diff --git a/src/donau/donau-httpd_charity_insert.c b/src/donau/donau-httpd_charity_insert.c @@ -18,7 +18,7 @@ * @brief Handle request to insert a charity. * @author Johannes Casaburi */ -#include <taler/platform.h> +#include <donau_config.h> #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> #include <jansson.h> diff --git a/src/donau/donau-httpd_config.c b/src/donau/donau-httpd_config.c @@ -18,7 +18,7 @@ * @brief Handle /config requests * @author Christian Grothoff */ -#include <taler/platform.h> +#include <donau_config.h> #include <gnunet/gnunet_json_lib.h> #include <taler/taler_dbevents.h> #include "donau-httpd_config.h" diff --git a/src/donau/donau-httpd_csr.c b/src/donau/donau-httpd_csr.c @@ -21,7 +21,7 @@ * @brief Handle /csr requests * @author Johannes Casaburi */ -#include <taler/platform.h> +#include <donau_config.h> #include <gnunet/gnunet_util_lib.h> #include <jansson.h> #include <microhttpd.h> diff --git a/src/donau/donau-httpd_db.c b/src/donau/donau-httpd_db.c @@ -18,7 +18,7 @@ * @brief Generic database operations for the donau. * @author Johannes Casaburi */ -#include <taler/platform.h> +#include <donau_config.h> #include <pthread.h> #include <jansson.h> #include <gnunet/gnunet_json_lib.h> diff --git a/src/donau/donau-httpd_donation-statement.c b/src/donau/donau-httpd_donation-statement.c @@ -18,7 +18,7 @@ * @brief Return donation statement * @author Johannes Casaburi */ -#include <taler/platform.h> +#include <donau_config.h> #include <gnunet/gnunet_util_lib.h> #include <jansson.h> #include <microhttpd.h> diff --git a/src/donau/donau-httpd_history_get.c b/src/donau/donau-httpd_history_get.c @@ -18,7 +18,7 @@ * @brief Return history * @author Johannes Casaburi */ -#include "taler/platform.h" +#include "donau_config.h" #include <gnunet/gnunet_util_lib.h> #include <jansson.h> #include <microhttpd.h> diff --git a/src/donau/donau-httpd_keys.c b/src/donau/donau-httpd_keys.c @@ -21,7 +21,7 @@ * @author Pius Loosli * @author Johannes Casaburi */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_json_lib.h> #include <taler/taler_mhd_lib.h> #include "donau_json_lib.h" diff --git a/src/donau/donau-httpd_keys.h b/src/donau/donau-httpd_keys.h @@ -18,7 +18,7 @@ * @brief management of our various keys * @author Christian Grothoff */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_json_lib.h> #include <taler/taler_mhd_lib.h> #include "donau_util.h" diff --git a/src/donau/donau-httpd_mhd.c b/src/donau/donau-httpd_mhd.c @@ -23,7 +23,7 @@ * @author Benedikt Mueller * @author Christian Grothoff */ -#include <taler/platform.h> +#include <donau_config.h> #include <gnunet/gnunet_util_lib.h> #include <jansson.h> #include <microhttpd.h> diff --git a/src/donau/donau-httpd_terms.c b/src/donau/donau-httpd_terms.c @@ -18,7 +18,7 @@ * @brief Handle /terms requests to return the terms of service * @author Christian Grothoff */ -#include <taler/platform.h> +#include <donau_config.h> #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> #include <jansson.h> diff --git a/src/donau/donau-httpd_terms.h b/src/donau/donau-httpd_terms.h @@ -20,7 +20,7 @@ */ #ifndef DONAU_HTTPD_TERMS_H #define DONAU_HTTPD_TERMS_H -#include <taler/platform.h> +#include <donau_config.h> #include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_json_lib.h> #include <jansson.h> diff --git a/src/donaudb/pg_commit.c b/src/donaudb/pg_commit.c @@ -18,7 +18,7 @@ * @brief Implementation of the commit function for Postgres * @author Christian Grothoff */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/donaudb/pg_create_tables.c b/src/donaudb/pg_create_tables.c @@ -18,7 +18,7 @@ * @brief Implementation of the create_tables function for Postgres * @author Johannes Casaburi */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/donaudb/pg_do_charity_delete.c b/src/donaudb/pg_do_charity_delete.c @@ -18,7 +18,7 @@ * @brief Implementation of the do_charity_delete function for Postgres * @author Johannes Casaburi */ -#include "taler/platform.h" +#include "donau_config.h" #include "taler/taler_error_codes.h" #include "taler/taler_dbevents.h" #include "taler/taler_pq_lib.h" diff --git a/src/donaudb/pg_drop_tables.c b/src/donaudb/pg_drop_tables.c @@ -18,7 +18,7 @@ * @brief Implementation of the drop_tables function for Postgres * @author Christian Grothoff */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/donaudb/pg_event_listen.c b/src/donaudb/pg_event_listen.c @@ -18,7 +18,7 @@ * @brief Implementation of the event_listen function for Postgres * @author Christian Grothoff */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/donaudb/pg_event_listen_cancel.c b/src/donaudb/pg_event_listen_cancel.c @@ -18,7 +18,7 @@ * @brief Implementation of the event_listen_cancel function for Postgres * @author Christian Grothoff */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/donaudb/pg_event_notify.c b/src/donaudb/pg_event_notify.c @@ -18,7 +18,7 @@ * @brief Implementation of the event_notify function for Postgres * @author Christian Grothoff */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/donaudb/pg_get_charities.c b/src/donaudb/pg_get_charities.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_donation_unit_key function for Postgres * @author Johannes Casaburi */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/donaudb/pg_get_history.c b/src/donaudb/pg_get_history.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_donation_unit_key function for Postgres * @author Johannes Casaburi */ -#include "taler/platform.h" +#include "donau_config.h" #include "taler/taler_error_codes.h" #include "taler/taler_dbevents.h" #include "taler/taler_pq_lib.h" diff --git a/src/donaudb/pg_insert_charity.c b/src/donaudb/pg_insert_charity.c @@ -19,7 +19,7 @@ * @author Johannes Casaburi * @author Lukas Matyja */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/donaudb/pg_insert_donation_unit.c b/src/donaudb/pg_insert_donation_unit.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_donation_unit function for Postgres * @author Johannes Casaburi */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/donaudb/pg_insert_history_entry.c b/src/donaudb/pg_insert_history_entry.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_history_entry function for Postgres * @author Johannes Casaburi */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/donaudb/pg_insert_issued_receipt.c b/src/donaudb/pg_insert_issued_receipt.c @@ -19,7 +19,7 @@ * @author Johannes Casaburi * @author Lukas Matyja */ -#include <taler/platform.h> +#include <donau_config.h> #include <gnunet/gnunet_pq_lib.h> #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> diff --git a/src/donaudb/pg_insert_signing_key.c b/src/donaudb/pg_insert_signing_key.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_signing_key function for Postgres * @author Johannes Casaburi */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/donaudb/pg_insert_submitted_receipts.c b/src/donaudb/pg_insert_submitted_receipts.c @@ -18,7 +18,7 @@ * @brief Implementation of the insert_submitted_receipts function for Postgres * @author Johannes Casaburi */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/donaudb/pg_iterate_active_signing_keys.c b/src/donaudb/pg_iterate_active_signing_keys.c @@ -18,7 +18,7 @@ * @brief Implementation of the iterate_active_signing_keys function for Postgres * @author Christian Grothoff */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/donaudb/pg_iterate_donation_units.c b/src/donaudb/pg_iterate_donation_units.c @@ -18,7 +18,7 @@ * @brief Implementation of the iterate_donation_units function for Postgres * @author Johannes Casaburi */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/donaudb/pg_iterate_submitted_receipts.c b/src/donaudb/pg_iterate_submitted_receipts.c @@ -18,7 +18,7 @@ * @brief Implementation of the iterate_submitted_receipts function for Postgres * @author Johannes Casaburi */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> @@ -39,7 +39,7 @@ DH_PG_iterate_submitted_receipts ( struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_uint64 (&donation_year), - GNUNET_PQ_query_param_auto_from_type (h_donor_tax_id), + GNUNET_PQ_query_param_auto_from_type (h_donor_tax_id), GNUNET_PQ_query_param_end }; uint64_t valueSum = 0; diff --git a/src/donaudb/pg_lookup_charity.c b/src/donaudb/pg_lookup_charity.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_donation_unit_key function for Postgres * @author Johannes Casaburi */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/donaudb/pg_lookup_issued_receipts.c b/src/donaudb/pg_lookup_issued_receipts.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_issued_receipts function for Postgres * @author Lukas Matyja */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/donaudb/pg_lookup_signing_key.c b/src/donaudb/pg_lookup_signing_key.c @@ -18,7 +18,7 @@ * @brief Implementation of the lookup_signing_key function for Postgres * @author Christian Grothoff */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/donaudb/pg_preflight.c b/src/donaudb/pg_preflight.c @@ -18,7 +18,7 @@ * @brief Implementation of the preflight function for Postgres * @author Christian Grothoff */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/donaudb/pg_rollback.c b/src/donaudb/pg_rollback.c @@ -18,7 +18,7 @@ * @brief Implementation of the rollback function for Postgres * @author Christian Grothoff */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/donaudb/pg_start.c b/src/donaudb/pg_start.c @@ -18,7 +18,7 @@ * @brief Implementation of the start function for Postgres * @author Christian Grothoff */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/donaudb/pg_start_read_committed.c b/src/donaudb/pg_start_read_committed.c @@ -18,7 +18,7 @@ * @brief Implementation of the start_read_committed function for Postgres * @author Christian Grothoff */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/donaudb/pg_start_read_only.c b/src/donaudb/pg_start_read_only.c @@ -18,7 +18,7 @@ * @brief Implementation of the start_read_only function for Postgres * @author Christian Grothoff */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/donaudb/pg_template.c b/src/donaudb/pg_template.c @@ -18,7 +18,7 @@ * @brief Implementation of the template function for Postgres * @author Christian Grothoff */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_error_codes.h> #include <taler/taler_dbevents.h> #include <taler/taler_pq_lib.h> diff --git a/src/donaudb/test_donaudb.c b/src/donaudb/test_donaudb.c @@ -18,7 +18,7 @@ * @brief test cases for DB interaction functions * @author Johannes Casaburi */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_json_lib.h> #include "donaudb_lib.h" #include "donaudb_plugin.h" diff --git a/src/json/json_helper.c b/src/json/json_helper.c @@ -20,7 +20,7 @@ * @author Sree Harsha Totakura <sreeharsha@totakura.in> * @author Christian Grothoff */ -#include <taler/platform.h> +#include <donau_config.h> #include <gnunet/gnunet_util_lib.h> #include <taler/taler_util.h> #include <taler/taler_json_lib.h> diff --git a/src/pq/test_pq.c b/src/pq/test_pq.c @@ -18,7 +18,7 @@ * @brief Tests for Postgres convenience API * @author Christian Grothoff <christian@grothoff.org> */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_util.h> #include <taler/taler_pq_lib.h> diff --git a/src/testing/test_donau_api.c b/src/testing/test_donau_api.c @@ -24,7 +24,7 @@ * @author Marcello Stanisci * @author Lukas Matyja */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_util.h> #include <taler/taler_json_lib.h> #include <gnunet/gnunet_util_lib.h> diff --git a/src/testing/testing_api_cmd_charities_get.c b/src/testing/testing_api_cmd_charities_get.c @@ -21,7 +21,7 @@ * @brief Implement the GET /charities test command. * @author Lukas Matyja */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_json_lib.h> #include <gnunet/gnunet_curl_lib.h> #include <taler/taler_testing_lib.h> @@ -65,7 +65,7 @@ struct StatusState */ static void charities_status_cb (void *cls, - const struct DONAU_GetCharitiesResponse *gcr) + const struct DONAU_GetCharitiesResponse *gcr) { struct StatusState *ss = cls; @@ -105,12 +105,13 @@ status_run (void *cls, ss->cgh = DONAU_charities_get ( TALER_TESTING_interpreter_get_context (is), - TALER_TESTING_get_donau_url (is), + TALER_TESTING_get_donau_url (is), ss->bearer, &charities_status_cb, ss); } + /** * Cleanup the state from a "reserve status" CMD, and possibly * cancel a pending operation thereof. @@ -126,9 +127,9 @@ status_cleanup (void *cls, if (NULL != ss->cgh) { - // log incomplete command - TALER_TESTING_command_incomplete (ss->is, - cmd->label); + // log incomplete command + TALER_TESTING_command_incomplete (ss->is, + cmd->label); DONAU_charities_get_cancel (ss->cgh); ss->cgh = NULL; } @@ -138,7 +139,7 @@ status_cleanup (void *cls, struct TALER_TESTING_Command TALER_TESTING_cmd_charities_get (const char *label, - const struct DONAU_BearerToken *bearer, + const struct DONAU_BearerToken *bearer, unsigned int expected_response_code) { struct StatusState *ss; diff --git a/src/testing/testing_api_cmd_charity_delete.c b/src/testing/testing_api_cmd_charity_delete.c @@ -21,7 +21,7 @@ * @brief Implement the DELETE /charities test command. * @author Lukas Matyja */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_json_lib.h> #include <gnunet/gnunet_curl_lib.h> #include <taler/taler_testing_lib.h> @@ -116,32 +116,34 @@ status_run (void *cls, /* Get charity id from trait */ { - const struct TALER_TESTING_Command *charity_post_cmd; - const unsigned long long *charity_id; - - charity_post_cmd = TALER_TESTING_interpreter_lookup_command (is, - ss->charity_reference); - - if (GNUNET_OK != - TALER_TESTING_get_trait_charity_id (charity_post_cmd, - &charity_id)) - { - GNUNET_break (0); - TALER_TESTING_interpreter_fail (is); - return; - } - ss->charity_id = (uint64_t) *(charity_id); + const struct TALER_TESTING_Command *charity_post_cmd; + const unsigned long long *charity_id; + + charity_post_cmd = TALER_TESTING_interpreter_lookup_command (is, + ss-> + charity_reference); + + if (GNUNET_OK != + TALER_TESTING_get_trait_charity_id (charity_post_cmd, + &charity_id)) + { + GNUNET_break (0); + TALER_TESTING_interpreter_fail (is); + return; + } + ss->charity_id = (uint64_t) *(charity_id); } ss->cgh = DONAU_charity_delete ( TALER_TESTING_interpreter_get_context (is), - TALER_TESTING_get_donau_url (is), + TALER_TESTING_get_donau_url (is), ss->charity_id, ss->bearer, &charity_status_cb, ss); } + /** * Cleanup the state from a "reserve status" CMD, and possibly * cancel a pending operation thereof. @@ -157,9 +159,9 @@ status_cleanup (void *cls, if (NULL != ss->cgh) { - // log incomplete command - TALER_TESTING_command_incomplete (ss->is, - cmd->label); + // log incomplete command + TALER_TESTING_command_incomplete (ss->is, + cmd->label); DONAU_charity_delete_cancel (ss->cgh); ss->cgh = NULL; } @@ -169,9 +171,9 @@ status_cleanup (void *cls, struct TALER_TESTING_Command TALER_TESTING_cmd_charity_delete (const char *label, - const char *charity_reference, - const struct DONAU_BearerToken *bearer, - unsigned int expected_response_code) + const char *charity_reference, + const struct DONAU_BearerToken *bearer, + unsigned int expected_response_code) { struct StatusState *ss; diff --git a/src/testing/testing_api_cmd_charity_get.c b/src/testing/testing_api_cmd_charity_get.c @@ -22,7 +22,7 @@ * @author Marcello Stanisci * @author Lukas Matyja */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_json_lib.h> #include <gnunet/gnunet_curl_lib.h> #include <taler/taler_testing_lib.h> diff --git a/src/testing/testing_api_cmd_charity_post.c b/src/testing/testing_api_cmd_charity_post.c @@ -21,7 +21,7 @@ * @brief Implement the POST /charities test command. * @author Lukas Matyja */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_json_lib.h> #include <gnunet/gnunet_curl_lib.h> #include <taler/taler_testing_lib.h> @@ -139,7 +139,7 @@ status_run (void *cls, */ static void cleanup (void *cls, - const struct TALER_TESTING_Command *cmd) + const struct TALER_TESTING_Command *cmd) { struct StatusState *ss = cls; diff --git a/src/testing/testing_api_cmd_donation_statement_get.c b/src/testing/testing_api_cmd_donation_statement_get.c @@ -22,7 +22,7 @@ * @author Marcello Stanisci * @author Lukas Matyja */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_json_lib.h> #include <gnunet/gnunet_curl_lib.h> #include <taler/taler_testing_lib.h> @@ -126,7 +126,7 @@ donation_statement_status_cb (void *cls, &ss->donation_statement); GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "qr-string: %s\n", qr_string); - GNUNET_free(qr_string); + GNUNET_free (qr_string); TALER_TESTING_interpreter_next (ss->is); return; diff --git a/src/testing/testing_api_cmd_get_donau.c b/src/testing/testing_api_cmd_get_donau.c @@ -22,7 +22,7 @@ * @author Christian Grothoff * @author Lukas Matyja */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_json_lib.h> #include <gnunet/gnunet_curl_lib.h> #include <taler/taler_testing_lib.h> diff --git a/src/testing/testing_api_cmd_issue_receipts.c b/src/testing/testing_api_cmd_issue_receipts.c @@ -21,7 +21,7 @@ * @brief Implement the POST /charities test command. * @author Lukas Matyja */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_json_lib.h> #include <gnunet/gnunet_curl_lib.h> #include <taler/taler_testing_lib.h> @@ -536,20 +536,23 @@ TALER_TESTING_cmd_issue_receipts (const char *label, ss->donor_tax_id = (const char*) donor_tax_id; // use libsodium SHA-512 Hash for compatibility reasons with the Donau Verify app. - unsigned char hash[512/8]; + unsigned char hash[512 / 8]; crypto_hash_sha512_state state; - crypto_hash_sha512_init(&state); + crypto_hash_sha512_init (&state); unsigned int tax_length; - for (tax_length = 0; donor_tax_id[tax_length]!= '\0'; ++tax_length); + for (tax_length = 0; donor_tax_id[tax_length]!= '\0'; ++tax_length) + ; unsigned int salt_length; - for (salt_length = 0; salt[salt_length]!= '\0'; ++salt_length); + for (salt_length = 0; salt[salt_length]!= '\0'; ++salt_length) + ; - crypto_hash_sha512_update(&state, (const unsigned char*) donor_tax_id, tax_length); - crypto_hash_sha512_update(&state, (const unsigned char*) salt, salt_length); + crypto_hash_sha512_update (&state, (const unsigned char*) donor_tax_id, + tax_length); + crypto_hash_sha512_update (&state, (const unsigned char*) salt, salt_length); - crypto_hash_sha512_final(&state, hash); - GNUNET_memcpy(ss->h_donor_tax_id.hash, hash, sizeof(hash)); + crypto_hash_sha512_final (&state, hash); + GNUNET_memcpy (ss->h_donor_tax_id.hash, hash, sizeof(hash)); { struct TALER_TESTING_Command cmd = { .cls = ss, diff --git a/src/testing/testing_api_cmd_submit_receipts.c b/src/testing/testing_api_cmd_submit_receipts.c @@ -21,7 +21,7 @@ * @brief Implement the POST /charities test command. * @author Lukas Matyja */ -#include <taler/platform.h> +#include <donau_config.h> #include <taler/taler_json_lib.h> #include <gnunet/gnunet_curl_lib.h> #include <taler/taler_testing_lib.h> diff --git a/src/testing/testing_api_loop.c b/src/testing/testing_api_loop.c @@ -22,12 +22,13 @@ * @brief main interpreter loop for testcases * @author Lukas Matyja */ -#include <taler/platform.h> +#include "donau_config.h" #include <taler/taler_json_lib.h> #include <gnunet/gnunet_curl_lib.h> #include <taler/taler_signatures.h> #include <taler/taler_testing_lib.h> #include "donau_testing_lib.h" +#include "donau_util.h" int @@ -45,7 +46,7 @@ DONAU_TESTING_main (char *const *argv, GNUNET_log_setup (argv[0], loglevel, NULL); - cred->cfg = GNUNET_CONFIGURATION_create (); + cred->cfg = GNUNET_CONFIGURATION_create (DONAU_project_data ()); if (GNUNET_OK != GNUNET_CONFIGURATION_load (cred->cfg, cfg_file)) diff --git a/src/testing/testing_api_misc.c b/src/testing/testing_api_misc.c @@ -21,7 +21,7 @@ * @brief non-command functions useful for writing tests * @author Christian Grothoff */ -#include <taler/platform.h> +#include <donau_config.h> #include <gnunet/gnunet_util_lib.h> #include <taler/taler_testing_lib.h> #include <taler/taler_fakebank_lib.h> diff --git a/src/testing/testing_api_traits.c b/src/testing/testing_api_traits.c @@ -15,14 +15,14 @@ You should have received a copy of the GNU General Public License along with TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> -*/ +*/ /** * @file testing/testing_api_traits.c * @brief loop for trait resolution * @author Christian Grothoff * @author Marcello Stanisci */ -#include <taler/platform.h> +#include <donau_config.h> #include "donau_testing_lib.h" @@ -47,7 +47,7 @@ TALER_TESTING_get_donau_url (struct TALER_TESTING_Interpreter *is) } if (GNUNET_OK != TALER_TESTING_get_trait_donau_url (donau_cmd, - &donau_url)) + &donau_url)) { GNUNET_break (0); TALER_TESTING_interpreter_fail (is);