select_wire_out_above_serial_id.h (2762B)
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/select_wire_out_above_serial_id.h 18 * @brief implementation of the select_wire_out_above_serial_id function for Postgres 19 * @author Christian Grothoff 20 */ 21 #ifndef EXCHANGE_DATABASE_SELECT_WIRE_OUT_ABOVE_SERIAL_ID_H 22 #define EXCHANGE_DATABASE_SELECT_WIRE_OUT_ABOVE_SERIAL_ID_H 23 24 #include "taler/taler_util.h" 25 #include "taler/taler_json_lib.h" 26 #include "exchangedb_lib.h" 27 28 29 /* Callback typedefs */ 30 /** 31 * Function called with the results of the lookup of the 32 * wire transfer data of the exchange. 33 * 34 * @param cls closure 35 * @param rowid identifier of the respective row in the database 36 * @param date timestamp of the wire transfer (roughly) 37 * @param wtid wire transfer subject 38 * @param payto_uri details of the receiver, URI in payto://-format 39 * @param amount amount that was wired 40 * @return #GNUNET_OK to continue, #GNUNET_SYSERR to stop iteration 41 */ 42 typedef enum GNUNET_GenericReturnValue 43 (*TALER_EXCHANGEDB_WireTransferOutCallback)( 44 void *cls, 45 uint64_t rowid, 46 struct GNUNET_TIME_Timestamp date, 47 const struct TALER_WireTransferIdentifierRawP *wtid, 48 const struct TALER_FullPayto payto_uri, 49 const struct TALER_Amount *amount); 50 51 /** 52 * Function called to select all wire transfers the exchange 53 * executed. 54 * 55 * @param pg the database context 56 * @param serial_id highest serial ID to exclude (select strictly larger) 57 * @param cb function to call for ONE unfinished item 58 * @param cb_cls closure for @a cb 59 * @return transaction status code 60 */ 61 enum GNUNET_DB_QueryStatus 62 TALER_EXCHANGEDB_select_wire_out_above_serial_id (struct 63 TALER_EXCHANGEDB_PostgresContext 64 * 65 pg, 66 uint64_t serial_id, 67 TALER_EXCHANGEDB_WireTransferOutCallback 68 cb, 69 void *cb_cls); 70 71 #endif