Added functions to settings_t to load files dynamically at runtime.

This commit is contained in:
Tobias Brunner
2010-12-03 17:40:52 +01:00
parent 6388a758ba
commit 0552135213
2 changed files with 157 additions and 28 deletions
+33
View File
@@ -127,6 +127,39 @@ struct settings_t {
enumerator_t* (*create_key_value_enumerator)(settings_t *this,
char *section, ...);
/**
* Load settings from the files matching the given pattern.
*
* Existing sections are extended, existing values replaced, by those found
* in the loaded files.
*
* @note If any of the files matching the pattern fails to load, no settings
* are added at all. So it's all or nothing.
*
* @param pattern file pattern
* @return TRUE, if settings were loaded successfully
*/
bool (*load_files)(settings_t *this, char *pattern);
/**
* Load settings from the files matching the given pattern.
*
* Existing sections are extended, existing values replaced, by those found
* in the loaded files.
*
* All settings are loaded relative to the given section.
*
* @note If any of the files matching the pattern fails to load, no settings
* are added at all. So it's all or nothing.
*
* @param pattern file pattern
* @param section section name of parent section, printf style
* @param ... argument list for section
* @return TRUE, if section is found and settings were loaded successfully
*/
bool (*load_files_section)(settings_t *this, char *pattern,
char *section, ...);
/**
* Destroy a settings instance.
*/