diff options
author | joe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845> | 2004-10-17 13:06:00 +0000 |
---|---|---|
committer | joe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845> | 2004-10-17 13:06:00 +0000 |
commit | d01dd904918f1628e2708b5dc7595089cc688bc0 (patch) | |
tree | 5f055655de6ec0f568c5b5f4769a62e7cb9e6b03 /src/ne_xml.h | |
parent | 3aa536fc208b12a335be934350b2d5c7b17a6d22 (diff) | |
download | neon-d01dd904918f1628e2708b5dc7595089cc688bc0.tar.gz |
* src/ne_xml.h (ne_xml_parse): Returns an error if parsing fails.
(ne_xml_failed): Redefine in terms of ne_xml_parse return value.
* src/ne_xml.c (ne_xml_parse): Return p->failure. (ne_xml_parse_v):
Pass through return value from ne_xml_parse.
* test/xml.c (parse_match): Check ne_xml_parse() return value; handle
match_chunked test mode.
(matches): Test for UTF-8 BOM handling in chunked mode.
git-svn-id: http://svn.webdav.org/repos/projects/neon/trunk@315 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
Diffstat (limited to 'src/ne_xml.h')
-rw-r--r-- | src/ne_xml.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/ne_xml.h b/src/ne_xml.h index 1062ac5..50b350a 100644 --- a/src/ne_xml.h +++ b/src/ne_xml.h @@ -87,10 +87,9 @@ void ne_xml_push_handler(ne_xml_parser *p, void *userdata); /* ne_xml_failed returns non-zero if there was an error during - * parsing, or zero if the parse completed successfully. If a handler - * callback aborts the parse by returning a negative number, that number - * is returned by ne_xml_failed. If the XML could not be parsed, a - * positive number is returned. */ + * parsing, or zero if the parse completed successfully. The return + * value is equal to that of the last ne_xml_parse call for this + * parser. */ int ne_xml_failed(ne_xml_parser *p); /* Set error string for parser: the string may be truncated. */ @@ -106,8 +105,11 @@ void ne_xml_destroy(ne_xml_parser *p); /* Parse the given block of input of length len. Parser must be * called with len=0 to signify the end of the document (for that - * case, the block argument is ignored). */ -void ne_xml_parse(ne_xml_parser *p, const char *block, size_t len); + * case, the block argument is ignored). Returns zero on success, or + * non-zero on error: for an XML syntax error, a positive number is + * returned; if parsing is aborted by a caller-supplied callback, that + * callback's return value is returned. */ +int ne_xml_parse(ne_xml_parser *p, const char *block, size_t len); /* As above, casting (ne_xml_parser *)userdata internally. * (This function can be passed to ne_add_response_body_reader) */ |