From 737e3f4bf67a2048381785328206c595bffe632a Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 19 Mar 2016 19:16:35 +0100 Subject: refactor to eliminate duplicated JSON parsing logic (#4150) --- src/json/json_helper.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/json') diff --git a/src/json/json_helper.c b/src/json/json_helper.c index b61fe21a6..7eaaa441a 100644 --- a/src/json/json_helper.c +++ b/src/json/json_helper.c @@ -143,4 +143,36 @@ TALER_JSON_spec_amount (const char *name, } +/** + * Generate line in parser specification for denomination public key. + * + * @param field name of the field + * @param[out] pk key to initialize + * @return corresponding field spec + */ +struct GNUNET_JSON_Specification +TALER_JSON_spec_denomination_public_key (const char *field, + struct TALER_DenominationPublicKey *pk) +{ + return GNUNET_JSON_spec_rsa_public_key (field, + &pk->rsa_public_key); +} + + +/** + * Generate line in parser specification for denomination signature. + * + * @param field name of the field + * @param sig the signature to initialize + * @return corresponding field spec + */ +struct GNUNET_JSON_Specification +TALER_JSON_spec_denomination_signature (const char *field, + struct TALER_DenominationSignature *sig) +{ + return GNUNET_JSON_spec_rsa_signature (field, + &sig->rsa_signature); +} + + /* end of json/json_helper.c */ -- cgit v1.2.3