summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2003-09-29 13:20:24 +0000
committerDaniel Veillard <veillard@src.gnome.org>2003-09-29 13:20:24 +0000
commita9cce9cd0d7aff3ec318b5d8d376da131b6aaad4 (patch)
treeba5ba1b51fea7936c5ca1b90e23c2004df34c703
parentc064b476c8736c8c601e4d8fc480a5d998d9441f (diff)
downloadlibxml2-a9cce9cd0d7aff3ec318b5d8d376da131b6aaad4.tar.gz
Okay this is scary but it is just adding a configure option to disable
* HTMLtree.c SAX2.c c14n.c catalog.c configure.in debugXML.c encoding.c entities.c nanoftp.c nanohttp.c parser.c relaxng.c testAutomata.c testC14N.c testHTML.c testRegexp.c testRelax.c testSchemas.c testXPath.c threads.c tree.c valid.c xmlIO.c xmlcatalog.c xmllint.c xmlmemory.c xmlreader.c xmlschemas.c example/gjobread.c include/libxml/HTMLtree.h include/libxml/c14n.h include/libxml/catalog.h include/libxml/debugXML.h include/libxml/entities.h include/libxml/nanohttp.h include/libxml/relaxng.h include/libxml/tree.h include/libxml/valid.h include/libxml/xmlIO.h include/libxml/xmlschemas.h include/libxml/xmlversion.h.in include/libxml/xpathInternals.h python/libxml.c: Okay this is scary but it is just adding a configure option to disable output, this touches most of the files. Daniel
-rw-r--r--ChangeLog17
-rw-r--r--HTMLtree.c3
-rw-r--r--SAX2.c2
-rw-r--r--c14n.c2
-rw-r--r--catalog.c6
-rw-r--r--configure.in16
-rw-r--r--debugXML.c22
-rw-r--r--encoding.c18
-rw-r--r--entities.c2
-rw-r--r--example/gjobread.c2
-rw-r--r--include/libxml/HTMLtree.h7
-rw-r--r--include/libxml/c14n.h2
-rw-r--r--include/libxml/catalog.h4
-rw-r--r--include/libxml/debugXML.h2
-rw-r--r--include/libxml/entities.h2
-rw-r--r--include/libxml/nanohttp.h2
-rw-r--r--include/libxml/relaxng.h2
-rw-r--r--include/libxml/tree.h9
-rw-r--r--include/libxml/valid.h6
-rw-r--r--include/libxml/xmlIO.h10
-rw-r--r--include/libxml/xmlschemas.h2
-rw-r--r--include/libxml/xmlversion.h.in9
-rw-r--r--include/libxml/xpathInternals.h3
-rw-r--r--nanoftp.c3
-rw-r--r--nanohttp.c6
-rw-r--r--parser.c2
-rw-r--r--python/libxml.c13
-rw-r--r--relaxng.c2
-rw-r--r--testAutomata.c2
-rw-r--r--testC14N.c6
-rw-r--r--testHTML.c4
-rw-r--r--testRegexp.c2
-rw-r--r--testRelax.c4
-rw-r--r--testSchemas.c4
-rw-r--r--testXPath.c2
-rw-r--r--threads.c4
-rw-r--r--tree.c117
-rw-r--r--valid.c16
-rw-r--r--xmlIO.c46
-rw-r--r--xmlcatalog.c6
-rw-r--r--xmllint.c38
-rw-r--r--xmlmemory.c2
-rw-r--r--xmlreader.c21
-rw-r--r--xmlschemas.c2
44 files changed, 341 insertions, 111 deletions
diff --git a/ChangeLog b/ChangeLog
index d1ba77ff..8c8942ee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+Mon Sep 29 15:15:08 CEST 2003 Daniel Veillard <daniel@veillard.com>
+
+ * HTMLtree.c SAX2.c c14n.c catalog.c configure.in debugXML.c
+ encoding.c entities.c nanoftp.c nanohttp.c parser.c relaxng.c
+ testAutomata.c testC14N.c testHTML.c testRegexp.c testRelax.c
+ testSchemas.c testXPath.c threads.c tree.c valid.c xmlIO.c
+ xmlcatalog.c xmllint.c xmlmemory.c xmlreader.c xmlschemas.c
+ example/gjobread.c include/libxml/HTMLtree.h include/libxml/c14n.h
+ include/libxml/catalog.h include/libxml/debugXML.h
+ include/libxml/entities.h include/libxml/nanohttp.h
+ include/libxml/relaxng.h include/libxml/tree.h
+ include/libxml/valid.h include/libxml/xmlIO.h
+ include/libxml/xmlschemas.h include/libxml/xmlversion.h.in
+ include/libxml/xpathInternals.h python/libxml.c:
+ Okay this is scary but it is just adding a configure option
+ to disable output, this touches most of the files.
+
Mon Sep 29 12:53:56 CEST 2003 Daniel Veillard <daniel@veillard.com>
* xmlmemory.c: better fix, avoids breaking the python bindings
diff --git a/HTMLtree.c b/HTMLtree.c
index 7571731b..41ce1eef 100644
--- a/HTMLtree.c
+++ b/HTMLtree.c
@@ -315,6 +315,7 @@ htmlIsBooleanAttr(const xmlChar *name)
return 0;
}
+#ifdef LIBXML_OUTPUT_ENABLED
/************************************************************************
* *
* Dumping HTML tree content to a simple buffer *
@@ -1135,6 +1136,6 @@ htmlSaveFileEnc(const char *filename, xmlDocPtr cur, const char *encoding) {
return(htmlSaveFileFormat(filename, cur, encoding, 1));
}
-
+#endif /* LIBXML_OUTPUT_ENABLED */
#endif /* LIBXML_HTML_ENABLED */
diff --git a/SAX2.c b/SAX2.c
index 261842fb..450db5be 100644
--- a/SAX2.c
+++ b/SAX2.c
@@ -871,7 +871,7 @@ xmlSAX2EndDocument(void *ctx)
*/
static void
xmlSAX2AttributeInternal(void *ctx, const xmlChar *fullname,
- const xmlChar *value, const xmlChar *prefix)
+ const xmlChar *value, const xmlChar *prefix ATTRIBUTE_UNUSED)
{
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlAttrPtr ret;
diff --git a/c14n.c b/c14n.c
index 89589ca6..620c9a38 100644
--- a/c14n.c
+++ b/c14n.c
@@ -12,6 +12,7 @@
#define IN_LIBXML
#include "libxml.h"
#ifdef LIBXML_C14N_ENABLED
+#ifdef LIBXML_OUTPUT_ENABLED
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
@@ -1927,4 +1928,5 @@ xmlC11NNormalizeString(const xmlChar * input,
*out++ = 0;
return (buffer);
}
+#endif /* LIBXML_OUTPUT_ENABLED */
#endif /* LIBXML_C14N_ENABLED */
diff --git a/catalog.c b/catalog.c
index d307bf4e..6ff22a1b 100644
--- a/catalog.c
+++ b/catalog.c
@@ -374,6 +374,7 @@ xmlFreeCatalog(xmlCatalogPtr catal) {
* *
************************************************************************/
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlCatalogDumpEntry:
* @entry: the
@@ -587,6 +588,7 @@ BAD_CAST "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd");
return(ret);
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/************************************************************************
* *
@@ -2682,6 +2684,7 @@ xmlACatalogResolveURI(xmlCatalogPtr catal, const xmlChar *URI) {
return(ret);
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlACatalogDump:
* @catal: a Catalog
@@ -2701,6 +2704,7 @@ xmlACatalogDump(xmlCatalogPtr catal, FILE *out) {
(xmlHashScanner) xmlCatalogDumpEntry, out);
}
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
* xmlACatalogAdd:
@@ -3097,6 +3101,7 @@ xmlCatalogResolveURI(const xmlChar *URI) {
return(ret);
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlCatalogDump:
* @out: the file.
@@ -3113,6 +3118,7 @@ xmlCatalogDump(FILE *out) {
xmlACatalogDump(xmlDefaultCatalog, out);
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
* xmlCatalogAdd:
diff --git a/configure.in b/configure.in
index 57bafa00..7b747764 100644
--- a/configure.in
+++ b/configure.in
@@ -527,8 +527,20 @@ if test "$with_history" = "yes" ; then
LDFLAGS=${_ldflags}
fi
-AC_SUBST(WITH_FTP)
-AC_SUBST(FTP_OBJ)
+AC_ARG_WITH(output,
+[ --with-output add the serialization support (on)])
+if test "$with_minimum" = "yes" -a "$with_output" = ""
+then
+ with_output=no
+fi
+if test "$with_output" = "no" ; then
+ echo Disabling serialization/saving support
+ WITH_OUTPUT=0
+else
+ WITH_OUTPUT=1
+fi
+AC_SUBST(WITH_OUTPUT)
+
AC_ARG_WITH(ftp,
[ --with-ftp add the FTP support (on)])
if test "$with_minimum" = "yes" -a "$with_ftp" = ""
diff --git a/debugXML.c b/debugXML.c
index 61097115..57a09fe8 100644
--- a/debugXML.c
+++ b/debugXML.c
@@ -1346,6 +1346,7 @@ xmlShellPrintXPathError(int errorType, const char *arg)
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlShellPrintNodeCtxt:
* @ctxt : a non-null shell context
@@ -1386,6 +1387,7 @@ xmlShellPrintNode(xmlNodePtr node)
{
xmlShellPrintNodeCtxt(NULL, node);
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
* xmlShellPrintXPathResultCtxt:
@@ -1397,20 +1399,18 @@ xmlShellPrintNode(xmlNodePtr node)
static void
xmlShellPrintXPathResultCtxt(xmlShellCtxtPtr ctxt,xmlXPathObjectPtr list)
{
- int i = 0;
if (!ctxt)
return;
if (list != NULL) {
switch (list->type) {
case XPATH_NODESET:{
+#ifdef LIBXML_OUTPUT_ENABLED
int indx;
if (list->nodesetval) {
for (indx = 0; indx < list->nodesetval->nodeNr;
indx++) {
- if (i > 0)
- fprintf(stderr, " -------\n");
xmlShellPrintNodeCtxt(ctxt,
list->nodesetval->nodeTab[indx]);
}
@@ -1419,6 +1419,10 @@ xmlShellPrintXPathResultCtxt(xmlShellCtxtPtr ctxt,xmlXPathObjectPtr list)
"Empty node set\n");
}
break;
+#else
+ xmlGenericError(xmlGenericErrorContext,
+ "Node set\n");
+#endif /* LIBXML_OUTPUT_ENABLED */
}
case XPATH_BOOLEAN:
xmlGenericError(xmlGenericErrorContext,
@@ -1664,6 +1668,7 @@ xmlShellDir(xmlShellCtxtPtr ctxt ATTRIBUTE_UNUSED,
return (0);
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlShellCat:
* @ctxt: the shell context
@@ -1707,6 +1712,7 @@ xmlShellCat(xmlShellCtxtPtr ctxt, char *arg ATTRIBUTE_UNUSED,
fprintf(ctxt->output, "\n");
return (0);
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
* xmlShellLoad:
@@ -1761,6 +1767,7 @@ xmlShellLoad(xmlShellCtxtPtr ctxt, char *filename,
return (0);
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlShellWrite:
* @ctxt: the shell context
@@ -1887,6 +1894,7 @@ xmlShellSave(xmlShellCtxtPtr ctxt, char *filename,
}
return (0);
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
* xmlShellValidate:
@@ -2178,18 +2186,22 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
#endif /* LIBXML_XPATH_ENABLED */
fprintf(ctxt->output, "\tpwd display current working directory\n");
fprintf(ctxt->output, "\tquit leave shell\n");
+#ifdef LIBXML_OUTPUT_ENABLED
fprintf(ctxt->output, "\tsave [name] save this document to name or the original name\n");
- fprintf(ctxt->output, "\tvalidate check the document for errors\n");
fprintf(ctxt->output, "\twrite [name] write the current node to the filename\n");
+#endif /* LIBXML_OUTPUT_ENABLED */
+ fprintf(ctxt->output, "\tvalidate check the document for errors\n");
fprintf(ctxt->output, "\tgrep string search for a string in the subtree\n");
} else if (!strcmp(command, "validate")) {
xmlShellValidate(ctxt, arg, NULL, NULL);
} else if (!strcmp(command, "load")) {
xmlShellLoad(ctxt, arg, NULL, NULL);
+#ifdef LIBXML_OUTPUT_ENABLED
} else if (!strcmp(command, "save")) {
xmlShellSave(ctxt, arg, NULL, NULL);
} else if (!strcmp(command, "write")) {
xmlShellWrite(ctxt, arg, NULL, NULL);
+#endif /* LIBXML_OUTPUT_ENABLED */
} else if (!strcmp(command, "grep")) {
xmlShellGrep(ctxt, arg, ctxt->node, NULL);
} else if (!strcmp(command, "free")) {
@@ -2389,6 +2401,7 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
}
ctxt->pctxt->node = NULL;
}
+#ifdef LIBXML_OUTPUT_ENABLED
} else if (!strcmp(command, "cat")) {
if (arg[0] == 0) {
xmlShellCat(ctxt, NULL, ctxt->node, NULL);
@@ -2466,6 +2479,7 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
}
ctxt->pctxt->node = NULL;
}
+#endif /* LIBXML_OUTPUT_ENABLED */
} else {
xmlGenericError(xmlGenericErrorContext,
"Unknown command %s\n", command);
diff --git a/encoding.c b/encoding.c
index 25f8cc3e..302cf568 100644
--- a/encoding.c
+++ b/encoding.c
@@ -512,6 +512,7 @@ asciiToUTF8(unsigned char* out, int *outlen,
return(0);
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* UTF8Toascii:
* @out: a pointer to an array of bytes to store the result
@@ -594,6 +595,7 @@ UTF8Toascii(unsigned char* out, int *outlen,
*inlen = processed - instart;
return(0);
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
* isolat1ToUTF8:
@@ -683,6 +685,7 @@ UTF8ToUTF8(unsigned char* out, int *outlen,
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* UTF8Toisolat1:
* @out: a pointer to an array of bytes to store the result
@@ -770,6 +773,7 @@ UTF8Toisolat1(unsigned char* out, int *outlen,
*inlen = processed - instart;
return(0);
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
* UTF16LEToUTF8:
@@ -859,6 +863,7 @@ UTF16LEToUTF8(unsigned char* out, int *outlen,
return(0);
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* UTF8ToUTF16LE:
* @outb: a pointer to an array of bytes to store the result
@@ -978,6 +983,7 @@ UTF8ToUTF16LE(unsigned char* outb, int *outlen,
*inlen = processed - instart;
return(0);
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
* UTF16BEToUTF8:
@@ -1071,6 +1077,7 @@ UTF16BEToUTF8(unsigned char* out, int *outlen,
return(0);
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* UTF8ToUTF16BE:
* @outb: a pointer to an array of bytes to store the result
@@ -1187,6 +1194,7 @@ UTF8ToUTF16BE(unsigned char* outb, int *outlen,
*inlen = processed - instart;
return(0);
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/************************************************************************
* *
@@ -1673,6 +1681,7 @@ xmlInitCharEncodingHandlers(void) {
return;
}
xmlNewCharEncodingHandler("UTF-8", UTF8ToUTF8, UTF8ToUTF8);
+#ifdef LIBXML_OUTPUT_ENABLED
xmlUTF16LEHandler =
xmlNewCharEncodingHandler("UTF-16LE", UTF16LEToUTF8, UTF8ToUTF16LE);
xmlUTF16BEHandler =
@@ -1683,6 +1692,15 @@ xmlInitCharEncodingHandlers(void) {
#ifdef LIBXML_HTML_ENABLED
xmlNewCharEncodingHandler("HTML", NULL, UTF8ToHtml);
#endif
+#else
+ xmlUTF16LEHandler =
+ xmlNewCharEncodingHandler("UTF-16LE", UTF16LEToUTF8, NULL);
+ xmlUTF16BEHandler =
+ xmlNewCharEncodingHandler("UTF-16BE", UTF16BEToUTF8, NULL);
+ xmlNewCharEncodingHandler("ISO-8859-1", isolat1ToUTF8, NULL);
+ xmlNewCharEncodingHandler("ASCII", asciiToUTF8, NULL);
+ xmlNewCharEncodingHandler("US-ASCII", asciiToUTF8, NULL);
+#endif /* LIBXML_OUTPUT_ENABLED */
#ifndef LIBXML_ICONV_ENABLED
#ifdef LIBXML_ISO8859X_ENABLED
xmlRegisterCharEncodingHandlersISO8859x ();
diff --git a/entities.c b/entities.c
index ae6fe488..85f0d18b 100644
--- a/entities.c
+++ b/entities.c
@@ -754,6 +754,7 @@ xmlCopyEntitiesTable(xmlEntitiesTablePtr table) {
return(xmlHashCopy(table, (xmlHashCopier) xmlCopyEntity));
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlDumpEntityDecl:
* @buf: An XML buffer.
@@ -851,3 +852,4 @@ void
xmlDumpEntitiesTable(xmlBufferPtr buf, xmlEntitiesTablePtr table) {
xmlHashScan(table, (xmlHashScanner)xmlDumpEntityDecl, buf);
}
+#endif /* LIBXML_OUTPUT_ENABLED */
diff --git a/example/gjobread.c b/example/gjobread.c
index 599ece8b..a447959b 100644
--- a/example/gjobread.c
+++ b/example/gjobread.c
@@ -240,8 +240,10 @@ parseGjobFile(char *filename) {
fprintf(stderr,"document of the wrong type, was '%s', Jobs expected",
cur->name);
fprintf(stderr,"xmlDocDump follows\n");
+#ifdef LIBXML_OUTPUT_ENABLED
xmlDocDump ( stderr, doc );
fprintf(stderr,"xmlDocDump finished\n");
+#endif /* LIBXML_OUTPUT_ENABLED */
xmlFreeDoc(doc);
free(ret);
return(NULL);
diff --git a/include/libxml/HTMLtree.h b/include/libxml/HTMLtree.h
index c40df38c..832c7c8e 100644
--- a/include/libxml/HTMLtree.h
+++ b/include/libxml/HTMLtree.h
@@ -68,6 +68,7 @@ XMLPUBFUN const xmlChar * XMLCALL
XMLPUBFUN int XMLCALL
htmlSetMetaEncoding (htmlDocPtr doc,
const xmlChar *encoding);
+#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL
htmlDocDumpMemory (xmlDocPtr cur,
xmlChar **mem,
@@ -117,16 +118,16 @@ XMLPUBFUN void XMLCALL
xmlDocPtr cur,
const char *encoding,
int format);
-
-XMLPUBFUN int XMLCALL
- htmlIsBooleanAttr (const xmlChar *name);
XMLPUBFUN void XMLCALL
htmlNodeDumpOutput (xmlOutputBufferPtr buf,
xmlDocPtr doc,
xmlNodePtr cur,
const char *encoding);
+#endif /* LIBXML_OUTPUT_ENABLED */
+XMLPUBFUN int XMLCALL
+ htmlIsBooleanAttr (const xmlChar *name);
#ifdef __cplusplus
diff --git a/include/libxml/c14n.h b/include/libxml/c14n.h
index a2d9aed3..8a78929f 100644
--- a/include/libxml/c14n.h
+++ b/include/libxml/c14n.h
@@ -11,6 +11,7 @@
*/
#ifndef __XML_C14N_H__
#define __XML_C14N_H__
+#ifdef LIBXML_OUTPUT_ENABLED
#ifdef __cplusplus
extern "C" {
@@ -92,5 +93,6 @@ XMLPUBFUN int XMLCALL
}
#endif /* __cplusplus */
+#endif /* LIBXML_OUTPUT_ENABLED */
#endif /* __XML_C14N_H__ */
diff --git a/include/libxml/catalog.h b/include/libxml/catalog.h
index 689e7ce1..c8a5ac33 100644
--- a/include/libxml/catalog.h
+++ b/include/libxml/catalog.h
@@ -91,9 +91,11 @@ XMLPUBFUN xmlChar * XMLCALL
XMLPUBFUN xmlChar * XMLCALL
xmlACatalogResolveURI (xmlCatalogPtr catal,
const xmlChar *URI);
+#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL
xmlACatalogDump (xmlCatalogPtr catal,
FILE *out);
+#endif /* LIBXML_OUTPUT_ENABLED */
XMLPUBFUN void XMLCALL
xmlFreeCatalog (xmlCatalogPtr catal);
XMLPUBFUN int XMLCALL
@@ -110,8 +112,10 @@ XMLPUBFUN void XMLCALL
xmlLoadCatalogs (const char *paths);
XMLPUBFUN void XMLCALL
xmlCatalogCleanup (void);
+#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL
xmlCatalogDump (FILE *out);
+#endif /* LIBXML_OUTPUT_ENABLED */
XMLPUBFUN xmlChar * XMLCALL
xmlCatalogResolve (const xmlChar *pubID,
const xmlChar *sysID);
diff --git a/include/libxml/debugXML.h b/include/libxml/debugXML.h
index f71e670a..58211eb0 100644
--- a/include/libxml/debugXML.h
+++ b/include/libxml/debugXML.h
@@ -148,6 +148,7 @@ XMLPUBFUN int XMLCALL
char *filename,
xmlNodePtr node,
xmlNodePtr node2);
+#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN int XMLCALL
xmlShellWrite (xmlShellCtxtPtr ctxt,
char *filename,
@@ -158,6 +159,7 @@ XMLPUBFUN int XMLCALL
char *filename,
xmlNodePtr node,
xmlNodePtr node2);
+#endif /* LIBXML_OUTPUT_ENABLED */
XMLPUBFUN int XMLCALL
xmlShellValidate (xmlShellCtxtPtr ctxt,
char *dtd,
diff --git a/include/libxml/entities.h b/include/libxml/entities.h
index 63558636..515913db 100644
--- a/include/libxml/entities.h
+++ b/include/libxml/entities.h
@@ -110,12 +110,14 @@ XMLPUBFUN xmlEntitiesTablePtr XMLCALL
xmlCopyEntitiesTable (xmlEntitiesTablePtr table);
XMLPUBFUN void XMLCALL
xmlFreeEntitiesTable (xmlEntitiesTablePtr table);
+#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL
xmlDumpEntitiesTable (xmlBufferPtr buf,
xmlEntitiesTablePtr table);
XMLPUBFUN void XMLCALL
xmlDumpEntityDecl (xmlBufferPtr buf,
xmlEntityPtr ent);
+#endif /* LIBXML_OUTPUT_ENABLED */
XMLPUBFUN void XMLCALL
xmlCleanupPredefinedEntities(void);
diff --git a/include/libxml/nanohttp.h b/include/libxml/nanohttp.h
index 8897fda4..87990aa0 100644
--- a/include/libxml/nanohttp.h
+++ b/include/libxml/nanohttp.h
@@ -56,9 +56,11 @@ XMLPUBFUN int XMLCALL
xmlNanoHTTPRead (void *ctx,
void *dest,
int len);
+#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN int XMLCALL
xmlNanoHTTPSave (void *ctxt,
const char *filename);
+#endif /* LIBXML_OUTPUT_ENABLED */
XMLPUBFUN void XMLCALL
xmlNanoHTTPClose (void *ctx);
#ifdef __cplusplus
diff --git a/include/libxml/relaxng.h b/include/libxml/relaxng.h
index 2129eea3..25fea441 100644
--- a/include/libxml/relaxng.h
+++ b/include/libxml/relaxng.h
@@ -103,12 +103,14 @@ XMLPUBFUN xmlRelaxNGPtr XMLCALL
xmlRelaxNGParse (xmlRelaxNGParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
xmlRelaxNGFree (xmlRelaxNGPtr schema);
+#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL
xmlRelaxNGDump (FILE *output,
xmlRelaxNGPtr schema);
XMLPUBFUN void XMLCALL
xmlRelaxNGDumpTree (FILE * output,
xmlRelaxNGPtr schema);
+#endif /* LIBXML_OUTPUT_ENABLED */
/*
* Interfaces for validating
*/
diff --git a/include/libxml/tree.h b/include/libxml/tree.h
index 686364fa..41656270 100644
--- a/include/libxml/tree.h
+++ b/include/libxml/tree.h
@@ -533,13 +533,6 @@ struct _xmlDoc {
/*
* Variables.
*/
-#if 0
-LIBXML_DLL_IMPORT extern int oldXMLWDcompatibility;/* maintain compatibility with old WD */
-LIBXML_DLL_IMPORT extern int xmlIndentTreeOutput; /* try to indent the tree dumps */
-LIBXML_DLL_IMPORT extern xmlBufferAllocationScheme xmlBufferAllocScheme; /* alloc scheme to use */
-LIBXML_DLL_IMPORT extern int xmlSaveNoEmptyTags; /* save empty tags as <empty></empty> */
-LIBXML_DLL_IMPORT extern int xmlDefaultBufferSize; /* default buffer size */
-#endif
/*
* Some helper functions
@@ -961,6 +954,7 @@ XMLPUBFUN int XMLCALL
xmlReconciliateNs (xmlDocPtr doc,
xmlNodePtr tree);
+#ifdef LIBXML_OUTPUT_ENABLED
/*
* Saving.
*/
@@ -1037,6 +1031,7 @@ XMLPUBFUN int XMLCALL
xmlDocPtr cur,
const char *encoding);
+#endif /* LIBXML_OUTPUT_ENABLED */
/*
* XHTML
*/
diff --git a/include/libxml/valid.h b/include/libxml/valid.h
index 46b36dad..cb7ff2cc 100644
--- a/include/libxml/valid.h
+++ b/include/libxml/valid.h
@@ -145,12 +145,14 @@ XMLPUBFUN xmlNotationTablePtr XMLCALL
xmlCopyNotationTable (xmlNotationTablePtr table);
XMLPUBFUN void XMLCALL
xmlFreeNotationTable (xmlNotationTablePtr table);
+#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL
xmlDumpNotationDecl (xmlBufferPtr buf,
xmlNotationPtr nota);
XMLPUBFUN void XMLCALL
xmlDumpNotationTable (xmlBufferPtr buf,
xmlNotationTablePtr table);
+#endif /* LIBXML_OUTPUT_ENABLED */
/* Element Content */
XMLPUBFUN xmlElementContentPtr XMLCALL
@@ -183,12 +185,14 @@ XMLPUBFUN xmlElementTablePtr XMLCALL
xmlCopyElementTable (xmlElementTablePtr table);
XMLPUBFUN void XMLCALL
xmlFreeElementTable (xmlElementTablePtr table);
+#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL
xmlDumpElementTable (xmlBufferPtr buf,
xmlElementTablePtr table);
XMLPUBFUN void XMLCALL
xmlDumpElementDecl (xmlBufferPtr buf,
xmlElementPtr elem);
+#endif /* LIBXML_OUTPUT_ENABLED */
/* Enumeration */
XMLPUBFUN xmlEnumerationPtr XMLCALL
@@ -213,12 +217,14 @@ XMLPUBFUN xmlAttributeTablePtr XMLCALL
xmlCopyAttributeTable (xmlAttributeTablePtr table);
XMLPUBFUN void XMLCALL
xmlFreeAttributeTable (xmlAttributeTablePtr table);
+#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL
xmlDumpAttributeTable (xmlBufferPtr buf,
xmlAttributeTablePtr table);
XMLPUBFUN void XMLCALL
xmlDumpAttributeDecl (xmlBufferPtr buf,
xmlAttributePtr attr);
+#endif /* LIBXML_OUTPUT_ENABLED */
/* IDs */
XMLPUBFUN xmlIDPtr XMLCALL
diff --git a/include/libxml/xmlIO.h b/include/libxml/xmlIO.h
index 244c950f..a212f8ee 100644
--- a/include/libxml/xmlIO.h
+++ b/include/libxml/xmlIO.h
@@ -62,6 +62,7 @@ typedef int (*xmlInputReadCallback) (void * context, char * buffer, int len);
*/
typedef int (*xmlInputCloseCallback) (void * context);
+#ifdef LIBXML_OUTPUT_ENABLED
/*
* Those are the functions and datatypes for the library output
* I/O structures.
@@ -107,6 +108,7 @@ typedef int (*xmlOutputWriteCallback) (void * context, const char * buffer,
* Returns 0 or -1 in case of error
*/
typedef int (*xmlOutputCloseCallback) (void * context);
+#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef __cplusplus
}
@@ -133,6 +135,7 @@ struct _xmlParserInputBuffer {
};
+#ifdef LIBXML_OUTPUT_ENABLED
struct _xmlOutputBuffer {
void* context;
xmlOutputWriteCallback writecallback;
@@ -144,14 +147,13 @@ struct _xmlOutputBuffer {
xmlBufferPtr conv; /* if encoder != NULL buffer for output */
int written; /* total number of byte written */
};
+#endif /* LIBXML_OUTPUT_ENABLED */
/*
* Interfaces for input
*/
XMLPUBFUN void XMLCALL
xmlCleanupInputCallbacks (void);
-XMLPUBFUN void XMLCALL
- xmlCleanupOutputCallbacks (void);
XMLPUBFUN void XMLCALL
xmlRegisterDefaultInputCallbacks (void);
@@ -198,10 +200,13 @@ XMLPUBFUN int XMLCALL
xmlInputOpenCallback openFunc,
xmlInputReadCallback readFunc,
xmlInputCloseCallback closeFunc);
+#ifdef LIBXML_OUTPUT_ENABLED
/*
* Interfaces for output
*/
XMLPUBFUN void XMLCALL
+ xmlCleanupOutputCallbacks (void);
+XMLPUBFUN void XMLCALL
xmlRegisterDefaultOutputCallbacks(void);
XMLPUBFUN xmlOutputBufferPtr XMLCALL
xmlAllocOutputBuffer (xmlCharEncodingHandlerPtr encoder);
@@ -243,6 +248,7 @@ XMLPUBFUN int XMLCALL
xmlOutputOpenCallback openFunc,
xmlOutputWriteCallback writeFunc,
xmlOutputCloseCallback closeFunc);
+#endif /* LIBXML_OUTPUT_ENABLED */
/* This function only exists if HTTP support built into the library */
#ifdef LIBXML_HTTP_ENABLED
diff --git a/include/libxml/xmlschemas.h b/include/libxml/xmlschemas.h
index 11751444..0e563f4e 100644
--- a/include/libxml/xmlschemas.h
+++ b/include/libxml/xmlschemas.h
@@ -88,9 +88,11 @@ XMLPUBFUN xmlSchemaPtr XMLCALL
xmlSchemaParse (xmlSchemaParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL
xmlSchemaFree (xmlSchemaPtr schema);
+#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL
xmlSchemaDump (FILE *output,
xmlSchemaPtr schema);
+#endif /* LIBXML_OUTPUT_ENABLED */
/*
* Interfaces for validating
*/
diff --git a/include/libxml/xmlversion.h.in b/include/libxml/xmlversion.h.in
index ef1a3351..61b45ca8 100644
--- a/include/libxml/xmlversion.h.in
+++ b/include/libxml/xmlversion.h.in
@@ -84,6 +84,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
#endif
/**
+ * LIBXML_OUTPUT_ENABLED:
+ *
+ * Whether the serialization/saving support is configured in
+ */
+#if @WITH_OUTPUT@
+#define LIBXML_OUTPUT_ENABLED
+#endif
+
+/**
* LIBXML_FTP_ENABLED:
*
* Whether the FTP support is configured in
diff --git a/include/libxml/xpathInternals.h b/include/libxml/xpathInternals.h
index d74b9ddb..6b9e9965 100644
--- a/include/libxml/xpathInternals.h
+++ b/include/libxml/xpathInternals.h
@@ -377,6 +377,7 @@ XMLPUBFUN void XMLCALL
int line,
int no);
+#ifdef LIBXML_DEBUG_ENABLED
XMLPUBFUN void XMLCALL
xmlXPathDebugDumpObject (FILE *output,
xmlXPathObjectPtr cur,
@@ -385,7 +386,7 @@ XMLPUBFUN void XMLCALL
xmlXPathDebugDumpCompExpr(FILE *output,
xmlXPathCompExprPtr comp,
int depth);
-
+#endif
/**
* NodeSet handling.
*/
diff --git a/nanoftp.c b/nanoftp.c
index 43ac8ac3..b6043a08 100644
--- a/nanoftp.c
+++ b/nanoftp.c
@@ -90,13 +90,16 @@
* A couple portability macros
*/
#ifndef _WINSOCKAPI_
+#ifndef __BEOS__
#define closesocket(s) close(s)
+#endif
#define SOCKET int
#endif
#if defined(VMS) || defined(__VMS)
#define SOCKLEN_T unsigned int
#endif
+
#define FTP_COMMAND_OK 200
#define FTP_SYNTAX_ERROR 500
#define FTP_GET_PASSWD 331
diff --git a/nanohttp.c b/nanohttp.c
index 15cc94dd..5072d37f 100644
--- a/nanohttp.c
+++ b/nanohttp.c
@@ -95,7 +95,9 @@
* A couple portability macros
*/
#ifndef _WINSOCKAPI_
+#ifndef __BEOS__
#define closesocket(s) close(s)
+#endif
#define SOCKET int
#endif
@@ -922,6 +924,7 @@ xmlNanoHTTPConnectAttempt(struct sockaddr *addr)
if ( FD_ISSET(s, &wfd) ) {
SOCKLEN_T len;
len = sizeof(status);
+#ifdef SO_ERROR
if (getsockopt(s, SOL_SOCKET, SO_ERROR, (char*)&status, &len) < 0 ) {
/* Solaris error code */
xmlGenericError( xmlGenericErrorContext,
@@ -930,6 +933,7 @@ xmlNanoHTTPConnectAttempt(struct sockaddr *addr)
strerror( socket_errno( ) ) );
return (-1);
}
+#endif
if ( status ) {
closesocket(s);
errno = status;
@@ -1510,6 +1514,7 @@ xmlNanoHTTPFetch(const char *URL, const char *filename, char **contentType) {
return(0);
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlNanoHTTPSave:
* @ctxt: the HTTP context
@@ -1546,6 +1551,7 @@ xmlNanoHTTPSave(void *ctxt, const char *filename) {
xmlNanoHTTPClose(ctxt);
return(0);
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
* xmlNanoHTTPReturnCode:
diff --git a/parser.c b/parser.c
index 746d2b00..438dd3c6 100644
--- a/parser.c
+++ b/parser.c
@@ -11974,7 +11974,9 @@ xmlInitParser(void) {
xmlInitializePredefinedEntities();
xmlDefaultSAXHandlerInit();
xmlRegisterDefaultInputCallbacks();
+#ifdef LIBXML_OUTPUT_ENABLED
xmlRegisterDefaultOutputCallbacks();
+#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef LIBXML_HTML_ENABLED
htmlInitAutoClose();
htmlDefaultSAXHandlerInit();
diff --git a/python/libxml.c b/python/libxml.c
index cd71ff17..6f3ca8b8 100644
--- a/python/libxml.c
+++ b/python/libxml.c
@@ -319,6 +319,7 @@ xmlPythonFileClose (void * context) {
return(0);
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlOutputBufferCreatePythonFile:
* @file: a PyFile_Type
@@ -368,6 +369,7 @@ libxml_xmlCreateOutputBuffer(ATTRIBUTE_UNUSED PyObject *self, PyObject *args) {
py_retval = libxml_xmlOutputBufferPtrWrap(buffer);
return(py_retval);
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
@@ -1056,7 +1058,10 @@ static xmlSAXHandler pythonSaxHandler = {
NULL, /* TODO pythonGetParameterEntity, */
pythonCdataBlock,
pythonExternalSubset,
- 1
+ 1,
+ NULL, /* TODO mograte to SAX2 */
+ NULL,
+ NULL
};
/************************************************************************
@@ -2299,6 +2304,7 @@ libxml_xmlNodeGetNs(ATTRIBUTE_UNUSED PyObject * self, PyObject * args)
return (py_retval);
}
+#ifdef LIBXML_OUTPUT_ENABLED
/************************************************************************
* *
* Serialization front-end *
@@ -2524,6 +2530,7 @@ libxml_saveNodeTo(ATTRIBUTE_UNUSED PyObject * self, PyObject * args)
}
return (PyInt_FromLong((long) len));
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/************************************************************************
* *
@@ -2773,9 +2780,11 @@ static PyMethodDef libxmlMethods[] = {
{(char *) "type", libxml_type, METH_VARARGS, NULL},
{(char *) "doc", libxml_doc, METH_VARARGS, NULL},
{(char *) "xmlNewNode", libxml_xmlNewNode, METH_VARARGS, NULL},
+#ifdef LIBXML_OUTPUT_ENABLED
{(char *) "serializeNode", libxml_serializeNode, METH_VARARGS, NULL},
{(char *) "saveNodeTo", libxml_saveNodeTo, METH_VARARGS, NULL},
{(char *) "outputBufferCreate", libxml_xmlCreateOutputBuffer, METH_VARARGS, NULL},
+#endif /* LIBXML_OUTPUT_ENABLED */
{(char *) "inputBufferCreate", libxml_xmlCreateInputBuffer, METH_VARARGS, NULL},
{(char *) "setEntityLoader", libxml_xmlSetEntityLoader, METH_VARARGS, NULL},
{(char *)"xmlRegisterErrorHandler", libxml_xmlRegisterErrorHandler, METH_VARARGS, NULL },
@@ -2807,7 +2816,9 @@ initlibxml2mod(void)
return;
/* XXX xmlInitParser does much more than this */
xmlInitGlobals();
+#ifdef LIBXML_OUTPUT_ENABLED
xmlRegisterDefaultOutputCallbacks();
+#endif /* LIBXML_OUTPUT_ENABLED */
xmlRegisterDefaultInputCallbacks();
m = Py_InitModule((char *) "libxml2mod", libxmlMethods);
initialized = 1;
diff --git a/relaxng.c b/relaxng.c
index b1c2e000..ad157188 100644
--- a/relaxng.c
+++ b/relaxng.c
@@ -7405,6 +7405,7 @@ xmlRelaxNGGetParserErrors(xmlRelaxNGParserCtxtPtr ctxt,
return(0);
}
+#ifdef LIBXML_OUTPUT_ENABLED
/************************************************************************
* *
* Dump back a compiled form *
@@ -7635,6 +7636,7 @@ xmlRelaxNGDumpTree(FILE * output, xmlRelaxNGPtr schema)
xmlDocDump(output, schema->doc);
}
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/************************************************************************
* *
diff --git a/testAutomata.c b/testAutomata.c
index 747d13e5..07be2cc5 100644
--- a/testAutomata.c
+++ b/testAutomata.c
@@ -300,7 +300,7 @@ int main(int argc, char **argv) {
#else
#include <stdio.h>
-int main(int argc, char **argv) {
+int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
printf("%s : Automata support not compiled in\n", argv[0]);
return(0);
}
diff --git a/testC14N.c b/testC14N.c
index bdacc227..6a36a684 100644
--- a/testC14N.c
+++ b/testC14N.c
@@ -7,7 +7,7 @@
* Author: Aleksey Sanin <aleksey@aleksey.com>
*/
#include "libxml.h"
-#if defined(LIBXML_C14N_ENABLED)
+#if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
#include <stdio.h>
#include <string.h>
@@ -348,8 +348,8 @@ print_xpath_nodes(xmlNodeSetPtr nodes) {
#else
#include <stdio.h>
-int main(int argc, char **argv) {
- printf("%s : XPath/Canonicalization support not compiled in\n", argv[0]);
+int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
+ printf("%s : XPath/Canonicalization and output support not compiled in\n", argv[0]);
return(0);
}
#endif /* LIBXML_C14N_ENABLED */
diff --git a/testHTML.c b/testHTML.c
index 81233248..4067fd4d 100644
--- a/testHTML.c
+++ b/testHTML.c
@@ -742,6 +742,7 @@ parseAndPrintFile(char *filename) {
xmlFreeDoc(tmp);
}
+#ifdef LIBXML_OUTPUT_ENABLED
/*
* print it.
*/
@@ -761,6 +762,7 @@ parseAndPrintFile(char *filename) {
htmlDocDump(stdout, doc);
#endif
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/*
* free it.
@@ -839,7 +841,7 @@ int main(int argc, char **argv) {
}
#else /* !LIBXML_HTML_ENABLED */
#include <stdio.h>
-int main(int argc, char **argv) {
+int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
printf("%s : HTML support not compiled in\n", argv[0]);
return(0);
}
diff --git a/testRegexp.c b/testRegexp.c
index c0a5cbca..7f344148 100644
--- a/testRegexp.c
+++ b/testRegexp.c
@@ -151,7 +151,7 @@ int main(int argc, char **argv) {
#else
#include <stdio.h>
-int main(int argc, char **argv) {
+int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
printf("%s : Regexp support not compiled in\n", argv[0]);
return(0);
}
diff --git a/testRelax.c b/testRelax.c
index c930b519..dee47156 100644
--- a/testRelax.c
+++ b/testRelax.c
@@ -123,12 +123,14 @@ int main(int argc, char **argv) {
files = -1;
break;
}
+#ifdef LIBXML_OUTPUT_ENABLED
#ifdef LIBXML_DEBUG_ENABLED
if (debug)
xmlRelaxNGDump(stdout, schema);
#endif
if (tree)
xmlRelaxNGDumpTree(stdout, schema);
+#endif /* LIBXML_OUTPUT_ENABLED */
} else {
xmlDocPtr doc;
@@ -185,7 +187,7 @@ int main(int argc, char **argv) {
#else
#include <stdio.h>
-int main(int argc, char **argv) {
+int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
printf("%s : RelaxNG support not compiled in\n", argv[0]);
return(0);
}
diff --git a/testSchemas.c b/testSchemas.c
index 54e36d0d..27025187 100644
--- a/testSchemas.c
+++ b/testSchemas.c
@@ -114,10 +114,12 @@ int main(int argc, char **argv) {
schema = xmlSchemaParse(ctxt);
xmlSchemaFreeParserCtxt(ctxt);
}
+#ifdef LIBXML_OUTPUT_ENABLED
#ifdef LIBXML_DEBUG_ENABLED
if (debug)
xmlSchemaDump(stdout, schema);
#endif
+#endif /* LIBXML_OUTPUT_ENABLED */
} else {
xmlDocPtr doc;
@@ -173,7 +175,7 @@ int main(int argc, char **argv) {
#else
#include <stdio.h>
-int main(int argc, char **argv) {
+int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
printf("%s : Schemas support not compiled in\n", argv[0]);
return(0);
}
diff --git a/testXPath.c b/testXPath.c
index 8d138084..bdb7358b 100644
--- a/testXPath.c
+++ b/testXPath.c
@@ -220,7 +220,7 @@ int main(int argc, char **argv) {
}
#else
#include <stdio.h>
-int main(int argc, char **argv) {
+int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
printf("%s : XPath/Debug support not compiled in\n", argv[0]);
return(0);
}
diff --git a/threads.c b/threads.c
index c6464495..b51caa21 100644
--- a/threads.c
+++ b/threads.c
@@ -99,7 +99,9 @@ static int run_once_init = 1;
#endif /* HAVE_WIN32_THREADS */
static xmlRMutexPtr xmlLibraryLock = NULL;
+#ifdef LIBXML_THREAD_ENABLED
static void xmlOnceInit(void);
+#endif
/**
* xmlNewMutex:
@@ -527,6 +529,7 @@ xmlCleanupThreads(void)
#endif
}
+#ifdef LIBXML_THREAD_ENABLED
/**
* xmlOnceInit
*
@@ -550,6 +553,7 @@ xmlOnceInit(void) {
mainthread = GetCurrentThreadId();
#endif
}
+#endif
/**
* DllMain:
diff --git a/tree.c b/tree.c
index b372e43e..8dd86d62 100644
--- a/tree.c
+++ b/tree.c
@@ -6789,6 +6789,7 @@ xmlBufferWriteQuotedString(xmlBufferPtr buf, const xmlChar *string) {
}
+#ifdef LIBXML_OUTPUT_ENABLED
/************************************************************************
* *
* Dumping XML tree content to a simple buffer *
@@ -7567,6 +7568,7 @@ xmlDocContentDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr cur,
}
}
}
+#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef LIBXML_HTML_ENABLED
/************************************************************************
@@ -7615,6 +7617,7 @@ xmlIsXHTML(const xmlChar *systemID, const xmlChar *publicID) {
return(0);
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xhtmlIsEmpty:
* @node: the node
@@ -8059,8 +8062,10 @@ xhtmlNodeDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur,
xmlOutputBufferWriteString(buf, (const char *)cur->name);
xmlOutputBufferWriteString(buf, ">");
}
+#endif /* LIBXML_OUTPUT_ENABLED */
#endif
+#ifdef LIBXML_OUTPUT_ENABLED
/************************************************************************
* *
* Saving functions front-ends *
@@ -8211,61 +8216,6 @@ xmlDocDumpMemoryEnc(xmlDocPtr out_doc, xmlChar **doc_txt_ptr,
}
/**
- * xmlGetDocCompressMode:
- * @doc: the document
- *
- * get the compression ratio for a document, ZLIB based
- * Returns 0 (uncompressed) to 9 (max compression)
- */
-int
-xmlGetDocCompressMode (xmlDocPtr doc) {
- if (doc == NULL) return(-1);
- return(doc->compression);
-}
-
-/**
- * xmlSetDocCompressMode:
- * @doc: the document
- * @mode: the compression ratio
- *
- * set the compression ratio for a document, ZLIB based
- * Correct values: 0 (uncompressed) to 9 (max compression)
- */
-void
-xmlSetDocCompressMode (xmlDocPtr doc, int mode) {
- if (doc == NULL) return;
- if (mode < 0) doc->compression = 0;
- else if (mode > 9) doc->compression = 9;
- else doc->compression = mode;
-}
-
-/**
- * xmlGetCompressMode:
- *
- * get the default compression mode used, ZLIB based.
- * Returns 0 (uncompressed) to 9 (max compression)
- */
-int
-xmlGetCompressMode(void)
-{
- return (xmlCompressMode);
-}
-
-/**
- * xmlSetCompressMode:
- * @mode: the compression ratio
- *
- * set the default compression mode used, ZLIB based
- * Correct values: 0 (uncompressed) to 9 (max compression)
- */
-void
-xmlSetCompressMode(int mode) {
- if (mode < 0) xmlCompressMode = 0;
- else if (mode > 9) xmlCompressMode = 9;
- else xmlCompressMode = mode;
-}
-
-/**
* xmlDocFormatDump:
* @f: the FILE*
* @cur: the document
@@ -8463,3 +8413,60 @@ xmlSaveFile(const char *filename, xmlDocPtr cur) {
return(xmlSaveFormatFileEnc(filename, cur, NULL, 0));
}
+#endif /* LIBXML_OUTPUT_ENABLED */
+
+/**
+ * xmlGetDocCompressMode:
+ * @doc: the document
+ *
+ * get the compression ratio for a document, ZLIB based
+ * Returns 0 (uncompressed) to 9 (max compression)
+ */
+int
+xmlGetDocCompressMode (xmlDocPtr doc) {
+ if (doc == NULL) return(-1);
+ return(doc->compression);
+}
+
+/**
+ * xmlSetDocCompressMode:
+ * @doc: the document
+ * @mode: the compression ratio
+ *
+ * set the compression ratio for a document, ZLIB based
+ * Correct values: 0 (uncompressed) to 9 (max compression)
+ */
+void
+xmlSetDocCompressMode (xmlDocPtr doc, int mode) {
+ if (doc == NULL) return;
+ if (mode < 0) doc->compression = 0;
+ else if (mode > 9) doc->compression = 9;
+ else doc->compression = mode;
+}
+
+/**
+ * xmlGetCompressMode:
+ *
+ * get the default compression mode used, ZLIB based.
+ * Returns 0 (uncompressed) to 9 (max compression)
+ */
+int
+xmlGetCompressMode(void)
+{
+ return (xmlCompressMode);
+}
+
+/**
+ * xmlSetCompressMode:
+ * @mode: the compression ratio
+ *
+ * set the default compression mode used, ZLIB based
+ * Correct values: 0 (uncompressed) to 9 (max compression)
+ */
+void
+xmlSetCompressMode(int mode) {
+ if (mode < 0) xmlCompressMode = 0;
+ else if (mode > 9) xmlCompressMode = 9;
+ else xmlCompressMode = mode;
+}
+
diff --git a/valid.c b/valid.c
index b1555a8d..7ebd686b 100644
--- a/valid.c
+++ b/valid.c
@@ -827,6 +827,7 @@ xmlFreeElementContent(xmlElementContentPtr cur) {
xmlFree(cur);
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlDumpElementContent:
* @buf: An XML buffer
@@ -910,6 +911,7 @@ xmlSprintfElementContent(char *buf ATTRIBUTE_UNUSED,
xmlElementContentPtr content ATTRIBUTE_UNUSED,
int glob ATTRIBUTE_UNUSED) {
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
* xmlSnprintfElementContent:
@@ -1065,7 +1067,8 @@ xmlFreeElement(xmlElementPtr elem) {
* Returns NULL if not, otherwise the entity
*/
xmlElementPtr
-xmlAddElementDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *name,
+xmlAddElementDecl(xmlValidCtxtPtr ctxt ATTRIBUTE_UNUSED,
+ xmlDtdPtr dtd, const xmlChar *name,
xmlElementTypeVal type,
xmlElementContentPtr content) {
xmlElementPtr ret;
@@ -1312,6 +1315,7 @@ xmlCopyElementTable(xmlElementTablePtr table) {
(xmlHashCopier) xmlCopyElement));
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlDumpElementDecl:
* @buf: the XML buffer output
@@ -1381,6 +1385,7 @@ void
xmlDumpElementTable(xmlBufferPtr buf, xmlElementTablePtr table) {
xmlHashScan(table, (xmlHashScanner) xmlDumpElementDecl, buf);
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
* xmlCreateEnumeration:
@@ -1447,6 +1452,7 @@ xmlCopyEnumeration(xmlEnumerationPtr cur) {
return(ret);
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlDumpEnumeration:
* @buf: the XML buffer output
@@ -1466,6 +1472,7 @@ xmlDumpEnumeration(xmlBufferPtr buf, xmlEnumerationPtr cur) {
xmlDumpEnumeration(buf, cur->next);
}
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
* xmlCreateAttributeTable:
@@ -1605,7 +1612,8 @@ xmlFreeAttribute(xmlAttributePtr attr) {
* Returns NULL if not new, otherwise the attribute decl
*/
xmlAttributePtr
-xmlAddAttributeDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *elem,
+xmlAddAttributeDecl(xmlValidCtxtPtr ctxt ATTRIBUTE_UNUSED,
+ xmlDtdPtr dtd, const xmlChar *elem,
const xmlChar *name, const xmlChar *ns,
xmlAttributeType type, xmlAttributeDefault def,
const xmlChar *defaultValue, xmlEnumerationPtr tree) {
@@ -1858,6 +1866,7 @@ xmlCopyAttributeTable(xmlAttributeTablePtr table) {
(xmlHashCopier) xmlCopyAttribute));
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlDumpAttributeDecl:
* @buf: the XML buffer output
@@ -1949,6 +1958,7 @@ void
xmlDumpAttributeTable(xmlBufferPtr buf, xmlAttributeTablePtr table) {
xmlHashScan(table, (xmlHashScanner) xmlDumpAttributeDecl, buf);
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/************************************************************************
* *
@@ -2124,6 +2134,7 @@ xmlCopyNotationTable(xmlNotationTablePtr table) {
(xmlHashCopier) xmlCopyNotation));
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlDumpNotationDecl:
* @buf: the XML buffer output
@@ -2160,6 +2171,7 @@ void
xmlDumpNotationTable(xmlBufferPtr buf, xmlNotationTablePtr table) {
xmlHashScan(table, (xmlHashScanner) xmlDumpNotationDecl, buf);
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/************************************************************************
* *
diff --git a/xmlIO.c b/xmlIO.c
index 7992f18b..c1eb3584 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -105,6 +105,7 @@ static xmlInputCallback xmlInputCallbackTable[MAX_INPUT_CALLBACK];
static int xmlInputCallbackNr = 0;
static int xmlInputCallbackInitialized = 0;
+#ifdef LIBXML_OUTPUT_ENABLED
/*
* Output I/O callback sets
*/
@@ -120,6 +121,7 @@ typedef struct _xmlOutputCallback {
static xmlOutputCallback xmlOutputCallbackTable[MAX_OUTPUT_CALLBACK];
static int xmlOutputCallbackNr = 0;
static int xmlOutputCallbackInitialized = 0;
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
@@ -162,6 +164,7 @@ xmlCleanupInputCallbacks(void)
xmlInputCallbackInitialized = 0;
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlCleanupOutputCallbacks:
*
@@ -186,6 +189,7 @@ xmlCleanupOutputCallbacks(void)
xmlOutputCallbackNr = 0;
xmlOutputCallbackInitialized = 0;
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/************************************************************************
* *
@@ -245,6 +249,7 @@ xmlFdRead (void * context, char * buffer, int len) {
return(read((int) (long) context, &buffer[0], len));
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlFdWrite:
* @context: the I/O context
@@ -259,6 +264,7 @@ static int
xmlFdWrite (void * context, const char * buffer, int len) {
return(write((int) (long) context, &buffer[0], len));
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
* xmlFdClose:
@@ -356,6 +362,7 @@ xmlFileOpen (const char *filename) {
return retval;
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlFileOpenW:
* @filename: the URI for matching
@@ -396,6 +403,7 @@ xmlFileOpenW (const char *filename) {
fd = fopen(path, "wb");
return((void *) fd);
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
* xmlFileRead:
@@ -412,6 +420,7 @@ xmlFileRead (void * context, char * buffer, int len) {
return(fread(&buffer[0], 1, len, (FILE *) context));
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlFileWrite:
* @context: the I/O context
@@ -430,6 +439,7 @@ xmlFileWrite (void * context, const char * buffer, int len) {
return(items * len);
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
* xmlFileClose:
@@ -549,6 +559,7 @@ xmlGzfileOpen (const char *filename) {
return retval;
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlGzfileOpenW:
* @filename: the URI for matching
@@ -592,6 +603,7 @@ xmlGzfileOpenW (const char *filename, int compression) {
fd = gzopen(path, mode);
return((void *) fd);
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
* xmlGzfileRead:
@@ -608,6 +620,7 @@ xmlGzfileRead (void * context, char * buffer, int len) {
return(gzread((gzFile) context, &buffer[0], len));
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlGzfileWrite:
* @context: the I/O context
@@ -622,6 +635,7 @@ static int
xmlGzfileWrite (void * context, const char * buffer, int len) {
return(gzwrite((gzFile) context, (char *) &buffer[0], len));
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
* xmlGzfileClose:
@@ -642,6 +656,7 @@ xmlGzfileClose (void * context) {
* *
************************************************************************/
+#ifdef LIBXML_OUTPUT_ENABLED
typedef struct xmlIOHTTPWriteCtxt_
{
int compression;
@@ -974,8 +989,10 @@ xmlZMemBuffGetContent( xmlZMemBuffPtr buff, char ** data_ref ) {
return ( zlgth );
}
+#endif /* LIBXML_OUTPUT_ENABLED */
#endif /* HAVE_ZLIB_H */
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlFreeHTTPWriteCtxt
* @ctxt: Context to cleanup
@@ -1006,6 +1023,7 @@ xmlFreeHTTPWriteCtxt( xmlIOHTTPWriteCtxtPtr ctxt )
xmlFree( ctxt );
return;
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
@@ -1036,6 +1054,7 @@ xmlIOHTTPOpen (const char *filename) {
return(xmlNanoHTTPOpen(filename, NULL));
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlIOHTTPOpenW:
* @post_uri: The destination URI for the document
@@ -1099,7 +1118,9 @@ xmlIOHTTPOpenW(const char *post_uri, int compression)
return (ctxt);
}
+#endif /* LIBXML_OUTPUT_ENABLED */
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlIOHTTPDfltOpenW
* @post_uri: The destination URI for this document.
@@ -1114,6 +1135,7 @@ static void *
xmlIOHTTPDfltOpenW( const char * post_uri ) {
return ( xmlIOHTTPOpenW( post_uri, 0 ) );
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
* xmlIOHTTPRead:
@@ -1130,6 +1152,7 @@ xmlIOHTTPRead(void * context, char * buffer, int len) {
return(xmlNanoHTTPRead(context, &buffer[0], len));
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlIOHTTPWrite
* @context: previously opened writing context
@@ -1173,6 +1196,7 @@ xmlIOHTTPWrite( void * context, const char * buffer, int len ) {
return ( len );
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
@@ -1189,6 +1213,7 @@ xmlIOHTTPClose (void * context) {
return 0;
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlIOHTTCloseWrite
* @context: The I/O context
@@ -1345,6 +1370,7 @@ static int
xmlIOHTTPClosePost( void * ctxt ) {
return ( xmlIOHTTPCloseWrite( ctxt, "POST" ) );
}
+#endif /* LIBXML_OUTPUT_ENABLED */
#endif /* LIBXML_HTTP_ENABLED */
@@ -1438,6 +1464,7 @@ xmlRegisterInputCallbacks(xmlInputMatchCallback matchFunc,
return(xmlInputCallbackNr++);
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlRegisterOutputCallbacks:
* @matchFunc: the xmlOutputMatchCallback
@@ -1463,6 +1490,7 @@ xmlRegisterOutputCallbacks(xmlOutputMatchCallback matchFunc,
xmlOutputCallbackInitialized = 1;
return(xmlOutputCallbackNr++);
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
* xmlRegisterDefaultInputCallbacks:
@@ -1494,6 +1522,7 @@ xmlRegisterDefaultInputCallbacks
xmlInputCallbackInitialized = 1;
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlRegisterDefaultOutputCallbacks:
*
@@ -1554,6 +1583,7 @@ xmlRegisterHTTPPostCallbacks( void ) {
return;
}
#endif
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
* xmlAllocParserInputBuffer:
@@ -1593,6 +1623,7 @@ xmlAllocParserInputBuffer(xmlCharEncoding enc) {
return(ret);
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlAllocOutputBuffer:
* @encoder: the encoding converter or NULL
@@ -1634,6 +1665,7 @@ xmlAllocOutputBuffer(xmlCharEncodingHandlerPtr encoder) {
return(ret);
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
* xmlFreeParserInputBuffer:
@@ -1663,6 +1695,7 @@ xmlFreeParserInputBuffer(xmlParserInputBufferPtr in) {
xmlFree(in);
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlOutputBufferClose:
* @out: a buffered output
@@ -1700,6 +1733,7 @@ xmlOutputBufferClose(xmlOutputBufferPtr out) {
xmlFree(out);
return( ( err_rc == 0 ) ? written : err_rc );
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
* xmlParserInputBufferCreateFilename:
@@ -1770,6 +1804,7 @@ xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc) {
return(ret);
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlOutputBufferCreateFilename:
* @URI: a C string containing the URI or filename
@@ -1788,7 +1823,7 @@ xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc) {
xmlOutputBufferPtr
xmlOutputBufferCreateFilename(const char *URI,
xmlCharEncodingHandlerPtr encoder,
- int compression) {
+ int compression ATTRIBUTE_UNUSED) {
xmlOutputBufferPtr ret;
int i = 0;
void *context = NULL;
@@ -1899,6 +1934,7 @@ xmlOutputBufferCreateFilename(const char *URI,
}
return(ret);
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
* xmlParserInputBufferCreateFile:
@@ -1929,6 +1965,7 @@ xmlParserInputBufferCreateFile(FILE *file, xmlCharEncoding enc) {
return(ret);
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlOutputBufferCreateFile:
* @file: a FILE*
@@ -1957,6 +1994,7 @@ xmlOutputBufferCreateFile(FILE *file, xmlCharEncodingHandlerPtr encoder) {
return(ret);
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
* xmlParserInputBufferCreateFd:
@@ -2059,6 +2097,7 @@ xmlParserInputBufferCreateStatic(const char *mem, int size,
return(ret);
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlOutputBufferCreateFd:
* @fd: a file descriptor number
@@ -2084,6 +2123,7 @@ xmlOutputBufferCreateFd(int fd, xmlCharEncodingHandlerPtr encoder) {
return(ret);
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
* xmlParserInputBufferCreateIO:
@@ -2114,6 +2154,7 @@ xmlParserInputBufferCreateIO(xmlInputReadCallback ioread,
return(ret);
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlOutputBufferCreateIO:
* @iowrite: an I/O write function
@@ -2143,6 +2184,7 @@ xmlOutputBufferCreateIO(xmlOutputWriteCallback iowrite,
return(ret);
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
* xmlParserInputBufferPush:
@@ -2320,6 +2362,7 @@ xmlParserInputBufferRead(xmlParserInputBufferPtr in, int len) {
return(-1);
}
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlOutputBufferWrite:
* @out: a buffered parser output
@@ -2497,6 +2540,7 @@ xmlOutputBufferFlush(xmlOutputBufferPtr out) {
#endif
return(ret);
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/**
* xmlParserGetDirectory:
diff --git a/xmlcatalog.c b/xmlcatalog.c
index 44c8e633..6e614ced 100644
--- a/xmlcatalog.c
+++ b/xmlcatalog.c
@@ -29,7 +29,7 @@
#include <libxml/parser.h>
#include <libxml/globals.h>
-#ifdef LIBXML_CATALOG_ENABLED
+#if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
static int shell = 0;
static int sgml = 0;
static int noout = 0;
@@ -580,8 +580,8 @@ int main(int argc, char **argv) {
return(exit_value);
}
#else
-int main(int argc, char **argv) {
- fprintf(stderr, "libxml was not compiled with catalog support\n");
+int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
+ fprintf(stderr, "libxml was not compiled with catalog and output support\n");
return(1);
}
#endif
diff --git a/xmllint.c b/xmllint.c
index 92d55478..60bbdb13 100644
--- a/xmllint.c
+++ b/xmllint.c
@@ -102,8 +102,14 @@ static int debug = 0;
static int copy = 0;
static int recovery = 0;
static int noent = 0;
+static int noblanks = 0;
static int noout = 0;
static int nowrap = 0;
+#ifdef LIBXML_OUTPUT_ENABLED
+static int format = 0;
+static const char *output = NULL;
+static int compress = 0;
+#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef LIBXML_VALID_ENABLED
static int valid = 0;
static int postvalid = 0;
@@ -118,7 +124,6 @@ static xmlSchemaPtr wxschemas = NULL;
#endif
static int repeat = 0;
static int insert = 0;
-static int compress = 0;
#ifdef LIBXML_HTML_ENABLED
static int html = 0;
#endif
@@ -127,8 +132,6 @@ static int push = 0;
#ifdef HAVE_SYS_MMAN_H
static int memory = 0;
#endif
-static int noblanks = 0;
-static int format = 0;
static int testIO = 0;
static char *encoding = NULL;
#ifdef LIBXML_XINCLUDE_ENABLED
@@ -147,7 +150,6 @@ static int nocatalogs = 0;
static int stream = 0;
static int chkregister = 0;
static int sax1 = 0;
-static const char *output = NULL;
static int options = 0;
/*
@@ -983,6 +985,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
}
}else
#endif /* LIBXML_VALID_ENABLED */
+#ifdef LIBXML_OUTPUT_ENABLED
if (noout == 0) {
/*
* print it.
@@ -1062,6 +1065,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
}
#endif
}
+#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef LIBXML_VALID_ENABLED
/*
@@ -1278,7 +1282,11 @@ static void showVersion(const char *name) {
static void usage(const char *name) {
printf("Usage : %s [options] XMLfiles ...\n", name);
+#ifdef LIBXML_OUTPUT_ENABLED
printf("\tParse the XML files and output the result of the parsing\n");
+#else
+ printf("\tParse the XML files\n");
+#endif /* LIBXML_OUTPUT_ENABLED */
printf("\t--version : display the version of the XML library used\n");
#ifdef LIBXML_DEBUG_ENABLED
printf("\t--debug : dump a debug tree of the in-memory document\n");
@@ -1304,9 +1312,11 @@ static void usage(const char *name) {
printf("\t--output file or -o file: save to a given file\n");
printf("\t--repeat : repeat 100 times, for timing or profiling\n");
printf("\t--insert : ad-hoc test for valid insertions\n");
+#ifdef LIBXML_OUTPUT_ENABLED
#ifdef HAVE_ZLIB_H
printf("\t--compress : turn on gzip compression of output\n");
#endif
+#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef LIBXML_HTML_ENABLED
printf("\t--html : use the HTML parser\n");
#endif
@@ -1317,10 +1327,13 @@ static void usage(const char *name) {
printf("\t--nowarning : do not emit warnings from parser/validator\n");
printf("\t--noblanks : drop (ignorable?) blanks spaces\n");
printf("\t--nocdata : replace cdata section with text nodes\n");
- printf("\t--nsclean : remove redundant namespace declarations\n");
+#ifdef LIBXML_OUTPUT_ENABLED
printf("\t--format : reformat/reindent the input\n");
- printf("\t--testIO : test user I/O support\n");
printf("\t--encode encoding : output in the given encoding\n");
+ printf("\t--dropdtd : remove the DOCTYPE of the input docs\n");
+#endif /* LIBXML_OUTPUT_ENABLED */
+ printf("\t--nsclean : remove redundant namespace declarations\n");
+ printf("\t--testIO : test user I/O support\n");
#ifdef LIBXML_CATALOG_ENABLED
printf("\t--catalogs : use SGML catalogs from $SGML_CATALOG_FILES\n");
printf("\t otherwise XML Catalogs starting from \n");
@@ -1333,7 +1346,6 @@ static void usage(const char *name) {
#endif
printf("\t--loaddtd : fetch external DTD\n");
printf("\t--dtdattr : loaddtd + populate the tree with inherited attributes \n");
- printf("\t--dropdtd : remove the DOCTYPE of the input docs\n");
printf("\t--stream : use the streaming interface to process very large files\n");
printf("\t--chkregister : verify the node registration code\n");
#ifdef LIBXML_SCHEMAS_ENABLED
@@ -1411,24 +1423,26 @@ main(int argc, char **argv) {
} else if ((!strcmp(argv[i], "-noout")) ||
(!strcmp(argv[i], "--noout")))
noout++;
+#ifdef LIBXML_OUTPUT_ENABLED
else if ((!strcmp(argv[i], "-o")) ||
(!strcmp(argv[i], "-output")) ||
(!strcmp(argv[i], "--output"))) {
i++;
output = argv[i];
}
+#endif /* LIBXML_OUTPUT_ENABLED */
else if ((!strcmp(argv[i], "-htmlout")) ||
(!strcmp(argv[i], "--htmlout")))
htmlout++;
+ else if ((!strcmp(argv[i], "-nowrap")) ||
+ (!strcmp(argv[i], "--nowrap")))
+ nowrap++;
#ifdef LIBXML_HTML_ENABLED
else if ((!strcmp(argv[i], "-html")) ||
(!strcmp(argv[i], "--html"))) {
html++;
}
#endif /* LIBXML_HTML_ENABLED */
- else if ((!strcmp(argv[i], "-nowrap")) ||
- (!strcmp(argv[i], "--nowrap")))
- nowrap++;
else if ((!strcmp(argv[i], "-loaddtd")) ||
(!strcmp(argv[i], "--loaddtd"))) {
loaddtd++;
@@ -1496,6 +1510,7 @@ main(int argc, char **argv) {
/* options |= XML_PARSE_XINCLUDE; */
}
#endif
+#ifdef LIBXML_OUTPUT_ENABLED
#ifdef HAVE_ZLIB_H
else if ((!strcmp(argv[i], "-compress")) ||
(!strcmp(argv[i], "--compress"))) {
@@ -1503,6 +1518,7 @@ main(int argc, char **argv) {
xmlSetCompressMode(9);
}
#endif
+#endif /* LIBXML_OUTPUT_ENABLED */
else if ((!strcmp(argv[i], "-nowarning")) ||
(!strcmp(argv[i], "--nowarning"))) {
xmlGetWarningsDefaultValue = 0;
@@ -1548,7 +1564,9 @@ main(int argc, char **argv) {
else if ((!strcmp(argv[i], "-format")) ||
(!strcmp(argv[i], "--format"))) {
noblanks++;
+#ifdef LIBXML_OUTPUT_ENABLED
format++;
+#endif /* LIBXML_OUTPUT_ENABLED */
xmlKeepBlanksDefault(0);
}
else if ((!strcmp(argv[i], "-stream")) ||
diff --git a/xmlmemory.c b/xmlmemory.c
index f61724f4..2059ef40 100644
--- a/xmlmemory.c
+++ b/xmlmemory.c
@@ -668,7 +668,9 @@ static void debugmem_tag_error(void *p)
#endif
}
+#ifdef MEM_LIST
static FILE *xmlMemoryDumpFile = NULL;
+#endif
/**
* xmlMemShow:
diff --git a/xmlreader.c b/xmlreader.c
index e7b5639e..2900a4c8 100644
--- a/xmlreader.c
+++ b/xmlreader.c
@@ -764,6 +764,7 @@ xmlTextReaderPushData(xmlTextReaderPtr reader) {
return(0);
}
+#ifdef LIBXML_REGEXP_ENABLED
/**
* xmlTextReaderValidatePush:
* @reader: the xmlTextReaderPtr used
@@ -771,8 +772,7 @@ xmlTextReaderPushData(xmlTextReaderPtr reader) {
* Push the current node for validation
*/
static void
-xmlTextReaderValidatePush(xmlTextReaderPtr reader) {
-#ifdef LIBXML_REGEXP_ENABLED
+xmlTextReaderValidatePush(xmlTextReaderPtr reader ATTRIBUTE_UNUSED) {
xmlNodePtr node = reader->node;
if ((reader->validate == XML_TEXTREADER_VALIDATE_DTD) &&
@@ -820,7 +820,6 @@ printf("Expand failed !\n");
reader->rngValidErrors++;
#endif
}
-#endif /* LIBXML_REGEXP_ENABLED */
}
/**
@@ -834,7 +833,6 @@ printf("Expand failed !\n");
static void
xmlTextReaderValidateCData(xmlTextReaderPtr reader,
const xmlChar *data, int len) {
-#ifdef LIBXML_REGEXP_ENABLED
if ((reader->validate == XML_TEXTREADER_VALIDATE_DTD) &&
(reader->ctxt != NULL) && (reader->ctxt->validate == 1)) {
reader->ctxt->valid &= xmlValidatePushCData(&reader->ctxt->vctxt,
@@ -850,7 +848,6 @@ xmlTextReaderValidateCData(xmlTextReaderPtr reader,
reader->rngValidErrors++;
#endif
}
-#endif /* LIBXML_REGEXP_ENABLED */
}
/**
@@ -861,7 +858,6 @@ xmlTextReaderValidateCData(xmlTextReaderPtr reader,
*/
static void
xmlTextReaderValidatePop(xmlTextReaderPtr reader) {
-#ifdef LIBXML_REGEXP_ENABLED
xmlNodePtr node = reader->node;
if ((reader->validate == XML_TEXTREADER_VALIDATE_DTD) &&
@@ -898,8 +894,8 @@ xmlTextReaderValidatePop(xmlTextReaderPtr reader) {
reader->rngValidErrors++;
#endif
}
-#endif /* LIBXML_REGEXP_ENABLED */
}
+
/**
* xmlTextReaderValidateEntity:
* @reader: the xmlTextReaderPtr used
@@ -910,7 +906,6 @@ xmlTextReaderValidatePop(xmlTextReaderPtr reader) {
*/
static void
xmlTextReaderValidateEntity(xmlTextReaderPtr reader) {
-#ifdef LIBXML_REGEXP_ENABLED
xmlNodePtr oldnode = reader->node;
xmlNodePtr node = reader->node;
xmlParserCtxtPtr ctxt = reader->ctxt;
@@ -941,6 +936,7 @@ xmlTextReaderValidateEntity(xmlTextReaderPtr reader) {
break;
node = node->next;
}
+#ifdef LIBXML_REGEXP_ENABLED
} else if (node->type == XML_ELEMENT_NODE) {
reader->node = node;
xmlTextReaderValidatePush(reader);
@@ -948,6 +944,7 @@ xmlTextReaderValidateEntity(xmlTextReaderPtr reader) {
(node->type == XML_CDATA_SECTION_NODE)) {
xmlTextReaderValidateCData(reader, node->content,
xmlStrlen(node->content));
+#endif
}
/*
@@ -991,8 +988,8 @@ xmlTextReaderValidateEntity(xmlTextReaderPtr reader) {
} while ((node != NULL) && (node != oldnode));
} while ((node != NULL) && (node != oldnode));
reader->node = oldnode;
-#endif /* LIBXML_REGEXP_ENABLED */
}
+#endif /* LIBXML_REGEXP_ENABLED */
/**
@@ -1155,9 +1152,11 @@ get_next_node:
reader->state = XML_TEXTREADER_END;
goto node_found;
}
+#ifdef LIBXML_REGEXP_ENABLED
if ((reader->validate) &&
(reader->node->type == XML_ELEMENT_NODE))
xmlTextReaderValidatePop(reader);
+#endif /* LIBXML_REGEXP_ENABLED */
reader->node = reader->node->next;
reader->state = XML_TEXTREADER_ELEMENT;
@@ -1183,8 +1182,10 @@ get_next_node:
reader->state = XML_TEXTREADER_END;
goto node_found;
}
+#ifdef LIBXML_REGEXP_ENABLED
if ((reader->validate) && (reader->node->type == XML_ELEMENT_NODE))
xmlTextReaderValidatePop(reader);
+#endif /* LIBXML_REGEXP_ENABLED */
reader->node = reader->node->parent;
if ((reader->node == NULL) ||
(reader->node->type == XML_DOCUMENT_NODE) ||
@@ -1249,10 +1250,12 @@ node_found:
xmlTextReaderEntPush(reader, reader->node);
reader->node = reader->node->children->children;
}
+#ifdef LIBXML_REGEXP_ENABLED
} else if ((reader->node != NULL) &&
(reader->node->type == XML_ENTITY_REF_NODE) &&
(reader->ctxt != NULL) && (reader->validate)) {
xmlTextReaderValidateEntity(reader);
+#endif /* LIBXML_REGEXP_ENABLED */
}
if ((reader->node != NULL) &&
(reader->node->type == XML_ENTITY_DECL) &&
diff --git a/xmlschemas.c b/xmlschemas.c
index 46f9f4c9..29128615 100644
--- a/xmlschemas.c
+++ b/xmlschemas.c
@@ -512,6 +512,7 @@ xmlSchemaErrorContext(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
* *
************************************************************************/
+#ifdef LIBXML_OUTPUT_ENABLED
/**
* xmlSchemaElementDump:
* @elem: an element
@@ -741,6 +742,7 @@ xmlSchemaDump(FILE * output, xmlSchemaPtr schema)
xmlHashScanFull(schema->elemDecl,
(xmlHashScannerFull) xmlSchemaElementDump, output);
}
+#endif /* LIBXML_OUTPUT_ENABLED */
/************************************************************************
* *