exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

iterate_denomination_info.h (2965B)


      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 typedef void
     39 (*TALER_EXCHANGEDB_DenominationCallback)(
     40   void *cls,
     41   uint64_t denom_serial,
     42   const struct TALER_DenominationPublicKey *denom_pub,
     43   const struct TALER_EXCHANGEDB_DenominationKeyInformation *issue);
     44 
     45 
     46 /* Callback typedefs */
     47 /**
     48  * Function called with information about the exchange's denomination keys.
     49  * Note that the 'master' field in @a issue will not yet be initialized when
     50  * this function is called!
     51  *
     52  * @param cls closure
     53  * @param denom_serial table row of the denomination
     54  * @param denom_pub public key of the denomination
     55  * @param issue detailed information about the denomination (value, expiration times, fees);
     56  */
     57 typedef void
     58 (*TALER_EXCHANGEDB_DenominationCallback)(
     59   void *cls,
     60   uint64_t denom_serial,
     61   const struct TALER_DenominationPublicKey *denom_pub,
     62   const struct TALER_EXCHANGEDB_DenominationKeyInformation *issue);
     63 
     64 /**
     65  * Fetch information about all known denomination keys.
     66  *
     67  * @param pg the database context
     68  * @param cb function to call on each denomination key
     69  * @param cb_cls closure for @a cb
     70  * @return transaction status code
     71  */
     72 enum GNUNET_DB_QueryStatus
     73 TALER_EXCHANGEDB_iterate_denomination_info (struct
     74                                             TALER_EXCHANGEDB_PostgresContext *pg
     75                                             ,
     76                                             TALER_EXCHANGEDB_DenominationCallback
     77                                             cb,
     78                                             void *cb_cls);
     79 
     80 #endif