summaryrefslogtreecommitdiff
path: root/Modules/expat
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2003-02-07 02:15:56 +0000
committerFred Drake <fdrake@acm.org>2003-02-07 02:15:56 +0000
commit5ec0fb27d9fc8330d164c4fb7a41cfab90fb229e (patch)
treeb12b0d1de59fd69039ebee0558b8a911b5d9148a /Modules/expat
parente04153aed12f6d897d5914c1977505c9115cc038 (diff)
downloadcpython-5ec0fb27d9fc8330d164c4fb7a41cfab90fb229e.tar.gz
Integrate the patch from expat.h 1.51; needed for some C compilers.
Closes SF bug #680797.
Diffstat (limited to 'Modules/expat')
-rw-r--r--Modules/expat/expat.h45
1 files changed, 24 insertions, 21 deletions
diff --git a/Modules/expat/expat.h b/Modules/expat/expat.h
index 0b70302dbf..5322bea77e 100644
--- a/Modules/expat/expat.h
+++ b/Modules/expat/expat.h
@@ -57,6 +57,26 @@ typedef unsigned char XML_Bool;
#define XML_TRUE ((XML_Bool) 1)
#define XML_FALSE ((XML_Bool) 0)
+/* The XML_Status enum gives the possible return values for several
+ API functions. The preprocessor #defines are included so this
+ stanza can be added to code that still needs to support older
+ versions of Expat 1.95.x:
+
+ #ifndef XML_STATUS_OK
+ #define XML_STATUS_OK 1
+ #define XML_STATUS_ERROR 0
+ #endif
+
+ Otherwise, the #define hackery is quite ugly and would have been
+ dropped.
+*/
+enum XML_Status {
+ XML_STATUS_ERROR = 0,
+#define XML_STATUS_ERROR XML_STATUS_ERROR
+ XML_STATUS_OK = 1
+#define XML_STATUS_OK XML_STATUS_OK
+};
+
enum XML_Error {
XML_ERROR_NONE,
XML_ERROR_NO_MEMORY,
@@ -717,28 +737,11 @@ XML_GetIdAttributeIndex(XML_Parser parser);
detected. The last call to XML_Parse must have isFinal true; len
may be zero for this call (or any other).
- The XML_Status enum gives the possible return values for the
- XML_Parse and XML_ParseBuffer functions. Though the return values
- for these functions has always been described as a Boolean value,
- the implementation, at least for the 1.95.x series, has always
- returned exactly one of these values. The preprocessor #defines
- are included so this stanza can be added to code that still needs
- to support older versions of Expat 1.95.x:
-
- #ifndef XML_STATUS_OK
- #define XML_STATUS_OK 1
- #define XML_STATUS_ERROR 0
- #endif
-
- Otherwise, the #define hackery is quite ugly and would have been dropped.
+ Though the return values for these functions has always been
+ described as a Boolean value, the implementation, at least for the
+ 1.95.x series, has always returned exactly one of the XML_Status
+ values.
*/
-enum XML_Status {
- XML_STATUS_ERROR = 0,
-#define XML_STATUS_ERROR XML_STATUS_ERROR
- XML_STATUS_OK = 1
-#define XML_STATUS_OK XML_STATUS_OK
-};
-
XMLPARSEAPI(enum XML_Status)
XML_Parse(XML_Parser parser, const char *s, int len, int isFinal);