Cleanup function xmlBufResetInput() to set input from Buffer

This was scattered in a number of modules, xmlParserInputPtr
have usually their base, cur and end pointer set from an
xmlBuf used as input.
* buf.c buf.h: add a new function implementing this setup
* parser.c HTMLparser.c catalog.c parserInternals.c xmlreader.c
  use the new function instead of digging into the buffer in
  all those modules
diff --git a/xmlreader.c b/xmlreader.c
index be4e44a..767bd05 100644
--- a/xmlreader.c
+++ b/xmlreader.c
@@ -5126,9 +5126,7 @@
 		inputStream->filename = (char *)
 		    xmlCanonicPath((const xmlChar *) URL);
 	    inputStream->buf = buf;
-	    inputStream->cur =
-	    inputStream->base = xmlBufContent(buf->buffer);
-	    inputStream->end = xmlBufEnd(buf->buffer);
+            xmlBufResetInput(buf->buffer, inputStream);
 
 	    inputPush(reader->ctxt, inputStream);
 	    reader->cur = 0;