aboutsummaryrefslogtreecommitdiff
path: root/src/include/taler_mhd_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <grothoff@gnunet.org>2021-07-28 09:13:21 +0200
committerChristian Grothoff <grothoff@gnunet.org>2021-07-28 09:13:21 +0200
commit6516f1899f4202d802901d08ce26d02db63af83f (patch)
tree561efa3beadc892dd330e1886b902f405564f24b /src/include/taler_mhd_lib.h
parent225543b8001148b8540b92966196ac2d5e9c826e (diff)
start to use new GNUNET_JSON_PACK functionality
Diffstat (limited to 'src/include/taler_mhd_lib.h')
-rw-r--r--src/include/taler_mhd_lib.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/include/taler_mhd_lib.h b/src/include/taler_mhd_lib.h
index 894a701c6..0e30d6600 100644
--- a/src/include/taler_mhd_lib.h
+++ b/src/include/taler_mhd_lib.h
@@ -142,6 +142,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.
*
* @param connection the MHD connection to use
@@ -195,6 +209,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.
*
* @param ec error code to return