From 9c3ddcbc183a9a96f10cdb14f28258ea61f5f7c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96zg=C3=BCr=20Kesim?= Date: Tue, 27 Jun 2023 18:57:05 +0200 Subject: added TALER_adult_age(struct TALER_AgeMask *mask) --- src/include/taler_util.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/include/taler_util.h') 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. -- cgit v1.2.3