33#ifndef COMMON_CONFIG_H
34#define COMMON_CONFIG_H
50#define LUMIERA_CONFIG_KEY_CHARS "abcdefghijklmnopqrstuvwxyz0123456789_."
51#define LUMIERA_CONFIG_ENV_CHARS "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789__"
57 lumiera_config_lookup
keys;
73#define LUMIERA_CONFIG_TYPES \
74 LUMIERA_CONFIG_TYPE(link, const char*) \
75 LUMIERA_CONFIG_TYPE(number, long long) \
76 LUMIERA_CONFIG_TYPE(real, long double) \
77 LUMIERA_CONFIG_TYPE(string, const char*) \
78 LUMIERA_CONFIG_TYPE(wordlist, const char*) \
79 LUMIERA_CONFIG_TYPE(word, const char*) \
80 LUMIERA_CONFIG_TYPE(bool, int)
196#define LUMIERA_CONFIG_TYPE(name, type) \
198 lumiera_config_##name##_get (const char* key, type* value);
200#undef LUMIERA_CONFIG_TYPE
263#define LUMIERA_CONFIG_TYPE(name, type) \
265 lumiera_config_##name##_set (const char* key, type* value);
267#undef LUMIERA_CONFIG_TYPE
Lookup of configuration keys in a low-level configuration system.
int lumiera_config_purge(const char *filename)
#define LUMIERA_CONFIG_TYPES
Supported high level types: TODO documenting.
lumiera_config_lookup keys
void lumiera_config_dump(FILE *out)
Does a diagnostic dump of the whole config database.
const char * lumiera_config_wordlist_replace(const char *key, const char *value, const char *subst1, const char *subst2, const char *delims)
Universal word replacement function.
int lumiera_config_info(const char *key, const char **filename, unsigned *line)
LumieraConfigitem lumiera_config_set(const char *key, const char *delim_value)
int lumiera_config_load(const char *file)
LUMIERA_CONFIG_TYPES const char * lumiera_config_wordlist_get_nth(const char *key, unsigned nth, const char *delims)
Wordlists Wordlists are lists of single words delimited by any of " \t,;".
lumiera_configitem defaults
int lumiera_config_init(const char *path)
Initialise the configuration subsystem.
int lumiera_config_wordlist_find(const char *key, const char *value, const char *delims)
Find the index of a word in a wordlist.
int lumiera_config_save()
LumieraConfigitem lumiera_config_setdefault(const char *line)
Installs a default value for a config key.
lumiera_config * LumieraConfig
const char * lumiera_config_get(const char *key, const char **value)
void lumiera_config_destroy()
Destroys the configuration subsystem.
const char * lumiera_config_wordlist_add(const char *key, const char *value, const char *delims)
Add a word to the end of a wordlist if it doesn't exist already.
LUMIERA_CONFIG_TYPES int lumiera_config_reset(const char *key)
const char * lumiera_config_get_default(const char *key, const char **value)
lumiera_configitem TODO_unknown
Draft for a configuration system (2008).
lumiera_configitem * LumieraConfigitem
Lumiera error handling (C interface).
#define LUMIERA_ERROR_DECLARE(err)
Forward declare an error constant.
Mutual exclusion locking, header.