summaryrefslogtreecommitdiff
path: root/src/include/taler_util.h
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2023-06-27 18:57:05 +0200
committerÖzgür Kesim <oec-taler@kesim.org>2023-06-27 18:57:05 +0200
commit9c3ddcbc183a9a96f10cdb14f28258ea61f5f7c5 (patch)
treefdf88fe8e5f2af2ff75fb5f67f03ccdf509ef914 /src/include/taler_util.h
parent537206e49f7ccc32551ea894547ee1583ea244ef (diff)
downloadexchange-9c3ddcbc183a9a96f10cdb14f28258ea61f5f7c5.tar.gz
exchange-9c3ddcbc183a9a96f10cdb14f28258ea61f5f7c5.tar.bz2
exchange-9c3ddcbc183a9a96f10cdb14f28258ea61f5f7c5.zip
added TALER_adult_age(struct TALER_AgeMask *mask)
Diffstat (limited to 'src/include/taler_util.h')
-rw-r--r--src/include/taler_util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/include/taler_util.h b/src/include/taler_util.h
index dc30fca31..e0473bff7 100644
--- a/src/include/taler_util.h
+++ b/src/include/taler_util.h
@@ -622,6 +622,14 @@ TALER_get_lowest_age (
const struct TALER_AgeMask *mask,
uint8_t age);
+/* @brief Get the lowest age for the largest age group
+ *
+ * @param mask the age mask
+ * @return lowest age for the largest age group
+ */
+#define TALER_adult_age(mask) \
+ sizeof((mask)->bits) * 8 - __builtin_clz ((mask)->bits) - 1
+
/**
* Handle to an external process that will assist
* with some JSON-to-JSON conversion.