![]() |
Lumiera 0.pre.04
»edit your freedom«
|
Draft for a configuration system (2008). More...
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_get_nth (const char *key, unsigned nth, const char *delims) |
| return nth word of a wordlist | |
| int | lumiera_config_wordlist_find (const char *key, const char *value, const char *delims) |
| Find the index of a word in a wordlist. | |
| 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. | |
| 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. | |
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(), lumiera_tmpbuf_strndup(), and NULL.
Referenced by lumiera_plugin_discover(), and TEST().
Here is the call graph for this function:
Here is the caller graph for this function:| 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().
Referenced by TEST().
Here is the call graph for this function:
Here is the caller graph for this function:| 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.
References lumiera_config_get(), lumiera_config_set(), lumiera_global_config, LUMIERA_MUTEX_SECTION, lumiera_tmpbuf_snprintf(), and NULL.
Referenced by TEST().
Here is the call graph for this function:
Here is the caller graph for this function:| 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.
References lumiera_config_get(), lumiera_config_set(), lumiera_global_config, LUMIERA_MUTEX_SECTION, lumiera_tmpbuf_snprintf(), and NULL.
Referenced by TEST().
Here is the call graph for this function:
Here is the caller graph for this function:
|
extern |
Definition at line 73 of file config.c.
Referenced by lumiera_config_destroy(), lumiera_config_dump(), lumiera_config_get(), lumiera_config_get_default(), lumiera_config_init(), lumiera_config_set(), lumiera_config_setdefault(), lumiera_config_wordlist_add(), and lumiera_config_wordlist_replace().