1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-23 01:52:48 +03:00

error: Remove underscores from xmlRaiseError

This commit is contained in:
Nick Wellnhofer
2024-06-26 01:18:55 +02:00
parent 3ff8a2c4b8
commit 598ee0d2c6
12 changed files with 88 additions and 88 deletions

View File

@@ -366,10 +366,10 @@ htmlSaveErr(int code, xmlNodePtr node, const char *extra)
msg = "unexpected error number\n"; msg = "unexpected error number\n";
} }
res = __xmlRaiseError(NULL, NULL, NULL, NULL, node, res = xmlRaiseError(NULL, NULL, NULL, NULL, node,
XML_FROM_OUTPUT, code, XML_ERR_ERROR, NULL, 0, XML_FROM_OUTPUT, code, XML_ERR_ERROR, NULL, 0,
extra, NULL, NULL, 0, 0, extra, NULL, NULL, 0, 0,
msg, extra); msg, extra);
if (res < 0) if (res < 0)
xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_OUTPUT, NULL); xmlRaiseMemoryError(NULL, NULL, NULL, XML_FROM_OUTPUT, NULL);
} }

View File

@@ -222,11 +222,11 @@ xmlCatalogErr(xmlCatalogEntryPtr catal, xmlNodePtr node, int error,
{ {
int res; int res;
res = __xmlRaiseError(NULL, NULL, NULL, catal, node, res = xmlRaiseError(NULL, NULL, NULL, catal, node,
XML_FROM_CATALOG, error, XML_ERR_ERROR, NULL, 0, XML_FROM_CATALOG, error, XML_ERR_ERROR, NULL, 0,
(const char *) str1, (const char *) str2, (const char *) str1, (const char *) str2,
(const char *) str3, 0, 0, (const char *) str3, 0, 0,
msg, str1, str2, str3); msg, str1, str2, str3);
if (res < 0) if (res < 0)
xmlCatalogErrMemory(); xmlCatalogErrMemory();
} }

14
error.c
View File

@@ -746,7 +746,7 @@ xmlVRaiseError(xmlStructuredErrorFunc schannel,
} }
/** /**
* __xmlRaiseError: * xmlRaiseError:
* @schannel: the structured callback channel * @schannel: the structured callback channel
* @channel: the old callback channel * @channel: the old callback channel
* @data: the callback data * @data: the callback data
@@ -772,12 +772,12 @@ xmlVRaiseError(xmlStructuredErrorFunc schannel,
* Returns 0 on success, -1 if a memory allocation failed. * Returns 0 on success, -1 if a memory allocation failed.
*/ */
int int
__xmlRaiseError(xmlStructuredErrorFunc schannel, xmlRaiseError(xmlStructuredErrorFunc schannel,
xmlGenericErrorFunc channel, void *data, void *ctx, xmlGenericErrorFunc channel, void *data, void *ctx,
xmlNode *node, int domain, int code, xmlErrorLevel level, xmlNode *node, int domain, int code, xmlErrorLevel level,
const char *file, int line, const char *str1, const char *file, int line, const char *str1,
const char *str2, const char *str3, int int1, int col, const char *str2, const char *str3, int int1, int col,
const char *msg, ...) const char *msg, ...)
{ {
va_list ap; va_list ap;
int res; int res;

View File

@@ -19,12 +19,12 @@ xmlVRaiseError(xmlStructuredErrorFunc schannel, xmlGenericErrorFunc channel,
const char *str2, const char *str3, int int1, int col, const char *str2, const char *str3, int int1, int col,
const char *msg, va_list ap); const char *msg, va_list ap);
XML_HIDDEN int XML_HIDDEN int
__xmlRaiseError(xmlStructuredErrorFunc schannel, xmlGenericErrorFunc channel, xmlRaiseError(xmlStructuredErrorFunc schannel, xmlGenericErrorFunc channel,
void *data, void *ctx, struct _xmlNode *node, void *data, void *ctx, struct _xmlNode *node,
int domain, int code, xmlErrorLevel level, int domain, int code, xmlErrorLevel level,
const char *file, int line, const char *str1, const char *file, int line, const char *str1,
const char *str2, const char *str3, int int1, int col, const char *str2, const char *str3, int int1, int col,
const char *msg, ...) LIBXML_ATTR_FORMAT(16,17); const char *msg, ...) LIBXML_ATTR_FORMAT(16,17);
XML_HIDDEN void XML_HIDDEN void
xmlGenericErrorDefaultFunc(void *ctx, const char *msg, xmlGenericErrorDefaultFunc(void *ctx, const char *msg,
...) LIBXML_ATTR_FORMAT(2,3); ...) LIBXML_ATTR_FORMAT(2,3);

View File

@@ -491,10 +491,10 @@ xmlRngPErr(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr node, int error,
data = xmlGenericErrorContext; data = xmlGenericErrorContext;
} }
res = __xmlRaiseError(schannel, channel, data, NULL, node, res = xmlRaiseError(schannel, channel, data, NULL, node,
XML_FROM_RELAXNGP, error, XML_ERR_ERROR, NULL, 0, XML_FROM_RELAXNGP, error, XML_ERR_ERROR, NULL, 0,
(const char *) str1, (const char *) str2, NULL, 0, 0, (const char *) str1, (const char *) str2, NULL, 0, 0,
msg, str1, str2); msg, str1, str2);
if (res < 0) if (res < 0)
xmlRngPErrMemory(ctxt); xmlRngPErrMemory(ctxt);
} }
@@ -533,10 +533,10 @@ xmlRngVErr(xmlRelaxNGValidCtxtPtr ctxt, xmlNodePtr node, int error,
data = xmlGenericErrorContext; data = xmlGenericErrorContext;
} }
res = __xmlRaiseError(schannel, channel, data, NULL, node, res = xmlRaiseError(schannel, channel, data, NULL, node,
XML_FROM_RELAXNGV, error, XML_ERR_ERROR, NULL, 0, XML_FROM_RELAXNGV, error, XML_ERR_ERROR, NULL, 0,
(const char *) str1, (const char *) str2, NULL, 0, 0, (const char *) str1, (const char *) str2, NULL, 0, 0,
msg, str1, str2); msg, str1, str2);
if (res < 0) if (res < 0)
xmlRngVErrMemory(ctxt); xmlRngVErrMemory(ctxt);
} }

View File

@@ -271,10 +271,10 @@ xmlSchematronPErr(xmlSchematronParserCtxtPtr ctxt, xmlNodePtr node, int error,
data = xmlGenericErrorContext; data = xmlGenericErrorContext;
} }
res = __xmlRaiseError(schannel, channel, data, ctxt, node, res = xmlRaiseError(schannel, channel, data, ctxt, node,
XML_FROM_SCHEMASP, error, XML_ERR_ERROR, NULL, 0, XML_FROM_SCHEMASP, error, XML_ERR_ERROR, NULL, 0,
(const char *) str1, (const char *) str2, NULL, 0, 0, (const char *) str1, (const char *) str2, NULL, 0, 0,
msg, str1, str2); msg, str1, str2);
if (res < 0) if (res < 0)
xmlSchematronPErrMemory(ctxt); xmlSchematronPErrMemory(ctxt);
} }
@@ -328,10 +328,10 @@ xmlSchematronVErr(xmlSchematronValidCtxtPtr ctxt, int error,
data = xmlGenericErrorContext; data = xmlGenericErrorContext;
} }
res = __xmlRaiseError(schannel, channel, data, ctxt, NULL, res = xmlRaiseError(schannel, channel, data, ctxt, NULL,
XML_FROM_SCHEMASV, error, XML_ERR_ERROR, NULL, 0, XML_FROM_SCHEMASV, error, XML_ERR_ERROR, NULL, 0,
(const char *) str1, NULL, NULL, 0, 0, (const char *) str1, NULL, NULL, 0, 0,
msg, str1); msg, str1);
if (res < 0) if (res < 0)
xmlSchematronVErrMemory(ctxt); xmlSchematronVErrMemory(ctxt);
} }
@@ -1647,17 +1647,17 @@ xmlSchematronReportSuccess(xmlSchematronValidCtxtPtr ctxt,
data = xmlGenericErrorContext; data = xmlGenericErrorContext;
} }
res = __xmlRaiseError(schannel, channel, data, NULL, cur, res = xmlRaiseError(schannel, channel, data, NULL, cur,
XML_FROM_SCHEMATRONV, XML_FROM_SCHEMATRONV,
(test->type == XML_SCHEMATRON_ASSERT) ? (test->type == XML_SCHEMATRON_ASSERT) ?
XML_SCHEMATRONV_ASSERT : XML_SCHEMATRONV_ASSERT :
XML_SCHEMATRONV_REPORT, XML_SCHEMATRONV_REPORT,
XML_ERR_ERROR, NULL, line, XML_ERR_ERROR, NULL, line,
(pattern == NULL) ? (pattern == NULL) ?
NULL : NULL :
(const char *) pattern->name, (const char *) pattern->name,
(const char *) path, (const char *) report, 0, 0, (const char *) path, (const char *) report, 0, 0,
"%s", msg); "%s", msg);
if (res < 0) if (res < 0)
xmlSchematronVErrMemory(ctxt); xmlSchematronVErrMemory(ctxt);
} else { } else {

View File

@@ -174,10 +174,10 @@ xmlXIncludeErr(xmlXIncludeCtxtPtr ctxt, xmlNodePtr node, int error,
data = xmlGenericErrorContext; data = xmlGenericErrorContext;
} }
res = __xmlRaiseError(schannel, channel, data, ctxt, node, res = xmlRaiseError(schannel, channel, data, ctxt, node,
XML_FROM_XINCLUDE, error, XML_ERR_ERROR, XML_FROM_XINCLUDE, error, XML_ERR_ERROR,
NULL, 0, (const char *) extra, NULL, NULL, 0, 0, NULL, 0, (const char *) extra, NULL, NULL, 0, 0,
msg, (const char *) extra); msg, (const char *) extra);
if (res < 0) { if (res < 0) {
ctxt->errNo = XML_ERR_NO_MEMORY; ctxt->errNo = XML_ERR_NO_MEMORY;
ctxt->fatalErr = 1; ctxt->fatalErr = 1;

View File

@@ -385,10 +385,10 @@ xmlRegexpErrCompile(xmlRegParserCtxtPtr ctxt, const char *extra)
ctxt->error = XML_REGEXP_COMPILE_ERROR; ctxt->error = XML_REGEXP_COMPILE_ERROR;
} }
res = __xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_REGEXP, res = xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_REGEXP,
XML_REGEXP_COMPILE_ERROR, XML_ERR_FATAL, XML_REGEXP_COMPILE_ERROR, XML_ERR_FATAL,
NULL, 0, extra, regexp, NULL, idx, 0, NULL, 0, extra, regexp, NULL, idx, 0,
"failed to compile: %s\n", extra); "failed to compile: %s\n", extra);
if (res < 0) if (res < 0)
xmlRegexpErrMemory(ctxt); xmlRegexpErrMemory(ctxt);
} }

View File

@@ -112,10 +112,10 @@ xmlSaveErr(xmlOutputBufferPtr out, int code, xmlNodePtr node,
msg = "unexpected error number\n"; msg = "unexpected error number\n";
} }
res = __xmlRaiseError(NULL, NULL, NULL, NULL, node, res = xmlRaiseError(NULL, NULL, NULL, NULL, node,
XML_FROM_OUTPUT, code, XML_ERR_ERROR, NULL, 0, XML_FROM_OUTPUT, code, XML_ERR_ERROR, NULL, 0,
extra, NULL, NULL, 0, 0, extra, NULL, NULL, 0, 0,
msg, extra); msg, extra);
if (res < 0) if (res < 0)
xmlSaveErrMemory(out); xmlSaveErrMemory(out);
} }

View File

@@ -123,14 +123,14 @@ static void
xmlWriterErrMsg(xmlTextWriterPtr ctxt, xmlParserErrors error, xmlWriterErrMsg(xmlTextWriterPtr ctxt, xmlParserErrors error,
const char *msg) const char *msg)
{ {
if (ctxt != NULL) { xmlParserCtxtPtr pctxt = NULL;
__xmlRaiseError(NULL, NULL, NULL, ctxt->ctxt,
NULL, XML_FROM_WRITER, error, XML_ERR_FATAL, if (ctxt != NULL)
NULL, 0, NULL, NULL, NULL, 0, 0, "%s", msg); pctxt = ctxt->ctxt;
} else {
__xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_WRITER, error, xmlRaiseError(NULL, NULL, NULL, pctxt,
XML_ERR_FATAL, NULL, 0, NULL, NULL, NULL, 0, 0, "%s", msg); NULL, XML_FROM_WRITER, error, XML_ERR_FATAL,
} NULL, 0, NULL, NULL, NULL, 0, 0, "%s", msg);
} }
/** /**
@@ -146,14 +146,14 @@ static void LIBXML_ATTR_FORMAT(3,0)
xmlWriterErrMsgInt(xmlTextWriterPtr ctxt, xmlParserErrors error, xmlWriterErrMsgInt(xmlTextWriterPtr ctxt, xmlParserErrors error,
const char *msg, int val) const char *msg, int val)
{ {
if (ctxt != NULL) { xmlParserCtxtPtr pctxt = NULL;
__xmlRaiseError(NULL, NULL, NULL, ctxt->ctxt,
NULL, XML_FROM_WRITER, error, XML_ERR_FATAL, if (ctxt != NULL)
NULL, 0, NULL, NULL, NULL, val, 0, msg, val); pctxt = ctxt->ctxt;
} else {
__xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_WRITER, error, xmlRaiseError(NULL, NULL, NULL, pctxt,
XML_ERR_FATAL, NULL, 0, NULL, NULL, NULL, val, 0, msg, val); NULL, XML_FROM_WRITER, error, XML_ERR_FATAL,
} NULL, 0, NULL, NULL, NULL, val, 0, msg, val);
} }
/** /**

12
xpath.c
View File

@@ -703,12 +703,12 @@ xmlXPathErr(xmlXPathParserContextPtr ctxt, int code)
data = xmlGenericErrorContext; data = xmlGenericErrorContext;
} }
res = __xmlRaiseError(schannel, channel, data, NULL, node, XML_FROM_XPATH, res = xmlRaiseError(schannel, channel, data, NULL, node, XML_FROM_XPATH,
code + XML_XPATH_EXPRESSION_OK - XPATH_EXPRESSION_OK, code + XML_XPATH_EXPRESSION_OK - XPATH_EXPRESSION_OK,
XML_ERR_ERROR, NULL, 0, XML_ERR_ERROR, NULL, 0,
(const char *) ctxt->base, NULL, NULL, (const char *) ctxt->base, NULL, NULL,
ctxt->cur - ctxt->base, 0, ctxt->cur - ctxt->base, 0,
"%s", xmlXPathErrorMessages[code]); "%s", xmlXPathErrorMessages[code]);
if (res < 0) if (res < 0)
xmlXPathPErrMemory(ctxt); xmlXPathPErrMemory(ctxt);
} }

View File

@@ -99,11 +99,11 @@ xmlXPtrErr(xmlXPathParserContextPtr ctxt, int code,
node = ctxt->context->debugNode; node = ctxt->context->debugNode;
} }
res = __xmlRaiseError(serror, NULL, data, NULL, node, res = xmlRaiseError(serror, NULL, data, NULL, node,
XML_FROM_XPOINTER, code, XML_ERR_ERROR, NULL, 0, XML_FROM_XPOINTER, code, XML_ERR_ERROR, NULL, 0,
(const char *) extra, (const char *) ctxt->base, (const char *) extra, (const char *) ctxt->base,
NULL, ctxt->cur - ctxt->base, 0, NULL, ctxt->cur - ctxt->base, 0,
msg, extra); msg, extra);
if (res < 0) if (res < 0)
xmlXPathPErrMemory(ctxt); xmlXPathPErrMemory(ctxt);
} }