add streaming on memory regression tests, found bad bugs in the reader

* Makefile.am: add streaming on memory regression tests, found
  bad bugs in the reader interface
* xmlreader.c: fixing bugs w.r.t. very large names, and special
  condition in end of file.
* xmlIO.c tree.c include/libxml/tree.h include/libxml/xmlIO.h:
  adding immutable buffers, and parser input based on those,
  but this should not be used (yet) for general parsing
* parser.c: added a comment about using immutable buffers for
  general parsing.
* result/bigname.xml.rdr result/bigname2.xml.rdr: fixing the
  output of the regression tests
* xmllint.c: using the immutable buffers when streaming on
  mmaped file (--stream --memory)
Daniel
diff --git a/Makefile.am b/Makefile.am
index 4f3f04b..9951dbb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -588,6 +588,23 @@
 	      diff $(srcdir)/result/$$name.rdr result.$$name ; \
 	      rm result.$$name ; \
 	  fi ; fi ; done)
+	@echo "##"
+	@echo "## Reader on memory regression tests"
+	@echo "##"
+	-@(for i in $(srcdir)/test/* ; do \
+	  name=`basename $$i`; \
+	  if [ ! -d $$i ] ; then \
+	  if [ ! -f $(srcdir)/result/$$name.rdr ] ; then \
+	      echo New test file $$name ; \
+	      $(CHECKER) $(top_builddir)/xmllint --memory --nonet --debug --stream $$i > $(srcdir)/result/$$name.rdr 2>/dev/null ; \
+	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
+	  else \
+	      echo Testing $$name ; \
+	      $(CHECKER) $(top_builddir)/xmllint --memory --nonet --debug --stream $$i > result.$$name 2>/dev/null ; \
+	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
+	      diff $(srcdir)/result/$$name.rdr result.$$name ; \
+	      rm result.$$name ; \
+	  fi ; fi ; done)
 
 
 SAXtests : testSAX$(EXEEXT)