Configuration API. More...
Go to the source code of this file.
Data Structures | |
struct | GNUNET_CONFIGURATION_ConfigSettings |
Closure for GNUNET_CONFIGURATION_config_tool_run() with settings for what should be done with the configuration. More... | |
Macros | |
#define | GNUNET_CONFIGURATION_CONFIG_OPTIONS(cs) |
Macro that expands to a set of GNUNET-getopt directives to initialize a struct GNUNET_CONFIGURATION_ConfigSettings from the command line. More... | |
Typedefs | |
typedef enum GNUNET_GenericReturnValue(* | GNUNET_CONFIGURATION_Callback) (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg) |
Signature of a function to be run with a configuration. More... | |
typedef void(* | GNUNET_CONFIGURATION_Iterator) (void *cls, const char *section, const char *option, const char *value) |
Function to iterate over options. More... | |
typedef void(* | GNUNET_CONFIGURATION_SectionIterator) (void *cls, const char *section) |
Function to iterate over section. More... | |
Functions | |
struct GNUNET_CONFIGURATION_Handle * | GNUNET_CONFIGURATION_create (const struct GNUNET_OS_ProjectData *pd) |
Create a new configuration object. More... | |
struct GNUNET_CONFIGURATION_Handle * | GNUNET_CONFIGURATION_dup (const struct GNUNET_CONFIGURATION_Handle *cfg) |
Duplicate an existing configuration object. More... | |
void | GNUNET_CONFIGURATION_destroy (struct GNUNET_CONFIGURATION_Handle *cfg) |
Destroy configuration object. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg, const char *filename) |
Load configuration. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_load_from (struct GNUNET_CONFIGURATION_Handle *cfg, const char *defaults_d) |
Load default configuration. More... | |
char * | GNUNET_CONFIGURATION_default_filename (const struct GNUNET_OS_ProjectData *pd) |
Return the filename of the default configuration filename that is used when no explicit configuration entry point has been specified. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg, const char *filename) |
Parse a configuration file, add all of the options in the file to the configuration environment. More... | |
char * | GNUNET_CONFIGURATION_serialize (const struct GNUNET_CONFIGURATION_Handle *cfg, size_t *size) |
Serializes the given configuration. More... | |
char * | GNUNET_CONFIGURATION_serialize_diagnostics (const struct GNUNET_CONFIGURATION_Handle *cfg) |
Serializes the given configuration with diagnostics information. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_deserialize (struct GNUNET_CONFIGURATION_Handle *cfg, const char *mem, size_t size, const char *source_filename) |
De-serializes configuration. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg, const char *filename) |
Write configuration file. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_write_diffs (const struct GNUNET_CONFIGURATION_Handle *cfg_default, const struct GNUNET_CONFIGURATION_Handle *cfg_new, const char *filename) |
Write only configuration entries that have been changed to configuration file. More... | |
struct GNUNET_CONFIGURATION_Handle * | GNUNET_CONFIGURATION_get_diff (const struct GNUNET_CONFIGURATION_Handle *cfg_default, const struct GNUNET_CONFIGURATION_Handle *cfg_new) |
Compute configuration with only entries that have been changed. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle *cfg) |
Test if there are configuration options that were changed since the last save. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_parse_and_run (const struct GNUNET_OS_ProjectData *pd, const char *filename, GNUNET_CONFIGURATION_Callback cb, void *cb_cls) |
Parse a configuration file filename and run the function cb with the resulting configuration object. More... | |
void | GNUNET_CONFIGURATION_enable_diagnostics (struct GNUNET_CONFIGURATION_Handle *cfg) |
Enable extra diagnostics. More... | |
const struct GNUNET_OS_ProjectData * | GNUNET_CONFIGURATION_get_project_data (const struct GNUNET_CONFIGURATION_Handle *cfg) |
Return the project data associated with this configuration. More... | |
void | GNUNET_CONFIGURATION_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_CONFIGURATION_Iterator iter, void *iter_cls) |
Iterate over all options in the configuration. More... | |
void | GNUNET_CONFIGURATION_iterate_sections (const struct GNUNET_CONFIGURATION_Handle *cfg, GNUNET_CONFIGURATION_SectionIterator iter, void *iter_cls) |
Iterate over all sections in the configuration. More... | |
void | GNUNET_CONFIGURATION_remove_section (struct GNUNET_CONFIGURATION_Handle *cfg, const char *section) |
Remove the given section and all options in it. More... | |
enum GNUNET_GenericReturnValue | 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 number. More... | |
enum GNUNET_GenericReturnValue | 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 floating point number. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, struct GNUNET_TIME_Relative *time) |
Get a configuration value that should be a relative time. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_get_value_size (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, unsigned long long *size) |
Get a configuration value that should be a size in bytes. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option) |
Test if we have a value for a particular option. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value) |
Get a configuration value that should be a string. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_get_value_filename (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, char **value) |
Get a configuration value that should be the name of a file or directory. More... | |
int | GNUNET_CONFIGURATION_iterate_value_filenames (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, GNUNET_FileNameCallback cb, void *cb_cls) |
Iterate over the set of filenames stored in a configuration value. More... | |
void | GNUNET_CONFIGURATION_iterate_section_values (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, GNUNET_CONFIGURATION_Iterator iter, void *iter_cls) |
Iterate over values of a section in the configuration. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_get_value_choice (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, const char *const *choices, const char **value) |
Get a configuration value that should be in a set of predefined strings. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_get_value_yesno (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option) |
Get a configuration value that should be in a set of "YES" or "NO". More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_get_data (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, void *buf, size_t buf_size) |
Get Crockford32-encoded fixed-size binary data from a configuration. More... | |
char * | GNUNET_CONFIGURATION_expand_dollar (const struct GNUNET_CONFIGURATION_Handle *cfg, char *orig) |
Expand an expression of the form "$FOO/BAR" to "DIRECTORY/BAR" where either in the "PATHS" section or the environment "FOO" is set to "DIRECTORY". More... | |
void | GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, unsigned long long number) |
Set a configuration value that should be a number. More... | |
void | GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, const char *value) |
Set a configuration value that should be a string. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_remove_value_filename (struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, const char *option, const char *value) |
Remove a filename from a configuration value that represents a list of filenames. More... | |
enum GNUNET_GenericReturnValue | GNUNET_CONFIGURATION_append_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. More... | |
void | GNUNET_CONFIGURATION_config_settings_free (struct GNUNET_CONFIGURATION_ConfigSettings *cs) |
Free resources associated with cs. More... | |
void | GNUNET_CONFIGURATION_config_tool_run (void *cls, char *const *args, const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg) |
Main task to run to perform operations typical for gnunet-config as per the configuration settings given in cls. More... | |
Configuration API.
Definition in file gnunet_configuration_lib.h.