aboutsummaryrefslogtreecommitdiff
path: root/src/pq/pq_query_helper.c
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2023-11-29 09:08:24 +0900
committerChristian Grothoff <grothoff@gnunet.org>2023-11-29 09:08:24 +0900
commit180f65b097c5f83637a5a31159c79b3d8fd35cfa (patch)
tree26d570cdb1fbd35a605fb98391aa74e3949a9e2c /src/pq/pq_query_helper.c
parent36f8a0970f07fd646292e882e3cb7707d58dec4f (diff)
parent245e8ed2c2280341151ba08e24edbc52c496914e (diff)
downloadexchange-180f65b097c5f83637a5a31159c79b3d8fd35cfa.tar.gz
exchange-180f65b097c5f83637a5a31159c79b3d8fd35cfa.tar.bz2
exchange-180f65b097c5f83637a5a31159c79b3d8fd35cfa.zip
Merge branch 'master' of git+ssh://git.taler.net/exchangev0.9.3a
Diffstat (limited to 'src/pq/pq_query_helper.c')
-rw-r--r--src/pq/pq_query_helper.c45
1 files changed, 37 insertions, 8 deletions
diff --git a/src/pq/pq_query_helper.c b/src/pq/pq_query_helper.c
index f66844515..24bf054da 100644
--- a/src/pq/pq_query_helper.c
+++ b/src/pq/pq_query_helper.c
@@ -846,14 +846,14 @@ qconv_array (
same_sized = (0 != meta->same_size);
#define RETURN_UNLESS(cond) \
- do { \
- if (! (cond)) \
- { \
- GNUNET_break ((cond)); \
- noerror = false; \
- goto DONE; \
- } \
- } while (0)
+ do { \
+ if (! (cond)) \
+ { \
+ GNUNET_break ((cond)); \
+ noerror = false; \
+ goto DONE; \
+ } \
+ } while (0)
/* Calculate sizes and check bounds */
{
@@ -1037,6 +1037,15 @@ qconv_array (
sizeof(struct TALER_DenominationHashP));
break;
}
+ case TALER_PQ_array_of_hash_code:
+ {
+ const struct GNUNET_HashCode *hashes = data;
+
+ GNUNET_memcpy (out,
+ &hashes[i],
+ sizeof(struct GNUNET_HashCode));
+ break;
+ }
default:
{
GNUNET_assert (0);
@@ -1171,6 +1180,26 @@ TALER_PQ_query_param_array_denom_hash (
struct GNUNET_PQ_QueryParam
+TALER_PQ_query_param_array_hash_code (
+ size_t num,
+ const struct GNUNET_HashCode *hashes,
+ struct GNUNET_PQ_Context *db)
+{
+ Oid oid;
+ GNUNET_assert (GNUNET_OK ==
+ GNUNET_PQ_get_oid_by_name (db, "gnunet_hashcode", &oid));
+ return query_param_array_generic (num,
+ true,
+ hashes,
+ NULL,
+ sizeof(struct GNUNET_HashCode),
+ TALER_PQ_array_of_hash_code,
+ oid,
+ NULL);
+}
+
+
+struct GNUNET_PQ_QueryParam
TALER_PQ_query_param_array_amount (
size_t num,
const struct TALER_Amount *amounts,