code cleanup, especially the function comments. fixed a small bug when

* DOCBparser.c HTMLparser.c c14n.c debugXML.c encoding.c hash.c
  nanoftp.c nanohttp.c parser.c parserInternals.c testC14N.c
  testDocbook.c threads.c tree.c valid.c xmlIO.c xmllint.c xmlmemory.c
  xmlreader.c xmlregexp.c xmlschemas.c xmlschemastypes.c xpath.c:
  code cleanup, especially the function comments.
* tree.c: fixed a small bug when freeing nodes which are XInclude ones.
Daniel
diff --git a/threads.c b/threads.c
index bd99efd..6aa5ecc 100644
--- a/threads.c
+++ b/threads.c
@@ -102,7 +102,7 @@
 static void xmlOnceInit(void);
 
 /**
- * xmlMutexPtr:
+ * xmlNewMutex:
  *
  * xmlNewMutex() is used to allocate a libxml2 token struct for use in
  * synchronizing access to data.
@@ -176,7 +176,7 @@
 }
 
 /**
- * xmlRNewMutex:
+ * xmlNewRMutex:
  *
  * xmlRNewMutex() is used to allocate a reentrant mutex for use in
  * synchronizing access to data. token_r is a re-entrant lock and thus useful
@@ -204,7 +204,7 @@
 }
 
 /**
- * xmlRFreeMutex:
+ * xmlFreeRMutex:
  * @tok:  the reentrant mutex
  *
  * xmlRFreeMutex() is used to reclaim resources associated with a
@@ -322,14 +322,6 @@
 #endif /* LIBXML_THREAD_ENABLED */
 
 
-/**
- * xmlGetGlobalState:
- *
- * xmlGetGlobalState() is called to retrieve the global state for a thread.
- *
- * Returns the thread global state or NULL in case of error
- */
-
 #ifdef HAVE_WIN32_THREADS
 #if !defined(HAVE_COMPILER_TLS)
 typedef struct _xmlGlobalStateCleanupHelperParams
@@ -338,7 +330,7 @@
     void *memory;
 } xmlGlobalStateCleanupHelperParams;
 
-void xmlGlobalStateCleanupHelper (void *p)
+static void xmlGlobalStateCleanupHelper (void *p)
 {
     xmlGlobalStateCleanupHelperParams *params = (xmlGlobalStateCleanupHelperParams *) p;
     WaitForSingleObject(params->thread, INFINITE);
@@ -350,6 +342,13 @@
 #endif /* HAVE_COMPILER_TLS */
 #endif /* HAVE_WIN32_THREADS */
 
+/**
+ * xmlGetGlobalState:
+ *
+ * xmlGetGlobalState() is called to retrieve the global state for a thread.
+ *
+ * Returns the thread global state or NULL in case of error
+ */
 xmlGlobalStatePtr
 xmlGetGlobalState(void)
 {