#include "libxml.h"
#include <string.h>
#include <stdarg.h>
#include <libxml/parser.h>
#include <libxml/xmlerror.h>
#include <libxml/xmlmemory.h>
#include "private/error.h"
Go to the source code of this file.
|
| void | xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED, const char *msg,...) |
| |
| void | initGenericErrorDefaultFunc (xmlGenericErrorFunc *handler) |
| |
| void | xmlSetGenericErrorFunc (void *ctx, xmlGenericErrorFunc handler) |
| |
| void | xmlSetStructuredErrorFunc (void *ctx, xmlStructuredErrorFunc handler) |
| |
| void | xmlParserPrintFileInfo (xmlParserInputPtr input) |
| |
| static void | xmlParserPrintFileContextInternal (xmlParserInputPtr input, xmlGenericErrorFunc channel, void *data) |
| |
| void | xmlParserPrintFileContext (xmlParserInputPtr input) |
| |
| static void | xmlReportError (xmlErrorPtr err, xmlParserCtxtPtr ctxt, const char *str, xmlGenericErrorFunc channel, void *data) |
| |
◆ IN_LIBXML
◆ XML_GET_VAR_STR
◆ XML_MAX_ERRORS
◆ initGenericErrorDefaultFunc()
initGenericErrorDefaultFunc: @handler: the handler
DEPRECATED: Use xmlSetGenericErrorFunc.
Set or reset (if NULL) the default handler for generic errors to the builtin error function.
Definition at line 91 of file error.c.
92{
95 else
97}
UINT(* handler)(MSIPACKAGE *)
void xmlGenericErrorDefaultFunc(void *ctx ATTRIBUTE_UNUSED, const char *msg,...)
xmlGenericErrorFunc xmlGenericError
◆ xmlGenericErrorDefaultFunc()
◆ xmlParserPrintFileContext()
| void xmlParserPrintFileContext |
( |
xmlParserInputPtr |
input | ) |
|
xmlParserPrintFileContext: @input: an xmlParserInputPtr input
Displays current context within the input content for error tracking
Definition at line 244 of file error.c.
244 {
247}
GLenum GLenum GLenum input
static void xmlParserPrintFileContextInternal(xmlParserInputPtr input, xmlGenericErrorFunc channel, void *data)
◆ xmlParserPrintFileContextInternal()
xmlParserPrintFileContextInternal: @input: an xmlParserInputPtr input
Displays current context within the input content for error tracking
Definition at line 174 of file error.c.
175 {
180
182 return;
183
186
187 while ((
cur >
base) && ((*(
cur) ==
'\n') || (*(
cur) ==
'\r'))) {
189 }
191
193 (*
cur !=
'\n') && (*
cur !=
'\r')) {
196 }
197 if ((
n > 0) && ((*
cur ==
'\n') || (*
cur ==
'\r'))) {
199 } else {
200
201 while ((cur < input->
cur) && ((*
cur & 0xC0) == 0x80))
203 }
204
206
209
210 while ((*
cur != 0) && (*(
cur) !=
'\n') && (*(
cur) !=
'\r')) {
213
215 break;
218 }
221
223
226
227 while ((
n<col) && (
n++ <
sizeof(
content)-2) && (*ctnt != 0)) {
228 if (*(ctnt) != '\t')
229 *(ctnt) = ' ';
230 ctnt++;
231 }
232 *ctnt++ = '^';
233 *ctnt = 0;
235}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
#define memcpy(s1, s2, n)
XMLPUBFUN int XMLPUBFUN int XMLPUBFUN int xmlGetUTF8Char(const unsigned char *utf, int *len)
Referenced by xmlParserPrintFileContext(), and xmlReportError().
◆ xmlParserPrintFileInfo()
| void xmlParserPrintFileInfo |
( |
xmlParserInputPtr |
input | ) |
|
xmlParserPrintFileInfo: @input: an xmlParserInputPtr input
Displays the associated file and line information for the current input
Definition at line 154 of file error.c.
154 {
158 "%s:%d: ",
input->filename,
160 else
162 "Entity: line %d: ",
input->line);
163 }
164}
◆ xmlReportError()
xmlReportError: @err: the error @ctx: the parser context or NULL @str: the formatted error message
Report an error with its context, replace the 4 old error/warning routines.
Definition at line 259 of file error.c.
261{
271
273 return;
274
275 if (channel ==
NULL) {
278 }
285
287 return;
288
291
292
293
294
298 (ctxt->inputNr > 1)) {
300 input = ctxt->inputTab[ctxt->inputNr - 2];
301 }
306 channel(
data,
"Entity: line %d: ",
input->line);
307 }
308 } else {
311 else if ((
line != 0) &&
315 channel(
data,
"Entity: line %d: ",
line);
316 }
318 channel(
data,
"element %s: ",
name);
319 }
322 channel(
data,
"parser ");
323 break;
325 channel(
data,
"namespace ");
326 break;
329 channel(
data,
"validity ");
330 break;
332 channel(
data,
"HTML parser ");
333 break;
335 channel(
data,
"memory ");
336 break;
338 channel(
data,
"output ");
339 break;
341 channel(
data,
"I/O ");
342 break;
344 channel(
data,
"XInclude ");
345 break;
347 channel(
data,
"XPath ");
348 break;
350 channel(
data,
"parser ");
351 break;
353 channel(
data,
"regexp ");
354 break;
356 channel(
data,
"module ");
357 break;
359 channel(
data,
"Schemas validity ");
360 break;
362 channel(
data,
"Schemas parser ");
363 break;
365 channel(
data,
"Relax-NG parser ");
366 break;
368 channel(
data,
"Relax-NG validity ");
369 break;
371 channel(
data,
"Catalog ");
372 break;
374 channel(
data,
"C14N ");
375 break;
377 channel(
data,
"XSLT ");
378 break;
380 channel(
data,
"encoding ");
381 break;
383 channel(
data,
"schematron ");
384 break;
386 channel(
data,
"internal buffer ");
387 break;
389 channel(
data,
"URI ");
390 break;
391 default:
392 break;
393 }
397 break;
399 channel(
data,
"warning : ");
400 break;
402 channel(
data,
"error : ");
403 break;
405 channel(
data,
"error : ");
406 break;
407 }
413 else
415 } else {
416 channel(
data,
"%s\n",
"out of memory error");
417 }
418
423 channel(
data,
"%s:%d: \n",
cur->filename,
cur->line);
425 channel(
data,
"Entity: line %d: \n",
cur->line);
427 }
428 }
434
435 channel(
data,
"%s\n",
err->str1);
436 for (
i=0;
i <
err->int1;
i++)
441 }
442}
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
XMLPUBFUN int xmlStrlen(const xmlChar *str)
◆ xmlSetGenericErrorFunc()
xmlSetGenericErrorFunc: @ctx: the new error handling context @handler: the new handler function
Function to reset the handler and the error context for out of context error messages. This simply means that @handler will be called for subsequent error messages while not parsing nor validating. And @ctx will be passed as first argument to @handler One can simply force messages to be emitted to another FILE * than stderr by setting @ctx to this file handle and @handler to NULL. For multi-threaded applications, this must be set separately for each thread.
Definition at line 114 of file error.c.
◆ xmlSetStructuredErrorFunc()
xmlSetStructuredErrorFunc: @ctx: the new error handling context @handler: the new handler function
Function to reset the handler and the error context for out of context structured error messages. This simply means that @handler will be called for subsequent error messages while not parsing nor validating. And @ctx will be passed as first argument to @handler For multi-threaded applications, this must be set separately for each thread.
Definition at line 135 of file error.c.
135 {
138}
void * xmlStructuredErrorContext
xmlStructuredErrorFunc xmlStructuredError