add long-time overdue convenience function
This commit is contained in:
parent
896bb8f074
commit
bf2ce9853e
@ -160,6 +160,17 @@ TALER_amount_set_zero (const char *cur,
|
|||||||
struct TALER_Amount *amount);
|
struct TALER_Amount *amount);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test if the given @a amount is zero.
|
||||||
|
*
|
||||||
|
* @param amount amount to compare to zero
|
||||||
|
* @return true if the amount is zero,
|
||||||
|
* false if it is non-zero or invalid
|
||||||
|
*/
|
||||||
|
bool
|
||||||
|
TALER_amount_is_zero (const struct TALER_Amount *amount);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test if the given amount is valid.
|
* Test if the given amount is valid.
|
||||||
*
|
*
|
||||||
|
@ -241,6 +241,18 @@ TALER_amount_is_valid (const struct TALER_Amount *amount)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
TALER_amount_is_zero (const struct TALER_Amount *amount)
|
||||||
|
{
|
||||||
|
if (GNUNET_OK !=
|
||||||
|
TALER_amount_is_valid (amount))
|
||||||
|
return false;
|
||||||
|
return
|
||||||
|
(0 == amount->value) &&
|
||||||
|
(0 == amount->fraction);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test if @a a is valid, NBO variant.
|
* Test if @a a is valid, NBO variant.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user