38 LUMIERA_INTERFACE_DEFINE (lumieraorg_configuration, 0,
39 lumieraorg_configuration,
43 LUMIERA_INTERFACE_MAP (load,
45 LUMIERA_INTERFACE_MAP (save,
47 LUMIERA_INTERFACE_MAP (purge,
48 lumiera_config_purge),
49 LUMIERA_INTERFACE_MAP (dump,
51 LUMIERA_INTERFACE_INLINE (setdefault,
52 int, (
const char* line),
55 LUMIERA_INTERFACE_MAP (reset,
56 lumiera_config_reset),
57 LUMIERA_INTERFACE_MAP (info,
60 LUMIERA_INTERFACE_MAP (wordlist_get_nth,
62 LUMIERA_INTERFACE_MAP (wordlist_find,
64 LUMIERA_INTERFACE_INLINE (wordlist_replace,
65 int, (
const char* key,
72 LUMIERA_INTERFACE_INLINE (wordlist_add,
73 int, (
const char* key,
const char* value,
const char* delims),
77 LUMIERA_INTERFACE_INLINE (link_get,
78 int, (
const char* key,
const char** value),
79 {
return !!lumiera_config_link_get (key, value);}
81 LUMIERA_INTERFACE_INLINE (link_set,
82 int, (
const char* key,
const char** value),
83 {
return !!lumiera_config_link_set (key, value);}
86 LUMIERA_INTERFACE_INLINE (number_get,
87 int, (
const char* key,
long long* value),
90 LUMIERA_INTERFACE_INLINE (number_set,
91 int, (
const char* key,
long long* value),
92 {
return !!lumiera_config_number_set (key, value);}
95 LUMIERA_INTERFACE_INLINE (real_get,
96 int, (
const char* key,
long double* value),
99 LUMIERA_INTERFACE_INLINE (real_set,
100 int, (
const char* key,
long double* value),
101 {
return !!lumiera_config_real_set (key, value);}
104 LUMIERA_INTERFACE_INLINE (string_get,
105 int, (
const char* key,
const char** value),
106 {
return !!lumiera_config_string_get (key, value);}
108 LUMIERA_INTERFACE_INLINE (string_set,
109 int, (
const char* key,
const char** value),
110 {
return !!lumiera_config_string_set (key, value);}
113 LUMIERA_INTERFACE_INLINE (wordlist_get,
114 int, (
const char* key,
const char** value),
117 LUMIERA_INTERFACE_INLINE (wordlist_set,
118 int, (
const char* key,
const char** value),
119 {
return !!lumiera_config_wordlist_set (key, value);}
122 LUMIERA_INTERFACE_INLINE (word_get,
123 int, (
const char* key,
const char** value),
124 {
return !!lumiera_config_word_get (key, value);}
126 LUMIERA_INTERFACE_INLINE (word_set,
127 int, (
const char* key,
const char** value),
128 {
return !!lumiera_config_word_set (key, value);}
131 LUMIERA_INTERFACE_INLINE (bool_get,
132 int, (
const char* key,
int* value),
135 LUMIERA_INTERFACE_INLINE (bool_set,
136 int, (
const char* key,
int* value),
137 {
return !!lumiera_config_bool_set (key, value);}
143 #ifndef LUMIERA_PLUGIN 147 lumiera_config_interface_init (
void)
153 lumiera_config_interface_destroy (
void)
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.
LUMIERA_EXPORT(LUMIERA_INTERFACE_DEFINE(lumieraorg_interface, 0, lumieraorg_interface, NULL, NULL, NULL, LUMIERA_INTERFACE_MAP(open, lumiera_interface_open), LUMIERA_INTERFACE_MAP(close, lumiera_interface_close), LUMIERA_INTERFACE_MAP(version, lumiera_interface_version),))
Definition of 'the mother of all interfaces' since this interface is singleton and required for any c...
Interface for a lumiera configuration system (draft).
const char * lumiera_config_real_get(const char *key, long double *value)
Real floating point number in standard formats (see printf/scanf)
#define LUMIERA_INTERFACE_REGISTEREXPORTED
Register all exported interfaces when not a plugin This is a no-op when LUMIERA_PLUGIN is defined...
const char * lumiera_config_bool_get(const char *key, int *value)
Bool Bool in various formats, (0,1(!1), yes/no, true/false, on/off, set/clear)
int lumiera_config_wordlist_find(const char *key, const char *value, const char *delims)
Find the index of a word in a wordlist.
LumieraConfigitem lumiera_config_setdefault(const char *line)
Installs a default value for a config key.
const char * lumiera_config_wordlist_get_nth(const char *key, unsigned nth, const char *delims)
return nth word of a wordlist
Global registry for interfaces (extension points).
#define LUMIERA_INTERFACE_UNREGISTEREXPORTED
Unregister all exported interfaces when not a plugin This is a no-op when LUMIERA_PLUGIN is defined...
const char * lumiera_config_wordlist_get(const char *key, const char **value)
Wordlist words delimited by any of " \t,;".
void lumiera_config_dump(FILE *out)
Does a diagnostic dump of the whole config database.
const char * lumiera_config_number_get(const char *key, long long *value)
Number signed integer numbers, in different formats (decimal, hex, oct, binary(for masks)) ...
External interface to the lumiera configuration system.
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.