diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-03-19 15:23:11 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-03-19 15:23:11 +0100 |
commit | 0d1eced630f4ed05ad95fdbb4354fd428c9cdbf6 (patch) | |
tree | 0ed4d6f189ed72287a0e003446c87a2b6db70c1a /src/util/util.c | |
parent | d229f78da3b0b7f851d3541f59651b4f600c879d (diff) | |
download | exchange-0d1eced630f4ed05ad95fdbb4354fd428c9cdbf6.tar.xz |
first refactoring of JSON logic to address #4150 and #4237
Diffstat (limited to 'src/util/util.c')
-rw-r--r-- | src/util/util.c | 42 |
1 files changed, 1 insertions, 41 deletions
diff --git a/src/util/util.c b/src/util/util.c index addafacf7..6dcd0dc29 100644 --- a/src/util/util.c +++ b/src/util/util.c @@ -56,7 +56,7 @@ TALER_b2s (const void *buf, GNUNET_free (tmp); ret[8] = '\0'; return ret; -} +} /** @@ -90,46 +90,6 @@ TALER_config_get_denom (struct GNUNET_CONFIGURATION_Handle *cfg, /** - * Round a time value so that it is suitable for transmission - * via JSON encodings. - * - * @param at time to round - * @return #GNUNET_OK if time was already rounded, #GNUNET_NO if - * it was just now rounded - */ -int -TALER_round_abs_time (struct GNUNET_TIME_Absolute *at) -{ - if (at->abs_value_us == GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us) - return GNUNET_OK; - if (0 == at->abs_value_us % 1000000) - return GNUNET_OK; - at->abs_value_us -= at->abs_value_us % 1000000; - return GNUNET_NO; -} - - -/** - * Round a time value so that it is suitable for transmission - * via JSON encodings. - * - * @param rt time to round - * @return #GNUNET_OK if time was already rounded, #GNUNET_NO if - * it was just now rounded - */ -int -TALER_round_rel_time (struct GNUNET_TIME_Relative *rt) -{ - if (rt->rel_value_us == GNUNET_TIME_UNIT_FOREVER_REL.rel_value_us) - return GNUNET_OK; - if (0 == rt->rel_value_us % 1000000) - return GNUNET_OK; - rt->rel_value_us -= rt->rel_value_us % 1000000; - return GNUNET_NO; -} - - -/** * Load configuration by parsing all configuration * files in the given directory. * |