77 |_| XML parser
88
99 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] > 1118 Licensed under the MIT license:
1219
1320 Permission is hereby granted, free of charge, to any person obtaining
@@ -115,7 +122,11 @@ enum XML_Error {
115122 XML_ERROR_RESERVED_PREFIX_XMLNS,
116123 XML_ERROR_RESERVED_NAMESPACE_URI,
117124 /* 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
119130};
120131
121132enum XML_Content_Type {
@@ -318,7 +329,7 @@ typedef void(XMLCALL *XML_EndDoctypeDeclHandler)(void *userData);
318329
319330 For internal entities (<!ENTITY foo "bar">), value will
320331 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
322333 the value_length argument. Since it is legal to have zero-length
323334 values, do not use this argument to test for internal entities.
324335
@@ -513,7 +524,7 @@ typedef struct {
513524 Otherwise it must return XML_STATUS_ERROR.
514525
515526 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.
517528*/
518529typedef int (XMLCALL *XML_UnknownEncodingHandler)(void *encodingHandlerData,
519530 const XML_Char *name,
@@ -707,7 +718,7 @@ XML_GetBase(XML_Parser parser);
707718/* Returns the number of the attribute/value pairs passed in last call
708719 to the XML_StartElementHandler that were specified in the start-tag
709720 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
711722 XML_StartElementHandler. Returns -1 if parser == NULL.
712723*/
713724XMLPARSEAPI (int )
@@ -716,7 +727,7 @@ XML_GetSpecifiedAttributeCount(XML_Parser parser);
716727/* Returns the index of the ID attribute passed in the last call to
717728 XML_StartElementHandler, or -1 if there is no ID attribute or
718729 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
720731 XML_StartElementHandler.
721732*/
722733XMLPARSEAPI (int )
@@ -997,7 +1008,10 @@ enum XML_FeatureEnum {
9971008 XML_FEATURE_SIZEOF_XML_LCHAR,
9981009 XML_FEATURE_NS,
9991010 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
10011015 /* Additional features must be added to the end of this enum. */
10021016};
10031017
@@ -1010,12 +1024,24 @@ typedef struct {
10101024XMLPARSEAPI (const XML_Feature *)
10111025XML_GetFeatureList(void );
10121026
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+
10131039/* Expat follows the semantic versioning convention.
10141040 See http://semver.org.
10151041*/
10161042#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
10191045
10201046#ifdef __cplusplus
10211047}
0 commit comments