aboutsummaryrefslogtreecommitdiff
path: root/src/mint-lib/mint_api_json.h
diff options
context:
space:
mode:
authorFournier Nicolas <nicolas.fournier@ensta-paristech.fr>2015-08-10 15:11:11 +0200
committerFournier Nicolas <nicolas.fournier@ensta-paristech.fr>2015-08-10 15:11:11 +0200
commitd6c1340bcdfef8228a7802bf046f4f8babf44f5e (patch)
tree0a4c8f5f68c8e566768651aba342877337525b12 /src/mint-lib/mint_api_json.h
parentb02dc90ba08d0653bfd121f87425804c10901f23 (diff)
parentcf3345a96f4e5c3fc1085052170e79adfaaff220 (diff)
Merge branch 'master' of taler.net:/var/git/mint
Diffstat (limited to 'src/mint-lib/mint_api_json.h')
-rw-r--r--src/mint-lib/mint_api_json.h48
1 files changed, 45 insertions, 3 deletions
diff --git a/src/mint-lib/mint_api_json.h b/src/mint-lib/mint_api_json.h
index 46ccef3a..2af5588e 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
@@ -87,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
{
@@ -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