summaryrefslogtreecommitdiff
path: root/src/json
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-07-31 21:40:48 +0200
committerChristian Grothoff <christian@grothoff.org>2021-07-31 21:40:48 +0200
commitfde9dc80f6e6a5fe4c5856b2ed78e6c024528c43 (patch)
tree35d5e52652b38f75a5279fe855cc1d345fe3c1c5 /src/json
parent1d54400a025ff62ad15b77ab117ea5188884b1a1 (diff)
downloadexchange-fde9dc80f6e6a5fe4c5856b2ed78e6c024528c43.tar.gz
exchange-fde9dc80f6e6a5fe4c5856b2ed78e6c024528c43.tar.bz2
exchange-fde9dc80f6e6a5fe4c5856b2ed78e6c024528c43.zip
-more json_pack cleaning
Diffstat (limited to 'src/json')
-rw-r--r--src/json/json_pack.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/json/json_pack.c b/src/json/json_pack.c
index 7a5d22ee..1859e264 100644
--- a/src/json/json_pack.c
+++ b/src/json/json_pack.c
@@ -36,6 +36,20 @@ TALER_JSON_pack_time_abs (const char *name,
struct GNUNET_JSON_PackSpec
+TALER_JSON_pack_time_abs_human (const char *name,
+ struct GNUNET_TIME_Absolute at)
+{
+ struct GNUNET_JSON_PackSpec ps = {
+ .field_name = name,
+ .object = json_string (
+ GNUNET_STRINGS_absolute_time_to_string (at))
+ };
+
+ return ps;
+}
+
+
+struct GNUNET_JSON_PackSpec
TALER_JSON_pack_time_abs_nbo (const char *name,
struct GNUNET_TIME_AbsoluteNBO at)
{
@@ -45,6 +59,15 @@ TALER_JSON_pack_time_abs_nbo (const char *name,
struct GNUNET_JSON_PackSpec
+TALER_JSON_pack_time_abs_nbo_human (const char *name,
+ struct GNUNET_TIME_AbsoluteNBO at)
+{
+ return TALER_JSON_pack_time_abs_human (name,
+ GNUNET_TIME_absolute_ntoh (at));
+}
+
+
+struct GNUNET_JSON_PackSpec
TALER_JSON_pack_time_rel (const char *name,
struct GNUNET_TIME_Relative rt)
{