diff options
Diffstat (limited to 'src/include/taler_extensions.h')
-rw-r--r-- | src/include/taler_extensions.h | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/src/include/taler_extensions.h b/src/include/taler_extensions.h index a37a7461a..1eb567f72 100644 --- a/src/include/taler_extensions.h +++ b/src/include/taler_extensions.h @@ -22,7 +22,7 @@ #define TALER_EXTENSIONS_H #include <gnunet/gnunet_util_lib.h> -#include "taler_crypto_lib.h" +#include "taler_util.h" #include "taler_json_lib.h" #include "taler_mhd_lib.h" #include "taler_extensions_policy.h" @@ -128,13 +128,13 @@ struct TALER_Extension * @brief Handler to read an extension-specific configuration in JSON * encoding and enable the extension. Must be implemented by the extension. * - * @param ext The extension object. If NULL, the configuration will only be checked. - * @param config A JSON blob + * @param[in] ext The extension object. If NULL, the configuration will only be checked. + * @param[in,out] config A JSON blob * @return GNUNET_OK if the json was a valid configuration for the extension. */ enum GNUNET_GenericReturnValue (*load_config)( - struct TALER_Extension *ext, - json_t *config); + const json_t *config, + struct TALER_Extension *ext); /** * @brief Handler to return the manifest of the extension in JSON encoding. @@ -162,6 +162,7 @@ struct TALER_Extension * (see https://docs.taler.net/core/api-exchange.html#deposit), this handler * will be called before the deposit transaction. * + * @param[in] currency Currency used in the exchange * @param[in] policy_json Details about the policy, provided by the client * during a deposit request. * @param[out] details On success, will contain the details to the policy, @@ -170,6 +171,7 @@ struct TALER_Extension * @return GNUNET_OK if the data was accepted by the extension. */ enum GNUNET_GenericReturnValue (*create_policy_details)( + const char *currency, const json_t *policy_json, struct TALER_PolicyDetails *details, const char **error_hint); @@ -219,12 +221,12 @@ struct TALER_Extensions * Generic functions for extensions */ -/* +/** * @brief Loads the extensions as shared libraries, as specified in the given * TALER configuration. * * @param cfg Handle to the TALER configuration - * @return GNUNET_OK on success, GNUNET_SYSERR if unknown extensions were found + * @return #GNUNET_OK on success, #GNUNET_SYSERR if unknown extensions were found * or any particular configuration couldn't be parsed. */ enum GNUNET_GenericReturnValue @@ -259,13 +261,13 @@ TALER_extensions_parse_manifest ( */ enum GNUNET_GenericReturnValue TALER_extensions_load_manifests ( - json_t *manifests); + const json_t *manifests); /* * @brief Returns the head of the linked list of extensions. */ const struct TALER_Extensions * -TALER_extensions_get_head (); +TALER_extensions_get_head (void); /** * @brief Finds and returns a supported extension by a given type. @@ -323,7 +325,7 @@ TALER_extensions_is_enabled ( */ enum GNUNET_GenericReturnValue TALER_extensions_verify_manifests_signature ( - json_t *manifests, + const json_t *manifests, struct TALER_MasterSignatureP *extensions_sig, struct TALER_MasterPublicKeyP *master_pub); @@ -344,10 +346,6 @@ TALER_extensions_verify_manifests_signature ( * The default age mask represents the age groups * 0-7, 8-9, 10-11, 12-13, 14-15, 16-17, 18-20, 21-... */ -#define TALER_EXTENSION_AGE_RESTRICTION_DEFAULT_AGE_MASK (1 | 1 << 8 | 1 << 10 \ - | 1 << 12 | 1 << 14 \ - | 1 << 16 | 1 << 18 \ - | 1 << 21) #define TALER_EXTENSION_AGE_RESTRICTION_DEFAULT_AGE_GROUPS "8:10:12:14:16:18:21" @@ -367,7 +365,7 @@ struct TALER_AgeRestrictionConfig * @return age restriction configuration if present, otherwise NULL. */ const struct TALER_AgeRestrictionConfig * -TALER_extensions_get_age_restriction_config (); +TALER_extensions_get_age_restriction_config (void); /** * @brief Check if age restriction is enabled @@ -375,7 +373,7 @@ TALER_extensions_get_age_restriction_config (); * @return true, if age restriction is loaded, configured and enabled; otherwise false. */ bool -TALER_extensions_is_age_restriction_enabled (); +TALER_extensions_is_age_restriction_enabled (void); /** * @brief Return the age mask for age restriction @@ -383,6 +381,6 @@ TALER_extensions_is_age_restriction_enabled (); * @return configured age mask, if age restriction is loaded, configured and enabled; otherwise zero mask. */ struct TALER_AgeMask -TALER_extensions_get_age_restriction_mask (); +TALER_extensions_get_age_restriction_mask (void); #endif |