1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-29 11:41:22 +03:00

Release 1.6, lot of fixes, more validation, code cleanup, added namespace

on attributes, Daniel.
This commit is contained in:
Daniel Veillard
1999-08-29 21:02:19 +00:00
parent 56316b09e4
commit b96e643849
58 changed files with 5241 additions and 1903 deletions

41
error.c
View File

@ -10,18 +10,32 @@
#include <stdarg.h>
#include "parser.h"
static void
/**
* xmlParserPrintFileInfo:
* @input: an xmlParserInputPtr input
*
* Displays the associated file and line informations for the current input
*/
void
xmlParserPrintFileInfo(xmlParserInputPtr input) {
if (input != NULL) {
if (input->filename)
fprintf(stderr, "%s:%d: ", input->filename,
input->line);
else
fprintf(stderr, "line %d: ", input->line);
fprintf(stderr, "Entity: line %d: ", input->line);
}
}
static void
/**
* xmlParserPrintFileContext:
* @input: an xmlParserInputPtr input
*
* Displays current context within the input content for error tracking
*/
void
xmlParserPrintFileContext(xmlParserInputPtr input) {
const CHAR *cur, *base;
int n;
@ -67,11 +81,14 @@ xmlParserError(void *ctx, const char *msg, ...)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlParserInputPtr input;
xmlParserInputPtr cur = NULL;
va_list args;
input = ctxt->input;
if ((input->filename == NULL) && (ctxt->inputNr > 1))
if ((input->filename == NULL) && (ctxt->inputNr > 1)) {
cur = input;
input = ctxt->inputTab[ctxt->inputNr - 2];
}
xmlParserPrintFileInfo(input);
@ -81,6 +98,11 @@ xmlParserError(void *ctx, const char *msg, ...)
va_end(args);
xmlParserPrintFileContext(input);
if (cur != NULL) {
xmlParserPrintFileInfo(cur);
fprintf(stderr, "\n");
xmlParserPrintFileContext(cur);
}
}
/**
@ -97,11 +119,15 @@ xmlParserWarning(void *ctx, const char *msg, ...)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlParserInputPtr input;
xmlParserInputPtr cur = NULL;
va_list args;
input = ctxt->input;
if ((input->filename == NULL) && (ctxt->inputNr > 1))
if ((input->filename == NULL) && (ctxt->inputNr > 1)) {
cur = input;
input = ctxt->inputTab[ctxt->inputNr - 2];
}
xmlParserPrintFileInfo(input);
@ -111,6 +137,11 @@ xmlParserWarning(void *ctx, const char *msg, ...)
va_end(args);
xmlParserPrintFileContext(input);
if (cur != NULL) {
xmlParserPrintFileInfo(cur);
fprintf(stderr, "\n");
xmlParserPrintFileContext(cur);
}
}
/**