From 59b4e1cdd81524a2b6b20d34dcdac69b7f1a385e Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 22 Jun 2015 21:18:44 +0200 Subject: almost finished checking if reserve transaction history well-formedness for /withdraw/sign error checking --- src/mint-lib/mint_api_json.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'src/mint-lib/mint_api_json.h') diff --git a/src/mint-lib/mint_api_json.h b/src/mint-lib/mint_api_json.h index ec3b63cb..69019251 100644 --- a/src/mint-lib/mint_api_json.h +++ b/src/mint-lib/mint_api_json.h @@ -74,9 +74,9 @@ enum MAJ_Command MAJ_CMD_EDDSA_SIGNATURE, /** - * Parse at current position. + * Parse `const char *` JSON string at current position. */ - MAJ_CMD_B, + MAJ_CMD_STRING, /** * Parse at current position. @@ -176,6 +176,11 @@ struct MAJ_Specification } eddsa_signature; + /** + * Where to store a pointer to the string. + */ + const char **strptr; + } details; }; @@ -229,6 +234,17 @@ MAJ_parse_free (struct MAJ_Specification *spec); #define MAJ_spec_varsize(name,obj,size) { .cmd = MAJ_CMD_BINARY_VARIABLE, .field = name, .details.variable_data.dest_p = obj, .details.variable_data.dest_size_p = size } +/** + * The expected field stores a string. + * + * @param name name of the JSON field + * @param strptr where to store a pointer to the field + */ +struct MAJ_Specification +MAJ_spec_string (const char *name, + const char **strptr); + + /** * Absolute time. * -- cgit v1.2.3