diff --git a/ChangeLog b/ChangeLog index 53cc190ac1f5dc1e30db17277dd84453bc752c3c..6fa18cab6161440f7cd2a35bef44ea7690e3c95d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Jul 3 22:59:28 CEST 2005 Daniel Veillard + + * 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 * parserInternals.c: fix bug raised by zamez on IRC diff --git a/runsuite.c b/runsuite.c index 23e98a546898f9f959c7369e661c4a65d449036b..e9fcc0c45d208db16fea2d8419dd263f16c6f9cd 100644 --- a/runsuite.c +++ b/runsuite.c @@ -743,7 +743,7 @@ done: 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 @@ xstcMetadata(int verbose, const char *metadata, const char *base) { 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 07f7d405780d72406b2c6e998d1d8455f53067d5..0854a07c0bf8e9eaec024eca6327d064350b57a5 100644 --- a/runtest.c +++ b/runtest.c @@ -20,6 +20,8 @@ #include #include #include + +#ifdef LIBXML_OUTPUT_ENABLED #ifdef LIBXML_READER_ENABLED #include #endif @@ -1388,6 +1390,7 @@ xmlSAXHandler debugSAX2HandlerStruct = { xmlSAXHandlerPtr debugSAX2Handler = &debugSAX2HandlerStruct; +#ifdef LIBXML_HTML_ENABLED /** * htmlstartElementDebug: * @ctxt: An XML parser context @@ -1501,6 +1504,9 @@ xmlSAXHandler debugHTMLSAXHandlerStruct = { }; xmlSAXHandlerPtr debugHTMLSAXHandler = &debugHTMLSAXHandlerStruct; +#endif /* LIBXML_HTML_ENABLED */ + +#ifdef LIBXML_SAX1_ENABLED /** * saxParseTest: * @filename: the file to parse @@ -1579,6 +1585,7 @@ saxParseTest(const char *filename, const char *result, return(ret); } +#endif /************************************************************************ * * @@ -1609,7 +1616,11 @@ oldParseTest(const char *filename, const char *result, /* * 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 @@ oldParseTest(const char *filename, const char *result, /* * 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 @@ testDesc testDescriptions[] = { 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 @@ testDesc testDescriptions[] = { 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 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) { 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 a5869a1eed24ad98eb754f72ff9f1e9db00f2629..0e51cbcdf231013be35bad709ca118e971a08c02 100644 --- a/tree.c +++ b/tree.c @@ -333,7 +333,7 @@ xmlSplitQName3(const xmlChar *name, int *len) { #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