/*
  This file is part of TALER
  Copyright (C) 2020-2022, 2026 Taler Systems SA

  TALER is free software; you can redistribute it and/or modify it under the
  terms of the GNU Affero General Public License as published by the Free Software
  Foundation; either version 3, or (at your option) any later version.

  TALER is distributed in the hope that it will be useful, but WITHOUT ANY
  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more details.

  You should have received a copy of the GNU Affero General Public License along with
  TALER; see the file COPYING.  If not, see <http://www.gnu.org/licenses/>
*/
/**
 * @file taler-exchange-httpd_configuration.h
 * @brief helper functions to parse configuration data
 * @author Christian Grothoff
 */
#include "taler/taler_json_lib.h"
#include "taler/taler_mhd_lib.h"
#include "taler-exchange-httpd_responses.h"


#ifndef TALER_EXCHANGE_HTTPD_CONFIGURATION_H
#define TALER_EXCHANGE_HTTPD_CONFIGURATION_H


/**
 * Looks up the AGE_RESTRICTED setting for a denomination in the config and
 * returns the age restriction (mask) accordingly.
 *
 * @param section_name Section in the configuration for the particular
 *    denomination.
 */
struct TALER_AgeMask
TEH_CONFIG_load_age_mask (const char *section_name);


/**
 * Load denomination configuration data, like fees, expiration times (!) and
 * age restriction flags for the denomination type configured in section @a
 * section_name.  Before calling this function, the `start` and
 * `validity_duration` times must already be initialized in @a meta.
 *
 * @param section_name section in the configuration to use
 * @param[in,out] meta denomination type data to complete
 * @return #GNUNET_OK on success
 */
enum GNUNET_GenericReturnValue
TEH_CONFIG_load_denom_data (
  const char *section_name,
  struct TALER_EXCHANGEDB_DenominationKeyMetaData *meta);

#endif
