* @return #GNUNET_OK on success, #GNUNET_SYSERR on error
*/
int
-GNUNET_CONFIGURATION_write_diffs (const struct GNUNET_CONFIGURATION_Handle
- *cfg_default,
- const struct GNUNET_CONFIGURATION_Handle
- *cfg_new, const char *filename);
+GNUNET_CONFIGURATION_write_diffs (const struct GNUNET_CONFIGURATION_Handle *cfg_default,
+ const struct GNUNET_CONFIGURATION_Handle *cfg_new,
+ const char *filename);
/**
* @return configuration with only the differences, never NULL
*/
struct GNUNET_CONFIGURATION_Handle *
-GNUNET_CONFIGURATION_get_diff (const struct GNUNET_CONFIGURATION_Handle
- *cfg_default,
- const struct GNUNET_CONFIGURATION_Handle
- *cfg_new);
+GNUNET_CONFIGURATION_get_diff (const struct GNUNET_CONFIGURATION_Handle *cfg_default,
+ const struct GNUNET_CONFIGURATION_Handle *cfg_new);
/**
* @param option name of the option
* @param value value of the option
*/
-typedef void (*GNUNET_CONFIGURATION_Iterator) (void *cls, const char *section,
- const char *option,
- const char *value);
+typedef void
+(*GNUNET_CONFIGURATION_Iterator) (void *cls,
+ const char *section,
+ const char *option,
+ const char *value);
/**
* @param cls closure
* @param section name of the section
*/
-typedef void (*GNUNET_CONFIGURATION_Section_Iterator) (void *cls,
- const char *section);
+typedef void
+(*GNUNET_CONFIGURATION_Section_Iterator) (void *cls,
+ const char *section);
/**
*
* @param cfg configuration to inspect
* @param iter function to call on each option
- * @param iter_cls closure for iter
+ * @param iter_cls closure for @a iter
*/
void
GNUNET_CONFIGURATION_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg,
*
* @param cfg configuration to inspect
* @param iter function to call on each section
- * @param iter_cls closure for iter
+ * @param iter_cls closure for @a iter
*/
void
-GNUNET_CONFIGURATION_iterate_sections (const struct GNUNET_CONFIGURATION_Handle
- *cfg,
- GNUNET_CONFIGURATION_Section_Iterator
- iter, void *iter_cls);
+GNUNET_CONFIGURATION_iterate_sections (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ GNUNET_CONFIGURATION_Section_Iterator iter,
+ void *iter_cls);
/**
GNUNET_CONFIGURATION_remove_section (struct GNUNET_CONFIGURATION_Handle *cfg,
const char *section);
+
/**
* Get a configuration value that should be a number.
*
* @return #GNUNET_OK on success, #GNUNET_SYSERR on error
*/
int
-GNUNET_CONFIGURATION_get_value_number (const struct GNUNET_CONFIGURATION_Handle
- *cfg, const char *section,
+GNUNET_CONFIGURATION_get_value_number (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *section,
const char *option,
unsigned long long *number);
+/**
+ * Get a configuration value that should be a floating point number.
+ *
+ * @param cfg configuration to inspect
+ * @param section section of interest
+ * @param option option of interest
+ * @param number where to store the floating value of the option
+ * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
+ */
+int
+GNUNET_CONFIGURATION_get_value_float (const struct GNUNET_CONFIGURATION_Handle
+ *cfg, const char *section,
+ const char *option,
+ float *number);
+
+
/**
* Get a configuration value that should be a relative time.
*
* @return #GNUNET_OK on success, #GNUNET_SYSERR on error
*/
int
-GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handle
- *cfg, const char *section,
+GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *section,
const char *option,
struct GNUNET_TIME_Relative *time);
* @return #GNUNET_OK on success, #GNUNET_SYSERR on error
*/
int
-GNUNET_CONFIGURATION_get_value_size (const struct GNUNET_CONFIGURATION_Handle
- *cfg, const char *section,
+GNUNET_CONFIGURATION_get_value_size (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *section,
const char *option,
unsigned long long *size);
*/
int
GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg,
- const char *section, const char *option);
+ const char *section,
+ const char *option);
/**
int
GNUNET_CONFIGURATION_get_value_filename (const struct GNUNET_CONFIGURATION_Handle *cfg,
const char *section,
- const char *option, char **value);
+ const char *option,
+ char **value);
/**
* @return number of filenames iterated over, -1 on error
*/
int
-GNUNET_CONFIGURATION_iterate_value_filenames (const struct
- GNUNET_CONFIGURATION_Handle *cfg,
+GNUNET_CONFIGURATION_iterate_value_filenames (const struct GNUNET_CONFIGURATION_Handle *cfg,
const char *section,
const char *option,
GNUNET_FileNameCallback cb,
* @param iter_cls closure for @a iter
*/
void
-GNUNET_CONFIGURATION_iterate_section_values (const struct
- GNUNET_CONFIGURATION_Handle *cfg,
+GNUNET_CONFIGURATION_iterate_section_values (const struct GNUNET_CONFIGURATION_Handle *cfg,
const char *section,
GNUNET_CONFIGURATION_Iterator iter,
void *iter_cls);
* @return #GNUNET_OK on success, #GNUNET_SYSERR on error
*/
int
-GNUNET_CONFIGURATION_get_value_choice (const struct GNUNET_CONFIGURATION_Handle
- *cfg, const char *section,
- const char *option, const char *const *choices,
+GNUNET_CONFIGURATION_get_value_choice (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *section,
+ const char *option,
+ const char *const *choices,
const char **value);
/**
* @return #GNUNET_YES, #GNUNET_NO or if option has no valid value, #GNUNET_SYSERR
*/
int
-GNUNET_CONFIGURATION_get_value_yesno (const struct GNUNET_CONFIGURATION_Handle
- *cfg, const char *section,
+GNUNET_CONFIGURATION_get_value_yesno (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *section,
const char *option);
* 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 *
-GNUNET_CONFIGURATION_expand_dollar (const struct GNUNET_CONFIGURATION_Handle
- *cfg, char *orig);
+GNUNET_CONFIGURATION_expand_dollar (const struct GNUNET_CONFIGURATION_Handle *cfg,
+ char *orig);
/**
*/
void
GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle *cfg,
- const char *section, const char *option,
+ const char *section,
+ const char *option,
unsigned long long number);
*/
void
GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle *cfg,
- const char *section, const char *option,
+ const char *section,
+ const char *option,
const char *value);
* #GNUNET_SYSERR if the filename is not in the list
*/
int
-GNUNET_CONFIGURATION_remove_value_filename (struct GNUNET_CONFIGURATION_Handle
- *cfg, const char *section,
+GNUNET_CONFIGURATION_remove_value_filename (struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *section,
const char *option,
const char *value);
+
/**
* Append a filename to a configuration value that
* represents a list of filenames
* #GNUNET_SYSERR if the filename already in the list
*/
int
-GNUNET_CONFIGURATION_append_value_filename (struct GNUNET_CONFIGURATION_Handle
- *cfg, const char *section,
+GNUNET_CONFIGURATION_append_value_filename (struct GNUNET_CONFIGURATION_Handle *cfg,
+ const char *section,
const char *option,
const char *value);