From 189adf52eb96de135d531f53389ecce2d791268d Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 8 Aug 2015 21:46:26 +0200 Subject: finshing json parsing support for /refresh/melt handling --- src/mint-lib/mint_api_json.h | 46 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 44 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 46ccef3a..bca3b47c 100644 --- a/src/mint-lib/mint_api_json.h +++ b/src/mint-lib/mint_api_json.h @@ -79,7 +79,17 @@ enum MAJ_Command MAJ_CMD_STRING, /** - * Parse at current position. + * Parse `uint16_t` integer at the current position. + */ + MAJ_CMD_UINT16, + + /** + * Parse JSON object at the current position. + */ + MAJ_CMD_JSON_OBJECT, + + /** + * Parse ??? at current position. */ MAJ_CMD_C @@ -181,6 +191,16 @@ struct MAJ_Specification */ const char **strptr; + /** + * Where to store 16-bit integer. + */ + uint16_t *u16; + + /** + * Where to store a JSON object. + */ + json_t **obj; + } details; }; @@ -249,13 +269,35 @@ MAJ_spec_string (const char *name, * Absolute time. * * @param name name of the JSON field - * @param at where to store the absolute time found under @a name + * @param[out] at where to store the absolute time found under @a name */ struct MAJ_Specification MAJ_spec_absolute_time (const char *name, struct GNUNET_TIME_Absolute *at); +/** + * 16-bit integer. + * + * @param name name of the JSON field + * @param[out] u16 where to store the integer found under @a name + */ +struct MAJ_Specification +MAJ_spec_uint16 (const char *name, + uint16_t *u16); + + +/** + * JSON object. + * + * @param name name of the JSON field + * @param[out] jsonp where to store the JSON found under @a name + */ +struct MAJ_Specification +MAJ_spec_json (const char *name, + json_t **jsonp); + + /** * Specification for parsing an amount value. * -- cgit v1.2.3 From 2da8705c9653729f6e46f7586c049db8cb280a4c Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 9 Aug 2015 15:46:29 +0200 Subject: doxygen --- src/include/taler_mint_service.h | 7 +++---- src/mint-lib/mint_api_context.h | 2 +- src/mint-lib/mint_api_json.h | 2 +- src/mint/taler-mint-httpd_responses.h | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) (limited to 'src/mint-lib/mint_api_json.h') diff --git a/src/include/taler_mint_service.h b/src/include/taler_mint_service.h index 68813306..02407a3a 100644 --- a/src/include/taler_mint_service.h +++ b/src/include/taler_mint_service.h @@ -188,7 +188,7 @@ struct TALER_MINT_DenomPublicKey /** - * Information we get from the mint about auditors. + * @brief Information we get from the mint about auditors. */ struct TALER_MINT_AuditorInformation { @@ -222,9 +222,8 @@ struct TALER_MINT_AuditorInformation }; - /** - * Information about keys from the mint. + * @brief Information about keys from the mint. */ struct TALER_MINT_Keys { @@ -466,7 +465,7 @@ enum TALER_MINT_ReserveTransactionType { /** - * Entry in the reserve's transaction history. + * @brief Entry in the reserve's transaction history. */ struct TALER_MINT_ReserveHistory { diff --git a/src/mint-lib/mint_api_context.h b/src/mint-lib/mint_api_context.h index c545a3fe..79613cc8 100644 --- a/src/mint-lib/mint_api_context.h +++ b/src/mint-lib/mint_api_context.h @@ -90,7 +90,7 @@ MAC_job_cancel (struct MAC_Job *job); /** - * Buffer data structure we use to buffer the HTTP download + * @brief Buffer data structure we use to buffer the HTTP download * before giving it to the JSON parser. */ struct MAC_DownloadBuffer diff --git a/src/mint-lib/mint_api_json.h b/src/mint-lib/mint_api_json.h index bca3b47c..2af5588e 100644 --- a/src/mint-lib/mint_api_json.h +++ b/src/mint-lib/mint_api_json.h @@ -97,7 +97,7 @@ enum MAJ_Command /** - * Entry in parser specification for #MAJ_parse_json. + * @brief Entry in parser specification for #MAJ_parse_json. */ struct MAJ_Specification { diff --git a/src/mint/taler-mint-httpd_responses.h b/src/mint/taler-mint-httpd_responses.h index 7afd0188..a3535638 100644 --- a/src/mint/taler-mint-httpd_responses.h +++ b/src/mint/taler-mint-httpd_responses.h @@ -350,7 +350,7 @@ TMH_RESPONSE_reply_refresh_reveal_missmatch (struct MHD_Connection *connection, /** - * Information for each session a coin was melted into. + * @brief Information for each session a coin was melted into. */ struct TMH_RESPONSE_LinkSessionInfo { -- cgit v1.2.3