Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-05-18 08:29:50

0001 /*
0002                             __  __            _
0003                          ___\ \/ /_ __   __ _| |_
0004                         / _ \\  /| '_ \ / _` | __|
0005                        |  __//  \| |_) | (_| | |_
0006                         \___/_/\_\ .__/ \__,_|\__|
0007                                  |_| XML parser
0008 
0009    Copyright (c) 1997-2000 Thai Open Source Software Center Ltd
0010    Copyright (c) 2000      Clark Cooper <coopercc@users.sourceforge.net>
0011    Copyright (c) 2000-2005 Fred L. Drake, Jr. <fdrake@users.sourceforge.net>
0012    Copyright (c) 2001-2002 Greg Stein <gstein@users.sourceforge.net>
0013    Copyright (c) 2002-2016 Karl Waclawek <karl@waclawek.net>
0014    Copyright (c) 2016-2022 Sebastian Pipping <sebastian@pipping.org>
0015    Copyright (c) 2016      Cristian Rodríguez <crrodriguez@opensuse.org>
0016    Copyright (c) 2016      Thomas Beutlich <tc@tbeu.de>
0017    Copyright (c) 2017      Rhodri James <rhodri@wildebeest.org.uk>
0018    Copyright (c) 2022      Thijs Schreijer <thijs@thijsschreijer.nl>
0019    Licensed under the MIT license:
0020 
0021    Permission is  hereby granted,  free of charge,  to any  person obtaining
0022    a  copy  of  this  software   and  associated  documentation  files  (the
0023    "Software"),  to  deal in  the  Software  without restriction,  including
0024    without  limitation the  rights  to use,  copy,  modify, merge,  publish,
0025    distribute, sublicense, and/or sell copies of the Software, and to permit
0026    persons  to whom  the Software  is  furnished to  do so,  subject to  the
0027    following conditions:
0028 
0029    The above copyright  notice and this permission notice  shall be included
0030    in all copies or substantial portions of the Software.
0031 
0032    THE  SOFTWARE  IS  PROVIDED  "AS  IS",  WITHOUT  WARRANTY  OF  ANY  KIND,
0033    EXPRESS  OR IMPLIED,  INCLUDING  BUT  NOT LIMITED  TO  THE WARRANTIES  OF
0034    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
0035    NO EVENT SHALL THE AUTHORS OR  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
0036    DAMAGES OR  OTHER LIABILITY, WHETHER  IN AN  ACTION OF CONTRACT,  TORT OR
0037    OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
0038    USE OR OTHER DEALINGS IN THE SOFTWARE.
0039 */
0040 
0041 #ifndef Expat_INCLUDED
0042 #define Expat_INCLUDED 1
0043 
0044 #include <stdlib.h>
0045 #include "expat_external.h"
0046 
0047 #ifdef __cplusplus
0048 extern "C" {
0049 #endif
0050 
0051 struct XML_ParserStruct;
0052 typedef struct XML_ParserStruct *XML_Parser;
0053 
0054 typedef unsigned char XML_Bool;
0055 #define XML_TRUE ((XML_Bool)1)
0056 #define XML_FALSE ((XML_Bool)0)
0057 
0058 /* The XML_Status enum gives the possible return values for several
0059    API functions.  The preprocessor #defines are included so this
0060    stanza can be added to code that still needs to support older
0061    versions of Expat 1.95.x:
0062 
0063    #ifndef XML_STATUS_OK
0064    #define XML_STATUS_OK    1
0065    #define XML_STATUS_ERROR 0
0066    #endif
0067 
0068    Otherwise, the #define hackery is quite ugly and would have been
0069    dropped.
0070 */
0071 enum XML_Status {
0072   XML_STATUS_ERROR = 0,
0073 #define XML_STATUS_ERROR XML_STATUS_ERROR
0074   XML_STATUS_OK = 1,
0075 #define XML_STATUS_OK XML_STATUS_OK
0076   XML_STATUS_SUSPENDED = 2
0077 #define XML_STATUS_SUSPENDED XML_STATUS_SUSPENDED
0078 };
0079 
0080 enum XML_Error {
0081   XML_ERROR_NONE,
0082   XML_ERROR_NO_MEMORY,
0083   XML_ERROR_SYNTAX,
0084   XML_ERROR_NO_ELEMENTS,
0085   XML_ERROR_INVALID_TOKEN,
0086   XML_ERROR_UNCLOSED_TOKEN,
0087   XML_ERROR_PARTIAL_CHAR,
0088   XML_ERROR_TAG_MISMATCH,
0089   XML_ERROR_DUPLICATE_ATTRIBUTE,
0090   XML_ERROR_JUNK_AFTER_DOC_ELEMENT,
0091   XML_ERROR_PARAM_ENTITY_REF,
0092   XML_ERROR_UNDEFINED_ENTITY,
0093   XML_ERROR_RECURSIVE_ENTITY_REF,
0094   XML_ERROR_ASYNC_ENTITY,
0095   XML_ERROR_BAD_CHAR_REF,
0096   XML_ERROR_BINARY_ENTITY_REF,
0097   XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF,
0098   XML_ERROR_MISPLACED_XML_PI,
0099   XML_ERROR_UNKNOWN_ENCODING,
0100   XML_ERROR_INCORRECT_ENCODING,
0101   XML_ERROR_UNCLOSED_CDATA_SECTION,
0102   XML_ERROR_EXTERNAL_ENTITY_HANDLING,
0103   XML_ERROR_NOT_STANDALONE,
0104   XML_ERROR_UNEXPECTED_STATE,
0105   XML_ERROR_ENTITY_DECLARED_IN_PE,
0106   XML_ERROR_FEATURE_REQUIRES_XML_DTD,
0107   XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING,
0108   /* Added in 1.95.7. */
0109   XML_ERROR_UNBOUND_PREFIX,
0110   /* Added in 1.95.8. */
0111   XML_ERROR_UNDECLARING_PREFIX,
0112   XML_ERROR_INCOMPLETE_PE,
0113   XML_ERROR_XML_DECL,
0114   XML_ERROR_TEXT_DECL,
0115   XML_ERROR_PUBLICID,
0116   XML_ERROR_SUSPENDED,
0117   XML_ERROR_NOT_SUSPENDED,
0118   XML_ERROR_ABORTED,
0119   XML_ERROR_FINISHED,
0120   XML_ERROR_SUSPEND_PE,
0121   /* Added in 2.0. */
0122   XML_ERROR_RESERVED_PREFIX_XML,
0123   XML_ERROR_RESERVED_PREFIX_XMLNS,
0124   XML_ERROR_RESERVED_NAMESPACE_URI,
0125   /* Added in 2.2.1. */
0126   XML_ERROR_INVALID_ARGUMENT,
0127   /* Added in 2.3.0. */
0128   XML_ERROR_NO_BUFFER,
0129   /* Added in 2.4.0. */
0130   XML_ERROR_AMPLIFICATION_LIMIT_BREACH
0131 };
0132 
0133 enum XML_Content_Type {
0134   XML_CTYPE_EMPTY = 1,
0135   XML_CTYPE_ANY,
0136   XML_CTYPE_MIXED,
0137   XML_CTYPE_NAME,
0138   XML_CTYPE_CHOICE,
0139   XML_CTYPE_SEQ
0140 };
0141 
0142 enum XML_Content_Quant {
0143   XML_CQUANT_NONE,
0144   XML_CQUANT_OPT,
0145   XML_CQUANT_REP,
0146   XML_CQUANT_PLUS
0147 };
0148 
0149 /* If type == XML_CTYPE_EMPTY or XML_CTYPE_ANY, then quant will be
0150    XML_CQUANT_NONE, and the other fields will be zero or NULL.
0151    If type == XML_CTYPE_MIXED, then quant will be NONE or REP and
0152    numchildren will contain number of elements that may be mixed in
0153    and children point to an array of XML_Content cells that will be
0154    all of XML_CTYPE_NAME type with no quantification.
0155 
0156    If type == XML_CTYPE_NAME, then the name points to the name, and
0157    the numchildren field will be zero and children will be NULL. The
0158    quant fields indicates any quantifiers placed on the name.
0159 
0160    CHOICE and SEQ will have name NULL, the number of children in
0161    numchildren and children will point, recursively, to an array
0162    of XML_Content cells.
0163 
0164    The EMPTY, ANY, and MIXED types will only occur at top level.
0165 */
0166 
0167 typedef struct XML_cp XML_Content;
0168 
0169 struct XML_cp {
0170   enum XML_Content_Type type;
0171   enum XML_Content_Quant quant;
0172   XML_Char *name;
0173   unsigned int numchildren;
0174   XML_Content *children;
0175 };
0176 
0177 /* This is called for an element declaration. See above for
0178    description of the model argument. It's the user code's responsibility
0179    to free model when finished with it. See XML_FreeContentModel.
0180    There is no need to free the model from the handler, it can be kept
0181    around and freed at a later stage.
0182 */
0183 typedef void(XMLCALL *XML_ElementDeclHandler)(void *userData,
0184                                               const XML_Char *name,
0185                                               XML_Content *model);
0186 
0187 XMLPARSEAPI(void)
0188 XML_SetElementDeclHandler(XML_Parser parser, XML_ElementDeclHandler eldecl);
0189 
0190 /* The Attlist declaration handler is called for *each* attribute. So
0191    a single Attlist declaration with multiple attributes declared will
0192    generate multiple calls to this handler. The "default" parameter
0193    may be NULL in the case of the "#IMPLIED" or "#REQUIRED"
0194    keyword. The "isrequired" parameter will be true and the default
0195    value will be NULL in the case of "#REQUIRED". If "isrequired" is
0196    true and default is non-NULL, then this is a "#FIXED" default.
0197 */
0198 typedef void(XMLCALL *XML_AttlistDeclHandler)(
0199     void *userData, const XML_Char *elname, const XML_Char *attname,
0200     const XML_Char *att_type, const XML_Char *dflt, int isrequired);
0201 
0202 XMLPARSEAPI(void)
0203 XML_SetAttlistDeclHandler(XML_Parser parser, XML_AttlistDeclHandler attdecl);
0204 
0205 /* The XML declaration handler is called for *both* XML declarations
0206    and text declarations. The way to distinguish is that the version
0207    parameter will be NULL for text declarations. The encoding
0208    parameter may be NULL for XML declarations. The standalone
0209    parameter will be -1, 0, or 1 indicating respectively that there
0210    was no standalone parameter in the declaration, that it was given
0211    as no, or that it was given as yes.
0212 */
0213 typedef void(XMLCALL *XML_XmlDeclHandler)(void *userData,
0214                                           const XML_Char *version,
0215                                           const XML_Char *encoding,
0216                                           int standalone);
0217 
0218 XMLPARSEAPI(void)
0219 XML_SetXmlDeclHandler(XML_Parser parser, XML_XmlDeclHandler xmldecl);
0220 
0221 typedef struct {
0222   void *(*malloc_fcn)(size_t size);
0223   void *(*realloc_fcn)(void *ptr, size_t size);
0224   void (*free_fcn)(void *ptr);
0225 } XML_Memory_Handling_Suite;
0226 
0227 /* Constructs a new parser; encoding is the encoding specified by the
0228    external protocol or NULL if there is none specified.
0229 */
0230 XMLPARSEAPI(XML_Parser)
0231 XML_ParserCreate(const XML_Char *encoding);
0232 
0233 /* Constructs a new parser and namespace processor.  Element type
0234    names and attribute names that belong to a namespace will be
0235    expanded; unprefixed attribute names are never expanded; unprefixed
0236    element type names are expanded only if there is a default
0237    namespace. The expanded name is the concatenation of the namespace
0238    URI, the namespace separator character, and the local part of the
0239    name.  If the namespace separator is '\0' then the namespace URI
0240    and the local part will be concatenated without any separator.
0241    It is a programming error to use the separator '\0' with namespace
0242    triplets (see XML_SetReturnNSTriplet).
0243    If a namespace separator is chosen that can be part of a URI or
0244    part of an XML name, splitting an expanded name back into its
0245    1, 2 or 3 original parts on application level in the element handler
0246    may end up vulnerable, so these are advised against;  sane choices for
0247    a namespace separator are e.g. '\n' (line feed) and '|' (pipe).
0248 
0249    Note that Expat does not validate namespace URIs (beyond encoding)
0250    against RFC 3986 today (and is not required to do so with regard to
0251    the XML 1.0 namespaces specification) but it may start doing that
0252    in future releases.  Before that, an application using Expat must
0253    be ready to receive namespace URIs containing non-URI characters.
0254 */
0255 XMLPARSEAPI(XML_Parser)
0256 XML_ParserCreateNS(const XML_Char *encoding, XML_Char namespaceSeparator);
0257 
0258 /* Constructs a new parser using the memory management suite referred to
0259    by memsuite. If memsuite is NULL, then use the standard library memory
0260    suite. If namespaceSeparator is non-NULL it creates a parser with
0261    namespace processing as described above. The character pointed at
0262    will serve as the namespace separator.
0263 
0264    All further memory operations used for the created parser will come from
0265    the given suite.
0266 */
0267 XMLPARSEAPI(XML_Parser)
0268 XML_ParserCreate_MM(const XML_Char *encoding,
0269                     const XML_Memory_Handling_Suite *memsuite,
0270                     const XML_Char *namespaceSeparator);
0271 
0272 /* Prepare a parser object to be re-used.  This is particularly
0273    valuable when memory allocation overhead is disproportionately high,
0274    such as when a large number of small documnents need to be parsed.
0275    All handlers are cleared from the parser, except for the
0276    unknownEncodingHandler. The parser's external state is re-initialized
0277    except for the values of ns and ns_triplets.
0278 
0279    Added in Expat 1.95.3.
0280 */
0281 XMLPARSEAPI(XML_Bool)
0282 XML_ParserReset(XML_Parser parser, const XML_Char *encoding);
0283 
0284 /* atts is array of name/value pairs, terminated by 0;
0285    names and values are 0 terminated.
0286 */
0287 typedef void(XMLCALL *XML_StartElementHandler)(void *userData,
0288                                                const XML_Char *name,
0289                                                const XML_Char **atts);
0290 
0291 typedef void(XMLCALL *XML_EndElementHandler)(void *userData,
0292                                              const XML_Char *name);
0293 
0294 /* s is not 0 terminated. */
0295 typedef void(XMLCALL *XML_CharacterDataHandler)(void *userData,
0296                                                 const XML_Char *s, int len);
0297 
0298 /* target and data are 0 terminated */
0299 typedef void(XMLCALL *XML_ProcessingInstructionHandler)(void *userData,
0300                                                         const XML_Char *target,
0301                                                         const XML_Char *data);
0302 
0303 /* data is 0 terminated */
0304 typedef void(XMLCALL *XML_CommentHandler)(void *userData, const XML_Char *data);
0305 
0306 typedef void(XMLCALL *XML_StartCdataSectionHandler)(void *userData);
0307 typedef void(XMLCALL *XML_EndCdataSectionHandler)(void *userData);
0308 
0309 /* This is called for any characters in the XML document for which
0310    there is no applicable handler.  This includes both characters that
0311    are part of markup which is of a kind that is not reported
0312    (comments, markup declarations), or characters that are part of a
0313    construct which could be reported but for which no handler has been
0314    supplied. The characters are passed exactly as they were in the XML
0315    document except that they will be encoded in UTF-8 or UTF-16.
0316    Line boundaries are not normalized. Note that a byte order mark
0317    character is not passed to the default handler. There are no
0318    guarantees about how characters are divided between calls to the
0319    default handler: for example, a comment might be split between
0320    multiple calls.
0321 */
0322 typedef void(XMLCALL *XML_DefaultHandler)(void *userData, const XML_Char *s,
0323                                           int len);
0324 
0325 /* This is called for the start of the DOCTYPE declaration, before
0326    any DTD or internal subset is parsed.
0327 */
0328 typedef void(XMLCALL *XML_StartDoctypeDeclHandler)(void *userData,
0329                                                    const XML_Char *doctypeName,
0330                                                    const XML_Char *sysid,
0331                                                    const XML_Char *pubid,
0332                                                    int has_internal_subset);
0333 
0334 /* This is called for the end of the DOCTYPE declaration when the
0335    closing > is encountered, but after processing any external
0336    subset.
0337 */
0338 typedef void(XMLCALL *XML_EndDoctypeDeclHandler)(void *userData);
0339 
0340 /* This is called for entity declarations. The is_parameter_entity
0341    argument will be non-zero if the entity is a parameter entity, zero
0342    otherwise.
0343 
0344    For internal entities (<!ENTITY foo "bar">), value will
0345    be non-NULL and systemId, publicID, and notationName will be NULL.
0346    The value string is NOT null-terminated; the length is provided in
0347    the value_length argument. Since it is legal to have zero-length
0348    values, do not use this argument to test for internal entities.
0349 
0350    For external entities, value will be NULL and systemId will be
0351    non-NULL. The publicId argument will be NULL unless a public
0352    identifier was provided. The notationName argument will have a
0353    non-NULL value only for unparsed entity declarations.
0354 
0355    Note that is_parameter_entity can't be changed to XML_Bool, since
0356    that would break binary compatibility.
0357 */
0358 typedef void(XMLCALL *XML_EntityDeclHandler)(
0359     void *userData, const XML_Char *entityName, int is_parameter_entity,
0360     const XML_Char *value, int value_length, const XML_Char *base,
0361     const XML_Char *systemId, const XML_Char *publicId,
0362     const XML_Char *notationName);
0363 
0364 XMLPARSEAPI(void)
0365 XML_SetEntityDeclHandler(XML_Parser parser, XML_EntityDeclHandler handler);
0366 
0367 /* OBSOLETE -- OBSOLETE -- OBSOLETE
0368    This handler has been superseded by the EntityDeclHandler above.
0369    It is provided here for backward compatibility.
0370 
0371    This is called for a declaration of an unparsed (NDATA) entity.
0372    The base argument is whatever was set by XML_SetBase. The
0373    entityName, systemId and notationName arguments will never be
0374    NULL. The other arguments may be.
0375 */
0376 typedef void(XMLCALL *XML_UnparsedEntityDeclHandler)(
0377     void *userData, const XML_Char *entityName, const XML_Char *base,
0378     const XML_Char *systemId, const XML_Char *publicId,
0379     const XML_Char *notationName);
0380 
0381 /* This is called for a declaration of notation.  The base argument is
0382    whatever was set by XML_SetBase. The notationName will never be
0383    NULL.  The other arguments can be.
0384 */
0385 typedef void(XMLCALL *XML_NotationDeclHandler)(void *userData,
0386                                                const XML_Char *notationName,
0387                                                const XML_Char *base,
0388                                                const XML_Char *systemId,
0389                                                const XML_Char *publicId);
0390 
0391 /* When namespace processing is enabled, these are called once for
0392    each namespace declaration. The call to the start and end element
0393    handlers occur between the calls to the start and end namespace
0394    declaration handlers. For an xmlns attribute, prefix will be
0395    NULL.  For an xmlns="" attribute, uri will be NULL.
0396 */
0397 typedef void(XMLCALL *XML_StartNamespaceDeclHandler)(void *userData,
0398                                                      const XML_Char *prefix,
0399                                                      const XML_Char *uri);
0400 
0401 typedef void(XMLCALL *XML_EndNamespaceDeclHandler)(void *userData,
0402                                                    const XML_Char *prefix);
0403 
0404 /* This is called if the document is not standalone, that is, it has an
0405    external subset or a reference to a parameter entity, but does not
0406    have standalone="yes". If this handler returns XML_STATUS_ERROR,
0407    then processing will not continue, and the parser will return a
0408    XML_ERROR_NOT_STANDALONE error.
0409    If parameter entity parsing is enabled, then in addition to the
0410    conditions above this handler will only be called if the referenced
0411    entity was actually read.
0412 */
0413 typedef int(XMLCALL *XML_NotStandaloneHandler)(void *userData);
0414 
0415 /* This is called for a reference to an external parsed general
0416    entity.  The referenced entity is not automatically parsed.  The
0417    application can parse it immediately or later using
0418    XML_ExternalEntityParserCreate.
0419 
0420    The parser argument is the parser parsing the entity containing the
0421    reference; it can be passed as the parser argument to
0422    XML_ExternalEntityParserCreate.  The systemId argument is the
0423    system identifier as specified in the entity declaration; it will
0424    not be NULL.
0425 
0426    The base argument is the system identifier that should be used as
0427    the base for resolving systemId if systemId was relative; this is
0428    set by XML_SetBase; it may be NULL.
0429 
0430    The publicId argument is the public identifier as specified in the
0431    entity declaration, or NULL if none was specified; the whitespace
0432    in the public identifier will have been normalized as required by
0433    the XML spec.
0434 
0435    The context argument specifies the parsing context in the format
0436    expected by the context argument to XML_ExternalEntityParserCreate;
0437    context is valid only until the handler returns, so if the
0438    referenced entity is to be parsed later, it must be copied.
0439    context is NULL only when the entity is a parameter entity.
0440 
0441    The handler should return XML_STATUS_ERROR if processing should not
0442    continue because of a fatal error in the handling of the external
0443    entity.  In this case the calling parser will return an
0444    XML_ERROR_EXTERNAL_ENTITY_HANDLING error.
0445 
0446    Note that unlike other handlers the first argument is the parser,
0447    not userData.
0448 */
0449 typedef int(XMLCALL *XML_ExternalEntityRefHandler)(XML_Parser parser,
0450                                                    const XML_Char *context,
0451                                                    const XML_Char *base,
0452                                                    const XML_Char *systemId,
0453                                                    const XML_Char *publicId);
0454 
0455 /* This is called in two situations:
0456    1) An entity reference is encountered for which no declaration
0457       has been read *and* this is not an error.
0458    2) An internal entity reference is read, but not expanded, because
0459       XML_SetDefaultHandler has been called.
0460    Note: skipped parameter entities in declarations and skipped general
0461          entities in attribute values cannot be reported, because
0462          the event would be out of sync with the reporting of the
0463          declarations or attribute values
0464 */
0465 typedef void(XMLCALL *XML_SkippedEntityHandler)(void *userData,
0466                                                 const XML_Char *entityName,
0467                                                 int is_parameter_entity);
0468 
0469 /* This structure is filled in by the XML_UnknownEncodingHandler to
0470    provide information to the parser about encodings that are unknown
0471    to the parser.
0472 
0473    The map[b] member gives information about byte sequences whose
0474    first byte is b.
0475 
0476    If map[b] is c where c is >= 0, then b by itself encodes the
0477    Unicode scalar value c.
0478 
0479    If map[b] is -1, then the byte sequence is malformed.
0480 
0481    If map[b] is -n, where n >= 2, then b is the first byte of an
0482    n-byte sequence that encodes a single Unicode scalar value.
0483 
0484    The data member will be passed as the first argument to the convert
0485    function.
0486 
0487    The convert function is used to convert multibyte sequences; s will
0488    point to a n-byte sequence where map[(unsigned char)*s] == -n.  The
0489    convert function must return the Unicode scalar value represented
0490    by this byte sequence or -1 if the byte sequence is malformed.
0491 
0492    The convert function may be NULL if the encoding is a single-byte
0493    encoding, that is if map[b] >= -1 for all bytes b.
0494 
0495    When the parser is finished with the encoding, then if release is
0496    not NULL, it will call release passing it the data member; once
0497    release has been called, the convert function will not be called
0498    again.
0499 
0500    Expat places certain restrictions on the encodings that are supported
0501    using this mechanism.
0502 
0503    1. Every ASCII character that can appear in a well-formed XML document,
0504       other than the characters
0505 
0506       $@\^`{}~
0507 
0508       must be represented by a single byte, and that byte must be the
0509       same byte that represents that character in ASCII.
0510 
0511    2. No character may require more than 4 bytes to encode.
0512 
0513    3. All characters encoded must have Unicode scalar values <=
0514       0xFFFF, (i.e., characters that would be encoded by surrogates in
0515       UTF-16 are  not allowed).  Note that this restriction doesn't
0516       apply to the built-in support for UTF-8 and UTF-16.
0517 
0518    4. No Unicode character may be encoded by more than one distinct
0519       sequence of bytes.
0520 */
0521 typedef struct {
0522   int map[256];
0523   void *data;
0524   int(XMLCALL *convert)(void *data, const char *s);
0525   void(XMLCALL *release)(void *data);
0526 } XML_Encoding;
0527 
0528 /* This is called for an encoding that is unknown to the parser.
0529 
0530    The encodingHandlerData argument is that which was passed as the
0531    second argument to XML_SetUnknownEncodingHandler.
0532 
0533    The name argument gives the name of the encoding as specified in
0534    the encoding declaration.
0535 
0536    If the callback can provide information about the encoding, it must
0537    fill in the XML_Encoding structure, and return XML_STATUS_OK.
0538    Otherwise it must return XML_STATUS_ERROR.
0539 
0540    If info does not describe a suitable encoding, then the parser will
0541    return an XML_ERROR_UNKNOWN_ENCODING error.
0542 */
0543 typedef int(XMLCALL *XML_UnknownEncodingHandler)(void *encodingHandlerData,
0544                                                  const XML_Char *name,
0545                                                  XML_Encoding *info);
0546 
0547 XMLPARSEAPI(void)
0548 XML_SetElementHandler(XML_Parser parser, XML_StartElementHandler start,
0549                       XML_EndElementHandler end);
0550 
0551 XMLPARSEAPI(void)
0552 XML_SetStartElementHandler(XML_Parser parser, XML_StartElementHandler handler);
0553 
0554 XMLPARSEAPI(void)
0555 XML_SetEndElementHandler(XML_Parser parser, XML_EndElementHandler handler);
0556 
0557 XMLPARSEAPI(void)
0558 XML_SetCharacterDataHandler(XML_Parser parser,
0559                             XML_CharacterDataHandler handler);
0560 
0561 XMLPARSEAPI(void)
0562 XML_SetProcessingInstructionHandler(XML_Parser parser,
0563                                     XML_ProcessingInstructionHandler handler);
0564 XMLPARSEAPI(void)
0565 XML_SetCommentHandler(XML_Parser parser, XML_CommentHandler handler);
0566 
0567 XMLPARSEAPI(void)
0568 XML_SetCdataSectionHandler(XML_Parser parser,
0569                            XML_StartCdataSectionHandler start,
0570                            XML_EndCdataSectionHandler end);
0571 
0572 XMLPARSEAPI(void)
0573 XML_SetStartCdataSectionHandler(XML_Parser parser,
0574                                 XML_StartCdataSectionHandler start);
0575 
0576 XMLPARSEAPI(void)
0577 XML_SetEndCdataSectionHandler(XML_Parser parser,
0578                               XML_EndCdataSectionHandler end);
0579 
0580 /* This sets the default handler and also inhibits expansion of
0581    internal entities. These entity references will be passed to the
0582    default handler, or to the skipped entity handler, if one is set.
0583 */
0584 XMLPARSEAPI(void)
0585 XML_SetDefaultHandler(XML_Parser parser, XML_DefaultHandler handler);
0586 
0587 /* This sets the default handler but does not inhibit expansion of
0588    internal entities.  The entity reference will not be passed to the
0589    default handler.
0590 */
0591 XMLPARSEAPI(void)
0592 XML_SetDefaultHandlerExpand(XML_Parser parser, XML_DefaultHandler handler);
0593 
0594 XMLPARSEAPI(void)
0595 XML_SetDoctypeDeclHandler(XML_Parser parser, XML_StartDoctypeDeclHandler start,
0596                           XML_EndDoctypeDeclHandler end);
0597 
0598 XMLPARSEAPI(void)
0599 XML_SetStartDoctypeDeclHandler(XML_Parser parser,
0600                                XML_StartDoctypeDeclHandler start);
0601 
0602 XMLPARSEAPI(void)
0603 XML_SetEndDoctypeDeclHandler(XML_Parser parser, XML_EndDoctypeDeclHandler end);
0604 
0605 XMLPARSEAPI(void)
0606 XML_SetUnparsedEntityDeclHandler(XML_Parser parser,
0607                                  XML_UnparsedEntityDeclHandler handler);
0608 
0609 XMLPARSEAPI(void)
0610 XML_SetNotationDeclHandler(XML_Parser parser, XML_NotationDeclHandler handler);
0611 
0612 XMLPARSEAPI(void)
0613 XML_SetNamespaceDeclHandler(XML_Parser parser,
0614                             XML_StartNamespaceDeclHandler start,
0615                             XML_EndNamespaceDeclHandler end);
0616 
0617 XMLPARSEAPI(void)
0618 XML_SetStartNamespaceDeclHandler(XML_Parser parser,
0619                                  XML_StartNamespaceDeclHandler start);
0620 
0621 XMLPARSEAPI(void)
0622 XML_SetEndNamespaceDeclHandler(XML_Parser parser,
0623                                XML_EndNamespaceDeclHandler end);
0624 
0625 XMLPARSEAPI(void)
0626 XML_SetNotStandaloneHandler(XML_Parser parser,
0627                             XML_NotStandaloneHandler handler);
0628 
0629 XMLPARSEAPI(void)
0630 XML_SetExternalEntityRefHandler(XML_Parser parser,
0631                                 XML_ExternalEntityRefHandler handler);
0632 
0633 /* If a non-NULL value for arg is specified here, then it will be
0634    passed as the first argument to the external entity ref handler
0635    instead of the parser object.
0636 */
0637 XMLPARSEAPI(void)
0638 XML_SetExternalEntityRefHandlerArg(XML_Parser parser, void *arg);
0639 
0640 XMLPARSEAPI(void)
0641 XML_SetSkippedEntityHandler(XML_Parser parser,
0642                             XML_SkippedEntityHandler handler);
0643 
0644 XMLPARSEAPI(void)
0645 XML_SetUnknownEncodingHandler(XML_Parser parser,
0646                               XML_UnknownEncodingHandler handler,
0647                               void *encodingHandlerData);
0648 
0649 /* This can be called within a handler for a start element, end
0650    element, processing instruction or character data.  It causes the
0651    corresponding markup to be passed to the default handler.
0652 */
0653 XMLPARSEAPI(void)
0654 XML_DefaultCurrent(XML_Parser parser);
0655 
0656 /* If do_nst is non-zero, and namespace processing is in effect, and
0657    a name has a prefix (i.e. an explicit namespace qualifier) then
0658    that name is returned as a triplet in a single string separated by
0659    the separator character specified when the parser was created: URI
0660    + sep + local_name + sep + prefix.
0661 
0662    If do_nst is zero, then namespace information is returned in the
0663    default manner (URI + sep + local_name) whether or not the name
0664    has a prefix.
0665 
0666    Note: Calling XML_SetReturnNSTriplet after XML_Parse or
0667      XML_ParseBuffer has no effect.
0668 */
0669 
0670 XMLPARSEAPI(void)
0671 XML_SetReturnNSTriplet(XML_Parser parser, int do_nst);
0672 
0673 /* This value is passed as the userData argument to callbacks. */
0674 XMLPARSEAPI(void)
0675 XML_SetUserData(XML_Parser parser, void *userData);
0676 
0677 /* Returns the last value set by XML_SetUserData or NULL. */
0678 #define XML_GetUserData(parser) (*(void **)(parser))
0679 
0680 /* This is equivalent to supplying an encoding argument to
0681    XML_ParserCreate. On success XML_SetEncoding returns non-zero,
0682    zero otherwise.
0683    Note: Calling XML_SetEncoding after XML_Parse or XML_ParseBuffer
0684      has no effect and returns XML_STATUS_ERROR.
0685 */
0686 XMLPARSEAPI(enum XML_Status)
0687 XML_SetEncoding(XML_Parser parser, const XML_Char *encoding);
0688 
0689 /* If this function is called, then the parser will be passed as the
0690    first argument to callbacks instead of userData.  The userData will
0691    still be accessible using XML_GetUserData.
0692 */
0693 XMLPARSEAPI(void)
0694 XML_UseParserAsHandlerArg(XML_Parser parser);
0695 
0696 /* If useDTD == XML_TRUE is passed to this function, then the parser
0697    will assume that there is an external subset, even if none is
0698    specified in the document. In such a case the parser will call the
0699    externalEntityRefHandler with a value of NULL for the systemId
0700    argument (the publicId and context arguments will be NULL as well).
0701    Note: For the purpose of checking WFC: Entity Declared, passing
0702      useDTD == XML_TRUE will make the parser behave as if the document
0703      had a DTD with an external subset.
0704    Note: If this function is called, then this must be done before
0705      the first call to XML_Parse or XML_ParseBuffer, since it will
0706      have no effect after that.  Returns
0707      XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING.
0708    Note: If the document does not have a DOCTYPE declaration at all,
0709      then startDoctypeDeclHandler and endDoctypeDeclHandler will not
0710      be called, despite an external subset being parsed.
0711    Note: If XML_DTD is not defined when Expat is compiled, returns
0712      XML_ERROR_FEATURE_REQUIRES_XML_DTD.
0713    Note: If parser == NULL, returns XML_ERROR_INVALID_ARGUMENT.
0714 */
0715 XMLPARSEAPI(enum XML_Error)
0716 XML_UseForeignDTD(XML_Parser parser, XML_Bool useDTD);
0717 
0718 /* Sets the base to be used for resolving relative URIs in system
0719    identifiers in declarations.  Resolving relative identifiers is
0720    left to the application: this value will be passed through as the
0721    base argument to the XML_ExternalEntityRefHandler,
0722    XML_NotationDeclHandler and XML_UnparsedEntityDeclHandler. The base
0723    argument will be copied.  Returns XML_STATUS_ERROR if out of memory,
0724    XML_STATUS_OK otherwise.
0725 */
0726 XMLPARSEAPI(enum XML_Status)
0727 XML_SetBase(XML_Parser parser, const XML_Char *base);
0728 
0729 XMLPARSEAPI(const XML_Char *)
0730 XML_GetBase(XML_Parser parser);
0731 
0732 /* Returns the number of the attribute/value pairs passed in last call
0733    to the XML_StartElementHandler that were specified in the start-tag
0734    rather than defaulted. Each attribute/value pair counts as 2; thus
0735    this corresponds to an index into the atts array passed to the
0736    XML_StartElementHandler.  Returns -1 if parser == NULL.
0737 */
0738 XMLPARSEAPI(int)
0739 XML_GetSpecifiedAttributeCount(XML_Parser parser);
0740 
0741 /* Returns the index of the ID attribute passed in the last call to
0742    XML_StartElementHandler, or -1 if there is no ID attribute or
0743    parser == NULL.  Each attribute/value pair counts as 2; thus this
0744    corresponds to an index into the atts array passed to the
0745    XML_StartElementHandler.
0746 */
0747 XMLPARSEAPI(int)
0748 XML_GetIdAttributeIndex(XML_Parser parser);
0749 
0750 #ifdef XML_ATTR_INFO
0751 /* Source file byte offsets for the start and end of attribute names and values.
0752    The value indices are exclusive of surrounding quotes; thus in a UTF-8 source
0753    file an attribute value of "blah" will yield:
0754    info->valueEnd - info->valueStart = 4 bytes.
0755 */
0756 typedef struct {
0757   XML_Index nameStart;  /* Offset to beginning of the attribute name. */
0758   XML_Index nameEnd;    /* Offset after the attribute name's last byte. */
0759   XML_Index valueStart; /* Offset to beginning of the attribute value. */
0760   XML_Index valueEnd;   /* Offset after the attribute value's last byte. */
0761 } XML_AttrInfo;
0762 
0763 /* Returns an array of XML_AttrInfo structures for the attribute/value pairs
0764    passed in last call to the XML_StartElementHandler that were specified
0765    in the start-tag rather than defaulted. Each attribute/value pair counts
0766    as 1; thus the number of entries in the array is
0767    XML_GetSpecifiedAttributeCount(parser) / 2.
0768 */
0769 XMLPARSEAPI(const XML_AttrInfo *)
0770 XML_GetAttributeInfo(XML_Parser parser);
0771 #endif
0772 
0773 /* Parses some input. Returns XML_STATUS_ERROR if a fatal error is
0774    detected.  The last call to XML_Parse must have isFinal true; len
0775    may be zero for this call (or any other).
0776 
0777    Though the return values for these functions has always been
0778    described as a Boolean value, the implementation, at least for the
0779    1.95.x series, has always returned exactly one of the XML_Status
0780    values.
0781 */
0782 XMLPARSEAPI(enum XML_Status)
0783 XML_Parse(XML_Parser parser, const char *s, int len, int isFinal);
0784 
0785 XMLPARSEAPI(void *)
0786 XML_GetBuffer(XML_Parser parser, int len);
0787 
0788 XMLPARSEAPI(enum XML_Status)
0789 XML_ParseBuffer(XML_Parser parser, int len, int isFinal);
0790 
0791 /* Stops parsing, causing XML_Parse() or XML_ParseBuffer() to return.
0792    Must be called from within a call-back handler, except when aborting
0793    (resumable = 0) an already suspended parser. Some call-backs may
0794    still follow because they would otherwise get lost. Examples:
0795    - endElementHandler() for empty elements when stopped in
0796      startElementHandler(),
0797    - endNameSpaceDeclHandler() when stopped in endElementHandler(),
0798    and possibly others.
0799 
0800    Can be called from most handlers, including DTD related call-backs,
0801    except when parsing an external parameter entity and resumable != 0.
0802    Returns XML_STATUS_OK when successful, XML_STATUS_ERROR otherwise.
0803    Possible error codes:
0804    - XML_ERROR_SUSPENDED: when suspending an already suspended parser.
0805    - XML_ERROR_FINISHED: when the parser has already finished.
0806    - XML_ERROR_SUSPEND_PE: when suspending while parsing an external PE.
0807 
0808    When resumable != 0 (true) then parsing is suspended, that is,
0809    XML_Parse() and XML_ParseBuffer() return XML_STATUS_SUSPENDED.
0810    Otherwise, parsing is aborted, that is, XML_Parse() and XML_ParseBuffer()
0811    return XML_STATUS_ERROR with error code XML_ERROR_ABORTED.
0812 
0813    *Note*:
0814    This will be applied to the current parser instance only, that is, if
0815    there is a parent parser then it will continue parsing when the
0816    externalEntityRefHandler() returns. It is up to the implementation of
0817    the externalEntityRefHandler() to call XML_StopParser() on the parent
0818    parser (recursively), if one wants to stop parsing altogether.
0819 
0820    When suspended, parsing can be resumed by calling XML_ResumeParser().
0821 */
0822 XMLPARSEAPI(enum XML_Status)
0823 XML_StopParser(XML_Parser parser, XML_Bool resumable);
0824 
0825 /* Resumes parsing after it has been suspended with XML_StopParser().
0826    Must not be called from within a handler call-back. Returns same
0827    status codes as XML_Parse() or XML_ParseBuffer().
0828    Additional error code XML_ERROR_NOT_SUSPENDED possible.
0829 
0830    *Note*:
0831    This must be called on the most deeply nested child parser instance
0832    first, and on its parent parser only after the child parser has finished,
0833    to be applied recursively until the document entity's parser is restarted.
0834    That is, the parent parser will not resume by itself and it is up to the
0835    application to call XML_ResumeParser() on it at the appropriate moment.
0836 */
0837 XMLPARSEAPI(enum XML_Status)
0838 XML_ResumeParser(XML_Parser parser);
0839 
0840 enum XML_Parsing { XML_INITIALIZED, XML_PARSING, XML_FINISHED, XML_SUSPENDED };
0841 
0842 typedef struct {
0843   enum XML_Parsing parsing;
0844   XML_Bool finalBuffer;
0845 } XML_ParsingStatus;
0846 
0847 /* Returns status of parser with respect to being initialized, parsing,
0848    finished, or suspended and processing the final buffer.
0849    XXX XML_Parse() and XML_ParseBuffer() should return XML_ParsingStatus,
0850    XXX with XML_FINISHED_OK or XML_FINISHED_ERROR replacing XML_FINISHED
0851 */
0852 XMLPARSEAPI(void)
0853 XML_GetParsingStatus(XML_Parser parser, XML_ParsingStatus *status);
0854 
0855 /* Creates an XML_Parser object that can parse an external general
0856    entity; context is a '\0'-terminated string specifying the parse
0857    context; encoding is a '\0'-terminated string giving the name of
0858    the externally specified encoding, or NULL if there is no
0859    externally specified encoding.  The context string consists of a
0860    sequence of tokens separated by formfeeds (\f); a token consisting
0861    of a name specifies that the general entity of the name is open; a
0862    token of the form prefix=uri specifies the namespace for a
0863    particular prefix; a token of the form =uri specifies the default
0864    namespace.  This can be called at any point after the first call to
0865    an ExternalEntityRefHandler so longer as the parser has not yet
0866    been freed.  The new parser is completely independent and may
0867    safely be used in a separate thread.  The handlers and userData are
0868    initialized from the parser argument.  Returns NULL if out of memory.
0869    Otherwise returns a new XML_Parser object.
0870 */
0871 XMLPARSEAPI(XML_Parser)
0872 XML_ExternalEntityParserCreate(XML_Parser parser, const XML_Char *context,
0873                                const XML_Char *encoding);
0874 
0875 enum XML_ParamEntityParsing {
0876   XML_PARAM_ENTITY_PARSING_NEVER,
0877   XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE,
0878   XML_PARAM_ENTITY_PARSING_ALWAYS
0879 };
0880 
0881 /* Controls parsing of parameter entities (including the external DTD
0882    subset). If parsing of parameter entities is enabled, then
0883    references to external parameter entities (including the external
0884    DTD subset) will be passed to the handler set with
0885    XML_SetExternalEntityRefHandler.  The context passed will be 0.
0886 
0887    Unlike external general entities, external parameter entities can
0888    only be parsed synchronously.  If the external parameter entity is
0889    to be parsed, it must be parsed during the call to the external
0890    entity ref handler: the complete sequence of
0891    XML_ExternalEntityParserCreate, XML_Parse/XML_ParseBuffer and
0892    XML_ParserFree calls must be made during this call.  After
0893    XML_ExternalEntityParserCreate has been called to create the parser
0894    for the external parameter entity (context must be 0 for this
0895    call), it is illegal to make any calls on the old parser until
0896    XML_ParserFree has been called on the newly created parser.
0897    If the library has been compiled without support for parameter
0898    entity parsing (ie without XML_DTD being defined), then
0899    XML_SetParamEntityParsing will return 0 if parsing of parameter
0900    entities is requested; otherwise it will return non-zero.
0901    Note: If XML_SetParamEntityParsing is called after XML_Parse or
0902       XML_ParseBuffer, then it has no effect and will always return 0.
0903    Note: If parser == NULL, the function will do nothing and return 0.
0904 */
0905 XMLPARSEAPI(int)
0906 XML_SetParamEntityParsing(XML_Parser parser,
0907                           enum XML_ParamEntityParsing parsing);
0908 
0909 /* Sets the hash salt to use for internal hash calculations.
0910    Helps in preventing DoS attacks based on predicting hash
0911    function behavior. This must be called before parsing is started.
0912    Returns 1 if successful, 0 when called after parsing has started.
0913    Note: If parser == NULL, the function will do nothing and return 0.
0914 */
0915 XMLPARSEAPI(int)
0916 XML_SetHashSalt(XML_Parser parser, unsigned long hash_salt);
0917 
0918 /* If XML_Parse or XML_ParseBuffer have returned XML_STATUS_ERROR, then
0919    XML_GetErrorCode returns information about the error.
0920 */
0921 XMLPARSEAPI(enum XML_Error)
0922 XML_GetErrorCode(XML_Parser parser);
0923 
0924 /* These functions return information about the current parse
0925    location.  They may be called from any callback called to report
0926    some parse event; in this case the location is the location of the
0927    first of the sequence of characters that generated the event.  When
0928    called from callbacks generated by declarations in the document
0929    prologue, the location identified isn't as neatly defined, but will
0930    be within the relevant markup.  When called outside of the callback
0931    functions, the position indicated will be just past the last parse
0932    event (regardless of whether there was an associated callback).
0933 
0934    They may also be called after returning from a call to XML_Parse
0935    or XML_ParseBuffer.  If the return value is XML_STATUS_ERROR then
0936    the location is the location of the character at which the error
0937    was detected; otherwise the location is the location of the last
0938    parse event, as described above.
0939 
0940    Note: XML_GetCurrentLineNumber and XML_GetCurrentColumnNumber
0941    return 0 to indicate an error.
0942    Note: XML_GetCurrentByteIndex returns -1 to indicate an error.
0943 */
0944 XMLPARSEAPI(XML_Size) XML_GetCurrentLineNumber(XML_Parser parser);
0945 XMLPARSEAPI(XML_Size) XML_GetCurrentColumnNumber(XML_Parser parser);
0946 XMLPARSEAPI(XML_Index) XML_GetCurrentByteIndex(XML_Parser parser);
0947 
0948 /* Return the number of bytes in the current event.
0949    Returns 0 if the event is in an internal entity.
0950 */
0951 XMLPARSEAPI(int)
0952 XML_GetCurrentByteCount(XML_Parser parser);
0953 
0954 /* If XML_CONTEXT_BYTES is defined, returns the input buffer, sets
0955    the integer pointed to by offset to the offset within this buffer
0956    of the current parse position, and sets the integer pointed to by size
0957    to the size of this buffer (the number of input bytes). Otherwise
0958    returns a NULL pointer. Also returns a NULL pointer if a parse isn't
0959    active.
0960 
0961    NOTE: The character pointer returned should not be used outside
0962    the handler that makes the call.
0963 */
0964 XMLPARSEAPI(const char *)
0965 XML_GetInputContext(XML_Parser parser, int *offset, int *size);
0966 
0967 /* For backwards compatibility with previous versions. */
0968 #define XML_GetErrorLineNumber XML_GetCurrentLineNumber
0969 #define XML_GetErrorColumnNumber XML_GetCurrentColumnNumber
0970 #define XML_GetErrorByteIndex XML_GetCurrentByteIndex
0971 
0972 /* Frees the content model passed to the element declaration handler */
0973 XMLPARSEAPI(void)
0974 XML_FreeContentModel(XML_Parser parser, XML_Content *model);
0975 
0976 /* Exposing the memory handling functions used in Expat */
0977 XMLPARSEAPI(void *)
0978 XML_ATTR_MALLOC
0979 XML_ATTR_ALLOC_SIZE(2)
0980 XML_MemMalloc(XML_Parser parser, size_t size);
0981 
0982 XMLPARSEAPI(void *)
0983 XML_ATTR_ALLOC_SIZE(3)
0984 XML_MemRealloc(XML_Parser parser, void *ptr, size_t size);
0985 
0986 XMLPARSEAPI(void)
0987 XML_MemFree(XML_Parser parser, void *ptr);
0988 
0989 /* Frees memory used by the parser. */
0990 XMLPARSEAPI(void)
0991 XML_ParserFree(XML_Parser parser);
0992 
0993 /* Returns a string describing the error. */
0994 XMLPARSEAPI(const XML_LChar *)
0995 XML_ErrorString(enum XML_Error code);
0996 
0997 /* Return a string containing the version number of this expat */
0998 XMLPARSEAPI(const XML_LChar *)
0999 XML_ExpatVersion(void);
1000 
1001 typedef struct {
1002   int major;
1003   int minor;
1004   int micro;
1005 } XML_Expat_Version;
1006 
1007 /* Return an XML_Expat_Version structure containing numeric version
1008    number information for this version of expat.
1009 */
1010 XMLPARSEAPI(XML_Expat_Version)
1011 XML_ExpatVersionInfo(void);
1012 
1013 /* Added in Expat 1.95.5. */
1014 enum XML_FeatureEnum {
1015   XML_FEATURE_END = 0,
1016   XML_FEATURE_UNICODE,
1017   XML_FEATURE_UNICODE_WCHAR_T,
1018   XML_FEATURE_DTD,
1019   XML_FEATURE_CONTEXT_BYTES,
1020   XML_FEATURE_MIN_SIZE,
1021   XML_FEATURE_SIZEOF_XML_CHAR,
1022   XML_FEATURE_SIZEOF_XML_LCHAR,
1023   XML_FEATURE_NS,
1024   XML_FEATURE_LARGE_SIZE,
1025   XML_FEATURE_ATTR_INFO,
1026   /* Added in Expat 2.4.0. */
1027   XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_MAXIMUM_AMPLIFICATION_DEFAULT,
1028   XML_FEATURE_BILLION_LAUGHS_ATTACK_PROTECTION_ACTIVATION_THRESHOLD_DEFAULT
1029   /* Additional features must be added to the end of this enum. */
1030 };
1031 
1032 typedef struct {
1033   enum XML_FeatureEnum feature;
1034   const XML_LChar *name;
1035   long int value;
1036 } XML_Feature;
1037 
1038 XMLPARSEAPI(const XML_Feature *)
1039 XML_GetFeatureList(void);
1040 
1041 #ifdef XML_DTD
1042 /* Added in Expat 2.4.0. */
1043 XMLPARSEAPI(XML_Bool)
1044 XML_SetBillionLaughsAttackProtectionMaximumAmplification(
1045     XML_Parser parser, float maximumAmplificationFactor);
1046 
1047 /* Added in Expat 2.4.0. */
1048 XMLPARSEAPI(XML_Bool)
1049 XML_SetBillionLaughsAttackProtectionActivationThreshold(
1050     XML_Parser parser, unsigned long long activationThresholdBytes);
1051 #endif
1052 
1053 /* Expat follows the semantic versioning convention.
1054    See http://semver.org.
1055 */
1056 #define XML_MAJOR_VERSION 2
1057 #define XML_MINOR_VERSION 5
1058 #define XML_MICRO_VERSION 0
1059 
1060 #ifdef __cplusplus
1061 }
1062 #endif
1063 
1064 #endif /* not Expat_INCLUDED */