From 9e4ac84b6eed7cc622d041c396bc460ce7e1bf07 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 5 Dec 2022 14:03:43 +0100 Subject: [PATCH] force include of taler_util.h, not of taler_crypto_lib.h or taler_amount_lib.h --- contrib/sigp/h.header | 5 ++--- src/exchange/taler-exchange-httpd.h | 2 +- src/include/taler_amount_lib.h | 4 ++++ src/include/taler_auditordb_plugin.h | 1 + src/include/taler_crypto_lib.h | 4 ++++ src/include/taler_extensions.h | 2 +- src/include/taler_extensions_policy.h | 2 +- src/include/taler_util.h | 4 ++++ src/kyclogic/taler-exchange-kyc-tester.c | 2 +- src/lib/exchange_api_handle.h | 2 +- src/lib/exchange_api_management_get_keys.c | 2 +- src/sq/sq_result_helper.c | 2 +- 12 files changed, 22 insertions(+), 10 deletions(-) diff --git a/contrib/sigp/h.header b/contrib/sigp/h.header index a0e3c6ae3..6ed22a63d 100644 --- a/contrib/sigp/h.header +++ b/contrib/sigp/h.header @@ -27,6 +27,5 @@ #ifndef TALER_SIGNATURES_H #define TALER_SIGNATURES_H -#include -#include "taler_amount_lib.h" -#include "taler_crypto_lib.h" + + diff --git a/src/exchange/taler-exchange-httpd.h b/src/exchange/taler-exchange-httpd.h index 4d3fb4901..67b8e75d0 100644 --- a/src/exchange/taler-exchange-httpd.h +++ b/src/exchange/taler-exchange-httpd.h @@ -25,7 +25,7 @@ #include #include "taler_json_lib.h" -#include "taler_crypto_lib.h" +#include "taler_util.h" #include "taler_kyclogic_plugin.h" #include "taler_extensions.h" #include diff --git a/src/include/taler_amount_lib.h b/src/include/taler_amount_lib.h index a529cfb84..04aa00045 100644 --- a/src/include/taler_amount_lib.h +++ b/src/include/taler_amount_lib.h @@ -18,6 +18,10 @@ * @brief amount-representation utility functions * @author Sree Harsha Totakura */ +#if ! defined (__TALER_UTIL_LIB_H_INSIDE__) +#error "Only can be included directly." +#endif + #ifndef TALER_AMOUNT_LIB_H #define TALER_AMOUNT_LIB_H diff --git a/src/include/taler_auditordb_plugin.h b/src/include/taler_auditordb_plugin.h index cf27668b6..99b5e7f3f 100644 --- a/src/include/taler_auditordb_plugin.h +++ b/src/include/taler_auditordb_plugin.h @@ -25,6 +25,7 @@ #include #include #include +#include "taler_util.h" #include "taler_auditordb_lib.h" #include "taler_signatures.h" diff --git a/src/include/taler_crypto_lib.h b/src/include/taler_crypto_lib.h index 631883f41..4fdda39e0 100644 --- a/src/include/taler_crypto_lib.h +++ b/src/include/taler_crypto_lib.h @@ -19,6 +19,10 @@ * @author Sree Harsha Totakura * @author Christian Grothoff */ +#if ! defined (__TALER_UTIL_LIB_H_INSIDE__) +#error "Only can be included directly." +#endif + #ifndef TALER_CRYPTO_LIB_H #define TALER_CRYPTO_LIB_H diff --git a/src/include/taler_extensions.h b/src/include/taler_extensions.h index a37a7461a..fedc17d90 100644 --- a/src/include/taler_extensions.h +++ b/src/include/taler_extensions.h @@ -22,7 +22,7 @@ #define TALER_EXTENSIONS_H #include -#include "taler_crypto_lib.h" +#include "taler_util.h" #include "taler_json_lib.h" #include "taler_mhd_lib.h" #include "taler_extensions_policy.h" diff --git a/src/include/taler_extensions_policy.h b/src/include/taler_extensions_policy.h index 1072e214b..ecb4e2628 100644 --- a/src/include/taler_extensions_policy.h +++ b/src/include/taler_extensions_policy.h @@ -22,7 +22,7 @@ #define TALER_EXTENSIONS_POLICY_H #include -#include "taler_crypto_lib.h" +#include "taler_util.h" #include "taler_json_lib.h" #include "taler_mhd_lib.h" diff --git a/src/include/taler_util.h b/src/include/taler_util.h index 1580f3dca..5776d62c3 100644 --- a/src/include/taler_util.h +++ b/src/include/taler_util.h @@ -21,6 +21,8 @@ #ifndef TALER_UTIL_H #define TALER_UTIL_H +#define __TALER_UTIL_LIB_H_INSIDE__ + #include #include #include "taler_amount_lib.h" @@ -551,4 +553,6 @@ enum GNUNET_GenericReturnValue TALER_JSON_parse_age_groups (const json_t *root, struct TALER_AgeMask *mask); +#undef __TALER_UTIL_LIB_H_INSIDE__ + #endif diff --git a/src/kyclogic/taler-exchange-kyc-tester.c b/src/kyclogic/taler-exchange-kyc-tester.c index 2aed8d961..1b6094993 100644 --- a/src/kyclogic/taler-exchange-kyc-tester.c +++ b/src/kyclogic/taler-exchange-kyc-tester.c @@ -28,7 +28,7 @@ #include "taler_mhd_lib.h" #include "taler_json_lib.h" #include "taler_templating_lib.h" -#include "taler_crypto_lib.h" +#include "taler_util.h" #include "taler_kyclogic_lib.h" #include "taler_kyclogic_plugin.h" #include diff --git a/src/lib/exchange_api_handle.h b/src/lib/exchange_api_handle.h index 7ef88489e..3b1d875fb 100644 --- a/src/lib/exchange_api_handle.h +++ b/src/lib/exchange_api_handle.h @@ -25,7 +25,7 @@ #include #include "taler_auditor_service.h" #include "taler_exchange_service.h" -#include "taler_crypto_lib.h" +#include "taler_util.h" #include "taler_curl_lib.h" /** diff --git a/src/lib/exchange_api_management_get_keys.c b/src/lib/exchange_api_management_get_keys.c index 8a279d1ef..80c471441 100644 --- a/src/lib/exchange_api_management_get_keys.c +++ b/src/lib/exchange_api_management_get_keys.c @@ -26,7 +26,7 @@ #include "exchange_api_curl_defaults.h" #include "taler_signatures.h" #include "taler_curl_lib.h" -#include "taler_crypto_lib.h" +#include "taler_util.h" #include "taler_json_lib.h" /** diff --git a/src/sq/sq_result_helper.c b/src/sq/sq_result_helper.c index bacb7743a..9d80837bd 100644 --- a/src/sq/sq_result_helper.c +++ b/src/sq/sq_result_helper.c @@ -23,7 +23,7 @@ #include #include #include "taler_sq_lib.h" -#include "taler_amount_lib.h" +#include "taler_util.h" /**