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