* @file include/gnunet_configuration_lib.h
* @brief configuration API
* @author Christian Grothoff
- * @defgroup configuration Configuration management
+ * @defgroup configuration Configuration management
* @{
*/
#ifndef GNUNET_CONFIGURATION_LIB_H
#endif
#endif
-#include "gnunet_common.h"
-#include "gnunet_time_lib.h"
-
/**
* A configuration object.
*/
* @return #GNUNET_OK on success, #GNUNET_SYSERR on error
*/
int
-GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Handle
- *cfg, const char *section,
- const char *option, char **value);
+GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *section,
+ const char *option,
+ char **value);
/**
* @return #GNUNET_OK on success, #GNUNET_SYSERR on error
*/
int
-GNUNET_CONFIGURATION_get_value_filename (const struct
- GNUNET_CONFIGURATION_Handle *cfg,
+GNUNET_CONFIGURATION_get_value_filename (const struct GNUNET_CONFIGURATION_Handle *cfg,
const char *section,
const char *option, char **value);
+
/**
* Iterate over the set of filenames stored in a configuration value.
*
int
GNUNET_CONFIGURATION_get_value_choice (const struct GNUNET_CONFIGURATION_Handle
*cfg, const char *section,
- const char *option, const char **choices,
+ const char *option, const char *const *choices,
const char **value);
/**
/**
* Expand an expression of the form "$FOO/BAR" to "DIRECTORY/BAR"
- * where either in the "PATHS" section or the environtment
- * "FOO" is set to "DIRECTORY".
+ * where either in the "PATHS" section or the environtment "FOO" is
+ * set to "DIRECTORY". We also support default expansion,
+ * i.e. ${VARIABLE:-default} will expand to $VARIABLE if VARIABLE is
+ * set in PATHS or the environment, and otherwise to "default". Note
+ * that "default" itself can also be a $-expression, thus
+ * "${VAR1:-{$VAR2}}" will expand to VAR1 and if that is not defined
+ * to VAR2.
*
* @param cfg configuration to use for path expansion
* @param orig string to $-expand (will be freed!)