1
0
Fork 0

fixes for compiling without syntax validation.

This commit is contained in:
ehofman 2009-05-11 08:46:03 +00:00 committed by Tim Moore
parent 88478f03d0
commit 20ad439f42
2 changed files with 30 additions and 3 deletions

View file

@ -58,9 +58,9 @@ typedef struct
#include <assert.h>
#include <ctype.h>
#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
/* -------------------------------------------------------------------------- */

View file

@ -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
}