summaryrefslogtreecommitdiff
path: root/src/include/taler_pq_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-11-30 17:17:37 +0100
committerChristian Grothoff <christian@grothoff.org>2017-11-30 17:17:37 +0100
commit5540747ca2e5f37f2df504d689b850d1078fcdc5 (patch)
tree0e8be904bdedfe74a7cf78e1c27f7edc614c6301 /src/include/taler_pq_lib.h
parent78b77ee8d515c80ac85ca7af59e3e82c2baaeb68 (diff)
downloadexchange-5540747ca2e5f37f2df504d689b850d1078fcdc5.tar.gz
exchange-5540747ca2e5f37f2df504d689b850d1078fcdc5.tar.bz2
exchange-5540747ca2e5f37f2df504d689b850d1078fcdc5.zip
patch to address #5183: always round time before giving it to DB, tolerate DB answering without rounded time
Diffstat (limited to 'src/include/taler_pq_lib.h')
-rw-r--r--src/include/taler_pq_lib.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/src/include/taler_pq_lib.h b/src/include/taler_pq_lib.h
index 1fda8e58..4ac0a6df 100644
--- a/src/include/taler_pq_lib.h
+++ b/src/include/taler_pq_lib.h
@@ -65,6 +65,32 @@ TALER_PQ_query_param_json (const json_t *x);
/**
+ * Generate query parameter for an absolute time value.
+ * In contrast to
+ * #GNUNET_PQ_query_param_absolute_time(), this function
+ * will abort (!) if the time given is not rounded!
+ * The database must store a 64-bit integer.
+ *
+ * @param x pointer to the query parameter to pass
+ */
+struct GNUNET_PQ_QueryParam
+TALER_PQ_query_param_absolute_time (const struct GNUNET_TIME_Absolute *x);
+
+
+/**
+ * Generate query parameter for an absolute time value.
+ * In contrast to
+ * #GNUNET_PQ_query_param_absolute_time(), this function
+ * will abort (!) if the time given is not rounded!
+ * The database must store a 64-bit integer.
+ *
+ * @param x pointer to the query parameter to pass
+ */
+struct GNUNET_PQ_QueryParam
+TALER_PQ_query_param_absolute_time_nbo (const struct GNUNET_TIME_AbsoluteNBO *x);
+
+
+/**
* Currency amount expected.
*
* @param name name of the field in the table
@@ -100,6 +126,36 @@ TALER_PQ_result_spec_json (const char *name,
json_t **jp);
+/**
+ * Rounded absolute time expected.
+ * In contrast to #GNUNET_PQ_query_param_absolute_time_nbo(),
+ * this function ensures that the result is rounded and can
+ * be converted to JSON.
+ *
+ * @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 GNUNET_PQ_ResultSpec
+TALER_PQ_result_spec_absolute_time (const char *name,
+ struct GNUNET_TIME_Absolute *at);
+
+
+/**
+ * Rounded absolute time expected.
+ * In contrast to #GNUNET_PQ_result_spec_absolute_time_nbo(),
+ * this function ensures that the result is rounded and can
+ * be converted to JSON.
+ *
+ * @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 GNUNET_PQ_ResultSpec
+TALER_PQ_result_spec_absolute_time_nbo (const char *name,
+ struct GNUNET_TIME_AbsoluteNBO *at);
+
+
#endif /* TALER_PQ_LIB_H_ */
/* end of include/taler_pq_lib.h */