diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-01-30 13:49:29 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-01-30 13:49:29 +0100 |
commit | a396f4e7fa39f17aec35360eb12098629649c831 (patch) | |
tree | e3e94b05bd85f548e52859af50660e5aea44d456 /src/mint-lib/mint_api_json.c | |
parent | 3bb757b3a7bddbd132805dc1147158b40238e543 (diff) | |
parent | ae45b7ac9579cc9fcb9c3008162e07b694eb52f8 (diff) | |
download | exchange-a396f4e7fa39f17aec35360eb12098629649c831.tar.gz exchange-a396f4e7fa39f17aec35360eb12098629649c831.tar.bz2 exchange-a396f4e7fa39f17aec35360eb12098629649c831.zip |
Merge branch 'master' of ssh://taler.net:/var/git/mint
Diffstat (limited to 'src/mint-lib/mint_api_json.c')
-rw-r--r-- | src/mint-lib/mint_api_json.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/mint-lib/mint_api_json.c b/src/mint-lib/mint_api_json.c index a728a5495..7de33e5eb 100644 --- a/src/mint-lib/mint_api_json.c +++ b/src/mint-lib/mint_api_json.c @@ -232,6 +232,20 @@ parse_json (json_t *root, } break; + case MAJ_CMD_UINT64: + { + json_int_t val; + + if (! json_is_integer (pos)) + { + GNUNET_break_op (0); + return i; + } + val = json_integer_value (pos); + *spec[i].details.u64 = (uint64_t) val; + } + break; + case MAJ_CMD_JSON_OBJECT: { if (! (json_is_object (pos) || json_is_array (pos)) ) @@ -429,6 +443,26 @@ MAJ_spec_uint16 (const char *name, /** + * 64-bit integer. + * + * @param name name of the JSON field + * @param[out] u64 where to store the integer found under @a name + */ +struct MAJ_Specification +MAJ_spec_uint64 (const char *name, + uint64_t *u64) +{ + struct MAJ_Specification ret = + { + .cmd = MAJ_CMD_UINT64, + .field = name, + .details.u64 = u64 + }; + return ret; +} + + +/** * JSON object. * * @param name name of the JSON field |