[Python-checkins] python/dist/src/Modules/expat expat_external.h, NONE, 1.1 expat.h, 1.6, 1.7 macconfig.h, 1.2, 1.3 xmlparse.c, 1.6, 1.7 xmlrole.c, 1.6, 1.7 xmltok.c, 1.4, 1.5 xmltok.h, 1.2, 1.3

fdrake at users.sourceforge.net fdrake at users.sourceforge.net
Tue Aug 3 09:06:25 CEST 2004


Update of /cvsroot/python/python/dist/src/Modules/expat
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25991

Modified Files:
	expat.h macconfig.h xmlparse.c xmlrole.c xmltok.c xmltok.h 
Added Files:
	expat_external.h 
Log Message:
update to Expat 1.95.8

--- NEW FILE: expat_external.h ---
/* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
   See the file COPYING for copying permission.
*/

/* External API definitions */

#if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
#define XML_USE_MSC_EXTENSIONS 1
#endif

/* Expat tries very hard to make the API boundary very specifically
   defined.  There are two macros defined to control this boundary;
   each of these can be defined before including this header to
   achieve some different behavior, but doing so it not recommended or
   tested frequently.

   XMLCALL    - The calling convention to use for all calls across the
                "library boundary."  This will default to cdecl, and
                try really hard to tell the compiler that's what we
                want.

   XMLIMPORT  - Whatever magic is needed to note that a function is
                to be imported from a dynamically loaded library
                (.dll, .so, or .sl, depending on your platform).

   The XMLCALL macro was added in Expat 1.95.7.  The only one which is
   expected to be directly useful in client code is XMLCALL.

   Note that on at least some Unix versions, the Expat library must be
   compiled with the cdecl calling convention as the default since
   system headers may assume the cdecl convention.
*/
#ifndef XMLCALL
#if defined(XML_USE_MSC_EXTENSIONS)
#define XMLCALL __cdecl
#elif defined(__GNUC__) && defined(__i386)
#define XMLCALL __attribute__((cdecl))
#else
/* For any platform which uses this definition and supports more than
   one calling convention, we need to extend this definition to
   declare the convention used on that platform, if it's possible to
   do so.

   If this is the case for your platform, please file a bug report
   with information on how to identify your platform via the C
   pre-processor and how to specify the same calling convention as the
   platform's malloc() implementation.
*/
#define XMLCALL
#endif
#endif  /* not defined XMLCALL */


#if !defined(XML_STATIC) && !defined(XMLIMPORT)
#ifndef XML_BUILDING_EXPAT
/* using Expat from an application */

#ifdef XML_USE_MSC_EXTENSIONS
#define XMLIMPORT __declspec(dllimport)
#endif

#endif
#endif  /* not defined XML_STATIC */

/* If we didn't define it above, define it away: */
#ifndef XMLIMPORT
#define XMLIMPORT
#endif


#define XMLPARSEAPI(type) XMLIMPORT type XMLCALL

#ifdef __cplusplus
extern "C" {
#endif

#ifdef XML_UNICODE_WCHAR_T
#define XML_UNICODE
#endif

#ifdef XML_UNICODE     /* Information is UTF-16 encoded. */
#ifdef XML_UNICODE_WCHAR_T
typedef wchar_t XML_Char;
typedef wchar_t XML_LChar;
#else
typedef unsigned short XML_Char;
typedef char XML_LChar;
#endif /* XML_UNICODE_WCHAR_T */
#else                  /* Information is UTF-8 encoded. */
typedef char XML_Char;
typedef char XML_LChar;
#endif /* XML_UNICODE */

Index: expat.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/expat/expat.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** expat.h	21 Oct 2003 15:38:55 -0000	1.6
--- expat.h	3 Aug 2004 07:06:22 -0000	1.7
***************
*** 16,110 ****
  
  #include <stdlib.h>
! 
! #if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
! #define XML_USE_MSC_EXTENSIONS 1
! #endif
! 
! /* Expat tries very hard to make the API boundary very specifically
!    defined.  There are two macros defined to control this boundary;
!    each of these can be defined before including this header to
!    achieve some different behavior, but doing so it not recommended or
!    tested frequently.
! 
!    XMLCALL    - The calling convention to use for all calls across the
!                 "library boundary."  This will default to cdecl, and
!                 try really hard to tell the compiler that's what we
!                 want.
! 
!    XMLIMPORT  - Whatever magic is needed to note that a function is
!                 to be imported from a dynamically loaded library
!                 (.dll, .so, or .sl, depending on your platform).
! 
!    The XMLCALL macro was added in Expat 1.95.7.  The only one which is
!    expected to be directly useful in client code is XMLCALL.
! 
!    Note that on at least some Unix versions, the Expat library must be
!    compiled with the cdecl calling convention as the default since
!    system headers may assume the cdecl convention.
! */
! #ifndef XMLCALL
! #if defined(XML_USE_MSC_EXTENSIONS)
! #define XMLCALL __cdecl
! #elif defined(__GNUC__)
! #define XMLCALL __attribute__((cdecl))
! #else
! /* For any platform which uses this definition and supports more than
!    one calling convention, we need to extend this definition to
!    declare the convention used on that platform, if it's possible to
!    do so.
! 
!    If this is the case for your platform, please file a bug report
!    with information on how to identify your platform via the C
!    pre-processor and how to specify the same calling convention as the
!    platform's malloc() implementation.
! */
! #define XMLCALL
! #endif
! #endif  /* not defined XMLCALL */
! 
! 
! #if !defined(XML_STATIC) && !defined(XMLIMPORT)
! #ifndef XML_BUILDING_EXPAT
! /* using Expat from an application */
! 
! #ifdef XML_USE_MSC_EXTENSIONS
! #define XMLIMPORT __declspec(dllimport)
! #endif
! 
! #endif
! #endif  /* not defined XML_STATIC */
! 
! /* If we didn't define it above, define it away: */
! #ifndef XMLIMPORT
! #define XMLIMPORT
! #endif
! 
! 
! #define XMLPARSEAPI(type) XMLIMPORT type XMLCALL
! 
! #ifdef __cplusplus
! extern "C" {
! #endif
! 
! #ifdef XML_UNICODE_WCHAR_T
! #define XML_UNICODE
! #endif
  
  struct XML_ParserStruct;
  typedef struct XML_ParserStruct *XML_Parser;
  
- #ifdef XML_UNICODE     /* Information is UTF-16 encoded. */
- #ifdef XML_UNICODE_WCHAR_T
- typedef wchar_t XML_Char;
- typedef wchar_t XML_LChar;
- #else
- typedef unsigned short XML_Char;
- typedef char XML_LChar;
- #endif /* XML_UNICODE_WCHAR_T */
- #else                  /* Information is UTF-8 encoded. */
- typedef char XML_Char;
- typedef char XML_LChar;
- #endif /* XML_UNICODE */
- 
  /* Should this be defined using stdbool.h when C99 is available? */
  typedef unsigned char XML_Bool;
--- 16,24 ----
  
  #include <stdlib.h>
! #include "expat_external.h"
  
  struct XML_ParserStruct;
  typedef struct XML_ParserStruct *XML_Parser;
  
  /* Should this be defined using stdbool.h when C99 is available? */
  typedef unsigned char XML_Bool;
***************
*** 128,133 ****
    XML_STATUS_ERROR = 0,
  #define XML_STATUS_ERROR XML_STATUS_ERROR
!   XML_STATUS_OK = 1
  #define XML_STATUS_OK XML_STATUS_OK
  };
  
--- 42,49 ----
    XML_STATUS_ERROR = 0,
  #define XML_STATUS_ERROR XML_STATUS_ERROR
!   XML_STATUS_OK = 1,
  #define XML_STATUS_OK XML_STATUS_OK
+   XML_STATUS_SUSPENDED = 2,
+ #define XML_STATUS_SUSPENDED XML_STATUS_SUSPENDED
  };
  
***************
*** 160,164 ****
    XML_ERROR_FEATURE_REQUIRES_XML_DTD,
    XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING,
!   XML_ERROR_UNBOUND_PREFIX
  };
  
--- 76,92 ----
    XML_ERROR_FEATURE_REQUIRES_XML_DTD,
    XML_ERROR_CANT_CHANGE_FEATURE_ONCE_PARSING,
!   /* Added in 1.95.7. */
!   XML_ERROR_UNBOUND_PREFIX,
!   /* Added in 1.95.8. */
!   XML_ERROR_UNDECLARING_PREFIX,
!   XML_ERROR_INCOMPLETE_PE,
!   XML_ERROR_XML_DECL,
!   XML_ERROR_TEXT_DECL,
!   XML_ERROR_PUBLICID,
!   XML_ERROR_SUSPENDED,
!   XML_ERROR_NOT_SUSPENDED,
!   XML_ERROR_ABORTED,
!   XML_ERROR_FINISHED,
!   XML_ERROR_SUSPEND_PE
  };
  
***************
*** 259,265 ****
  
  typedef struct {
!   void *(XMLCALL *malloc_fcn)(size_t size);
!   void *(XMLCALL *realloc_fcn)(void *ptr, size_t size);
!   void (XMLCALL *free_fcn)(void *ptr);
  } XML_Memory_Handling_Suite;
  
--- 187,193 ----
  
  typedef struct {
!   void *(*malloc_fcn)(size_t size);
!   void *(*realloc_fcn)(void *ptr, size_t size);
!   void (*free_fcn)(void *ptr);
  } XML_Memory_Handling_Suite;
  
***************
*** 601,608 ****
  
  XMLPARSEAPI(void)
! XML_SetStartElementHandler(XML_Parser, XML_StartElementHandler);
  
  XMLPARSEAPI(void)
! XML_SetEndElementHandler(XML_Parser, XML_EndElementHandler);
  
  XMLPARSEAPI(void)
--- 529,538 ----
  
  XMLPARSEAPI(void)
! XML_SetStartElementHandler(XML_Parser parser,
!                            XML_StartElementHandler handler);
  
  XMLPARSEAPI(void)
! XML_SetEndElementHandler(XML_Parser parser,
!                          XML_EndElementHandler handler);
  
  XMLPARSEAPI(void)
***************
*** 693,697 ****
  */
  XMLPARSEAPI(void)
! XML_SetExternalEntityRefHandlerArg(XML_Parser, void *arg);
  
  XMLPARSEAPI(void)
--- 623,628 ----
  */
  XMLPARSEAPI(void)
! XML_SetExternalEntityRefHandlerArg(XML_Parser parser,
!                                    void *arg);
  
  XMLPARSEAPI(void)
***************
*** 756,759 ****
--- 687,693 ----
     externalEntityRefHandler with a value of NULL for the systemId
     argument (the publicId and context arguments will be NULL as well).
+    Note: For the purpose of checking WFC: Entity Declared, passing
+      useDTD == XML_TRUE will make the parser behave as if the document
+      had a DTD with an external subset.
     Note: If this function is called, then this must be done before
       the first call to XML_Parse or XML_ParseBuffer, since it will
***************
*** 819,822 ****
--- 753,825 ----
  XML_ParseBuffer(XML_Parser parser, int len, int isFinal);
  
+ /* Stops parsing, causing XML_Parse() or XML_ParseBuffer() to return.
+    Must be called from within a call-back handler, except when aborting
+    (resumable = 0) an already suspended parser. Some call-backs may
+    still follow because they would otherwise get lost. Examples:
+    - endElementHandler() for empty elements when stopped in
+      startElementHandler(), 
+    - endNameSpaceDeclHandler() when stopped in endElementHandler(), 
+    and possibly others.
+ 
+    Can be called from most handlers, including DTD related call-backs,
+    except when parsing an external parameter entity and resumable != 0.
+    Returns XML_STATUS_OK when successful, XML_STATUS_ERROR otherwise.
+    Possible error codes: 
+    - XML_ERROR_SUSPENDED: when suspending an already suspended parser.
+    - XML_ERROR_FINISHED: when the parser has already finished.
+    - XML_ERROR_SUSPEND_PE: when suspending while parsing an external PE.
+ 
+    When resumable != 0 (true) then parsing is suspended, that is, 
+    XML_Parse() and XML_ParseBuffer() return XML_STATUS_SUSPENDED. 
+    Otherwise, parsing is aborted, that is, XML_Parse() and XML_ParseBuffer()
+    return XML_STATUS_ERROR with error code XML_ERROR_ABORTED.
+ 
+    *Note*:
+    This will be applied to the current parser instance only, that is, if
+    there is a parent parser then it will continue parsing when the
+    externalEntityRefHandler() returns. It is up to the implementation of
+    the externalEntityRefHandler() to call XML_StopParser() on the parent
+    parser (recursively), if one wants to stop parsing altogether.
+ 
+    When suspended, parsing can be resumed by calling XML_ResumeParser(). 
+ */
+ XMLPARSEAPI(enum XML_Status)
+ XML_StopParser(XML_Parser parser, XML_Bool resumable);
+ 
+ /* Resumes parsing after it has been suspended with XML_StopParser().
+    Must not be called from within a handler call-back. Returns same
+    status codes as XML_Parse() or XML_ParseBuffer().
+    Additional error code XML_ERROR_NOT_SUSPENDED possible.   
+ 
+    *Note*:
+    This must be called on the most deeply nested child parser instance
+    first, and on its parent parser only after the child parser has finished,
+    to be applied recursively until the document entity's parser is restarted.
+    That is, the parent parser will not resume by itself and it is up to the
+    application to call XML_ResumeParser() on it at the appropriate moment.
+ */
+ XMLPARSEAPI(enum XML_Status)
+ XML_ResumeParser(XML_Parser parser);
+ 
+ enum XML_Parsing {
+   XML_INITIALIZED,
+   XML_PARSING,
+   XML_FINISHED,
+   XML_SUSPENDED
+ };
+ 
+ typedef struct {
+   enum XML_Parsing parsing;
+   XML_Bool finalBuffer;
+ } XML_ParsingStatus;
+ 
+ /* Returns status of parser with respect to being initialized, parsing,
+    finished, or suspended and processing the final buffer.
+    XXX XML_Parse() and XML_ParseBuffer() should return XML_ParsingStatus,
+    XXX with XML_FINISHED_OK or XML_FINISHED_ERROR replacing XML_FINISHED
+ */
+ XMLPARSEAPI(void)
+ XML_GetParsingStatus(XML_Parser parser, XML_ParsingStatus *status);
+ 
  /* Creates an XML_Parser object that can parse an external general
     entity; context is a '\0'-terminated string specifying the parse
***************
*** 993,997 ****
  #define XML_MAJOR_VERSION 1
  #define XML_MINOR_VERSION 95
! #define XML_MICRO_VERSION 7
  
  #ifdef __cplusplus
--- 996,1000 ----
  #define XML_MAJOR_VERSION 1
  #define XML_MINOR_VERSION 95
! #define XML_MICRO_VERSION 8
  
  #ifdef __cplusplus

Index: macconfig.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/expat/macconfig.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** macconfig.h	10 Feb 2004 16:50:19 -0000	1.2
--- macconfig.h	3 Aug 2004 07:06:22 -0000	1.3
***************
*** 19,76 ****
  #undef HAVE_BCOPY
  
- /* Define to 1 if you have the <dlfcn.h> header file. */
- #undef HAVE_DLFCN_H
- 
- /* Define to 1 if you have the <fcntl.h> header file. */
- #undef HAVE_FCNTL_H
- 
- /* Define to 1 if you have the `getpagesize' function. */
- #undef HAVE_GETPAGESIZE
- 
- /* Define to 1 if you have the <inttypes.h> header file. */
- #undef HAVE_INTTYPES_H
- 
  /* Define to 1 if you have the `memmove' function. */
  #define HAVE_MEMMOVE
  
- /* Define to 1 if you have the <memory.h> header file. */
- #undef HAVE_MEMORY_H
- 
  /* Define to 1 if you have a working `mmap' system call. */
  #undef HAVE_MMAP
  
- /* Define to 1 if you have the <stdint.h> header file. */
- #undef HAVE_STDINT_H
- 
- /* Define to 1 if you have the <strings.h> header file. */
- #undef HAVE_STRINGS_H
- 
- /* Define to 1 if you have the <sys/stat.h> header file. */
- #undef HAVE_SYS_STAT_H
- 
- /* Define to 1 if you have the <sys/types.h> header file. */
- #undef HAVE_SYS_TYPES_H
- 
  /* Define to 1 if you have the <unistd.h> header file. */
  #undef HAVE_UNISTD_H
  
- /* Define to the address where bug reports for this package should be sent. */
- #undef PACKAGE_BUGREPORT
- 
- /* Define to the full name of this package. */
- #undef PACKAGE_NAME
- 
- /* Define to the full name and version of this package. */
- #undef PACKAGE_STRING
- 
- /* Define to the one symbol short name of this package. */
- #undef PACKAGE_TARNAME
- 
- /* Define to the version of this package. */
- #undef PACKAGE_VERSION
- 
- /* Define to 1 if you have the ANSI C header files. */
- #define STDC_HEADERS
- 
  /* whether byteorder is bigendian */
  #define WORDS_BIGENDIAN
--- 19,31 ----

Index: xmlparse.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/expat/xmlparse.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** xmlparse.c	21 Oct 2003 15:38:55 -0000	1.6
--- xmlparse.c	3 Aug 2004 07:06:22 -0000	1.7
***************
*** 5,8 ****
--- 5,9 ----
  #include <stddef.h>
  #include <string.h>                     /* memset(), memcpy() */
+ #include <assert.h>
  
  #define XML_BUILDING_EXPAT 1
***************
*** 12,19 ****
  #elif defined(MACOS_CLASSIC)
  #include "macconfig.h"
[...1989 lines suppressed...]
    if (isDocEntity) {
      ms->free_fcn(p->scaffIndex);
--- 5521,5525 ----
***************
*** 5394,5399 ****
      tsize = table->size * sizeof(NAMED *);
      table->v = (NAMED **)table->mem->malloc_fcn(tsize);
!     if (!table->v)
        return NULL;
      memset(table->v, 0, tsize);
      i = hash(name) & ((unsigned long)table->size - 1);
--- 5761,5768 ----
      tsize = table->size * sizeof(NAMED *);
      table->v = (NAMED **)table->mem->malloc_fcn(tsize);
!     if (!table->v) {
!       table->size = 0;
        return NULL;
+     }
      memset(table->v, 0, tsize);
      i = hash(name) & ((unsigned long)table->size - 1);

Index: xmlrole.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/expat/xmlrole.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** xmlrole.c	21 Oct 2003 15:38:55 -0000	1.6
--- xmlrole.c	3 Aug 2004 07:06:22 -0000	1.7
***************
*** 3,6 ****
--- 3,8 ----
  */
  
+ #include <stddef.h>
+ 
  #ifdef COMPILED_FROM_DSP
  #include "winconfig.h"
***************
*** 13,16 ****
--- 15,19 ----
  #endif /* ndef COMPILED_FROM_DSP */
  
+ #include "expat_external.h"
  #include "internal.h"
  #include "xmlrole.h"
***************
*** 371,374 ****
--- 374,379 ----
      state->handler = doctype5;
      return XML_ROLE_DOCTYPE_NONE;
+   case XML_TOK_NONE:
+     return XML_ROLE_NONE;
    }
    return common(state, tok);

Index: xmltok.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/expat/xmltok.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** xmltok.c	21 Oct 2003 15:38:55 -0000	1.4
--- xmltok.c	3 Aug 2004 07:06:22 -0000	1.5
***************
*** 3,6 ****
--- 3,8 ----
  */
  
+ #include <stddef.h>
+ 
  #ifdef COMPILED_FROM_DSP
  #include "winconfig.h"
***************
*** 13,16 ****
--- 15,19 ----
  #endif /* ndef COMPILED_FROM_DSP */
  
+ #include "expat_external.h"
  #include "internal.h"
  #include "xmltok.h"
***************
*** 1234,1238 ****
  struct unknown_encoding {
    struct normal_encoding normal;
!   int (*convert)(void *userData, const char *p);
    void *userData;
    unsigned short utf16[256];
--- 1237,1241 ----
  struct unknown_encoding {
    struct normal_encoding normal;
!   CONVERTER convert;
    void *userData;
    unsigned short utf16[256];

Index: xmltok.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/expat/xmltok.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** xmltok.h	25 Jan 2003 22:41:29 -0000	1.2
--- xmltok.h	3 Aug 2004 07:06:22 -0000	1.3
***************
*** 282,286 ****
  int XmlSizeOfUnknownEncoding(void);
  
! typedef int (*CONVERTER)(void *userData, const char *p);
  
  ENCODING *
--- 282,287 ----
  int XmlSizeOfUnknownEncoding(void);
  
! 
! typedef int (XMLCALL *CONVERTER) (void *userData, const char *p);
  
  ENCODING *



More information about the Python-checkins mailing list