[xiph-commits] r9729 - icecast/trunk/icecast/src

oddsock at svn.xiph.org oddsock at svn.xiph.org
Thu Aug 11 13:31:15 PDT 2005


Author: oddsock
Date: 2005-08-11 13:31:13 -0700 (Thu, 11 Aug 2005)
New Revision: 9729

Modified:
   icecast/trunk/icecast/src/xslt.c
Log:
xlst function so that win32 can use an older version of libxslt...

Modified: icecast/trunk/icecast/src/xslt.c
===================================================================
--- icecast/trunk/icecast/src/xslt.c	2005-08-11 14:14:40 UTC (rev 9728)
+++ icecast/trunk/icecast/src/xslt.c	2005-08-11 20:31:13 UTC (rev 9729)
@@ -33,6 +33,33 @@
 #ifndef _WIN32
 #include <sys/time.h>
 #endif
+
+#ifdef WIN32
+#define snprintf _snprintf
+int xsltSaveResultToString(xmlChar **doc_txt_ptr, int * doc_txt_len, xmlDocPtr result, xsltStylesheetPtr style) {
+    xmlOutputBufferPtr buf;
+
+    *doc_txt_ptr = NULL;
+    *doc_txt_len = 0;
+    if (result->children == NULL)
+	return(0);
+
+	buf = xmlAllocOutputBuffer(NULL);
+
+    if (buf == NULL)
+		return(-1);
+    xsltSaveResultTo(buf, result, style);
+    if (buf->conv != NULL) {
+		*doc_txt_len = buf->conv->use;
+		*doc_txt_ptr = xmlStrndup(buf->conv->content, *doc_txt_len);
+    } else {
+		*doc_txt_len = buf->buffer->use;
+		*doc_txt_ptr = xmlStrndup(buf->buffer->content, *doc_txt_len);
+    }
+    (void)xmlOutputBufferClose(buf);
+    return 0;
+}
+#endif
 
 
 #include "thread/thread.h"



More information about the commits mailing list