dnl check libxml2 (needed for tools)
if test "$build_tools" != "false" ; then
- PKG_CHECK_MODULES(LIBXML2, [libxml-2.0 >= 2.9 ],[],
+ PKG_CHECK_MODULES(LIBXML2, [libxml-2.0],[],
[
if test "$build_tools" = "true" ; then
AC_MSG_ERROR([Could not found libxml2, tools cannot be compiled.])
#include "lpc2xml.h"
#include <string.h>
#include <libxml/xmlsave.h>
-
+#include <libxml/xmlversion.h>
#define LPC2XML_BZ 2048
return ret;
}
-int lpc2xml_convert_string(lpc2xml_context* context, unsigned char **content) {
+int lpc2xml_convert_string(lpc2xml_context* context, char **content) {
int ret = 0;
xmlBufferPtr buffer = xmlBufferCreate();
xmlSaveCtxtPtr save_ctx = xmlSaveToBuffer(buffer, "UTF-8", XML_SAVE_FORMAT);
}
xmlSaveClose(save_ctx);
if(ret == 0) {
- *content = xmlBufferDetach(buffer);
+#if LIBXML_VERSION >= 20800
+ *content = (char *)xmlBufferDetach(buffer);
+#else
+ *content = strdup((const char *)xmlBufferContent(buffer));
+#endif
}
xmlBufferFree(buffer);
return ret;
int lpc2xml_convert_file(lpc2xml_context* context, const char *filename);
int lpc2xml_convert_fd(lpc2xml_context* context, int fd);
-int lpc2xml_convert_string(lpc2xml_context* context, unsigned char **content);
+int lpc2xml_convert_string(lpc2xml_context* context, char **content);
#endif //LPC2XML_H_