Lumiera
0.pre.03
»edit your freedom«
|
Go to the source code of this file.
Draft for a configuration system (2008).
Part of this is the implementation of a word list with search and access functions
Definition in file config-wordlist.c.
#include "include/logging.h"
#include "lib/error.h"
#include "lib/tmpbuf.h"
#include "common/config.h"
Functions | |
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. More... | |
int | lumiera_config_wordlist_find (const char *key, const char *value, const char *delims) |
Find the index of a word in a wordlist. More... | |
const char * | lumiera_config_wordlist_get_nth (const char *key, unsigned nth, const char *delims) |
return nth word of a wordlist More... | |
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. More... | |
Variables | |
LumieraConfig | lumiera_global_config |
const char* lumiera_config_wordlist_get_nth | ( | const char * | key, |
unsigned | nth, | ||
const char * | delims | ||
) |
return nth word of a wordlist
Wordlists Wordlists are lists of single words delimited by any of " \t,;".
Definition at line 38 of file config-wordlist.c.
References lumiera_config_wordlist_get().
int lumiera_config_wordlist_find | ( | const char * | key, |
const char * | value, | ||
const char * | delims | ||
) |
Find the index of a word in a wordlist.
key | key under which this wordlist is stored |
value | word to find |
delims | a string literal listing all characters which are treated as delimiters |
Definition at line 65 of file config-wordlist.c.
References lumiera_config_wordlist_get().
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.
Replaces a word with up to two new words. This can be used to delete a word (no replacements), insert a new word before an existing word (giving the new word as subst1 and the old word as subst2) insert a new word after an existing word (giving the old word as subst1 and the new word as subst2) or simply give 2 new words.
key | key under which this wordlist is stored |
value | word to be replaced |
subst1 | first replacement word |
subst2 | second replacement word |
delims | a string literal listing all characters which are treated as delimiters |
Definition at line 88 of file config-wordlist.c.
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.
key | key under which this wordlist is stored |
value | new word to add |
delims | a string literal listing all characters which are treated as delimiters |
Definition at line 143 of file config-wordlist.c.