Commit 6b6d6809 authored by Daniel Veillard's avatar Daniel Veillard

fixing compilations when disabling parts of the library at configure time.

* runsuite.c runtest.c tree.c: fixing compilations when
  disabling parts of the library at configure time.
Daniel
parent 304e78c6
Sun Jul 3 22:59:28 CEST 2005 Daniel Veillard <daniel@veillard.com>
* runsuite.c runtest.c tree.c: fixing compilations when
disabling parts of the library at configure time.
Sun Jul 3 18:17:58 CEST 2005 Daniel Veillard <daniel@veillard.com> Sun Jul 3 18:17:58 CEST 2005 Daniel Veillard <daniel@veillard.com>
* parserInternals.c: fix bug raised by zamez on IRC * parserInternals.c: fix bug raised by zamez on IRC
......
...@@ -743,7 +743,7 @@ done: ...@@ -743,7 +743,7 @@ done:
static int static int
xstcTestInstance(int verbose, xmlNodePtr cur, xmlSchemaPtr schemas, xstcTestInstance(int verbose, xmlNodePtr cur, xmlSchemaPtr schemas,
const xmlChar *spath, const xmlChar *base) { const xmlChar *spath, const char *base) {
xmlChar *href = NULL; xmlChar *href = NULL;
xmlChar *path = NULL; xmlChar *path = NULL;
xmlChar *validity = NULL; xmlChar *validity = NULL;
...@@ -952,7 +952,7 @@ xstcMetadata(int verbose, const char *metadata, const char *base) { ...@@ -952,7 +952,7 @@ xstcMetadata(int verbose, const char *metadata, const char *base) {
xmlNodePtr cur; xmlNodePtr cur;
xmlChar *contributor; xmlChar *contributor;
xmlChar *name; xmlChar *name;
int ret; int ret = 0;
doc = xmlReadFile(metadata, NULL, XML_PARSE_NOENT); doc = xmlReadFile(metadata, NULL, XML_PARSE_NOENT);
if (doc == NULL) { if (doc == NULL) {
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
#include <libxml/parser.h> #include <libxml/parser.h>
#include <libxml/tree.h> #include <libxml/tree.h>
#include <libxml/uri.h> #include <libxml/uri.h>
#ifdef LIBXML_OUTPUT_ENABLED
#ifdef LIBXML_READER_ENABLED #ifdef LIBXML_READER_ENABLED
#include <libxml/xmlreader.h> #include <libxml/xmlreader.h>
#endif #endif
...@@ -1388,6 +1390,7 @@ xmlSAXHandler debugSAX2HandlerStruct = { ...@@ -1388,6 +1390,7 @@ xmlSAXHandler debugSAX2HandlerStruct = {
xmlSAXHandlerPtr debugSAX2Handler = &debugSAX2HandlerStruct; xmlSAXHandlerPtr debugSAX2Handler = &debugSAX2HandlerStruct;
#ifdef LIBXML_HTML_ENABLED
/** /**
* htmlstartElementDebug: * htmlstartElementDebug:
* @ctxt: An XML parser context * @ctxt: An XML parser context
...@@ -1501,6 +1504,9 @@ xmlSAXHandler debugHTMLSAXHandlerStruct = { ...@@ -1501,6 +1504,9 @@ xmlSAXHandler debugHTMLSAXHandlerStruct = {
}; };
xmlSAXHandlerPtr debugHTMLSAXHandler = &debugHTMLSAXHandlerStruct; xmlSAXHandlerPtr debugHTMLSAXHandler = &debugHTMLSAXHandlerStruct;
#endif /* LIBXML_HTML_ENABLED */
#ifdef LIBXML_SAX1_ENABLED
/** /**
* saxParseTest: * saxParseTest:
* @filename: the file to parse * @filename: the file to parse
...@@ -1579,6 +1585,7 @@ saxParseTest(const char *filename, const char *result, ...@@ -1579,6 +1585,7 @@ saxParseTest(const char *filename, const char *result,
return(ret); return(ret);
} }
#endif
/************************************************************************ /************************************************************************
* * * *
...@@ -1609,7 +1616,11 @@ oldParseTest(const char *filename, const char *result, ...@@ -1609,7 +1616,11 @@ oldParseTest(const char *filename, const char *result,
/* /*
* base of the test, parse with the old API * base of the test, parse with the old API
*/ */
#ifdef LIBXML_SAX1_ENABLED
doc = xmlParseFile(filename); doc = xmlParseFile(filename);
#else
doc = xmlReadFile(filename, NULL, 0);
#endif
if (doc == NULL) if (doc == NULL)
return(1); return(1);
temp = resultFilename(filename, "", ".res"); temp = resultFilename(filename, "", ".res");
...@@ -1626,7 +1637,11 @@ oldParseTest(const char *filename, const char *result, ...@@ -1626,7 +1637,11 @@ oldParseTest(const char *filename, const char *result,
/* /*
* Parse the saved result to make sure the round trip is okay * Parse the saved result to make sure the round trip is okay
*/ */
#ifdef LIBXML_SAX1_ENABLED
doc = xmlParseFile(temp); doc = xmlParseFile(temp);
#else
doc = xmlReadFile(temp, NULL, 0);
#endif
if (doc == NULL) if (doc == NULL)
return(1); return(1);
xmlSaveFile(temp, doc); xmlSaveFile(temp, doc);
...@@ -3817,12 +3832,14 @@ testDesc testDescriptions[] = { ...@@ -3817,12 +3832,14 @@ testDesc testDescriptions[] = {
walkerParseTest, "./test/*", "result/", ".rdr", NULL, walkerParseTest, "./test/*", "result/", ".rdr", NULL,
0 }, 0 },
#endif #endif
#ifdef LIBXML_SAX1_ENABLED
{ "SAX1 callbacks regression tests" , { "SAX1 callbacks regression tests" ,
saxParseTest, "./test/*", "result/", ".sax", NULL, saxParseTest, "./test/*", "result/", ".sax", NULL,
XML_PARSE_SAX1 }, XML_PARSE_SAX1 },
{ "SAX2 callbacks regression tests" , { "SAX2 callbacks regression tests" ,
saxParseTest, "./test/*", "result/", ".sax2", NULL, saxParseTest, "./test/*", "result/", ".sax2", NULL,
0 }, 0 },
#endif
#ifdef LIBXML_PUSH_ENABLED #ifdef LIBXML_PUSH_ENABLED
{ "XML push regression tests" , { "XML push regression tests" ,
pushParseTest, "./test/*", "result/", "", NULL, pushParseTest, "./test/*", "result/", "", NULL,
...@@ -3837,10 +3854,12 @@ testDesc testDescriptions[] = { ...@@ -3837,10 +3854,12 @@ testDesc testDescriptions[] = {
pushParseTest, "./test/HTML/*", "result/HTML/", "", ".err", pushParseTest, "./test/HTML/*", "result/HTML/", "", ".err",
XML_PARSE_HTML }, XML_PARSE_HTML },
#endif #endif
#ifdef LIBXML_SAX1_ENABLED
{ "HTML SAX regression tests" , { "HTML SAX regression tests" ,
saxParseTest, "./test/HTML/*", "result/HTML/", ".sax", NULL, saxParseTest, "./test/HTML/*", "result/HTML/", ".sax", NULL,
XML_PARSE_HTML }, XML_PARSE_HTML },
#endif #endif
#endif
#ifdef LIBXML_VALID_ENABLED #ifdef LIBXML_VALID_ENABLED
{ "Valid documents regression tests" , { "Valid documents regression tests" ,
errParseTest, "./test/VCM/*", NULL, NULL, NULL, errParseTest, "./test/VCM/*", NULL, NULL, NULL,
...@@ -4061,3 +4080,11 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { ...@@ -4061,3 +4080,11 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
return(ret); return(ret);
} }
#else /* ! LIBXML_OUTPUT_ENABLED */
int
main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
fprintf(stderr, "runtest requires output to be enabled in libxml2\n");
return(1);
}
#endif
...@@ -333,7 +333,7 @@ xmlSplitQName3(const xmlChar *name, int *len) { ...@@ -333,7 +333,7 @@ xmlSplitQName3(const xmlChar *name, int *len) {
#define CUR_SCHAR(s, l) xmlStringCurrentChar(NULL, s, &l) #define CUR_SCHAR(s, l) xmlStringCurrentChar(NULL, s, &l)
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) #if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined (LIBXML_HTML_ENABLED)
/** /**
* xmlValidateNCName: * xmlValidateNCName:
* @value: the value to check * @value: the value to check
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment