added support for large file, tested with a 3+GB instance, and some

* libxml.h include/libxml/parser.h parser.c xmlIO.c DOCBparser.c:
  added support for large file, tested with a 3+GB instance,
  and some cleanup.
* catalog.c: added a TODO
* Makefile.am: added some "make tests" comments
Daniel
diff --git a/ChangeLog b/ChangeLog
index 64ed432..da5ec32 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Fri Apr 18 14:31:15 CEST 2003 Daniel Veillard <daniel@veillard.com>
+
+	* libxml.h include/libxml/parser.h parser.c xmlIO.c DOCBparser.c: 
+	  added support for large file, tested with a 3+GB instance,
+	  and some cleanup.
+	* catalog.c: added a TODO
+	* Makefile.am: added some "make tests" comments
+
 Thu Apr 17 14:51:57 CEST 2003 Daniel Veillard <daniel@veillard.com>
 
 	* relaxng.c: some cleanups
diff --git a/DOCBparser.c b/DOCBparser.c
index 4673a6c..232c5a5 100644
--- a/DOCBparser.c
+++ b/DOCBparser.c
@@ -4713,7 +4713,7 @@
         */
        while (RAW != ']') {
            const xmlChar *check = CUR_PTR;
-           int cons = ctxt->input->consumed;
+           unsigned int cons = ctxt->input->consumed;
 
            SKIP_BLANKS;
            docbParseMarkupDecl(ctxt);
diff --git a/Makefile.am b/Makefile.am
index 216af1b..9d32c31 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -408,6 +408,8 @@
 	@echo "##"
 	@echo "## XInclude regression tests"
 	@echo "##"
+	@echo "## the warning reported on fallback.xml test is expected"
+	@echo "##"
 	-@(for i in $(srcdir)/test/XInclude/docs/* ; do \
 	  name=`basename $$i`; \
 	  if [ ! -d $$i ] ; then \
@@ -736,6 +738,9 @@
 	@echo "##"
 	@echo "## Relax-NG streaming regression tests"
 	@echo "##"
+	@echo "## Some error messages are different than non-streaming"
+	@echo "## and generate small diffs"
+	@echo "##"
 	-@(for i in $(srcdir)/test/relaxng/*.rng ; do \
 	  name=`basename $$i | sed 's+\.rng++'`; \
 	  for j in $(srcdir)/test/relaxng/"$$name"_*.xml ; do \
diff --git a/catalog.c b/catalog.c
index 040d99c..a9dc3a4 100644
--- a/catalog.c
+++ b/catalog.c
@@ -47,6 +47,11 @@
  * TODO:
  *
  * macro to flag unimplemented blocks
+ * XML_CATALOG_PREFER user env to select between system/public prefered
+ * option. C.f. Richard Tobin <richard@cogsci.ed.ac.uk>
+ *> Just FYI, I am using an environment variable XML_CATALOG_PREFER with
+ *> values "system" and "public".  I have made the default be "system" to
+ *> match yours.
  */
 #define TODO 								\
     xmlGenericError(xmlGenericErrorContext,				\
diff --git a/include/libxml/parser.h b/include/libxml/parser.h
index d221825..d623e73 100644
--- a/include/libxml/parser.h
+++ b/include/libxml/parser.h
@@ -55,7 +55,12 @@
     int length;                       /* length if known */
     int line;                         /* Current line */
     int col;                          /* Current column */
-    int consumed;                     /* How many xmlChars already consumed */
+    /*
+     * NOTE: consumed is only tested for equality in the parser code,
+     *       so even if there is an overflow this should not give troubles
+     *       for parsing very large instances.
+     */
+    unsigned long consumed;           /* How many xmlChars already consumed */
     xmlParserInputDeallocate free;    /* function to deallocate the base */
     const xmlChar *encoding;          /* the encoding string for entity */
     const xmlChar *version;           /* the version string for entity */
diff --git a/libxml.h b/libxml.h
index 6b7476f..8b1b949 100644
--- a/libxml.h
+++ b/libxml.h
@@ -9,6 +9,15 @@
 #ifndef __XML_LIBXML_H__
 #define __XML_LIBXML_H__
 
+#ifndef NO_LARGEFILE_SOURCE
+#ifndef _LARGEFILE_SOURCE
+#define _LARGEFILE_SOURCE
+#endif
+#ifndef _FILE_OFFSET_BITS
+#define _FILE_OFFSET_BITS 64
+#endif
+#endif
+
 #if defined(WIN32) && !defined(__CYGWIN__)
 #include "win32config.h"
 #elif defined(macintosh)
diff --git a/parser.c b/parser.c
index 5c7af3d..19da806 100644
--- a/parser.c
+++ b/parser.c
@@ -5044,7 +5044,7 @@
 	while ((RAW != 0) && ((RAW != ']') || (NXT(1) != ']') ||
 	       (NXT(2) != '>'))) {
 	    const xmlChar *check = CUR_PTR;
-	    int cons = ctxt->input->consumed;
+	    unsigned int cons = ctxt->input->consumed;
 
 	    if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
 		xmlParseConditionalSections(ctxt);
@@ -5352,7 +5352,7 @@
            ((RAW == '<') && (NXT(1) == '!')) ||
 	   (RAW == '%') || IS_BLANK(CUR)) {
 	const xmlChar *check = CUR_PTR;
-	int cons = ctxt->input->consumed;
+	unsigned int cons = ctxt->input->consumed;
 
 	GROW;
         if ((RAW == '<') && (NXT(1) == '!') && (NXT(2) == '[')) {
@@ -6485,7 +6485,7 @@
 	 */
 	while (RAW != ']') {
 	    const xmlChar *check = CUR_PTR;
-	    int cons = ctxt->input->consumed;
+	    unsigned int cons = ctxt->input->consumed;
 
 	    SKIP_BLANKS;
 	    xmlParseMarkupDecl(ctxt);
@@ -6695,7 +6695,7 @@
 	   ((RAW != '/') || (NXT(1) != '>')) &&
 	   (IS_CHAR(RAW))) {
 	const xmlChar *q = CUR_PTR;
-	int cons = ctxt->input->consumed;
+	unsigned int cons = ctxt->input->consumed;
 
 	attname = xmlParseAttribute(ctxt, &attvalue);
         if ((attname != NULL) && (attvalue != NULL)) {
@@ -7030,7 +7030,7 @@
     while ((RAW != 0) &&
 	   ((RAW != '<') || (NXT(1) != '/'))) {
 	const xmlChar *test = CUR_PTR;
-	int cons = ctxt->input->consumed;
+	unsigned int cons = ctxt->input->consumed;
 	const xmlChar *cur = ctxt->input->cur;
 
 	/*
@@ -8709,7 +8709,7 @@
 	    }
             case XML_PARSER_CONTENT: {
 		const xmlChar *test;
-		int cons;
+		unsigned int cons;
 		if ((avail < 2) && (ctxt->inputNr == 1))
 		    goto done;
 		cur = ctxt->input->cur[0];
diff --git a/xmlIO.c b/xmlIO.c
index f137d66..a3b1dc0 100644
--- a/xmlIO.c
+++ b/xmlIO.c
@@ -1713,8 +1713,7 @@
  * Returns the new parser input or NULL
  */
 xmlParserInputBufferPtr
-xmlParserInputBufferCreateFilename
-(const char *URI, xmlCharEncoding enc) {
+xmlParserInputBufferCreateFilename(const char *URI, xmlCharEncoding enc) {
     xmlParserInputBufferPtr ret;
     int i = 0;
     void *context = NULL;