1919 Copyright (c) 2023 Hanno Böck <hanno@gentoo.org>
2020 Copyright (c) 2023 Sony Corporation / Snild Dolkow <snild@sony.com>
2121 Copyright (c) 2024 Taichi Haradaguchi <20001722@ymail.ne.jp>
22+ Copyright (c) 2025 Matthew Fernandez <matthew.fernandez@gmail.com>
2223 Licensed under the MIT license:
2324
2425 Permission is hereby granted, free of charge, to any person obtaining
25- a copy of this software and associated documentation files (the
26+ a copy of this software and associated documentation files (the
2627 "Software"), to deal in the Software without restriction, including
2728 without limitation the rights to use, copy, modify, merge, publish,
2829 distribute, sublicense, and/or sell copies of the Software, and to permit
4243*/
4344
4445#ifndef Expat_INCLUDED
45- #define Expat_INCLUDED 1
46+ # define Expat_INCLUDED 1
4647
47- #include < stdlib.h>
48- #include " expat_external.h"
48+ # include < stdlib.h>
49+ # include " expat_external.h"
4950
50- #ifdef __cplusplus
51+ # ifdef __cplusplus
5152extern " C" {
52- #endif
53+ # endif
5354
5455struct XML_ParserStruct ;
5556typedef struct XML_ParserStruct *XML_Parser;
5657
5758typedef unsigned char XML_Bool;
58- #define XML_TRUE ((XML_Bool)1 )
59- #define XML_FALSE ((XML_Bool)0 )
59+ # define XML_TRUE ((XML_Bool)1 )
60+ # define XML_FALSE ((XML_Bool)0 )
6061
6162/* The XML_Status enum gives the possible return values for several
6263 API functions. The preprocessor #defines are included so this
@@ -73,11 +74,11 @@ typedef unsigned char XML_Bool;
7374*/
7475enum XML_Status {
7576 XML_STATUS_ERROR = 0 ,
76- #define XML_STATUS_ERROR XML_STATUS_ERROR
77+ # define XML_STATUS_ERROR XML_STATUS_ERROR
7778 XML_STATUS_OK = 1 ,
78- #define XML_STATUS_OK XML_STATUS_OK
79+ # define XML_STATUS_OK XML_STATUS_OK
7980 XML_STATUS_SUSPENDED = 2
80- #define XML_STATUS_SUSPENDED XML_STATUS_SUSPENDED
81+ # define XML_STATUS_SUSPENDED XML_STATUS_SUSPENDED
8182};
8283
8384enum XML_Error {
@@ -276,7 +277,7 @@ XML_ParserCreate_MM(const XML_Char *encoding,
276277
277278/* Prepare a parser object to be reused. This is particularly
278279 valuable when memory allocation overhead is disproportionately high,
279- such as when a large number of small documnents need to be parsed.
280+ such as when a large number of small documents need to be parsed.
280281 All handlers are cleared from the parser, except for the
281282 unknownEncodingHandler. The parser's external state is re-initialized
282283 except for the values of ns and ns_triplets.
@@ -680,7 +681,7 @@ XMLPARSEAPI(void)
680681XML_SetUserData(XML_Parser parser, void *userData);
681682
682683/* Returns the last value set by XML_SetUserData or NULL. */
683- #define XML_GetUserData (parser ) (*(void **)(parser))
684+ # define XML_GetUserData (parser ) (*(void **)(parser))
684685
685686/* This is equivalent to supplying an encoding argument to
686687 XML_ParserCreate. On success XML_SetEncoding returns non-zero,
@@ -752,7 +753,7 @@ XML_GetSpecifiedAttributeCount(XML_Parser parser);
752753XMLPARSEAPI (int )
753754XML_GetIdAttributeIndex(XML_Parser parser);
754755
755- #ifdef XML_ATTR_INFO
756+ # ifdef XML_ATTR_INFO
756757/* Source file byte offsets for the start and end of attribute names and values.
757758 The value indices are exclusive of surrounding quotes; thus in a UTF-8 source
758759 file an attribute value of "blah" will yield:
@@ -773,7 +774,7 @@ typedef struct {
773774*/
774775XMLPARSEAPI (const XML_AttrInfo *)
775776XML_GetAttributeInfo(XML_Parser parser);
776- #endif
777+ # endif
777778
778779/* Parses some input. Returns XML_STATUS_ERROR if a fatal error is
779780 detected. The last call to XML_Parse must have isFinal true; len
@@ -970,9 +971,9 @@ XMLPARSEAPI(const char *)
970971XML_GetInputContext(XML_Parser parser, int *offset, int *size);
971972
972973/* For backwards compatibility with previous versions. */
973- #define XML_GetErrorLineNumber XML_GetCurrentLineNumber
974- #define XML_GetErrorColumnNumber XML_GetCurrentColumnNumber
975- #define XML_GetErrorByteIndex XML_GetCurrentByteIndex
974+ # define XML_GetErrorLineNumber XML_GetCurrentLineNumber
975+ # define XML_GetErrorColumnNumber XML_GetCurrentColumnNumber
976+ # define XML_GetErrorByteIndex XML_GetCurrentByteIndex
976977
977978/* Frees the content model passed to the element declaration handler */
978979XMLPARSEAPI (void )
@@ -1032,7 +1033,10 @@ enum XML_FeatureEnum {
10321033 XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT,
10331034 XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT,
10341035 /* Added in Expat 2.6.0. */
1035- XML_FEATURE_GE
1036+ XML_FEATURE_GE,
1037+ /* Added in Expat 2.7.2. */
1038+ XML_FEATURE_ALLOC_TRACKER_MAXIMUM_AMPLIFICATION_DEFAULT,
1039+ XML_FEATURE_ALLOC_TRACKER_ACTIVATION_THRESHOLD_DEFAULT,
10361040 /* Additional features must be added to the end of this enum. */
10371041};
10381042
@@ -1045,7 +1049,7 @@ typedef struct {
10451049XMLPARSEAPI (const XML_Feature *)
10461050XML_GetFeatureList(void );
10471051
1048- #if defined(XML_DTD) || (defined(XML_GE) && XML_GE == 1)
1052+ # if defined(XML_DTD) || (defined(XML_GE) && XML_GE == 1)
10491053/* Added in Expat 2.4.0 for XML_DTD defined and
10501054 * added in Expat 2.6.0 for XML_GE == 1. */
10511055XMLPARSEAPI (XML_Bool)
@@ -1057,7 +1061,17 @@ XML_SetBillionLaughsAttackProtectionMaximumAmplification(
10571061XMLPARSEAPI (XML_Bool)
10581062XML_SetBillionLaughsAttackProtectionActivationThreshold(
10591063 XML_Parser parser, unsigned long long activationThresholdBytes);
1060- #endif
1064+
1065+ /* Added in Expat 2.7.2. */
1066+ XMLPARSEAPI (XML_Bool)
1067+ XML_SetAllocTrackerMaximumAmplification(XML_Parser parser,
1068+ float maximumAmplificationFactor);
1069+
1070+ /* Added in Expat 2.7.2. */
1071+ XMLPARSEAPI (XML_Bool)
1072+ XML_SetAllocTrackerActivationThreshold(
1073+ XML_Parser parser, unsigned long long activationThresholdBytes);
1074+ # endif
10611075
10621076/* Added in Expat 2.6.0. */
10631077XMLPARSEAPI (XML_Bool)
@@ -1066,12 +1080,12 @@ XML_SetReparseDeferralEnabled(XML_Parser parser, XML_Bool enabled);
10661080/* Expat follows the semantic versioning convention.
10671081 See https://semver.org
10681082*/
1069- #define XML_MAJOR_VERSION 2
1070- #define XML_MINOR_VERSION 7
1071- #define XML_MICRO_VERSION 1
1083+ # define XML_MAJOR_VERSION 2
1084+ # define XML_MINOR_VERSION 7
1085+ # define XML_MICRO_VERSION 3
10721086
1073- #ifdef __cplusplus
1087+ # ifdef __cplusplus
10741088}
1075- #endif
1089+ # endif
10761090
10771091#endif /* not Expat_INCLUDED */
0 commit comments