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
This commit is contained in:
Daniel Veillard 2003-09-29 13:20:24 +00:00
parent c064b476c8
commit a9cce9cd0d
44 changed files with 341 additions and 111 deletions

View File

@ -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> Mon Sep 29 12:53:56 CEST 2003 Daniel Veillard <daniel@veillard.com>
* xmlmemory.c: better fix, avoids breaking the python bindings * xmlmemory.c: better fix, avoids breaking the python bindings

View File

@ -315,6 +315,7 @@ htmlIsBooleanAttr(const xmlChar *name)
return 0; return 0;
} }
#ifdef LIBXML_OUTPUT_ENABLED
/************************************************************************ /************************************************************************
* * * *
* Dumping HTML tree content to a simple buffer * * 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)); return(htmlSaveFileFormat(filename, cur, encoding, 1));
} }
#endif /* LIBXML_OUTPUT_ENABLED */
#endif /* LIBXML_HTML_ENABLED */ #endif /* LIBXML_HTML_ENABLED */

2
SAX2.c
View File

@ -871,7 +871,7 @@ xmlSAX2EndDocument(void *ctx)
*/ */
static void static void
xmlSAX2AttributeInternal(void *ctx, const xmlChar *fullname, xmlSAX2AttributeInternal(void *ctx, const xmlChar *fullname,
const xmlChar *value, const xmlChar *prefix) const xmlChar *value, const xmlChar *prefix ATTRIBUTE_UNUSED)
{ {
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx; xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
xmlAttrPtr ret; xmlAttrPtr ret;

2
c14n.c
View File

@ -12,6 +12,7 @@
#define IN_LIBXML #define IN_LIBXML
#include "libxml.h" #include "libxml.h"
#ifdef LIBXML_C14N_ENABLED #ifdef LIBXML_C14N_ENABLED
#ifdef LIBXML_OUTPUT_ENABLED
#ifdef HAVE_STDLIB_H #ifdef HAVE_STDLIB_H
#include <stdlib.h> #include <stdlib.h>
@ -1927,4 +1928,5 @@ xmlC11NNormalizeString(const xmlChar * input,
*out++ = 0; *out++ = 0;
return (buffer); return (buffer);
} }
#endif /* LIBXML_OUTPUT_ENABLED */
#endif /* LIBXML_C14N_ENABLED */ #endif /* LIBXML_C14N_ENABLED */

View File

@ -374,6 +374,7 @@ xmlFreeCatalog(xmlCatalogPtr catal) {
* * * *
************************************************************************/ ************************************************************************/
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlCatalogDumpEntry: * xmlCatalogDumpEntry:
* @entry: the * @entry: the
@ -587,6 +588,7 @@ BAD_CAST "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd");
return(ret); return(ret);
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/************************************************************************ /************************************************************************
* * * *
@ -2682,6 +2684,7 @@ xmlACatalogResolveURI(xmlCatalogPtr catal, const xmlChar *URI) {
return(ret); return(ret);
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlACatalogDump: * xmlACatalogDump:
* @catal: a Catalog * @catal: a Catalog
@ -2701,6 +2704,7 @@ xmlACatalogDump(xmlCatalogPtr catal, FILE *out) {
(xmlHashScanner) xmlCatalogDumpEntry, out); (xmlHashScanner) xmlCatalogDumpEntry, out);
} }
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
* xmlACatalogAdd: * xmlACatalogAdd:
@ -3097,6 +3101,7 @@ xmlCatalogResolveURI(const xmlChar *URI) {
return(ret); return(ret);
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlCatalogDump: * xmlCatalogDump:
* @out: the file. * @out: the file.
@ -3113,6 +3118,7 @@ xmlCatalogDump(FILE *out) {
xmlACatalogDump(xmlDefaultCatalog, out); xmlACatalogDump(xmlDefaultCatalog, out);
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
* xmlCatalogAdd: * xmlCatalogAdd:

View File

@ -527,8 +527,20 @@ if test "$with_history" = "yes" ; then
LDFLAGS=${_ldflags} LDFLAGS=${_ldflags}
fi fi
AC_SUBST(WITH_FTP) AC_ARG_WITH(output,
AC_SUBST(FTP_OBJ) [ --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, AC_ARG_WITH(ftp,
[ --with-ftp add the FTP support (on)]) [ --with-ftp add the FTP support (on)])
if test "$with_minimum" = "yes" -a "$with_ftp" = "" if test "$with_minimum" = "yes" -a "$with_ftp" = ""

View File

@ -1346,6 +1346,7 @@ xmlShellPrintXPathError(int errorType, const char *arg)
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlShellPrintNodeCtxt: * xmlShellPrintNodeCtxt:
* @ctxt : a non-null shell context * @ctxt : a non-null shell context
@ -1386,6 +1387,7 @@ xmlShellPrintNode(xmlNodePtr node)
{ {
xmlShellPrintNodeCtxt(NULL, node); xmlShellPrintNodeCtxt(NULL, node);
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
* xmlShellPrintXPathResultCtxt: * xmlShellPrintXPathResultCtxt:
@ -1397,20 +1399,18 @@ xmlShellPrintNode(xmlNodePtr node)
static void static void
xmlShellPrintXPathResultCtxt(xmlShellCtxtPtr ctxt,xmlXPathObjectPtr list) xmlShellPrintXPathResultCtxt(xmlShellCtxtPtr ctxt,xmlXPathObjectPtr list)
{ {
int i = 0;
if (!ctxt) if (!ctxt)
return; return;
if (list != NULL) { if (list != NULL) {
switch (list->type) { switch (list->type) {
case XPATH_NODESET:{ case XPATH_NODESET:{
#ifdef LIBXML_OUTPUT_ENABLED
int indx; int indx;
if (list->nodesetval) { if (list->nodesetval) {
for (indx = 0; indx < list->nodesetval->nodeNr; for (indx = 0; indx < list->nodesetval->nodeNr;
indx++) { indx++) {
if (i > 0)
fprintf(stderr, " -------\n");
xmlShellPrintNodeCtxt(ctxt, xmlShellPrintNodeCtxt(ctxt,
list->nodesetval->nodeTab[indx]); list->nodesetval->nodeTab[indx]);
} }
@ -1419,6 +1419,10 @@ xmlShellPrintXPathResultCtxt(xmlShellCtxtPtr ctxt,xmlXPathObjectPtr list)
"Empty node set\n"); "Empty node set\n");
} }
break; break;
#else
xmlGenericError(xmlGenericErrorContext,
"Node set\n");
#endif /* LIBXML_OUTPUT_ENABLED */
} }
case XPATH_BOOLEAN: case XPATH_BOOLEAN:
xmlGenericError(xmlGenericErrorContext, xmlGenericError(xmlGenericErrorContext,
@ -1664,6 +1668,7 @@ xmlShellDir(xmlShellCtxtPtr ctxt ATTRIBUTE_UNUSED,
return (0); return (0);
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlShellCat: * xmlShellCat:
* @ctxt: the shell context * @ctxt: the shell context
@ -1707,6 +1712,7 @@ xmlShellCat(xmlShellCtxtPtr ctxt, char *arg ATTRIBUTE_UNUSED,
fprintf(ctxt->output, "\n"); fprintf(ctxt->output, "\n");
return (0); return (0);
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
* xmlShellLoad: * xmlShellLoad:
@ -1761,6 +1767,7 @@ xmlShellLoad(xmlShellCtxtPtr ctxt, char *filename,
return (0); return (0);
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlShellWrite: * xmlShellWrite:
* @ctxt: the shell context * @ctxt: the shell context
@ -1887,6 +1894,7 @@ xmlShellSave(xmlShellCtxtPtr ctxt, char *filename,
} }
return (0); return (0);
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
* xmlShellValidate: * xmlShellValidate:
@ -2178,18 +2186,22 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
#endif /* LIBXML_XPATH_ENABLED */ #endif /* LIBXML_XPATH_ENABLED */
fprintf(ctxt->output, "\tpwd display current working directory\n"); fprintf(ctxt->output, "\tpwd display current working directory\n");
fprintf(ctxt->output, "\tquit leave shell\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, "\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"); 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"); fprintf(ctxt->output, "\tgrep string search for a string in the subtree\n");
} else if (!strcmp(command, "validate")) { } else if (!strcmp(command, "validate")) {
xmlShellValidate(ctxt, arg, NULL, NULL); xmlShellValidate(ctxt, arg, NULL, NULL);
} else if (!strcmp(command, "load")) { } else if (!strcmp(command, "load")) {
xmlShellLoad(ctxt, arg, NULL, NULL); xmlShellLoad(ctxt, arg, NULL, NULL);
#ifdef LIBXML_OUTPUT_ENABLED
} else if (!strcmp(command, "save")) { } else if (!strcmp(command, "save")) {
xmlShellSave(ctxt, arg, NULL, NULL); xmlShellSave(ctxt, arg, NULL, NULL);
} else if (!strcmp(command, "write")) { } else if (!strcmp(command, "write")) {
xmlShellWrite(ctxt, arg, NULL, NULL); xmlShellWrite(ctxt, arg, NULL, NULL);
#endif /* LIBXML_OUTPUT_ENABLED */
} else if (!strcmp(command, "grep")) { } else if (!strcmp(command, "grep")) {
xmlShellGrep(ctxt, arg, ctxt->node, NULL); xmlShellGrep(ctxt, arg, ctxt->node, NULL);
} else if (!strcmp(command, "free")) { } else if (!strcmp(command, "free")) {
@ -2389,6 +2401,7 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
} }
ctxt->pctxt->node = NULL; ctxt->pctxt->node = NULL;
} }
#ifdef LIBXML_OUTPUT_ENABLED
} else if (!strcmp(command, "cat")) { } else if (!strcmp(command, "cat")) {
if (arg[0] == 0) { if (arg[0] == 0) {
xmlShellCat(ctxt, NULL, ctxt->node, NULL); xmlShellCat(ctxt, NULL, ctxt->node, NULL);
@ -2466,6 +2479,7 @@ xmlShell(xmlDocPtr doc, char *filename, xmlShellReadlineFunc input,
} }
ctxt->pctxt->node = NULL; ctxt->pctxt->node = NULL;
} }
#endif /* LIBXML_OUTPUT_ENABLED */
} else { } else {
xmlGenericError(xmlGenericErrorContext, xmlGenericError(xmlGenericErrorContext,
"Unknown command %s\n", command); "Unknown command %s\n", command);

View File

@ -512,6 +512,7 @@ asciiToUTF8(unsigned char* out, int *outlen,
return(0); return(0);
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* UTF8Toascii: * UTF8Toascii:
* @out: a pointer to an array of bytes to store the result * @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; *inlen = processed - instart;
return(0); return(0);
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
* isolat1ToUTF8: * isolat1ToUTF8:
@ -683,6 +685,7 @@ UTF8ToUTF8(unsigned char* out, int *outlen,
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* UTF8Toisolat1: * UTF8Toisolat1:
* @out: a pointer to an array of bytes to store the result * @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; *inlen = processed - instart;
return(0); return(0);
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
* UTF16LEToUTF8: * UTF16LEToUTF8:
@ -859,6 +863,7 @@ UTF16LEToUTF8(unsigned char* out, int *outlen,
return(0); return(0);
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* UTF8ToUTF16LE: * UTF8ToUTF16LE:
* @outb: a pointer to an array of bytes to store the result * @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; *inlen = processed - instart;
return(0); return(0);
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
* UTF16BEToUTF8: * UTF16BEToUTF8:
@ -1071,6 +1077,7 @@ UTF16BEToUTF8(unsigned char* out, int *outlen,
return(0); return(0);
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* UTF8ToUTF16BE: * UTF8ToUTF16BE:
* @outb: a pointer to an array of bytes to store the result * @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; *inlen = processed - instart;
return(0); return(0);
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/************************************************************************ /************************************************************************
* * * *
@ -1673,6 +1681,7 @@ xmlInitCharEncodingHandlers(void) {
return; return;
} }
xmlNewCharEncodingHandler("UTF-8", UTF8ToUTF8, UTF8ToUTF8); xmlNewCharEncodingHandler("UTF-8", UTF8ToUTF8, UTF8ToUTF8);
#ifdef LIBXML_OUTPUT_ENABLED
xmlUTF16LEHandler = xmlUTF16LEHandler =
xmlNewCharEncodingHandler("UTF-16LE", UTF16LEToUTF8, UTF8ToUTF16LE); xmlNewCharEncodingHandler("UTF-16LE", UTF16LEToUTF8, UTF8ToUTF16LE);
xmlUTF16BEHandler = xmlUTF16BEHandler =
@ -1683,6 +1692,15 @@ xmlInitCharEncodingHandlers(void) {
#ifdef LIBXML_HTML_ENABLED #ifdef LIBXML_HTML_ENABLED
xmlNewCharEncodingHandler("HTML", NULL, UTF8ToHtml); xmlNewCharEncodingHandler("HTML", NULL, UTF8ToHtml);
#endif #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 #ifndef LIBXML_ICONV_ENABLED
#ifdef LIBXML_ISO8859X_ENABLED #ifdef LIBXML_ISO8859X_ENABLED
xmlRegisterCharEncodingHandlersISO8859x (); xmlRegisterCharEncodingHandlersISO8859x ();

View File

@ -754,6 +754,7 @@ xmlCopyEntitiesTable(xmlEntitiesTablePtr table) {
return(xmlHashCopy(table, (xmlHashCopier) xmlCopyEntity)); return(xmlHashCopy(table, (xmlHashCopier) xmlCopyEntity));
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlDumpEntityDecl: * xmlDumpEntityDecl:
* @buf: An XML buffer. * @buf: An XML buffer.
@ -851,3 +852,4 @@ void
xmlDumpEntitiesTable(xmlBufferPtr buf, xmlEntitiesTablePtr table) { xmlDumpEntitiesTable(xmlBufferPtr buf, xmlEntitiesTablePtr table) {
xmlHashScan(table, (xmlHashScanner)xmlDumpEntityDecl, buf); xmlHashScan(table, (xmlHashScanner)xmlDumpEntityDecl, buf);
} }
#endif /* LIBXML_OUTPUT_ENABLED */

View File

@ -240,8 +240,10 @@ parseGjobFile(char *filename) {
fprintf(stderr,"document of the wrong type, was '%s', Jobs expected", fprintf(stderr,"document of the wrong type, was '%s', Jobs expected",
cur->name); cur->name);
fprintf(stderr,"xmlDocDump follows\n"); fprintf(stderr,"xmlDocDump follows\n");
#ifdef LIBXML_OUTPUT_ENABLED
xmlDocDump ( stderr, doc ); xmlDocDump ( stderr, doc );
fprintf(stderr,"xmlDocDump finished\n"); fprintf(stderr,"xmlDocDump finished\n");
#endif /* LIBXML_OUTPUT_ENABLED */
xmlFreeDoc(doc); xmlFreeDoc(doc);
free(ret); free(ret);
return(NULL); return(NULL);

View File

@ -68,6 +68,7 @@ XMLPUBFUN const xmlChar * XMLCALL
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
htmlSetMetaEncoding (htmlDocPtr doc, htmlSetMetaEncoding (htmlDocPtr doc,
const xmlChar *encoding); const xmlChar *encoding);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
htmlDocDumpMemory (xmlDocPtr cur, htmlDocDumpMemory (xmlDocPtr cur,
xmlChar **mem, xmlChar **mem,
@ -117,16 +118,16 @@ XMLPUBFUN void XMLCALL
xmlDocPtr cur, xmlDocPtr cur,
const char *encoding, const char *encoding,
int format); int format);
XMLPUBFUN int XMLCALL
htmlIsBooleanAttr (const xmlChar *name);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
htmlNodeDumpOutput (xmlOutputBufferPtr buf, htmlNodeDumpOutput (xmlOutputBufferPtr buf,
xmlDocPtr doc, xmlDocPtr doc,
xmlNodePtr cur, xmlNodePtr cur,
const char *encoding); const char *encoding);
#endif /* LIBXML_OUTPUT_ENABLED */
XMLPUBFUN int XMLCALL
htmlIsBooleanAttr (const xmlChar *name);
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -11,6 +11,7 @@
*/ */
#ifndef __XML_C14N_H__ #ifndef __XML_C14N_H__
#define __XML_C14N_H__ #define __XML_C14N_H__
#ifdef LIBXML_OUTPUT_ENABLED
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -92,5 +93,6 @@ XMLPUBFUN int XMLCALL
} }
#endif /* __cplusplus */ #endif /* __cplusplus */
#endif /* LIBXML_OUTPUT_ENABLED */
#endif /* __XML_C14N_H__ */ #endif /* __XML_C14N_H__ */

View File

@ -91,9 +91,11 @@ XMLPUBFUN xmlChar * XMLCALL
XMLPUBFUN xmlChar * XMLCALL XMLPUBFUN xmlChar * XMLCALL
xmlACatalogResolveURI (xmlCatalogPtr catal, xmlACatalogResolveURI (xmlCatalogPtr catal,
const xmlChar *URI); const xmlChar *URI);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlACatalogDump (xmlCatalogPtr catal, xmlACatalogDump (xmlCatalogPtr catal,
FILE *out); FILE *out);
#endif /* LIBXML_OUTPUT_ENABLED */
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlFreeCatalog (xmlCatalogPtr catal); xmlFreeCatalog (xmlCatalogPtr catal);
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
@ -110,8 +112,10 @@ XMLPUBFUN void XMLCALL
xmlLoadCatalogs (const char *paths); xmlLoadCatalogs (const char *paths);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlCatalogCleanup (void); xmlCatalogCleanup (void);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlCatalogDump (FILE *out); xmlCatalogDump (FILE *out);
#endif /* LIBXML_OUTPUT_ENABLED */
XMLPUBFUN xmlChar * XMLCALL XMLPUBFUN xmlChar * XMLCALL
xmlCatalogResolve (const xmlChar *pubID, xmlCatalogResolve (const xmlChar *pubID,
const xmlChar *sysID); const xmlChar *sysID);

View File

@ -148,6 +148,7 @@ XMLPUBFUN int XMLCALL
char *filename, char *filename,
xmlNodePtr node, xmlNodePtr node,
xmlNodePtr node2); xmlNodePtr node2);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlShellWrite (xmlShellCtxtPtr ctxt, xmlShellWrite (xmlShellCtxtPtr ctxt,
char *filename, char *filename,
@ -158,6 +159,7 @@ XMLPUBFUN int XMLCALL
char *filename, char *filename,
xmlNodePtr node, xmlNodePtr node,
xmlNodePtr node2); xmlNodePtr node2);
#endif /* LIBXML_OUTPUT_ENABLED */
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlShellValidate (xmlShellCtxtPtr ctxt, xmlShellValidate (xmlShellCtxtPtr ctxt,
char *dtd, char *dtd,

View File

@ -110,12 +110,14 @@ XMLPUBFUN xmlEntitiesTablePtr XMLCALL
xmlCopyEntitiesTable (xmlEntitiesTablePtr table); xmlCopyEntitiesTable (xmlEntitiesTablePtr table);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlFreeEntitiesTable (xmlEntitiesTablePtr table); xmlFreeEntitiesTable (xmlEntitiesTablePtr table);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlDumpEntitiesTable (xmlBufferPtr buf, xmlDumpEntitiesTable (xmlBufferPtr buf,
xmlEntitiesTablePtr table); xmlEntitiesTablePtr table);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlDumpEntityDecl (xmlBufferPtr buf, xmlDumpEntityDecl (xmlBufferPtr buf,
xmlEntityPtr ent); xmlEntityPtr ent);
#endif /* LIBXML_OUTPUT_ENABLED */
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlCleanupPredefinedEntities(void); xmlCleanupPredefinedEntities(void);

View File

@ -56,9 +56,11 @@ XMLPUBFUN int XMLCALL
xmlNanoHTTPRead (void *ctx, xmlNanoHTTPRead (void *ctx,
void *dest, void *dest,
int len); int len);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL
xmlNanoHTTPSave (void *ctxt, xmlNanoHTTPSave (void *ctxt,
const char *filename); const char *filename);
#endif /* LIBXML_OUTPUT_ENABLED */
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlNanoHTTPClose (void *ctx); xmlNanoHTTPClose (void *ctx);
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -103,12 +103,14 @@ XMLPUBFUN xmlRelaxNGPtr XMLCALL
xmlRelaxNGParse (xmlRelaxNGParserCtxtPtr ctxt); xmlRelaxNGParse (xmlRelaxNGParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlRelaxNGFree (xmlRelaxNGPtr schema); xmlRelaxNGFree (xmlRelaxNGPtr schema);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlRelaxNGDump (FILE *output, xmlRelaxNGDump (FILE *output,
xmlRelaxNGPtr schema); xmlRelaxNGPtr schema);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlRelaxNGDumpTree (FILE * output, xmlRelaxNGDumpTree (FILE * output,
xmlRelaxNGPtr schema); xmlRelaxNGPtr schema);
#endif /* LIBXML_OUTPUT_ENABLED */
/* /*
* Interfaces for validating * Interfaces for validating
*/ */

View File

@ -533,13 +533,6 @@ struct _xmlDoc {
/* /*
* Variables. * 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 * Some helper functions
@ -961,6 +954,7 @@ XMLPUBFUN int XMLCALL
xmlReconciliateNs (xmlDocPtr doc, xmlReconciliateNs (xmlDocPtr doc,
xmlNodePtr tree); xmlNodePtr tree);
#ifdef LIBXML_OUTPUT_ENABLED
/* /*
* Saving. * Saving.
*/ */
@ -1037,6 +1031,7 @@ XMLPUBFUN int XMLCALL
xmlDocPtr cur, xmlDocPtr cur,
const char *encoding); const char *encoding);
#endif /* LIBXML_OUTPUT_ENABLED */
/* /*
* XHTML * XHTML
*/ */

View File

@ -145,12 +145,14 @@ XMLPUBFUN xmlNotationTablePtr XMLCALL
xmlCopyNotationTable (xmlNotationTablePtr table); xmlCopyNotationTable (xmlNotationTablePtr table);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlFreeNotationTable (xmlNotationTablePtr table); xmlFreeNotationTable (xmlNotationTablePtr table);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlDumpNotationDecl (xmlBufferPtr buf, xmlDumpNotationDecl (xmlBufferPtr buf,
xmlNotationPtr nota); xmlNotationPtr nota);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlDumpNotationTable (xmlBufferPtr buf, xmlDumpNotationTable (xmlBufferPtr buf,
xmlNotationTablePtr table); xmlNotationTablePtr table);
#endif /* LIBXML_OUTPUT_ENABLED */
/* Element Content */ /* Element Content */
XMLPUBFUN xmlElementContentPtr XMLCALL XMLPUBFUN xmlElementContentPtr XMLCALL
@ -183,12 +185,14 @@ XMLPUBFUN xmlElementTablePtr XMLCALL
xmlCopyElementTable (xmlElementTablePtr table); xmlCopyElementTable (xmlElementTablePtr table);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlFreeElementTable (xmlElementTablePtr table); xmlFreeElementTable (xmlElementTablePtr table);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlDumpElementTable (xmlBufferPtr buf, xmlDumpElementTable (xmlBufferPtr buf,
xmlElementTablePtr table); xmlElementTablePtr table);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlDumpElementDecl (xmlBufferPtr buf, xmlDumpElementDecl (xmlBufferPtr buf,
xmlElementPtr elem); xmlElementPtr elem);
#endif /* LIBXML_OUTPUT_ENABLED */
/* Enumeration */ /* Enumeration */
XMLPUBFUN xmlEnumerationPtr XMLCALL XMLPUBFUN xmlEnumerationPtr XMLCALL
@ -213,12 +217,14 @@ XMLPUBFUN xmlAttributeTablePtr XMLCALL
xmlCopyAttributeTable (xmlAttributeTablePtr table); xmlCopyAttributeTable (xmlAttributeTablePtr table);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlFreeAttributeTable (xmlAttributeTablePtr table); xmlFreeAttributeTable (xmlAttributeTablePtr table);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlDumpAttributeTable (xmlBufferPtr buf, xmlDumpAttributeTable (xmlBufferPtr buf,
xmlAttributeTablePtr table); xmlAttributeTablePtr table);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlDumpAttributeDecl (xmlBufferPtr buf, xmlDumpAttributeDecl (xmlBufferPtr buf,
xmlAttributePtr attr); xmlAttributePtr attr);
#endif /* LIBXML_OUTPUT_ENABLED */
/* IDs */ /* IDs */
XMLPUBFUN xmlIDPtr XMLCALL XMLPUBFUN xmlIDPtr XMLCALL

View File

@ -62,6 +62,7 @@ typedef int (*xmlInputReadCallback) (void * context, char * buffer, int len);
*/ */
typedef int (*xmlInputCloseCallback) (void * context); typedef int (*xmlInputCloseCallback) (void * context);
#ifdef LIBXML_OUTPUT_ENABLED
/* /*
* Those are the functions and datatypes for the library output * Those are the functions and datatypes for the library output
* I/O structures. * I/O structures.
@ -107,6 +108,7 @@ typedef int (*xmlOutputWriteCallback) (void * context, const char * buffer,
* Returns 0 or -1 in case of error * Returns 0 or -1 in case of error
*/ */
typedef int (*xmlOutputCloseCallback) (void * context); typedef int (*xmlOutputCloseCallback) (void * context);
#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef __cplusplus #ifdef __cplusplus
} }
@ -133,6 +135,7 @@ struct _xmlParserInputBuffer {
}; };
#ifdef LIBXML_OUTPUT_ENABLED
struct _xmlOutputBuffer { struct _xmlOutputBuffer {
void* context; void* context;
xmlOutputWriteCallback writecallback; xmlOutputWriteCallback writecallback;
@ -144,14 +147,13 @@ struct _xmlOutputBuffer {
xmlBufferPtr conv; /* if encoder != NULL buffer for output */ xmlBufferPtr conv; /* if encoder != NULL buffer for output */
int written; /* total number of byte written */ int written; /* total number of byte written */
}; };
#endif /* LIBXML_OUTPUT_ENABLED */
/* /*
* Interfaces for input * Interfaces for input
*/ */
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlCleanupInputCallbacks (void); xmlCleanupInputCallbacks (void);
XMLPUBFUN void XMLCALL
xmlCleanupOutputCallbacks (void);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlRegisterDefaultInputCallbacks (void); xmlRegisterDefaultInputCallbacks (void);
@ -198,9 +200,12 @@ XMLPUBFUN int XMLCALL
xmlInputOpenCallback openFunc, xmlInputOpenCallback openFunc,
xmlInputReadCallback readFunc, xmlInputReadCallback readFunc,
xmlInputCloseCallback closeFunc); xmlInputCloseCallback closeFunc);
#ifdef LIBXML_OUTPUT_ENABLED
/* /*
* Interfaces for output * Interfaces for output
*/ */
XMLPUBFUN void XMLCALL
xmlCleanupOutputCallbacks (void);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlRegisterDefaultOutputCallbacks(void); xmlRegisterDefaultOutputCallbacks(void);
XMLPUBFUN xmlOutputBufferPtr XMLCALL XMLPUBFUN xmlOutputBufferPtr XMLCALL
@ -243,6 +248,7 @@ XMLPUBFUN int XMLCALL
xmlOutputOpenCallback openFunc, xmlOutputOpenCallback openFunc,
xmlOutputWriteCallback writeFunc, xmlOutputWriteCallback writeFunc,
xmlOutputCloseCallback closeFunc); xmlOutputCloseCallback closeFunc);
#endif /* LIBXML_OUTPUT_ENABLED */
/* This function only exists if HTTP support built into the library */ /* This function only exists if HTTP support built into the library */
#ifdef LIBXML_HTTP_ENABLED #ifdef LIBXML_HTTP_ENABLED

View File

@ -88,9 +88,11 @@ XMLPUBFUN xmlSchemaPtr XMLCALL
xmlSchemaParse (xmlSchemaParserCtxtPtr ctxt); xmlSchemaParse (xmlSchemaParserCtxtPtr ctxt);
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlSchemaFree (xmlSchemaPtr schema); xmlSchemaFree (xmlSchemaPtr schema);
#ifdef LIBXML_OUTPUT_ENABLED
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlSchemaDump (FILE *output, xmlSchemaDump (FILE *output,
xmlSchemaPtr schema); xmlSchemaPtr schema);
#endif /* LIBXML_OUTPUT_ENABLED */
/* /*
* Interfaces for validating * Interfaces for validating
*/ */

View File

@ -83,6 +83,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
#endif #endif
#endif #endif
/**
* LIBXML_OUTPUT_ENABLED:
*
* Whether the serialization/saving support is configured in
*/
#if @WITH_OUTPUT@
#define LIBXML_OUTPUT_ENABLED
#endif
/** /**
* LIBXML_FTP_ENABLED: * LIBXML_FTP_ENABLED:
* *

View File

@ -377,6 +377,7 @@ XMLPUBFUN void XMLCALL
int line, int line,
int no); int no);
#ifdef LIBXML_DEBUG_ENABLED
XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL
xmlXPathDebugDumpObject (FILE *output, xmlXPathDebugDumpObject (FILE *output,
xmlXPathObjectPtr cur, xmlXPathObjectPtr cur,
@ -385,7 +386,7 @@ XMLPUBFUN void XMLCALL
xmlXPathDebugDumpCompExpr(FILE *output, xmlXPathDebugDumpCompExpr(FILE *output,
xmlXPathCompExprPtr comp, xmlXPathCompExprPtr comp,
int depth); int depth);
#endif
/** /**
* NodeSet handling. * NodeSet handling.
*/ */

View File

@ -90,13 +90,16 @@
* A couple portability macros * A couple portability macros
*/ */
#ifndef _WINSOCKAPI_ #ifndef _WINSOCKAPI_
#ifndef __BEOS__
#define closesocket(s) close(s) #define closesocket(s) close(s)
#endif
#define SOCKET int #define SOCKET int
#endif #endif
#if defined(VMS) || defined(__VMS) #if defined(VMS) || defined(__VMS)
#define SOCKLEN_T unsigned int #define SOCKLEN_T unsigned int
#endif #endif
#define FTP_COMMAND_OK 200 #define FTP_COMMAND_OK 200
#define FTP_SYNTAX_ERROR 500 #define FTP_SYNTAX_ERROR 500
#define FTP_GET_PASSWD 331 #define FTP_GET_PASSWD 331

View File

@ -95,7 +95,9 @@
* A couple portability macros * A couple portability macros
*/ */
#ifndef _WINSOCKAPI_ #ifndef _WINSOCKAPI_
#ifndef __BEOS__
#define closesocket(s) close(s) #define closesocket(s) close(s)
#endif
#define SOCKET int #define SOCKET int
#endif #endif
@ -922,6 +924,7 @@ xmlNanoHTTPConnectAttempt(struct sockaddr *addr)
if ( FD_ISSET(s, &wfd) ) { if ( FD_ISSET(s, &wfd) ) {
SOCKLEN_T len; SOCKLEN_T len;
len = sizeof(status); len = sizeof(status);
#ifdef SO_ERROR
if (getsockopt(s, SOL_SOCKET, SO_ERROR, (char*)&status, &len) < 0 ) { if (getsockopt(s, SOL_SOCKET, SO_ERROR, (char*)&status, &len) < 0 ) {
/* Solaris error code */ /* Solaris error code */
xmlGenericError( xmlGenericErrorContext, xmlGenericError( xmlGenericErrorContext,
@ -930,6 +933,7 @@ xmlNanoHTTPConnectAttempt(struct sockaddr *addr)
strerror( socket_errno( ) ) ); strerror( socket_errno( ) ) );
return (-1); return (-1);
} }
#endif
if ( status ) { if ( status ) {
closesocket(s); closesocket(s);
errno = status; errno = status;
@ -1510,6 +1514,7 @@ xmlNanoHTTPFetch(const char *URL, const char *filename, char **contentType) {
return(0); return(0);
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlNanoHTTPSave: * xmlNanoHTTPSave:
* @ctxt: the HTTP context * @ctxt: the HTTP context
@ -1546,6 +1551,7 @@ xmlNanoHTTPSave(void *ctxt, const char *filename) {
xmlNanoHTTPClose(ctxt); xmlNanoHTTPClose(ctxt);
return(0); return(0);
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
* xmlNanoHTTPReturnCode: * xmlNanoHTTPReturnCode:

View File

@ -11974,7 +11974,9 @@ xmlInitParser(void) {
xmlInitializePredefinedEntities(); xmlInitializePredefinedEntities();
xmlDefaultSAXHandlerInit(); xmlDefaultSAXHandlerInit();
xmlRegisterDefaultInputCallbacks(); xmlRegisterDefaultInputCallbacks();
#ifdef LIBXML_OUTPUT_ENABLED
xmlRegisterDefaultOutputCallbacks(); xmlRegisterDefaultOutputCallbacks();
#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef LIBXML_HTML_ENABLED #ifdef LIBXML_HTML_ENABLED
htmlInitAutoClose(); htmlInitAutoClose();
htmlDefaultSAXHandlerInit(); htmlDefaultSAXHandlerInit();

View File

@ -319,6 +319,7 @@ xmlPythonFileClose (void * context) {
return(0); return(0);
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlOutputBufferCreatePythonFile: * xmlOutputBufferCreatePythonFile:
* @file: a PyFile_Type * @file: a PyFile_Type
@ -368,6 +369,7 @@ libxml_xmlCreateOutputBuffer(ATTRIBUTE_UNUSED PyObject *self, PyObject *args) {
py_retval = libxml_xmlOutputBufferPtrWrap(buffer); py_retval = libxml_xmlOutputBufferPtrWrap(buffer);
return(py_retval); return(py_retval);
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
@ -1056,7 +1058,10 @@ static xmlSAXHandler pythonSaxHandler = {
NULL, /* TODO pythonGetParameterEntity, */ NULL, /* TODO pythonGetParameterEntity, */
pythonCdataBlock, pythonCdataBlock,
pythonExternalSubset, 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); return (py_retval);
} }
#ifdef LIBXML_OUTPUT_ENABLED
/************************************************************************ /************************************************************************
* * * *
* Serialization front-end * * Serialization front-end *
@ -2524,6 +2530,7 @@ libxml_saveNodeTo(ATTRIBUTE_UNUSED PyObject * self, PyObject * args)
} }
return (PyInt_FromLong((long) len)); return (PyInt_FromLong((long) len));
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/************************************************************************ /************************************************************************
* * * *
@ -2773,9 +2780,11 @@ static PyMethodDef libxmlMethods[] = {
{(char *) "type", libxml_type, METH_VARARGS, NULL}, {(char *) "type", libxml_type, METH_VARARGS, NULL},
{(char *) "doc", libxml_doc, METH_VARARGS, NULL}, {(char *) "doc", libxml_doc, METH_VARARGS, NULL},
{(char *) "xmlNewNode", libxml_xmlNewNode, METH_VARARGS, NULL}, {(char *) "xmlNewNode", libxml_xmlNewNode, METH_VARARGS, NULL},
#ifdef LIBXML_OUTPUT_ENABLED
{(char *) "serializeNode", libxml_serializeNode, METH_VARARGS, NULL}, {(char *) "serializeNode", libxml_serializeNode, METH_VARARGS, NULL},
{(char *) "saveNodeTo", libxml_saveNodeTo, METH_VARARGS, NULL}, {(char *) "saveNodeTo", libxml_saveNodeTo, METH_VARARGS, NULL},
{(char *) "outputBufferCreate", libxml_xmlCreateOutputBuffer, METH_VARARGS, NULL}, {(char *) "outputBufferCreate", libxml_xmlCreateOutputBuffer, METH_VARARGS, NULL},
#endif /* LIBXML_OUTPUT_ENABLED */
{(char *) "inputBufferCreate", libxml_xmlCreateInputBuffer, METH_VARARGS, NULL}, {(char *) "inputBufferCreate", libxml_xmlCreateInputBuffer, METH_VARARGS, NULL},
{(char *) "setEntityLoader", libxml_xmlSetEntityLoader, METH_VARARGS, NULL}, {(char *) "setEntityLoader", libxml_xmlSetEntityLoader, METH_VARARGS, NULL},
{(char *)"xmlRegisterErrorHandler", libxml_xmlRegisterErrorHandler, METH_VARARGS, NULL }, {(char *)"xmlRegisterErrorHandler", libxml_xmlRegisterErrorHandler, METH_VARARGS, NULL },
@ -2807,7 +2816,9 @@ initlibxml2mod(void)
return; return;
/* XXX xmlInitParser does much more than this */ /* XXX xmlInitParser does much more than this */
xmlInitGlobals(); xmlInitGlobals();
#ifdef LIBXML_OUTPUT_ENABLED
xmlRegisterDefaultOutputCallbacks(); xmlRegisterDefaultOutputCallbacks();
#endif /* LIBXML_OUTPUT_ENABLED */
xmlRegisterDefaultInputCallbacks(); xmlRegisterDefaultInputCallbacks();
m = Py_InitModule((char *) "libxml2mod", libxmlMethods); m = Py_InitModule((char *) "libxml2mod", libxmlMethods);
initialized = 1; initialized = 1;

View File

@ -7405,6 +7405,7 @@ xmlRelaxNGGetParserErrors(xmlRelaxNGParserCtxtPtr ctxt,
return(0); return(0);
} }
#ifdef LIBXML_OUTPUT_ENABLED
/************************************************************************ /************************************************************************
* * * *
* Dump back a compiled form * * Dump back a compiled form *
@ -7635,6 +7636,7 @@ xmlRelaxNGDumpTree(FILE * output, xmlRelaxNGPtr schema)
xmlDocDump(output, schema->doc); xmlDocDump(output, schema->doc);
} }
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/************************************************************************ /************************************************************************
* * * *

View File

@ -300,7 +300,7 @@ int main(int argc, char **argv) {
#else #else
#include <stdio.h> #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]); printf("%s : Automata support not compiled in\n", argv[0]);
return(0); return(0);
} }

View File

@ -7,7 +7,7 @@
* Author: Aleksey Sanin <aleksey@aleksey.com> * Author: Aleksey Sanin <aleksey@aleksey.com>
*/ */
#include "libxml.h" #include "libxml.h"
#if defined(LIBXML_C14N_ENABLED) #if defined(LIBXML_C14N_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -348,8 +348,8 @@ print_xpath_nodes(xmlNodeSetPtr nodes) {
#else #else
#include <stdio.h> #include <stdio.h>
int main(int argc, char **argv) { int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
printf("%s : XPath/Canonicalization support not compiled in\n", argv[0]); printf("%s : XPath/Canonicalization and output support not compiled in\n", argv[0]);
return(0); return(0);
} }
#endif /* LIBXML_C14N_ENABLED */ #endif /* LIBXML_C14N_ENABLED */

View File

@ -742,6 +742,7 @@ parseAndPrintFile(char *filename) {
xmlFreeDoc(tmp); xmlFreeDoc(tmp);
} }
#ifdef LIBXML_OUTPUT_ENABLED
/* /*
* print it. * print it.
*/ */
@ -761,6 +762,7 @@ parseAndPrintFile(char *filename) {
htmlDocDump(stdout, doc); htmlDocDump(stdout, doc);
#endif #endif
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/* /*
* free it. * free it.
@ -839,7 +841,7 @@ int main(int argc, char **argv) {
} }
#else /* !LIBXML_HTML_ENABLED */ #else /* !LIBXML_HTML_ENABLED */
#include <stdio.h> #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]); printf("%s : HTML support not compiled in\n", argv[0]);
return(0); return(0);
} }

View File

@ -151,7 +151,7 @@ int main(int argc, char **argv) {
#else #else
#include <stdio.h> #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]); printf("%s : Regexp support not compiled in\n", argv[0]);
return(0); return(0);
} }

View File

@ -123,12 +123,14 @@ int main(int argc, char **argv) {
files = -1; files = -1;
break; break;
} }
#ifdef LIBXML_OUTPUT_ENABLED
#ifdef LIBXML_DEBUG_ENABLED #ifdef LIBXML_DEBUG_ENABLED
if (debug) if (debug)
xmlRelaxNGDump(stdout, schema); xmlRelaxNGDump(stdout, schema);
#endif #endif
if (tree) if (tree)
xmlRelaxNGDumpTree(stdout, schema); xmlRelaxNGDumpTree(stdout, schema);
#endif /* LIBXML_OUTPUT_ENABLED */
} else { } else {
xmlDocPtr doc; xmlDocPtr doc;
@ -185,7 +187,7 @@ int main(int argc, char **argv) {
#else #else
#include <stdio.h> #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]); printf("%s : RelaxNG support not compiled in\n", argv[0]);
return(0); return(0);
} }

View File

@ -114,10 +114,12 @@ int main(int argc, char **argv) {
schema = xmlSchemaParse(ctxt); schema = xmlSchemaParse(ctxt);
xmlSchemaFreeParserCtxt(ctxt); xmlSchemaFreeParserCtxt(ctxt);
} }
#ifdef LIBXML_OUTPUT_ENABLED
#ifdef LIBXML_DEBUG_ENABLED #ifdef LIBXML_DEBUG_ENABLED
if (debug) if (debug)
xmlSchemaDump(stdout, schema); xmlSchemaDump(stdout, schema);
#endif #endif
#endif /* LIBXML_OUTPUT_ENABLED */
} else { } else {
xmlDocPtr doc; xmlDocPtr doc;
@ -173,7 +175,7 @@ int main(int argc, char **argv) {
#else #else
#include <stdio.h> #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]); printf("%s : Schemas support not compiled in\n", argv[0]);
return(0); return(0);
} }

View File

@ -220,7 +220,7 @@ int main(int argc, char **argv) {
} }
#else #else
#include <stdio.h> #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]); printf("%s : XPath/Debug support not compiled in\n", argv[0]);
return(0); return(0);
} }

View File

@ -99,7 +99,9 @@ static int run_once_init = 1;
#endif /* HAVE_WIN32_THREADS */ #endif /* HAVE_WIN32_THREADS */
static xmlRMutexPtr xmlLibraryLock = NULL; static xmlRMutexPtr xmlLibraryLock = NULL;
#ifdef LIBXML_THREAD_ENABLED
static void xmlOnceInit(void); static void xmlOnceInit(void);
#endif
/** /**
* xmlNewMutex: * xmlNewMutex:
@ -527,6 +529,7 @@ xmlCleanupThreads(void)
#endif #endif
} }
#ifdef LIBXML_THREAD_ENABLED
/** /**
* xmlOnceInit * xmlOnceInit
* *
@ -550,6 +553,7 @@ xmlOnceInit(void) {
mainthread = GetCurrentThreadId(); mainthread = GetCurrentThreadId();
#endif #endif
} }
#endif
/** /**
* DllMain: * DllMain:

117
tree.c
View File

@ -6789,6 +6789,7 @@ xmlBufferWriteQuotedString(xmlBufferPtr buf, const xmlChar *string) {
} }
#ifdef LIBXML_OUTPUT_ENABLED
/************************************************************************ /************************************************************************
* * * *
* Dumping XML tree content to a simple buffer * * 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 #ifdef LIBXML_HTML_ENABLED
/************************************************************************ /************************************************************************
@ -7615,6 +7617,7 @@ xmlIsXHTML(const xmlChar *systemID, const xmlChar *publicID) {
return(0); return(0);
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xhtmlIsEmpty: * xhtmlIsEmpty:
* @node: the node * @node: the node
@ -8059,8 +8062,10 @@ xhtmlNodeDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur,
xmlOutputBufferWriteString(buf, (const char *)cur->name); xmlOutputBufferWriteString(buf, (const char *)cur->name);
xmlOutputBufferWriteString(buf, ">"); xmlOutputBufferWriteString(buf, ">");
} }
#endif /* LIBXML_OUTPUT_ENABLED */
#endif #endif
#ifdef LIBXML_OUTPUT_ENABLED
/************************************************************************ /************************************************************************
* * * *
* Saving functions front-ends * * Saving functions front-ends *
@ -8210,61 +8215,6 @@ xmlDocDumpMemoryEnc(xmlDocPtr out_doc, xmlChar **doc_txt_ptr,
txt_encoding, 0); txt_encoding, 0);
} }
/**
* 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: * xmlDocFormatDump:
* @f: the FILE* * @f: the FILE*
@ -8463,3 +8413,60 @@ xmlSaveFile(const char *filename, xmlDocPtr cur) {
return(xmlSaveFormatFileEnc(filename, cur, NULL, 0)); 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;
}

16
valid.c
View File

@ -827,6 +827,7 @@ xmlFreeElementContent(xmlElementContentPtr cur) {
xmlFree(cur); xmlFree(cur);
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlDumpElementContent: * xmlDumpElementContent:
* @buf: An XML buffer * @buf: An XML buffer
@ -910,6 +911,7 @@ xmlSprintfElementContent(char *buf ATTRIBUTE_UNUSED,
xmlElementContentPtr content ATTRIBUTE_UNUSED, xmlElementContentPtr content ATTRIBUTE_UNUSED,
int glob ATTRIBUTE_UNUSED) { int glob ATTRIBUTE_UNUSED) {
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
* xmlSnprintfElementContent: * xmlSnprintfElementContent:
@ -1065,7 +1067,8 @@ xmlFreeElement(xmlElementPtr elem) {
* Returns NULL if not, otherwise the entity * Returns NULL if not, otherwise the entity
*/ */
xmlElementPtr xmlElementPtr
xmlAddElementDecl(xmlValidCtxtPtr ctxt, xmlDtdPtr dtd, const xmlChar *name, xmlAddElementDecl(xmlValidCtxtPtr ctxt ATTRIBUTE_UNUSED,
xmlDtdPtr dtd, const xmlChar *name,
xmlElementTypeVal type, xmlElementTypeVal type,
xmlElementContentPtr content) { xmlElementContentPtr content) {
xmlElementPtr ret; xmlElementPtr ret;
@ -1312,6 +1315,7 @@ xmlCopyElementTable(xmlElementTablePtr table) {
(xmlHashCopier) xmlCopyElement)); (xmlHashCopier) xmlCopyElement));
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlDumpElementDecl: * xmlDumpElementDecl:
* @buf: the XML buffer output * @buf: the XML buffer output
@ -1381,6 +1385,7 @@ void
xmlDumpElementTable(xmlBufferPtr buf, xmlElementTablePtr table) { xmlDumpElementTable(xmlBufferPtr buf, xmlElementTablePtr table) {
xmlHashScan(table, (xmlHashScanner) xmlDumpElementDecl, buf); xmlHashScan(table, (xmlHashScanner) xmlDumpElementDecl, buf);
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
* xmlCreateEnumeration: * xmlCreateEnumeration:
@ -1447,6 +1452,7 @@ xmlCopyEnumeration(xmlEnumerationPtr cur) {
return(ret); return(ret);
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlDumpEnumeration: * xmlDumpEnumeration:
* @buf: the XML buffer output * @buf: the XML buffer output
@ -1466,6 +1472,7 @@ xmlDumpEnumeration(xmlBufferPtr buf, xmlEnumerationPtr cur) {
xmlDumpEnumeration(buf, cur->next); xmlDumpEnumeration(buf, cur->next);
} }
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
* xmlCreateAttributeTable: * xmlCreateAttributeTable:
@ -1605,7 +1612,8 @@ xmlFreeAttribute(xmlAttributePtr attr) {
* Returns NULL if not new, otherwise the attribute decl * Returns NULL if not new, otherwise the attribute decl
*/ */
xmlAttributePtr 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, const xmlChar *name, const xmlChar *ns,
xmlAttributeType type, xmlAttributeDefault def, xmlAttributeType type, xmlAttributeDefault def,
const xmlChar *defaultValue, xmlEnumerationPtr tree) { const xmlChar *defaultValue, xmlEnumerationPtr tree) {
@ -1858,6 +1866,7 @@ xmlCopyAttributeTable(xmlAttributeTablePtr table) {
(xmlHashCopier) xmlCopyAttribute)); (xmlHashCopier) xmlCopyAttribute));
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlDumpAttributeDecl: * xmlDumpAttributeDecl:
* @buf: the XML buffer output * @buf: the XML buffer output
@ -1949,6 +1958,7 @@ void
xmlDumpAttributeTable(xmlBufferPtr buf, xmlAttributeTablePtr table) { xmlDumpAttributeTable(xmlBufferPtr buf, xmlAttributeTablePtr table) {
xmlHashScan(table, (xmlHashScanner) xmlDumpAttributeDecl, buf); xmlHashScan(table, (xmlHashScanner) xmlDumpAttributeDecl, buf);
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/************************************************************************ /************************************************************************
* * * *
@ -2124,6 +2134,7 @@ xmlCopyNotationTable(xmlNotationTablePtr table) {
(xmlHashCopier) xmlCopyNotation)); (xmlHashCopier) xmlCopyNotation));
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlDumpNotationDecl: * xmlDumpNotationDecl:
* @buf: the XML buffer output * @buf: the XML buffer output
@ -2160,6 +2171,7 @@ void
xmlDumpNotationTable(xmlBufferPtr buf, xmlNotationTablePtr table) { xmlDumpNotationTable(xmlBufferPtr buf, xmlNotationTablePtr table) {
xmlHashScan(table, (xmlHashScanner) xmlDumpNotationDecl, buf); xmlHashScan(table, (xmlHashScanner) xmlDumpNotationDecl, buf);
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/************************************************************************ /************************************************************************
* * * *

46
xmlIO.c
View File

@ -105,6 +105,7 @@ static xmlInputCallback xmlInputCallbackTable[MAX_INPUT_CALLBACK];
static int xmlInputCallbackNr = 0; static int xmlInputCallbackNr = 0;
static int xmlInputCallbackInitialized = 0; static int xmlInputCallbackInitialized = 0;
#ifdef LIBXML_OUTPUT_ENABLED
/* /*
* Output I/O callback sets * Output I/O callback sets
*/ */
@ -120,6 +121,7 @@ typedef struct _xmlOutputCallback {
static xmlOutputCallback xmlOutputCallbackTable[MAX_OUTPUT_CALLBACK]; static xmlOutputCallback xmlOutputCallbackTable[MAX_OUTPUT_CALLBACK];
static int xmlOutputCallbackNr = 0; static int xmlOutputCallbackNr = 0;
static int xmlOutputCallbackInitialized = 0; static int xmlOutputCallbackInitialized = 0;
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
@ -162,6 +164,7 @@ xmlCleanupInputCallbacks(void)
xmlInputCallbackInitialized = 0; xmlInputCallbackInitialized = 0;
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlCleanupOutputCallbacks: * xmlCleanupOutputCallbacks:
* *
@ -186,6 +189,7 @@ xmlCleanupOutputCallbacks(void)
xmlOutputCallbackNr = 0; xmlOutputCallbackNr = 0;
xmlOutputCallbackInitialized = 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)); return(read((int) (long) context, &buffer[0], len));
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlFdWrite: * xmlFdWrite:
* @context: the I/O context * @context: the I/O context
@ -259,6 +264,7 @@ static int
xmlFdWrite (void * context, const char * buffer, int len) { xmlFdWrite (void * context, const char * buffer, int len) {
return(write((int) (long) context, &buffer[0], len)); return(write((int) (long) context, &buffer[0], len));
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
* xmlFdClose: * xmlFdClose:
@ -356,6 +362,7 @@ xmlFileOpen (const char *filename) {
return retval; return retval;
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlFileOpenW: * xmlFileOpenW:
* @filename: the URI for matching * @filename: the URI for matching
@ -396,6 +403,7 @@ xmlFileOpenW (const char *filename) {
fd = fopen(path, "wb"); fd = fopen(path, "wb");
return((void *) fd); return((void *) fd);
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
* xmlFileRead: * xmlFileRead:
@ -412,6 +420,7 @@ xmlFileRead (void * context, char * buffer, int len) {
return(fread(&buffer[0], 1, len, (FILE *) context)); return(fread(&buffer[0], 1, len, (FILE *) context));
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlFileWrite: * xmlFileWrite:
* @context: the I/O context * @context: the I/O context
@ -430,6 +439,7 @@ xmlFileWrite (void * context, const char * buffer, int len) {
return(items * len); return(items * len);
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
* xmlFileClose: * xmlFileClose:
@ -549,6 +559,7 @@ xmlGzfileOpen (const char *filename) {
return retval; return retval;
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlGzfileOpenW: * xmlGzfileOpenW:
* @filename: the URI for matching * @filename: the URI for matching
@ -592,6 +603,7 @@ xmlGzfileOpenW (const char *filename, int compression) {
fd = gzopen(path, mode); fd = gzopen(path, mode);
return((void *) fd); return((void *) fd);
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
* xmlGzfileRead: * xmlGzfileRead:
@ -608,6 +620,7 @@ xmlGzfileRead (void * context, char * buffer, int len) {
return(gzread((gzFile) context, &buffer[0], len)); return(gzread((gzFile) context, &buffer[0], len));
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlGzfileWrite: * xmlGzfileWrite:
* @context: the I/O context * @context: the I/O context
@ -622,6 +635,7 @@ static int
xmlGzfileWrite (void * context, const char * buffer, int len) { xmlGzfileWrite (void * context, const char * buffer, int len) {
return(gzwrite((gzFile) context, (char *) &buffer[0], len)); return(gzwrite((gzFile) context, (char *) &buffer[0], len));
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
* xmlGzfileClose: * xmlGzfileClose:
@ -642,6 +656,7 @@ xmlGzfileClose (void * context) {
* * * *
************************************************************************/ ************************************************************************/
#ifdef LIBXML_OUTPUT_ENABLED
typedef struct xmlIOHTTPWriteCtxt_ typedef struct xmlIOHTTPWriteCtxt_
{ {
int compression; int compression;
@ -974,8 +989,10 @@ xmlZMemBuffGetContent( xmlZMemBuffPtr buff, char ** data_ref ) {
return ( zlgth ); return ( zlgth );
} }
#endif /* LIBXML_OUTPUT_ENABLED */
#endif /* HAVE_ZLIB_H */ #endif /* HAVE_ZLIB_H */
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlFreeHTTPWriteCtxt * xmlFreeHTTPWriteCtxt
* @ctxt: Context to cleanup * @ctxt: Context to cleanup
@ -1006,6 +1023,7 @@ xmlFreeHTTPWriteCtxt( xmlIOHTTPWriteCtxtPtr ctxt )
xmlFree( ctxt ); xmlFree( ctxt );
return; return;
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
@ -1036,6 +1054,7 @@ xmlIOHTTPOpen (const char *filename) {
return(xmlNanoHTTPOpen(filename, NULL)); return(xmlNanoHTTPOpen(filename, NULL));
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlIOHTTPOpenW: * xmlIOHTTPOpenW:
* @post_uri: The destination URI for the document * @post_uri: The destination URI for the document
@ -1099,7 +1118,9 @@ xmlIOHTTPOpenW(const char *post_uri, int compression)
return (ctxt); return (ctxt);
} }
#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlIOHTTPDfltOpenW * xmlIOHTTPDfltOpenW
* @post_uri: The destination URI for this document. * @post_uri: The destination URI for this document.
@ -1114,6 +1135,7 @@ static void *
xmlIOHTTPDfltOpenW( const char * post_uri ) { xmlIOHTTPDfltOpenW( const char * post_uri ) {
return ( xmlIOHTTPOpenW( post_uri, 0 ) ); return ( xmlIOHTTPOpenW( post_uri, 0 ) );
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
* xmlIOHTTPRead: * xmlIOHTTPRead:
@ -1130,6 +1152,7 @@ xmlIOHTTPRead(void * context, char * buffer, int len) {
return(xmlNanoHTTPRead(context, &buffer[0], len)); return(xmlNanoHTTPRead(context, &buffer[0], len));
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlIOHTTPWrite * xmlIOHTTPWrite
* @context: previously opened writing context * @context: previously opened writing context
@ -1173,6 +1196,7 @@ xmlIOHTTPWrite( void * context, const char * buffer, int len ) {
return ( len ); return ( len );
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
@ -1189,6 +1213,7 @@ xmlIOHTTPClose (void * context) {
return 0; return 0;
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlIOHTTCloseWrite * xmlIOHTTCloseWrite
* @context: The I/O context * @context: The I/O context
@ -1345,6 +1370,7 @@ static int
xmlIOHTTPClosePost( void * ctxt ) { xmlIOHTTPClosePost( void * ctxt ) {
return ( xmlIOHTTPCloseWrite( ctxt, "POST" ) ); return ( xmlIOHTTPCloseWrite( ctxt, "POST" ) );
} }
#endif /* LIBXML_OUTPUT_ENABLED */
#endif /* LIBXML_HTTP_ENABLED */ #endif /* LIBXML_HTTP_ENABLED */
@ -1438,6 +1464,7 @@ xmlRegisterInputCallbacks(xmlInputMatchCallback matchFunc,
return(xmlInputCallbackNr++); return(xmlInputCallbackNr++);
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlRegisterOutputCallbacks: * xmlRegisterOutputCallbacks:
* @matchFunc: the xmlOutputMatchCallback * @matchFunc: the xmlOutputMatchCallback
@ -1463,6 +1490,7 @@ xmlRegisterOutputCallbacks(xmlOutputMatchCallback matchFunc,
xmlOutputCallbackInitialized = 1; xmlOutputCallbackInitialized = 1;
return(xmlOutputCallbackNr++); return(xmlOutputCallbackNr++);
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
* xmlRegisterDefaultInputCallbacks: * xmlRegisterDefaultInputCallbacks:
@ -1494,6 +1522,7 @@ xmlRegisterDefaultInputCallbacks
xmlInputCallbackInitialized = 1; xmlInputCallbackInitialized = 1;
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlRegisterDefaultOutputCallbacks: * xmlRegisterDefaultOutputCallbacks:
* *
@ -1554,6 +1583,7 @@ xmlRegisterHTTPPostCallbacks( void ) {
return; return;
} }
#endif #endif
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
* xmlAllocParserInputBuffer: * xmlAllocParserInputBuffer:
@ -1593,6 +1623,7 @@ xmlAllocParserInputBuffer(xmlCharEncoding enc) {
return(ret); return(ret);
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlAllocOutputBuffer: * xmlAllocOutputBuffer:
* @encoder: the encoding converter or NULL * @encoder: the encoding converter or NULL
@ -1634,6 +1665,7 @@ xmlAllocOutputBuffer(xmlCharEncodingHandlerPtr encoder) {
return(ret); return(ret);
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
* xmlFreeParserInputBuffer: * xmlFreeParserInputBuffer:
@ -1663,6 +1695,7 @@ xmlFreeParserInputBuffer(xmlParserInputBufferPtr in) {
xmlFree(in); xmlFree(in);
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlOutputBufferClose: * xmlOutputBufferClose:
* @out: a buffered output * @out: a buffered output
@ -1700,6 +1733,7 @@ xmlOutputBufferClose(xmlOutputBufferPtr out) {
xmlFree(out); xmlFree(out);
return( ( err_rc == 0 ) ? written : err_rc ); return( ( err_rc == 0 ) ? written : err_rc );
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
* xmlParserInputBufferCreateFilename: * xmlParserInputBufferCreateFilename:
@ -1770,6 +1804,7 @@ xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc) {
return(ret); return(ret);
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlOutputBufferCreateFilename: * xmlOutputBufferCreateFilename:
* @URI: a C string containing the URI or filename * @URI: a C string containing the URI or filename
@ -1788,7 +1823,7 @@ xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc) {
xmlOutputBufferPtr xmlOutputBufferPtr
xmlOutputBufferCreateFilename(const char *URI, xmlOutputBufferCreateFilename(const char *URI,
xmlCharEncodingHandlerPtr encoder, xmlCharEncodingHandlerPtr encoder,
int compression) { int compression ATTRIBUTE_UNUSED) {
xmlOutputBufferPtr ret; xmlOutputBufferPtr ret;
int i = 0; int i = 0;
void *context = NULL; void *context = NULL;
@ -1899,6 +1934,7 @@ xmlOutputBufferCreateFilename(const char *URI,
} }
return(ret); return(ret);
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
* xmlParserInputBufferCreateFile: * xmlParserInputBufferCreateFile:
@ -1929,6 +1965,7 @@ xmlParserInputBufferCreateFile(FILE *file, xmlCharEncoding enc) {
return(ret); return(ret);
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlOutputBufferCreateFile: * xmlOutputBufferCreateFile:
* @file: a FILE* * @file: a FILE*
@ -1957,6 +1994,7 @@ xmlOutputBufferCreateFile(FILE *file, xmlCharEncodingHandlerPtr encoder) {
return(ret); return(ret);
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
* xmlParserInputBufferCreateFd: * xmlParserInputBufferCreateFd:
@ -2059,6 +2097,7 @@ xmlParserInputBufferCreateStatic(const char *mem, int size,
return(ret); return(ret);
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlOutputBufferCreateFd: * xmlOutputBufferCreateFd:
* @fd: a file descriptor number * @fd: a file descriptor number
@ -2084,6 +2123,7 @@ xmlOutputBufferCreateFd(int fd, xmlCharEncodingHandlerPtr encoder) {
return(ret); return(ret);
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
* xmlParserInputBufferCreateIO: * xmlParserInputBufferCreateIO:
@ -2114,6 +2154,7 @@ xmlParserInputBufferCreateIO(xmlInputReadCallback ioread,
return(ret); return(ret);
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlOutputBufferCreateIO: * xmlOutputBufferCreateIO:
* @iowrite: an I/O write function * @iowrite: an I/O write function
@ -2143,6 +2184,7 @@ xmlOutputBufferCreateIO(xmlOutputWriteCallback iowrite,
return(ret); return(ret);
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
* xmlParserInputBufferPush: * xmlParserInputBufferPush:
@ -2320,6 +2362,7 @@ xmlParserInputBufferRead(xmlParserInputBufferPtr in, int len) {
return(-1); return(-1);
} }
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlOutputBufferWrite: * xmlOutputBufferWrite:
* @out: a buffered parser output * @out: a buffered parser output
@ -2497,6 +2540,7 @@ xmlOutputBufferFlush(xmlOutputBufferPtr out) {
#endif #endif
return(ret); return(ret);
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/** /**
* xmlParserGetDirectory: * xmlParserGetDirectory:

View File

@ -29,7 +29,7 @@
#include <libxml/parser.h> #include <libxml/parser.h>
#include <libxml/globals.h> #include <libxml/globals.h>
#ifdef LIBXML_CATALOG_ENABLED #if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
static int shell = 0; static int shell = 0;
static int sgml = 0; static int sgml = 0;
static int noout = 0; static int noout = 0;
@ -580,8 +580,8 @@ int main(int argc, char **argv) {
return(exit_value); return(exit_value);
} }
#else #else
int main(int argc, char **argv) { int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
fprintf(stderr, "libxml was not compiled with catalog support\n"); fprintf(stderr, "libxml was not compiled with catalog and output support\n");
return(1); return(1);
} }
#endif #endif

View File

@ -102,8 +102,14 @@ static int debug = 0;
static int copy = 0; static int copy = 0;
static int recovery = 0; static int recovery = 0;
static int noent = 0; static int noent = 0;
static int noblanks = 0;
static int noout = 0; static int noout = 0;
static int nowrap = 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 #ifdef LIBXML_VALID_ENABLED
static int valid = 0; static int valid = 0;
static int postvalid = 0; static int postvalid = 0;
@ -118,7 +124,6 @@ static xmlSchemaPtr wxschemas = NULL;
#endif #endif
static int repeat = 0; static int repeat = 0;
static int insert = 0; static int insert = 0;
static int compress = 0;
#ifdef LIBXML_HTML_ENABLED #ifdef LIBXML_HTML_ENABLED
static int html = 0; static int html = 0;
#endif #endif
@ -127,8 +132,6 @@ static int push = 0;
#ifdef HAVE_SYS_MMAN_H #ifdef HAVE_SYS_MMAN_H
static int memory = 0; static int memory = 0;
#endif #endif
static int noblanks = 0;
static int format = 0;
static int testIO = 0; static int testIO = 0;
static char *encoding = NULL; static char *encoding = NULL;
#ifdef LIBXML_XINCLUDE_ENABLED #ifdef LIBXML_XINCLUDE_ENABLED
@ -147,7 +150,6 @@ static int nocatalogs = 0;
static int stream = 0; static int stream = 0;
static int chkregister = 0; static int chkregister = 0;
static int sax1 = 0; static int sax1 = 0;
static const char *output = NULL;
static int options = 0; static int options = 0;
/* /*
@ -983,6 +985,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
} }
}else }else
#endif /* LIBXML_VALID_ENABLED */ #endif /* LIBXML_VALID_ENABLED */
#ifdef LIBXML_OUTPUT_ENABLED
if (noout == 0) { if (noout == 0) {
/* /*
* print it. * print it.
@ -1062,6 +1065,7 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
} }
#endif #endif
} }
#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef LIBXML_VALID_ENABLED #ifdef LIBXML_VALID_ENABLED
/* /*
@ -1278,7 +1282,11 @@ static void showVersion(const char *name) {
static void usage(const char *name) { static void usage(const char *name) {
printf("Usage : %s [options] XMLfiles ...\n", 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"); 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"); printf("\t--version : display the version of the XML library used\n");
#ifdef LIBXML_DEBUG_ENABLED #ifdef LIBXML_DEBUG_ENABLED
printf("\t--debug : dump a debug tree of the in-memory document\n"); 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--output file or -o file: save to a given file\n");
printf("\t--repeat : repeat 100 times, for timing or profiling\n"); printf("\t--repeat : repeat 100 times, for timing or profiling\n");
printf("\t--insert : ad-hoc test for valid insertions\n"); printf("\t--insert : ad-hoc test for valid insertions\n");
#ifdef LIBXML_OUTPUT_ENABLED
#ifdef HAVE_ZLIB_H #ifdef HAVE_ZLIB_H
printf("\t--compress : turn on gzip compression of output\n"); printf("\t--compress : turn on gzip compression of output\n");
#endif #endif
#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef LIBXML_HTML_ENABLED #ifdef LIBXML_HTML_ENABLED
printf("\t--html : use the HTML parser\n"); printf("\t--html : use the HTML parser\n");
#endif #endif
@ -1317,10 +1327,13 @@ static void usage(const char *name) {
printf("\t--nowarning : do not emit warnings from parser/validator\n"); printf("\t--nowarning : do not emit warnings from parser/validator\n");
printf("\t--noblanks : drop (ignorable?) blanks spaces\n"); printf("\t--noblanks : drop (ignorable?) blanks spaces\n");
printf("\t--nocdata : replace cdata section with text nodes\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--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--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 #ifdef LIBXML_CATALOG_ENABLED
printf("\t--catalogs : use SGML catalogs from $SGML_CATALOG_FILES\n"); printf("\t--catalogs : use SGML catalogs from $SGML_CATALOG_FILES\n");
printf("\t otherwise XML Catalogs starting from \n"); printf("\t otherwise XML Catalogs starting from \n");
@ -1333,7 +1346,6 @@ static void usage(const char *name) {
#endif #endif
printf("\t--loaddtd : fetch external DTD\n"); printf("\t--loaddtd : fetch external DTD\n");
printf("\t--dtdattr : loaddtd + populate the tree with inherited attributes \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--stream : use the streaming interface to process very large files\n");
printf("\t--chkregister : verify the node registration code\n"); printf("\t--chkregister : verify the node registration code\n");
#ifdef LIBXML_SCHEMAS_ENABLED #ifdef LIBXML_SCHEMAS_ENABLED
@ -1411,24 +1423,26 @@ main(int argc, char **argv) {
} else if ((!strcmp(argv[i], "-noout")) || } else if ((!strcmp(argv[i], "-noout")) ||
(!strcmp(argv[i], "--noout"))) (!strcmp(argv[i], "--noout")))
noout++; noout++;
#ifdef LIBXML_OUTPUT_ENABLED
else if ((!strcmp(argv[i], "-o")) || else if ((!strcmp(argv[i], "-o")) ||
(!strcmp(argv[i], "-output")) || (!strcmp(argv[i], "-output")) ||
(!strcmp(argv[i], "--output"))) { (!strcmp(argv[i], "--output"))) {
i++; i++;
output = argv[i]; output = argv[i];
} }
#endif /* LIBXML_OUTPUT_ENABLED */
else if ((!strcmp(argv[i], "-htmlout")) || else if ((!strcmp(argv[i], "-htmlout")) ||
(!strcmp(argv[i], "--htmlout"))) (!strcmp(argv[i], "--htmlout")))
htmlout++; htmlout++;
else if ((!strcmp(argv[i], "-nowrap")) ||
(!strcmp(argv[i], "--nowrap")))
nowrap++;
#ifdef LIBXML_HTML_ENABLED #ifdef LIBXML_HTML_ENABLED
else if ((!strcmp(argv[i], "-html")) || else if ((!strcmp(argv[i], "-html")) ||
(!strcmp(argv[i], "--html"))) { (!strcmp(argv[i], "--html"))) {
html++; html++;
} }
#endif /* LIBXML_HTML_ENABLED */ #endif /* LIBXML_HTML_ENABLED */
else if ((!strcmp(argv[i], "-nowrap")) ||
(!strcmp(argv[i], "--nowrap")))
nowrap++;
else if ((!strcmp(argv[i], "-loaddtd")) || else if ((!strcmp(argv[i], "-loaddtd")) ||
(!strcmp(argv[i], "--loaddtd"))) { (!strcmp(argv[i], "--loaddtd"))) {
loaddtd++; loaddtd++;
@ -1496,6 +1510,7 @@ main(int argc, char **argv) {
/* options |= XML_PARSE_XINCLUDE; */ /* options |= XML_PARSE_XINCLUDE; */
} }
#endif #endif
#ifdef LIBXML_OUTPUT_ENABLED
#ifdef HAVE_ZLIB_H #ifdef HAVE_ZLIB_H
else if ((!strcmp(argv[i], "-compress")) || else if ((!strcmp(argv[i], "-compress")) ||
(!strcmp(argv[i], "--compress"))) { (!strcmp(argv[i], "--compress"))) {
@ -1503,6 +1518,7 @@ main(int argc, char **argv) {
xmlSetCompressMode(9); xmlSetCompressMode(9);
} }
#endif #endif
#endif /* LIBXML_OUTPUT_ENABLED */
else if ((!strcmp(argv[i], "-nowarning")) || else if ((!strcmp(argv[i], "-nowarning")) ||
(!strcmp(argv[i], "--nowarning"))) { (!strcmp(argv[i], "--nowarning"))) {
xmlGetWarningsDefaultValue = 0; xmlGetWarningsDefaultValue = 0;
@ -1548,7 +1564,9 @@ main(int argc, char **argv) {
else if ((!strcmp(argv[i], "-format")) || else if ((!strcmp(argv[i], "-format")) ||
(!strcmp(argv[i], "--format"))) { (!strcmp(argv[i], "--format"))) {
noblanks++; noblanks++;
#ifdef LIBXML_OUTPUT_ENABLED
format++; format++;
#endif /* LIBXML_OUTPUT_ENABLED */
xmlKeepBlanksDefault(0); xmlKeepBlanksDefault(0);
} }
else if ((!strcmp(argv[i], "-stream")) || else if ((!strcmp(argv[i], "-stream")) ||

View File

@ -668,7 +668,9 @@ static void debugmem_tag_error(void *p)
#endif #endif
} }
#ifdef MEM_LIST
static FILE *xmlMemoryDumpFile = NULL; static FILE *xmlMemoryDumpFile = NULL;
#endif
/** /**
* xmlMemShow: * xmlMemShow:

View File

@ -764,6 +764,7 @@ xmlTextReaderPushData(xmlTextReaderPtr reader) {
return(0); return(0);
} }
#ifdef LIBXML_REGEXP_ENABLED
/** /**
* xmlTextReaderValidatePush: * xmlTextReaderValidatePush:
* @reader: the xmlTextReaderPtr used * @reader: the xmlTextReaderPtr used
@ -771,8 +772,7 @@ xmlTextReaderPushData(xmlTextReaderPtr reader) {
* Push the current node for validation * Push the current node for validation
*/ */
static void static void
xmlTextReaderValidatePush(xmlTextReaderPtr reader) { xmlTextReaderValidatePush(xmlTextReaderPtr reader ATTRIBUTE_UNUSED) {
#ifdef LIBXML_REGEXP_ENABLED
xmlNodePtr node = reader->node; xmlNodePtr node = reader->node;
if ((reader->validate == XML_TEXTREADER_VALIDATE_DTD) && if ((reader->validate == XML_TEXTREADER_VALIDATE_DTD) &&
@ -820,7 +820,6 @@ printf("Expand failed !\n");
reader->rngValidErrors++; reader->rngValidErrors++;
#endif #endif
} }
#endif /* LIBXML_REGEXP_ENABLED */
} }
/** /**
@ -834,7 +833,6 @@ printf("Expand failed !\n");
static void static void
xmlTextReaderValidateCData(xmlTextReaderPtr reader, xmlTextReaderValidateCData(xmlTextReaderPtr reader,
const xmlChar *data, int len) { const xmlChar *data, int len) {
#ifdef LIBXML_REGEXP_ENABLED
if ((reader->validate == XML_TEXTREADER_VALIDATE_DTD) && if ((reader->validate == XML_TEXTREADER_VALIDATE_DTD) &&
(reader->ctxt != NULL) && (reader->ctxt->validate == 1)) { (reader->ctxt != NULL) && (reader->ctxt->validate == 1)) {
reader->ctxt->valid &= xmlValidatePushCData(&reader->ctxt->vctxt, reader->ctxt->valid &= xmlValidatePushCData(&reader->ctxt->vctxt,
@ -850,7 +848,6 @@ xmlTextReaderValidateCData(xmlTextReaderPtr reader,
reader->rngValidErrors++; reader->rngValidErrors++;
#endif #endif
} }
#endif /* LIBXML_REGEXP_ENABLED */
} }
/** /**
@ -861,7 +858,6 @@ xmlTextReaderValidateCData(xmlTextReaderPtr reader,
*/ */
static void static void
xmlTextReaderValidatePop(xmlTextReaderPtr reader) { xmlTextReaderValidatePop(xmlTextReaderPtr reader) {
#ifdef LIBXML_REGEXP_ENABLED
xmlNodePtr node = reader->node; xmlNodePtr node = reader->node;
if ((reader->validate == XML_TEXTREADER_VALIDATE_DTD) && if ((reader->validate == XML_TEXTREADER_VALIDATE_DTD) &&
@ -898,8 +894,8 @@ xmlTextReaderValidatePop(xmlTextReaderPtr reader) {
reader->rngValidErrors++; reader->rngValidErrors++;
#endif #endif
} }
#endif /* LIBXML_REGEXP_ENABLED */
} }
/** /**
* xmlTextReaderValidateEntity: * xmlTextReaderValidateEntity:
* @reader: the xmlTextReaderPtr used * @reader: the xmlTextReaderPtr used
@ -910,7 +906,6 @@ xmlTextReaderValidatePop(xmlTextReaderPtr reader) {
*/ */
static void static void
xmlTextReaderValidateEntity(xmlTextReaderPtr reader) { xmlTextReaderValidateEntity(xmlTextReaderPtr reader) {
#ifdef LIBXML_REGEXP_ENABLED
xmlNodePtr oldnode = reader->node; xmlNodePtr oldnode = reader->node;
xmlNodePtr node = reader->node; xmlNodePtr node = reader->node;
xmlParserCtxtPtr ctxt = reader->ctxt; xmlParserCtxtPtr ctxt = reader->ctxt;
@ -941,6 +936,7 @@ xmlTextReaderValidateEntity(xmlTextReaderPtr reader) {
break; break;
node = node->next; node = node->next;
} }
#ifdef LIBXML_REGEXP_ENABLED
} else if (node->type == XML_ELEMENT_NODE) { } else if (node->type == XML_ELEMENT_NODE) {
reader->node = node; reader->node = node;
xmlTextReaderValidatePush(reader); xmlTextReaderValidatePush(reader);
@ -948,6 +944,7 @@ xmlTextReaderValidateEntity(xmlTextReaderPtr reader) {
(node->type == XML_CDATA_SECTION_NODE)) { (node->type == XML_CDATA_SECTION_NODE)) {
xmlTextReaderValidateCData(reader, node->content, xmlTextReaderValidateCData(reader, node->content,
xmlStrlen(node->content)); xmlStrlen(node->content));
#endif
} }
/* /*
@ -991,8 +988,8 @@ xmlTextReaderValidateEntity(xmlTextReaderPtr reader) {
} while ((node != NULL) && (node != oldnode)); } while ((node != NULL) && (node != oldnode));
} while ((node != NULL) && (node != oldnode)); } while ((node != NULL) && (node != oldnode));
reader->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; reader->state = XML_TEXTREADER_END;
goto node_found; goto node_found;
} }
#ifdef LIBXML_REGEXP_ENABLED
if ((reader->validate) && if ((reader->validate) &&
(reader->node->type == XML_ELEMENT_NODE)) (reader->node->type == XML_ELEMENT_NODE))
xmlTextReaderValidatePop(reader); xmlTextReaderValidatePop(reader);
#endif /* LIBXML_REGEXP_ENABLED */
reader->node = reader->node->next; reader->node = reader->node->next;
reader->state = XML_TEXTREADER_ELEMENT; reader->state = XML_TEXTREADER_ELEMENT;
@ -1183,8 +1182,10 @@ get_next_node:
reader->state = XML_TEXTREADER_END; reader->state = XML_TEXTREADER_END;
goto node_found; goto node_found;
} }
#ifdef LIBXML_REGEXP_ENABLED
if ((reader->validate) && (reader->node->type == XML_ELEMENT_NODE)) if ((reader->validate) && (reader->node->type == XML_ELEMENT_NODE))
xmlTextReaderValidatePop(reader); xmlTextReaderValidatePop(reader);
#endif /* LIBXML_REGEXP_ENABLED */
reader->node = reader->node->parent; reader->node = reader->node->parent;
if ((reader->node == NULL) || if ((reader->node == NULL) ||
(reader->node->type == XML_DOCUMENT_NODE) || (reader->node->type == XML_DOCUMENT_NODE) ||
@ -1249,10 +1250,12 @@ node_found:
xmlTextReaderEntPush(reader, reader->node); xmlTextReaderEntPush(reader, reader->node);
reader->node = reader->node->children->children; reader->node = reader->node->children->children;
} }
#ifdef LIBXML_REGEXP_ENABLED
} else if ((reader->node != NULL) && } else if ((reader->node != NULL) &&
(reader->node->type == XML_ENTITY_REF_NODE) && (reader->node->type == XML_ENTITY_REF_NODE) &&
(reader->ctxt != NULL) && (reader->validate)) { (reader->ctxt != NULL) && (reader->validate)) {
xmlTextReaderValidateEntity(reader); xmlTextReaderValidateEntity(reader);
#endif /* LIBXML_REGEXP_ENABLED */
} }
if ((reader->node != NULL) && if ((reader->node != NULL) &&
(reader->node->type == XML_ENTITY_DECL) && (reader->node->type == XML_ENTITY_DECL) &&

View File

@ -512,6 +512,7 @@ xmlSchemaErrorContext(xmlSchemaParserCtxtPtr ctxt, xmlSchemaPtr schema,
* * * *
************************************************************************/ ************************************************************************/
#ifdef LIBXML_OUTPUT_ENABLED
/** /**
* xmlSchemaElementDump: * xmlSchemaElementDump:
* @elem: an element * @elem: an element
@ -741,6 +742,7 @@ xmlSchemaDump(FILE * output, xmlSchemaPtr schema)
xmlHashScanFull(schema->elemDecl, xmlHashScanFull(schema->elemDecl,
(xmlHashScannerFull) xmlSchemaElementDump, output); (xmlHashScannerFull) xmlSchemaElementDump, output);
} }
#endif /* LIBXML_OUTPUT_ENABLED */
/************************************************************************ /************************************************************************
* * * *