[xml] PATCH: implement xmlSaveToBuffer()



Hi,

the attached patch implement the function xmlSaveToBuffer() which was documented but not implemented.

Can the patch be applied?

Thanks,
Geert Jansen
diff -ur libxml2-2.6.22.orig/xmlsave.c libxml2-2.6.22/xmlsave.c
--- libxml2-2.6.22.orig/xmlsave.c       2005-09-12 17:35:07.000000000 +0200
+++ libxml2-2.6.22/xmlsave.c    2005-11-06 14:59:49.000000000 +0100
@@ -1473,13 +1473,18 @@
  * with the encoding and the options given
  *
  * Returns a new serialization context or NULL in case of error.
+ */
+
 xmlSaveCtxtPtr
 xmlSaveToBuffer(xmlBufferPtr buffer, const char *encoding, int options)
 {
-    TODO
-    return(NULL);
+    xmlSaveCtxtPtr ret;
+
+    ret = xmlNewSaveCtxt(encoding, options);
+    if (ret == NULL) return(NULL);
+    ret->buf = buffer;
+    return(ret);
 }
- */
 
 /**
  * xmlSaveToIO:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]