diff --git a/media/doc/3rd Party Files.txt b/media/doc/3rd Party Files.txt index 6f56690318c..8b7b4e319ac 100644 --- a/media/doc/3rd Party Files.txt +++ b/media/doc/3rd Party Files.txt @@ -239,7 +239,7 @@ URL: https://github.com/win-iconv/win-iconv Title: LibXML Path: sdk/lib/3rdparty/libxml2 -Used Version: 2.9.14 +Used Version: 2.10.0 License: MIT (https://spdx.org/licenses/MIT.htmlf) URL: http://xmlsoft.org, ftp://xmlsoft.org/libxml2/ diff --git a/sdk/include/reactos/libs/libxml/SAX.h b/sdk/include/reactos/libs/libxml/SAX.h index 20093ceb685..fa50568f253 100644 --- a/sdk/include/reactos/libs/libxml/SAX.h +++ b/sdk/include/reactos/libs/libxml/SAX.h @@ -16,54 +16,67 @@ #include #include #include -#include #ifdef LIBXML_LEGACY_ENABLED #ifdef __cplusplus extern "C" { #endif +XML_DEPRECATED XMLPUBFUN const xmlChar * XMLCALL getPublicId (void *ctx); +XML_DEPRECATED XMLPUBFUN const xmlChar * XMLCALL getSystemId (void *ctx); +XML_DEPRECATED XMLPUBFUN void XMLCALL setDocumentLocator (void *ctx, xmlSAXLocatorPtr loc); +XML_DEPRECATED XMLPUBFUN int XMLCALL getLineNumber (void *ctx); +XML_DEPRECATED XMLPUBFUN int XMLCALL getColumnNumber (void *ctx); +XML_DEPRECATED XMLPUBFUN int XMLCALL isStandalone (void *ctx); +XML_DEPRECATED XMLPUBFUN int XMLCALL hasInternalSubset (void *ctx); +XML_DEPRECATED XMLPUBFUN int XMLCALL hasExternalSubset (void *ctx); +XML_DEPRECATED XMLPUBFUN void XMLCALL internalSubset (void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID); +XML_DEPRECATED XMLPUBFUN void XMLCALL externalSubset (void *ctx, const xmlChar *name, const xmlChar *ExternalID, const xmlChar *SystemID); +XML_DEPRECATED XMLPUBFUN xmlEntityPtr XMLCALL getEntity (void *ctx, const xmlChar *name); +XML_DEPRECATED XMLPUBFUN xmlEntityPtr XMLCALL getParameterEntity (void *ctx, const xmlChar *name); +XML_DEPRECATED XMLPUBFUN xmlParserInputPtr XMLCALL resolveEntity (void *ctx, const xmlChar *publicId, const xmlChar *systemId); +XML_DEPRECATED XMLPUBFUN void XMLCALL entityDecl (void *ctx, const xmlChar *name, @@ -71,6 +84,7 @@ XMLPUBFUN void XMLCALL const xmlChar *publicId, const xmlChar *systemId, xmlChar *content); +XML_DEPRECATED XMLPUBFUN void XMLCALL attributeDecl (void *ctx, const xmlChar *elem, @@ -79,16 +93,19 @@ XMLPUBFUN void XMLCALL int def, const xmlChar *defaultValue, xmlEnumerationPtr tree); +XML_DEPRECATED XMLPUBFUN void XMLCALL elementDecl (void *ctx, const xmlChar *name, int type, xmlElementContentPtr content); +XML_DEPRECATED XMLPUBFUN void XMLCALL notationDecl (void *ctx, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId); +XML_DEPRECATED XMLPUBFUN void XMLCALL unparsedEntityDecl (void *ctx, const xmlChar *name, @@ -96,72 +113,86 @@ XMLPUBFUN void XMLCALL const xmlChar *systemId, const xmlChar *notationName); +XML_DEPRECATED XMLPUBFUN void XMLCALL startDocument (void *ctx); +XML_DEPRECATED XMLPUBFUN void XMLCALL endDocument (void *ctx); +XML_DEPRECATED XMLPUBFUN void XMLCALL attribute (void *ctx, const xmlChar *fullname, const xmlChar *value); +XML_DEPRECATED XMLPUBFUN void XMLCALL startElement (void *ctx, const xmlChar *fullname, const xmlChar **atts); +XML_DEPRECATED XMLPUBFUN void XMLCALL endElement (void *ctx, const xmlChar *name); +XML_DEPRECATED XMLPUBFUN void XMLCALL reference (void *ctx, const xmlChar *name); +XML_DEPRECATED XMLPUBFUN void XMLCALL characters (void *ctx, const xmlChar *ch, int len); +XML_DEPRECATED XMLPUBFUN void XMLCALL ignorableWhitespace (void *ctx, const xmlChar *ch, int len); +XML_DEPRECATED XMLPUBFUN void XMLCALL processingInstruction (void *ctx, const xmlChar *target, const xmlChar *data); +XML_DEPRECATED XMLPUBFUN void XMLCALL globalNamespace (void *ctx, const xmlChar *href, const xmlChar *prefix); +XML_DEPRECATED XMLPUBFUN void XMLCALL setNamespace (void *ctx, const xmlChar *name); +XML_DEPRECATED XMLPUBFUN xmlNsPtr XMLCALL getNamespace (void *ctx); +XML_DEPRECATED XMLPUBFUN int XMLCALL checkNamespace (void *ctx, xmlChar *nameSpace); +XML_DEPRECATED XMLPUBFUN void XMLCALL namespaceDecl (void *ctx, const xmlChar *href, const xmlChar *prefix); +XML_DEPRECATED XMLPUBFUN void XMLCALL comment (void *ctx, const xmlChar *value); +XML_DEPRECATED XMLPUBFUN void XMLCALL cdataBlock (void *ctx, const xmlChar *value, int len); #ifdef LIBXML_SAX1_ENABLED +XML_DEPRECATED XMLPUBFUN void XMLCALL initxmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr, int warning); #ifdef LIBXML_HTML_ENABLED +XML_DEPRECATED XMLPUBFUN void XMLCALL inithtmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr); #endif -#ifdef LIBXML_DOCB_ENABLED -XMLPUBFUN void XMLCALL - initdocbDefaultSAXHandler (xmlSAXHandlerV1 *hdlr); -#endif #endif /* LIBXML_SAX1_ENABLED */ #ifdef __cplusplus diff --git a/sdk/include/reactos/libs/libxml/SAX2.h b/sdk/include/reactos/libs/libxml/SAX2.h index a55212eb554..8e9b0b95fe5 100644 --- a/sdk/include/reactos/libs/libxml/SAX2.h +++ b/sdk/include/reactos/libs/libxml/SAX2.h @@ -16,7 +16,6 @@ #include #include #include -#include #ifdef __cplusplus extern "C" { @@ -99,8 +98,7 @@ XMLPUBFUN void XMLCALL XMLPUBFUN void XMLCALL xmlSAX2EndDocument (void *ctx); #if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || \ - defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED) || \ - defined(LIBXML_LEGACY_ENABLED) + defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_LEGACY_ENABLED) XMLPUBFUN void XMLCALL xmlSAX2StartElement (void *ctx, const xmlChar *fullname, @@ -161,15 +159,11 @@ XMLPUBFUN void XMLCALL #ifdef LIBXML_HTML_ENABLED XMLPUBFUN void XMLCALL xmlSAX2InitHtmlDefaultSAXHandler(xmlSAXHandler *hdlr); +XML_DEPRECATED XMLPUBFUN void XMLCALL htmlDefaultSAXHandlerInit (void); #endif -#ifdef LIBXML_DOCB_ENABLED -XMLPUBFUN void XMLCALL - xmlSAX2InitDocbDefaultSAXHandler(xmlSAXHandler *hdlr); -XMLPUBFUN void XMLCALL - docbDefaultSAXHandlerInit (void); -#endif +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlDefaultSAXHandlerInit (void); #ifdef __cplusplus diff --git a/sdk/include/reactos/libs/libxml/dict.h b/sdk/include/reactos/libs/libxml/dict.h index cf54af1f252..91f74d1b8ff 100644 --- a/sdk/include/reactos/libs/libxml/dict.h +++ b/sdk/include/reactos/libs/libxml/dict.h @@ -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); diff --git a/sdk/include/reactos/libs/libxml/encoding.h b/sdk/include/reactos/libs/libxml/encoding.h index c875af6fb7c..381e1886bf8 100644 --- a/sdk/include/reactos/libs/libxml/encoding.h +++ b/sdk/include/reactos/libs/libxml/encoding.h @@ -27,9 +27,7 @@ #ifdef LIBXML_ICONV_ENABLED #include #endif -#ifdef LIBXML_ICU_ENABLED -#include -#endif + #ifdef __cplusplus extern "C" { #endif @@ -128,19 +126,6 @@ typedef int (* xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen, * Block defining the handlers for non UTF-8 encodings. * If iconv is supported, there are two extra fields. */ -#ifdef LIBXML_ICU_ENABLED -/* Size of pivot buffer, same as icu/source/common/ucnv.cpp CHUNK_SIZE */ -#define ICU_PIVOT_BUF_SIZE 1024 -struct _uconv_t { - UConverter *uconv; /* for conversion between an encoding and UTF-16 */ - UConverter *utf8; /* for conversion between UTF-8 and UTF-16 */ - UChar pivot_buf[ICU_PIVOT_BUF_SIZE]; - UChar *pivot_source; - UChar *pivot_target; -}; -typedef struct _uconv_t uconv_t; -#endif - typedef struct _xmlCharEncodingHandler xmlCharEncodingHandler; typedef xmlCharEncodingHandler *xmlCharEncodingHandlerPtr; struct _xmlCharEncodingHandler { @@ -152,8 +137,8 @@ struct _xmlCharEncodingHandler { iconv_t iconv_out; #endif /* LIBXML_ICONV_ENABLED */ #ifdef LIBXML_ICU_ENABLED - uconv_t *uconv_in; - uconv_t *uconv_out; + struct _uconv_t *uconv_in; + struct _uconv_t *uconv_out; #endif /* LIBXML_ICU_ENABLED */ }; @@ -168,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 diff --git a/sdk/include/reactos/libs/libxml/entities.h b/sdk/include/reactos/libs/libxml/entities.h index 47b4573eba6..2b60d9e6228 100644 --- a/sdk/include/reactos/libs/libxml/entities.h +++ b/sdk/include/reactos/libs/libxml/entities.h @@ -75,6 +75,7 @@ typedef xmlEntitiesTable *xmlEntitiesTablePtr; */ #ifdef LIBXML_LEGACY_ENABLED +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlInitializePredefinedEntities (void); #endif /* LIBXML_LEGACY_ENABLED */ @@ -112,6 +113,7 @@ XMLPUBFUN xmlEntityPtr XMLCALL xmlGetParameterEntity (xmlDocPtr doc, const xmlChar *name); #ifdef LIBXML_LEGACY_ENABLED +XML_DEPRECATED XMLPUBFUN const xmlChar * XMLCALL xmlEncodeEntities (xmlDocPtr doc, const xmlChar *input); diff --git a/sdk/include/reactos/libs/libxml/globals.h b/sdk/include/reactos/libs/libxml/globals.h index 5e41b7bb5f8..d57ccb05415 100644 --- a/sdk/include/reactos/libs/libxml/globals.h +++ b/sdk/include/reactos/libs/libxml/globals.h @@ -24,7 +24,9 @@ extern "C" { #endif +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlInitGlobals(void); +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlCleanupGlobals(void); /** @@ -67,7 +69,6 @@ XMLCALL xmlOutputBufferCreateFilenameDefault (xmlOutputBufferCreateFilenameFunc * compatibility support. */ -#undef docbDefaultSAXHandler #undef htmlDefaultSAXHandler #undef oldXMLWDcompatibility #undef xmlBufferAllocScheme @@ -124,7 +125,7 @@ struct _xmlGlobalState xmlSAXLocator xmlDefaultSAXLocator; xmlSAXHandlerV1 xmlDefaultSAXHandler; - xmlSAXHandlerV1 docbDefaultSAXHandler; + xmlSAXHandlerV1 docbDefaultSAXHandler; /* unused */ xmlSAXHandlerV1 htmlDefaultSAXHandler; xmlFreeFunc xmlFree; @@ -251,16 +252,6 @@ XMLPUBVAR xmlFreeFunc xmlFree; XMLPUBVAR xmlStrdupFunc xmlMemStrdup; #endif /* LIBXML_THREAD_ALLOC_ENABLED */ -#ifdef LIBXML_DOCB_ENABLED -XMLPUBFUN xmlSAXHandlerV1 * XMLCALL __docbDefaultSAXHandler(void); -#ifdef LIBXML_THREAD_ENABLED -#define docbDefaultSAXHandler \ -(*(__docbDefaultSAXHandler())) -#else -XMLPUBVAR xmlSAXHandlerV1 docbDefaultSAXHandler; -#endif -#endif - #ifdef LIBXML_HTML_ENABLED XMLPUBFUN xmlSAXHandlerV1 * XMLCALL __htmlDefaultSAXHandler(void); #ifdef LIBXML_THREAD_ENABLED diff --git a/sdk/include/reactos/libs/libxml/nanoftp.h b/sdk/include/reactos/libs/libxml/nanoftp.h index 7335faf1075..f39bde5be07 100644 --- a/sdk/include/reactos/libs/libxml/nanoftp.h +++ b/sdk/include/reactos/libs/libxml/nanoftp.h @@ -1,7 +1,8 @@ /* * Summary: minimal FTP implementation * Description: minimal FTP implementation allowing to fetch resources - * like external subset. + * like external subset. This module is DEPRECATED, do not + * use any of its functions. * * Copy: See Copyright for the status of this software. * @@ -16,7 +17,7 @@ #ifdef LIBXML_FTP_ENABLED /* Needed for portability to Windows 64 bits */ -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) #include #else /** @@ -78,40 +79,52 @@ typedef void (*ftpDataCallback) (void *userData, /* * Init */ +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlNanoFTPInit (void); +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlNanoFTPCleanup (void); /* * Creating/freeing contexts. */ +XML_DEPRECATED XMLPUBFUN void * XMLCALL xmlNanoFTPNewCtxt (const char *URL); +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlNanoFTPFreeCtxt (void * ctx); +XML_DEPRECATED XMLPUBFUN void * XMLCALL xmlNanoFTPConnectTo (const char *server, int port); /* * Opening/closing session connections. */ +XML_DEPRECATED XMLPUBFUN void * XMLCALL xmlNanoFTPOpen (const char *URL); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlNanoFTPConnect (void *ctx); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlNanoFTPClose (void *ctx); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlNanoFTPQuit (void *ctx); +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlNanoFTPScanProxy (const char *URL); +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlNanoFTPProxy (const char *host, int port, const char *user, const char *passwd, int type); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlNanoFTPUpdateURL (void *ctx, const char *URL); @@ -119,38 +132,48 @@ XMLPUBFUN int XMLCALL /* * Rather internal commands. */ +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlNanoFTPGetResponse (void *ctx); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlNanoFTPCheckResponse (void *ctx); /* * CD/DIR/GET handlers. */ +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlNanoFTPCwd (void *ctx, const char *directory); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlNanoFTPDele (void *ctx, const char *file); +XML_DEPRECATED XMLPUBFUN SOCKET XMLCALL xmlNanoFTPGetConnection (void *ctx); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlNanoFTPCloseConnection(void *ctx); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlNanoFTPList (void *ctx, ftpListCallback callback, void *userData, const char *filename); +XML_DEPRECATED XMLPUBFUN SOCKET XMLCALL xmlNanoFTPGetSocket (void *ctx, const char *filename); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlNanoFTPGet (void *ctx, ftpDataCallback callback, void *userData, const char *filename); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlNanoFTPRead (void *ctx, void *dest, diff --git a/sdk/include/reactos/libs/libxml/parser.h b/sdk/include/reactos/libs/libxml/parser.h index 0ba1c387a97..82c61d67e92 100644 --- a/sdk/include/reactos/libs/libxml/parser.h +++ b/sdk/include/reactos/libs/libxml/parser.h @@ -10,8 +10,6 @@ #ifndef __XML_PARSER_H__ #define __XML_PARSER_H__ -#include - #include #include #include @@ -192,7 +190,7 @@ struct _xmlParserCtxt { const xmlChar *version; /* the XML version string */ const xmlChar *encoding; /* the declared encoding, if any */ int standalone; /* standalone document */ - int html; /* an HTML(1)/Docbook(2) document + int html; /* an HTML(1) document * 3 is HTML after * 10 is HTML after */ @@ -996,13 +994,16 @@ XMLPUBFUN xmlParserCtxtPtr XMLCALL /* * Reading/setting optional parsing features. */ +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlGetFeaturesList (int *len, const char **result); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlGetFeature (xmlParserCtxtPtr ctxt, const char *name, void *result); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlSetFeature (xmlParserCtxtPtr ctxt, const char *name, diff --git a/sdk/include/reactos/libs/libxml/parserInternals.h b/sdk/include/reactos/libs/libxml/parserInternals.h index 1f26ce20810..656ee4625c3 100644 --- a/sdk/include/reactos/libs/libxml/parserInternals.h +++ b/sdk/include/reactos/libs/libxml/parserInternals.h @@ -339,6 +339,7 @@ XMLPUBFUN int XMLCALL XMLPUBFUN int XMLCALL xmlSwitchToEncoding (xmlParserCtxtPtr ctxt, xmlCharEncodingHandlerPtr handler); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlSwitchInputEncoding (xmlParserCtxtPtr ctxt, xmlParserInputPtr input, @@ -574,6 +575,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); @@ -597,25 +599,34 @@ typedef void (*xmlEntityReferenceFunc) (xmlEntityPtr ent, xmlNodePtr firstNode, xmlNodePtr lastNode); +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlSetEntityReferenceFunc (xmlEntityReferenceFunc func); +XML_DEPRECATED XMLPUBFUN xmlChar * XMLCALL xmlParseQuotedString (xmlParserCtxtPtr ctxt); +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlParseNamespace (xmlParserCtxtPtr ctxt); +XML_DEPRECATED XMLPUBFUN xmlChar * XMLCALL xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt); +XML_DEPRECATED XMLPUBFUN xmlChar * XMLCALL xmlScanName (xmlParserCtxtPtr ctxt); +XML_DEPRECATED XMLPUBFUN xmlChar * XMLCALL xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt); +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlParserHandleReference(xmlParserCtxtPtr ctxt); +XML_DEPRECATED XMLPUBFUN xmlChar * XMLCALL xmlNamespaceParseQName (xmlParserCtxtPtr ctxt, xmlChar **prefix); /** * Entities */ +XML_DEPRECATED XMLPUBFUN xmlChar * XMLCALL xmlDecodeEntities (xmlParserCtxtPtr ctxt, int len, @@ -623,6 +634,7 @@ XMLPUBFUN xmlChar * XMLCALL xmlChar end, xmlChar end2, xmlChar end3); +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlHandleEntity (xmlParserCtxtPtr ctxt, xmlEntityPtr entity); diff --git a/sdk/include/reactos/libs/libxml/relaxng.h b/sdk/include/reactos/libs/libxml/relaxng.h index f269c9ec0db..6369785cef0 100644 --- a/sdk/include/reactos/libs/libxml/relaxng.h +++ b/sdk/include/reactos/libs/libxml/relaxng.h @@ -118,6 +118,7 @@ typedef enum { XMLPUBFUN int XMLCALL xmlRelaxNGInitTypes (void); +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlRelaxNGCleanupTypes (void); diff --git a/sdk/include/reactos/libs/libxml/schematron.h b/sdk/include/reactos/libs/libxml/schematron.h index 364eaecde6b..c61e61b3cf5 100644 --- a/sdk/include/reactos/libs/libxml/schematron.h +++ b/sdk/include/reactos/libs/libxml/schematron.h @@ -1,5 +1,5 @@ /* - * Summary: XML Schemastron implementation + * Summary: XML Schematron implementation * Description: interface to the XML Schematron validity checking. * * Copy: See Copyright for the status of this software. diff --git a/sdk/include/reactos/libs/libxml/threads.h b/sdk/include/reactos/libs/libxml/threads.h index 9969ae7cfd0..6eedac1f374 100644 --- a/sdk/include/reactos/libs/libxml/threads.h +++ b/sdk/include/reactos/libs/libxml/threads.h @@ -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 diff --git a/sdk/include/reactos/libs/libxml/tree.h b/sdk/include/reactos/libs/libxml/tree.h index 1e79be92ea9..98e208745a9 100644 --- a/sdk/include/reactos/libs/libxml/tree.h +++ b/sdk/include/reactos/libs/libxml/tree.h @@ -177,11 +177,11 @@ typedef enum { XML_NAMESPACE_DECL= 18, XML_XINCLUDE_START= 19, XML_XINCLUDE_END= 20 -#ifdef LIBXML_DOCB_ENABLED - ,XML_DOCB_DOCUMENT_NODE= 21 -#endif + /* XML_DOCB_DOCUMENT_NODE= 21 */ /* removed */ } xmlElementType; +/* For backward compatibility */ +#define XML_DOCB_DOCUMENT_NODE 21 /** * xmlNotation: @@ -659,7 +659,7 @@ struct _xmlDOMWrapCtxt { defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || \ defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || \ defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || \ - defined(LIBXML_DOCB_ENABLED) || defined(LIBXML_LEGACY_ENABLED) + defined(LIBXML_LEGACY_ENABLED) XMLPUBFUN int XMLCALL xmlValidateNCName (const xmlChar *value, int space); @@ -763,6 +763,7 @@ XMLPUBFUN xmlDtdPtr XMLCALL XMLPUBFUN void XMLCALL xmlFreeDtd (xmlDtdPtr cur); #ifdef LIBXML_LEGACY_ENABLED +XML_DEPRECATED XMLPUBFUN xmlNsPtr XMLCALL xmlNewGlobalNs (xmlDocPtr doc, const xmlChar *href, diff --git a/sdk/include/reactos/libs/libxml/valid.h b/sdk/include/reactos/libs/libxml/valid.h index 2bc7b380c1e..3eaf84adcb4 100644 --- a/sdk/include/reactos/libs/libxml/valid.h +++ b/sdk/include/reactos/libs/libxml/valid.h @@ -60,17 +60,17 @@ typedef void (XMLCDECL *xmlValidityWarningFunc) (void *ctx, #ifdef IN_LIBXML /** - * XML_CTXT_FINISH_DTD_0: + * XML_VCTXT_DTD_VALIDATED: * - * Special value for finishDtd field when embedded in an xmlParserCtxt + * Set after xmlValidateDtdFinal was called. */ -#define XML_CTXT_FINISH_DTD_0 0xabcd1234 +#define XML_VCTXT_DTD_VALIDATED (1u << 0) /** - * XML_CTXT_FINISH_DTD_1: + * XML_VCTXT_USE_PCTXT: * - * Special value for finishDtd field when embedded in an xmlParserCtxt + * Set if the validation context is part of a parser context. */ -#define XML_CTXT_FINISH_DTD_1 0xabcd1235 +#define XML_VCTXT_USE_PCTXT (1u << 1) #endif /* @@ -90,7 +90,7 @@ struct _xmlValidCtxt { int nodeMax; /* Max depth of the parsing stack */ xmlNodePtr *nodeTab; /* array of nodes */ - unsigned int finishDtd; /* finished validating the Dtd ? */ + unsigned int flags; /* internal flags */ xmlDocPtr doc; /* the document */ int valid; /* temporary validity check result */ @@ -283,20 +283,25 @@ XMLPUBFUN int XMLCALL xmlAttrPtr attr); /* IDREFs */ +XML_DEPRECATED XMLPUBFUN xmlRefPtr XMLCALL xmlAddRef (xmlValidCtxtPtr ctxt, xmlDocPtr doc, const xmlChar *value, xmlAttrPtr attr); +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlFreeRefTable (xmlRefTablePtr table); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlIsRef (xmlDocPtr doc, xmlNodePtr elem, xmlAttrPtr attr); +XML_DEPRECATED XMLPUBFUN int XMLCALL xmlRemoveRef (xmlDocPtr doc, xmlAttrPtr attr); +XML_DEPRECATED XMLPUBFUN xmlListPtr XMLCALL xmlGetRefs (xmlDocPtr doc, const xmlChar *ID); diff --git a/sdk/include/reactos/libs/libxml/xmlerror.h b/sdk/include/reactos/libs/libxml/xmlerror.h index c1019971f24..ee95be9c9c2 100644 --- a/sdk/include/reactos/libs/libxml/xmlerror.h +++ b/sdk/include/reactos/libs/libxml/xmlerror.h @@ -209,6 +209,7 @@ typedef enum { XML_ERR_VERSION_MISMATCH, /* 109 */ XML_ERR_NAME_TOO_LONG, /* 110 */ XML_ERR_USER_STOP, /* 111 */ + XML_ERR_COMMENT_ABRUPTLY_ENDED, /* 112 */ XML_NS_ERR_XML_NAMESPACE = 200, XML_NS_ERR_UNDEFINED_NAMESPACE, /* 201 */ XML_NS_ERR_QNAME, /* 202 */ @@ -259,6 +260,7 @@ typedef enum { XML_DTD_DUP_TOKEN, /* 541 */ XML_HTML_STRUCURE_ERROR = 800, XML_HTML_UNKNOWN_TAG, /* 801 */ + XML_HTML_INCORRECTLY_OPENED_COMMENT, /* 802 */ XML_RNGP_ANYNAME_ATTR_ANCESTOR = 1000, XML_RNGP_ATTR_CONFLICT, /* 1001 */ XML_RNGP_ATTRIBUTE_CHILDREN, /* 1002 */ diff --git a/sdk/include/reactos/libs/libxml/xmlmemory.h b/sdk/include/reactos/libs/libxml/xmlmemory.h index 17e375a3c9a..ae2a4275a3b 100644 --- a/sdk/include/reactos/libs/libxml/xmlmemory.h +++ b/sdk/include/reactos/libs/libxml/xmlmemory.h @@ -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); /* diff --git a/sdk/include/reactos/libs/libxml/xmlschemastypes.h b/sdk/include/reactos/libs/libxml/xmlschemastypes.h index 35d48d414be..5d588f92ea3 100644 --- a/sdk/include/reactos/libs/libxml/xmlschemastypes.h +++ b/sdk/include/reactos/libs/libxml/xmlschemastypes.h @@ -32,6 +32,7 @@ typedef enum { XMLPUBFUN void XMLCALL xmlSchemaInitTypes (void); +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlSchemaCleanupTypes (void); XMLPUBFUN xmlSchemaTypePtr XMLCALL diff --git a/sdk/include/reactos/libs/libxml/xmlversion.h b/sdk/include/reactos/libs/libxml/xmlversion.h index 9cd054df70e..ad9a2cb82b6 100644 --- a/sdk/include/reactos/libs/libxml/xmlversion.h +++ b/sdk/include/reactos/libs/libxml/xmlversion.h @@ -29,28 +29,28 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * * the version string like "1.2.3" */ -#define LIBXML_DOTTED_VERSION "2.9.14" +#define LIBXML_DOTTED_VERSION "2.10.0" /** * LIBXML_VERSION: * * the version number: 1.2.3 value is 10203 */ -#define LIBXML_VERSION 20914 +#define LIBXML_VERSION 21000 /** * LIBXML_VERSION_STRING: * * the version number string, 1.2.3 value is "10203" */ -#define LIBXML_VERSION_STRING "20914" +#define LIBXML_VERSION_STRING "21000" /** * LIBXML_VERSION_EXTRA: * * extra version information, used to show a git commit description */ -#define LIBXML_VERSION_EXTRA "-GITv2.9.13-22-g7846b0a67" +#define LIBXML_VERSION_EXTRA "-GITv2.9.13-209-gae383bdb7" /** * LIBXML_TEST_VERSION: @@ -58,7 +58,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * Macro to check that the libxml version in use is compatible with * the version the software has been compiled against */ -#define LIBXML_TEST_VERSION xmlCheckVersion(20914); +#define LIBXML_TEST_VERSION xmlCheckVersion(21000); #ifndef VMS #if 0 @@ -171,7 +171,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * * Whether the FTP support is configured in */ -#if 1 +#if 0 #define LIBXML_FTP_ENABLED #endif @@ -207,7 +207,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * * Whether the deprecated APIs are compiled in for compatibility */ -#if 1 +#if 0 #define LIBXML_LEGACY_ENABLED #endif @@ -229,15 +229,6 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); #define LIBXML_CATALOG_ENABLED #endif -/** - * LIBXML_DOCB_ENABLED: - * - * Whether the SGML Docbook support is configured in - */ -#if 1 -#define LIBXML_DOCB_ENABLED -#endif - /** * LIBXML_XPATH_ENABLED: * @@ -256,6 +247,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); #define LIBXML_XPTR_ENABLED #endif +/** + * LIBXML_XPTR_LOCS_ENABLED: + * + * Whether support for XPointer locations is configured in + */ +#if 0 +#define LIBXML_XPTR_LOCS_ENABLED +#endif + /** * LIBXML_XINCLUDE_ENABLED: * @@ -456,6 +456,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); # define LIBXML_ATTR_FORMAT(fmt,args) #endif +#ifndef XML_DEPRECATED +# ifdef IN_LIBXML +# define XML_DEPRECATED +# else +/* Available since at least GCC 3.1 */ +# define XML_DEPRECATED __attribute__((deprecated)) +# endif +#endif + #else /* ! __GNUC__ */ /** * ATTRIBUTE_UNUSED: @@ -475,6 +484,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * Macro used to indicate to GCC the parameter are printf like */ #define LIBXML_ATTR_FORMAT(fmt,args) +/** + * XML_DEPRECATED: + * + * Macro used to indicate that a function, variable, type or struct member + * is deprecated. + */ +#ifndef XML_DEPRECATED +#define XML_DEPRECATED +#endif #endif /* __GNUC__ */ #ifdef __cplusplus diff --git a/sdk/include/reactos/libs/libxml/xmlversion.h.in b/sdk/include/reactos/libs/libxml/xmlversion.h.in index f9f79a2f2ac..bdebfe3b0c9 100644 --- a/sdk/include/reactos/libs/libxml/xmlversion.h.in +++ b/sdk/include/reactos/libs/libxml/xmlversion.h.in @@ -229,15 +229,6 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); #define LIBXML_CATALOG_ENABLED #endif -/** - * LIBXML_DOCB_ENABLED: - * - * Whether the SGML Docbook support is configured in - */ -#if @WITH_DOCB@ -#define LIBXML_DOCB_ENABLED -#endif - /** * LIBXML_XPATH_ENABLED: * @@ -256,6 +247,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); #define LIBXML_XPTR_ENABLED #endif +/** + * LIBXML_XPTR_LOCS_ENABLED: + * + * Whether support for XPointer locations is configured in + */ +#if @WITH_XPTR_LOCS@ +#define LIBXML_XPTR_LOCS_ENABLED +#endif + /** * LIBXML_XINCLUDE_ENABLED: * @@ -456,6 +456,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); # define LIBXML_ATTR_FORMAT(fmt,args) #endif +#ifndef XML_DEPRECATED +# ifdef IN_LIBXML +# define XML_DEPRECATED +# else +/* Available since at least GCC 3.1 */ +# define XML_DEPRECATED __attribute__((deprecated)) +# endif +#endif + #else /* ! __GNUC__ */ /** * ATTRIBUTE_UNUSED: @@ -475,6 +484,15 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); * Macro used to indicate to GCC the parameter are printf like */ #define LIBXML_ATTR_FORMAT(fmt,args) +/** + * XML_DEPRECATED: + * + * Macro used to indicate that a function, variable, type or struct member + * is deprecated. + */ +#ifndef XML_DEPRECATED +#define XML_DEPRECATED +#endif #endif /* __GNUC__ */ #ifdef __cplusplus diff --git a/sdk/include/reactos/libs/libxml/xpath.h b/sdk/include/reactos/libs/libxml/xpath.h index 539593fa506..bfbc5d6d995 100644 --- a/sdk/include/reactos/libs/libxml/xpath.h +++ b/sdk/include/reactos/libs/libxml/xpath.h @@ -104,13 +104,23 @@ typedef enum { XPATH_BOOLEAN = 2, XPATH_NUMBER = 3, XPATH_STRING = 4, +#ifdef LIBXML_XPTR_LOCS_ENABLED XPATH_POINT = 5, XPATH_RANGE = 6, XPATH_LOCATIONSET = 7, +#endif XPATH_USERS = 8, XPATH_XSLT_TREE = 9 /* An XSLT value tree, non modifiable */ } xmlXPathObjectType; +#ifndef LIBXML_XPTR_LOCS_ENABLED +/** DOC_DISABLE */ +#define XPATH_POINT 5 +#define XPATH_RANGE 6 +#define XPATH_LOCATIONSET 7 +/** DOC_ENABLE */ +#endif + typedef struct _xmlXPathObject xmlXPathObject; typedef xmlXPathObject *xmlXPathObjectPtr; struct _xmlXPathObject { @@ -549,6 +559,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 diff --git a/sdk/include/reactos/libs/libxml/xpointer.h b/sdk/include/reactos/libs/libxml/xpointer.h index b99112b87a1..ca7bdbe085f 100644 --- a/sdk/include/reactos/libs/libxml/xpointer.h +++ b/sdk/include/reactos/libs/libxml/xpointer.h @@ -28,6 +28,7 @@ extern "C" { #endif +#ifdef LIBXML_XPTR_LOCS_ENABLED /* * A Location Set */ @@ -43,51 +44,68 @@ struct _xmlLocationSet { * Handling of location sets. */ +XML_DEPRECATED XMLPUBFUN xmlLocationSetPtr XMLCALL xmlXPtrLocationSetCreate (xmlXPathObjectPtr val); +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlXPtrFreeLocationSet (xmlLocationSetPtr obj); +XML_DEPRECATED XMLPUBFUN xmlLocationSetPtr XMLCALL xmlXPtrLocationSetMerge (xmlLocationSetPtr val1, xmlLocationSetPtr val2); +XML_DEPRECATED XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrNewRange (xmlNodePtr start, int startindex, xmlNodePtr end, int endindex); +XML_DEPRECATED XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrNewRangePoints (xmlXPathObjectPtr start, xmlXPathObjectPtr end); +XML_DEPRECATED XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrNewRangeNodePoint (xmlNodePtr start, xmlXPathObjectPtr end); +XML_DEPRECATED XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrNewRangePointNode (xmlXPathObjectPtr start, xmlNodePtr end); +XML_DEPRECATED XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrNewRangeNodes (xmlNodePtr start, xmlNodePtr end); +XML_DEPRECATED XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrNewLocationSetNodes (xmlNodePtr start, xmlNodePtr end); +XML_DEPRECATED XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrNewLocationSetNodeSet(xmlNodeSetPtr set); +XML_DEPRECATED XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrNewRangeNodeObject (xmlNodePtr start, xmlXPathObjectPtr end); +XML_DEPRECATED XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrNewCollapsedRange (xmlNodePtr start); +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlXPtrLocationSetAdd (xmlLocationSetPtr cur, xmlXPathObjectPtr val); +XML_DEPRECATED XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrWrapLocationSet (xmlLocationSetPtr val); +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlXPtrLocationSetDel (xmlLocationSetPtr cur, xmlXPathObjectPtr val); +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlXPtrLocationSetRemove (xmlLocationSetPtr cur, int val); +#endif /* LIBXML_XPTR_LOCS_ENABLED */ /* * Functions. @@ -99,13 +117,18 @@ XMLPUBFUN xmlXPathContextPtr XMLCALL XMLPUBFUN xmlXPathObjectPtr XMLCALL xmlXPtrEval (const xmlChar *str, xmlXPathContextPtr ctx); +#ifdef LIBXML_XPTR_LOCS_ENABLED +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlXPtrRangeToFunction (xmlXPathParserContextPtr ctxt, int nargs); +XML_DEPRECATED XMLPUBFUN xmlNodePtr XMLCALL xmlXPtrBuildNodeList (xmlXPathObjectPtr obj); +XML_DEPRECATED XMLPUBFUN void XMLCALL xmlXPtrEvalRangePredicate (xmlXPathParserContextPtr ctxt); +#endif /* LIBXML_XPTR_LOCS_ENABLED */ #ifdef __cplusplus } #endif diff --git a/sdk/lib/3rdparty/libxml2/CMakeLists.txt b/sdk/lib/3rdparty/libxml2/CMakeLists.txt index e56e434d3e8..ba32c6a732a 100644 --- a/sdk/lib/3rdparty/libxml2/CMakeLists.txt +++ b/sdk/lib/3rdparty/libxml2/CMakeLists.txt @@ -23,7 +23,6 @@ list(APPEND SOURCE chvalid.c debugXML.c dict.c - DOCBparser.c encoding.c entities.c error.c diff --git a/sdk/lib/3rdparty/libxml2/COPYING b/sdk/lib/3rdparty/libxml2/COPYING deleted file mode 100644 index d61318502ca..00000000000 --- a/sdk/lib/3rdparty/libxml2/COPYING +++ /dev/null @@ -1,23 +0,0 @@ -Except where otherwise noted in the source code (e.g. the files hash.c, -list.c and the trio files, which are covered by a similar licence but -with different Copyright notices) all the files are: - - Copyright (C) 1998-2012 Daniel Veillard. All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is fur- -nished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT- -NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/sdk/lib/3rdparty/libxml2/DOCBparser.c b/sdk/lib/3rdparty/libxml2/DOCBparser.c deleted file mode 100644 index f12511b9e8a..00000000000 --- a/sdk/lib/3rdparty/libxml2/DOCBparser.c +++ /dev/null @@ -1,305 +0,0 @@ -/* - * DOCBparser.c : an attempt to parse SGML Docbook documents - * - * This is deprecated !!! - * Code removed with release 2.6.0 it was broken. - * The doc are expect to be migrated to XML DocBook - * - * See Copyright for the status of this software. - * - * daniel@veillard.com - */ - -#define IN_LIBXML -#include "libxml.h" -#ifdef LIBXML_DOCB_ENABLED - -#include -#include - -/** - * docbEncodeEntities: - * @out: a pointer to an array of bytes to store the result - * @outlen: the length of @out - * @in: a pointer to an array of UTF-8 chars - * @inlen: the length of @in - * @quoteChar: the quote character to escape (' or ") or zero. - * - * Take a block of UTF-8 chars in and try to convert it to an ASCII - * plus SGML entities block of chars out. - * - * Returns 0 if success, -2 if the transcoding fails, or -1 otherwise - * The value of @inlen after return is the number of octets consumed - * as the return value is positive, else unpredictable. - * The value of @outlen after return is the number of octets consumed. - */ -int -docbEncodeEntities(unsigned char *out ATTRIBUTE_UNUSED, - int *outlen ATTRIBUTE_UNUSED, - const unsigned char *in ATTRIBUTE_UNUSED, - int *inlen ATTRIBUTE_UNUSED, - int quoteChar ATTRIBUTE_UNUSED) -{ - static int deprecated = 0; - - if (!deprecated) { - xmlGenericError(xmlGenericErrorContext, - "docbEncodeEntities() deprecated function reached\n"); - deprecated = 1; - } - return(-1); -} - -/** - * docbParseDocument: - * @ctxt: an SGML parser context - * - * parse an SGML document (and build a tree if using the standard SAX - * interface). - * - * Returns 0, -1 in case of error. the parser context is augmented - * as a result of the parsing. - */ - -int -docbParseDocument(docbParserCtxtPtr ctxt ATTRIBUTE_UNUSED) -{ - static int deprecated = 0; - - if (!deprecated) { - xmlGenericError(xmlGenericErrorContext, - "docbParseDocument() deprecated function reached\n"); - deprecated = 1; - } - return (xmlParseDocument(ctxt)); -} - -/** - * docbFreeParserCtxt: - * @ctxt: an SGML parser context - * - * Free all the memory used by a parser context. However the parsed - * document in ctxt->myDoc is not freed. - */ - -void -docbFreeParserCtxt(docbParserCtxtPtr ctxt ATTRIBUTE_UNUSED) -{ - static int deprecated = 0; - - if (!deprecated) { - xmlGenericError(xmlGenericErrorContext, - "docbFreeParserCtxt() deprecated function reached\n"); - deprecated = 1; - } - xmlFreeParserCtxt(ctxt); -} - -/** - * docbParseChunk: - * @ctxt: an XML parser context - * @chunk: an char array - * @size: the size in byte of the chunk - * @terminate: last chunk indicator - * - * Parse a Chunk of memory - * - * Returns zero if no error, the xmlParserErrors otherwise. - */ -int -docbParseChunk(docbParserCtxtPtr ctxt ATTRIBUTE_UNUSED, - const char *chunk ATTRIBUTE_UNUSED, - int size ATTRIBUTE_UNUSED, - int terminate ATTRIBUTE_UNUSED) -{ - static int deprecated = 0; - - if (!deprecated) { - xmlGenericError(xmlGenericErrorContext, - "docbParseChunk() deprecated function reached\n"); - deprecated = 1; - } - - return (xmlParseChunk(ctxt, chunk, size, terminate)); -} - -/** - * docbCreatePushParserCtxt: - * @sax: a SAX handler - * @user_data: The user data returned on SAX callbacks - * @chunk: a pointer to an array of chars - * @size: number of chars in the array - * @filename: an optional file name or URI - * @enc: an optional encoding - * - * Create a parser context for using the DocBook SGML parser in push mode - * To allow content encoding detection, @size should be >= 4 - * The value of @filename is used for fetching external entities - * and error/warning reports. - * - * Returns the new parser context or NULL - */ -docbParserCtxtPtr -docbCreatePushParserCtxt(docbSAXHandlerPtr sax ATTRIBUTE_UNUSED, - void *user_data ATTRIBUTE_UNUSED, - const char *chunk ATTRIBUTE_UNUSED, - int size ATTRIBUTE_UNUSED, - const char *filename ATTRIBUTE_UNUSED, - xmlCharEncoding enc ATTRIBUTE_UNUSED) -{ - static int deprecated = 0; - - if (!deprecated) { - xmlGenericError(xmlGenericErrorContext, - "docbParseChunk() deprecated function reached\n"); - deprecated = 1; - } - - return(xmlCreatePushParserCtxt(sax, user_data, chunk, size, filename)); -} - -/** - * docbSAXParseDoc: - * @cur: a pointer to an array of xmlChar - * @encoding: a free form C string describing the SGML document encoding, or NULL - * @sax: the SAX handler block - * @userData: if using SAX, this pointer will be provided on callbacks. - * - * parse an SGML in-memory document and build a tree. - * It use the given SAX function block to handle the parsing callback. - * If sax is NULL, fallback to the default DOM tree building routines. - * - * Returns the resulting document tree - */ - -docbDocPtr -docbSAXParseDoc(xmlChar * cur ATTRIBUTE_UNUSED, - const char *encoding ATTRIBUTE_UNUSED, - docbSAXHandlerPtr sax ATTRIBUTE_UNUSED, - void *userData ATTRIBUTE_UNUSED) -{ - static int deprecated = 0; - - if (!deprecated) { - xmlGenericError(xmlGenericErrorContext, - "docbParseChunk() deprecated function reached\n"); - deprecated = 1; - } - - return (xmlSAXParseMemoryWithData(sax, (const char *)cur, - xmlStrlen((const xmlChar *) cur), 0, userData)); -} - -/** - * docbParseDoc: - * @cur: a pointer to an array of xmlChar - * @encoding: a free form C string describing the SGML document encoding, or NULL - * - * parse an SGML in-memory document and build a tree. - * - * Returns the resulting document tree - */ - -docbDocPtr -docbParseDoc(xmlChar * cur ATTRIBUTE_UNUSED, - const char *encoding ATTRIBUTE_UNUSED) -{ - static int deprecated = 0; - - if (!deprecated) { - xmlGenericError(xmlGenericErrorContext, - "docbParseChunk() deprecated function reached\n"); - deprecated = 1; - } - - return (xmlParseDoc(cur)); -} - - -/** - * docbCreateFileParserCtxt: - * @filename: the filename - * @encoding: the SGML document encoding, or NULL - * - * Create a parser context for a file content. - * Automatic support for ZLIB/Compress compressed document is provided - * by default if found at compile-time. - * - * Returns the new parser context or NULL - */ -docbParserCtxtPtr -docbCreateFileParserCtxt(const char *filename ATTRIBUTE_UNUSED, - const char *encoding ATTRIBUTE_UNUSED) -{ - static int deprecated = 0; - - if (!deprecated) { - xmlGenericError(xmlGenericErrorContext, - "docbCreateFileParserCtxt() deprecated function reached\n"); - deprecated = 1; - } - - return (xmlCreateFileParserCtxt(filename)); -} - -/** - * docbSAXParseFile: - * @filename: the filename - * @encoding: a free form C string describing the SGML document encoding, or NULL - * @sax: the SAX handler block - * @userData: if using SAX, this pointer will be provided on callbacks. - * - * parse an SGML file and build a tree. Automatic support for ZLIB/Compress - * compressed document is provided by default if found at compile-time. - * It use the given SAX function block to handle the parsing callback. - * If sax is NULL, fallback to the default DOM tree building routines. - * - * Returns the resulting document tree - */ - -docbDocPtr -docbSAXParseFile(const char *filename ATTRIBUTE_UNUSED, - const char *encoding ATTRIBUTE_UNUSED, - docbSAXHandlerPtr sax ATTRIBUTE_UNUSED, - void *userData ATTRIBUTE_UNUSED) -{ - static int deprecated = 0; - - if (!deprecated) { - xmlGenericError(xmlGenericErrorContext, - "docbSAXParseFile() deprecated function reached\n"); - deprecated = 1; - } - - return (xmlSAXParseFileWithData(sax, filename, 0, userData)); -} - -/** - * docbParseFile: - * @filename: the filename - * @encoding: a free form C string describing document encoding, or NULL - * - * parse a Docbook SGML file and build a tree. Automatic support for - * ZLIB/Compress compressed document is provided by default if found - * at compile-time. - * - * Returns the resulting document tree - */ - -docbDocPtr -docbParseFile(const char *filename ATTRIBUTE_UNUSED, - const char *encoding ATTRIBUTE_UNUSED) -{ - static int deprecated = 0; - - if (!deprecated) { - xmlGenericError(xmlGenericErrorContext, - "docbParseFile() deprecated function reached\n"); - deprecated = 1; - } - - return (xmlParseFile(filename)); -} -#define bottom_DOCBparser -#include "elfgcchack.h" -#endif /* LIBXML_DOCB_ENABLED */ diff --git a/sdk/lib/3rdparty/libxml2/HTMLparser.c b/sdk/lib/3rdparty/libxml2/HTMLparser.c index e720bb2013d..abc4e90575c 100644 --- a/sdk/lib/3rdparty/libxml2/HTMLparser.c +++ b/sdk/lib/3rdparty/libxml2/HTMLparser.c @@ -11,24 +11,8 @@ #ifdef LIBXML_HTML_ENABLED #include -#ifdef HAVE_CTYPE_H #include -#endif -#ifdef HAVE_STDLIB_H #include -#endif -#ifdef HAVE_SYS_STAT_H -#include -#endif -#ifdef HAVE_FCNTL_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef LIBXML_ZLIB_ENABLED -#include -#endif #include #include @@ -1411,6 +1395,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 @@ -2558,6 +2545,21 @@ htmlNewDoc(const xmlChar *URI, const xmlChar *ExternalID) { static const xmlChar * htmlParseNameComplex(xmlParserCtxtPtr ctxt); +static void +htmlSkipBogusComment(htmlParserCtxtPtr ctxt) { + int c; + + htmlParseErr(ctxt, XML_HTML_INCORRECTLY_OPENED_COMMENT, + "Incorrectly opened comment\n", NULL, NULL); + + do { + c = CUR; + if (c == 0) + break; + NEXT; + } while (c != '>'); +} + /** * htmlParseHTMLName: * @ctxt: an HTML parser context @@ -3488,10 +3490,20 @@ htmlParseComment(htmlParserCtxtPtr ctxt) { q = CUR_CHAR(ql); if (q == 0) goto unfinished; + if (q == '>') { + htmlParseErr(ctxt, XML_ERR_COMMENT_ABRUPTLY_ENDED, "Comment abruptly ended", NULL, NULL); + cur = '>'; + goto finished; + } NEXTL(ql); r = CUR_CHAR(rl); if (r == 0) goto unfinished; + if (q == '-' && r == '>') { + htmlParseErr(ctxt, XML_ERR_COMMENT_ABRUPTLY_ENDED, "Comment abruptly ended", NULL, NULL); + cur = '>'; + goto finished; + } NEXTL(rl); cur = CUR_CHAR(l); while ((cur != 0) && @@ -3539,6 +3551,7 @@ htmlParseComment(htmlParserCtxtPtr ctxt) { cur = next; l = nl; } +finished: buf[len] = 0; if (cur == '>') { NEXT; @@ -4380,72 +4393,74 @@ htmlParseContent(htmlParserCtxtPtr ctxt) { * Handle SCRIPT/STYLE separately */ htmlParseScript(ctxt); - } else { - /* - * Sometimes DOCTYPE arrives in the middle of the document - */ - if ((CUR == '<') && (NXT(1) == '!') && - (UPP(2) == 'D') && (UPP(3) == 'O') && - (UPP(4) == 'C') && (UPP(5) == 'T') && - (UPP(6) == 'Y') && (UPP(7) == 'P') && - (UPP(8) == 'E')) { - htmlParseErr(ctxt, XML_HTML_STRUCURE_ERROR, - "Misplaced DOCTYPE declaration\n", - BAD_CAST "DOCTYPE" , NULL); - htmlParseDocTypeDecl(ctxt); - } + } - /* - * First case : a comment - */ - if ((CUR == '<') && (NXT(1) == '!') && - (NXT(2) == '-') && (NXT(3) == '-')) { - htmlParseComment(ctxt); - } + else if ((CUR == '<') && (NXT(1) == '!')) { + /* + * Sometimes DOCTYPE arrives in the middle of the document + */ + if ((UPP(2) == 'D') && (UPP(3) == 'O') && + (UPP(4) == 'C') && (UPP(5) == 'T') && + (UPP(6) == 'Y') && (UPP(7) == 'P') && + (UPP(8) == 'E')) { + htmlParseErr(ctxt, XML_HTML_STRUCURE_ERROR, + "Misplaced DOCTYPE declaration\n", + BAD_CAST "DOCTYPE" , NULL); + htmlParseDocTypeDecl(ctxt); + } + /* + * First case : a comment + */ + else if ((NXT(2) == '-') && (NXT(3) == '-')) { + htmlParseComment(ctxt); + } + else { + htmlSkipBogusComment(ctxt); + } + } - /* - * Second case : a Processing Instruction. - */ - else if ((CUR == '<') && (NXT(1) == '?')) { - htmlParsePI(ctxt); - } + /* + * Second case : a Processing Instruction. + */ + else if ((CUR == '<') && (NXT(1) == '?')) { + htmlParsePI(ctxt); + } - /* - * Third case : a sub-element. - */ - else if ((CUR == '<') && IS_ASCII_LETTER(NXT(1))) { - htmlParseElement(ctxt); - } - else if (CUR == '<') { - if ((ctxt->sax != NULL) && (!ctxt->disableSAX) && - (ctxt->sax->characters != NULL)) - ctxt->sax->characters(ctxt->userData, BAD_CAST "<", 1); - NEXT; - } + /* + * Third case : a sub-element. + */ + else if ((CUR == '<') && IS_ASCII_LETTER(NXT(1))) { + htmlParseElement(ctxt); + } + else if (CUR == '<') { + if ((ctxt->sax != NULL) && (!ctxt->disableSAX) && + (ctxt->sax->characters != NULL)) + ctxt->sax->characters(ctxt->userData, BAD_CAST "<", 1); + NEXT; + } - /* - * Fourth case : a reference. If if has not been resolved, - * parsing returns it's Name, create the node - */ - else if (CUR == '&') { - htmlParseReference(ctxt); - } + /* + * Fourth case : a reference. If if has not been resolved, + * parsing returns it's Name, create the node + */ + else if (CUR == '&') { + htmlParseReference(ctxt); + } - /* - * Fifth case : end of the resource - */ - else if (CUR == 0) { - htmlAutoCloseOnEnd(ctxt); - break; - } + /* + * Fifth case : end of the resource + */ + else if (CUR == 0) { + htmlAutoCloseOnEnd(ctxt); + break; + } - /* - * Last case, text. Note that References are handled directly. - */ - else { - htmlParseCharData(ctxt); - } - } + /* + * Last case, text. Note that References are handled directly. + */ + else { + htmlParseCharData(ctxt); + } GROW; } if (currentNode != NULL) xmlFree(currentNode); @@ -4785,76 +4800,78 @@ htmlParseContentInternal(htmlParserCtxtPtr ctxt) { * Handle SCRIPT/STYLE separately */ htmlParseScript(ctxt); - } else { - /* - * Sometimes DOCTYPE arrives in the middle of the document - */ - if ((CUR == '<') && (NXT(1) == '!') && - (UPP(2) == 'D') && (UPP(3) == 'O') && - (UPP(4) == 'C') && (UPP(5) == 'T') && - (UPP(6) == 'Y') && (UPP(7) == 'P') && - (UPP(8) == 'E')) { - htmlParseErr(ctxt, XML_HTML_STRUCURE_ERROR, - "Misplaced DOCTYPE declaration\n", - BAD_CAST "DOCTYPE" , NULL); - htmlParseDocTypeDecl(ctxt); - } + } - /* - * First case : a comment - */ - if ((CUR == '<') && (NXT(1) == '!') && - (NXT(2) == '-') && (NXT(3) == '-')) { - htmlParseComment(ctxt); - } + else if ((CUR == '<') && (NXT(1) == '!')) { + /* + * Sometimes DOCTYPE arrives in the middle of the document + */ + if ((UPP(2) == 'D') && (UPP(3) == 'O') && + (UPP(4) == 'C') && (UPP(5) == 'T') && + (UPP(6) == 'Y') && (UPP(7) == 'P') && + (UPP(8) == 'E')) { + htmlParseErr(ctxt, XML_HTML_STRUCURE_ERROR, + "Misplaced DOCTYPE declaration\n", + BAD_CAST "DOCTYPE" , NULL); + htmlParseDocTypeDecl(ctxt); + } + /* + * First case : a comment + */ + else if ((NXT(2) == '-') && (NXT(3) == '-')) { + htmlParseComment(ctxt); + } + else { + htmlSkipBogusComment(ctxt); + } + } - /* - * Second case : a Processing Instruction. - */ - else if ((CUR == '<') && (NXT(1) == '?')) { - htmlParsePI(ctxt); - } + /* + * Second case : a Processing Instruction. + */ + else if ((CUR == '<') && (NXT(1) == '?')) { + htmlParsePI(ctxt); + } - /* - * Third case : a sub-element. - */ - else if ((CUR == '<') && IS_ASCII_LETTER(NXT(1))) { - htmlParseElementInternal(ctxt); - if (currentNode != NULL) xmlFree(currentNode); + /* + * Third case : a sub-element. + */ + else if ((CUR == '<') && IS_ASCII_LETTER(NXT(1))) { + htmlParseElementInternal(ctxt); + if (currentNode != NULL) xmlFree(currentNode); - currentNode = xmlStrdup(ctxt->name); - depth = ctxt->nameNr; - } - else if (CUR == '<') { - if ((ctxt->sax != NULL) && (!ctxt->disableSAX) && - (ctxt->sax->characters != NULL)) - ctxt->sax->characters(ctxt->userData, BAD_CAST "<", 1); - NEXT; - } + currentNode = xmlStrdup(ctxt->name); + depth = ctxt->nameNr; + } + else if (CUR == '<') { + if ((ctxt->sax != NULL) && (!ctxt->disableSAX) && + (ctxt->sax->characters != NULL)) + ctxt->sax->characters(ctxt->userData, BAD_CAST "<", 1); + NEXT; + } - /* - * Fourth case : a reference. If if has not been resolved, - * parsing returns it's Name, create the node - */ - else if (CUR == '&') { - htmlParseReference(ctxt); - } + /* + * Fourth case : a reference. If if has not been resolved, + * parsing returns it's Name, create the node + */ + else if (CUR == '&') { + htmlParseReference(ctxt); + } - /* - * Fifth case : end of the resource - */ - else if (CUR == 0) { - htmlAutoCloseOnEnd(ctxt); - break; - } + /* + * Fifth case : end of the resource + */ + else if (CUR == 0) { + htmlAutoCloseOnEnd(ctxt); + break; + } - /* - * Last case, text. Note that References are handled directly. - */ - else { - htmlParseCharData(ctxt); - } - } + /* + * Last case, text. Note that References are handled directly. + */ + else { + htmlParseCharData(ctxt); + } GROW; } if (currentNode != NULL) xmlFree(currentNode); @@ -5111,7 +5128,7 @@ htmlInitParserCtxt(htmlParserCtxtPtr ctxt) ctxt->linenumbers = xmlLineNumbersDefaultValue; ctxt->keepBlanks = xmlKeepBlanksDefaultValue; ctxt->html = 1; - ctxt->vctxt.finishDtd = XML_CTXT_FINISH_DTD_0; + ctxt->vctxt.flags = XML_VCTXT_USE_PCTXT; ctxt->vctxt.userData = ctxt; ctxt->vctxt.error = xmlParserValidityError; ctxt->vctxt.warning = xmlParserValidityWarning; @@ -5951,93 +5968,97 @@ htmlParseTryOrFinish(htmlParserCtxtPtr ctxt, int terminate) { #endif break; } - } else { - /* - * Sometimes DOCTYPE arrives in the middle of the document - */ - if ((cur == '<') && (next == '!') && - (UPP(2) == 'D') && (UPP(3) == 'O') && - (UPP(4) == 'C') && (UPP(5) == 'T') && - (UPP(6) == 'Y') && (UPP(7) == 'P') && - (UPP(8) == 'E')) { - if ((!terminate) && - (htmlParseLookupSequence(ctxt, '>', 0, 0, 1) < 0)) - goto done; - htmlParseErr(ctxt, XML_HTML_STRUCURE_ERROR, - "Misplaced DOCTYPE declaration\n", - BAD_CAST "DOCTYPE" , NULL); - htmlParseDocTypeDecl(ctxt); - } else if ((cur == '<') && (next == '!') && - (in->cur[2] == '-') && (in->cur[3] == '-')) { - if ((!terminate) && (htmlParseLookupCommentEnd(ctxt) < 0)) - goto done; + } else if ((cur == '<') && (next == '!')) { + /* + * Sometimes DOCTYPE arrives in the middle of the document + */ + if ((UPP(2) == 'D') && (UPP(3) == 'O') && + (UPP(4) == 'C') && (UPP(5) == 'T') && + (UPP(6) == 'Y') && (UPP(7) == 'P') && + (UPP(8) == 'E')) { + if ((!terminate) && + (htmlParseLookupSequence(ctxt, '>', 0, 0, 1) < 0)) + goto done; + htmlParseErr(ctxt, XML_HTML_STRUCURE_ERROR, + "Misplaced DOCTYPE declaration\n", + BAD_CAST "DOCTYPE" , NULL); + htmlParseDocTypeDecl(ctxt); + } else if ((in->cur[2] == '-') && (in->cur[3] == '-')) { + if ((!terminate) && + (htmlParseLookupCommentEnd(ctxt) < 0)) + goto done; #ifdef DEBUG_PUSH - xmlGenericError(xmlGenericErrorContext, - "HPP: Parsing Comment\n"); + xmlGenericError(xmlGenericErrorContext, + "HPP: Parsing Comment\n"); #endif - htmlParseComment(ctxt); - ctxt->instate = XML_PARSER_CONTENT; - } else if ((cur == '<') && (next == '?')) { - if ((!terminate) && - (htmlParseLookupSequence(ctxt, '>', 0, 0, 0) < 0)) - goto done; + htmlParseComment(ctxt); + ctxt->instate = XML_PARSER_CONTENT; + } else { + if ((!terminate) && + (htmlParseLookupSequence(ctxt, '>', 0, 0, 0) < 0)) + goto done; + htmlSkipBogusComment(ctxt); + } + } else if ((cur == '<') && (next == '?')) { + if ((!terminate) && + (htmlParseLookupSequence(ctxt, '>', 0, 0, 0) < 0)) + goto done; #ifdef DEBUG_PUSH - xmlGenericError(xmlGenericErrorContext, - "HPP: Parsing PI\n"); + xmlGenericError(xmlGenericErrorContext, + "HPP: Parsing PI\n"); #endif - htmlParsePI(ctxt); - ctxt->instate = XML_PARSER_CONTENT; - } else if ((cur == '<') && (next == '!') && (avail < 4)) { - goto done; - } else if ((cur == '<') && (next == '/')) { - ctxt->instate = XML_PARSER_END_TAG; - ctxt->checkIndex = 0; + htmlParsePI(ctxt); + ctxt->instate = XML_PARSER_CONTENT; + } else if ((cur == '<') && (next == '!') && (avail < 4)) { + goto done; + } else if ((cur == '<') && (next == '/')) { + ctxt->instate = XML_PARSER_END_TAG; + ctxt->checkIndex = 0; #ifdef DEBUG_PUSH - xmlGenericError(xmlGenericErrorContext, - "HPP: entering END_TAG\n"); + xmlGenericError(xmlGenericErrorContext, + "HPP: entering END_TAG\n"); #endif - break; - } else if ((cur == '<') && IS_ASCII_LETTER(next)) { - if ((!terminate) && (next == 0)) - goto done; - ctxt->instate = XML_PARSER_START_TAG; - ctxt->checkIndex = 0; + break; + } else if ((cur == '<') && IS_ASCII_LETTER(next)) { + if ((!terminate) && (next == 0)) + goto done; + ctxt->instate = XML_PARSER_START_TAG; + ctxt->checkIndex = 0; #ifdef DEBUG_PUSH - xmlGenericError(xmlGenericErrorContext, - "HPP: entering START_TAG\n"); + xmlGenericError(xmlGenericErrorContext, + "HPP: entering START_TAG\n"); #endif - break; - } else if (cur == '<') { - if ((ctxt->sax != NULL) && (!ctxt->disableSAX) && - (ctxt->sax->characters != NULL)) - ctxt->sax->characters(ctxt->userData, - BAD_CAST "<", 1); - NEXT; - } else { - /* - * check that the text sequence is complete - * before handing out the data to the parser - * to avoid problems with erroneous end of - * data detection. - */ - if ((!terminate) && - (htmlParseLookupSequence(ctxt, '<', 0, 0, 0) < 0)) - goto done; - ctxt->checkIndex = 0; + break; + } else if (cur == '<') { + if ((ctxt->sax != NULL) && (!ctxt->disableSAX) && + (ctxt->sax->characters != NULL)) + ctxt->sax->characters(ctxt->userData, + BAD_CAST "<", 1); + NEXT; + } else { + /* + * check that the text sequence is complete + * before handing out the data to the parser + * to avoid problems with erroneous end of + * data detection. + */ + if ((!terminate) && + (htmlParseLookupSequence(ctxt, '<', 0, 0, 0) < 0)) + goto done; + ctxt->checkIndex = 0; #ifdef DEBUG_PUSH - xmlGenericError(xmlGenericErrorContext, - "HPP: Parsing char data\n"); + xmlGenericError(xmlGenericErrorContext, + "HPP: Parsing char data\n"); #endif - while ((ctxt->instate != XML_PARSER_EOF) && - (cur != '<') && (in->cur < in->end)) { - if (cur == '&') { - htmlParseReference(ctxt); - } else { - htmlParseCharData(ctxt); - } - cur = in->cur[0]; + while ((ctxt->instate != XML_PARSER_EOF) && + (cur != '<') && (in->cur < in->end)) { + if (cur == '&') { + htmlParseReference(ctxt); + } else { + htmlParseCharData(ctxt); } - } + cur = in->cur[0]; + } } break; @@ -6745,6 +6766,8 @@ htmlCtxtReset(htmlParserCtxtPtr ctxt) ctxt->nameNr = 0; ctxt->name = NULL; + ctxt->nsNr = 0; + DICT_FREE(ctxt->version); ctxt->version = NULL; DICT_FREE(ctxt->encoding); @@ -7278,6 +7301,4 @@ htmlCtxtReadIO(htmlParserCtxtPtr ctxt, xmlInputReadCallback ioread, return (htmlDoRead(ctxt, URL, encoding, options, 1)); } -#define bottom_HTMLparser -#include "elfgcchack.h" #endif /* LIBXML_HTML_ENABLED */ diff --git a/sdk/lib/3rdparty/libxml2/HTMLtree.c b/sdk/lib/3rdparty/libxml2/HTMLtree.c index 7a2b8558389..3dd78a91eba 100644 --- a/sdk/lib/3rdparty/libxml2/HTMLtree.c +++ b/sdk/lib/3rdparty/libxml2/HTMLtree.c @@ -12,13 +12,8 @@ #ifdef LIBXML_HTML_ENABLED #include /* for memset() only ! */ - -#ifdef HAVE_CTYPE_H #include -#endif -#ifdef HAVE_STDLIB_H #include -#endif #include #include @@ -304,7 +299,7 @@ create: * output as