10 #ifndef FOSSCONFIG_H_INCLUDE
11 #define FOSSCONFIG_H_INCLUDE
17 #define RETRIEVE_ERROR 2
54 char*
trim(
char* ptext);
fo_conf * conf
The loaded configuration data.
char * fo_config_get_list(fo_conf *conf, char *group, char *key, int idx, GError **error)
int fo_config_list_length(fo_conf *conf, char *group, char *key, GError **error)
Gets the length of the list associated with a particular list key.
char * trim(char *ptext)
Trimming whitespace.
void fo_config_free(fo_conf *conf)
Frees the memory associated with the internal configuration data structures.
fo_conf * fo_config_load(char *fname, GError **error)
Load the configuration information from the provided file.
char ** fo_config_group_set(fo_conf *conf, int *length)
Gets the set of group names.
char * fo_config_get(fo_conf *conf, const char *group, const char *key, GError **error)
Gets an element based on its group name and key name. If the group or key is not found,...
@ fo_load_config
Unable to load config.
@ fo_missing_key
Required key is missing.
@ fo_invalid_join
Join is invalid.
@ fo_invalid_file
File is invalid.
@ fo_missing_file
File is missing.
@ fo_invalid_group
Requested group is invalid.
@ fo_missing_group
Required group is missing.
@ fo_invalid_key
Requested key is invalid.
int fo_config_has_group(fo_conf *conf, char *group)
Checks if the currently parsed configuration file has a specific group.
int fo_config_is_list(fo_conf *conf, char *group, char *key, GError **error)
Checks if a particular value is a list or just a normal value.
void fo_config_join(fo_conf *dst, fo_conf *src, GError **error)
Takes all groups and key from a fo_conf and adds them to another.
char ** fo_config_key_set(fo_conf *conf, char *group, int *length)
Gets the set of key names for a particular group.
int fo_config_has_key(fo_conf *conf, char *group, char *key)
Checks if the a specific group in the currently parsed configuration file has a specific key.
char ** group_set
Array of groups.
int n_groups
Number of groups.
GTree * group_map
Tree of groups in conf file.
GTree * key_sets
Tree of sets of keys.