diff options
author | Florian Dold <florian@dold.me> | 2024-06-16 17:23:59 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2024-06-16 17:25:06 +0200 |
commit | 65e2a270ce7173d76c8e94008ec803ab144f1923 (patch) | |
tree | fefdee207aa83059bfef520bae6c519b1c17d79c /src/include/taler_util.h | |
parent | 8170cd200c1bec7c6ea9f71fa20e3aeacf3446ec (diff) |
util: always provide currency spec for main currency
The logic is now part of the configuration parser, as the merchant also
needs the same logic.
Diffstat (limited to 'src/include/taler_util.h')
-rw-r--r-- | src/include/taler_util.h | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/include/taler_util.h b/src/include/taler_util.h index 8feb8451c..000d0dee5 100644 --- a/src/include/taler_util.h +++ b/src/include/taler_util.h @@ -57,16 +57,16 @@ /* Define logging functions */ #define TALER_LOG_DEBUG(...) \ - GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, __VA_ARGS__) + GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, __VA_ARGS__) #define TALER_LOG_INFO(...) \ - GNUNET_log (GNUNET_ERROR_TYPE_INFO, __VA_ARGS__) + GNUNET_log (GNUNET_ERROR_TYPE_INFO, __VA_ARGS__) #define TALER_LOG_WARNING(...) \ - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, __VA_ARGS__) + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, __VA_ARGS__) #define TALER_LOG_ERROR(...) \ - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, __VA_ARGS__) + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, __VA_ARGS__) /** @@ -77,11 +77,11 @@ * @param reason string to print as warning */ #define TALER_assert_as(EXP, reason) \ - do { \ - if (EXP) break; \ - TALER_LOG_ERROR ("%s at %s:%d\n", reason, __FILE__, __LINE__); \ - abort (); \ - } while (0) + do { \ + if (EXP) break; \ + TALER_LOG_ERROR ("%s at %s:%d\n", reason, __FILE__, __LINE__); \ + abort (); \ + } while (0) /** @@ -112,10 +112,11 @@ #define TALER_gcry_ok(cmd) \ - do {int rc; rc = cmd; if (! rc) break; \ - TALER_LOG_ERROR ("A Gcrypt call failed at %s:%d with error: %s\n", \ - __FILE__, \ - __LINE__, gcry_strerror (rc)); abort (); } while (0) + do {int rc; rc = cmd; if (! rc) break; \ + TALER_LOG_ERROR ("A Gcrypt call failed at %s:%d with error: %s\n", \ + __FILE__, \ + __LINE__, gcry_strerror (rc)); abort (); } while (0 \ + ) /** @@ -259,6 +260,7 @@ struct TALER_CurrencySpecification * our configuration. * * @param cfg configuration to parse + * @param main_currency main currency of the component * @param[out] num_currencies set to number of enabled currencies, length of @e cspecs * @param[out] cspecs set to currency specification array * @return #GNUNET_OK on success, #GNUNET_NO if zero @@ -267,6 +269,7 @@ struct TALER_CurrencySpecification */ enum GNUNET_GenericReturnValue TALER_CONFIG_parse_currencies (const struct GNUNET_CONFIGURATION_Handle *cfg, + const char *main_currency, unsigned int *num_currencies, struct TALER_CurrencySpecification **cspecs); @@ -771,7 +774,7 @@ TALER_get_lowest_age ( * @return lowest age for the largest age group */ #define TALER_adult_age(mask) \ - sizeof((mask)->bits) * 8 - __builtin_clz ((mask)->bits) - 1 + sizeof((mask)->bits) * 8 - __builtin_clz ((mask)->bits) - 1 /** * Handle to an external process that will assist |