add a diagnostic config dump function

This commit is contained in:
Christian Thaeter 2008-09-05 06:44:42 +02:00
parent 21db988e18
commit fa54fb9bc2
2 changed files with 27 additions and 1 deletions

View file

@ -274,6 +274,25 @@ lumiera_config_setdefault (const char* line)
}
void
lumiera_config_dump (FILE* out)
{
fprintf (out, "# registered defaults:\n");
LLIST_FOREACH (&lumiera_global_config->defaults.childs, node)
fprintf (out, "%s\n", ((LumieraConfigitem) node)->line);
fprintf (out, "# end of defaults\n\n");
#if 0 /*TODO UNIMPLEMENTED */
fprintf (out, "# files:\n");
lumiera_configitem files;
fprintf (out, "# volatiles:")
lumiera_configitem TODO_unknown;
#endif
}
int
lumiera_config_reset (const char* key)
{

View file

@ -55,7 +55,7 @@ LUMIERA_ERROR_DECLARE (CONFIG_DEFAULT);
//TODO: System includes//
#include <nobug.h>
#include <stdio.h>
/**
* @file
@ -153,6 +153,13 @@ int
lumiera_config_purge (const char* filename);
/**
* Does a diagnostic dump of the whole config database
*/
void
lumiera_config_dump (FILE* out);
// * {{{ lumiera_config_get(...) }}}
// * get a value by key
// * handles internally everything as string:string key:value pair.