summaryrefslogtreecommitdiff
path: root/src/include/taler_util.h
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2023-06-26 00:01:31 +0200
committerÖzgür Kesim <oec-taler@kesim.org>2023-06-26 00:01:31 +0200
commitddedf03a816e5139b235a3ebdf5b600508c5ed5f (patch)
treea65179048fc764ec82ddf645a8982186b0157448 /src/include/taler_util.h
parent70bfe0ed1b9a5dbb6cc487465ef3c3df4cdb0436 (diff)
downloadexchange-ddedf03a816e5139b235a3ebdf5b600508c5ed5f.tar.gz
exchange-ddedf03a816e5139b235a3ebdf5b600508c5ed5f.tar.bz2
exchange-ddedf03a816e5139b235a3ebdf5b600508c5ed5f.zip
[age-withdraw] age-withdraw commit- and reveal-handlers implemented, 12/n
The handlers for the commit- and reveal-phases of the age-withdraw HTTP-endpoints are implemented, yet not active. Still missing: - support for age-withdraw is missing in lib/. - tests
Diffstat (limited to 'src/include/taler_util.h')
-rw-r--r--src/include/taler_util.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/include/taler_util.h b/src/include/taler_util.h
index 1de264c12..1f3a4c706 100644
--- a/src/include/taler_util.h
+++ b/src/include/taler_util.h
@@ -558,6 +558,18 @@ char *
TALER_age_mask_to_string (
const struct TALER_AgeMask *mask);
+/*
+ * @brief returns the age group of a given age for a given age mask
+ *
+ * @param mask Age mask
+ * @param age The given age
+ * @return age group
+ */
+uint8_t
+TALER_get_age_group (
+ const struct TALER_AgeMask *mask,
+ uint8_t age);
+
/**
* @brief Parses a JSON object { "age_groups": "a:b:...y:z" }.
*
@@ -570,6 +582,18 @@ TALER_JSON_parse_age_groups (const json_t *root,
struct TALER_AgeMask *mask);
+/* @brief Return the lowest age in the corresponding group for a given age
+ * according the given age mask.
+ *
+ * @param[IN] mask age mask
+ * @param[IN] age age to check
+ * @return lowest age in corresponding age group
+ */
+uint8_t
+TALER_get_lowest_age (
+ const struct TALER_AgeMask *mask,
+ uint8_t age);
+
/**
* Handle to an external process that will assist
* with some JSON-to-JSON conversion.