+2012-08-09 Dodji Seketeli <dodji@redhat.com>
+
+ Use accessor functions to manipulate xmlOutputBuffer
+ * native/jni/xmlj/xmlj_io.c (GET_XML_OUTPUT_BUFFER_CONTENT)
+ (GET_XML_OUTPUT_BUFFER_SIZE): New macros.
+ (xmljOutputWriteCallback): Use them.
+
2012-03-08 Andrew John Hughes <ahughes@redhat.com>
* NEWS: Set correct release date.
xmlCharEncoding
xmljDetectCharEncoding (JNIEnv * env, jbyteArray buffer);
+
+#ifdef LIBXML2_NEW_BUFFER
+#define GET_XML_OUTPUT_BUFFER_CONTENT(buf) (gchar *) \
+ (char *) xmlOutputBufferGetContent(buf)
+#define GET_XML_OUTPUT_BUFFER_SIZE(buf) \
+ xmlOutputBufferGetSize(buf)
+#else
+#define GET_XML_OUTPUT_BUFFER_CONTENT(buf) \
+ (buf)->buffer->content
+#define GET_XML_OUTPUT_BUFFER_SIZE(buf) \
+ (buf)->buffer->use
+#endif
+
int
xmljOutputWriteCallback (void *context, const char *buffer, int len)
{
inputStream->directory = NULL;
inputStream->buf = inputBuffer;
- inputStream->base = inputStream->buf->buffer->content;
- inputStream->cur = inputStream->buf->buffer->content;
- inputStream->end = &inputStream->base[inputStream->buf->buffer->use];
+ inputStream->base = GET_XML_OUTPUT_BUFFER_CONTENT (inputStream->buf);
+ inputStream->cur = GET_XML_OUTPUT_BUFFER_CONTENT (inputStream->buf);
+ inputStream->end =
+ &inputStream->base[GET_XML_OUTPUT_BUFFER_SIZE (inputStream->buf)];
if ((ctxt->directory == NULL) && (inputStream->directory != NULL))
ctxt->directory =
(char *) xmlStrdup ((const xmlChar *) inputStream->directory);