diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-08-08 21:46:26 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-08-08 21:46:26 +0200 |
commit | 189adf52eb96de135d531f53389ecce2d791268d (patch) | |
tree | 880e0c362ff5a9858e59a04625dd42188e640cb9 /src/mint-lib/mint_api_json.h | |
parent | 6ea5858d3276378dd3636ecc36ed312a0ccaee61 (diff) | |
download | exchange-189adf52eb96de135d531f53389ecce2d791268d.tar.xz |
finshing json parsing support for /refresh/melt handling
Diffstat (limited to 'src/mint-lib/mint_api_json.h')
-rw-r--r-- | src/mint-lib/mint_api_json.h | 46 |
1 files changed, 44 insertions, 2 deletions
diff --git a/src/mint-lib/mint_api_json.h b/src/mint-lib/mint_api_json.h index 46ccef3ab..bca3b47ca 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,7 +269,7 @@ 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, @@ -257,6 +277,28 @@ MAJ_spec_absolute_time (const char *name, /** + * 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. * * @param name name of the JSON field |