From 6516f1899f4202d802901d08ce26d02db63af83f Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 28 Jul 2021 09:13:21 +0200 Subject: start to use new GNUNET_JSON_PACK functionality --- src/include/taler_mhd_lib.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/include/taler_mhd_lib.h') diff --git a/src/include/taler_mhd_lib.h b/src/include/taler_mhd_lib.h index 894a701c..0e30d660 100644 --- a/src/include/taler_mhd_lib.h +++ b/src/include/taler_mhd_lib.h @@ -141,6 +141,20 @@ TALER_MHD_reply_json_pack (struct MHD_Connection *connection, ...); +/** + * Function to call to handle the request by building a JSON + * reply from varargs. + * + * @param connection the MHD connection to handle + * @param response_code HTTP response code to use + * @param ... varargs of JSON pack specification + * @return MHD result code + */ +#define TALER_MHD_REPLY_JSON_PACK(connection,response_code,...) \ + TALER_MHD_reply_json (connection, GNUNET_JSON_PACK (__VA_ARGS__), \ + response_code) + + /** * Send a response indicating an error. * @@ -194,6 +208,16 @@ TALER_MHD_make_json_pack (const char *fmt, ...); +/** + * Make JSON response object. + * + * @param ... varargs + * @return MHD response object + */ +#define TALER_MHD_MAKE_JSON_PACK(...) \ + TALER_MHD_make_json (GNUNET_JSON_PACK (__VA_ARGS__)) + + /** * Create a response indicating an internal error. * -- cgit v1.2.3