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/catalog.c b/catalog.c
index 401e95c..1fac025 100644
--- a/catalog.c
+++ b/catalog.c
@@ -914,9 +914,7 @@
 
     inputStream->filename = (char *) xmlCanonicPath((const xmlChar *)filename);
     inputStream->buf = buf;
-    inputStream->cur =
-    inputStream->base = xmlBufContent(buf->buffer);
-    inputStream->end = xmlBufEnd(buf->buffer);
+    xmlBufResetInput(buf->buffer, inputStream);
 
     inputPush(ctxt, inputStream);
     if ((ctxt->directory == NULL) && (directory == NULL))