@@ -57,6 +57,26 @@ typedef unsigned char XML_Bool;
5757#define XML_TRUE ((XML_Bool) 1 )
5858#define XML_FALSE ((XML_Bool) 0 )
5959
60+ /* The XML_Status enum gives the possible return values for several
61+ API functions. The preprocessor #defines are included so this
62+ stanza can be added to code that still needs to support older
63+ versions of Expat 1.95.x:
64+
65+ #ifndef XML_STATUS_OK
66+ #define XML_STATUS_OK 1
67+ #define XML_STATUS_ERROR 0
68+ #endif
69+
70+ Otherwise, the #define hackery is quite ugly and would have been
71+ dropped.
72+ */
73+ enum XML_Status {
74+ XML_STATUS_ERROR = 0 ,
75+ #define XML_STATUS_ERROR XML_STATUS_ERROR
76+ XML_STATUS_OK = 1
77+ #define XML_STATUS_OK XML_STATUS_OK
78+ };
79+
6080enum XML_Error {
6181 XML_ERROR_NONE,
6282 XML_ERROR_NO_MEMORY,
@@ -717,28 +737,11 @@ XML_GetIdAttributeIndex(XML_Parser parser);
717737 detected. The last call to XML_Parse must have isFinal true; len
718738 may be zero for this call (or any other).
719739
720- The XML_Status enum gives the possible return values for the
721- XML_Parse and XML_ParseBuffer functions. Though the return values
722- for these functions has always been described as a Boolean value,
723- the implementation, at least for the 1.95.x series, has always
724- returned exactly one of these values. The preprocessor #defines
725- are included so this stanza can be added to code that still needs
726- to support older versions of Expat 1.95.x:
727-
728- #ifndef XML_STATUS_OK
729- #define XML_STATUS_OK 1
730- #define XML_STATUS_ERROR 0
731- #endif
732-
733- Otherwise, the #define hackery is quite ugly and would have been dropped.
740+ Though the return values for these functions has always been
741+ described as a Boolean value, the implementation, at least for the
742+ 1.95.x series, has always returned exactly one of the XML_Status
743+ values.
734744*/
735- enum XML_Status {
736- XML_STATUS_ERROR = 0 ,
737- #define XML_STATUS_ERROR XML_STATUS_ERROR
738- XML_STATUS_OK = 1
739- #define XML_STATUS_OK XML_STATUS_OK
740- };
741-
742745XMLPARSEAPI (enum XML_Status)
743746XML_Parse(XML_Parser parser, const char *s, int len, int isFinal);
744747
0 commit comments