mirror of
https://gitlab.gnome.org/GNOME/libxml2
synced 2025-03-28 21:33:13 +00:00
Deprecate module init and cleanup functions
These functions shouldn't be part of the public API. Most init functions are only thread-safe when called from xmlInitParser. Global variables should only be cleaned up by calling xmlCleanupParser.
This commit is contained in:
parent
7d02c7291f
commit
40483d0ce2
@ -1394,6 +1394,9 @@ static const elementPriority htmlEndPriority[] = {
|
||||
/**
|
||||
* htmlInitAutoClose:
|
||||
*
|
||||
* DEPRECATED: This function will be made private. Call xmlInitParser to
|
||||
* initialize the library.
|
||||
*
|
||||
* This is a no-op now.
|
||||
*/
|
||||
void
|
||||
|
6
SAX2.c
6
SAX2.c
@ -2928,6 +2928,9 @@ xmlSAX2InitDefaultSAXHandler(xmlSAXHandler *hdlr, int warning)
|
||||
/**
|
||||
* xmlDefaultSAXHandlerInit:
|
||||
*
|
||||
* DEPRECATED: This function will be made private. Call xmlInitParser to
|
||||
* initialize the library.
|
||||
*
|
||||
* Initialize the default SAX2 handler
|
||||
*/
|
||||
void
|
||||
@ -2986,6 +2989,9 @@ xmlSAX2InitHtmlDefaultSAXHandler(xmlSAXHandler *hdlr)
|
||||
/**
|
||||
* htmlDefaultSAXHandlerInit:
|
||||
*
|
||||
* DEPRECATED: This function will be made private. Call xmlInitParser to
|
||||
* initialize the library.
|
||||
*
|
||||
* Initialize the default SAX handler
|
||||
*/
|
||||
void
|
||||
|
9
dict.c
9
dict.c
@ -146,8 +146,10 @@ static unsigned int rand_seed = 0;
|
||||
/**
|
||||
* xmlInitializeDict:
|
||||
*
|
||||
* DEPRECATED: This function will be made private. Call xmlInitParser to
|
||||
* initialize the library.
|
||||
*
|
||||
* Do the dictionary mutex initialization.
|
||||
* this function is deprecated
|
||||
*
|
||||
* Returns 0 if initialization was already done, and 1 if that
|
||||
* call led to the initialization
|
||||
@ -210,6 +212,11 @@ int __xmlRandom(void) {
|
||||
/**
|
||||
* xmlDictCleanup:
|
||||
*
|
||||
* DEPRECATED: This function will be made private. 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 !
|
||||
*/
|
||||
|
@ -1408,6 +1408,9 @@ xmlNewCharEncodingHandler(const char *name,
|
||||
/**
|
||||
* xmlInitCharEncodingHandlers:
|
||||
*
|
||||
* DEPRECATED: This function will be made private. Call xmlInitParser to
|
||||
* initialize the library.
|
||||
*
|
||||
* Initialize the char encoding support, it registers the default
|
||||
* encoding supported.
|
||||
* NOTE: while public, this function usually doesn't need to be called
|
||||
@ -1468,6 +1471,11 @@ xmlInitCharEncodingHandlers(void) {
|
||||
/**
|
||||
* xmlCleanupCharEncodingHandlers:
|
||||
*
|
||||
* DEPRECATED: This function will be made private. 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.
|
||||
*
|
||||
* Cleanup the memory allocated for the char encoding support, it
|
||||
* unregisters all the encoding handlers and the aliases.
|
||||
*/
|
||||
|
@ -40,6 +40,9 @@ static xmlMutexPtr xmlThrDefMutex = NULL;
|
||||
/**
|
||||
* xmlInitGlobals:
|
||||
*
|
||||
* DEPRECATED: This function will be made private. Call xmlInitParser to
|
||||
* initialize the library.
|
||||
*
|
||||
* Additional initialisation for multi-threading
|
||||
*/
|
||||
void xmlInitGlobals(void)
|
||||
@ -522,6 +525,11 @@ xmlInitializeGlobalState(xmlGlobalStatePtr gs)
|
||||
/**
|
||||
* xmlCleanupGlobals:
|
||||
*
|
||||
* DEPRECATED: This function will be made private. 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.
|
||||
*
|
||||
* Additional cleanup for multi-threading
|
||||
*/
|
||||
void xmlCleanupGlobals(void)
|
||||
|
@ -159,9 +159,11 @@ XMLPUBFUN void XMLCALL
|
||||
#ifdef LIBXML_HTML_ENABLED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSAX2InitHtmlDefaultSAXHandler(xmlSAXHandler *hdlr);
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN void XMLCALL
|
||||
htmlDefaultSAXHandlerInit (void);
|
||||
#endif
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlDefaultSAXHandlerInit (void);
|
||||
#ifdef __cplusplus
|
||||
|
@ -27,6 +27,7 @@ typedef xmlDict *xmlDictPtr;
|
||||
/*
|
||||
* Initializer
|
||||
*/
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN int XMLCALL xmlInitializeDict(void);
|
||||
|
||||
/*
|
||||
@ -70,6 +71,7 @@ XMLPUBFUN int XMLCALL
|
||||
/*
|
||||
* Cleanup function
|
||||
*/
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlDictCleanup (void);
|
||||
|
||||
|
@ -153,8 +153,10 @@ extern "C" {
|
||||
/*
|
||||
* Interfaces for encoding handlers.
|
||||
*/
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlInitCharEncodingHandlers (void);
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlCleanupCharEncodingHandlers (void);
|
||||
XMLPUBFUN void XMLCALL
|
||||
|
@ -24,7 +24,9 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN void XMLCALL xmlInitGlobals(void);
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN void XMLCALL xmlCleanupGlobals(void);
|
||||
|
||||
/**
|
||||
|
@ -574,6 +574,7 @@ XMLPUBFUN void XMLCALL xmlParserInputShrink (xmlParserInputPtr in);
|
||||
/*
|
||||
* Actually comes from the HTML parser but launched from the init stuff.
|
||||
*/
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN void XMLCALL htmlInitAutoClose (void);
|
||||
XMLPUBFUN htmlParserCtxtPtr XMLCALL htmlCreateFileParserCtxt(const char *filename,
|
||||
const char *encoding);
|
||||
|
@ -116,8 +116,10 @@ typedef enum {
|
||||
XML_RELAXNGP_CRNG = 2
|
||||
} xmlRelaxNGParserFlag;
|
||||
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlRelaxNGInitTypes (void);
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlRelaxNGCleanupTypes (void);
|
||||
|
||||
|
@ -57,6 +57,7 @@ XMLPUBFUN void XMLCALL
|
||||
/*
|
||||
* Library wide APIs.
|
||||
*/
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlInitThreads (void);
|
||||
XMLPUBFUN void XMLCALL
|
||||
@ -67,6 +68,7 @@ XMLPUBFUN int XMLCALL
|
||||
xmlGetThreadId (void);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlIsMainThread (void);
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlCleanupThreads(void);
|
||||
XMLPUBFUN xmlGlobalStatePtr XMLCALL
|
||||
|
@ -126,12 +126,14 @@ XMLPUBFUN int XMLCALL
|
||||
/*
|
||||
* Initialization of the memory layer.
|
||||
*/
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlInitMemory (void);
|
||||
|
||||
/*
|
||||
* Cleanup of the memory layer.
|
||||
*/
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlCleanupMemory (void);
|
||||
/*
|
||||
|
@ -30,8 +30,10 @@ typedef enum {
|
||||
XML_SCHEMA_WHITESPACE_COLLAPSE = 3
|
||||
} xmlSchemaWhitespaceValueType;
|
||||
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSchemaInitTypes (void);
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSchemaCleanupTypes (void);
|
||||
XMLPUBFUN xmlSchemaTypePtr XMLCALL
|
||||
|
@ -549,6 +549,7 @@ XMLPUBFUN void XMLCALL
|
||||
xmlXPathFreeCompExpr (xmlXPathCompExprPtr comp);
|
||||
#endif /* LIBXML_XPATH_ENABLED */
|
||||
#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPathInit (void);
|
||||
XMLPUBFUN int XMLCALL
|
||||
|
@ -289,8 +289,22 @@ skip_impl = (
|
||||
)
|
||||
|
||||
deprecated_funcs = {
|
||||
'htmlDefaultSAXHandlerInit': True,
|
||||
'htmlInitAutoClose': True,
|
||||
'xmlCleanupCharEncodingHandlers': True,
|
||||
'xmlCleanupGlobals': True,
|
||||
'xmlDefaultSAXHandlerInit': True,
|
||||
'xmlDictCleanup': True,
|
||||
'xmlInitCharEncodingHandlers': True,
|
||||
'xmlInitGlobals': True,
|
||||
'xmlInitializeDict': True,
|
||||
'xmlIsRef': True,
|
||||
'xmlRelaxNGCleanupTypes': True,
|
||||
'xmlRelaxNGInitTypes': True,
|
||||
'xmlRemoveRef': True,
|
||||
'xmlSchemaCleanupTypes': True,
|
||||
'xmlSchemaInitTypes': True,
|
||||
'xmlXPathInit': True,
|
||||
}
|
||||
|
||||
def skip_function(name):
|
||||
|
@ -2815,6 +2815,9 @@ xmlRelaxNGRegisterTypeLibrary(const xmlChar * namespace, void *data,
|
||||
/**
|
||||
* xmlRelaxNGInitTypes:
|
||||
*
|
||||
* DEPRECATED: This function will be made private. Call xmlInitParser to
|
||||
* initialize the library.
|
||||
*
|
||||
* Initialize the default type libraries.
|
||||
*
|
||||
* Returns 0 in case of success and -1 in case of error.
|
||||
@ -2849,6 +2852,11 @@ xmlRelaxNGInitTypes(void)
|
||||
/**
|
||||
* xmlRelaxNGCleanupTypes:
|
||||
*
|
||||
* DEPRECATED: This function will be made private. 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.
|
||||
*
|
||||
* Cleanup the default Schemas type library associated to RelaxNG
|
||||
*/
|
||||
void
|
||||
|
@ -843,6 +843,9 @@ xmlUnlockLibrary(void)
|
||||
/**
|
||||
* xmlInitThreads:
|
||||
*
|
||||
* DEPRECATED: This function will be made private. Call xmlInitParser to
|
||||
* initialize the library.
|
||||
*
|
||||
* xmlInitThreads() is used to to initialize all the thread related
|
||||
* data of the libxml2 library.
|
||||
*/
|
||||
@ -883,6 +886,11 @@ xmlInitThreads(void)
|
||||
/**
|
||||
* xmlCleanupThreads:
|
||||
*
|
||||
* DEPRECATED: This function will be made private. 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.
|
||||
*
|
||||
* xmlCleanupThreads() is used to to cleanup all the thread related
|
||||
* data of the libxml2 library once processing has ended.
|
||||
*
|
||||
|
@ -935,6 +935,9 @@ xmlMemoryDump(void)
|
||||
/**
|
||||
* xmlInitMemory:
|
||||
*
|
||||
* DEPRECATED: This function will be made private. Call xmlInitParser to
|
||||
* initialize the library.
|
||||
*
|
||||
* Initialize the memory layer.
|
||||
*
|
||||
* Returns 0 on success
|
||||
@ -974,6 +977,11 @@ xmlInitMemory(void)
|
||||
/**
|
||||
* xmlCleanupMemory:
|
||||
*
|
||||
* DEPRECATED: This function will be made private. 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 up all the memory allocated by the library for its own
|
||||
* use. This should not be called by user level code.
|
||||
*/
|
||||
|
@ -386,6 +386,9 @@ xmlSchemaAddParticle(void)
|
||||
/*
|
||||
* xmlSchemaInitTypes:
|
||||
*
|
||||
* DEPRECATED: This function will be made private. Call xmlInitParser to
|
||||
* initialize the library.
|
||||
*
|
||||
* Initialize the default XML Schemas type library
|
||||
*/
|
||||
void
|
||||
@ -623,6 +626,11 @@ xmlSchemaFreeTypeEntry(void *type, const xmlChar *name ATTRIBUTE_UNUSED) {
|
||||
/**
|
||||
* xmlSchemaCleanupTypes:
|
||||
*
|
||||
* DEPRECATED: This function will be made private. 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.
|
||||
*
|
||||
* Cleanup the default XML Schemas type library
|
||||
*/
|
||||
void
|
||||
|
Loading…
x
Reference in New Issue
Block a user