select_aggregations_above_serial.h (3008B)
1 /* 2 This file is part of TALER 3 Copyright (C) 2023 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/select_aggregations_above_serial.h 18 * @brief implementation of the select_aggregations_above_serial function for Postgres 19 * @author Christian Grothoff 20 */ 21 #ifndef EXCHANGE_DATABASE_SELECT_AGGREGATIONS_ABOVE_SERIAL_H 22 #define EXCHANGE_DATABASE_SELECT_AGGREGATIONS_ABOVE_SERIAL_H 23 24 #include "taler/taler_util.h" 25 #include "taler/taler_json_lib.h" 26 #include "exchangedb_lib.h" 27 28 29 /** 30 * Function called on aggregations that were done for 31 * a (batch) deposit. 32 * 33 * @param cls closure 34 * @param amount affected amount 35 * @param tracking_serial_id where in the table are we 36 * @param batch_deposit_serial_id which batch deposit was aggregated 37 */ 38 typedef void 39 (*TALER_EXCHANGEDB_AggregationCallback)( 40 void *cls, 41 const struct TALER_Amount *amount, 42 uint64_t tracking_serial_id, 43 uint64_t batch_deposit_serial_id); 44 45 46 /* Callback typedefs */ 47 /** 48 * Function called on aggregations that were done for 49 * a (batch) deposit. 50 * 51 * @param cls closure 52 * @param amount affected amount 53 * @param tracking_serial_id where in the table are we 54 * @param batch_deposit_serial_id which batch deposit was aggregated 55 */ 56 typedef void 57 (*TALER_EXCHANGEDB_AggregationCallback)( 58 void *cls, 59 const struct TALER_Amount *amount, 60 uint64_t tracking_serial_id, 61 uint64_t batch_deposit_serial_id); 62 63 /** 64 * Select all aggregation tracking IDs in the database 65 * above a given @a min_tracking_serial_id. 66 * 67 * @param pg the database context 68 * @param min_tracking_serial_id only return entries strictly above this row (and in order) 69 * @param cb function to call on all such aggregations 70 * @param cb_cls closure for @a cb 71 * @return transaction status code 72 */ 73 enum GNUNET_DB_QueryStatus 74 TALER_EXCHANGEDB_select_aggregations_above_serial (struct 75 TALER_EXCHANGEDB_PostgresContext 76 * 77 pg, 78 uint64_t 79 min_tracking_serial_id, 80 TALER_EXCHANGEDB_AggregationCallback 81 cb, 82 void *cb_cls); 83 84 85 #endif