-remove trailing whitespace
[oweals/gnunet.git] / src / include / gnunet_configuration_lib.h
index 5ef58bf95aef715e058c790dd86c2b69d3f74f82..e736bdeb01ef5928c7a5ce1f165d1a9229078fd1 100644 (file)
@@ -4,7 +4,7 @@
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
-     by the Free Software Foundation; either version 2, or (at your
+     by the Free Software Foundation; either version 3, or (at your
      option) any later version.
 
      GNUnet is distributed in the hope that it will be useful, but
@@ -22,7 +22,7 @@
  * @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
@@ -37,9 +37,6 @@ extern "C"
 #endif
 #endif
 
-#include "gnunet_common.h"
-#include "gnunet_time_lib.h"
-
 /**
  * A configuration object.
  */
@@ -157,30 +154,30 @@ GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg,
 
 /**
  * Write only configuration entries that have been changed to configuration file
- * @param cfgDefault default configuration
- * @param cfgNew new configuration
+ * @param cfg_default default configuration
+ * @param cfg_new new configuration
  * @param filename where to write the configuration diff between default and new
  * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
  */
 int
 GNUNET_CONFIGURATION_write_diffs (const struct GNUNET_CONFIGURATION_Handle
-                                  *cfgDefault,
+                                  *cfg_default,
                                   const struct GNUNET_CONFIGURATION_Handle
-                                  *cfgNew, const char *filename);
+                                  *cfg_new, const char *filename);
 
 
 /**
  * Compute configuration with only entries that have been changed
  *
- * @param cfgDefault original configuration
- * @param cfgNew new configuration
+ * @param cfg_default original configuration
+ * @param cfg_new new configuration
  * @return configuration with only the differences, never NULL
  */
 struct GNUNET_CONFIGURATION_Handle *
 GNUNET_CONFIGURATION_get_diff (const struct GNUNET_CONFIGURATION_Handle
-                              *cfgDefault,
+                              *cfg_default,
                               const struct GNUNET_CONFIGURATION_Handle
-                              *cfgNew);
+                              *cfg_new);
 
 
 /**
@@ -327,9 +324,10 @@ GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg,
  * @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);
 
 
 /**
@@ -344,11 +342,11 @@ GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Handle
  * @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.
  *
@@ -397,7 +395,7 @@ GNUNET_CONFIGURATION_iterate_section_values (const struct
 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);
 
 /**
@@ -417,11 +415,18 @@ GNUNET_CONFIGURATION_get_value_yesno (const struct GNUNET_CONFIGURATION_Handle
 
 /**
  * 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!)
+ * @param orig string to $-expand (will be freed!)  Note that multiple
+ *          $-expressions can be present in this string.  They will all be
+ *          $-expanded.
  * @return $-expanded string
  */
 char *