diff options
author | Gregory P. Smith <greg@krypto.org> | 2012-07-14 21:12:35 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@krypto.org> | 2012-07-14 21:12:35 (GMT) |
commit | 7c6309c6afebecd9cefe7c547b87cf23abcbe2a3 (patch) | |
tree | 9852412a7bad47617cd0d42e01d37e3400229b04 /Modules/expat/expat.h | |
parent | 15810673dc33436cbf8d1a6a6f9622249845b205 (diff) | |
download | cpython-7c6309c6afebecd9cefe7c547b87cf23abcbe2a3.zip cpython-7c6309c6afebecd9cefe7c547b87cf23abcbe2a3.tar.gz cpython-7c6309c6afebecd9cefe7c547b87cf23abcbe2a3.tar.bz2 |
Update the embedded copy of the expat XML parser to 2.1.0. It brings
with it a vareity of bug fixes, both security and behavior. See
http://www.libexpat.org/ for the list.
NOTE: I already backported the expat hash randomization fix in March.
Fixes issue #14340.
Diffstat (limited to 'Modules/expat/expat.h')
-rw-r--r-- | Modules/expat/expat.h | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/Modules/expat/expat.h b/Modules/expat/expat.h index 89646d2..06b5de0 100644 --- a/Modules/expat/expat.h +++ b/Modules/expat/expat.h @@ -742,6 +742,29 @@ XML_GetSpecifiedAttributeCount(XML_Parser parser); XMLPARSEAPI(int) XML_GetIdAttributeIndex(XML_Parser parser); +#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: + info->valueEnd - info->valueStart = 4 bytes. +*/ +typedef struct { + XML_Index nameStart; /* Offset to beginning of the attribute name. */ + XML_Index nameEnd; /* Offset after the attribute name's last byte. */ + XML_Index valueStart; /* Offset to beginning of the attribute value. */ + XML_Index valueEnd; /* Offset after the attribute value's last byte. */ +} XML_AttrInfo; + +/* Returns an array of XML_AttrInfo structures for the attribute/value pairs + passed in last call to the XML_StartElementHandler that were specified + in the start-tag rather than defaulted. Each attribute/value pair counts + as 1; thus the number of entries in the array is + XML_GetSpecifiedAttributeCount(parser) / 2. +*/ +XMLPARSEAPI(const XML_AttrInfo *) +XML_GetAttributeInfo(XML_Parser parser); +#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 may be zero for this call (or any other). @@ -994,7 +1017,9 @@ enum XML_FeatureEnum { XML_FEATURE_MIN_SIZE, XML_FEATURE_SIZEOF_XML_CHAR, XML_FEATURE_SIZEOF_XML_LCHAR, - XML_FEATURE_NS + XML_FEATURE_NS, + XML_FEATURE_LARGE_SIZE, + XML_FEATURE_ATTR_INFO /* Additional features must be added to the end of this enum. */ }; @@ -1014,7 +1039,7 @@ XML_GetFeatureList(void); change to major or minor version. */ #define XML_MAJOR_VERSION 2 -#define XML_MINOR_VERSION 0 +#define XML_MINOR_VERSION 1 #define XML_MICRO_VERSION 0 #ifdef __cplusplus |