summaryrefslogtreecommitdiff
path: root/src/pq
diff options
context:
space:
mode:
Diffstat (limited to 'src/pq')
-rw-r--r--src/pq/pq_helper.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/pq/pq_helper.c b/src/pq/pq_helper.c
index 8fd7e207..bd54447e 100644
--- a/src/pq/pq_helper.c
+++ b/src/pq/pq_helper.c
@@ -108,6 +108,21 @@ TALER_PQ_query_param_absolute_time (const struct GNUNET_TIME_Absolute *x)
/**
+ * Generate query parameter for an absolute time value.
+ * The database must store a 64-bit integer.
+ *
+ * @param x pointer to the query parameter to pass
+ */
+struct TALER_PQ_QueryParam
+TALER_PQ_query_param_absolute_time_nbo(const struct GNUNET_TIME_AbsoluteNBO *x)
+{
+ struct TALER_PQ_QueryParam res =
+ TALER_PQ_query_param_auto_from_type (&x->abs_value_us__);
+ return res;
+}
+
+
+/**
* Generate query parameter for an uint16_t in host byte order.
*
* @param x pointer to the query parameter to pass
@@ -269,6 +284,23 @@ TALER_PQ_result_spec_absolute_time (const char *name,
/**
+ * Absolute time expected.
+ *
+ * @param name name of the field in the table
+ * @param[out] at where to store the result
+ * @return array entry for the result specification to use
+ */
+struct TALER_PQ_ResultSpec
+TALER_PQ_result_spec_absolute_time_nbo (const char *name,
+ struct GNUNET_TIME_AbsoluteNBO *at)
+{
+ struct TALER_PQ_ResultSpec res =
+ TALER_PQ_result_spec_auto_from_type(name, &at->abs_value_us__);
+ return res;
+}
+
+
+/**
* uint16_t expected.
*
* @param name name of the field in the table