dict: Make init/cleanup functions private
diff --git a/dict.c b/dict.c
index 0537802..8901ec2 100644
--- a/dict.c
+++ b/dict.c
@@ -148,15 +148,10 @@
/**
* xmlInitializeDict:
*
- * DEPRECATED: This function will be made private. Call xmlInitParser to
- * initialize the library.
- *
- * Do the dictionary mutex initialization.
- *
- * Returns 0 if initialization was already done, and 1 if that
- * call led to the initialization
+ * DEPRECATED: Alias for xmlInitParser.
*/
int xmlInitializeDict(void) {
+ xmlInitParser();
return(0);
}
@@ -165,9 +160,6 @@
*
* This function is not public
* Do the dictionary mutex initialization.
- * this function is not thread safe, initialization should
- * normally be done once at setup when called from xmlOnceInit()
- * we may also land in this code if thread support is not compiled in
*
* Returns 0 if initialization was already done, and 1 if that
* call led to the initialization
@@ -214,16 +206,22 @@
/**
* xmlDictCleanup:
*
- * DEPRECATED: This function will be made private. Call xmlCleanupParser
+ * DEPRECATED: This function is a no-op. Call xmlCleanupParser
* to free global state but see the warnings there. xmlCleanupParser
* should be only called once at program exit. In most cases, you don't
* have call cleanup functions at all.
- *
- * Free the dictionary mutex. Do not call unless sure the library
- * is not in use anymore !
*/
void
xmlDictCleanup(void) {
+}
+
+/**
+ * xmlCleanupDictInternal:
+ *
+ * Free the dictionary mutex.
+ */
+void
+xmlCleanupDictInternal(void) {
if (!xmlDictInitialized)
return;
diff --git a/include/private/dict.h b/include/private/dict.h
index 02b18f9..42bebff 100644
--- a/include/private/dict.h
+++ b/include/private/dict.h
@@ -2,6 +2,7 @@
#define XML_DICT_H_PRIVATE__
int __xmlInitializeDict(void);
+void xmlCleanupDictInternal(void);
int __xmlRandom(void);
#endif /* XML_DICT_H_PRIVATE__ */
diff --git a/parser.c b/parser.c
index 78fb642..02bc97e 100644
--- a/parser.c
+++ b/parser.c
@@ -76,6 +76,7 @@
#endif
#include "private/buf.h"
+#include "private/dict.h"
#include "private/enc.h"
#include "private/error.h"
#include "private/globals.h"
@@ -14498,7 +14499,7 @@
xmlInitThreadsInternal();
xmlInitGlobalsInternal();
xmlInitMemoryInternal();
- xmlInitializeDict();
+ __xmlInitializeDict();
xmlInitCharEncodingHandlers();
xmlRegisterDefaultInputCallbacks();
#ifdef LIBXML_OUTPUT_ENABLED
@@ -14545,7 +14546,7 @@
#ifdef LIBXML_CATALOG_ENABLED
xmlCatalogCleanup();
#endif
- xmlDictCleanup();
+ xmlCleanupDictInternal();
xmlCleanupInputCallbacks();
#ifdef LIBXML_OUTPUT_ENABLED
xmlCleanupOutputCallbacks();