expat_external.h

Go to the documentation of this file.
00001 /* Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
00002    See the file COPYING for copying permission.
00003 */
00004 
00005 #ifndef Expat_External_INCLUDED
00006 #define Expat_External_INCLUDED 1
00007 
00008 /* External API definitions */
00009 
00010 #if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
00011 #define XML_USE_MSC_EXTENSIONS 1
00012 #endif
00013 
00014 /* Expat tries very hard to make the API boundary very specifically
00015    defined.  There are two macros defined to control this boundary;
00016    each of these can be defined before including this header to
00017    achieve some different behavior, but doing so it not recommended or
00018    tested frequently.
00019 
00020    XMLCALL    - The calling convention to use for all calls across the
00021                 "library boundary."  This will default to cdecl, and
00022                 try really hard to tell the compiler that's what we
00023                 want.
00024 
00025    XMLIMPORT  - Whatever magic is needed to note that a function is
00026                 to be imported from a dynamically loaded library
00027                 (.dll, .so, or .sl, depending on your platform).
00028 
00029    The XMLCALL macro was added in Expat 1.95.7.  The only one which is
00030    expected to be directly useful in client code is XMLCALL.
00031 
00032    Note that on at least some Unix versions, the Expat library must be
00033    compiled with the cdecl calling convention as the default since
00034    system headers may assume the cdecl convention.
00035 */
00036 #ifndef XMLCALL
00037 #if defined(XML_USE_MSC_EXTENSIONS)
00038 #define XMLCALL __cdecl
00039 #elif defined(__GNUC__) && defined(__i386)
00040 #define XMLCALL __attribute__((cdecl))
00041 #else
00042 /* For any platform which uses this definition and supports more than
00043    one calling convention, we need to extend this definition to
00044    declare the convention used on that platform, if it's possible to
00045    do so.
00046 
00047    If this is the case for your platform, please file a bug report
00048    with information on how to identify your platform via the C
00049    pre-processor and how to specify the same calling convention as the
00050    platform's malloc() implementation.
00051 */
00052 #define XMLCALL
00053 #endif
00054 #endif  /* not defined XMLCALL */
00055 
00056 
00057 #if !defined(XML_STATIC) && !defined(XMLIMPORT)
00058 #ifndef XML_BUILDING_EXPAT
00059 /* using Expat from an application */
00060 
00061 #ifdef XML_USE_MSC_EXTENSIONS
00062 #define XMLIMPORT __declspec(dllimport)
00063 #endif
00064 
00065 #endif
00066 #endif  /* not defined XML_STATIC */
00067 
00068 
00069 /* If we didn't define it above, define it away: */
00070 #ifndef XMLIMPORT
00071 #define XMLIMPORT
00072 #endif
00073 
00074 
00075 #define XMLPARSEAPI(type) XMLIMPORT type XMLCALL
00076 
00077 #ifdef __cplusplus
00078 extern "C" {
00079 #endif
00080 
00081 #ifdef XML_UNICODE_WCHAR_T
00082 #define XML_UNICODE
00083 #endif
00084 
00085 #ifdef XML_UNICODE     /* Information is UTF-16 encoded. */
00086 #ifdef XML_UNICODE_WCHAR_T
00087 typedef wchar_t XML_Char;
00088 typedef wchar_t XML_LChar;
00089 #else
00090 typedef unsigned short XML_Char;
00091 typedef char XML_LChar;
00092 #endif /* XML_UNICODE_WCHAR_T */
00093 #else                  /* Information is UTF-8 encoded. */
00094 typedef char XML_Char;
00095 typedef char XML_LChar;
00096 #endif /* XML_UNICODE */
00097 
00098 #ifdef XML_LARGE_SIZE  /* Use large integers for file/stream positions. */
00099 #if defined(XML_USE_MSC_EXTENSIONS) && _MSC_VER < 1400
00100 typedef __int64 XML_Index; 
00101 typedef unsigned __int64 XML_Size;
00102 #else
00103 typedef long long XML_Index;
00104 typedef unsigned long long XML_Size;
00105 #endif
00106 #else
00107 typedef long XML_Index;
00108 typedef unsigned long XML_Size;
00109 #endif /* XML_LARGE_SIZE */
00110 
00111 #ifdef __cplusplus
00112 }
00113 #endif
00114 
00115 #endif /* not Expat_External_INCLUDED */

Generated on Thu Aug 20 22:33:05 2009 for OpenXDAS by  doxygen 1.5.6