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