From e2ad249c230d7f9d6a2bc30fe2e74c89ba01857e Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Sun, 17 Nov 2024 19:48:44 +0100 Subject: [PATCH] parser: Deprecate more internal symbols - xmlParseExternalSubset - xmlPushInput - xmlPopInput - xmlCopyCharMultiByte - xmlCreateEntityParserCtxt - xmlStringComment --- include/libxml/parserInternals.h | 6 ++++++ parser.c | 6 ++++++ parserInternals.c | 2 ++ python/generator.py | 4 ++++ 4 files changed, 18 insertions(+) diff --git a/include/libxml/parserInternals.h b/include/libxml/parserInternals.h index 71fe3450..a16a5aae 100644 --- a/include/libxml/parserInternals.h +++ b/include/libxml/parserInternals.h @@ -294,6 +294,7 @@ XMLPUBVAR const unsigned int xmlParserMaxDepth; */ XMLPUBVAR const xmlChar xmlStringText[]; XMLPUBVAR const xmlChar xmlStringTextNoenc[]; +XML_DEPRECATED XMLPUBVAR const xmlChar xmlStringComment[]; XML_DEPRECATED @@ -310,6 +311,7 @@ XMLPUBFUN xmlParserCtxtPtr XMLPUBFUN xmlParserCtxtPtr xmlCreateMemoryParserCtxt(const char *buffer, int size); +XML_DEPRECATED XMLPUBFUN xmlParserCtxtPtr xmlCreateEntityParserCtxt(const xmlChar *URL, const xmlChar *ID, @@ -341,9 +343,11 @@ XML_DEPRECATED XMLPUBFUN xmlParserInputPtr xmlNewEntityInputStream (xmlParserCtxtPtr ctxt, xmlEntityPtr entity); +XML_DEPRECATED XMLPUBFUN int xmlPushInput (xmlParserCtxtPtr ctxt, xmlParserInputPtr input); +XML_DEPRECATED XMLPUBFUN xmlChar xmlPopInput (xmlParserCtxtPtr ctxt); XMLPUBFUN void @@ -509,6 +513,7 @@ XMLPUBFUN void XML_DEPRECATED XMLPUBFUN void xmlParseMisc (xmlParserCtxtPtr ctxt); +XML_DEPRECATED XMLPUBFUN void xmlParseExternalSubset (xmlParserCtxtPtr ctxt, const xmlChar *ExternalID, @@ -593,6 +598,7 @@ XMLPUBFUN int xmlCheckLanguageID (const xmlChar *lang); XML_DEPRECATED XMLPUBFUN int xmlCurrentChar (xmlParserCtxtPtr ctxt, int *len); +XML_DEPRECATED XMLPUBFUN int xmlCopyCharMultiByte (xmlChar *out, int val); XML_DEPRECATED diff --git a/parser.c b/parser.c index 73f0646b..8b24ae29 100644 --- a/parser.c +++ b/parser.c @@ -2549,6 +2549,8 @@ xmlSkipBlankCharsPE(xmlParserCtxtPtr ctxt) { * xmlPopInput: * @ctxt: an XML parser context * + * DEPRECATED: Internal function, don't use. + * * xmlPopInput: the current input pointed by ctxt->input came to an end * pop it and return the next char. * @@ -2571,6 +2573,8 @@ xmlPopInput(xmlParserCtxtPtr ctxt) { * @ctxt: an XML parser context * @input: an XML parser input fragment (entity, XML fragment ...). * + * DEPRECATED: Internal function, don't use. + * * Push an input stream onto the stack. * * Returns -1 in case of error or the index in the input stack @@ -7260,6 +7264,8 @@ xmlParseTextDecl(xmlParserCtxtPtr ctxt) { * @ExternalID: the external identifier * @SystemID: the system identifier (or URL) * + * DEPRECATED: Internal function, don't use. + * * parse Markup declarations from an external subset * * [30] extSubset ::= textDecl? extSubsetDecl diff --git a/parserInternals.c b/parserInternals.c index a6ddf502..5f856403 100644 --- a/parserInternals.c +++ b/parserInternals.c @@ -990,6 +990,8 @@ xmlStringCurrentChar(xmlParserCtxtPtr ctxt ATTRIBUTE_UNUSED, * @out: pointer to an array of xmlChar * @val: the char value * + * DEPRECATED: Internal function, don't use. + * * append the char value in the array * * Returns the number of xmlChar written diff --git a/python/generator.py b/python/generator.py index 0d175d2d..9cad6178 100755 --- a/python/generator.py +++ b/python/generator.py @@ -308,6 +308,8 @@ deprecated_funcs = { 'xmlCleanupCharEncodingHandlers': True, 'xmlCleanupGlobals': True, 'xmlCopyChar': True, + 'xmlCopyCharMultiByte': True, + 'xmlCreateEntityParserCtxt': True, 'xmlDefaultSAXHandlerInit': True, 'xmlDictCleanup': True, 'xmlFileMatch': True, @@ -341,6 +343,7 @@ deprecated_funcs = { 'xmlParseEntity': True, 'xmlParseEntityDecl': True, 'xmlParseEntityRef': True, + 'xmlParseExternalSubset': True, 'xmlParseMarkupDecl': True, 'xmlParseMisc': True, 'xmlParseName': True, @@ -368,6 +371,7 @@ deprecated_funcs = { 'xmlParserSetReplaceEntities': True, 'xmlParserSetValidate': True, 'xmlPedanticParserDefault': True, + 'xmlPopInput': True, 'xmlRecoverDoc': True, 'xmlRecoverFile': True, 'xmlRecoverMemory': True,