iterate_denomination_info.h (3322B)
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_denomination_info.h 18 * @brief implementation of the iterate_denomination_info function for Postgres 19 * @author Christian Grothoff 20 */ 21 #ifndef EXCHANGE_DATABASE_ITERATE_DENOMINATION_INFO_H 22 #define EXCHANGE_DATABASE_ITERATE_DENOMINATION_INFO_H 23 24 #include "taler/taler_json_lib.h" 25 #include "exchangedb_lib.h" 26 27 28 /** 29 * Function called with information about the exchange's denomination keys. 30 * Note that the 'master' field in @a issue will not yet be initialized when 31 * this function is called! 32 * 33 * @param cls closure 34 * @param denom_serial table row of the denomination 35 * @param denom_pub public key of the denomination 36 * @param issue detailed information about the denomination (value, expiration times, fees); 37 */ 38 #ifndef TALER_EXCHANGEDB_DENOMINATION_RESULT_CLOSURE 39 /** 40 * Type of the closure for #TALER_EXCHANGEDB_DenominationCallback. 41 */ 42 #define TALER_EXCHANGEDB_DENOMINATION_RESULT_CLOSURE void 43 #endif 44 typedef void 45 (*TALER_EXCHANGEDB_DenominationCallback)( 46 TALER_EXCHANGEDB_DENOMINATION_RESULT_CLOSURE *cls, 47 uint64_t denom_serial, 48 const struct TALER_DenominationPublicKey *denom_pub, 49 const struct TALER_EXCHANGEDB_DenominationKeyInformation *issue); 50 51 52 /* Callback typedefs */ 53 /** 54 * Function called with information about the exchange's denomination keys. 55 * Note that the 'master' field in @a issue will not yet be initialized when 56 * this function is called! 57 * 58 * @param cls closure 59 * @param denom_serial table row of the denomination 60 * @param denom_pub public key of the denomination 61 * @param issue detailed information about the denomination (value, expiration times, fees); 62 */ 63 typedef void 64 (*TALER_EXCHANGEDB_DenominationCallback)( 65 TALER_EXCHANGEDB_DENOMINATION_RESULT_CLOSURE *cls, 66 uint64_t denom_serial, 67 const struct TALER_DenominationPublicKey *denom_pub, 68 const struct TALER_EXCHANGEDB_DenominationKeyInformation *issue); 69 70 /** 71 * Fetch information about all known denomination keys. 72 * 73 * @param pg the database context 74 * @param cb function to call on each denomination key 75 * @param cb_cls closure for @a cb 76 * @return transaction status code 77 */ 78 enum GNUNET_DB_QueryStatus 79 TALER_EXCHANGEDB_iterate_denomination_info (struct 80 TALER_EXCHANGEDB_PostgresContext *pg 81 , 82 TALER_EXCHANGEDB_DenominationCallback 83 cb, 84 TALER_EXCHANGEDB_DENOMINATION_RESULT_CLOSURE 85 *cb_cls); 86 87 #endif