7
7
|_| XML parser
8
8
9
9
Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
10
- Copyright (c) 2000-2017 Expat development team
10
+ Copyright (c) 2000 Clark Cooper <[email protected] >
11
+ Copyright (c) 2000-2005 Fred L. Drake, Jr. <[email protected] >
12
+ Copyright (c) 2001-2002 Greg Stein <[email protected] >
13
+ Copyright (c) 2002-2016 Karl Waclawek <[email protected] >
14
+ Copyright (c) 2016-2021 Sebastian Pipping <[email protected] >
15
+ Copyright (c) 2016 Cristian Rodríguez <[email protected] >
16
+ Copyright (c) 2016 Thomas Beutlich <[email protected] >
17
+ Copyright (c) 2017 Rhodri James <[email protected] >
11
18
Licensed under the MIT license:
12
19
13
20
Permission is hereby granted, free of charge, to any person obtaining
@@ -115,7 +122,11 @@ enum XML_Error {
115
122
XML_ERROR_RESERVED_PREFIX_XMLNS,
116
123
XML_ERROR_RESERVED_NAMESPACE_URI,
117
124
/* Added in 2.2.1. */
118
- XML_ERROR_INVALID_ARGUMENT
125
+ XML_ERROR_INVALID_ARGUMENT,
126
+ /* Added in 2.3.0. */
127
+ XML_ERROR_NO_BUFFER,
128
+ /* Added in 2.4.0. */
129
+ XML_ERROR_AMPLIFICATION_LIMIT_BREACH
119
130
};
120
131
121
132
enum XML_Content_Type {
@@ -318,7 +329,7 @@ typedef void(XMLCALL *XML_EndDoctypeDeclHandler)(void *userData);
318
329
319
330
For internal entities (<!ENTITY foo "bar">), value will
320
331
be non-NULL and systemId, publicID, and notationName will be NULL.
321
- The value string is NOT nul -terminated; the length is provided in
332
+ The value string is NOT null -terminated; the length is provided in
322
333
the value_length argument. Since it is legal to have zero-length
323
334
values, do not use this argument to test for internal entities.
324
335
@@ -513,7 +524,7 @@ typedef struct {
513
524
Otherwise it must return XML_STATUS_ERROR.
514
525
515
526
If info does not describe a suitable encoding, then the parser will
516
- return an XML_UNKNOWN_ENCODING error.
527
+ return an XML_ERROR_UNKNOWN_ENCODING error.
517
528
*/
518
529
typedef int (XMLCALL *XML_UnknownEncodingHandler)(void *encodingHandlerData,
519
530
const XML_Char *name,
@@ -707,7 +718,7 @@ XML_GetBase(XML_Parser parser);
707
718
/* Returns the number of the attribute/value pairs passed in last call
708
719
to the XML_StartElementHandler that were specified in the start-tag
709
720
rather than defaulted. Each attribute/value pair counts as 2; thus
710
- this correspondds to an index into the atts array passed to the
721
+ this corresponds to an index into the atts array passed to the
711
722
XML_StartElementHandler. Returns -1 if parser == NULL.
712
723
*/
713
724
XMLPARSEAPI (int )
@@ -716,7 +727,7 @@ XML_GetSpecifiedAttributeCount(XML_Parser parser);
716
727
/* Returns the index of the ID attribute passed in the last call to
717
728
XML_StartElementHandler, or -1 if there is no ID attribute or
718
729
parser == NULL. Each attribute/value pair counts as 2; thus this
719
- correspondds to an index into the atts array passed to the
730
+ corresponds to an index into the atts array passed to the
720
731
XML_StartElementHandler.
721
732
*/
722
733
XMLPARSEAPI (int )
@@ -997,7 +1008,10 @@ enum XML_FeatureEnum {
997
1008
XML_FEATURE_SIZEOF_XML_LCHAR,
998
1009
XML_FEATURE_NS,
999
1010
XML_FEATURE_LARGE_SIZE,
1000
- XML_FEATURE_ATTR_INFO
1011
+ XML_FEATURE_ATTR_INFO,
1012
+ /* Added in Expat 2.4.0. */
1013
+ XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT,
1014
+ XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT
1001
1015
/* Additional features must be added to the end of this enum. */
1002
1016
};
1003
1017
@@ -1010,12 +1024,24 @@ typedef struct {
1010
1024
XMLPARSEAPI (const XML_Feature *)
1011
1025
XML_GetFeatureList(void );
1012
1026
1027
+ #ifdef XML_DTD
1028
+ /* Added in Expat 2.4.0. */
1029
+ XMLPARSEAPI (XML_Bool)
1030
+ XML_SetBillionLaughsAttackProtectionMaximumAmplification(
1031
+ XML_Parser parser, float maximumAmplificationFactor);
1032
+
1033
+ /* Added in Expat 2.4.0. */
1034
+ XMLPARSEAPI (XML_Bool)
1035
+ XML_SetBillionLaughsAttackProtectionActivationThreshold(
1036
+ XML_Parser parser, unsigned long long activationThresholdBytes);
1037
+ #endif
1038
+
1013
1039
/* Expat follows the semantic versioning convention.
1014
1040
See http://semver.org.
1015
1041
*/
1016
1042
#define XML_MAJOR_VERSION 2
1017
- #define XML_MINOR_VERSION 2
1018
- #define XML_MICRO_VERSION 8
1043
+ #define XML_MINOR_VERSION 4
1044
+ #define XML_MICRO_VERSION 1
1019
1045
1020
1046
#ifdef __cplusplus
1021
1047
}
0 commit comments