From 7fe250407c440e59bece248747ffe8b29a8833b3 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 16 Jan 2015 15:04:47 +0100 Subject: clean up (and rename) request_json_require_nav to properly report parsing errors --- src/mint/taler-mint-httpd_parsing.h | 80 +++++++++++++++++++------------------ 1 file changed, 42 insertions(+), 38 deletions(-) (limited to 'src/mint/taler-mint-httpd_parsing.h') diff --git a/src/mint/taler-mint-httpd_parsing.h b/src/mint/taler-mint-httpd_parsing.h index c725187c5..a03f2b62d 100644 --- a/src/mint/taler-mint-httpd_parsing.h +++ b/src/mint/taler-mint-httpd_parsing.h @@ -30,43 +30,6 @@ #include -/** - * Constants for JSON navigation description. - */ -enum -{ - /** - * Access a field. - * Param: const char * - */ - JNAV_FIELD, - /** - * Access an array index. - * Param: int - */ - JNAV_INDEX, - /** - * Return base32crockford encoded data of - * constant size. - * Params: (void *, size_t) - */ - JNAV_RET_DATA, - /** - * Return base32crockford encoded data of - * variable size. - * Params: (void **, size_t *) - */ - JNAV_RET_DATA_VAR, - /** - * Return a json object, which must be - * of the given type (JSON_* type constants, - * or -1 for any type). - * Params: (int, json_t **) - */ - JNAV_RET_TYPED_JSON -}; - - /** * Process a POST request containing a JSON object. This * function realizes an MHD POST processor that will @@ -110,6 +73,47 @@ void TALER_MINT_parse_post_cleanup_callback (void *con_cls); +/** + * Constants for JSON navigation description. + */ +enum TALER_MINT_JsonNavigationCommand +{ + /** + * Access a field. + * Param: const char * + */ + JNAV_FIELD, + + /** + * Access an array index. + * Param: int + */ + JNAV_INDEX, + + /** + * Return base32crockford encoded data of + * constant size. + * Params: (void *, size_t) + */ + JNAV_RET_DATA, + + /** + * Return base32crockford encoded data of + * variable size. + * Params: (void **, size_t *) + */ + JNAV_RET_DATA_VAR, + + /** + * Return a json object, which must be + * of the given type (JSON_* type constants, + * or -1 for any type). + * Params: (int, json_t **) + */ + JNAV_RET_TYPED_JSON +}; + + /** * Navigate through a JSON tree. * @@ -124,7 +128,7 @@ TALER_MINT_parse_post_cleanup_callback (void *con_cls); * GNUNET_SYSERR on internal error */ int -request_json_require_nav (struct MHD_Connection *connection, +GNUNET_MINT_parse_navigate_json (struct MHD_Connection *connection, const json_t *root, ...); -- cgit v1.2.3