diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-09-05 14:44:27 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-09-05 14:44:27 -0700 |
commit | c24fd4b82cf4476c6d9c863ee03f2d729b64e5f0 (patch) | |
tree | e2585459dafdcb544bfc4ff3e91e94a84fc72341 /parse-xml.c | |
parent | 8197d7f4d4702d18df5b2121b5e0126c61e1b7ea (diff) | |
parent | 11becb87505b8cdf6fbf2f10941f87d394e49f80 (diff) | |
download | subsurface-c24fd4b82cf4476c6d9c863ee03f2d729b64e5f0.tar.gz |
Merge branch 'open-files' of git://github.com/nathansamson/diveclog
* 'open-files' of git://github.com/nathansamson/diveclog:
Report errors when opening files
Make it possible to load multiple files at once.
Open File works. I refactored the code and introduced a new type. I never used it as a pointer (their was no real reason), but I'm not really satisfied.
Diffstat (limited to 'parse-xml.c')
-rw-r--r-- | parse-xml.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/parse-xml.c b/parse-xml.c index 8aaeedc9f..90fdb1ad1 100644 --- a/parse-xml.c +++ b/parse-xml.c @@ -1228,13 +1228,20 @@ static void reset_all(void) import_source = UNKNOWN; } -void parse_xml_file(const char *filename) +void parse_xml_file(const char *filename, GError **error) { xmlDoc *doc; doc = xmlReadFile(filename, NULL, 0); if (!doc) { fprintf(stderr, "Failed to parse '%s'.\n", filename); + if (error != NULL) + { + *error = g_error_new(g_quark_from_string("divelog"), + DIVE_ERROR_PARSE, + "Failed to parse '%s'", + filename); + } return; } |