From ed51946442e5e22a7dea68f14ff2bf563503c755 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 19 Jan 2015 21:53:23 +0100 Subject: more code refactoring to separate parsing, db and response generation nicely --- src/include/taler_json_lib.h | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'src/include/taler_json_lib.h') diff --git a/src/include/taler_json_lib.h b/src/include/taler_json_lib.h index b224c4b33..ec354cce7 100644 --- a/src/include/taler_json_lib.h +++ b/src/include/taler_json_lib.h @@ -27,8 +27,7 @@ /** - * Convert a TALER amount to a JSON - * object. + * Convert a TALER amount to a JSON object. * * @param amount the amount * @return a json object describing the amount @@ -47,6 +46,17 @@ json_t * TALER_JSON_from_abs (struct GNUNET_TIME_Absolute stamp); +/** + * Convert a signature (with purpose) to a JSON object representation. + * + * @param purpose purpose of the signature + * @param signature the signature + * @return the JSON reporesentation of the signature with purpose + */ +json_t * +TALER_JSON_from_sig (const struct GNUNET_CRYPTO_EccSignaturePurpose *purpose, + const struct GNUNET_CRYPTO_EddsaSignature *signature); + /** * Convert binary data to a JSON string @@ -65,7 +75,7 @@ TALER_JSON_from_data (const void *data, size_t size); * * @param json the json object representing Amount * @param r_amount where the amount has to be written - * @return GNUNET_OK upon successful parsing; GNUNET_SYSERR upon error + * @return #GNUNET_OK upon successful parsing; GNUNET_SYSERR upon error */ int TALER_JSON_to_amount (json_t *json, @@ -76,7 +86,7 @@ TALER_JSON_to_amount (json_t *json, * * @param json the json object representing absolute time in seconds * @param r_abs where the time has to be written - * @return GNUNET_OK upon successful parsing; GNUNET_SYSERR upon error + * @return #GNUNET_OK upon successful parsing; GNUNET_SYSERR upon error */ int TALER_JSON_to_abs (json_t *json, @@ -88,7 +98,7 @@ TALER_JSON_to_abs (json_t *json, * @param json the json object representing data * @param out the pointer to hold the parsed data. * @param out_size the size of r_data. - * @return GNUNET_OK upon successful parsing; GNUNET_SYSERR upon error + * @return #GNUNET_OK upon successful parsing; GNUNET_SYSERR upon error */ int TALER_JSON_to_data (json_t *json, -- cgit v1.2.3