33 #include <sys/types.h>   106 #define econf_setValue(kf, group, key, value) (( \   108     int: econf_setIntValue, \   109     long: econf_setInt64Value, \   110     unsigned int: econf_setUIntValue, \   111     unsigned long: econf_setUInt64Value, \   112     float: econf_setFloatValue, \   113     double: econf_setDoubleValue, \   114     char*: econf_setStringValue, void*: econf_setStringValue)) \   115 (kf, group, key, value))   123 #define econf_free(value) (( \   125     econf_file*: econf_freeFile , \   126     char**: econf_freeArray)) \   156                                 const char *delim, 
const char *comment);
   199                                             const char *delim, 
const char *comment,
   200                                             bool (*callback)(
const char *filename, 
const void *data),
   201                                             const void *callback_data);
   334                                    const char *usr_subdir,
   335                                    const char *config_name,
   336                                    const char *config_suffix,
   338                                    const char *comment);
   453                                               const char *usr_subdir,
   454                                               const char *config_name,
   455                                               const char *config_suffix,
   458                                               bool (*callback)(
const char *filename, 
const void *data),
   459                                               const void *callback_data);
   496 extern econf_err __attribute__ ((deprecated(
"Use the econf_readConfig/econf_readConfigWithCallback instead")))
   498                const 
char *usr_conf_dir,
   499                const 
char *etc_conf_dir,
   500                const 
char *config_name,
   501                const 
char *config_suffix,
   503                const 
char *comment);
   553                            const 
char *usr_conf_dir,
   554                            const 
char *etc_conf_dir,
   555                            const 
char *config_name,
   556                            const 
char *config_suffix,
   559                            bool (*callback)(const 
char *filename, const 
void *data),
   560                            const 
void *callback_data);
   582                                        const 
char *usr_conf_dir,
   583                                        const 
char *etc_conf_dir,
   584                                        const 
char *config_name,
   585                                        const 
char *config_suffix,
   587                                        const 
char *comment);
   614                                                    const 
char *usr_conf_dir,
   615                                                    const 
char *etc_conf_dir,
   616                                                    const 
char *config_name,
   617                                                    const 
char *config_suffix,
   620                                                    bool (*callback)(const 
char *filename, const 
void *data),
   621                                                    const 
void *callback_data);
   742                                       const 
char *file_name);
 
General syntax error in input file. 
void econf_requireGroup(gid_t group)
All parsed files require this group permission. 
File is a sym link which is not permitted. 
struct econf_file econf_file
void econf_set_comment_tag(econf_file *key_file, const char comment)
Set the comment character tag of the given econf_file object. 
econf_err econf_readDirs(econf_file **key_file, const char *usr_conf_dir, const char *etc_conf_dir, const char *config_name, const char *config_suffix, const char *delim, const char *comment)
Evaluating key/values of a given configuration by reading and merging all needed/available files in t...
econf_err econf_setFloatValue(econf_file *kf, const char *group, const char *key, float value)
Set float value for given group/key. 
char econf_delimiter_tag(econf_file *key_file)
Returns the delimiter character of the given econf_file object. 
econf_err econf_setDoubleValue(econf_file *kf, const char *group, const char *key, double value)
Set double value for given group/key. 
char econf_comment_tag(econf_file *key_file)
Returns the comment character tag of the given econf_file object. 
econf_err econf_getFloatValueDef(econf_file *kf, const char *group, const char *key, float *result, float def)
Evaluating float value for given group/key. 
econf_err econf_readConfig(econf_file **key_file, const char *project, const char *usr_subdir, const char *config_name, const char *config_suffix, const char *delim, const char *comment)
Evaluating key/values of a given configuration by reading and merging all needed/available files from...
void econf_reset_security_settings(void)
Reset all UID, GID, permissions,... 
econf_err econf_getUInt64Value(econf_file *kf, const char *group, const char *key, uint64_t *result)
Evaluating uint64 value for given group/key. 
void econf_errLocation(char **filename, uint64_t *line_nr)
Info about where the error has happened. 
void econf_requirePermissions(mode_t file_perms, mode_t dir_perms)
All parsed file have to have these file and directory permissions. 
char * econf_getPath(econf_file *kf)
Evaluating path name. 
econf_err econf_readDirsHistory(econf_file ***key_files, size_t *size, const char *usr_conf_dir, const char *etc_conf_dir, const char *config_name, const char *config_suffix, const char *delim, const char *comment)
Evaluating key/values for every given configuration files in two different directories (normally in /...
econf_err econf_getUInt64ValueDef(econf_file *kf, const char *group, const char *key, uint64_t *result, uint64_t def)
Evaluating uint64 value for given group/key. 
econf_err econf_getUIntValue(econf_file *kf, const char *group, const char *key, uint32_t *result)
Evaluating uint32 value for given group/key. 
void econf_requireOwner(uid_t owner)
All parsed files require this user permission. 
void econf_freeArray(char **array)
Free an array of type char** created by econf_getGroups() or econf_getKeys(). 
void econf_freeFile(econf_file *key_file)
Free memory allocated by e.g. 
Value cannot be converted. 
econf_err econf_getBoolValue(econf_file *kf, const char *group, const char *key, bool *result)
Evaluating bool value for given group/key. 
econf_err econf_getGroups(econf_file *kf, size_t *length, char ***groups)
Evaluating all group entries. 
econf_err econf_getInt64ValueDef(econf_file *kf, const char *group, const char *key, int64_t *result, int64_t def)
Evaluating int64 value for given group/key. 
econf_err econf_getDoubleValueDef(econf_file *kf, const char *group, const char *key, double *result, double def)
Evaluating double value for given group/key. 
File has wrong dir permission. 
Given key has NULL value. 
econf_err econf_getStringValue(econf_file *kf, const char *group, const char *key, char **result)
Evaluating string value for given group/key. 
Key is NULL or has empty value. 
econf_err econf_getKeys(econf_file *kf, const char *group, size_t *length, char ***keys)
Evaluating all keys. 
econf_err econf_getFloatValue(econf_file *kf, const char *group, const char *key, float *result)
Evaluating float value for given group/key. 
File has wrong file permissions. 
econf_err econf_readFileWithCallback(econf_file **result, const char *file_name, const char *delim, const char *comment, bool(*callback)(const char *filename, const void *data), const void *callback_data)
Process the file of the given file_name and save its contents into key_file object. 
econf_err econf_getStringValueDef(econf_file *kf, const char *group, const char *key, char **result, char *def)
Evaluating string value for given group/key. 
econf_err econf_writeFile(econf_file *key_file, const char *save_to_dir, const char *file_name)
Write content of an econf_file struct to specified location. 
econf_err econf_setInt64Value(econf_file *kf, const char *group, const char *key, int64_t value)
Set int64 value for given group/key. 
Parsed file list is NULL. 
General purpose success code. 
econf_err econf_getInt64Value(econf_file *kf, const char *group, const char *key, int64_t *result)
Evaluating int64 value for given group/key. 
econf_err econf_setUIntValue(econf_file *kf, const char *group, const char *key, uint32_t value)
Set uint32 value for given group/key. 
econf_err econf_setStringValue(econf_file *kf, const char *group, const char *key, const char *value)
Set string value for given group/key. 
econf_err econf_newKeyFile(econf_file **result, char delimiter, char comment)
Create a new econf_file object. 
econf_err econf_setUInt64Value(econf_file *kf, const char *group, const char *key, uint64_t value)
Set uint64 value for given group/key. 
econf_err econf_getUIntValueDef(econf_file *kf, const char *group, const char *key, uint32_t *result, uint32_t def)
Evaluating uint32 value for given group/key. 
econf_err econf_readDirsHistoryWithCallback(econf_file ***key_files, size_t *size, const char *usr_conf_dir, const char *etc_conf_dir, const char *config_name, const char *config_suffix, const char *delim, const char *comment, bool(*callback)(const char *filename, const void *data), const void *callback_data)
Evaluating key/values for every given configuration files in two different directories (normally in /...
User defined parsing callback has failed. 
econf_err econf_newKeyFile_with_options(econf_file **result, const char *options)
Create a new econf_file object with special options. 
econf_err econf_setBoolValue(econf_file *kf, const char *group, const char *key, const char *value)
Set bool value for given group/key. 
econf_err econf_getIntValueDef(econf_file *kf, const char *group, const char *key, int32_t *result, int32_t def)
Evaluating int32 value for given group/key. 
void econf_set_delimiter_tag(econf_file *key_file, const char delimiter)
Set the delimiter character of the given econf_file object. 
Wrong boolean value (1/0 true/false yes/no) 
econf_err econf_readConfigWithCallback(econf_file **key_file, const char *project, const char *usr_subdir, const char *config_name, const char *config_suffix, const char *delim, const char *comment, bool(*callback)(const char *filename, const void *data), const void *callback_data)
Evaluating key/values of a given configuration by reading and merging all needed/available files from...
econf_err econf_getBoolValueDef(econf_file *kf, const char *group, const char *key, bool *result, bool def)
Evaluating bool value for given group/key. 
econf_err econf_readFile(econf_file **result, const char *file_name, const char *delim, const char *comment)
Process the file of the given file_name and save its contents into key_file object. 
econf_err econf_newIniFile(econf_file **result)
Create a new econf_file object in IniFile format. 
econf_err econf_set_conf_dirs(const char **dir_postfix_list)
Set a list of directory structures (with order) which describes the directories in which the files h...
Missing closing section bracket. 
const char * econf_errString(const econf_err error)
Convert an econf_err type to a string. 
econf_err
libeconf error codes 
econf_err econf_getIntValue(econf_file *kf, const char *group, const char *key, int32_t *result)
Evaluating int32 value for given group/key. 
econf_err econf_mergeFiles(econf_file **merged_file, econf_file *usr_file, econf_file *etc_file)
Merge the contents of two key_files objects. 
void econf_followSymlinks(bool allow)
Allowing the parser to follow sym links (default: true). 
econf_err econf_getDoubleValue(econf_file *kf, const char *group, const char *key, double *result)
Evaluating double value for given group/key. 
econf_err econf_readDirsWithCallback(econf_file **key_file, const char *usr_conf_dir, const char *etc_conf_dir, const char *config_name, const char *config_suffix, const char *delim, const char *comment, bool(*callback)(const char *filename, const void *data), const void *callback_data)
Evaluating key/values for every given configuration files in two different directories (normally in /...
econf_err econf_setIntValue(econf_file *kf, const char *group, const char *key, int32_t value)
Set int32 value for given group/key. 
Error creating or writing to a file.