[Python-checkins] python/dist/src/Modules/expat internal.h,NONE,1.1 ascii.h,1.1.1.1,1.2 expat.h,1.3,1.4 xmlparse.c,1.2,1.3 xmlrole.c,1.3,1.4 xmlrole.h,1.1.1.1,1.2 xmltok.c,1.2,1.3 xmltok.h,1.1.1.1,1.2 xmltok_impl.c,1.1.1.1,1.2 xmltok_ns.c,1.1.1.1,1.2

loewis@users.sourceforge.net loewis@users.sourceforge.net
Sat, 25 Jan 2003 14:41:32 -0800


Update of /cvsroot/python/python/dist/src/Modules/expat
In directory sc8-pr-cvs1:/tmp/cvs-serv31347/Modules/expat

Modified Files:
	ascii.h expat.h xmlparse.c xmlrole.c xmlrole.h xmltok.c 
	xmltok.h xmltok_impl.c xmltok_ns.c 
Added Files:
	internal.h 
Log Message:
Incorporate Expat 1.95.6.


--- NEW FILE: internal.h ---
/* internal.h

   Internal definitions used by Expat.  This is not needed to compile
   client code.

   The following calling convention macros are defined for frequently
   called functions:

   FASTCALL    - Used for those internal functions that have a simple
                 body and a low number of arguments and local variables.

   PTRCALL     - Used for functions called though function pointers.

   PTRFASTCALL - Like PTRCALL, but for low number of arguments.

   inline      - Used for selected internal functions for which inlining
                 may improve performance on some platforms.

   Note: Use of these macros is based on judgement, not hard rules,
         and therefore subject to change.
*/

#if defined(__GNUC__)
/* Instability reported with egcs on a RedHat Linux 7.3.
   Let's comment it out:
   #define FASTCALL __attribute__((stdcall, regparm(3)))
   and let's try this:
*/
#define FASTCALL __attribute__((regparm(3)))
#define PTRCALL
#define PTRFASTCALL __attribute__((regparm(3)))

#elif defined(WIN32)
/* Using __fastcall seems to have an unexpected negative effect under
   MS VC++, especially for function pointers, so we won't use it for
   now on that platform. It may be reconsidered for a future release
   if it can be made more effective.
   Likely reason: __fastcall on Windows is like stdcall, therefore
   the compiler cannot perform stack optimizations for call clusters.
*/
#define FASTCALL
#define PTRCALL
#define PTRFASTCALL

#endif

#ifndef FASTCALL
#define FASTCALL
#endif

#ifndef PTRCALL
#define PTRCALL
#endif

#ifndef PTRFASTCALL
#define PTRFASTCALL
#endif

#ifndef XML_MIN_SIZE
#if !defined(__cplusplus) && !defined(inline)
#ifdef __GNUC__
#define inline __inline
#endif /* __GNUC__ */
#endif
#endif /* XML_MIN_SIZE */

#ifdef __cplusplus
#define inline inline
#else
#ifndef inline
#define inline
#endif
#endif

Index: ascii.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/expat/ascii.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** ascii.h	11 Feb 2002 23:13:05 -0000	1.1.1.1
--- ascii.h	25 Jan 2003 22:41:29 -0000	1.2
***************
*** 1,5 ****
! /*
! Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
! See the file COPYING for copying permission.
  */
  
--- 1,4 ----
! /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
!    See the file COPYING for copying permission.
  */
  
***************
*** 70,74 ****
  
  #define ASCII_TAB 0x09
! #define ASCII_SPACE 0x20 
  #define ASCII_EXCL 0x21
  #define ASCII_QUOT 0x22
--- 69,73 ----
  
  #define ASCII_TAB 0x09
! #define ASCII_SPACE 0x20
  #define ASCII_EXCL 0x21
  #define ASCII_QUOT 0x22

Index: expat.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/expat/expat.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** expat.h	8 May 2002 07:16:37 -0000	1.3
--- expat.h	25 Jan 2003 22:41:29 -0000	1.4
***************
*** 1,5 ****
! /*
! Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
! See the file COPYING for copying permission.
  */
  
--- 1,4 ----
! /* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
!    See the file COPYING for copying permission.
  */
  
[...1432 lines suppressed...]
! typedef struct {
!   enum XML_FeatureEnum  feature;
!   const XML_LChar       *name;
!   long int              value;
! } XML_Feature;
  
+ XMLPARSEAPI(const XML_Feature *)
+ XML_GetFeatureList(void);
+ 
+ 
+ /* Expat follows the GNU/Linux convention of odd number minor version for
+    beta/development releases and even number minor version for stable
+    releases. Micro is bumped with each release, and set to 0 with each
+    change to major or minor version.
+ */
  #define XML_MAJOR_VERSION 1
  #define XML_MINOR_VERSION 95
! #define XML_MICRO_VERSION 6
  
  #ifdef __cplusplus

Index: xmlparse.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/expat/xmlparse.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** xmlparse.c	11 Feb 2002 23:16:32 -0000	1.2
--- xmlparse.c	25 Jan 2003 22:41:29 -0000	1.3
***************
*** 1,19 ****
! /*
! Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
! See the file COPYING for copying permission.
  */
  
  #ifdef COMPILED_FROM_DSP
! #  include "winconfig.h"
! #  define XMLPARSEAPI(type) __declspec(dllexport) type __cdecl
! #  include "expat.h"
! #  undef XMLPARSEAPI
[...9033 lines suppressed...]
!                const char *end)
  {
!   DTD * const dtd = _dtd;  /* save one level of indirection */
!   const XML_Char *name = poolStoreString(&dtd->pool, enc, ptr, end);
    ELEMENT_TYPE *ret;
  
!   if (!name)
!     return NULL;
!   ret = (ELEMENT_TYPE *) lookup(&dtd->elementTypes, name, sizeof(ELEMENT_TYPE));
!   if (!ret)
!     return NULL;
    if (ret->name != name)
!     poolDiscard(&dtd->pool);
    else {
!     poolFinish(&dtd->pool);
      if (!setElementTypePrefix(parser, ret))
!       return NULL;
    }
    return ret;
! }

Index: xmlrole.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/expat/xmlrole.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** xmlrole.c	17 Jul 2002 14:45:33 -0000	1.3
--- xmlrole.c	25 Jan 2003 22:41:29 -0000	1.4
***************
*** 1,15 ****
! /*
! Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
! See the file COPYING for copying permission.
  */
  
  #ifdef COMPILED_FROM_DSP
! #  include "winconfig.h"
  #else
! #ifdef HAVE_CONFIG_H
! #  include <config.h>
[...2195 lines suppressed...]
--- 1305,1309 ----
    state->documentEntity = 1;
    state->includeLevel = 0;
+   state->inEntityValue = 0;
  #endif /* XML_DTD */
  }
***************
*** 1265,1269 ****
  #ifdef XML_DTD
  
! void XmlPrologStateInitExternalEntity(PROLOG_STATE *state)
  {
    state->handler = externalSubset0;
--- 1311,1316 ----
  #ifdef XML_DTD
  
! void
! XmlPrologStateInitExternalEntity(PROLOG_STATE *state)
  {
    state->handler = externalSubset0;

Index: xmlrole.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/expat/xmlrole.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** xmlrole.h	11 Feb 2002 23:13:07 -0000	1.1.1.1
--- xmlrole.h	25 Jan 2003 22:41:29 -0000	1.2
***************
*** 1,5 ****
! /*
! Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
! See the file COPYING for copying permission.
  */
  
--- 1,4 ----
! /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
!    See the file COPYING for copying permission.
  */
  
***************
*** 7,10 ****
--- 6,15 ----
  #define XmlRole_INCLUDED 1
  
+ #ifdef __VMS
+ /*      0        1         2         3      0        1         2         3
+         1234567890123456789012345678901     1234567890123456789012345678901 */
+ #define XmlPrologStateInitExternalEntity    XmlPrologStateInitExternalEnt
+ #endif
+ 
  #include "xmltok.h"
  
***************
*** 18,21 ****
--- 23,27 ----
    XML_ROLE_XML_DECL,
    XML_ROLE_INSTANCE_START,
+   XML_ROLE_DOCTYPE_NONE,
    XML_ROLE_DOCTYPE_NAME,
    XML_ROLE_DOCTYPE_SYSTEM_ID,
***************
*** 25,28 ****
--- 31,35 ----
    XML_ROLE_GENERAL_ENTITY_NAME,
    XML_ROLE_PARAM_ENTITY_NAME,
+   XML_ROLE_ENTITY_NONE,
    XML_ROLE_ENTITY_VALUE,
    XML_ROLE_ENTITY_SYSTEM_ID,
***************
*** 30,33 ****
--- 37,41 ----
    XML_ROLE_ENTITY_COMPLETE,
    XML_ROLE_ENTITY_NOTATION_NAME,
+   XML_ROLE_NOTATION_NONE,
    XML_ROLE_NOTATION_NAME,
    XML_ROLE_NOTATION_SYSTEM_ID,
***************
*** 45,48 ****
--- 53,57 ----
    XML_ROLE_ATTRIBUTE_ENUM_VALUE,
    XML_ROLE_ATTRIBUTE_NOTATION_VALUE,
+   XML_ROLE_ATTLIST_NONE,
    XML_ROLE_ATTLIST_ELEMENT_NAME,
    XML_ROLE_IMPLIED_ATTRIBUTE_VALUE,
***************
*** 50,53 ****
--- 59,63 ----
    XML_ROLE_DEFAULT_ATTRIBUTE_VALUE,
    XML_ROLE_FIXED_ATTRIBUTE_VALUE,
+   XML_ROLE_ELEMENT_NONE,
    XML_ROLE_ELEMENT_NAME,
    XML_ROLE_CONTENT_ANY,
***************
*** 65,68 ****
--- 75,80 ----
    XML_ROLE_CONTENT_ELEMENT_OPT,
    XML_ROLE_CONTENT_ELEMENT_PLUS,
+   XML_ROLE_PI,
+   XML_ROLE_COMMENT,
  #ifdef XML_DTD
    XML_ROLE_TEXT_DECL,
***************
*** 74,86 ****
  
  typedef struct prolog_state {
!   int (*handler)(struct prolog_state *state,
! 	         int tok,
! 		 const char *ptr,
! 		 const char *end,
! 		 const ENCODING *enc);
    unsigned level;
  #ifdef XML_DTD
    unsigned includeLevel;
    int documentEntity;
  #endif /* XML_DTD */
  } PROLOG_STATE;
--- 86,100 ----
  
  typedef struct prolog_state {
!   int (PTRCALL *handler) (struct prolog_state *state,
!                           int tok,
!                           const char *ptr,
!                           const char *end,
!                           const ENCODING *enc);
    unsigned level;
+   int role_none;
  #ifdef XML_DTD
    unsigned includeLevel;
    int documentEntity;
+   int inEntityValue;
  #endif /* XML_DTD */
  } PROLOG_STATE;

Index: xmltok.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/expat/xmltok.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** xmltok.c	11 Feb 2002 23:16:32 -0000	1.2
--- xmltok.c	25 Jan 2003 22:41:29 -0000	1.3
***************
*** 1,15 ****
! /*
! Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
! See the file COPYING for copying permission.
  */
  
  #ifdef COMPILED_FROM_DSP
! #  include "winconfig.h"
  #else
! #ifdef HAVE_CONFIG_H
! #  include <config.h>
[...1891 lines suppressed...]
!         return XmlTok(*encPtr, state, ptr, end, nextTokPtr);
        }
        break;
***************
*** 1556,1562 ****
  ENCODING *
  XmlInitUnknownEncodingNS(void *mem,
! 		         int *table,
! 		         int (*convert)(void *userData, const char *p),
! 		         void *userData)
  {
    ENCODING *enc = XmlInitUnknownEncoding(mem, table, convert, userData);
--- 1622,1628 ----
  ENCODING *
  XmlInitUnknownEncodingNS(void *mem,
!                          int *table,
!                          CONVERTER convert, 
!                          void *userData)
  {
    ENCODING *enc = XmlInitUnknownEncoding(mem, table, convert, userData);

Index: xmltok.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/expat/xmltok.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** xmltok.h	11 Feb 2002 23:13:07 -0000	1.1.1.1
--- xmltok.h	25 Jan 2003 22:41:29 -0000	1.2
***************
*** 1,5 ****
! /*
! Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
! See the file COPYING for copying permission.
  */
  
--- 1,4 ----
! /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
!    See the file COPYING for copying permission.
  */
  
***************
*** 12,28 ****
  
  /* The following token may be returned by XmlContentTok */
! #define XML_TOK_TRAILING_RSQB -5 /* ] or ]] at the end of the scan; might be start of
!                                     illegal ]]> sequence */
! /* The following tokens may be returned by both XmlPrologTok and XmlContentTok */
! #define XML_TOK_NONE -4    /* The string to be scanned is empty */
! #define XML_TOK_TRAILING_CR -3 /* A CR at the end of the scan;
!                                   might be part of CRLF sequence */ 
! #define XML_TOK_PARTIAL_CHAR -2 /* only part of a multibyte sequence */
! #define XML_TOK_PARTIAL -1 /* only part of a token */
  #define XML_TOK_INVALID 0
  
  /* The following tokens are returned by XmlContentTok; some are also
!   returned by XmlAttributeValueTok, XmlEntityTok, XmlCdataSectionTok */
! 
  #define XML_TOK_START_TAG_WITH_ATTS 1
  #define XML_TOK_START_TAG_NO_ATTS 2
--- 11,29 ----
  
  /* The following token may be returned by XmlContentTok */
! #define XML_TOK_TRAILING_RSQB -5 /* ] or ]] at the end of the scan; might be
!                                     start of illegal ]]> sequence */
! /* The following tokens may be returned by both XmlPrologTok and
!    XmlContentTok.
! */
! #define XML_TOK_NONE -4          /* The string to be scanned is empty */
! #define XML_TOK_TRAILING_CR -3   /* A CR at the end of the scan;
!                                     might be part of CRLF sequence */
! #define XML_TOK_PARTIAL_CHAR -2  /* only part of a multibyte sequence */
! #define XML_TOK_PARTIAL -1       /* only part of a token */
  #define XML_TOK_INVALID 0
  
  /* The following tokens are returned by XmlContentTok; some are also
!    returned by XmlAttributeValueTok, XmlEntityTok, XmlCdataSectionTok.
! */
  #define XML_TOK_START_TAG_WITH_ATTS 1
  #define XML_TOK_START_TAG_NO_ATTS 2
***************
*** 34,53 ****
  #define XML_TOK_CDATA_SECT_OPEN 8
  #define XML_TOK_ENTITY_REF 9
! #define XML_TOK_CHAR_REF 10     /* numeric character reference */
  
! /* The following tokens may be returned by both XmlPrologTok and XmlContentTok */
! #define XML_TOK_PI 11      /* processing instruction */
! #define XML_TOK_XML_DECL 12 /* XML decl or text decl */
  #define XML_TOK_COMMENT 13
! #define XML_TOK_BOM 14     /* Byte order mark */
  
  /* The following tokens are returned only by XmlPrologTok */
  #define XML_TOK_PROLOG_S 15
! #define XML_TOK_DECL_OPEN 16 /* <!foo */
! #define XML_TOK_DECL_CLOSE 17 /* > */
  #define XML_TOK_NAME 18
  #define XML_TOK_NMTOKEN 19
! #define XML_TOK_POUND_NAME 20 /* #name */
! #define XML_TOK_OR 21 /* | */
  #define XML_TOK_PERCENT 22
  #define XML_TOK_OPEN_PAREN 23
--- 35,56 ----
  #define XML_TOK_CDATA_SECT_OPEN 8
  #define XML_TOK_ENTITY_REF 9
! #define XML_TOK_CHAR_REF 10               /* numeric character reference */
  
! /* The following tokens may be returned by both XmlPrologTok and
!    XmlContentTok.
! */
! #define XML_TOK_PI 11                     /* processing instruction */
! #define XML_TOK_XML_DECL 12               /* XML decl or text decl */
  #define XML_TOK_COMMENT 13
! #define XML_TOK_BOM 14                    /* Byte order mark */
  
  /* The following tokens are returned only by XmlPrologTok */
  #define XML_TOK_PROLOG_S 15
! #define XML_TOK_DECL_OPEN 16              /* <!foo */
! #define XML_TOK_DECL_CLOSE 17             /* > */
  #define XML_TOK_NAME 18
  #define XML_TOK_NMTOKEN 19
! #define XML_TOK_POUND_NAME 20             /* #name */
! #define XML_TOK_OR 21                     /* | */
  #define XML_TOK_PERCENT 22
  #define XML_TOK_OPEN_PAREN 23
***************
*** 60,71 ****
  
  /* The following occur only in element type declarations */
! #define XML_TOK_NAME_QUESTION 30 /* name? */
! #define XML_TOK_NAME_ASTERISK 31 /* name* */
! #define XML_TOK_NAME_PLUS 32 /* name+ */
! #define XML_TOK_COND_SECT_OPEN 33 /* <![ */
! #define XML_TOK_COND_SECT_CLOSE 34 /* ]]> */
! #define XML_TOK_CLOSE_PAREN_QUESTION 35 /* )? */
! #define XML_TOK_CLOSE_PAREN_ASTERISK 36 /* )* */
! #define XML_TOK_CLOSE_PAREN_PLUS 37 /* )+ */
  #define XML_TOK_COMMA 38
  
--- 63,74 ----
  
  /* The following occur only in element type declarations */
! #define XML_TOK_NAME_QUESTION 30          /* name? */
! #define XML_TOK_NAME_ASTERISK 31          /* name* */
! #define XML_TOK_NAME_PLUS 32              /* name+ */
! #define XML_TOK_COND_SECT_OPEN 33         /* <![ */
! #define XML_TOK_COND_SECT_CLOSE 34        /* ]]> */
! #define XML_TOK_CLOSE_PAREN_QUESTION 35   /* )? */
! #define XML_TOK_CLOSE_PAREN_ASTERISK 36   /* )* */
! #define XML_TOK_CLOSE_PAREN_PLUS 37       /* )+ */
  #define XML_TOK_COMMA 38
  
***************
*** 76,81 ****
  #define XML_TOK_CDATA_SECT_CLOSE 40
  
! /* With namespace processing this is returned by XmlPrologTok
!    for a name with a colon. */
  #define XML_TOK_PREFIXED_NAME 41
  
--- 79,85 ----
  #define XML_TOK_CDATA_SECT_CLOSE 40
  
! /* With namespace processing this is returned by XmlPrologTok for a
!    name with a colon.
! */
  #define XML_TOK_PREFIXED_NAME 41
  
***************
*** 122,160 ****
  typedef struct encoding ENCODING;
  
  struct encoding {
!   int (*scanners[XML_N_STATES])(const ENCODING *,
! 			        const char *,
! 			        const char *,
! 			        const char **);
!   int (*literalScanners[XML_N_LITERAL_TYPES])(const ENCODING *,
! 					      const char *,
! 					      const char *,
! 					      const char **);
!   int (*sameName)(const ENCODING *,
! 	          const char *, const char *);
!   int (*nameMatchesAscii)(const ENCODING *,
! 			  const char *, const char *, const char *);
!   int (*nameLength)(const ENCODING *, const char *);
!   const char *(*skipS)(const ENCODING *, const char *);
!   int (*getAtts)(const ENCODING *enc, const char *ptr,
! 	         int attsMax, ATTRIBUTE *atts);
!   int (*charRefNumber)(const ENCODING *enc, const char *ptr);
!   int (*predefinedEntityName)(const ENCODING *, const char *, const char *);
!   void (*updatePosition)(const ENCODING *,
! 			 const char *ptr,
! 			 const char *end,
! 			 POSITION *);
!   int (*isPublicId)(const ENCODING *enc, const char *ptr, const char *end,
! 		    const char **badPtr);
!   void (*utf8Convert)(const ENCODING *enc,
! 		      const char **fromP,
! 		      const char *fromLim,
! 		      char **toP,
! 		      const char *toLim);
!   void (*utf16Convert)(const ENCODING *enc,
! 		       const char **fromP,
! 		       const char *fromLim,
! 		       unsigned short **toP,
! 		       const unsigned short *toLim);
    int minBytesPerChar;
    char isUtf8;
--- 126,172 ----
  typedef struct encoding ENCODING;
  
+ typedef int (PTRCALL *SCANNER)(const ENCODING *,
+                                const char *,
+                                const char *,
+                                const char **);
+ 
  struct encoding {
!   SCANNER scanners[XML_N_STATES];
!   SCANNER literalScanners[XML_N_LITERAL_TYPES];
!   int (PTRCALL *sameName)(const ENCODING *,
!                           const char *,
!                           const char *);
!   int (PTRCALL *nameMatchesAscii)(const ENCODING *,
!                                   const char *,
!                                   const char *,
!                                   const char *);
!   int (PTRFASTCALL *nameLength)(const ENCODING *, const char *);
!   const char *(PTRFASTCALL *skipS)(const ENCODING *, const char *);
!   int (PTRCALL *getAtts)(const ENCODING *enc,
!                          const char *ptr,
!                          int attsMax,
!                          ATTRIBUTE *atts);
!   int (PTRFASTCALL *charRefNumber)(const ENCODING *enc, const char *ptr);
!   int (PTRCALL *predefinedEntityName)(const ENCODING *,
!                                       const char *,
!                                       const char *);
!   void (PTRCALL *updatePosition)(const ENCODING *,
!                                  const char *ptr,
!                                  const char *end,
!                                  POSITION *);
!   int (PTRCALL *isPublicId)(const ENCODING *enc,
!                             const char *ptr,
!                             const char *end,
!                             const char **badPtr);
!   void (PTRCALL *utf8Convert)(const ENCODING *enc,
!                               const char **fromP,
!                               const char *fromLim,
!                               char **toP,
!                               const char *toLim);
!   void (PTRCALL *utf16Convert)(const ENCODING *enc,
!                                const char **fromP,
!                                const char *fromLim,
!                                unsigned short **toP,
!                                const unsigned short *toLim);
    int minBytesPerChar;
    char isUtf8;
***************
*** 162,183 ****
  };
  
! /*
! Scan the string starting at ptr until the end of the next complete token,
! but do not scan past eptr.  Return an integer giving the type of token.
  
! Return XML_TOK_NONE when ptr == eptr; nextTokPtr will not be set.
  
! Return XML_TOK_PARTIAL when the string does not contain a complete token;
! nextTokPtr will not be set.
  
! Return XML_TOK_INVALID when the string does not start a valid token; nextTokPtr
! will be set to point to the character which made the token invalid.
  
! Otherwise the string starts with a valid token; nextTokPtr will be set to point
! to the character following the end of that token.
  
! Each data character counts as a single token, but adjacent data characters
! may be returned together.  Similarly for characters in the prolog outside
! literals, comments and processing instructions.
  */
  
--- 174,196 ----
  };
  
! /* Scan the string starting at ptr until the end of the next complete
!    token, but do not scan past eptr.  Return an integer giving the
!    type of token.
  
!    Return XML_TOK_NONE when ptr == eptr; nextTokPtr will not be set.
  
!    Return XML_TOK_PARTIAL when the string does not contain a complete
!    token; nextTokPtr will not be set.
  
!    Return XML_TOK_INVALID when the string does not start a valid
!    token; nextTokPtr will be set to point to the character which made
!    the token invalid.
  
!    Otherwise the string starts with a valid token; nextTokPtr will be
!    set to point to the character following the end of that token.
  
!    Each data character counts as a single token, but adjacent data
!    characters may be returned together.  Similarly for characters in
!    the prolog outside literals, comments and processing instructions.
  */
  
***************
*** 202,208 ****
  #endif /* XML_DTD */
  
! /* This is used for performing a 2nd-level tokenization on
! the content of a literal that has already been returned by XmlTok. */ 
! 
  #define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) \
    (((enc)->literalScanners[literalType])(enc, ptr, end, nextTokPtr))
--- 215,221 ----
  #endif /* XML_DTD */
  
! /* This is used for performing a 2nd-level tokenization on the content
!    of a literal that has already been returned by XmlTok.
! */
  #define XmlLiteralTok(enc, literalType, ptr, end, nextTokPtr) \
    (((enc)->literalScanners[literalType])(enc, ptr, end, nextTokPtr))
***************
*** 251,296 ****
  } INIT_ENCODING;
  
! int  XmlParseXmlDecl(int isGeneralTextEntity,
! 			      const ENCODING *enc,
! 			      const char *ptr,
! 	  		      const char *end,
! 			      const char **badPtr,
! 			      const char **versionPtr,
! 			      const char **versionEndPtr,
! 			      const char **encodingNamePtr,
! 			      const ENCODING **namedEncodingPtr,
! 			      int *standalonePtr);
  
! int  XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name);
! const ENCODING  *XmlGetUtf8InternalEncoding(void);
! const ENCODING  *XmlGetUtf16InternalEncoding(void);
! int  XmlUtf8Encode(int charNumber, char *buf);
! int  XmlUtf16Encode(int charNumber, unsigned short *buf);
  
! int  XmlSizeOfUnknownEncoding(void);
! ENCODING  *
  XmlInitUnknownEncoding(void *mem,
! 		       int *table,
! 		       int (*conv)(void *userData, const char *p),
! 		       void *userData);
  
! int  XmlParseXmlDeclNS(int isGeneralTextEntity,
! 			        const ENCODING *enc,
! 			        const char *ptr,
! 	  		        const char *end,
! 			        const char **badPtr,
! 			        const char **versionPtr,
! 				const char **versionEndPtr,
! 			        const char **encodingNamePtr,
! 			        const ENCODING **namedEncodingPtr,
! 			        int *standalonePtr);
! int  XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name);
! const ENCODING  *XmlGetUtf8InternalEncodingNS(void);
! const ENCODING  *XmlGetUtf16InternalEncodingNS(void);
! ENCODING  *
  XmlInitUnknownEncodingNS(void *mem,
! 		         int *table,
! 		         int (*conv)(void *userData, const char *p),
! 		         void *userData);
  #ifdef __cplusplus
  }
--- 264,312 ----
  } INIT_ENCODING;
  
! int XmlParseXmlDecl(int isGeneralTextEntity,
!                     const ENCODING *enc,
!                     const char *ptr,
!                     const char *end,
!                     const char **badPtr,
!                     const char **versionPtr,
!                     const char **versionEndPtr,
!                     const char **encodingNamePtr,
!                     const ENCODING **namedEncodingPtr,
!                     int *standalonePtr);
  
! int XmlInitEncoding(INIT_ENCODING *, const ENCODING **, const char *name);
! const ENCODING *XmlGetUtf8InternalEncoding(void);
! const ENCODING *XmlGetUtf16InternalEncoding(void);
! int FASTCALL XmlUtf8Encode(int charNumber, char *buf);
! int FASTCALL XmlUtf16Encode(int charNumber, unsigned short *buf);
! int XmlSizeOfUnknownEncoding(void);
  
! typedef int (*CONVERTER)(void *userData, const char *p);
! 
! ENCODING *
  XmlInitUnknownEncoding(void *mem,
!                        int *table,
!                        CONVERTER convert,
!                        void *userData);
  
! int XmlParseXmlDeclNS(int isGeneralTextEntity,
!                       const ENCODING *enc,
!                       const char *ptr,
!                       const char *end,
!                       const char **badPtr,
!                       const char **versionPtr,
!                       const char **versionEndPtr,
!                       const char **encodingNamePtr,
!                       const ENCODING **namedEncodingPtr,
!                       int *standalonePtr);
! 
! int XmlInitEncodingNS(INIT_ENCODING *, const ENCODING **, const char *name);
! const ENCODING *XmlGetUtf8InternalEncodingNS(void);
! const ENCODING *XmlGetUtf16InternalEncodingNS(void);
! ENCODING *
  XmlInitUnknownEncodingNS(void *mem,
!                          int *table,
!                          CONVERTER convert,
!                          void *userData);
  #ifdef __cplusplus
  }

Index: xmltok_impl.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/expat/xmltok_impl.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** xmltok_impl.c	11 Feb 2002 23:13:08 -0000	1.1.1.1
--- xmltok_impl.c	25 Jan 2003 22:41:29 -0000	1.2
***************
*** 1,5 ****
! /*
! Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
! See the file COPYING for copying permission.
  */
  
--- 1,4 ----
! /* Copyright (c) 1998, 1999 Thai Open Source Software Center Ltd
!    See the file COPYING for copying permission.
  */
  
[...2084 lines suppressed...]
    while (ptr != end) {
***************
*** 1749,1753 ****
        ptr += MINBPC(enc);
        if (ptr != end && BYTE_TYPE(enc, ptr) == BT_LF)
! 	ptr += MINBPC(enc);
        pos->columnNumber = (unsigned)-1;
        break;
--- 1759,1763 ----
        ptr += MINBPC(enc);
        if (ptr != end && BYTE_TYPE(enc, ptr) == BT_LF)
!         ptr += MINBPC(enc);
        pos->columnNumber = (unsigned)-1;
        break;
***************
*** 1767,1768 ****
--- 1777,1779 ----
  #undef CHECK_NMSTRT_CASE
  #undef CHECK_NMSTRT_CASES
+ 

Index: xmltok_ns.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/expat/xmltok_ns.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** xmltok_ns.c	11 Feb 2002 23:13:08 -0000	1.1.1.1
--- xmltok_ns.c	25 Jan 2003 22:41:29 -0000	1.2
***************
*** 1,21 ****
! const ENCODING *NS(XmlGetUtf8InternalEncoding)(void)
  {
    return &ns(internal_utf8_encoding).enc;
  }
  
! const ENCODING *NS(XmlGetUtf16InternalEncoding)(void)
  {
! #if XML_BYTE_ORDER == 12
    return &ns(internal_little2_encoding).enc;
! #elif XML_BYTE_ORDER == 21
    return &ns(internal_big2_encoding).enc;
  #else
    const short n = 1;
!   return *(const char *)&n ? &ns(internal_little2_encoding).enc : &ns(internal_big2_encoding).enc;
  #endif
  }
  
! static
! const ENCODING *NS(encodings)[] = {
    &ns(latin1_encoding).enc,
    &ns(ascii_encoding).enc,
--- 1,24 ----
! const ENCODING *
! NS(XmlGetUtf8InternalEncoding)(void)
  {
    return &ns(internal_utf8_encoding).enc;
  }
  
! const ENCODING *
! NS(XmlGetUtf16InternalEncoding)(void)
  {
! #if BYTEORDER == 1234
    return &ns(internal_little2_encoding).enc;
! #elif BYTEORDER == 4321
    return &ns(internal_big2_encoding).enc;
  #else
    const short n = 1;
!   return (*(const char *)&n
!           ? &ns(internal_little2_encoding).enc
!           : &ns(internal_big2_encoding).enc);
  #endif
  }
  
! static const ENCODING *NS(encodings)[] = {
    &ns(latin1_encoding).enc,
    &ns(ascii_encoding).enc,
***************
*** 27,45 ****
  };
  
! static
! int NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end,
! 		       const char **nextTokPtr)
  {
!   return initScan(NS(encodings), (const INIT_ENCODING *)enc, XML_PROLOG_STATE, ptr, end, nextTokPtr);
  }
  
! static
! int NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end,
! 		       const char **nextTokPtr)
  {
!   return initScan(NS(encodings), (const INIT_ENCODING *)enc, XML_CONTENT_STATE, ptr, end, nextTokPtr);
  }
  
! int NS(XmlInitEncoding)(INIT_ENCODING *p, const ENCODING **encPtr, const char *name)
  {
    int i = getEncodingIndex(name);
--- 30,52 ----
  };
  
! static int PTRCALL
! NS(initScanProlog)(const ENCODING *enc, const char *ptr, const char *end,
!                    const char **nextTokPtr)
  {
!   return initScan(NS(encodings), (const INIT_ENCODING *)enc,
!                   XML_PROLOG_STATE, ptr, end, nextTokPtr);
  }
  
! static int PTRCALL
! NS(initScanContent)(const ENCODING *enc, const char *ptr, const char *end,
!                     const char **nextTokPtr)
  {
!   return initScan(NS(encodings), (const INIT_ENCODING *)enc,
!                   XML_CONTENT_STATE, ptr, end, nextTokPtr);
  }
  
! int
! NS(XmlInitEncoding)(INIT_ENCODING *p, const ENCODING **encPtr,
!                     const char *name)
  {
    int i = getEncodingIndex(name);
***************
*** 55,60 ****
  }
  
! static
! const ENCODING *NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end)
  {
  #define ENCODING_MAX 128
--- 62,67 ----
  }
  
! static const ENCODING *
! NS(findEncoding)(const ENCODING *enc, const char *ptr, const char *end)
  {
  #define ENCODING_MAX 128
***************
*** 74,98 ****
  }
  
! int NS(XmlParseXmlDecl)(int isGeneralTextEntity,
! 			const ENCODING *enc,
! 			const char *ptr,
! 			const char *end,
! 			const char **badPtr,
! 			const char **versionPtr,
! 			const char **versionEndPtr,
! 			const char **encodingName,
! 			const ENCODING **encoding,
! 			int *standalone)
  {
    return doParseXmlDecl(NS(findEncoding),
! 			isGeneralTextEntity,
! 			enc,
! 			ptr,
! 			end,
! 			badPtr,
! 			versionPtr,
! 			versionEndPtr,
! 			encodingName,
! 			encoding,
! 			standalone);
  }
--- 81,106 ----
  }
  
! int
! NS(XmlParseXmlDecl)(int isGeneralTextEntity,
!                     const ENCODING *enc,
!                     const char *ptr,
!                     const char *end,
!                     const char **badPtr,
!                     const char **versionPtr,
!                     const char **versionEndPtr,
!                     const char **encodingName,
!                     const ENCODING **encoding,
!                     int *standalone)
  {
    return doParseXmlDecl(NS(findEncoding),
!                         isGeneralTextEntity,
!                         enc,
!                         ptr,
!                         end,
!                         badPtr,
!                         versionPtr,
!                         versionEndPtr,
!                         encodingName,
!                         encoding,
!                         standalone);
  }