- tree.[ch] xmlIO.h: applied patch from Joe McAlerney to add
  xmlSaveFormatFileTo()
Daniel
diff --git a/ChangeLog b/ChangeLog
index 62e3442..178541f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sat Apr 28 18:54:28 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
+
+	* tree.[ch] xmlIO.h: applied patch from Joe McAlerney to add
+	  xmlSaveFormatFileTo()
+
 Sat Apr 28 16:33:05 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
 
 	* xpath.c: simple and efficient optimization, XPath functions
diff --git a/include/libxml/tree.h b/include/libxml/tree.h
index fea27aa..604f881 100644
--- a/include/libxml/tree.h
+++ b/include/libxml/tree.h
@@ -689,11 +689,15 @@
 					 int level,
 					 int format);
 
-/* This one is exported from xmlIO.h
+/* These are exported from xmlIO.h
  
 int		xmlSaveFileTo		(xmlOutputBuffer *buf,
 					 xmlDocPtr cur,
 					 const char *encoding);
+int             xmlSaveFormatFileTo     (xmlOutputBuffer *buf,
+                                         xmlDocPtr cur,
+                                         const char *encoding,
+                                         int format);
  */ 					 
 
 int		xmlSaveFileEnc		(const char *filename,
diff --git a/include/libxml/xmlIO.h b/include/libxml/xmlIO.h
index fee5b9b..ae7b76f 100644
--- a/include/libxml/xmlIO.h
+++ b/include/libxml/xmlIO.h
@@ -162,6 +162,10 @@
 int		xmlSaveFileTo		(xmlOutputBuffer *buf,
 					 xmlDocPtr cur,
 					 const char *encoding);
+int             xmlSaveFormatFileTo     (xmlOutputBuffer *buf,
+					 xmlDocPtr cur,
+				         const char *encoding,
+				         int format);
 void		xmlNodeDumpOutput	(xmlOutputBufferPtr buf,
 					 xmlDocPtr doc,
 					 xmlNodePtr cur,
diff --git a/tree.c b/tree.c
index 965aecd..f4f2288 100644
--- a/tree.c
+++ b/tree.c
@@ -6130,6 +6130,27 @@
 }
 
 /**
+ * xmlSaveFormatFileTo:
+ * @buf:  an output I/O buffer
+ * @cur:  the document
+ * @encoding:  the encoding if any assuming the i/O layer handles the trancoding
+ * @format: should formatting spaces been added
+ *
+ * Dump an XML document to an I/O buffer.
+ *
+ * returns: the number of byte written or -1 in case of failure.
+ */
+int
+xmlSaveFormatFileTo(xmlOutputBuffer *buf, xmlDocPtr cur, const char *encoding, int format) {
+  int ret;
+
+  if (buf == NULL) return(0);
+  xmlDocContentDumpOutput(buf, cur, encoding, format);
+  ret = xmlOutputBufferClose(buf);
+  return(ret);
+}
+
+/**
  * xmlSaveFileEnc:
  * @filename:  the filename (or URL)
  * @cur:  the document
diff --git a/tree.h b/tree.h
index fea27aa..604f881 100644
--- a/tree.h
+++ b/tree.h
@@ -689,11 +689,15 @@
 					 int level,
 					 int format);
 
-/* This one is exported from xmlIO.h
+/* These are exported from xmlIO.h
  
 int		xmlSaveFileTo		(xmlOutputBuffer *buf,
 					 xmlDocPtr cur,
 					 const char *encoding);
+int             xmlSaveFormatFileTo     (xmlOutputBuffer *buf,
+                                         xmlDocPtr cur,
+                                         const char *encoding,
+                                         int format);
  */ 					 
 
 int		xmlSaveFileEnc		(const char *filename,
diff --git a/xmlIO.h b/xmlIO.h
index fee5b9b..ae7b76f 100644
--- a/xmlIO.h
+++ b/xmlIO.h
@@ -162,6 +162,10 @@
 int		xmlSaveFileTo		(xmlOutputBuffer *buf,
 					 xmlDocPtr cur,
 					 const char *encoding);
+int             xmlSaveFormatFileTo     (xmlOutputBuffer *buf,
+					 xmlDocPtr cur,
+				         const char *encoding,
+				         int format);
 void		xmlNodeDumpOutput	(xmlOutputBufferPtr buf,
 					 xmlDocPtr doc,
 					 xmlNodePtr cur,