aboutsummaryrefslogtreecommitdiff
path: root/src/include/taler_mhd_lib.h
diff options
context:
space:
mode:
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