summaryrefslogtreecommitdiff
path: root/src/include/taler_pq_lib.h
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2023-07-29 21:26:58 +0200
committerÖzgür Kesim <oec-taler@kesim.org>2023-07-29 21:26:58 +0200
commitecf6b2750bb6ed9157aece72602dd042a50e36f3 (patch)
treef4436d80f00a07ac8e7193ee6e33c70d1b3a8424 /src/include/taler_pq_lib.h
parent28d80d3b38531eddfd37b2a8bcff9f209cf522ac (diff)
downloadexchange-ecf6b2750bb6ed9157aece72602dd042a50e36f3.tar.gz
exchange-ecf6b2750bb6ed9157aece72602dd042a50e36f3.tar.bz2
exchange-ecf6b2750bb6ed9157aece72602dd042a50e36f3.zip
[pq] added array support for taler_amount composite type
API added: - TALER_PQ_query_param_array_amount - TALER_PQ_result_spec_array_amount
Diffstat (limited to 'src/include/taler_pq_lib.h')
-rw-r--r--src/include/taler_pq_lib.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/include/taler_pq_lib.h b/src/include/taler_pq_lib.h
index 051962b2b..fddfd2a29 100644
--- a/src/include/taler_pq_lib.h
+++ b/src/include/taler_pq_lib.h
@@ -194,6 +194,19 @@ TALER_PQ_query_param_array_blinded_coin_hash (
const struct GNUNET_PQ_Context *db);
/**
+ * Generate query parameter for an array of mounts
+ *
+ * @param num of elements in @e amounts
+ * @param amounts continuous array of amounts
+ * @param db context for db-connection, needed for OID-lookup
+ */
+struct GNUNET_PQ_QueryParam
+TALER_PQ_query_param_array_amount (
+ size_t num,
+ const struct TALER_Amount *amounts,
+ struct GNUNET_PQ_Context *db);
+
+/**
* Currency amount expected.
*
* @param name name of the field in the table
@@ -356,6 +369,25 @@ TALER_PQ_result_spec_array_denom_hash (
size_t *num,
struct TALER_DenominationHashP **denom_hs);
+/**
+ * Array of amounts
+ *
+ * @param db context of the database connection
+ * @param name name of the field in the table
+ * @param currency The currency
+ * @param[out] num number of elements in @e amounts
+ * @param[out] amounts where to store the result
+ * @return array entry for the result specification to use
+ */
+struct GNUNET_PQ_ResultSpec
+TALER_PQ_result_spec_array_amount (
+ struct GNUNET_PQ_Context *db, /* not const because we need to query dynamically */
+ const char *name,
+ const char *currency,
+ size_t *num,
+ struct TALER_Amount **amounts);
+
+
#endif /* TALER_PQ_LIB_H_ */
/* end of include/taler_pq_lib.h */