diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2006-01-01 18:52:30 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2006-01-01 18:52:30 +0000 |
commit | cf657a2ffbb9f1ac4c34e2c2348b8d5a4f2193a3 (patch) | |
tree | c0fdd2ea86291fc2f470095571f000b3d727a22c /desktop/options.c | |
parent | e9601cb35a7e266cdb3e46f436bb6e7a132d8755 (diff) | |
download | netsurf-cf657a2ffbb9f1ac4c34e2c2348b8d5a4f2193a3.tar.gz netsurf-cf657a2ffbb9f1ac4c34e2c2348b8d5a4f2193a3.tar.bz2 |
[project @ 2006-01-01 18:52:30 by jmb]
Dump user options to stderr on abort.
Dump box tree on failed assertion.
Display Red/Yellow hourglass whilst dumping box tree (as this can take some time)
svn path=/import/netsurf/; revision=1928
Diffstat (limited to 'desktop/options.c')
-rw-r--r-- | desktop/options.c | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/desktop/options.c b/desktop/options.c index fa2d29cfe..ad8f17042 100644 --- a/desktop/options.c +++ b/desktop/options.c @@ -221,6 +221,36 @@ void options_write(const char *path) fclose(fp); } +/** + * Dump user options to stderr + */ +void options_dump(void) +{ + unsigned int i; + + for (i = 0; i != option_table_entries; i++) { + fprintf(stderr, "%s:", option_table[i].key); + switch (option_table[i].type) { + case OPTION_BOOL: + fprintf(stderr, "%c", + *((bool *) option_table[i].p) ? + '1' : '0'); + break; + + case OPTION_INTEGER: + fprintf(stderr, "%i", + *((int *) option_table[i].p)); + break; + + case OPTION_STRING: + if (*((char **) option_table[i].p)) + fprintf(stderr, "%s", + *((char **) option_table[i].p)); + break; + } + fprintf(stderr, "\n"); + } +} /** * Loads a hotlist as a tree from a specified file. @@ -238,7 +268,7 @@ struct tree *options_load_tree(const char *filename) { warn_user("HotlistLoadError", messages_get("ParsingFail")); return NULL; } - + html = options_find_tree_element((xmlNode *) doc, "html"); body = options_find_tree_element(html, "body"); ul = options_find_tree_element(body, "ul"); @@ -277,7 +307,7 @@ void options_load_tree_directory(xmlNode *ul, struct node *directory) { char *title; struct node *dir; xmlNode *n; - + assert(ul); assert(directory); @@ -350,7 +380,7 @@ void options_load_tree_entry(xmlNode *li, struct node *directory) { "memory exhausted.)"); return; } - + data = url_store_find(url); if (!data) return; |