iterate_auditor_denominations.h (3540B)
1 /* 2 This file is part of TALER 3 Copyright (C) 2022 Taler Systems SA 4 5 TALER is free software; you can redistribute it and/or modify it under the 6 terms of the GNU General Public License as published by the Free Software 7 Foundation; either version 3, or (at your option) any later version. 8 9 TALER is distributed in the hope that it will be useful, but WITHOUT ANY 10 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 11 A PARTICULAR PURPOSE. See the GNU General Public License for more details. 12 13 You should have received a copy of the GNU General Public License along with 14 TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> 15 */ 16 /** 17 * @file src/include/exchange-database/iterate_auditor_denominations.h 18 * @brief implementation of the iterate_auditor_denominations function for Postgres 19 * @author Christian Grothoff 20 */ 21 #ifndef EXCHANGE_DATABASE_ITERATE_AUDITOR_DENOMINATIONS_H 22 #define EXCHANGE_DATABASE_ITERATE_AUDITOR_DENOMINATIONS_H 23 24 #include "taler/taler_json_lib.h" 25 #include "exchangedb_lib.h" 26 27 28 /** 29 * Function called with information about the denominations 30 * audited by the exchange's auditors. 31 * 32 * @param cls closure with a `struct TEH_KeyStateHandle *` 33 * @param auditor_pub the public key of an auditor 34 * @param h_denom_pub hash of a denomination key audited by this auditor 35 * @param auditor_sig signature from the auditor affirming this 36 */ 37 #ifndef TALER_EXCHANGEDB_AUDITOR_DENOMINATIONS_RESULT_CLOSURE 38 /** 39 * Type of the closure for #TALER_EXCHANGEDB_AuditorDenominationsCallback. 40 */ 41 #define TALER_EXCHANGEDB_AUDITOR_DENOMINATIONS_RESULT_CLOSURE void 42 #endif 43 typedef void 44 (*TALER_EXCHANGEDB_AuditorDenominationsCallback)( 45 TALER_EXCHANGEDB_AUDITOR_DENOMINATIONS_RESULT_CLOSURE *cls, 46 const struct TALER_AuditorPublicKeyP *auditor_pub, 47 const struct TALER_DenominationHashP *h_denom_pub, 48 const struct TALER_AuditorSignatureP *auditor_sig); 49 50 51 /* Callback typedefs */ 52 /** 53 * Function called with information about the denominations 54 * audited by the exchange's auditors. 55 * 56 * @param cls closure with a `struct TEH_KeyStateHandle *` 57 * @param auditor_pub the public key of an auditor 58 * @param h_denom_pub hash of a denomination key audited by this auditor 59 * @param auditor_sig signature from the auditor affirming this 60 */ 61 typedef void 62 (*TALER_EXCHANGEDB_AuditorDenominationsCallback)( 63 TALER_EXCHANGEDB_AUDITOR_DENOMINATIONS_RESULT_CLOSURE *cls, 64 const struct TALER_AuditorPublicKeyP *auditor_pub, 65 const struct TALER_DenominationHashP *h_denom_pub, 66 const struct TALER_AuditorSignatureP *auditor_sig); 67 68 /** 69 * Function called to invoke @a cb on every denomination with an active 70 * auditor. Disabled auditors and denominations without auditor are 71 * skipped. Runs in its own read-only transaction. 72 * 73 * @param pg the database context 74 * @param cb function to call on each active auditor 75 * @param cb_cls closure for @a cb 76 * @return transaction status code 77 */ 78 enum GNUNET_DB_QueryStatus 79 TALER_EXCHANGEDB_iterate_auditor_denominations (struct 80 TALER_EXCHANGEDB_PostgresContext 81 *pg 82 , 83 TALER_EXCHANGEDB_AuditorDenominationsCallback 84 cb, 85 TALER_EXCHANGEDB_AUDITOR_DENOMINATIONS_RESULT_CLOSURE 86 *cb_cls); 87 88 #endif