#include "libxml.h"
#include <string.h>
#include <stdarg.h>
#include <libxml/parser.h>
#include <libxml/xmlerror.h>
#include <libxml/xmlmemory.h>
#include <libxml/globals.h>
Go to the source code of this file.
|
void XMLCDECL | xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED, const char *msg,...) LIBXML_ATTR_FORMAT(2 |
|
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
◆ initGenericErrorDefaultFunc()
initGenericErrorDefaultFunc: @handler: the handler
Set or reset (if NULL) the default handler for generic errors to the builtin error function.
Definition at line 90 of file error.c.
91{
94 else
96}
UINT(* handler)(MSIPACKAGE *)
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
void XMLCDECL xmlGenericErrorDefaultFunc(void *ctx ATTRIBUTE_UNUSED, const char *msg,...) LIBXML_ATTR_FORMAT(2
Referenced by xmlInitParser().
◆ xmlGenericErrorDefaultFunc()
xmlGenericErrorDefaultFunc: @ctx: an error context @msg: the message to display/transmit ...: extra parameters for the message display
Default handler for out of context error messages.
Definition at line 71 of file error.c.
71 {
73
76
80}
_Check_return_opt_ _CRTIMP int __cdecl vfprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format, va_list _ArgList)
XMLPUBVAR void * xmlGenericErrorContext
Referenced by initGenericErrorDefaultFunc(), xmlSetGenericErrorFunc(), and xmlThrDefSetGenericErrorFunc().
◆ xmlParserPrintFileContext()
xmlParserPrintFileContext: @input: an xmlParserInputPtr input
Displays current context within the input content for error tracking
Definition at line 230 of file error.c.
230 {
233}
GLenum GLenum GLenum input
static void xmlParserPrintFileContextInternal(xmlParserInputPtr input, xmlGenericErrorFunc channel, void *data)
◆ xmlParserPrintFileContextInternal()
xmlParserPrintFileContext: @input: an xmlParserInputPtr input
Displays current context within the input content for error tracking
Definition at line 173 of file error.c.
174 {
179
181 return;
182
185
186 while ((
cur >
base) && ((*(
cur) ==
'\n') || (*(
cur) ==
'\r'))) {
188 }
190
192 (*(
cur) !=
'\n') && (*(
cur) !=
'\r'))
194 if ((*(
cur) ==
'\n') || (*(
cur) ==
'\r'))
cur++;
195
197
200
201 while ((*
cur != 0) && (*(
cur) !=
'\n') &&
205 }
206 *ctnt = 0;
207
209
212
213 while ((
n<col) && (
n++ <
sizeof(
content)-2) && (*ctnt != 0)) {
214 if (*(ctnt) != '\t')
215 *(ctnt) = ' ';
216 ctnt++;
217 }
218 *ctnt++ = '^';
219 *ctnt = 0;
221}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Referenced by xmlParserPrintFileContext(), and xmlReportError().
◆ xmlParserPrintFileInfo()
xmlParserPrintFileInfo: @input: an xmlParserInputPtr input
Displays the associated file and line information for the current input
Definition at line 153 of file error.c.
153 {
157 "%s:%d: ",
input->filename,
159 else
161 "Entity: line %d: ",
input->line);
162 }
163}
◆ 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 245 of file error.c.
247{
257
259 return;
260
261 if (channel ==
NULL) {
264 }
271
273 return;
274
277
278
279
280
287 }
292 channel(
data,
"Entity: line %d: ",
input->line);
293 }
294 } else {
297 else if ((
line != 0) &&
301 channel(
data,
"Entity: line %d: ",
line);
302 }
304 channel(
data,
"element %s: ",
name);
305 }
308 channel(
data,
"parser ");
309 break;
311 channel(
data,
"namespace ");
312 break;
315 channel(
data,
"validity ");
316 break;
318 channel(
data,
"HTML parser ");
319 break;
321 channel(
data,
"memory ");
322 break;
324 channel(
data,
"output ");
325 break;
327 channel(
data,
"I/O ");
328 break;
330 channel(
data,
"XInclude ");
331 break;
333 channel(
data,
"XPath ");
334 break;
336 channel(
data,
"parser ");
337 break;
339 channel(
data,
"regexp ");
340 break;
342 channel(
data,
"module ");
343 break;
345 channel(
data,
"Schemas validity ");
346 break;
348 channel(
data,
"Schemas parser ");
349 break;
351 channel(
data,
"Relax-NG parser ");
352 break;
354 channel(
data,
"Relax-NG validity ");
355 break;
357 channel(
data,
"Catalog ");
358 break;
360 channel(
data,
"C14N ");
361 break;
363 channel(
data,
"XSLT ");
364 break;
366 channel(
data,
"encoding ");
367 break;
369 channel(
data,
"schematron ");
370 break;
372 channel(
data,
"internal buffer ");
373 break;
375 channel(
data,
"URI ");
376 break;
377 default:
378 break;
379 }
383 break;
385 channel(
data,
"warning : ");
386 break;
388 channel(
data,
"error : ");
389 break;
391 channel(
data,
"error : ");
392 break;
393 }
399 else
401 } else {
402 channel(
data,
"%s\n",
"out of memory error");
403 }
404
409 channel(
data,
"%s:%d: \n",
cur->filename,
cur->line);
411 channel(
data,
"Entity: line %d: \n",
cur->line);
413 }
414 }
420
421 channel(
data,
"%s\n",
err->str1);
422 for (
i=0;
i <
err->int1;
i++)
427 }
428}
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
xmlParserInputPtr * inputTab
XMLPUBFUN int XMLCALL 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 113 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 134 of file error.c.
134 {
137}
XMLPUBVAR void * xmlStructuredErrorContext
XMLPUBVAR xmlStructuredErrorFunc xmlStructuredError