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
diff --git a/ChangeLog b/ChangeLog
index 53cc190..6fa18ca 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+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>
* parserInternals.c: fix bug raised by zamez on IRC
diff --git a/runsuite.c b/runsuite.c
index 23e98a5..e9fcc0c 100644
--- a/runsuite.c
+++ b/runsuite.c
@@ -743,7 +743,7 @@
static int
xstcTestInstance(int verbose, xmlNodePtr cur, xmlSchemaPtr schemas,
- const xmlChar *spath, const xmlChar *base) {
+ const xmlChar *spath, const char *base) {
xmlChar *href = NULL;
xmlChar *path = NULL;
xmlChar *validity = NULL;
@@ -952,7 +952,7 @@
xmlNodePtr cur;
xmlChar *contributor;
xmlChar *name;
- int ret;
+ int ret = 0;
doc = xmlReadFile(metadata, NULL, XML_PARSE_NOENT);
if (doc == NULL) {
diff --git a/runtest.c b/runtest.c
index 07f7d40..0854a07 100644
--- a/runtest.c
+++ b/runtest.c
@@ -20,6 +20,8 @@
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <libxml/uri.h>
+
+#ifdef LIBXML_OUTPUT_ENABLED
#ifdef LIBXML_READER_ENABLED
#include <libxml/xmlreader.h>
#endif
@@ -1388,6 +1390,7 @@
xmlSAXHandlerPtr debugSAX2Handler = &debugSAX2HandlerStruct;
+#ifdef LIBXML_HTML_ENABLED
/**
* htmlstartElementDebug:
* @ctxt: An XML parser context
@@ -1501,6 +1504,9 @@
};
xmlSAXHandlerPtr debugHTMLSAXHandler = &debugHTMLSAXHandlerStruct;
+#endif /* LIBXML_HTML_ENABLED */
+
+#ifdef LIBXML_SAX1_ENABLED
/**
* saxParseTest:
* @filename: the file to parse
@@ -1579,6 +1585,7 @@
return(ret);
}
+#endif
/************************************************************************
* *
@@ -1609,7 +1616,11 @@
/*
* base of the test, parse with the old API
*/
+#ifdef LIBXML_SAX1_ENABLED
doc = xmlParseFile(filename);
+#else
+ doc = xmlReadFile(filename, NULL, 0);
+#endif
if (doc == NULL)
return(1);
temp = resultFilename(filename, "", ".res");
@@ -1626,7 +1637,11 @@
/*
* Parse the saved result to make sure the round trip is okay
*/
+#ifdef LIBXML_SAX1_ENABLED
doc = xmlParseFile(temp);
+#else
+ doc = xmlReadFile(temp, NULL, 0);
+#endif
if (doc == NULL)
return(1);
xmlSaveFile(temp, doc);
@@ -3817,12 +3832,14 @@
walkerParseTest, "./test/*", "result/", ".rdr", NULL,
0 },
#endif
+#ifdef LIBXML_SAX1_ENABLED
{ "SAX1 callbacks regression tests" ,
saxParseTest, "./test/*", "result/", ".sax", NULL,
XML_PARSE_SAX1 },
{ "SAX2 callbacks regression tests" ,
saxParseTest, "./test/*", "result/", ".sax2", NULL,
0 },
+#endif
#ifdef LIBXML_PUSH_ENABLED
{ "XML push regression tests" ,
pushParseTest, "./test/*", "result/", "", NULL,
@@ -3837,10 +3854,12 @@
pushParseTest, "./test/HTML/*", "result/HTML/", "", ".err",
XML_PARSE_HTML },
#endif
+#ifdef LIBXML_SAX1_ENABLED
{ "HTML SAX regression tests" ,
saxParseTest, "./test/HTML/*", "result/HTML/", ".sax", NULL,
XML_PARSE_HTML },
#endif
+#endif
#ifdef LIBXML_VALID_ENABLED
{ "Valid documents regression tests" ,
errParseTest, "./test/VCM/*", NULL, NULL, NULL,
@@ -4061,3 +4080,11 @@
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
diff --git a/tree.c b/tree.c
index a5869a1..0e51cbc 100644
--- a/tree.c
+++ b/tree.c
@@ -333,7 +333,7 @@
#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:
* @value: the value to check