diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-07-05 20:43:28 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-07-05 20:43:28 +0200 |
commit | 6de49ea2c02e311e5f5366005bd3497a9bb25187 (patch) | |
tree | a221b9c784b4e004eb5972e18516653d1aea6a5c /src/include/taler_util.h | |
parent | e428783e2e0295186dc4eae273df8a3f8b75df60 (diff) | |
parent | ed5b98a2c2308fbd44b906a30286d2689fd304dd (diff) |
Merge branch 'protocolv8'
Diffstat (limited to 'src/include/taler_util.h')
-rw-r--r-- | src/include/taler_util.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/include/taler_util.h b/src/include/taler_util.h index c7bf9c02a..22d7f7f2a 100644 --- a/src/include/taler_util.h +++ b/src/include/taler_util.h @@ -298,4 +298,52 @@ char * TALER_xtalerbank_account_from_payto (const char *payto); +/** + * Possible values for a binary filter. + */ +enum TALER_EXCHANGE_YesNoAll +{ + /** + * If condition is yes. + */ + TALER_EXCHANGE_YNA_YES = 1, + + /** + * If condition is no. + */ + TALER_EXCHANGE_YNA_NO = 2, + + /** + * Condition disabled. + */ + TALER_EXCHANGE_YNA_ALL = 3 +}; + + +/** + * Convert query argument to @a yna value. + * + * @param connection connection to take query argument from + * @param arg argument to try for + * @param default_val value to assign if the argument is not present + * @param[out] value to set + * @return true on success, false if the parameter was malformed + */ +bool +TALER_arg_to_yna (struct MHD_Connection *connection, + const char *arg, + 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 |