mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
Generate deprecation warnings for old SAX API
This commit is contained in:
@ -146,6 +146,7 @@ XMLPUBFUN void XMLCALL
|
||||
int len);
|
||||
|
||||
#ifdef LIBXML_SAX1_ENABLED
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSAXDefaultVersion (int version);
|
||||
#endif /* LIBXML_SAX1_ENABLED */
|
||||
|
@ -861,11 +861,14 @@ XMLPUBFUN int XMLCALL
|
||||
/*
|
||||
* Recovery mode
|
||||
*/
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN xmlDocPtr XMLCALL
|
||||
xmlRecoverDoc (const xmlChar *cur);
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN xmlDocPtr XMLCALL
|
||||
xmlRecoverMemory (const char *buffer,
|
||||
int size);
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN xmlDocPtr XMLCALL
|
||||
xmlRecoverFile (const char *filename);
|
||||
#endif /* LIBXML_SAX1_ENABLED */
|
||||
@ -878,47 +881,57 @@ XMLPUBFUN int XMLCALL
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlParseExtParsedEnt (xmlParserCtxtPtr ctxt);
|
||||
#ifdef LIBXML_SAX1_ENABLED
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSAXUserParseFile (xmlSAXHandlerPtr sax,
|
||||
void *user_data,
|
||||
const char *filename);
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSAXUserParseMemory (xmlSAXHandlerPtr sax,
|
||||
void *user_data,
|
||||
const char *buffer,
|
||||
int size);
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN xmlDocPtr XMLCALL
|
||||
xmlSAXParseDoc (xmlSAXHandlerPtr sax,
|
||||
const xmlChar *cur,
|
||||
int recovery);
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN xmlDocPtr XMLCALL
|
||||
xmlSAXParseMemory (xmlSAXHandlerPtr sax,
|
||||
const char *buffer,
|
||||
int size,
|
||||
int recovery);
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN xmlDocPtr XMLCALL
|
||||
xmlSAXParseMemoryWithData (xmlSAXHandlerPtr sax,
|
||||
const char *buffer,
|
||||
int size,
|
||||
int recovery,
|
||||
void *data);
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN xmlDocPtr XMLCALL
|
||||
xmlSAXParseFile (xmlSAXHandlerPtr sax,
|
||||
const char *filename,
|
||||
int recovery);
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN xmlDocPtr XMLCALL
|
||||
xmlSAXParseFileWithData (xmlSAXHandlerPtr sax,
|
||||
const char *filename,
|
||||
int recovery,
|
||||
void *data);
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN xmlDocPtr XMLCALL
|
||||
xmlSAXParseEntity (xmlSAXHandlerPtr sax,
|
||||
const char *filename);
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN xmlDocPtr XMLCALL
|
||||
xmlParseEntity (const char *filename);
|
||||
#endif /* LIBXML_SAX1_ENABLED */
|
||||
|
||||
#ifdef LIBXML_VALID_ENABLED
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN xmlDtdPtr XMLCALL
|
||||
xmlSAXParseDTD (xmlSAXHandlerPtr sax,
|
||||
const xmlChar *ExternalID,
|
||||
@ -955,6 +968,7 @@ XMLPUBFUN int XMLCALL
|
||||
const xmlChar *string,
|
||||
xmlNodePtr *lst,
|
||||
int recover);
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlParseExternalEntity (xmlDocPtr doc,
|
||||
xmlSAXHandlerPtr sax,
|
||||
@ -984,6 +998,7 @@ XMLPUBFUN void XMLCALL
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlFreeParserCtxt (xmlParserCtxtPtr ctxt);
|
||||
#ifdef LIBXML_SAX1_ENABLED
|
||||
XML_DEPRECATED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSetupParserForBuffer (xmlParserCtxtPtr ctxt,
|
||||
const xmlChar* buffer,
|
||||
|
@ -310,15 +310,21 @@ deprecated_funcs = {
|
||||
'xmlNanoFTPProxy': True,
|
||||
'xmlNanoFTPScanProxy': True,
|
||||
'xmlNewGlobalNs': True,
|
||||
'xmlParseEntity': True,
|
||||
'xmlParseNamespace': True,
|
||||
'xmlParseQuotedString': True,
|
||||
'xmlParserHandleReference': True,
|
||||
'xmlRecoverDoc': True,
|
||||
'xmlRecoverFile': True,
|
||||
'xmlRecoverMemory': True,
|
||||
'xmlRelaxNGCleanupTypes': True,
|
||||
'xmlRelaxNGInitTypes': True,
|
||||
'xmlRemoveRef': True,
|
||||
'xmlSAXDefaultVersion': True,
|
||||
'xmlScanName': True,
|
||||
'xmlSchemaCleanupTypes': True,
|
||||
'xmlSchemaInitTypes': True,
|
||||
'xmlSetupParserForBuffer': True,
|
||||
'xmlThrDefDefaultBufferSize': True,
|
||||
'xmlThrDefLineNumbersDefaultValue': True,
|
||||
'xmlThrDefPedanticParserDefaultValue': True,
|
||||
|
@ -1524,6 +1524,7 @@ libxml_xmlSAXParseFile(ATTRIBUTE_UNUSED PyObject * self, PyObject * args)
|
||||
const char *URI;
|
||||
PyObject *pyobj_SAX = NULL;
|
||||
xmlSAXHandlerPtr SAX = NULL;
|
||||
xmlParserCtxtPtr ctxt;
|
||||
|
||||
if (!PyArg_ParseTuple(args, (char *) "Osi:xmlSAXParseFile", &pyobj_SAX,
|
||||
&URI, &recover))
|
||||
@ -1540,7 +1541,9 @@ libxml_xmlSAXParseFile(ATTRIBUTE_UNUSED PyObject * self, PyObject * args)
|
||||
SAX = &pythonSaxHandler;
|
||||
Py_INCREF(pyobj_SAX);
|
||||
/* The reference is released in pythonEndDocument() */
|
||||
xmlSAXUserParseFile(SAX, pyobj_SAX, URI);
|
||||
ctxt = xmlNewSAXParserCtxt(SAX, pyobj_SAX);
|
||||
xmlCtxtReadFile(ctxt, URI, NULL, 0);
|
||||
xmlFreeParserCtxt(ctxt);
|
||||
#endif /* LIBXML_SAX1_ENABLED */
|
||||
Py_INCREF(Py_None);
|
||||
return (Py_None);
|
||||
|
Reference in New Issue
Block a user