summaryrefslogtreecommitdiffstats
path: root/parse-xml.c
diff options
context:
space:
mode:
Diffstat (limited to 'parse-xml.c')
-rw-r--r--parse-xml.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/parse-xml.c b/parse-xml.c
index 80cd2021a..f1b439e28 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -1745,7 +1745,7 @@ const char *preprocess_divelog_de(const char *buffer)
return buffer;
}
-void parse_xml_buffer(const char *url, const char *buffer, int size,
+int parse_xml_buffer(const char *url, const char *buffer, int size,
struct dive_table *table, const char **params)
{
xmlDoc *doc;
@@ -1756,10 +1756,9 @@ void parse_xml_buffer(const char *url, const char *buffer, int size,
if (res != buffer)
free((char *)res);
- if (!doc) {
- report_error(translate("gettextFromC", "Failed to parse '%s'"), url);
- return;
- }
+ if (!doc)
+ return report_error(translate("gettextFromC", "Failed to parse '%s'"), url);
+
set_save_userid_local(false);
set_userid("");
reset_all();
@@ -1768,6 +1767,8 @@ void parse_xml_buffer(const char *url, const char *buffer, int size,
traverse(xmlDocGetRootElement(doc));
dive_end();
xmlFreeDoc(doc);
+
+ return 0;
}
void parse_mkvi_buffer(struct membuffer *txt, struct membuffer *csv, const char *starttime)