mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-26 00:37:43 +03:00
parser: Report malloc failures
Fix many places where malloc failures aren't reported. Make xmlErrMemory public. This is useful for custom external entity loaders. Introduce new API function xmlSwitchEncodingName. Change the way how we store whether the the parser is stopped. This used to be signaled by setting ctxt->instate to XML_PARSER_EOF which was misdesigned and error-prone. Set ctxt->disableSAX to 2 instead and introduce a macro PARSER_STOPPED. Also stop to remove parser inputs in xmlHaltParser. This allows to remove many checks of ctxt->instate. Introduce xmlErrParser to handle errors if a parser context is available.
This commit is contained in:
@@ -26,8 +26,18 @@
|
||||
#define XML_INPUT_USES_ENC_DECL (1u << 4)
|
||||
#define XML_INPUT_ENCODING_ERROR (1u << 5)
|
||||
|
||||
#define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1)
|
||||
|
||||
XML_HIDDEN void
|
||||
xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra);
|
||||
xmlVErrParser(xmlParserCtxtPtr ctxt, xmlNodePtr node,
|
||||
int domain, int code, xmlErrorLevel level,
|
||||
const xmlChar *str1, const xmlChar *str2, const xmlChar *str3,
|
||||
int int1, const char *msg, va_list ap);
|
||||
XML_HIDDEN void
|
||||
xmlErrParser(xmlParserCtxtPtr ctxt, xmlNodePtr node,
|
||||
int domain, int code, xmlErrorLevel level,
|
||||
const xmlChar *str1, const xmlChar *str2, const xmlChar *str3,
|
||||
int int1, const char *msg, ...);
|
||||
XML_HIDDEN void
|
||||
xmlFatalErr(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *info);
|
||||
XML_HIDDEN void LIBXML_ATTR_FORMAT(3,0)
|
||||
|
||||
Reference in New Issue
Block a user