wire_prepare_data_get.h (2311B)
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/wire_prepare_data_get.h 18 * @brief implementation of the wire_prepare_data_get function for Postgres 19 * @author Christian Grothoff 20 */ 21 #ifndef EXCHANGE_DATABASE_WIRE_PREPARE_DATA_GET_H 22 #define EXCHANGE_DATABASE_WIRE_PREPARE_DATA_GET_H 23 24 #include "taler/taler_json_lib.h" 25 #include "exchangedb_lib.h" 26 27 28 /** 29 * Callback with data about a prepared wire transfer. 30 * 31 * @param cls closure 32 * @param rowid row identifier used to mark prepared transaction as done 33 * @param wire_method which wire method is this preparation data for 34 * @param buf transaction data that was persisted, NULL on error 35 * @param buf_size number of bytes in @a buf, 0 on error 36 */ 37 typedef void 38 (*TALER_EXCHANGEDB_WirePreparationIterator) (void *cls, 39 uint64_t rowid, 40 const char *wire_method, 41 const char *buf, 42 size_t buf_size); 43 44 /** 45 * Function called to get an unfinished wire transfer 46 * preparation data. Fetches at most one item. 47 * 48 * @param pg the database context 49 * @param start_row offset to query table at 50 * @param limit maximum number of results to return 51 * @param cb function to call for ONE unfinished item 52 * @param cb_cls closure for @a cb 53 * @return transaction status code 54 */ 55 enum GNUNET_DB_QueryStatus 56 TALER_EXCHANGEDB_wire_prepare_data_get ( 57 struct TALER_EXCHANGEDB_PostgresContext *pg, 58 uint64_t start_row, 59 uint64_t limit, 60 TALER_EXCHANGEDB_WirePreparationIterator cb, 61 void *cb_cls); 62 63 #endif