commit 22aa94cd42d9520a4b87bec7ef6d7c9a39cbc3c9
parent b8f4af3c492ba5a4f513ab1a23921c634b7c7ba6
Author: Christian Grothoff <grothoff@gnunet.org>
Date: Mon, 17 Aug 2026 17:27:15 +0200
fix doxygen
Diffstat:
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/src/include/taler/taler_amount_lib.h b/src/include/taler/taler_amount_lib.h
@@ -42,8 +42,9 @@ extern "C"
* represent currency names (i.e. EUR, USD, etc.). We use 8+4 for
* alignment in the `struct TALER_Amount`. The amount is typically an
* ISO 4217 currency code when an alphanumeric 3-digit code is used.
- * For regional currencies, the first character should be a "*" followed
- * by a region-specific name (i.e. "*BRETAGNEFR").
+ * For regional currencies, a longer region-specific name may be used
+ * (i.e. "BRETAGNEFR"); see TALER_check_currency() for the exact
+ * character set allowed.
*/
#define TALER_CURRENCY_LEN 12
@@ -192,7 +193,9 @@ TALER_amount_is_zero (const struct TALER_Amount *amount);
* Test if the given amount is valid.
*
* @param amount amount to check
- * @return #GNUNET_OK if @a amount is valid
+ * @return #GNUNET_OK if @a amount is valid,
+ * #GNUNET_NO if no currency is set,
+ * #GNUNET_SYSERR if the value exceeds #TALER_AMOUNT_MAX_VALUE
*/
enum GNUNET_GenericReturnValue
TALER_amount_is_valid (const struct TALER_Amount *amount);
@@ -365,7 +368,9 @@ enum TALER_AmountArithmeticResult
};
/**
- * Perform saturating subtraction of amounts.
+ * Perform subtraction of amounts. Note that this does *not* saturate:
+ * if @a a2 exceeds @a a1, @a diff is set to "invalid" and
+ * #TALER_AAR_INVALID_NEGATIVE_RESULT is returned.
*
* @param[out] diff where to store (@a a1 - @a a2), or invalid if @a a2 > @a a1
* @param a1 amount to subtract from
@@ -422,9 +427,11 @@ TALER_amount_divide2 (const struct TALER_Amount *dividend,
/**
* Multiply an @a amount by a @ factor.
*
- * @param[out] result where to store @a amount * @a factor
+ * @param[out] result where to store @a amount * @a factor,
+ * set to "invalid" on overflow
* @param amount amount to multiply
* @param factor factor by which to multiply
+ * @return operation status, negative on failures
*/
enum TALER_AmountArithmeticResult
TALER_amount_multiply (struct TALER_Amount *result,