Lely core libraries
2.2.5
|
Go to the documentation of this file.
22 #ifndef LELY_UTIL_CONFIG_H_
23 #define LELY_UTIL_CONFIG_H_
57 const char *value,
void *data);
59 void *__config_alloc(
void);
60 void __config_free(
void *ptr);
62 void __config_fini(
struct __config *config);
94 const config_t *config,
size_t n,
const char **sections);
125 const config_t *config,
const char *section,
const char *key);
185 const char *end,
struct floc *at);
221 #endif // !LELY_UTIL_CONFIG_H_
const char * config_set(config_t *config, const char *section, const char *key, const char *value)
Sets a key in or removes a key from a configuration struct.
size_t config_get_sections(const config_t *config, size_t n, const char **sections)
Retrieves a list of section names from a configuration struct.
size_t config_print_ini_file(const config_t *config, const char *filename)
Prints a configuration struct to an INI file.
A location in a text file.
size_t config_get_keys(const config_t *config, const char *section, size_t n, const char **keys)
Retrieves a list of key names from a section in a configuration struct.
size_t config_parse_ini_text(config_t *config, const char *begin, const char *end, struct floc *at)
Parses a string in INI-format and adds the keys to a configuration struct.
size_t config_parse_ini_file(config_t *config, const char *filename)
Parses an INI file and adds the keys to a configuration struct.
config_t * config_create(int flags)
Creates a new configuration struct with an unnamed empty root section.
void config_destroy(config_t *config)
Destroys a configuration struct.
size_t config_print_ini_text(const config_t *config, char **pbegin, char *end)
Prints a configuration struct in INI-format to a memory buffer.
void config_foreach(const config_t *config, config_foreach_func_t *func, void *data)
Invokes a function for each key in a configuration struct.
@ CONFIG_CASE
Section and key names are case-insensitive.
void config_foreach_func_t(const char *section, const char *key, const char *value, void *data)
The type of a function called by config_foreach() for each key in a configuration struct.
const char * config_get(const config_t *config, const char *section, const char *key)
Retrieves a key from a configuration struct.