[libxml2] Deprecate some global variables
- From: Nick Wellnhofer <nwellnhof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxml2] Deprecate some global variables
- Date: Tue, 23 Aug 2022 23:06:59 +0000 (UTC)
commit 75b5bc2b0a6219ee03069611793dccb2d47102c0
Author: Nick Wellnhofer <wellnhofer aevum de>
Date: Tue Aug 23 20:57:49 2022 +0200
Deprecate some global variables
Most of these should be completely unused.
globals.c | 16 ++++++++++++++++
include/libxml/globals.h | 28 ++++++++++++++++++++++++++++
python/generator.py | 3 +++
3 files changed, 47 insertions(+)
---
diff --git a/globals.c b/globals.c
index 5e42f193..5a725a7e 100644
--- a/globals.c
+++ b/globals.c
@@ -175,6 +175,8 @@ const char *xmlParserVersion = LIBXML_VERSION_STRING LIBXML_VERSION_EXTRA;
/**
* xmlBufferAllocScheme:
*
+ * DEPRECATED: Don't use.
+ *
* Global setting, default allocation policy for buffers, default is
* XML_BUFFER_ALLOC_EXACT
*/
@@ -183,6 +185,8 @@ static xmlBufferAllocationScheme xmlBufferAllocSchemeThrDef = XML_BUFFER_ALLOC_E
/**
* xmlDefaultBufferSize:
*
+ * DEPRECATED: Don't use.
+ *
* Global setting, default buffer size. Default value is BASE_BUFFER_SIZE
*/
int xmlDefaultBufferSize = BASE_BUFFER_SIZE;
@@ -235,6 +239,8 @@ static int xmlLoadExtDtdDefaultValueThrDef = 0;
/**
* xmlPedanticParserDefaultValue:
*
+ * DEPRECATED: Use the modern options API with XML_PARSE_PEDANTIC.
+ *
* Global setting, indicate that the parser be pedantic
* Disabled by default.
*/
@@ -243,6 +249,8 @@ static int xmlPedanticParserDefaultValueThrDef = 0;
/**
* xmlLineNumbersDefaultValue:
*
+ * DEPRECATED: The modern options API always enables line numbers.
+ *
* Global setting, indicate that the parser should store the line number
* in the content field of elements in the DOM tree.
* Disabled by default since this may not be safe for old classes of
@@ -358,6 +366,9 @@ static int xmlSaveNoEmptyTagsThrDef = 0;
/**
* xmlDefaultSAXHandler:
*
+ * DEPRECATED: This handler is unused and will be removed from future
+ * versions.
+ *
* Default SAX version1 handler for XML, builds the DOM tree
*/
xmlSAXHandlerV1 xmlDefaultSAXHandler = {
@@ -395,6 +406,8 @@ xmlSAXHandlerV1 xmlDefaultSAXHandler = {
/**
* xmlDefaultSAXLocator:
*
+ * DEPRECATED: Don't use
+ *
* The default SAX Locator
* { getPublicId, getSystemId, getLineNumber, getColumnNumber}
*/
@@ -409,6 +422,9 @@ xmlSAXLocator xmlDefaultSAXLocator = {
/**
* htmlDefaultSAXHandler:
*
+ * DEPRECATED: This handler is unused and will be removed from future
+ * versions.
+ *
* Default old SAX v1 handler for HTML, builds the DOM tree
*/
xmlSAXHandlerV1 htmlDefaultSAXHandler = {
diff --git a/include/libxml/globals.h b/include/libxml/globals.h
index d57ccb05..f60b398c 100644
--- a/include/libxml/globals.h
+++ b/include/libxml/globals.h
@@ -253,11 +253,13 @@ XMLPUBVAR xmlStrdupFunc xmlMemStrdup;
#endif /* LIBXML_THREAD_ALLOC_ENABLED */
#ifdef LIBXML_HTML_ENABLED
+XML_DEPRECATED
XMLPUBFUN xmlSAXHandlerV1 * XMLCALL __htmlDefaultSAXHandler(void);
#ifdef LIBXML_THREAD_ENABLED
#define htmlDefaultSAXHandler \
(*(__htmlDefaultSAXHandler()))
#else
+XML_DEPRECATED
XMLPUBVAR xmlSAXHandlerV1 htmlDefaultSAXHandler;
#endif
#endif
@@ -277,46 +279,58 @@ XMLPUBVAR xmlError xmlLastError;
*/
+XML_DEPRECATED
XMLPUBFUN int * XMLCALL __oldXMLWDcompatibility(void);
#ifdef LIBXML_THREAD_ENABLED
#define oldXMLWDcompatibility \
(*(__oldXMLWDcompatibility()))
#else
+XML_DEPRECATED
XMLPUBVAR int oldXMLWDcompatibility;
#endif
+XML_DEPRECATED
XMLPUBFUN xmlBufferAllocationScheme * XMLCALL __xmlBufferAllocScheme(void);
#ifdef LIBXML_THREAD_ENABLED
#define xmlBufferAllocScheme \
(*(__xmlBufferAllocScheme()))
#else
+XML_DEPRECATED
XMLPUBVAR xmlBufferAllocationScheme xmlBufferAllocScheme;
#endif
+XML_DEPRECATED
XMLPUBFUN xmlBufferAllocationScheme XMLCALL
xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v);
+XML_DEPRECATED
XMLPUBFUN int * XMLCALL __xmlDefaultBufferSize(void);
#ifdef LIBXML_THREAD_ENABLED
#define xmlDefaultBufferSize \
(*(__xmlDefaultBufferSize()))
#else
+XML_DEPRECATED
XMLPUBVAR int xmlDefaultBufferSize;
#endif
+XML_DEPRECATED
XMLPUBFUN int XMLCALL xmlThrDefDefaultBufferSize(int v);
+XML_DEPRECATED
XMLPUBFUN xmlSAXHandlerV1 * XMLCALL __xmlDefaultSAXHandler(void);
#ifdef LIBXML_THREAD_ENABLED
#define xmlDefaultSAXHandler \
(*(__xmlDefaultSAXHandler()))
#else
+XML_DEPRECATED
XMLPUBVAR xmlSAXHandlerV1 xmlDefaultSAXHandler;
#endif
+XML_DEPRECATED
XMLPUBFUN xmlSAXLocator * XMLCALL __xmlDefaultSAXLocator(void);
#ifdef LIBXML_THREAD_ENABLED
#define xmlDefaultSAXLocator \
(*(__xmlDefaultSAXLocator()))
#else
+XML_DEPRECATED
XMLPUBVAR xmlSAXLocator xmlDefaultSAXLocator;
#endif
@@ -397,13 +411,16 @@ XMLPUBVAR int xmlKeepBlanksDefaultValue;
#endif
XMLPUBFUN int XMLCALL xmlThrDefKeepBlanksDefaultValue(int v);
+XML_DEPRECATED
XMLPUBFUN int * XMLCALL __xmlLineNumbersDefaultValue(void);
#ifdef LIBXML_THREAD_ENABLED
#define xmlLineNumbersDefaultValue \
(*(__xmlLineNumbersDefaultValue()))
#else
+XML_DEPRECATED
XMLPUBVAR int xmlLineNumbersDefaultValue;
#endif
+XML_DEPRECATED
XMLPUBFUN int XMLCALL xmlThrDefLineNumbersDefaultValue(int v);
XMLPUBFUN int * XMLCALL __xmlLoadExtDtdDefaultValue(void);
@@ -432,13 +449,16 @@ XMLPUBFUN const char * * XMLCALL __xmlParserVersion(void);
XMLPUBVAR const char * xmlParserVersion;
#endif
+XML_DEPRECATED
XMLPUBFUN int * XMLCALL __xmlPedanticParserDefaultValue(void);
#ifdef LIBXML_THREAD_ENABLED
#define xmlPedanticParserDefaultValue \
(*(__xmlPedanticParserDefaultValue()))
#else
+XML_DEPRECATED
XMLPUBVAR int xmlPedanticParserDefaultValue;
#endif
+XML_DEPRECATED
XMLPUBFUN int XMLCALL xmlThrDefPedanticParserDefaultValue(int v);
XMLPUBFUN int * XMLCALL __xmlSaveNoEmptyTags(void);
@@ -459,36 +479,44 @@ XMLPUBVAR int xmlSubstituteEntitiesDefaultValue;
#endif
XMLPUBFUN int XMLCALL xmlThrDefSubstituteEntitiesDefaultValue(int v);
+XML_DEPRECATED
XMLPUBFUN xmlRegisterNodeFunc * XMLCALL __xmlRegisterNodeDefaultValue(void);
#ifdef LIBXML_THREAD_ENABLED
#define xmlRegisterNodeDefaultValue \
(*(__xmlRegisterNodeDefaultValue()))
#else
+XML_DEPRECATED
XMLPUBVAR xmlRegisterNodeFunc xmlRegisterNodeDefaultValue;
#endif
+XML_DEPRECATED
XMLPUBFUN xmlDeregisterNodeFunc * XMLCALL __xmlDeregisterNodeDefaultValue(void);
#ifdef LIBXML_THREAD_ENABLED
#define xmlDeregisterNodeDefaultValue \
(*(__xmlDeregisterNodeDefaultValue()))
#else
+XML_DEPRECATED
XMLPUBVAR xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue;
#endif
+XML_DEPRECATED
XMLPUBFUN xmlParserInputBufferCreateFilenameFunc * XMLCALL \
__xmlParserInputBufferCreateFilenameValue(void);
#ifdef LIBXML_THREAD_ENABLED
#define xmlParserInputBufferCreateFilenameValue \
(*(__xmlParserInputBufferCreateFilenameValue()))
#else
+XML_DEPRECATED
XMLPUBVAR xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue;
#endif
+XML_DEPRECATED
XMLPUBFUN xmlOutputBufferCreateFilenameFunc * XMLCALL __xmlOutputBufferCreateFilenameValue(void);
#ifdef LIBXML_THREAD_ENABLED
#define xmlOutputBufferCreateFilenameValue \
(*(__xmlOutputBufferCreateFilenameValue()))
#else
+XML_DEPRECATED
XMLPUBVAR xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue;
#endif
diff --git a/python/generator.py b/python/generator.py
index 09474fca..8a1a49c7 100755
--- a/python/generator.py
+++ b/python/generator.py
@@ -319,6 +319,9 @@ deprecated_funcs = {
'xmlScanName': True,
'xmlSchemaCleanupTypes': True,
'xmlSchemaInitTypes': True,
+ 'xmlThrDefDefaultBufferSize': True,
+ 'xmlThrDefLineNumbersDefaultValue': True,
+ 'xmlThrDefPedanticParserDefaultValue': True,
'xmlXPathInit': True,
'xmlXPtrEvalRangePredicate': True,
'xmlXPtrNewCollapsedRange': True,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]