From 20ad439f42e0aafacb8277514231a6d10ae98f8d Mon Sep 17 00:00:00 2001 From: ehofman Date: Mon, 11 May 2009 08:46:03 +0000 Subject: [PATCH] fixes for compiling without syntax validation. --- utils/xmlgrep/xml.c | 31 ++++++++++++++++++++++++++++++- utils/xmlgrep/xml.h | 2 -- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/utils/xmlgrep/xml.c b/utils/xmlgrep/xml.c index 16df5f977..b9016c08e 100644 --- a/utils/xmlgrep/xml.c +++ b/utils/xmlgrep/xml.c @@ -58,9 +58,9 @@ typedef struct #include #include -#ifndef XML_NONVALIDATING #include "xml.h" +#ifndef XML_NONVALIDATING static const char *__xml_error_str[XML_MAX_ERROR]; struct _xml_error @@ -224,7 +224,9 @@ xmlClose(void *id) close(rid->fd); } +#ifndef XML_NONVALIDATING if (rid->info) free(rid->info); +#endif free(rid); id = 0; } @@ -1280,6 +1282,33 @@ xmlErrorGetString(const void *id, int clear) return ret; } + +#else + +int +xmlErrorGetNo(const void *id, int clear) +{ + return XML_NO_ERROR; +} + +size_t +xmlErrorGetLineNo(const void *id, int clear) +{ + return 0; +} + +size_t +xmlErrorGetColumnNo(const void *id, int clear) +{ + return 0; +} + +const char * +xmlErrorGetString(const void *id, int clear) +{ + return "error detection was not enabled at compile time: no error."; +} + #endif /* -------------------------------------------------------------------------- */ diff --git a/utils/xmlgrep/xml.h b/utils/xmlgrep/xml.h index 26c55098f..52843857e 100644 --- a/utils/xmlgrep/xml.h +++ b/utils/xmlgrep/xml.h @@ -325,7 +325,6 @@ double xmlNodeGetDouble(const void *, const char *); double xmlAttributeGetDouble(const void *, const char *); -#ifndef XML_NONVALIDATING /** * Get the error number of the last error and clear it. * @@ -361,7 +360,6 @@ size_t xmlErrorGetColumnNo(const void *, int); * @return a string that explains the last error. */ const char *xmlErrorGetString(const void *, int); -#endif #ifdef __cplusplus } -- 2.39.5