exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 6b6814a205077f4c77f8dd42012fccdd12c0df5d
parent 0276abcd9a074e648cf5ca222bb8e681c6a673d7
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun, 14 Jun 2020 15:15:53 +0200

add TALER_yna_to_string()

Diffstat:
Msrc/include/taler_util.h | 11+++++++++++
Msrc/util/yna.c | 22++++++++++++++++++++++
2 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/src/include/taler_util.h b/src/include/taler_util.h @@ -335,4 +335,15 @@ TALER_arg_to_yna (struct MHD_Connection *connection, enum TALER_EXCHANGE_YesNoAll default_val, enum TALER_EXCHANGE_YesNoAll *yna); + +/** + * Convert YNA value to a string. + * + * @param yna value to convert + * @return string representation ("yes"/"no"/"all"). + */ +const char * +TALER_yna_to_string (enum TALER_EXCHANGE_YesNoAll yna); + + #endif diff --git a/src/util/yna.c b/src/util/yna.c @@ -64,3 +64,25 @@ TALER_arg_to_yna (struct MHD_Connection *connection, } return false; } + + +/** + * Convert YNA value to a string. + * + * @param yna value to convert + * @return string representation ("yes"/"no"/"all"). + */ +const char * +TALER_yna_to_string (enum TALER_EXCHANGE_YesNoAll yna) +{ + switch (yna) + { + case TALER_EXCHANGE_YNA_YES: + return "yes"; + case TALER_EXCHANGE_YNA_NO: + return "no"; + case TALER_EXCHANGE_YNA_ALL: + return "all"; + } + GNUNET_assert (0); +}