summaryrefslogtreecommitdiff
path: root/src/include/taler_mhd_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-09-18 22:11:28 +0200
committerChristian Grothoff <christian@grothoff.org>2023-09-18 22:11:28 +0200
commitdfe576f9379954ab8164da7521bef930d3af3948 (patch)
treeb7fffe7cfc8767df6b672ccfd08614b550352f1c /src/include/taler_mhd_lib.h
parent12cff1b4439ab5dcc26fcf79e19518ae1bdce069 (diff)
downloadexchange-dfe576f9379954ab8164da7521bef930d3af3948.tar.gz
exchange-dfe576f9379954ab8164da7521bef930d3af3948.tar.bz2
exchange-dfe576f9379954ab8164da7521bef930d3af3948.zip
more work on new history logic
Diffstat (limited to 'src/include/taler_mhd_lib.h')
-rw-r--r--src/include/taler_mhd_lib.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/include/taler_mhd_lib.h b/src/include/taler_mhd_lib.h
index e4aa916e7..60c5b209d 100644
--- a/src/include/taler_mhd_lib.h
+++ b/src/include/taler_mhd_lib.h
@@ -477,6 +477,50 @@ TALER_MHD_parse_request_arg_timeout (struct MHD_Connection *connection,
/**
+ * Extract optional numeric limit argument from request.
+ *
+ * @param connection the MHD connection
+ * @param name name of the query parameter
+ * @param[out] off set to the offet, unchanged if the
+ * option was not given
+ * @return #GNUNET_OK on success,
+ * #GNUNET_NO if an error was returned on @a connection (caller should return #MHD_YES) and
+ * #GNUNET_SYSERR if we failed to return an error (caller should return #MHD_NO)
+ */
+enum GNUNET_GenericReturnValue
+TALER_MHD_parse_request_arg_number (struct MHD_Connection *connection,
+ const char *name,
+ uint64_t *off);
+
+
+/**
+ * Extract optional numeric argument from request.
+ * Macro that *returns* #MHD_YES/#MHD_NO if the
+ * requested argument existed but failed to parse.
+ *
+ * @param connection the MHD connection
+ * @param name name of the argument to parse
+ * @param[out] off set to the given numeric value,
+ * unchanged if value was not specified
+ */
+#define TALER_MHD_parse_request_number(connection,name,off) \
+ do { \
+ switch (TALER_MHD_parse_request_arg_number (connection, \
+ name, \
+ off)) \
+ { \
+ case GNUNET_SYSERR: \
+ GNUNET_break (0); \
+ return MHD_NO; \
+ case GNUNET_NO: \
+ GNUNET_break_op (0); \
+ case GNUNET_OK: \
+ break; \
+ } \
+ } while (0)
+
+
+/**
* Extract fixed-size base32crockford encoded data from request argument.
*
* Queues an error response to the connection if the parameter is missing or