icecat: add release icecat-140.9.0-1gnu1 for ecne
This commit is contained in:
parent
8eb1f1732f
commit
a5f93cb214
1197 changed files with 30593 additions and 15344 deletions
|
|
@ -1,30 +1,31 @@
|
|||
diff --git a/expat/lib/expat_external.h b/expat/lib/expat_external.h
|
||||
--- a/expat/lib/expat_external.h
|
||||
+++ b/expat/lib/expat_external.h
|
||||
@@ -137,6 +137,9 @@ extern "C" {
|
||||
@@ -138,6 +138,9 @@ extern "C" {
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
+/* BEGIN MOZILLA CHANGE (typedef XML_Char to char16_t) */
|
||||
+#if 0
|
||||
+
|
||||
#ifdef XML_UNICODE /* Information is UTF-16 encoded. */
|
||||
# ifdef XML_UNICODE_WCHAR_T
|
||||
# ifdef XML_UNICODE /* Information is UTF-16 encoded. */
|
||||
# ifdef XML_UNICODE_WCHAR_T
|
||||
typedef wchar_t XML_Char;
|
||||
@@ -150,6 +153,9 @@ typedef char XML_Char;
|
||||
@@ -151,6 +154,9 @@ typedef char XML_Char;
|
||||
typedef char XML_LChar;
|
||||
#endif /* XML_UNICODE */
|
||||
# endif /* XML_UNICODE */
|
||||
|
||||
+#endif
|
||||
+/* END MOZILLA CHANGE */
|
||||
+
|
||||
#ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */
|
||||
# ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */
|
||||
typedef long long XML_Index;
|
||||
typedef unsigned long long XML_Size;
|
||||
diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
||||
index a187a3a18f19..3a3bb9aa45e2 100644
|
||||
--- a/expat/lib/xmlparse.c
|
||||
+++ b/expat/lib/xmlparse.c
|
||||
@@ -194,6 +194,9 @@ typedef char ICHAR;
|
||||
@@ -195,6 +195,9 @@ typedef char ICHAR;
|
||||
|
||||
#endif
|
||||
|
||||
|
|
@ -34,7 +35,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
#ifdef XML_UNICODE
|
||||
|
||||
# ifdef XML_UNICODE_WCHAR_T
|
||||
@@ -211,6 +214,9 @@ typedef char ICHAR;
|
||||
@@ -212,6 +215,9 @@ typedef char ICHAR;
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
||||
--- a/expat/lib/xmlparse.c
|
||||
+++ b/expat/lib/xmlparse.c
|
||||
@@ -269,7 +269,9 @@ typedef struct {
|
||||
@@ -270,7 +270,9 @@ typedef struct {
|
||||
#define INIT_DATA_BUF_SIZE 1024
|
||||
#define INIT_ATTS_SIZE 16
|
||||
#define INIT_ATTS_VERSION 0xFFFFFFFF
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
||||
--- a/expat/lib/xmlparse.c
|
||||
+++ b/expat/lib/xmlparse.c
|
||||
@@ -764,6 +764,9 @@ struct XML_ParserStruct {
|
||||
ACCOUNTING m_accounting;
|
||||
@@ -791,6 +791,9 @@ struct XML_ParserStruct {
|
||||
ENTITY_STATS m_entity_stats;
|
||||
#endif
|
||||
XML_Bool m_reenter;
|
||||
+/* BEGIN MOZILLA CHANGE (Report opening tag of mismatched closing tag) */
|
||||
+ const XML_Char* m_mismatch;
|
||||
+/* END MOZILLA CHANGE */
|
||||
};
|
||||
|
||||
#define MALLOC(parser, s) (parser->m_mem.malloc_fcn((s)))
|
||||
@@ -1189,6 +1192,10 @@ parserCreate(const XML_Char *encodingNam
|
||||
#if XML_GE == 1
|
||||
@@ -1538,6 +1541,10 @@ parserCreate(const XML_Char *encodingName,
|
||||
parser->m_internalEncoding = XmlGetInternalEncoding();
|
||||
}
|
||||
|
||||
|
|
@ -22,22 +22,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
return parser;
|
||||
}
|
||||
|
||||
@@ -2645,6 +2652,14 @@ XML_SetBillionLaughsAttackProtectionActi
|
||||
}
|
||||
#endif /* XML_GE == 1 */
|
||||
|
||||
+/* BEGIN MOZILLA CHANGE (Report opening tag of mismatched closing tag) */
|
||||
+const XML_Char * XMLCALL
|
||||
+MOZ_XML_GetMismatchedTag(XML_Parser parser)
|
||||
+{
|
||||
+ return parser->m_mismatch;
|
||||
+}
|
||||
+/* END MOZILLA CHANGE */
|
||||
+
|
||||
XML_Bool XMLCALL
|
||||
XML_SetReparseDeferralEnabled(XML_Parser parser, XML_Bool enabled) {
|
||||
if (parser != NULL && (enabled == XML_TRUE || enabled == XML_FALSE)) {
|
||||
@@ -3117,6 +3132,33 @@ doContent(XML_Parser parser, int startTa
|
||||
@@ -3593,6 +3600,33 @@ doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
|
||||
len = XmlNameLength(enc, rawName);
|
||||
if (len != tag->rawNameLength
|
||||
|| memcmp(tag->rawName, rawName, len) != 0) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
||||
--- a/expat/lib/xmlparse.c
|
||||
+++ b/expat/lib/xmlparse.c
|
||||
@@ -796,6 +796,8 @@ static const XML_Char implicitContext[]
|
||||
@@ -1046,6 +1046,8 @@ static const XML_Char implicitContext[]
|
||||
ASCII_s, ASCII_p, ASCII_a, ASCII_c, ASCII_e,
|
||||
'\0'};
|
||||
|
||||
|
|
@ -10,7 +10,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
/* To avoid warnings about unused functions: */
|
||||
#if ! defined(HAVE_ARC4RANDOM_BUF) && ! defined(HAVE_ARC4RANDOM)
|
||||
|
||||
@@ -957,9 +959,13 @@ ENTROPY_DEBUG(const char *label, unsigne
|
||||
@@ -1210,9 +1212,13 @@ ENTROPY_DEBUG(const char *label, unsigned long entropy) {
|
||||
}
|
||||
return entropy;
|
||||
}
|
||||
|
|
@ -24,7 +24,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
unsigned long entropy;
|
||||
(void)parser;
|
||||
|
||||
@@ -999,6 +1005,10 @@ generate_hash_secret_salt(XML_Parser par
|
||||
@@ -1252,6 +1258,10 @@ generate_hash_secret_salt(XML_Parser parser) {
|
||||
entropy * (unsigned long)2305843009213693951ULL);
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
||||
--- a/expat/lib/xmlparse.c
|
||||
+++ b/expat/lib/xmlparse.c
|
||||
@@ -2328,6 +2328,10 @@ XML_ResumeParser(XML_Parser parser) {
|
||||
@@ -2536,6 +2536,10 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal) {
|
||||
XmlUpdatePosition(parser->m_encoding, parser->m_positionPtr,
|
||||
parser->m_bufferPtr, &parser->m_position);
|
||||
parser->m_positionPtr = parser->m_bufferPtr;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
||||
--- a/expat/lib/xmlparse.c
|
||||
+++ b/expat/lib/xmlparse.c
|
||||
@@ -2357,7 +2357,13 @@ XML_GetCurrentByteIndex(XML_Parser parse
|
||||
@@ -2780,7 +2780,13 @@ XML_GetCurrentByteIndex(XML_Parser parser) {
|
||||
if (parser->m_eventPtr)
|
||||
return (XML_Index)(parser->m_parseEndByteIndex
|
||||
- (parser->m_parseEndPtr - parser->m_eventPtr));
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
||||
--- a/expat/lib/xmlparse.c
|
||||
+++ b/expat/lib/xmlparse.c
|
||||
@@ -491,6 +491,13 @@ static enum XML_Error doProlog(XML_Parse
|
||||
@@ -511,6 +511,13 @@ static enum XML_Error doProlog(XML_Parser parser, const ENCODING *enc,
|
||||
enum XML_Account account);
|
||||
static enum XML_Error processInternalEntity(XML_Parser parser, ENTITY *entity,
|
||||
XML_Bool betweenDecl);
|
||||
static enum XML_Error processEntity(XML_Parser parser, ENTITY *entity,
|
||||
XML_Bool betweenDecl, enum EntityType type);
|
||||
+/* BEGIN MOZILLA CHANGE (Bug 1746996 - Ensure that storeRawNames is always called) */
|
||||
+static enum XML_Error doContentInternal(XML_Parser parser, int startTagLevel,
|
||||
+ const ENCODING *enc, const char *start,
|
||||
|
|
@ -15,10 +15,10 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
static enum XML_Error doContent(XML_Parser parser, int startTagLevel,
|
||||
const ENCODING *enc, const char *start,
|
||||
const char *end, const char **endPtr,
|
||||
@@ -2756,10 +2763,14 @@ contentProcessor(XML_Parser parser, cons
|
||||
enum XML_Error result = doContent(
|
||||
parser, 0, parser->m_encoding, start, end, endPtr,
|
||||
(XML_Bool)! parser->m_parsingStatus.finalBuffer, XML_ACCOUNT_DIRECT);
|
||||
@@ -3210,10 +3217,14 @@ contentProcessor(XML_Parser parser, const char *start, const char *end,
|
||||
parser, parser->m_parentParser ? 1 : 0, parser->m_encoding, start, end,
|
||||
endPtr, (XML_Bool)! parser->m_parsingStatus.finalBuffer,
|
||||
XML_ACCOUNT_DIRECT);
|
||||
+/* BEGIN MOZILLA CHANGE (Bug 1746996 - Ensure that storeRawNames is always called) */
|
||||
+#if 0
|
||||
if (result == XML_ERROR_NONE) {
|
||||
|
|
@ -30,38 +30,36 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
return result;
|
||||
}
|
||||
|
||||
@@ -2872,6 +2883,24 @@ externalEntityContentProcessor(XML_Parse
|
||||
@@ -3331,10 +3342,14 @@ externalEntityContentProcessor(XML_Parser parser, const char *start,
|
||||
= doContent(parser, 1, parser->m_encoding, start, end, endPtr,
|
||||
(XML_Bool)! parser->m_parsingStatus.finalBuffer,
|
||||
XML_ACCOUNT_ENTITY_EXPANSION);
|
||||
+/* BEGIN MOZILLA CHANGE (Bug 1746996 - Ensure that storeRawNames is always called) */
|
||||
+#if 0
|
||||
if (result == XML_ERROR_NONE) {
|
||||
if (! storeRawNames(parser))
|
||||
return XML_ERROR_NO_MEMORY;
|
||||
}
|
||||
+#endif
|
||||
+/* END MOZILLA CHANGE */
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -3342,6 +3357,21 @@ static enum XML_Error
|
||||
doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
|
||||
const char *s, const char *end, const char **nextPtr,
|
||||
XML_Bool haveMore, enum XML_Account account) {
|
||||
+/* BEGIN MOZILLA CHANGE (Bug 1746996 - Ensure that storeRawNames is always called) */
|
||||
+ enum XML_Error result = doContentInternal(parser, startTagLevel, enc, s, end,
|
||||
+ nextPtr, haveMore, account);
|
||||
+ if (result == XML_ERROR_NONE) {
|
||||
+ if (! storeRawNames(parser))
|
||||
+ return XML_ERROR_NO_MEMORY;
|
||||
+ }
|
||||
+#endif
|
||||
+/* END MOZILLA CHANGE */
|
||||
+ return result;
|
||||
+}
|
||||
+
|
||||
+static enum XML_Error
|
||||
+doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
|
||||
+ const char *s, const char *end, const char **nextPtr,
|
||||
+ XML_Bool haveMore, enum XML_Account account) {
|
||||
+/* BEGIN MOZILLA CHANGE (Bug 1746996 - Ensure that storeRawNames is always called) */
|
||||
+ enum XML_Error result = doContentInternal(parser, startTagLevel, enc, s, end,
|
||||
+ nextPtr, haveMore, account);
|
||||
if (result == XML_ERROR_NONE) {
|
||||
if (! storeRawNames(parser))
|
||||
return XML_ERROR_NO_MEMORY;
|
||||
@@ -2880,9 +2909,10 @@ externalEntityContentProcessor(XML_Parse
|
||||
}
|
||||
|
||||
static enum XML_Error
|
||||
-doContent(XML_Parser parser, int startTagLevel, const ENCODING *enc,
|
||||
- const char *s, const char *end, const char **nextPtr,
|
||||
- XML_Bool haveMore, enum XML_Account account) {
|
||||
+doContentInternal(XML_Parser parser, int startTagLevel, const ENCODING *enc,
|
||||
+ const char *s, const char *end, const char **nextPtr,
|
||||
+ XML_Bool haveMore, enum XML_Account account) {
|
||||
|
|
@ -69,18 +67,3 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
/* save one level of indirection */
|
||||
DTD *const dtd = parser->m_dtd;
|
||||
|
||||
@@ -6038,10 +6068,14 @@ internalEntityProcessor(XML_Parser parse
|
||||
parser->m_encoding, s, end, nextPtr,
|
||||
(XML_Bool)! parser->m_parsingStatus.finalBuffer,
|
||||
XML_ACCOUNT_DIRECT);
|
||||
+/* BEGIN MOZILLA CHANGE (Bug 1746996 - Ensure that storeRawNames is always called) */
|
||||
+#if 0
|
||||
if (result == XML_ERROR_NONE) {
|
||||
if (! storeRawNames(parser))
|
||||
return XML_ERROR_NO_MEMORY;
|
||||
}
|
||||
+#endif
|
||||
+/* END MOZILLA CHANGE */
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
||||
--- a/expat/lib/xmlparse.c
|
||||
+++ b/expat/lib/xmlparse.c
|
||||
@@ -2680,6 +2680,13 @@ MOZ_XML_GetMismatchedTag(XML_Parser pars
|
||||
}
|
||||
/* END MOZILLA CHANGE */
|
||||
|
||||
+/* BEGIN MOZILLA CHANGE (Report whether the parser is currently expanding an entity) */
|
||||
+XML_Bool XMLCALL
|
||||
+MOZ_XML_ProcessingEntityValue(XML_Parser parser) {
|
||||
+ return parser->m_openInternalEntities != NULL;
|
||||
+}
|
||||
+/* END MOZILLA CHANGE */
|
||||
+
|
||||
XML_Bool XMLCALL
|
||||
XML_SetReparseDeferralEnabled(XML_Parser parser, XML_Bool enabled) {
|
||||
if (parser != NULL && (enabled == XML_TRUE || enabled == XML_FALSE)) {
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
||||
--- a/expat/lib/xmlparse.c
|
||||
+++ b/expat/lib/xmlparse.c
|
||||
@@ -3028,9 +3028,15 @@ doContentInternal(XML_Parser parser, int
|
||||
@@ -3487,9 +3487,15 @@ doContentInternal(XML_Parser parser, int startTagLevel, const ENCODING *enc,
|
||||
} else if (! entity) {
|
||||
if (parser->m_skippedEntityHandler)
|
||||
parser->m_skippedEntityHandler(parser->m_handlerArg, name, 0);
|
||||
|
|
@ -17,7 +17,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
}
|
||||
if (entity->open)
|
||||
return XML_ERROR_RECURSIVE_ENTITY_REF;
|
||||
@@ -6229,7 +6235,13 @@ appendAttributeValue(XML_Parser parser,
|
||||
@@ -6785,7 +6791,13 @@ appendAttributeValue(XML_Parser parser, const ENCODING *enc, XML_Bool isCdata,
|
||||
if ((pool == &parser->m_tempPool) && parser->m_defaultHandler)
|
||||
reportDefault(parser, enc, ptr, next);
|
||||
*/
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
||||
--- a/expat/lib/xmlparse.c
|
||||
+++ b/expat/lib/xmlparse.c
|
||||
@@ -3458,6 +3458,9 @@ storeAtts(XML_Parser parser, const ENCOD
|
||||
@@ -3929,6 +3929,9 @@ storeAtts(XML_Parser parser, const ENCODING *enc, const char *attStr,
|
||||
int n;
|
||||
XML_Char *uri;
|
||||
int nPrefixes = 0;
|
||||
|
|
@ -11,7 +11,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
BINDING *binding;
|
||||
const XML_Char *localPart;
|
||||
|
||||
@@ -3615,7 +3618,15 @@ storeAtts(XML_Parser parser, const ENCOD
|
||||
@@ -4086,7 +4089,15 @@ storeAtts(XML_Parser parser, const ENCODING *enc, const char *attStr,
|
||||
appAtts[attIndex], bindingsPtr);
|
||||
if (result)
|
||||
return result;
|
||||
|
|
@ -27,7 +27,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
} else {
|
||||
/* deal with other prefixed names later */
|
||||
attIndex++;
|
||||
@@ -3647,6 +3658,12 @@ storeAtts(XML_Parser parser, const ENCOD
|
||||
@@ -4118,6 +4129,12 @@ storeAtts(XML_Parser parser, const ENCODING *enc, const char *attStr,
|
||||
da->value, bindingsPtr);
|
||||
if (result)
|
||||
return result;
|
||||
|
|
@ -40,7 +40,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
} else {
|
||||
(da->id->name)[-1] = 2;
|
||||
nPrefixes++;
|
||||
@@ -3665,7 +3682,13 @@ storeAtts(XML_Parser parser, const ENCOD
|
||||
@@ -4136,7 +4153,13 @@ storeAtts(XML_Parser parser, const ENCODING *enc, const char *attStr,
|
||||
/* expand prefixed attribute names, check for duplicates,
|
||||
and clear flags that say whether attributes were specified */
|
||||
i = 0;
|
||||
|
|
@ -51,10 +51,10 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
+ if (nPrefixes || nXMLNSDeclarations) {
|
||||
+#endif
|
||||
+/* END MOZILLA CHANGE */
|
||||
int j; /* hash table index */
|
||||
unsigned int j; /* hash table index */
|
||||
unsigned long version = parser->m_nsAttsVersion;
|
||||
|
||||
@@ -3675,6 +3698,9 @@ storeAtts(XML_Parser parser, const ENCOD
|
||||
@@ -4146,6 +4169,9 @@ storeAtts(XML_Parser parser, const ENCODING *enc, const char *attStr,
|
||||
}
|
||||
|
||||
unsigned int nsAttsSize = 1u << parser->m_nsAttsPower;
|
||||
|
|
@ -64,7 +64,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
unsigned char oldNsAttsPower = parser->m_nsAttsPower;
|
||||
/* size of hash table must be at least 2 * (# of prefixed attributes) */
|
||||
if ((nPrefixes << 1)
|
||||
@@ -3724,6 +3750,9 @@ storeAtts(XML_Parser parser, const ENCOD
|
||||
@@ -4194,6 +4220,9 @@ storeAtts(XML_Parser parser, const ENCODING *enc, const char *attStr,
|
||||
parser->m_nsAtts[--j].version = version;
|
||||
}
|
||||
parser->m_nsAttsVersion = --version;
|
||||
|
|
@ -74,7 +74,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
|
||||
/* expand prefixed names and check for duplicates */
|
||||
for (; i < attIndex; i += 2) {
|
||||
@@ -3823,10 +3852,63 @@ storeAtts(XML_Parser parser, const ENCOD
|
||||
@@ -4293,10 +4322,63 @@ storeAtts(XML_Parser parser, const ENCODING *enc, const char *attStr,
|
||||
parser->m_nsAtts[j].hash = uriHash;
|
||||
parser->m_nsAtts[j].uriName = s;
|
||||
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
||||
--- a/expat/lib/xmlparse.c
|
||||
+++ b/expat/lib/xmlparse.c
|
||||
@@ -5752,7 +5752,13 @@ doProlog(XML_Parser parser, const ENCODI
|
||||
@@ -6227,7 +6227,13 @@ doProlog(XML_Parser parser, const ENCODING *enc, const char *s, const char *end,
|
||||
entity->open = XML_TRUE;
|
||||
entityTrackingOnOpen(parser, entity, __LINE__);
|
||||
if (! parser->m_externalEntityRefHandler(
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
diff --git a/expat/lib/xmltok.c b/expat/lib/xmltok.c
|
||||
--- a/expat/lib/xmltok.c
|
||||
+++ b/expat/lib/xmltok.c
|
||||
@@ -1148,6 +1148,10 @@ static const char KW_yes[] = {ASCII_y, A
|
||||
@@ -1148,6 +1148,10 @@ static const char KW_yes[] = {ASCII_y, ASCII_e, ASCII_s, '\0'};
|
||||
|
||||
static const char KW_no[] = {ASCII_n, ASCII_o, '\0'};
|
||||
|
||||
|
|
@ -12,7 +12,7 @@ diff --git a/expat/lib/xmltok.c b/expat/lib/xmltok.c
|
|||
static int
|
||||
doParseXmlDecl(const ENCODING *(*encodingFinder)(const ENCODING *, const char *,
|
||||
const char *),
|
||||
@@ -1175,6 +1179,13 @@ doParseXmlDecl(const ENCODING *(*encodin
|
||||
@@ -1175,6 +1179,13 @@ doParseXmlDecl(const ENCODING *(*encodingFinder)(const ENCODING *, const char *,
|
||||
*versionPtr = val;
|
||||
if (versionEndPtr)
|
||||
*versionEndPtr = ptr;
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
||||
--- a/expat/lib/xmlparse.c
|
||||
+++ b/expat/lib/xmlparse.c
|
||||
@@ -6085,7 +6085,29 @@ processInternalEntity(XML_Parser parser,
|
||||
entityTrackingOnClose(parser, entity, __LINE__);
|
||||
#endif /* XML_GE == 1 */
|
||||
entity->open = XML_FALSE;
|
||||
+/* BEGIN MOZILLA CHANGE (Bug 569229 - Deal with parser interruption from nested entities) */
|
||||
+#if 0
|
||||
parser->m_openInternalEntities = openEntity->next;
|
||||
+#else
|
||||
+ if (parser->m_openInternalEntities == openEntity) {
|
||||
+ parser->m_openInternalEntities = openEntity->next;
|
||||
+ }
|
||||
+ else {
|
||||
+ /* openEntity should be closed, but it contains an inner entity that is
|
||||
+ still open. Remove openEntity from the m_openInternalEntities linked
|
||||
+ list by looking for the inner entity in the list that links to
|
||||
+ openEntity and fixing up its 'next' member
|
||||
+ */
|
||||
+ OPEN_INTERNAL_ENTITY *innerOpenEntity = parser->m_openInternalEntities;
|
||||
+ do {
|
||||
+ if (innerOpenEntity->next == openEntity) {
|
||||
+ innerOpenEntity->next = openEntity->next;
|
||||
+ break;
|
||||
+ }
|
||||
+ } while ((innerOpenEntity = innerOpenEntity->next));
|
||||
+ }
|
||||
+#endif
|
||||
+/* END MOZILLA CHANGE */
|
||||
/* put openEntity back in list of free instances */
|
||||
openEntity->next = parser->m_freeInternalEntities;
|
||||
parser->m_freeInternalEntities = openEntity;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
||||
--- a/expat/lib/xmlparse.c
|
||||
+++ b/expat/lib/xmlparse.c
|
||||
@@ -444,16 +444,24 @@ typedef unsigned long long XmlBigCount;
|
||||
@@ -456,24 +456,36 @@ typedef unsigned long long XmlBigCount;
|
||||
typedef struct accounting {
|
||||
XmlBigCount countBytesDirect;
|
||||
XmlBigCount countBytesIndirect;
|
||||
|
|
@ -14,6 +14,18 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
unsigned long long activationThresholdBytes;
|
||||
} ACCOUNTING;
|
||||
|
||||
typedef struct MALLOC_TRACKER {
|
||||
XmlBigCount bytesAllocated;
|
||||
+/* BEGIN MOZILLA CHANGE (don't report debug information) */
|
||||
+# if 0
|
||||
XmlBigCount peakBytesAllocated; // updated live only for debug level >=2
|
||||
unsigned long debugLevel;
|
||||
+#endif
|
||||
+/* END MOZILLA CHANGE */
|
||||
float maximumAmplificationFactor; // >=1.0
|
||||
XmlBigCount activationThresholdBytes;
|
||||
} MALLOC_TRACKER;
|
||||
|
||||
typedef struct entity_stats {
|
||||
+/* BEGIN MOZILLA CHANGE (don't report debug information) */
|
||||
+#if 0
|
||||
|
|
@ -26,7 +38,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
} ENTITY_STATS;
|
||||
#endif /* XML_GE == 1 */
|
||||
|
||||
@@ -611,18 +619,26 @@ static void parserInit(XML_Parser parser
|
||||
@@ -632,18 +644,26 @@ static void parserInit(XML_Parser parser, const XML_Char *encodingName);
|
||||
static float accountingGetCurrentAmplification(XML_Parser rootParser);
|
||||
static void accountingReportStats(XML_Parser originParser, const char *epilog);
|
||||
static void accountingOnAbort(XML_Parser originParser);
|
||||
|
|
@ -53,9 +65,9 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
static void entityTrackingOnOpen(XML_Parser parser, ENTITY *entity,
|
||||
int sourceLine);
|
||||
static void entityTrackingOnClose(XML_Parser parser, ENTITY *entity,
|
||||
@@ -632,8 +648,12 @@ static XML_Parser getRootParserOf(XML_Pa
|
||||
@@ -653,8 +673,12 @@ static void entityTrackingOnClose(XML_Parser parser, ENTITY *entity,
|
||||
static XML_Parser getRootParserOf(XML_Parser parser,
|
||||
unsigned int *outLevelDiff);
|
||||
#endif /* XML_GE == 1 */
|
||||
|
||||
+/* BEGIN MOZILLA CHANGE (don't report debug information) */
|
||||
+#if 0
|
||||
|
|
@ -66,7 +78,123 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
|
||||
#define poolStart(pool) ((pool)->start)
|
||||
#define poolLength(pool) ((pool)->ptr - (pool)->start)
|
||||
@@ -1292,15 +1312,23 @@ parserInit(XML_Parser parser, const XML_
|
||||
@@ -814,6 +838,8 @@ struct XML_ParserStruct {
|
||||
#endif
|
||||
|
||||
#if XML_GE == 1
|
||||
+/* BEGIN MOZILLA CHANGE (don't report debug information) */
|
||||
+#if 0
|
||||
static void
|
||||
expat_heap_stat(XML_Parser rootParser, char operator, XmlBigCount absDiff,
|
||||
XmlBigCount newTotal, XmlBigCount peakTotal, int sourceLine) {
|
||||
@@ -827,6 +853,8 @@ expat_heap_stat(XML_Parser rootParser, char operator, XmlBigCount absDiff,
|
||||
(void *)rootParser, rootParser->m_accounting.countBytesDirect, operator,
|
||||
absDiff, newTotal, peakTotal, (double)amplification, sourceLine);
|
||||
}
|
||||
+#endif
|
||||
+/* END MOZILLA CHANGE */
|
||||
|
||||
static bool
|
||||
expat_heap_increase_tolerable(XML_Parser rootParser, XmlBigCount increase,
|
||||
@@ -855,9 +883,13 @@ expat_heap_increase_tolerable(XML_Parser rootParser, XmlBigCount increase,
|
||||
}
|
||||
}
|
||||
|
||||
+/* BEGIN MOZILLA CHANGE (don't report debug information) */
|
||||
+#if 0
|
||||
if (! tolerable && (rootParser->m_alloc_tracker.debugLevel >= 1)) {
|
||||
expat_heap_stat(rootParser, '+', increase, newTotal, newTotal, sourceLine);
|
||||
}
|
||||
+#endif
|
||||
+/* END MOZILLA CHANGE */
|
||||
|
||||
return tolerable;
|
||||
}
|
||||
@@ -901,6 +933,8 @@ expat_malloc(XML_Parser parser, size_t size, int sourceLine) {
|
||||
// Update accounting
|
||||
rootParser->m_alloc_tracker.bytesAllocated += bytesToAllocate;
|
||||
|
||||
+/* BEGIN MOZILLA CHANGE (don't report debug information) */
|
||||
+#if 0
|
||||
// Report as needed
|
||||
if (rootParser->m_alloc_tracker.debugLevel >= 2) {
|
||||
if (rootParser->m_alloc_tracker.bytesAllocated
|
||||
@@ -912,6 +946,8 @@ expat_malloc(XML_Parser parser, size_t size, int sourceLine) {
|
||||
rootParser->m_alloc_tracker.bytesAllocated,
|
||||
rootParser->m_alloc_tracker.peakBytesAllocated, sourceLine);
|
||||
}
|
||||
+#endif
|
||||
+/* END MOZILLA CHANGE */
|
||||
|
||||
return (char *)mallocedPtr + sizeof(size_t) + EXPAT_MALLOC_PADDING;
|
||||
}
|
||||
@@ -941,12 +977,16 @@ expat_free(XML_Parser parser, void *ptr, int sourceLine) {
|
||||
assert(rootParser->m_alloc_tracker.bytesAllocated >= bytesAllocated);
|
||||
rootParser->m_alloc_tracker.bytesAllocated -= bytesAllocated;
|
||||
|
||||
+/* BEGIN MOZILLA CHANGE (don't report debug information) */
|
||||
+#if 0
|
||||
// Report as needed
|
||||
if (rootParser->m_alloc_tracker.debugLevel >= 2) {
|
||||
expat_heap_stat(rootParser, '-', bytesAllocated,
|
||||
rootParser->m_alloc_tracker.bytesAllocated,
|
||||
rootParser->m_alloc_tracker.peakBytesAllocated, sourceLine);
|
||||
}
|
||||
+#endif
|
||||
+/* END MOZILLA CHANGE */
|
||||
|
||||
// NOTE: This may be freeing rootParser, so freeing has to come last
|
||||
parser->m_mem.free_fcn(mallocedPtr);
|
||||
@@ -1011,6 +1051,8 @@ expat_realloc(XML_Parser parser, void *ptr, size_t size, int sourceLine) {
|
||||
rootParser->m_alloc_tracker.bytesAllocated -= absDiff;
|
||||
}
|
||||
|
||||
+/* BEGIN MOZILLA CHANGE (don't report debug information) */
|
||||
+#if 0
|
||||
// Report as needed
|
||||
if (rootParser->m_alloc_tracker.debugLevel >= 2) {
|
||||
if (rootParser->m_alloc_tracker.bytesAllocated
|
||||
@@ -1022,6 +1064,8 @@ expat_realloc(XML_Parser parser, void *ptr, size_t size, int sourceLine) {
|
||||
rootParser->m_alloc_tracker.bytesAllocated,
|
||||
rootParser->m_alloc_tracker.peakBytesAllocated, sourceLine);
|
||||
}
|
||||
+#endif
|
||||
+/* END MOZILLA CHANGE */
|
||||
|
||||
// Update in-block recorded size
|
||||
*(size_t *)mallocedPtr = size;
|
||||
@@ -1431,8 +1475,12 @@ parserCreate(const XML_Char *encodingName,
|
||||
// Initialize .m_alloc_tracker
|
||||
memset(&parser->m_alloc_tracker, 0, sizeof(MALLOC_TRACKER));
|
||||
if (parentParser == NULL) {
|
||||
+/* BEGIN MOZILLA CHANGE (don't report debug information) */
|
||||
+#if 0
|
||||
parser->m_alloc_tracker.debugLevel
|
||||
= getDebugLevel("EXPAT_MALLOC_DEBUG", 0u);
|
||||
+#endif
|
||||
+/* END MOZILLA CHANGE */
|
||||
parser->m_alloc_tracker.maximumAmplificationFactor
|
||||
= EXPAT_ALLOC_TRACKER_MAXIMUM_AMPLIFICATION_DEFAULT;
|
||||
parser->m_alloc_tracker.activationThresholdBytes
|
||||
@@ -1452,6 +1500,8 @@ parserCreate(const XML_Char *encodingName,
|
||||
assert(SIZE_MAX - rootParser->m_alloc_tracker.bytesAllocated >= increase);
|
||||
rootParser->m_alloc_tracker.bytesAllocated += increase;
|
||||
|
||||
+/* BEGIN MOZILLA CHANGE (don't report debug information) */
|
||||
+#if 0
|
||||
// Report on allocation
|
||||
if (rootParser->m_alloc_tracker.debugLevel >= 2) {
|
||||
if (rootParser->m_alloc_tracker.bytesAllocated
|
||||
@@ -1464,6 +1514,8 @@ parserCreate(const XML_Char *encodingName,
|
||||
rootParser->m_alloc_tracker.bytesAllocated,
|
||||
rootParser->m_alloc_tracker.peakBytesAllocated, __LINE__);
|
||||
}
|
||||
+#endif
|
||||
+/* END MOZILLA CHANGE */
|
||||
#else
|
||||
parser->m_parentParser = NULL;
|
||||
#endif // XML_GE == 1
|
||||
@@ -1644,15 +1696,23 @@ parserInit(XML_Parser parser, const XML_Char *encodingName) {
|
||||
|
||||
#if XML_GE == 1
|
||||
memset(&parser->m_accounting, 0, sizeof(ACCOUNTING));
|
||||
|
|
@ -90,7 +218,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
}
|
||||
|
||||
/* moves list of bindings to m_freeBindingList */
|
||||
@@ -8069,6 +8097,8 @@ accountingGetCurrentAmplification(XML_Pa
|
||||
@@ -8667,6 +8727,8 @@ accountingGetCurrentAmplification(XML_Parser rootParser) {
|
||||
|
||||
static void
|
||||
accountingReportStats(XML_Parser originParser, const char *epilog) {
|
||||
|
|
@ -99,7 +227,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
const XML_Parser rootParser = getRootParserOf(originParser, NULL);
|
||||
assert(! rootParser->m_parentParser);
|
||||
|
||||
@@ -8084,6 +8114,8 @@ accountingReportStats(XML_Parser originP
|
||||
@@ -8682,6 +8744,8 @@ accountingReportStats(XML_Parser originParser, const char *epilog) {
|
||||
(void *)rootParser, rootParser->m_accounting.countBytesDirect,
|
||||
rootParser->m_accounting.countBytesIndirect,
|
||||
(double)amplificationFactor, epilog);
|
||||
|
|
@ -108,7 +236,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
}
|
||||
|
||||
static void
|
||||
@@ -8091,6 +8123,8 @@ accountingOnAbort(XML_Parser originParse
|
||||
@@ -8689,6 +8753,8 @@ accountingOnAbort(XML_Parser originParser) {
|
||||
accountingReportStats(originParser, " ABORTING\n");
|
||||
}
|
||||
|
||||
|
|
@ -117,7 +245,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
static void
|
||||
accountingReportDiff(XML_Parser rootParser,
|
||||
unsigned int levelsAwayFromRootParser, const char *before,
|
||||
@@ -8127,6 +8161,8 @@ accountingReportDiff(XML_Parser rootPars
|
||||
@@ -8725,6 +8791,8 @@ accountingReportDiff(XML_Parser rootParser,
|
||||
}
|
||||
fprintf(stderr, "\"\n");
|
||||
}
|
||||
|
|
@ -126,7 +254,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
|
||||
static XML_Bool
|
||||
accountingDiffTolerated(XML_Parser originParser, int tok, const char *before,
|
||||
@@ -8174,11 +8210,15 @@ accountingDiffTolerated(XML_Parser origi
|
||||
@@ -8772,11 +8840,15 @@ accountingDiffTolerated(XML_Parser originParser, int tok, const char *before,
|
||||
|| (amplificationFactor
|
||||
<= rootParser->m_accounting.maximumAmplificationFactor);
|
||||
|
||||
|
|
@ -142,7 +270,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
|
||||
return tolerated;
|
||||
}
|
||||
@@ -8197,6 +8237,8 @@ testingAccountingGetCountBytesIndirect(X
|
||||
@@ -8795,6 +8867,8 @@ testingAccountingGetCountBytesIndirect(XML_Parser parser) {
|
||||
return parser->m_accounting.countBytesIndirect;
|
||||
}
|
||||
|
||||
|
|
@ -151,7 +279,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
static void
|
||||
entityTrackingReportStats(XML_Parser rootParser, ENTITY *entity,
|
||||
const char *action, int sourceLine) {
|
||||
@@ -8220,9 +8262,13 @@ entityTrackingReportStats(XML_Parser roo
|
||||
@@ -8818,9 +8892,13 @@ entityTrackingReportStats(XML_Parser rootParser, ENTITY *entity,
|
||||
entity->is_param ? "%" : "&", entityName, action, entity->textLen,
|
||||
sourceLine);
|
||||
}
|
||||
|
|
@ -165,7 +293,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
const XML_Parser rootParser = getRootParserOf(originParser, NULL);
|
||||
assert(! rootParser->m_parentParser);
|
||||
|
||||
@@ -8234,15 +8280,21 @@ entityTrackingOnOpen(XML_Parser originPa
|
||||
@@ -8832,15 +8910,21 @@ entityTrackingOnOpen(XML_Parser originParser, ENTITY *entity, int sourceLine) {
|
||||
}
|
||||
|
||||
entityTrackingReportStats(rootParser, entity, "OPEN ", sourceLine);
|
||||
|
|
@ -186,19 +314,19 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
+/* END MOZILLA CHANGE */
|
||||
}
|
||||
|
||||
static XML_Parser
|
||||
@@ -8260,6 +8312,8 @@ getRootParserOf(XML_Parser parser, unsig
|
||||
return rootParser;
|
||||
}
|
||||
#endif /* XML_GE == 1 */
|
||||
@@ -8862,6 +8946,8 @@ getRootParserOf(XML_Parser parser, unsigned int *outLevelDiff) {
|
||||
|
||||
#if XML_GE == 1
|
||||
|
||||
+/* BEGIN MOZILLA CHANGE (don't report debug information) */
|
||||
+#if 0
|
||||
const char *
|
||||
unsignedCharToPrintable(unsigned char c) {
|
||||
switch (c) {
|
||||
@@ -8781,9 +8835,13 @@ unsignedCharToPrintable(unsigned char c)
|
||||
}
|
||||
@@ -9385,9 +9471,13 @@ unsignedCharToPrintable(unsigned char c) {
|
||||
assert(0); /* never gets here */
|
||||
// LCOV_EXCL_STOP
|
||||
}
|
||||
+#endif
|
||||
+/* END MOZILLA CHANGE */
|
||||
|
|
@ -210,7 +338,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
static unsigned long
|
||||
getDebugLevel(const char *variableName, unsigned long defaultDebugLevel) {
|
||||
const char *const valueOrNull = getenv(variableName);
|
||||
@@ -8802,3 +8860,5 @@ getDebugLevel(const char *variableName,
|
||||
@@ -9406,3 +9496,5 @@ getDebugLevel(const char *variableName, unsigned long defaultDebugLevel) {
|
||||
|
||||
return debugLevel;
|
||||
}
|
||||
|
|
@ -1,23 +1,23 @@
|
|||
diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
||||
--- a/expat/lib/xmlparse.c
|
||||
+++ b/expat/lib/xmlparse.c
|
||||
@@ -564,8 +564,12 @@ static XML_Bool setContext(XML_Parser pa
|
||||
@@ -592,8 +592,12 @@ static XML_Bool setContext(XML_Parser parser, const XML_Char *context);
|
||||
static void FASTCALL normalizePublicId(XML_Char *s);
|
||||
|
||||
static DTD *dtdCreate(const XML_Memory_Handling_Suite *ms);
|
||||
static DTD *dtdCreate(XML_Parser parser);
|
||||
+/* BEGIN MOZILLA CHANGE (unused API) */
|
||||
+#if 0
|
||||
/* do not call if m_parentParser != NULL */
|
||||
static void dtdReset(DTD *p, const XML_Memory_Handling_Suite *ms);
|
||||
static void dtdReset(DTD *p, XML_Parser parser);
|
||||
+#endif
|
||||
+/* END MOZILLA CHANGE */
|
||||
static void dtdDestroy(DTD *p, XML_Bool isDocEntity,
|
||||
const XML_Memory_Handling_Suite *ms);
|
||||
static void dtdDestroy(DTD *p, XML_Bool isDocEntity, XML_Parser parser);
|
||||
static int dtdCopy(XML_Parser oldParser, DTD *newDtd, const DTD *oldDtd,
|
||||
@@ -576,7 +580,11 @@ static NAMED *lookup(XML_Parser parser,
|
||||
XML_Parser parser);
|
||||
@@ -602,7 +606,11 @@ static int copyEntityTable(XML_Parser oldParser, HASH_TABLE *newTable,
|
||||
static NAMED *lookup(XML_Parser parser, HASH_TABLE *table, KEY name,
|
||||
size_t createSize);
|
||||
static void FASTCALL hashTableInit(HASH_TABLE *table,
|
||||
const XML_Memory_Handling_Suite *ms);
|
||||
static void FASTCALL hashTableInit(HASH_TABLE *table, XML_Parser parser);
|
||||
+/* BEGIN MOZILLA CHANGE (unused API) */
|
||||
+#if 0
|
||||
static void FASTCALL hashTableClear(HASH_TABLE *table);
|
||||
|
|
@ -26,16 +26,16 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
static void FASTCALL hashTableDestroy(HASH_TABLE *table);
|
||||
static void FASTCALL hashTableIterInit(HASH_TABLE_ITER *iter,
|
||||
const HASH_TABLE *table);
|
||||
@@ -800,6 +808,8 @@ struct XML_ParserStruct {
|
||||
#define REALLOC(parser, p, s) (parser->m_mem.realloc_fcn((p), (s)))
|
||||
#define FREE(parser, p) (parser->m_mem.free_fcn((p)))
|
||||
@@ -1074,6 +1082,8 @@ expat_realloc(XML_Parser parser, void *ptr, size_t size, int sourceLine) {
|
||||
}
|
||||
#endif // XML_GE == 1
|
||||
|
||||
+/* BEGIN MOZILLA CHANGE (unused API) */
|
||||
+#if 0
|
||||
XML_Parser XMLCALL
|
||||
XML_ParserCreate(const XML_Char *encodingName) {
|
||||
return XML_ParserCreate_MM(encodingName, NULL, NULL);
|
||||
@@ -810,6 +820,8 @@ XML_ParserCreateNS(const XML_Char *encod
|
||||
@@ -1084,6 +1094,8 @@ XML_ParserCreateNS(const XML_Char *encodingName, XML_Char nsSep) {
|
||||
XML_Char tmp[2] = {nsSep, 0};
|
||||
return XML_ParserCreate_MM(encodingName, NULL, tmp);
|
||||
}
|
||||
|
|
@ -44,7 +44,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
|
||||
// "xml=http://www.w3.org/XML/1998/namespace"
|
||||
static const XML_Char implicitContext[]
|
||||
@@ -1331,6 +1343,8 @@ parserInit(XML_Parser parser, const XML_
|
||||
@@ -1715,6 +1727,8 @@ parserInit(XML_Parser parser, const XML_Char *encodingName) {
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -53,7 +53,25 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
/* moves list of bindings to m_freeBindingList */
|
||||
static void FASTCALL
|
||||
moveToFreeBindingList(XML_Parser parser, BINDING *bindings) {
|
||||
@@ -1409,6 +1423,8 @@ XML_SetEncoding(XML_Parser parser, const
|
||||
@@ -1784,6 +1798,8 @@ XML_ParserReset(XML_Parser parser, const XML_Char *encodingName) {
|
||||
dtdReset(parser->m_dtd, parser);
|
||||
return XML_TRUE;
|
||||
}
|
||||
+#endif
|
||||
+/* END MOZILLA CHANGE */
|
||||
|
||||
static XML_Bool
|
||||
parserBusy(XML_Parser parser) {
|
||||
@@ -1798,6 +1814,8 @@ parserBusy(XML_Parser parser) {
|
||||
}
|
||||
}
|
||||
|
||||
+/* BEGIN MOZILLA CHANGE (unused API) */
|
||||
+#if 0
|
||||
enum XML_Status XMLCALL
|
||||
XML_SetEncoding(XML_Parser parser, const XML_Char *encodingName) {
|
||||
if (parser == NULL)
|
||||
@@ -1823,6 +1841,8 @@ XML_SetEncoding(XML_Parser parser, const XML_Char *encodingName) {
|
||||
}
|
||||
return XML_STATUS_OK;
|
||||
}
|
||||
|
|
@ -62,7 +80,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
|
||||
XML_Parser XMLCALL
|
||||
XML_ExternalEntityParserCreate(XML_Parser oldParser, const XML_Char *context,
|
||||
@@ -1665,6 +1681,8 @@ XML_UseParserAsHandlerArg(XML_Parser par
|
||||
@@ -2109,6 +2129,8 @@ XML_UseParserAsHandlerArg(XML_Parser parser) {
|
||||
parser->m_handlerArg = parser;
|
||||
}
|
||||
|
||||
|
|
@ -71,7 +89,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
enum XML_Error XMLCALL
|
||||
XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD) {
|
||||
if (parser == NULL)
|
||||
@@ -1681,6 +1699,8 @@ XML_UseForeignDTD(XML_Parser parser, XML
|
||||
@@ -2124,6 +2146,8 @@ XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD) {
|
||||
return XML_ERROR_FEATURE_REQUIRES_XML_DTD;
|
||||
#endif
|
||||
}
|
||||
|
|
@ -80,7 +98,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
|
||||
void XMLCALL
|
||||
XML_SetReturnNSTriplet(XML_Parser parser, int do_nst) {
|
||||
@@ -1756,6 +1776,8 @@ XML_SetElementHandler(XML_Parser parser,
|
||||
@@ -2198,6 +2222,8 @@ XML_SetElementHandler(XML_Parser parser, XML_StartElementHandler start,
|
||||
parser->m_endElementHandler = end;
|
||||
}
|
||||
|
||||
|
|
@ -89,7 +107,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
void XMLCALL
|
||||
XML_SetStartElementHandler(XML_Parser parser, XML_StartElementHandler start) {
|
||||
if (parser != NULL)
|
||||
@@ -1767,6 +1789,8 @@ XML_SetEndElementHandler(XML_Parser pars
|
||||
@@ -2209,6 +2235,8 @@ XML_SetEndElementHandler(XML_Parser parser, XML_EndElementHandler end) {
|
||||
if (parser != NULL)
|
||||
parser->m_endElementHandler = end;
|
||||
}
|
||||
|
|
@ -98,7 +116,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
|
||||
void XMLCALL
|
||||
XML_SetCharacterDataHandler(XML_Parser parser,
|
||||
@@ -1798,6 +1822,8 @@ XML_SetCdataSectionHandler(XML_Parser pa
|
||||
@@ -2240,6 +2268,8 @@ XML_SetCdataSectionHandler(XML_Parser parser,
|
||||
parser->m_endCdataSectionHandler = end;
|
||||
}
|
||||
|
||||
|
|
@ -107,7 +125,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
void XMLCALL
|
||||
XML_SetStartCdataSectionHandler(XML_Parser parser,
|
||||
XML_StartCdataSectionHandler start) {
|
||||
@@ -1819,6 +1845,8 @@ XML_SetDefaultHandler(XML_Parser parser,
|
||||
@@ -2261,6 +2291,8 @@ XML_SetDefaultHandler(XML_Parser parser, XML_DefaultHandler handler) {
|
||||
parser->m_defaultHandler = handler;
|
||||
parser->m_defaultExpandInternalEntities = XML_FALSE;
|
||||
}
|
||||
|
|
@ -116,7 +134,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
|
||||
void XMLCALL
|
||||
XML_SetDefaultHandlerExpand(XML_Parser parser, XML_DefaultHandler handler) {
|
||||
@@ -1837,6 +1865,8 @@ XML_SetDoctypeDeclHandler(XML_Parser par
|
||||
@@ -2279,6 +2311,8 @@ XML_SetDoctypeDeclHandler(XML_Parser parser, XML_StartDoctypeDeclHandler start,
|
||||
parser->m_endDoctypeDeclHandler = end;
|
||||
}
|
||||
|
||||
|
|
@ -125,7 +143,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
void XMLCALL
|
||||
XML_SetStartDoctypeDeclHandler(XML_Parser parser,
|
||||
XML_StartDoctypeDeclHandler start) {
|
||||
@@ -1849,6 +1879,8 @@ XML_SetEndDoctypeDeclHandler(XML_Parser
|
||||
@@ -2291,6 +2325,8 @@ XML_SetEndDoctypeDeclHandler(XML_Parser parser, XML_EndDoctypeDeclHandler end) {
|
||||
if (parser != NULL)
|
||||
parser->m_endDoctypeDeclHandler = end;
|
||||
}
|
||||
|
|
@ -134,7 +152,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
|
||||
void XMLCALL
|
||||
XML_SetUnparsedEntityDeclHandler(XML_Parser parser,
|
||||
@@ -1873,6 +1905,8 @@ XML_SetNamespaceDeclHandler(XML_Parser p
|
||||
@@ -2315,6 +2351,8 @@ XML_SetNamespaceDeclHandler(XML_Parser parser,
|
||||
parser->m_endNamespaceDeclHandler = end;
|
||||
}
|
||||
|
||||
|
|
@ -143,7 +161,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
void XMLCALL
|
||||
XML_SetStartNamespaceDeclHandler(XML_Parser parser,
|
||||
XML_StartNamespaceDeclHandler start) {
|
||||
@@ -1893,6 +1927,8 @@ XML_SetNotStandaloneHandler(XML_Parser p
|
||||
@@ -2335,6 +2373,8 @@ XML_SetNotStandaloneHandler(XML_Parser parser,
|
||||
if (parser != NULL)
|
||||
parser->m_notStandaloneHandler = handler;
|
||||
}
|
||||
|
|
@ -152,7 +170,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
|
||||
void XMLCALL
|
||||
XML_SetExternalEntityRefHandler(XML_Parser parser,
|
||||
@@ -1911,6 +1947,8 @@ XML_SetExternalEntityRefHandlerArg(XML_P
|
||||
@@ -2353,6 +2393,8 @@ XML_SetExternalEntityRefHandlerArg(XML_Parser parser, void *arg) {
|
||||
parser->m_externalEntityRefHandlerArg = parser;
|
||||
}
|
||||
|
||||
|
|
@ -161,7 +179,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
void XMLCALL
|
||||
XML_SetSkippedEntityHandler(XML_Parser parser,
|
||||
XML_SkippedEntityHandler handler) {
|
||||
@@ -1944,6 +1982,8 @@ XML_SetEntityDeclHandler(XML_Parser pars
|
||||
@@ -2386,6 +2428,8 @@ XML_SetEntityDeclHandler(XML_Parser parser, XML_EntityDeclHandler handler) {
|
||||
if (parser != NULL)
|
||||
parser->m_entityDeclHandler = handler;
|
||||
}
|
||||
|
|
@ -170,7 +188,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
|
||||
void XMLCALL
|
||||
XML_SetXmlDeclHandler(XML_Parser parser, XML_XmlDeclHandler handler) {
|
||||
@@ -2401,6 +2441,8 @@ XML_GetCurrentByteIndex(XML_Parser parse
|
||||
@@ -2856,6 +2900,8 @@ XML_GetCurrentByteIndex(XML_Parser parser) {
|
||||
/* END MOZILLA CHANGE */
|
||||
}
|
||||
|
||||
|
|
@ -179,7 +197,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
int XMLCALL
|
||||
XML_GetCurrentByteCount(XML_Parser parser) {
|
||||
if (parser == NULL)
|
||||
@@ -2429,6 +2471,8 @@ XML_GetInputContext(XML_Parser parser, i
|
||||
@@ -2884,6 +2930,8 @@ XML_GetInputContext(XML_Parser parser, int *offset, int *size) {
|
||||
#endif /* XML_CONTEXT_BYTES > 0 */
|
||||
return (const char *)0;
|
||||
}
|
||||
|
|
@ -188,7 +206,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
|
||||
XML_Size XMLCALL
|
||||
XML_GetCurrentLineNumber(XML_Parser parser) {
|
||||
@@ -2454,6 +2498,8 @@ XML_GetCurrentColumnNumber(XML_Parser pa
|
||||
@@ -2909,6 +2957,8 @@ XML_GetCurrentColumnNumber(XML_Parser parser) {
|
||||
return parser->m_position.columnNumber;
|
||||
}
|
||||
|
||||
|
|
@ -196,8 +214,8 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
+#if 0
|
||||
void XMLCALL
|
||||
XML_FreeContentModel(XML_Parser parser, XML_Content *model) {
|
||||
if (parser != NULL)
|
||||
@@ -2682,6 +2728,8 @@ XML_GetFeatureList(void) {
|
||||
if (parser == NULL)
|
||||
@@ -3159,6 +3209,8 @@ XML_GetFeatureList(void) {
|
||||
|
||||
return features;
|
||||
}
|
||||
|
|
@ -206,16 +224,16 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
|
||||
#if XML_GE == 1
|
||||
XML_Bool XMLCALL
|
||||
@@ -7146,6 +7194,8 @@ dtdCreate(const XML_Memory_Handling_Suit
|
||||
@@ -7770,6 +7822,8 @@ dtdCreate(XML_Parser parser) {
|
||||
return p;
|
||||
}
|
||||
|
||||
+/* BEGIN MOZILLA CHANGE (unused API) */
|
||||
+#if 0
|
||||
static void
|
||||
dtdReset(DTD *p, const XML_Memory_Handling_Suite *ms) {
|
||||
dtdReset(DTD *p, XML_Parser parser) {
|
||||
HASH_TABLE_ITER iter;
|
||||
@@ -7186,6 +7236,8 @@ dtdReset(DTD *p, const XML_Memory_Handli
|
||||
@@ -7810,6 +7864,8 @@ dtdReset(DTD *p, XML_Parser parser) {
|
||||
p->hasParamEntityRefs = XML_FALSE;
|
||||
p->standalone = XML_FALSE;
|
||||
}
|
||||
|
|
@ -223,8 +241,8 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
+/* END MOZILLA CHANGE */
|
||||
|
||||
static void
|
||||
dtdDestroy(DTD *p, XML_Bool isDocEntity, const XML_Memory_Handling_Suite *ms) {
|
||||
@@ -7540,6 +7592,8 @@ lookup(XML_Parser parser, HASH_TABLE *ta
|
||||
dtdDestroy(DTD *p, XML_Bool isDocEntity, XML_Parser parser) {
|
||||
@@ -8164,6 +8220,8 @@ lookup(XML_Parser parser, HASH_TABLE *table, KEY name, size_t createSize) {
|
||||
return table->v[i];
|
||||
}
|
||||
|
||||
|
|
@ -233,7 +251,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
static void FASTCALL
|
||||
hashTableClear(HASH_TABLE *table) {
|
||||
size_t i;
|
||||
@@ -7549,6 +7603,8 @@ hashTableClear(HASH_TABLE *table) {
|
||||
@@ -8173,6 +8231,8 @@ hashTableClear(HASH_TABLE *table) {
|
||||
}
|
||||
table->used = 0;
|
||||
}
|
||||
|
|
@ -242,7 +260,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
|
||||
static void FASTCALL
|
||||
hashTableDestroy(HASH_TABLE *table) {
|
||||
@@ -8223,6 +8279,8 @@ accountingDiffTolerated(XML_Parser origi
|
||||
@@ -8853,6 +8913,8 @@ accountingDiffTolerated(XML_Parser originParser, int tok, const char *before,
|
||||
return tolerated;
|
||||
}
|
||||
|
||||
|
|
@ -251,7 +269,7 @@ diff --git a/expat/lib/xmlparse.c b/expat/lib/xmlparse.c
|
|||
unsigned long long
|
||||
testingAccountingGetCountBytesDirect(XML_Parser parser) {
|
||||
if (! parser)
|
||||
@@ -8236,6 +8294,8 @@ testingAccountingGetCountBytesIndirect(X
|
||||
@@ -8866,6 +8928,8 @@ testingAccountingGetCountBytesIndirect(XML_Parser parser) {
|
||||
return 0;
|
||||
return parser->m_accounting.countBytesIndirect;
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
Copyright (c) 1998-2000 Thai Open Source Software Center Ltd and Clark Cooper
|
||||
Copyright (c) 2001-2022 Expat maintainers
|
||||
Copyright (c) 2001-2025 Expat maintainers
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
|
|
|
|||
|
|
@ -4,6 +4,6 @@ See moz.yaml for the current in-tree version.
|
|||
To update run
|
||||
|
||||
$ ./mach vendor parser/expat/moz.yaml --patch-mode=none
|
||||
$ hg commit -m "Bug X - Update to Expat x.x.x."
|
||||
$ git commit -a -m "Bug X - Update to Expat x.x.x."
|
||||
$ ./mach vendor parser/expat/moz.yaml --patch-mode=only
|
||||
$ hg commit -m "Bug X - Apply local patches to Expat x.x.x."
|
||||
$ git commit -a -m "Bug X - Apply local patches to Expat x.x.x."
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
Copyright (c) 2000-2005 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
|
||||
Copyright (c) 2001-2002 Greg Stein <gstein@users.sourceforge.net>
|
||||
Copyright (c) 2002-2016 Karl Waclawek <karl@waclawek.net>
|
||||
Copyright (c) 2016-2024 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2016-2026 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2016 Cristian Rodríguez <crrodriguez@opensuse.org>
|
||||
Copyright (c) 2016 Thomas Beutlich <tc@tbeu.de>
|
||||
Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
|
||||
|
|
@ -19,6 +19,7 @@
|
|||
Copyright (c) 2023 Hanno Böck <hanno@gentoo.org>
|
||||
Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.com>
|
||||
Copyright (c) 2024 Taichi Haradaguchi <20001722@ymail.ne.jp>
|
||||
Copyright (c) 2025 Matthew Fernandez <matthew.fernandez@gmail.com>
|
||||
Licensed under the MIT license:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
|
|
@ -42,21 +43,21 @@
|
|||
*/
|
||||
|
||||
#ifndef Expat_INCLUDED
|
||||
#define Expat_INCLUDED 1
|
||||
# define Expat_INCLUDED 1
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "expat_external.h"
|
||||
# include <stdlib.h>
|
||||
# include "expat_external.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
# endif
|
||||
|
||||
struct XML_ParserStruct;
|
||||
typedef struct XML_ParserStruct *XML_Parser;
|
||||
|
||||
typedef unsigned char XML_Bool;
|
||||
#define XML_TRUE ((XML_Bool)1)
|
||||
#define XML_FALSE ((XML_Bool)0)
|
||||
# define XML_TRUE ((XML_Bool)1)
|
||||
# define XML_FALSE ((XML_Bool)0)
|
||||
|
||||
/* The XML_Status enum gives the possible return values for several
|
||||
API functions. The preprocessor #defines are included so this
|
||||
|
|
@ -73,11 +74,11 @@ typedef unsigned char XML_Bool;
|
|||
*/
|
||||
enum XML_Status {
|
||||
XML_STATUS_ERROR = 0,
|
||||
#define XML_STATUS_ERROR XML_STATUS_ERROR
|
||||
# define XML_STATUS_ERROR XML_STATUS_ERROR
|
||||
XML_STATUS_OK = 1,
|
||||
#define XML_STATUS_OK XML_STATUS_OK
|
||||
# define XML_STATUS_OK XML_STATUS_OK
|
||||
XML_STATUS_SUSPENDED = 2
|
||||
#define XML_STATUS_SUSPENDED XML_STATUS_SUSPENDED
|
||||
# define XML_STATUS_SUSPENDED XML_STATUS_SUSPENDED
|
||||
};
|
||||
|
||||
enum XML_Error {
|
||||
|
|
@ -276,7 +277,7 @@ XML_ParserCreate_MM(const XML_Char *encoding,
|
|||
|
||||
/* Prepare a parser object to be reused. This is particularly
|
||||
valuable when memory allocation overhead is disproportionately high,
|
||||
such as when a large number of small documnents need to be parsed.
|
||||
such as when a large number of small documents need to be parsed.
|
||||
All handlers are cleared from the parser, except for the
|
||||
unknownEncodingHandler. The parser's external state is re-initialized
|
||||
except for the values of ns and ns_triplets.
|
||||
|
|
@ -680,7 +681,7 @@ XMLPARSEAPI(void)
|
|||
XML_SetUserData(XML_Parser parser, void *userData);
|
||||
|
||||
/* Returns the last value set by XML_SetUserData or NULL. */
|
||||
#define XML_GetUserData(parser) (*(void **)(parser))
|
||||
# define XML_GetUserData(parser) (*(void **)(parser))
|
||||
|
||||
/* This is equivalent to supplying an encoding argument to
|
||||
XML_ParserCreate. On success XML_SetEncoding returns non-zero,
|
||||
|
|
@ -752,7 +753,7 @@ XML_GetSpecifiedAttributeCount(XML_Parser parser);
|
|||
XMLPARSEAPI(int)
|
||||
XML_GetIdAttributeIndex(XML_Parser parser);
|
||||
|
||||
#ifdef XML_ATTR_INFO
|
||||
# ifdef XML_ATTR_INFO
|
||||
/* Source file byte offsets for the start and end of attribute names and values.
|
||||
The value indices are exclusive of surrounding quotes; thus in a UTF-8 source
|
||||
file an attribute value of "blah" will yield:
|
||||
|
|
@ -773,7 +774,7 @@ typedef struct {
|
|||
*/
|
||||
XMLPARSEAPI(const XML_AttrInfo *)
|
||||
XML_GetAttributeInfo(XML_Parser parser);
|
||||
#endif
|
||||
# endif
|
||||
|
||||
/* Parses some input. Returns XML_STATUS_ERROR if a fatal error is
|
||||
detected. The last call to XML_Parse must have isFinal true; len
|
||||
|
|
@ -970,9 +971,9 @@ XMLPARSEAPI(const char *)
|
|||
XML_GetInputContext(XML_Parser parser, int *offset, int *size);
|
||||
|
||||
/* For backwards compatibility with previous versions. */
|
||||
#define XML_GetErrorLineNumber XML_GetCurrentLineNumber
|
||||
#define XML_GetErrorColumnNumber XML_GetCurrentColumnNumber
|
||||
#define XML_GetErrorByteIndex XML_GetCurrentByteIndex
|
||||
# define XML_GetErrorLineNumber XML_GetCurrentLineNumber
|
||||
# define XML_GetErrorColumnNumber XML_GetCurrentColumnNumber
|
||||
# define XML_GetErrorByteIndex XML_GetCurrentByteIndex
|
||||
|
||||
/* Frees the content model passed to the element declaration handler */
|
||||
XMLPARSEAPI(void)
|
||||
|
|
@ -1032,7 +1033,10 @@ enum XML_FeatureEnum {
|
|||
XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT,
|
||||
XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT,
|
||||
/* Added in Expat 2.6.0. */
|
||||
XML_FEATURE_GE
|
||||
XML_FEATURE_GE,
|
||||
/* Added in Expat 2.7.2. */
|
||||
XML_FEATURE_ALLOC_TRACKER_MAXIMUM_AMPLIFICATION_DEFAULT,
|
||||
XML_FEATURE_ALLOC_TRACKER_ACTIVATION_THRESHOLD_DEFAULT,
|
||||
/* Additional features must be added to the end of this enum. */
|
||||
};
|
||||
|
||||
|
|
@ -1045,7 +1049,7 @@ typedef struct {
|
|||
XMLPARSEAPI(const XML_Feature *)
|
||||
XML_GetFeatureList(void);
|
||||
|
||||
#if defined(XML_DTD) || (defined(XML_GE) && XML_GE == 1)
|
||||
# if defined(XML_DTD) || (defined(XML_GE) && XML_GE == 1)
|
||||
/* Added in Expat 2.4.0 for XML_DTD defined and
|
||||
* added in Expat 2.6.0 for XML_GE == 1. */
|
||||
XMLPARSEAPI(XML_Bool)
|
||||
|
|
@ -1057,7 +1061,17 @@ XML_SetBillionLaughsAttackProtectionMaximumAmplification(
|
|||
XMLPARSEAPI(XML_Bool)
|
||||
XML_SetBillionLaughsAttackProtectionActivationThreshold(
|
||||
XML_Parser parser, unsigned long long activationThresholdBytes);
|
||||
#endif
|
||||
|
||||
/* Added in Expat 2.7.2. */
|
||||
XMLPARSEAPI(XML_Bool)
|
||||
XML_SetAllocTrackerMaximumAmplification(XML_Parser parser,
|
||||
float maximumAmplificationFactor);
|
||||
|
||||
/* Added in Expat 2.7.2. */
|
||||
XMLPARSEAPI(XML_Bool)
|
||||
XML_SetAllocTrackerActivationThreshold(
|
||||
XML_Parser parser, unsigned long long activationThresholdBytes);
|
||||
# endif
|
||||
|
||||
/* Added in Expat 2.6.0. */
|
||||
XMLPARSEAPI(XML_Bool)
|
||||
|
|
@ -1066,12 +1080,12 @@ XML_SetReparseDeferralEnabled(XML_Parser parser, XML_Bool enabled);
|
|||
/* Expat follows the semantic versioning convention.
|
||||
See https://semver.org
|
||||
*/
|
||||
#define XML_MAJOR_VERSION 2
|
||||
#define XML_MINOR_VERSION 6
|
||||
#define XML_MICRO_VERSION 4
|
||||
# define XML_MAJOR_VERSION 2
|
||||
# define XML_MINOR_VERSION 7
|
||||
# define XML_MICRO_VERSION 4
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#endif /* not Expat_INCLUDED */
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
Copyright (c) 2001-2002 Greg Stein <gstein@users.sourceforge.net>
|
||||
Copyright (c) 2002-2006 Karl Waclawek <karl@waclawek.net>
|
||||
Copyright (c) 2016 Cristian Rodríguez <crrodriguez@opensuse.org>
|
||||
Copyright (c) 2016-2019 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2016-2025 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
|
||||
Copyright (c) 2018 Yury Gribov <tetra2005@gmail.com>
|
||||
Licensed under the MIT license:
|
||||
|
|
@ -38,7 +38,7 @@
|
|||
*/
|
||||
|
||||
#ifndef Expat_External_INCLUDED
|
||||
#define Expat_External_INCLUDED 1
|
||||
# define Expat_External_INCLUDED 1
|
||||
|
||||
/* External API definitions */
|
||||
|
||||
|
|
@ -64,12 +64,12 @@
|
|||
compiled with the cdecl calling convention as the default since
|
||||
system headers may assume the cdecl convention.
|
||||
*/
|
||||
#ifndef XMLCALL
|
||||
# if defined(_MSC_VER)
|
||||
# define XMLCALL __cdecl
|
||||
# elif defined(__GNUC__) && defined(__i386) && ! defined(__INTEL_COMPILER)
|
||||
# define XMLCALL __attribute__((cdecl))
|
||||
# else
|
||||
# ifndef XMLCALL
|
||||
# if defined(_MSC_VER)
|
||||
# define XMLCALL __cdecl
|
||||
# elif defined(__GNUC__) && defined(__i386) && ! defined(__INTEL_COMPILER)
|
||||
# define XMLCALL __attribute__((cdecl))
|
||||
# else
|
||||
/* For any platform which uses this definition and supports more than
|
||||
one calling convention, we need to extend this definition to
|
||||
declare the convention used on that platform, if it's possible to
|
||||
|
|
@ -80,92 +80,92 @@
|
|||
pre-processor and how to specify the same calling convention as the
|
||||
platform's malloc() implementation.
|
||||
*/
|
||||
# define XMLCALL
|
||||
# endif
|
||||
#endif /* not defined XMLCALL */
|
||||
# define XMLCALL
|
||||
# endif
|
||||
# endif /* not defined XMLCALL */
|
||||
|
||||
#if ! defined(XML_STATIC) && ! defined(XMLIMPORT)
|
||||
# ifndef XML_BUILDING_EXPAT
|
||||
# if ! defined(XML_STATIC) && ! defined(XMLIMPORT)
|
||||
# ifndef XML_BUILDING_EXPAT
|
||||
/* using Expat from an application */
|
||||
|
||||
# if defined(_MSC_EXTENSIONS) && ! defined(__BEOS__) && ! defined(__CYGWIN__)
|
||||
# define XMLIMPORT __declspec(dllimport)
|
||||
# if defined(_MSC_VER) && ! defined(__BEOS__) && ! defined(__CYGWIN__)
|
||||
# define XMLIMPORT __declspec(dllimport)
|
||||
# endif
|
||||
|
||||
# endif
|
||||
# endif /* not defined XML_STATIC */
|
||||
|
||||
# ifndef XML_ENABLE_VISIBILITY
|
||||
# define XML_ENABLE_VISIBILITY 0
|
||||
# endif
|
||||
#endif /* not defined XML_STATIC */
|
||||
|
||||
#ifndef XML_ENABLE_VISIBILITY
|
||||
# define XML_ENABLE_VISIBILITY 0
|
||||
#endif
|
||||
|
||||
#if ! defined(XMLIMPORT) && XML_ENABLE_VISIBILITY
|
||||
# define XMLIMPORT __attribute__((visibility("default")))
|
||||
#endif
|
||||
# if ! defined(XMLIMPORT) && XML_ENABLE_VISIBILITY
|
||||
# define XMLIMPORT __attribute__((visibility("default")))
|
||||
# endif
|
||||
|
||||
/* If we didn't define it above, define it away: */
|
||||
#ifndef XMLIMPORT
|
||||
# define XMLIMPORT
|
||||
#endif
|
||||
# ifndef XMLIMPORT
|
||||
# define XMLIMPORT
|
||||
# endif
|
||||
|
||||
#if defined(__GNUC__) \
|
||||
&& (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96))
|
||||
# define XML_ATTR_MALLOC __attribute__((__malloc__))
|
||||
#else
|
||||
# define XML_ATTR_MALLOC
|
||||
#endif
|
||||
# if defined(__GNUC__) \
|
||||
&& (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96))
|
||||
# define XML_ATTR_MALLOC __attribute__((__malloc__))
|
||||
# else
|
||||
# define XML_ATTR_MALLOC
|
||||
# endif
|
||||
|
||||
#if defined(__GNUC__) \
|
||||
&& ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
|
||||
# define XML_ATTR_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
|
||||
#else
|
||||
# define XML_ATTR_ALLOC_SIZE(x)
|
||||
#endif
|
||||
# if defined(__GNUC__) \
|
||||
&& ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
|
||||
# define XML_ATTR_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
|
||||
# else
|
||||
# define XML_ATTR_ALLOC_SIZE(x)
|
||||
# endif
|
||||
|
||||
#define XMLPARSEAPI(type) XMLIMPORT type XMLCALL
|
||||
# define XMLPARSEAPI(type) XMLIMPORT type XMLCALL
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#ifdef XML_UNICODE_WCHAR_T
|
||||
# ifndef XML_UNICODE
|
||||
# define XML_UNICODE
|
||||
# ifdef XML_UNICODE_WCHAR_T
|
||||
# ifndef XML_UNICODE
|
||||
# define XML_UNICODE
|
||||
# endif
|
||||
# if defined(__SIZEOF_WCHAR_T__) && (__SIZEOF_WCHAR_T__ != 2)
|
||||
# error "sizeof(wchar_t) != 2; Need -fshort-wchar for both Expat and libc"
|
||||
# endif
|
||||
# endif
|
||||
# if defined(__SIZEOF_WCHAR_T__) && (__SIZEOF_WCHAR_T__ != 2)
|
||||
# error "sizeof(wchar_t) != 2; Need -fshort-wchar for both Expat and libc"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* BEGIN MOZILLA CHANGE (typedef XML_Char to char16_t) */
|
||||
#if 0
|
||||
|
||||
#ifdef XML_UNICODE /* Information is UTF-16 encoded. */
|
||||
# ifdef XML_UNICODE_WCHAR_T
|
||||
# ifdef XML_UNICODE /* Information is UTF-16 encoded. */
|
||||
# ifdef XML_UNICODE_WCHAR_T
|
||||
typedef wchar_t XML_Char;
|
||||
typedef wchar_t XML_LChar;
|
||||
# else
|
||||
# else
|
||||
typedef unsigned short XML_Char;
|
||||
typedef char XML_LChar;
|
||||
# endif /* XML_UNICODE_WCHAR_T */
|
||||
#else /* Information is UTF-8 encoded. */
|
||||
# endif /* XML_UNICODE_WCHAR_T */
|
||||
# else /* Information is UTF-8 encoded. */
|
||||
typedef char XML_Char;
|
||||
typedef char XML_LChar;
|
||||
#endif /* XML_UNICODE */
|
||||
# endif /* XML_UNICODE */
|
||||
|
||||
#endif
|
||||
/* END MOZILLA CHANGE */
|
||||
|
||||
#ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */
|
||||
# ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */
|
||||
typedef long long XML_Index;
|
||||
typedef unsigned long long XML_Size;
|
||||
#else
|
||||
# else
|
||||
typedef long XML_Index;
|
||||
typedef unsigned long XML_Size;
|
||||
#endif /* XML_LARGE_SIZE */
|
||||
# endif /* XML_LARGE_SIZE */
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#endif /* not Expat_External_INCLUDED */
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
Copyright (c) 2002-2003 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
|
||||
Copyright (c) 2002-2006 Karl Waclawek <karl@waclawek.net>
|
||||
Copyright (c) 2003 Greg Stein <gstein@users.sourceforge.net>
|
||||
Copyright (c) 2016-2024 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2016-2025 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2018 Yury Gribov <tetra2005@gmail.com>
|
||||
Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
|
||||
Copyright (c) 2023-2024 Sony Corporation / Snild Dolkow <snild@sony.com>
|
||||
|
|
@ -108,6 +108,7 @@
|
|||
#endif
|
||||
|
||||
#include <limits.h> // ULONG_MAX
|
||||
#include <stddef.h> // size_t
|
||||
|
||||
#if defined(_WIN32) \
|
||||
&& (! defined(__USE_MINGW_ANSI_STDIO) \
|
||||
|
|
@ -127,6 +128,9 @@
|
|||
# elif ULONG_MAX == 18446744073709551615u // 2^64-1
|
||||
# define EXPAT_FMT_PTRDIFF_T(midpart) "%" midpart "ld"
|
||||
# define EXPAT_FMT_SIZE_T(midpart) "%" midpart "lu"
|
||||
# elif defined(__wasm32__) // 32bit mode Emscripten or WASI SDK
|
||||
# define EXPAT_FMT_PTRDIFF_T(midpart) "%" midpart "ld"
|
||||
# define EXPAT_FMT_SIZE_T(midpart) "%" midpart "zu"
|
||||
# else
|
||||
# define EXPAT_FMT_PTRDIFF_T(midpart) "%" midpart "d"
|
||||
# define EXPAT_FMT_SIZE_T(midpart) "%" midpart "u"
|
||||
|
|
@ -145,6 +149,16 @@
|
|||
100.0f
|
||||
#define EXPAT_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT \
|
||||
8388608 // 8 MiB, 2^23
|
||||
|
||||
#define EXPAT_ALLOC_TRACKER_MAXIMUM_AMPLIFICATION_DEFAULT 100.0f
|
||||
#define EXPAT_ALLOC_TRACKER_ACTIVATION_THRESHOLD_DEFAULT \
|
||||
67108864 // 64 MiB, 2^26
|
||||
|
||||
// NOTE: If function expat_alloc was user facing, EXPAT_MALLOC_ALIGNMENT would
|
||||
// have to take sizeof(long double) into account
|
||||
#define EXPAT_MALLOC_ALIGNMENT sizeof(long long) // largest parser (sub)member
|
||||
#define EXPAT_MALLOC_PADDING ((EXPAT_MALLOC_ALIGNMENT) - sizeof(size_t))
|
||||
|
||||
/* NOTE END */
|
||||
|
||||
#include "expat.h" // so we can use type XML_Parser below
|
||||
|
|
@ -168,6 +182,9 @@ extern
|
|||
#endif
|
||||
XML_Bool g_reparseDeferralEnabledDefault; // written ONLY in runtests.c
|
||||
#if defined(XML_TESTING)
|
||||
void *expat_malloc(XML_Parser parser, size_t size, int sourceLine);
|
||||
void expat_free(XML_Parser parser, void *ptr, int sourceLine);
|
||||
void *expat_realloc(XML_Parser parser, void *ptr, size_t size, int sourceLine);
|
||||
extern unsigned int g_bytesScanned; // used for testing only
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -149,3 +149,14 @@ MOZ_XML_ParserFree(XML_Parser parser) {
|
|||
XML_Bool MOZ_XML_SetReparseDeferralEnabled(XML_Parser parser, int enabled) {
|
||||
return XML_SetReparseDeferralEnabled(parser, enabled);
|
||||
}
|
||||
|
||||
const XML_Char * XMLCALL
|
||||
MOZ_XML_GetMismatchedTag(XML_Parser parser)
|
||||
{
|
||||
return parser->m_mismatch;
|
||||
}
|
||||
|
||||
XML_Bool XMLCALL
|
||||
MOZ_XML_ProcessingEntityValue(XML_Parser parser) {
|
||||
return parser->m_openInternalEntities != NULL;
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -16,6 +16,7 @@
|
|||
Copyright (c) 2017 Rhodri James <rhodri@wildebeest.org.uk>
|
||||
Copyright (c) 2019 David Loffredo <loffredo@steptools.com>
|
||||
Copyright (c) 2021 Donghee Na <donghee.na@python.org>
|
||||
Copyright (c) 2025 Alfonso Gregory <gfunni234@gmail.com>
|
||||
Licensed under the MIT license:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
|
|
@ -46,7 +47,6 @@
|
|||
# include "winconfig.h"
|
||||
#endif
|
||||
|
||||
#include "expat_external.h"
|
||||
#include "internal.h"
|
||||
#include "xmlrole.h"
|
||||
#include "ascii.h"
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
Copyright (c) 2000 Clark Cooper <coopercc@users.sourceforge.net>
|
||||
Copyright (c) 2002 Karl Waclawek <karl@waclawek.net>
|
||||
Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
|
||||
Copyright (c) 2017-2024 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2017-2025 Sebastian Pipping <sebastian@pipping.org>
|
||||
Licensed under the MIT license:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
|
|
@ -34,19 +34,13 @@
|
|||
*/
|
||||
|
||||
#ifndef XmlRole_INCLUDED
|
||||
#define XmlRole_INCLUDED 1
|
||||
# define XmlRole_INCLUDED 1
|
||||
|
||||
#ifdef __VMS
|
||||
/* 0 1 2 3 0 1 2 3
|
||||
1234567890123456789012345678901 1234567890123456789012345678901 */
|
||||
# define XmlPrologStateInitExternalEntity XmlPrologStateInitExternalEnt
|
||||
#endif
|
||||
# include "xmltok.h"
|
||||
|
||||
#include "xmltok.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
# endif
|
||||
|
||||
enum {
|
||||
XML_ROLE_ERROR = -1,
|
||||
|
|
@ -107,11 +101,11 @@ enum {
|
|||
XML_ROLE_CONTENT_ELEMENT_PLUS,
|
||||
XML_ROLE_PI,
|
||||
XML_ROLE_COMMENT,
|
||||
#ifdef XML_DTD
|
||||
# ifdef XML_DTD
|
||||
XML_ROLE_TEXT_DECL,
|
||||
XML_ROLE_IGNORE_SECT,
|
||||
XML_ROLE_INNER_PARAM_ENTITY_REF,
|
||||
#endif /* XML_DTD */
|
||||
# endif /* XML_DTD */
|
||||
XML_ROLE_PARAM_ENTITY_REF
|
||||
};
|
||||
|
||||
|
|
@ -120,23 +114,23 @@ typedef struct prolog_state {
|
|||
const char *end, const ENCODING *enc);
|
||||
unsigned level;
|
||||
int role_none;
|
||||
#ifdef XML_DTD
|
||||
# ifdef XML_DTD
|
||||
unsigned includeLevel;
|
||||
int documentEntity;
|
||||
int inEntityValue;
|
||||
#endif /* XML_DTD */
|
||||
# endif /* XML_DTD */
|
||||
} PROLOG_STATE;
|
||||
|
||||
void XmlPrologStateInit(PROLOG_STATE *state);
|
||||
#ifdef XML_DTD
|
||||
# ifdef XML_DTD
|
||||
void XmlPrologStateInitExternalEntity(PROLOG_STATE *state);
|
||||
#endif /* XML_DTD */
|
||||
# endif /* XML_DTD */
|
||||
|
||||
#define XmlTokenRole(state, tok, ptr, end, enc) \
|
||||
(((state)->handler)(state, tok, ptr, end, enc))
|
||||
# define XmlTokenRole(state, tok, ptr, end, enc) \
|
||||
(((state)->handler)(state, tok, ptr, end, enc))
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#endif /* not XmlRole_INCLUDED */
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
Copyright (c) 2022 Martin Ettl <ettl.martin78@googlemail.com>
|
||||
Copyright (c) 2022 Sean McBride <sean@rogue-research.com>
|
||||
Copyright (c) 2023 Hanno Böck <hanno@gentoo.org>
|
||||
Copyright (c) 2025 Alfonso Gregory <gfunni234@gmail.com>
|
||||
Licensed under the MIT license:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
|
|
@ -56,7 +57,6 @@
|
|||
# include "winconfig.h"
|
||||
#endif
|
||||
|
||||
#include "expat_external.h"
|
||||
#include "internal.h"
|
||||
#include "xmltok.h"
|
||||
#include "nametab.h"
|
||||
|
|
@ -1409,7 +1409,7 @@ unknown_toUtf16(const ENCODING *enc, const char **fromP, const char *fromLim,
|
|||
}
|
||||
|
||||
ENCODING *
|
||||
XmlInitUnknownEncoding(void *mem, int *table, CONVERTER convert,
|
||||
XmlInitUnknownEncoding(void *mem, const int *table, CONVERTER convert,
|
||||
void *userData) {
|
||||
int i;
|
||||
struct unknown_encoding *e = (struct unknown_encoding *)mem;
|
||||
|
|
@ -1672,7 +1672,7 @@ initScan(const ENCODING *const *encodingTable, const INIT_ENCODING *enc,
|
|||
# undef ns
|
||||
|
||||
ENCODING *
|
||||
XmlInitUnknownEncodingNS(void *mem, int *table, CONVERTER convert,
|
||||
XmlInitUnknownEncodingNS(void *mem, const int *table, CONVERTER convert,
|
||||
void *userData) {
|
||||
ENCODING *enc = XmlInitUnknownEncoding(mem, table, convert, userData);
|
||||
if (enc)
|
||||
|
|
|
|||
|
|
@ -35,113 +35,113 @@
|
|||
*/
|
||||
|
||||
#ifndef XmlTok_INCLUDED
|
||||
#define XmlTok_INCLUDED 1
|
||||
# define XmlTok_INCLUDED 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
# ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
# endif
|
||||
|
||||
/* The following token may be returned by XmlContentTok */
|
||||
#define XML_TOK_TRAILING_RSQB \
|
||||
-5 /* ] or ]] at the end of the scan; might be \
|
||||
start of illegal ]]> sequence */
|
||||
# define XML_TOK_TRAILING_RSQB \
|
||||
-5 /* ] or ]] at the end of the scan; might be \
|
||||
start of illegal ]]> sequence */
|
||||
/* The following tokens may be returned by both XmlPrologTok and
|
||||
XmlContentTok.
|
||||
*/
|
||||
#define XML_TOK_NONE -4 /* The string to be scanned is empty */
|
||||
#define XML_TOK_TRAILING_CR \
|
||||
-3 /* A CR at the end of the scan; \
|
||||
might be part of CRLF sequence */
|
||||
#define XML_TOK_PARTIAL_CHAR -2 /* only part of a multibyte sequence */
|
||||
#define XML_TOK_PARTIAL -1 /* only part of a token */
|
||||
#define XML_TOK_INVALID 0
|
||||
# define XML_TOK_NONE -4 /* The string to be scanned is empty */
|
||||
# define XML_TOK_TRAILING_CR \
|
||||
-3 /* A CR at the end of the scan; \
|
||||
might be part of CRLF sequence */
|
||||
# define XML_TOK_PARTIAL_CHAR -2 /* only part of a multibyte sequence */
|
||||
# define XML_TOK_PARTIAL -1 /* only part of a token */
|
||||
# define XML_TOK_INVALID 0
|
||||
|
||||
/* The following tokens are returned by XmlContentTok; some are also
|
||||
returned by XmlAttributeValueTok, XmlEntityTok, XmlCdataSectionTok.
|
||||
*/
|
||||
#define XML_TOK_START_TAG_WITH_ATTS 1
|
||||
#define XML_TOK_START_TAG_NO_ATTS 2
|
||||
#define XML_TOK_EMPTY_ELEMENT_WITH_ATTS 3 /* empty element tag <e/> */
|
||||
#define XML_TOK_EMPTY_ELEMENT_NO_ATTS 4
|
||||
#define XML_TOK_END_TAG 5
|
||||
#define XML_TOK_DATA_CHARS 6
|
||||
#define XML_TOK_DATA_NEWLINE 7
|
||||
#define XML_TOK_CDATA_SECT_OPEN 8
|
||||
#define XML_TOK_ENTITY_REF 9
|
||||
#define XML_TOK_CHAR_REF 10 /* numeric character reference */
|
||||
# define XML_TOK_START_TAG_WITH_ATTS 1
|
||||
# define XML_TOK_START_TAG_NO_ATTS 2
|
||||
# define XML_TOK_EMPTY_ELEMENT_WITH_ATTS 3 /* empty element tag <e/> */
|
||||
# define XML_TOK_EMPTY_ELEMENT_NO_ATTS 4
|
||||
# define XML_TOK_END_TAG 5
|
||||
# define XML_TOK_DATA_CHARS 6
|
||||
# define XML_TOK_DATA_NEWLINE 7
|
||||
# define XML_TOK_CDATA_SECT_OPEN 8
|
||||
# define XML_TOK_ENTITY_REF 9
|
||||
# define XML_TOK_CHAR_REF 10 /* numeric character reference */
|
||||
|
||||
/* The following tokens may be returned by both XmlPrologTok and
|
||||
XmlContentTok.
|
||||
*/
|
||||
#define XML_TOK_PI 11 /* processing instruction */
|
||||
#define XML_TOK_XML_DECL 12 /* XML decl or text decl */
|
||||
#define XML_TOK_COMMENT 13
|
||||
#define XML_TOK_BOM 14 /* Byte order mark */
|
||||
# define XML_TOK_PI 11 /* processing instruction */
|
||||
# define XML_TOK_XML_DECL 12 /* XML decl or text decl */
|
||||
# define XML_TOK_COMMENT 13
|
||||
# define XML_TOK_BOM 14 /* Byte order mark */
|
||||
|
||||
/* The following tokens are returned only by XmlPrologTok */
|
||||
#define XML_TOK_PROLOG_S 15
|
||||
#define XML_TOK_DECL_OPEN 16 /* <!foo */
|
||||
#define XML_TOK_DECL_CLOSE 17 /* > */
|
||||
#define XML_TOK_NAME 18
|
||||
#define XML_TOK_NMTOKEN 19
|
||||
#define XML_TOK_POUND_NAME 20 /* #name */
|
||||
#define XML_TOK_OR 21 /* | */
|
||||
#define XML_TOK_PERCENT 22
|
||||
#define XML_TOK_OPEN_PAREN 23
|
||||
#define XML_TOK_CLOSE_PAREN 24
|
||||
#define XML_TOK_OPEN_BRACKET 25
|
||||
#define XML_TOK_CLOSE_BRACKET 26
|
||||
#define XML_TOK_LITERAL 27
|
||||
#define XML_TOK_PARAM_ENTITY_REF 28
|
||||
#define XML_TOK_INSTANCE_START 29
|
||||
# define XML_TOK_PROLOG_S 15
|
||||
# define XML_TOK_DECL_OPEN 16 /* <!foo */
|
||||
# define XML_TOK_DECL_CLOSE 17 /* > */
|
||||
# define XML_TOK_NAME 18
|
||||
# define XML_TOK_NMTOKEN 19
|
||||
# define XML_TOK_POUND_NAME 20 /* #name */
|
||||
# define XML_TOK_OR 21 /* | */
|
||||
# define XML_TOK_PERCENT 22
|
||||
# define XML_TOK_OPEN_PAREN 23
|
||||
# define XML_TOK_CLOSE_PAREN 24
|
||||
# define XML_TOK_OPEN_BRACKET 25
|
||||
# define XML_TOK_CLOSE_BRACKET 26
|
||||
# define XML_TOK_LITERAL 27
|
||||
# define XML_TOK_PARAM_ENTITY_REF 28
|
||||
# define XML_TOK_INSTANCE_START 29
|
||||
|
||||
/* The following occur only in element type declarations */
|
||||
#define XML_TOK_NAME_QUESTION 30 /* name? */
|
||||
#define XML_TOK_NAME_ASTERISK 31 /* name* */
|
||||
#define XML_TOK_NAME_PLUS 32 /* name+ */
|
||||
#define XML_TOK_COND_SECT_OPEN 33 /* <![ */
|
||||
#define XML_TOK_COND_SECT_CLOSE 34 /* ]]> */
|
||||
#define XML_TOK_CLOSE_PAREN_QUESTION 35 /* )? */
|
||||
#define XML_TOK_CLOSE_PAREN_ASTERISK 36 /* )* */
|
||||
#define XML_TOK_CLOSE_PAREN_PLUS 37 /* )+ */
|
||||
#define XML_TOK_COMMA 38
|
||||
# define XML_TOK_NAME_QUESTION 30 /* name? */
|
||||
# define XML_TOK_NAME_ASTERISK 31 /* name* */
|
||||
# define XML_TOK_NAME_PLUS 32 /* name+ */
|
||||
# define XML_TOK_COND_SECT_OPEN 33 /* <![ */
|
||||
# define XML_TOK_COND_SECT_CLOSE 34 /* ]]> */
|
||||
# define XML_TOK_CLOSE_PAREN_QUESTION 35 /* )? */
|
||||
# define XML_TOK_CLOSE_PAREN_ASTERISK 36 /* )* */
|
||||
# define XML_TOK_CLOSE_PAREN_PLUS 37 /* )+ */
|
||||
# define XML_TOK_COMMA 38
|
||||
|
||||
/* The following token is returned only by XmlAttributeValueTok */
|
||||
#define XML_TOK_ATTRIBUTE_VALUE_S 39
|
||||
# define XML_TOK_ATTRIBUTE_VALUE_S 39
|
||||
|
||||
/* The following token is returned only by XmlCdataSectionTok */
|
||||
#define XML_TOK_CDATA_SECT_CLOSE 40
|
||||
# define XML_TOK_CDATA_SECT_CLOSE 40
|
||||
|
||||
/* With namespace processing this is returned by XmlPrologTok for a
|
||||
name with a colon.
|
||||
*/
|
||||
#define XML_TOK_PREFIXED_NAME 41
|
||||
# define XML_TOK_PREFIXED_NAME 41
|
||||
|
||||
#ifdef XML_DTD
|
||||
# define XML_TOK_IGNORE_SECT 42
|
||||
#endif /* XML_DTD */
|
||||
# ifdef XML_DTD
|
||||
# define XML_TOK_IGNORE_SECT 42
|
||||
# endif /* XML_DTD */
|
||||
|
||||
#ifdef XML_DTD
|
||||
# define XML_N_STATES 4
|
||||
#else /* not XML_DTD */
|
||||
# define XML_N_STATES 3
|
||||
#endif /* not XML_DTD */
|
||||
# ifdef XML_DTD
|
||||
# define XML_N_STATES 4
|
||||
# else /* not XML_DTD */
|
||||
# define XML_N_STATES 3
|
||||
# endif /* not XML_DTD */
|
||||
|
||||
#define XML_PROLOG_STATE 0
|
||||
#define XML_CONTENT_STATE 1
|
||||
#define XML_CDATA_SECTION_STATE 2
|
||||
#ifdef XML_DTD
|
||||
# define XML_IGNORE_SECTION_STATE 3
|
||||
#endif /* XML_DTD */
|
||||
# define XML_PROLOG_STATE 0
|
||||
# define XML_CONTENT_STATE 1
|
||||
# define XML_CDATA_SECTION_STATE 2
|
||||
# ifdef XML_DTD
|
||||
# define XML_IGNORE_SECTION_STATE 3
|
||||
# endif /* XML_DTD */
|
||||
|
||||
#define XML_N_LITERAL_TYPES 2
|
||||
#define XML_ATTRIBUTE_VALUE_LITERAL 0
|
||||
#define XML_ENTITY_VALUE_LITERAL 1
|
||||
# define XML_N_LITERAL_TYPES 2
|
||||
# define XML_ATTRIBUTE_VALUE_LITERAL 0
|
||||
# define XML_ENTITY_VALUE_LITERAL 1
|
||||
|
||||
/* The size of the buffer passed to XmlUtf8Encode must be at least this. */
|
||||
#define XML_UTF8_ENCODE_MAX 4
|
||||
# define XML_UTF8_ENCODE_MAX 4
|
||||
/* The size of the buffer passed to XmlUtf16Encode must be at least this. */
|
||||
#define XML_UTF16_ENCODE_MAX 2
|
||||
# define XML_UTF16_ENCODE_MAX 2
|
||||
|
||||
typedef struct position {
|
||||
/* first line and first column are 0 not 1 */
|
||||
|
|
@ -220,63 +220,63 @@ struct encoding {
|
|||
the prolog outside literals, comments and processing instructions.
|
||||
*/
|
||||
|
||||
#define XmlTok(enc, state, ptr, end, nextTokPtr) \
|
||||
(((enc)->scanners[state])(enc, ptr, end, nextTokPtr))
|
||||
# define XmlTok(enc, state, ptr, end, nextTokPtr) \
|
||||
(((enc)->scanners[state])(enc, ptr, end, nextTokPtr))
|
||||
|
||||
#define XmlPrologTok(enc, ptr, end, nextTokPtr) \
|
||||
XmlTok(enc, XML_PROLOG_STATE, ptr, end, nextTokPtr)
|
||||
# define XmlPrologTok(enc, ptr, end, nextTokPtr) \
|
||||
XmlTok(enc, XML_PROLOG_STATE, ptr, end, nextTokPtr)
|
||||
|
||||
#define XmlContentTok(enc, ptr, end, nextTokPtr) \
|
||||
XmlTok(enc, XML_CONTENT_STATE, ptr, end, nextTokPtr)
|
||||
# define XmlContentTok(enc, ptr, end, nextTokPtr) \
|
||||
XmlTok(enc, XML_CONTENT_STATE, ptr, end, nextTokPtr)
|
||||
|
||||
#define XmlCdataSectionTok(enc, ptr, end, nextTokPtr) \
|
||||
XmlTok(enc, XML_CDATA_SECTION_STATE, ptr, end, nextTokPtr)
|
||||
# define XmlCdataSectionTok(enc, ptr, end, nextTokPtr) \
|
||||
XmlTok(enc, XML_CDATA_SECTION_STATE, ptr, end, nextTokPtr)
|
||||
|
||||
#ifdef XML_DTD
|
||||
# ifdef XML_DTD
|
||||
|
||||
# define XmlIgnoreSectionTok(enc, ptr, end, nextTokPtr) \
|
||||
XmlTok(enc, XML_IGNORE_SECTION_STATE, ptr, end, nextTokPtr)
|
||||
# define XmlIgnoreSectionTok(enc, ptr, end, nextTokPtr) \
|
||||
XmlTok(enc, XML_IGNORE_SECTION_STATE, ptr, end, nextTokPtr)
|
||||
|
||||
#endif /* XML_DTD */
|
||||
# endif /* XML_DTD */
|
||||
|
||||
/* This is used for performing a 2nd-level tokenization on the content
|
||||
of a literal that has already been returned by XmlTok.
|
||||
*/
|
||||
#define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) \
|
||||
(((enc)->literalScanners[literalType])(enc, ptr, end, nextTokPtr))
|
||||
# define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) \
|
||||
(((enc)->literalScanners[literalType])(enc, ptr, end, nextTokPtr))
|
||||
|
||||
#define XmlAttributeValueTok(enc, ptr, end, nextTokPtr) \
|
||||
XmlLiteralTok(enc, XML_ATTRIBUTE_VALUE_LITERAL, ptr, end, nextTokPtr)
|
||||
# define XmlAttributeValueTok(enc, ptr, end, nextTokPtr) \
|
||||
XmlLiteralTok(enc, XML_ATTRIBUTE_VALUE_LITERAL, ptr, end, nextTokPtr)
|
||||
|
||||
#define XmlEntityValueTok(enc, ptr, end, nextTokPtr) \
|
||||
XmlLiteralTok(enc, XML_ENTITY_VALUE_LITERAL, ptr, end, nextTokPtr)
|
||||
# define XmlEntityValueTok(enc, ptr, end, nextTokPtr) \
|
||||
XmlLiteralTok(enc, XML_ENTITY_VALUE_LITERAL, ptr, end, nextTokPtr)
|
||||
|
||||
#define XmlNameMatchesAscii(enc, ptr1, end1, ptr2) \
|
||||
(((enc)->nameMatchesAscii)(enc, ptr1, end1, ptr2))
|
||||
# define XmlNameMatchesAscii(enc, ptr1, end1, ptr2) \
|
||||
(((enc)->nameMatchesAscii)(enc, ptr1, end1, ptr2))
|
||||
|
||||
#define XmlNameLength(enc, ptr) (((enc)->nameLength)(enc, ptr))
|
||||
# define XmlNameLength(enc, ptr) (((enc)->nameLength)(enc, ptr))
|
||||
|
||||
#define XmlSkipS(enc, ptr) (((enc)->skipS)(enc, ptr))
|
||||
# define XmlSkipS(enc, ptr) (((enc)->skipS)(enc, ptr))
|
||||
|
||||
#define XmlGetAttributes(enc, ptr, attsMax, atts) \
|
||||
(((enc)->getAtts)(enc, ptr, attsMax, atts))
|
||||
# define XmlGetAttributes(enc, ptr, attsMax, atts) \
|
||||
(((enc)->getAtts)(enc, ptr, attsMax, atts))
|
||||
|
||||
#define XmlCharRefNumber(enc, ptr) (((enc)->charRefNumber)(enc, ptr))
|
||||
# define XmlCharRefNumber(enc, ptr) (((enc)->charRefNumber)(enc, ptr))
|
||||
|
||||
#define XmlPredefinedEntityName(enc, ptr, end) \
|
||||
(((enc)->predefinedEntityName)(enc, ptr, end))
|
||||
# define XmlPredefinedEntityName(enc, ptr, end) \
|
||||
(((enc)->predefinedEntityName)(enc, ptr, end))
|
||||
|
||||
#define XmlUpdatePosition(enc, ptr, end, pos) \
|
||||
(((enc)->updatePosition)(enc, ptr, end, pos))
|
||||
# define XmlUpdatePosition(enc, ptr, end, pos) \
|
||||
(((enc)->updatePosition)(enc, ptr, end, pos))
|
||||
|
||||
#define XmlIsPublicId(enc, ptr, end, badPtr) \
|
||||
(((enc)->isPublicId)(enc, ptr, end, badPtr))
|
||||
# define XmlIsPublicId(enc, ptr, end, badPtr) \
|
||||
(((enc)->isPublicId)(enc, ptr, end, badPtr))
|
||||
|
||||
#define XmlUtf8Convert(enc, fromP, fromLim, toP, toLim) \
|
||||
(((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim))
|
||||
# define XmlUtf8Convert(enc, fromP, fromLim, toP, toLim) \
|
||||
(((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim))
|
||||
|
||||
#define XmlUtf16Convert(enc, fromP, fromLim, toP, toLim) \
|
||||
(((enc)->utf16Convert)(enc, fromP, fromLim, toP, toLim))
|
||||
# define XmlUtf16Convert(enc, fromP, fromLim, toP, toLim) \
|
||||
(((enc)->utf16Convert)(enc, fromP, fromLim, toP, toLim))
|
||||
|
||||
typedef struct {
|
||||
ENCODING initEnc;
|
||||
|
|
@ -299,7 +299,7 @@ int XmlSizeOfUnknownEncoding(void);
|
|||
|
||||
typedef int(XMLCALL *CONVERTER)(void *userData, const char *p);
|
||||
|
||||
ENCODING *XmlInitUnknownEncoding(void *mem, int *table, CONVERTER convert,
|
||||
ENCODING *XmlInitUnknownEncoding(void *mem, const int *table, CONVERTER convert,
|
||||
void *userData);
|
||||
|
||||
int XmlParseXmlDeclNS(int isGeneralTextEntity, const ENCODING *enc,
|
||||
|
|
@ -312,10 +312,10 @@ int XmlInitEncodingNS(INIT_ENCODING *p, const ENCODING **encPtr,
|
|||
const char *name);
|
||||
const ENCODING *XmlGetUtf8InternalEncodingNS(void);
|
||||
const ENCODING *XmlGetUtf16InternalEncodingNS(void);
|
||||
ENCODING *XmlInitUnknownEncodingNS(void *mem, int *table, CONVERTER convert,
|
||||
void *userData);
|
||||
#ifdef __cplusplus
|
||||
ENCODING *XmlInitUnknownEncodingNS(void *mem, const int *table,
|
||||
CONVERTER convert, void *userData);
|
||||
# ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
# endif
|
||||
|
||||
#endif /* not XmlTok_INCLUDED */
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
Copyright (c) 2002 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
|
||||
Copyright (c) 2002-2006 Karl Waclawek <karl@waclawek.net>
|
||||
Copyright (c) 2017-2021 Sebastian Pipping <sebastian@pipping.org>
|
||||
Copyright (c) 2025 Alfonso Gregory <gfunni234@gmail.com>
|
||||
Licensed under the MIT license:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
|
|
@ -98,13 +99,13 @@ NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end) {
|
|||
int i;
|
||||
XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1);
|
||||
if (ptr != end)
|
||||
return 0;
|
||||
return NULL;
|
||||
*p = 0;
|
||||
if (streqci(buf, KW_UTF_16) && enc->minBytesPerChar == 2)
|
||||
return enc;
|
||||
i = getEncodingIndex(buf);
|
||||
if (i == UNKNOWN_ENC)
|
||||
return 0;
|
||||
return NULL;
|
||||
return NS(encodings)[i];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ origin:
|
|||
name: libexpat
|
||||
description: Expat is an XML parser.
|
||||
url: https://github.com/libexpat/libexpat
|
||||
release: R_2_6_4 (2024-11-07T02:31:34+01:00).
|
||||
revision: R_2_6_4
|
||||
release: R_2_7_4 (2026-01-31T12:16:55+01:00).
|
||||
revision: R_2_7_4
|
||||
license: MIT
|
||||
license-file: COPYING
|
||||
|
||||
|
|
@ -27,6 +27,7 @@ vendoring:
|
|||
- "**"
|
||||
- expat/lib/Makefile.am
|
||||
- expat/lib/libexpat.def.cmake
|
||||
- expat/lib/libexpat.map.in
|
||||
|
||||
include:
|
||||
- AUTHORS
|
||||
|
|
@ -39,6 +40,7 @@ vendoring:
|
|||
- expat_config.h
|
||||
- expat_config_moz.h
|
||||
- expat_config_rlbox.h
|
||||
- README_MOZILLA
|
||||
- rlbox_expat.h
|
||||
- rlbox_expat_types.h
|
||||
- sources.mozbuild
|
||||
|
|
@ -53,12 +55,10 @@ vendoring:
|
|||
- 03_dont_generate_salt.patch
|
||||
- 04_always_set_eventptrs.patch
|
||||
- 05_getcurrentbyteindex.patch
|
||||
- 06_report_processing_entity.patch
|
||||
- 07_always_store_rawnames.patch
|
||||
- 08_dont_ignore_undeclared_entity.patch
|
||||
- 09_include_xmlns.patch
|
||||
- 10_internalsubset.patch
|
||||
- 11_nested_entities.patch
|
||||
- 12_version_limit.patch
|
||||
- 13_no_debug_report.patch
|
||||
- 14_unused.patch
|
||||
- 06_always_store_rawnames.patch
|
||||
- 07_dont_ignore_undeclared_entity.patch
|
||||
- 08_include_xmlns.patch
|
||||
- 09_internalsubset.patch
|
||||
- 10_version_limit.patch
|
||||
- 11_no_debug_report.patch
|
||||
- 12_unused.patch
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue