Commit a9cce9cd authored by Daniel Veillard's avatar Daniel Veillard

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
parent c064b476
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
......
......@@ -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 */
......@@ -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;
......
......@@ -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 */
......@@ -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:
......
......@@ -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" = ""
......
......@@ -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);
......
......@@ -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 ();
......
......@@ -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 */
......@@ -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);
......
......@@ -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
......
......@@ -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__ */
......@@ -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);
......
......@@ -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,
......
......@@ -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);
......
......@@ -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
......
......@@ -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
*/
......
......@@ -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
*/
......
......@@ -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
......
......@@ -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,9 +200,12 @@ 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
......@@ -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
......
......@@ -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
*/
......
......@@ -83,6 +83,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
#endif
#endif
/**
* LIBXML_OUTPUT_ENABLED:
*
* Whether the serialization/saving support is configured in
*/
#if @WITH_OUTPUT@
#define LIBXML_OUTPUT_ENABLED
#endif
/**
* LIBXML_FTP_ENABLED:
*
......
......@@ -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.
*/
......
......@@ -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
......
......@@ -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:
......
......@@ -11974,7 +11974,9 @@ xmlInitParser(void) {
xmlInitializePredefinedEntities();
xmlDefaultSAXHandlerInit();
xmlRegisterDefaultInputCallbacks();
#ifdef LIBXML_OUTPUT_ENABLED
xmlRegisterDefaultOutputCallbacks();
#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef LIBXML_HTML_ENABLED
htmlInitAutoClose();
htmlDefaultSAXHandlerInit();
......
......@@ -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)