summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2012-08-06 10:16:41 +0800
committerDaniel Veillard <veillard@redhat.com>2012-08-06 10:16:41 +0800
commit18e1f1f1180c4d48ed52bf995b3c700c2cefb492 (patch)
tree7e1485d3fd374d6c626b5471cce69c27da0960f6 /include
parent3f0c613f28396c2b1acf90ad08382f0c9620d035 (diff)
downloadlibxml2-18e1f1f1180c4d48ed52bf995b3c700c2cefb492.tar.gz
Improvements for old buffer compatibility
Now tree.h exports LIBXML2_NEW_BUFFER macro indicating that the API uses the new buffers, important to keep code working with both versions. * tree.h buf.h: also export xmlBufContent(), xmlBufEnd(), and xmlBufUse() to help port the old code * buf.c: make sure the compatibility counters are updated on buffer usage, to keep proper working of application compiled against the old structures, but take care of int overflow
Diffstat (limited to 'include')
-rw-r--r--include/libxml/tree.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/libxml/tree.h b/include/libxml/tree.h
index 8f80d8d9..7562d9a5 100644
--- a/include/libxml/tree.h
+++ b/include/libxml/tree.h
@@ -112,6 +112,16 @@ typedef struct _xmlBuf xmlBuf;
typedef xmlBuf *xmlBufPtr;
+/*
+ * A few public routines for xmlBuf. As those are expected to be used
+ * mostly internally the bulk of the routines are internal in buf.h
+ */
+XMLPUBFUN xmlChar* XMLCALL xmlBufContent (const xmlBufPtr buf);
+XMLPUBFUN xmlChar* XMLCALL xmlBufEnd (const xmlBufPtr buf);
+XMLPUBFUN size_t XMLCALL xmlBufUse (xmlBufPtr buf);
+
+#define LIBXML2_NEW_BUFFER
+
/**
* XML_XML_NAMESPACE:
*
@@ -667,7 +677,7 @@ XMLPUBFUN const xmlChar * XMLCALL
int *len);
/*
- * Handling Buffers.
+ * Handling Buffers, the old ones see @xmlBuf for the new ones.
*/
XMLPUBFUN void XMLCALL