Bunch of updates, progressive parsing, updates on HTML, XPAth and docs, Daniel
diff --git a/include/libxml/parser.h b/include/libxml/parser.h
index 65433d8..43d183e 100644
--- a/include/libxml/parser.h
+++ b/include/libxml/parser.h
@@ -31,6 +31,7 @@
const CHAR *cur; /* Current char being parsed */
int line; /* Current line */
int col; /* Current column */
+ int consumed; /* How many CHARs were already consumed */
xmlParserInputDeallocate free; /* function to deallocate the base */
} xmlParserInput;
typedef xmlParserInput *xmlParserInputPtr;
@@ -186,6 +187,13 @@
#include "xml-error.h"
/*
+ * Input functions
+ */
+
+int xmlParserInputRead(xmlParserInputPtr in, int len);
+int xmlParserInputGrow(xmlParserInputPtr in, int len);
+
+/*
* CHAR handling
*/
CHAR *xmlStrdup(const CHAR *cur);
diff --git a/include/libxml/tree.h b/include/libxml/tree.h
index 0746c35..fddabb7 100644
--- a/include/libxml/tree.h
+++ b/include/libxml/tree.h
@@ -269,6 +269,8 @@
void xmlBufferAdd(xmlBufferPtr buf, const CHAR *str, int len);
void xmlBufferCat(xmlBufferPtr buf, const CHAR *str);
void xmlBufferCCat(xmlBufferPtr buf, const char *str);
+int xmlBufferShrink(xmlBufferPtr buf, int len);
+void xmlBufferEmpty(xmlBufferPtr buf);
/*
* Creating/freeing new structures
diff --git a/include/libxml/xmlIO.h b/include/libxml/xmlIO.h
index d6edcae..bdeecc3 100644
--- a/include/libxml/xmlIO.h
+++ b/include/libxml/xmlIO.h
@@ -11,6 +11,7 @@
#include <stdio.h>
#include "tree.h"
+#include "encoding.h"
#ifdef __cplusplus
extern "C" {
@@ -19,13 +20,10 @@
typedef struct xmlParserInputBuffer {
/* Inputs */
FILE *file; /* Input on file handler */
+ void* gzfile; /* Input on a compressed stream */
int fd; /* Input on a file descriptor */
-/**********
-#ifdef HAVE_ZLIB_H
- gzFile gzfile; Input on a compressed stream
-#endif
- */
+ xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 */
@@ -33,6 +31,21 @@
typedef xmlParserInputBuffer *xmlParserInputBufferPtr;
+/*
+ * Interfaces
+ */
+
+xmlParserInputBufferPtr xmlParserInputBufferCreateFilename(const char *filename,
+ xmlCharEncoding enc);
+xmlParserInputBufferPtr xmlParserInputBufferCreateFile(FILE *file,
+ xmlCharEncoding enc);
+xmlParserInputBufferPtr xmlParserInputBufferCreateFd(int fd, xmlCharEncoding enc);
+
+int xmlParserInputBufferRead(xmlParserInputBufferPtr in, int len);
+int xmlParserInputBufferGrow(xmlParserInputBufferPtr in, int len);
+
+void xmlFreeParserInputBuffer(xmlParserInputBufferPtr in);
+
#ifdef __cplusplus
}
#endif
diff --git a/include/libxml/xpath.h b/include/libxml/xpath.h
index fb06e23..737b55c 100644
--- a/include/libxml/xpath.h
+++ b/include/libxml/xpath.h
@@ -37,13 +37,12 @@
#define XPATH_BOOLEAN 2
#define XPATH_NUMBER 3
#define XPATH_STRING 4
-#define XPATH_MARKER 5 /* used for func call checks */
typedef struct xmlXPathObject {
int type;
xmlNodeSetPtr nodesetval;
int boolval;
- float floatval;
+ double floatval;
CHAR *stringval;
} xmlXPathObject, *xmlXPathObjectPtr;