diff --git a/HTMLparser.c b/HTMLparser.c index 171df6f0..5228b601 100644 --- a/HTMLparser.c +++ b/HTMLparser.c @@ -77,8 +77,8 @@ static void LIBXML_ATTR_FORMAT(3,0) htmlParseErr(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, const xmlChar *str1, const xmlChar *str2) { - xmlErrParser(ctxt, NULL, XML_FROM_HTML, error, XML_ERR_ERROR, - str1, str2, NULL, 0, msg, str1, str2); + xmlCtxtErr(ctxt, NULL, XML_FROM_HTML, error, XML_ERR_ERROR, + str1, str2, NULL, 0, msg, str1, str2); } /** @@ -94,8 +94,8 @@ static void LIBXML_ATTR_FORMAT(3,0) htmlParseErrInt(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, int val) { - xmlErrParser(ctxt, NULL, XML_FROM_HTML, error, XML_ERR_ERROR, - NULL, NULL, NULL, val, msg, val); + xmlCtxtErr(ctxt, NULL, XML_FROM_HTML, error, XML_ERR_ERROR, + NULL, NULL, NULL, val, msg, val); } /************************************************************************ diff --git a/SAX2.c b/SAX2.c index 5c156044..9ec306fe 100644 --- a/SAX2.c +++ b/SAX2.c @@ -55,8 +55,8 @@ static void LIBXML_ATTR_FORMAT(3,0) xmlErrValid(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, const xmlChar *str1, const xmlChar *str2) { - xmlErrParser(ctxt, NULL, XML_FROM_DTD, error, XML_ERR_ERROR, - str1, str2, NULL, 0, msg, str1, str2); + xmlCtxtErr(ctxt, NULL, XML_FROM_DTD, error, XML_ERR_ERROR, + str1, str2, NULL, 0, msg, str1, str2); if (ctxt != NULL) ctxt->valid = 0; } @@ -75,8 +75,8 @@ static void LIBXML_ATTR_FORMAT(3,0) xmlFatalErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, const xmlChar *str1, const xmlChar *str2) { - xmlErrParser(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL, - str1, str2, NULL, 0, msg, str1, str2); + xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL, + str1, str2, NULL, 0, msg, str1, str2); } /** @@ -93,8 +93,8 @@ static void LIBXML_ATTR_FORMAT(3,0) xmlWarnMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, const xmlChar *str1) { - xmlErrParser(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_WARNING, - str1, NULL, NULL, 0, msg, str1); + xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_WARNING, + str1, NULL, NULL, 0, msg, str1); } /** @@ -110,8 +110,8 @@ static void LIBXML_ATTR_FORMAT(3,0) xmlNsWarnMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, const xmlChar *str1, const xmlChar *str2) { - xmlErrParser(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_WARNING, - str1, str2, NULL, 0, msg, str1, str2); + xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_WARNING, + str1, str2, NULL, 0, msg, str1, str2); } /** @@ -876,8 +876,8 @@ static void LIBXML_ATTR_FORMAT(3,0) xmlNsErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, const xmlChar *str1, const xmlChar *str2) { - xmlErrParser(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_ERROR, - str1, str2, NULL, 0, msg, str1, str2); + xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_ERROR, + str1, str2, NULL, 0, msg, str1, str2); } /** diff --git a/include/private/parser.h b/include/private/parser.h index f7be343b..2c005d02 100644 --- a/include/private/parser.h +++ b/include/private/parser.h @@ -29,17 +29,15 @@ #define PARSER_STOPPED(ctxt) ((ctxt)->disableSAX > 1) XML_HIDDEN void -xmlErrMemory(xmlParserCtxtPtr ctxt); +xmlCtxtVErr(xmlParserCtxtPtr ctxt, xmlNodePtr node, xmlErrorDomain domain, + xmlParserErrors code, xmlErrorLevel level, + const xmlChar *str1, const xmlChar *str2, const xmlChar *str3, + int int1, const char *msg, va_list ap); XML_HIDDEN void -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, ...); +xmlCtxtErr(xmlParserCtxtPtr ctxt, xmlNodePtr node, xmlErrorDomain domain, + xmlParserErrors 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) diff --git a/parser.c b/parser.c index c18bd438..e60c25ae 100644 --- a/parser.c +++ b/parser.c @@ -229,7 +229,7 @@ xmlLoadEntityContent(xmlParserCtxtPtr ctxt, xmlEntityPtr entity); * * ************************************************************************/ -void +static void xmlErrMemory(xmlParserCtxtPtr ctxt) { xmlCtxtErrMemory(ctxt); } @@ -247,13 +247,13 @@ xmlErrAttributeDup(xmlParserCtxtPtr ctxt, const xmlChar * prefix, const xmlChar * localname) { if (prefix == NULL) - xmlErrParser(ctxt, NULL, XML_FROM_PARSER, XML_ERR_ATTRIBUTE_REDEFINED, - XML_ERR_FATAL, localname, NULL, NULL, 0, - "Attribute %s redefined\n", localname); + xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, XML_ERR_ATTRIBUTE_REDEFINED, + XML_ERR_FATAL, localname, NULL, NULL, 0, + "Attribute %s redefined\n", localname); else - xmlErrParser(ctxt, NULL, XML_FROM_PARSER, XML_ERR_ATTRIBUTE_REDEFINED, - XML_ERR_FATAL, prefix, localname, NULL, 0, - "Attribute %s:%s redefined\n", prefix, localname); + xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, XML_ERR_ATTRIBUTE_REDEFINED, + XML_ERR_FATAL, prefix, localname, NULL, 0, + "Attribute %s:%s redefined\n", prefix, localname); } /** @@ -268,8 +268,8 @@ static void LIBXML_ATTR_FORMAT(3,0) xmlFatalErrMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg) { - xmlErrParser(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL, - NULL, NULL, NULL, 0, "%s", msg); + xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL, + NULL, NULL, NULL, 0, "%s", msg); } /** @@ -286,8 +286,8 @@ void LIBXML_ATTR_FORMAT(3,0) xmlWarningMsg(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, const xmlChar *str1, const xmlChar *str2) { - xmlErrParser(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_WARNING, - str1, str2, NULL, 0, msg, str1, str2); + xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_WARNING, + str1, str2, NULL, 0, msg, str1, str2); } /** @@ -305,8 +305,8 @@ xmlValidityError(xmlParserCtxtPtr ctxt, xmlParserErrors error, { ctxt->valid = 0; - xmlErrParser(ctxt, NULL, XML_FROM_DTD, error, XML_ERR_ERROR, - str1, str2, NULL, 0, msg, str1, str2); + xmlCtxtErr(ctxt, NULL, XML_FROM_DTD, error, XML_ERR_ERROR, + str1, str2, NULL, 0, msg, str1, str2); } /** @@ -322,8 +322,8 @@ static void LIBXML_ATTR_FORMAT(3,0) xmlFatalErrMsgInt(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, int val) { - xmlErrParser(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL, - NULL, NULL, NULL, val, msg, val); + xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL, + NULL, NULL, NULL, val, msg, val); } /** @@ -342,8 +342,8 @@ xmlFatalErrMsgStrIntStr(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, const xmlChar *str1, int val, const xmlChar *str2) { - xmlErrParser(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL, - str1, str2, NULL, val, msg, str1, val, str2); + xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL, + str1, str2, NULL, val, msg, str1, val, str2); } /** @@ -359,8 +359,8 @@ static void LIBXML_ATTR_FORMAT(3,0) xmlFatalErrMsgStr(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, const xmlChar * val) { - xmlErrParser(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL, - val, NULL, NULL, 0, msg, val); + xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL, + val, NULL, NULL, 0, msg, val); } /** @@ -376,8 +376,8 @@ static void LIBXML_ATTR_FORMAT(3,0) xmlErrMsgStr(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, const xmlChar * val) { - xmlErrParser(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_ERROR, - val, NULL, NULL, 0, msg, val); + xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_ERROR, + val, NULL, NULL, 0, msg, val); } /** @@ -398,8 +398,8 @@ xmlNsErr(xmlParserCtxtPtr ctxt, xmlParserErrors error, { ctxt->nsWellFormed = 0; - xmlErrParser(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_ERROR, - info1, info2, info3, 0, msg, info1, info2, info3); + xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_ERROR, + info1, info2, info3, 0, msg, info1, info2, info3); } /** @@ -418,8 +418,8 @@ xmlNsWarn(xmlParserCtxtPtr ctxt, xmlParserErrors error, const xmlChar * info1, const xmlChar * info2, const xmlChar * info3) { - xmlErrParser(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_WARNING, - info1, info2, info3, 0, msg, info1, info2, info3); + xmlCtxtErr(ctxt, NULL, XML_FROM_NAMESPACE, error, XML_ERR_WARNING, + info1, info2, info3, 0, msg, info1, info2, info3); } static void diff --git a/parserInternals.c b/parserInternals.c index 74b3f213..d719ab26 100644 --- a/parserInternals.c +++ b/parserInternals.c @@ -142,10 +142,10 @@ xmlCtxtErrMemory(xmlParserCtxtPtr ctxt) } void -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) +xmlCtxtVErr(xmlParserCtxtPtr ctxt, xmlNodePtr node, xmlErrorDomain domain, + xmlParserErrors code, xmlErrorLevel level, + const xmlChar *str1, const xmlChar *str2, const xmlChar *str3, + int int1, const char *msg, va_list ap) { xmlStructuredErrorFunc schannel = NULL; xmlGenericErrorFunc channel = NULL; @@ -159,7 +159,7 @@ xmlVErrParser(xmlParserCtxtPtr ctxt, xmlNodePtr node, return; if (code == XML_ERR_NO_MEMORY) { - xmlErrMemory(ctxt); + xmlCtxtErrMemory(ctxt); return; } @@ -216,7 +216,7 @@ xmlVErrParser(xmlParserCtxtPtr ctxt, xmlNodePtr node, msg, ap); if (res < 0) { - xmlErrMemory(ctxt); + xmlCtxtErrMemory(ctxt); return; } @@ -232,16 +232,16 @@ xmlVErrParser(xmlParserCtxtPtr ctxt, xmlNodePtr node, } 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, ...) +xmlCtxtErr(xmlParserCtxtPtr ctxt, xmlNodePtr node, xmlErrorDomain domain, + xmlParserErrors code, xmlErrorLevel level, + const xmlChar *str1, const xmlChar *str2, const xmlChar *str3, + int int1, const char *msg, ...) { va_list ap; va_start(ap, msg); - xmlVErrParser(ctxt, node, domain, code, level, - str1, str2, str3, int1, msg, ap); + xmlCtxtVErr(ctxt, node, domain, code, level, + str1, str2, str3, int1, msg, ap); va_end(ap); } @@ -258,8 +258,8 @@ xmlErrInternal(xmlParserCtxtPtr ctxt, const char *msg, const xmlChar * str) { if (ctxt == NULL) return; - xmlErrParser(ctxt, NULL, XML_FROM_PARSER, XML_ERR_INTERNAL_ERROR, - XML_ERR_FATAL, str, NULL, NULL, 0, msg, str); + xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, XML_ERR_INTERNAL_ERROR, + XML_ERR_FATAL, str, NULL, NULL, 0, msg, str); } /** @@ -278,12 +278,12 @@ xmlFatalErr(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *info) errmsg = xmlErrString(error); if (info == NULL) { - xmlErrParser(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL, - NULL, NULL, NULL, 0, "%s\n", errmsg); + xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL, + NULL, NULL, NULL, 0, "%s\n", errmsg); } else { - xmlErrParser(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL, - (const xmlChar *) info, NULL, NULL, 0, - "%s: %s\n", errmsg, info); + xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL, + (const xmlChar *) info, NULL, NULL, 0, + "%s: %s\n", errmsg, info); } } @@ -300,8 +300,8 @@ static void LIBXML_ATTR_FORMAT(3,0) xmlErrEncodingInt(xmlParserCtxtPtr ctxt, xmlParserErrors error, const char *msg, int val) { - xmlErrParser(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL, - NULL, NULL, NULL, val, msg, val); + xmlCtxtErr(ctxt, NULL, XML_FROM_PARSER, error, XML_ERR_FATAL, + NULL, NULL, NULL, val, msg, val); } /** @@ -1117,7 +1117,7 @@ xmlSwitchInputEncoding(xmlParserCtxtPtr ctxt, xmlParserInputPtr input, buf = xmlBufCreate(); if (buf == NULL) { - xmlErrMemory(ctxt); + xmlCtxtErrMemory(ctxt); return(-1); } @@ -1135,7 +1135,7 @@ xmlSwitchInputEncoding(xmlParserCtxtPtr ctxt, xmlParserInputPtr input, nbchars = xmlCharEncInput(in); xmlBufResetInput(in->buffer, input); if (nbchars == XML_ENC_ERR_MEMORY) { - xmlErrMemory(ctxt); + xmlCtxtErrMemory(ctxt); } else if (nbchars < 0) { xmlCtxtErrIO(ctxt, in->error, NULL); xmlHaltParser(ctxt); @@ -1331,7 +1331,7 @@ xmlSetDeclaredEncoding(xmlParserCtxtPtr ctxt, xmlChar *encoding) { xmlFree(encoding); encoding = xmlStrdup(BAD_CAST autoEnc); if (encoding == NULL) - xmlErrMemory(ctxt); + xmlCtxtErrMemory(ctxt); } } } @@ -1381,7 +1381,7 @@ xmlNewInputStream(xmlParserCtxtPtr ctxt) { input = (xmlParserInputPtr) xmlMalloc(sizeof(xmlParserInput)); if (input == NULL) { - xmlErrMemory(ctxt); + xmlCtxtErrMemory(ctxt); return(NULL); } memset(input, 0, sizeof(xmlParserInput)); @@ -1395,7 +1395,7 @@ xmlNewInputStream(xmlParserCtxtPtr ctxt) { */ if (ctxt != NULL) { if (input->id >= INT_MAX) { - xmlErrMemory(ctxt); + xmlCtxtErrMemory(ctxt); return(NULL); } input->id = ctxt->input_id++; @@ -1523,12 +1523,12 @@ xmlNewStringInputStream(xmlParserCtxtPtr ctxt, const xmlChar *buffer) { } buf = xmlParserInputBufferCreateString(buffer); if (buf == NULL) { - xmlErrMemory(ctxt); + xmlCtxtErrMemory(ctxt); return(NULL); } input = xmlNewInputStream(ctxt); if (input == NULL) { - xmlErrMemory(ctxt); + xmlCtxtErrMemory(ctxt); xmlFreeParserInputBuffer(buf); return(NULL); } @@ -1752,7 +1752,7 @@ xmlInitSAXParserCtxt(xmlParserCtxtPtr ctxt, const xmlSAXHandler *sax, if (ctxt->nsdb == NULL) { ctxt->nsdb = xmlParserNsCreate(); if (ctxt->nsdb == NULL) { - xmlErrMemory(ctxt); + xmlCtxtErrMemory(ctxt); return(-1); } } @@ -2086,7 +2086,7 @@ xmlParserAddNodeInfo(xmlParserCtxtPtr ctxt, byte_size); if (tmp_buffer == NULL) { - xmlErrMemory(ctxt); + xmlCtxtErrMemory(ctxt); return; } ctxt->node_seq.buffer = tmp_buffer; diff --git a/valid.c b/valid.c index c5da9891..239bbdd2 100644 --- a/valid.c +++ b/valid.c @@ -77,8 +77,8 @@ xmlDoErrValid(xmlValidCtxtPtr ctxt, xmlNodePtr node, va_start(ap, msg); if (pctxt != NULL) { - xmlVErrParser(pctxt, node, XML_FROM_VALID, code, level, - str1, str2, str3, int1, msg, ap); + xmlCtxtVErr(pctxt, node, XML_FROM_VALID, code, level, + str1, str2, str3, int1, msg, ap); } else { xmlGenericErrorFunc channel = NULL; void *data = NULL; diff --git a/xmlIO.c b/xmlIO.c index d0cdb609..5f30ecfc 100644 --- a/xmlIO.c +++ b/xmlIO.c @@ -405,9 +405,9 @@ xmlCtxtErrIO(xmlParserCtxtPtr ctxt, int code, const char *uri) /* * TODO: Set filename in error */ - xmlErrParser(ctxt, NULL, XML_FROM_IO, code, level, - (const xmlChar *) uri, NULL, NULL, 0, - msg, str1, str2); + xmlCtxtErr(ctxt, NULL, XML_FROM_IO, code, level, + (const xmlChar *) uri, NULL, NULL, 0, + msg, str1, str2); } /************************************************************************