Skip to content

Commit 94352e1

Browse files
committed
upgraded expat to release 2.1.0
1 parent 9666e37 commit 94352e1

5 files changed

Lines changed: 215 additions & 70 deletions

File tree

XML/include/Poco/XML/expat.h

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,29 @@ XML_GetSpecifiedAttributeCount(XML_Parser parser);
742742
XMLPARSEAPI(int)
743743
XML_GetIdAttributeIndex(XML_Parser parser);
744744

745+
#ifdef XML_ATTR_INFO
746+
/* Source file byte offsets for the start and end of attribute names and values.
747+
The value indices are exclusive of surrounding quotes; thus in a UTF-8 source
748+
file an attribute value of "blah" will yield:
749+
info->valueEnd - info->valueStart = 4 bytes.
750+
*/
751+
typedef struct {
752+
XML_Index nameStart; /* Offset to beginning of the attribute name. */
753+
XML_Index nameEnd; /* Offset after the attribute name's last byte. */
754+
XML_Index valueStart; /* Offset to beginning of the attribute value. */
755+
XML_Index valueEnd; /* Offset after the attribute value's last byte. */
756+
} XML_AttrInfo;
757+
758+
/* Returns an array of XML_AttrInfo structures for the attribute/value pairs
759+
passed in last call to the XML_StartElementHandler that were specified
760+
in the start-tag rather than defaulted. Each attribute/value pair counts
761+
as 1; thus the number of entries in the array is
762+
XML_GetSpecifiedAttributeCount(parser) / 2.
763+
*/
764+
XMLPARSEAPI(const XML_AttrInfo *)
765+
XML_GetAttributeInfo(XML_Parser parser);
766+
#endif
767+
745768
/* Parses some input. Returns XML_STATUS_ERROR if a fatal error is
746769
detected. The last call to XML_Parse must have isFinal true; len
747770
may be zero for this call (or any other).
@@ -883,6 +906,15 @@ XMLPARSEAPI(int)
883906
XML_SetParamEntityParsing(XML_Parser parser,
884907
enum XML_ParamEntityParsing parsing);
885908

909+
/* Sets the hash salt to use for internal hash calculations.
910+
Helps in preventing DoS attacks based on predicting hash
911+
function behavior. This must be called before parsing is started.
912+
Returns 1 if successful, 0 when called after parsing has started.
913+
*/
914+
XMLPARSEAPI(int)
915+
XML_SetHashSalt(XML_Parser parser,
916+
unsigned long hash_salt);
917+
886918
/* If XML_Parse or XML_ParseBuffer have returned XML_STATUS_ERROR, then
887919
XML_GetErrorCode returns information about the error.
888920
*/
@@ -984,7 +1016,8 @@ enum XML_FeatureEnum {
9841016
XML_FEATURE_SIZEOF_XML_CHAR,
9851017
XML_FEATURE_SIZEOF_XML_LCHAR,
9861018
XML_FEATURE_NS,
987-
XML_FEATURE_LARGE_SIZE
1019+
XML_FEATURE_LARGE_SIZE,
1020+
XML_FEATURE_ATTR_INFO
9881021
/* Additional features must be added to the end of this enum. */
9891022
};
9901023

@@ -1004,8 +1037,8 @@ XML_GetFeatureList(void);
10041037
change to major or minor version.
10051038
*/
10061039
#define XML_MAJOR_VERSION 2
1007-
#define XML_MINOR_VERSION 0
1008-
#define XML_MICRO_VERSION 1
1040+
#define XML_MINOR_VERSION 1
1041+
#define XML_MICRO_VERSION 0
10091042

10101043
#ifdef __cplusplus
10111044
}

0 commit comments

Comments
 (0)