SAX based XML parser

Dependents:   giken9_HTMLServer_Temp_Sample

Committer:
andrewbonney
Date:
Thu May 26 10:03:14 2011 +0000
Revision:
1:e96b2af301dd
Parent:
0:07919e3d6c56
Update to reduce buffer sizes

Who changed what in which revision?

UserRevisionLine numberNew contents of line
andrewbonney 0:07919e3d6c56 1 /* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
andrewbonney 0:07919e3d6c56 2 See the file COPYING for copying permission.
andrewbonney 0:07919e3d6c56 3 */
andrewbonney 0:07919e3d6c56 4
andrewbonney 0:07919e3d6c56 5 #ifndef Expat_External_INCLUDED
andrewbonney 0:07919e3d6c56 6 #define Expat_External_INCLUDED 1
andrewbonney 0:07919e3d6c56 7
andrewbonney 0:07919e3d6c56 8 /* External API definitions */
andrewbonney 0:07919e3d6c56 9
andrewbonney 0:07919e3d6c56 10 #if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
andrewbonney 0:07919e3d6c56 11 #define XML_USE_MSC_EXTENSIONS 1
andrewbonney 0:07919e3d6c56 12 #endif
andrewbonney 0:07919e3d6c56 13
andrewbonney 0:07919e3d6c56 14 /* Expat tries very hard to make the API boundary very specifically
andrewbonney 0:07919e3d6c56 15 defined. There are two macros defined to control this boundary;
andrewbonney 0:07919e3d6c56 16 each of these can be defined before including this header to
andrewbonney 0:07919e3d6c56 17 achieve some different behavior, but doing so it not recommended or
andrewbonney 0:07919e3d6c56 18 tested frequently.
andrewbonney 0:07919e3d6c56 19
andrewbonney 0:07919e3d6c56 20 XMLCALL - The calling convention to use for all calls across the
andrewbonney 0:07919e3d6c56 21 "library boundary." This will default to cdecl, and
andrewbonney 0:07919e3d6c56 22 try really hard to tell the compiler that's what we
andrewbonney 0:07919e3d6c56 23 want.
andrewbonney 0:07919e3d6c56 24
andrewbonney 0:07919e3d6c56 25 XMLIMPORT - Whatever magic is needed to note that a function is
andrewbonney 0:07919e3d6c56 26 to be imported from a dynamically loaded library
andrewbonney 0:07919e3d6c56 27 (.dll, .so, or .sl, depending on your platform).
andrewbonney 0:07919e3d6c56 28
andrewbonney 0:07919e3d6c56 29 The XMLCALL macro was added in Expat 1.95.7. The only one which is
andrewbonney 0:07919e3d6c56 30 expected to be directly useful in client code is XMLCALL.
andrewbonney 0:07919e3d6c56 31
andrewbonney 0:07919e3d6c56 32 Note that on at least some Unix versions, the Expat library must be
andrewbonney 0:07919e3d6c56 33 compiled with the cdecl calling convention as the default since
andrewbonney 0:07919e3d6c56 34 system headers may assume the cdecl convention.
andrewbonney 0:07919e3d6c56 35 */
andrewbonney 0:07919e3d6c56 36 #ifndef XMLCALL
andrewbonney 0:07919e3d6c56 37 #if defined(_MSC_VER)
andrewbonney 0:07919e3d6c56 38 #define XMLCALL __cdecl
andrewbonney 0:07919e3d6c56 39 #elif defined(__GNUC__) && defined(__i386) && !defined(__INTEL_COMPILER)
andrewbonney 0:07919e3d6c56 40 #define XMLCALL __attribute__((cdecl))
andrewbonney 0:07919e3d6c56 41 #else
andrewbonney 0:07919e3d6c56 42 /* For any platform which uses this definition and supports more than
andrewbonney 0:07919e3d6c56 43 one calling convention, we need to extend this definition to
andrewbonney 0:07919e3d6c56 44 declare the convention used on that platform, if it's possible to
andrewbonney 0:07919e3d6c56 45 do so.
andrewbonney 0:07919e3d6c56 46
andrewbonney 0:07919e3d6c56 47 If this is the case for your platform, please file a bug report
andrewbonney 0:07919e3d6c56 48 with information on how to identify your platform via the C
andrewbonney 0:07919e3d6c56 49 pre-processor and how to specify the same calling convention as the
andrewbonney 0:07919e3d6c56 50 platform's malloc() implementation.
andrewbonney 0:07919e3d6c56 51 */
andrewbonney 0:07919e3d6c56 52 #define XMLCALL
andrewbonney 0:07919e3d6c56 53 #endif
andrewbonney 0:07919e3d6c56 54 #endif /* not defined XMLCALL */
andrewbonney 0:07919e3d6c56 55
andrewbonney 0:07919e3d6c56 56
andrewbonney 0:07919e3d6c56 57 #if !defined(XML_STATIC) && !defined(XMLIMPORT)
andrewbonney 0:07919e3d6c56 58 #ifndef XML_BUILDING_EXPAT
andrewbonney 0:07919e3d6c56 59 /* using Expat from an application */
andrewbonney 0:07919e3d6c56 60
andrewbonney 0:07919e3d6c56 61 #ifdef XML_USE_MSC_EXTENSIONS
andrewbonney 0:07919e3d6c56 62 #define XMLIMPORT __declspec(dllimport)
andrewbonney 0:07919e3d6c56 63 #endif
andrewbonney 0:07919e3d6c56 64
andrewbonney 0:07919e3d6c56 65 #endif
andrewbonney 0:07919e3d6c56 66 #endif /* not defined XML_STATIC */
andrewbonney 0:07919e3d6c56 67
andrewbonney 0:07919e3d6c56 68
andrewbonney 0:07919e3d6c56 69 /* If we didn't define it above, define it away: */
andrewbonney 0:07919e3d6c56 70 #ifndef XMLIMPORT
andrewbonney 0:07919e3d6c56 71 #define XMLIMPORT
andrewbonney 0:07919e3d6c56 72 #endif
andrewbonney 0:07919e3d6c56 73
andrewbonney 0:07919e3d6c56 74
andrewbonney 0:07919e3d6c56 75 #define XMLPARSEAPI(type) XMLIMPORT type XMLCALL
andrewbonney 0:07919e3d6c56 76
andrewbonney 0:07919e3d6c56 77 #ifdef __cplusplus
andrewbonney 0:07919e3d6c56 78 extern "C" {
andrewbonney 0:07919e3d6c56 79 #endif
andrewbonney 0:07919e3d6c56 80
andrewbonney 0:07919e3d6c56 81 #ifdef XML_UNICODE_WCHAR_T
andrewbonney 0:07919e3d6c56 82 #define XML_UNICODE
andrewbonney 0:07919e3d6c56 83 #endif
andrewbonney 0:07919e3d6c56 84
andrewbonney 0:07919e3d6c56 85 #ifdef XML_UNICODE /* Information is UTF-16 encoded. */
andrewbonney 0:07919e3d6c56 86 #ifdef XML_UNICODE_WCHAR_T
andrewbonney 0:07919e3d6c56 87 typedef wchar_t XML_Char;
andrewbonney 0:07919e3d6c56 88 typedef wchar_t XML_LChar;
andrewbonney 0:07919e3d6c56 89 #else
andrewbonney 0:07919e3d6c56 90 typedef unsigned short XML_Char;
andrewbonney 0:07919e3d6c56 91 typedef char XML_LChar;
andrewbonney 0:07919e3d6c56 92 #endif /* XML_UNICODE_WCHAR_T */
andrewbonney 0:07919e3d6c56 93 #else /* Information is UTF-8 encoded. */
andrewbonney 0:07919e3d6c56 94 typedef char XML_Char;
andrewbonney 0:07919e3d6c56 95 typedef char XML_LChar;
andrewbonney 0:07919e3d6c56 96 #endif /* XML_UNICODE */
andrewbonney 0:07919e3d6c56 97
andrewbonney 0:07919e3d6c56 98 #ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */
andrewbonney 0:07919e3d6c56 99 #if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
andrewbonney 0:07919e3d6c56 100 typedef __int64 XML_Index;
andrewbonney 0:07919e3d6c56 101 typedef unsigned __int64 XML_Size;
andrewbonney 0:07919e3d6c56 102 #else
andrewbonney 0:07919e3d6c56 103 typedef long long XML_Index;
andrewbonney 0:07919e3d6c56 104 typedef unsigned long long XML_Size;
andrewbonney 0:07919e3d6c56 105 #endif
andrewbonney 0:07919e3d6c56 106 #else
andrewbonney 0:07919e3d6c56 107 typedef long XML_Index;
andrewbonney 0:07919e3d6c56 108 typedef unsigned long XML_Size;
andrewbonney 0:07919e3d6c56 109 #endif /* XML_LARGE_SIZE */
andrewbonney 0:07919e3d6c56 110
andrewbonney 0:07919e3d6c56 111 #ifdef __cplusplus
andrewbonney 0:07919e3d6c56 112 }
andrewbonney 0:07919e3d6c56 113 #endif
andrewbonney 0:07919e3d6c56 114
andrewbonney 0:07919e3d6c56 115 #endif /* not Expat_External_INCLUDED */