jpayne@69: /* jpayne@69: __ __ _ jpayne@69: ___\ \/ /_ __ __ _| |_ jpayne@69: / _ \\ /| '_ \ / _` | __| jpayne@69: | __// \| |_) | (_| | |_ jpayne@69: \___/_/\_\ .__/ \__,_|\__| jpayne@69: |_| XML parser jpayne@69: jpayne@69: Copyright (c) 1997-2000 Thai Open Source Software Center Ltd jpayne@69: Copyright (c) 2000 Clark Cooper jpayne@69: Copyright (c) 2000-2004 Fred L. Drake, Jr. jpayne@69: Copyright (c) 2001-2002 Greg Stein jpayne@69: Copyright (c) 2002-2006 Karl Waclawek jpayne@69: Copyright (c) 2016 Cristian Rodríguez jpayne@69: Copyright (c) 2016-2019 Sebastian Pipping jpayne@69: Copyright (c) 2017 Rhodri James jpayne@69: Copyright (c) 2018 Yury Gribov jpayne@69: Licensed under the MIT license: jpayne@69: jpayne@69: Permission is hereby granted, free of charge, to any person obtaining jpayne@69: a copy of this software and associated documentation files (the jpayne@69: "Software"), to deal in the Software without restriction, including jpayne@69: without limitation the rights to use, copy, modify, merge, publish, jpayne@69: distribute, sublicense, and/or sell copies of the Software, and to permit jpayne@69: persons to whom the Software is furnished to do so, subject to the jpayne@69: following conditions: jpayne@69: jpayne@69: The above copyright notice and this permission notice shall be included jpayne@69: in all copies or substantial portions of the Software. jpayne@69: jpayne@69: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, jpayne@69: EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF jpayne@69: MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN jpayne@69: NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, jpayne@69: DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR jpayne@69: OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE jpayne@69: USE OR OTHER DEALINGS IN THE SOFTWARE. jpayne@69: */ jpayne@69: jpayne@69: #ifndef Expat_External_INCLUDED jpayne@69: #define Expat_External_INCLUDED 1 jpayne@69: jpayne@69: /* External API definitions */ jpayne@69: jpayne@69: /* Expat tries very hard to make the API boundary very specifically jpayne@69: defined. There are two macros defined to control this boundary; jpayne@69: each of these can be defined before including this header to jpayne@69: achieve some different behavior, but doing so it not recommended or jpayne@69: tested frequently. jpayne@69: jpayne@69: XMLCALL - The calling convention to use for all calls across the jpayne@69: "library boundary." This will default to cdecl, and jpayne@69: try really hard to tell the compiler that's what we jpayne@69: want. jpayne@69: jpayne@69: XMLIMPORT - Whatever magic is needed to note that a function is jpayne@69: to be imported from a dynamically loaded library jpayne@69: (.dll, .so, or .sl, depending on your platform). jpayne@69: jpayne@69: The XMLCALL macro was added in Expat 1.95.7. The only one which is jpayne@69: expected to be directly useful in client code is XMLCALL. jpayne@69: jpayne@69: Note that on at least some Unix versions, the Expat library must be jpayne@69: compiled with the cdecl calling convention as the default since jpayne@69: system headers may assume the cdecl convention. jpayne@69: */ jpayne@69: #ifndef XMLCALL jpayne@69: # if defined(_MSC_VER) jpayne@69: # define XMLCALL __cdecl jpayne@69: # elif defined(__GNUC__) && defined(__i386) && ! defined(__INTEL_COMPILER) jpayne@69: # define XMLCALL __attribute__((cdecl)) jpayne@69: # else jpayne@69: /* For any platform which uses this definition and supports more than jpayne@69: one calling convention, we need to extend this definition to jpayne@69: declare the convention used on that platform, if it's possible to jpayne@69: do so. jpayne@69: jpayne@69: If this is the case for your platform, please file a bug report jpayne@69: with information on how to identify your platform via the C jpayne@69: pre-processor and how to specify the same calling convention as the jpayne@69: platform's malloc() implementation. jpayne@69: */ jpayne@69: # define XMLCALL jpayne@69: # endif jpayne@69: #endif /* not defined XMLCALL */ jpayne@69: jpayne@69: #if ! defined(XML_STATIC) && ! defined(XMLIMPORT) jpayne@69: # ifndef XML_BUILDING_EXPAT jpayne@69: /* using Expat from an application */ jpayne@69: jpayne@69: # if defined(_MSC_EXTENSIONS) && ! defined(__BEOS__) && ! defined(__CYGWIN__) jpayne@69: # define XMLIMPORT __declspec(dllimport) jpayne@69: # endif jpayne@69: jpayne@69: # endif jpayne@69: #endif /* not defined XML_STATIC */ jpayne@69: jpayne@69: #ifndef XML_ENABLE_VISIBILITY jpayne@69: # define XML_ENABLE_VISIBILITY 0 jpayne@69: #endif jpayne@69: jpayne@69: #if ! defined(XMLIMPORT) && XML_ENABLE_VISIBILITY jpayne@69: # define XMLIMPORT __attribute__((visibility("default"))) jpayne@69: #endif jpayne@69: jpayne@69: /* If we didn't define it above, define it away: */ jpayne@69: #ifndef XMLIMPORT jpayne@69: # define XMLIMPORT jpayne@69: #endif jpayne@69: jpayne@69: #if defined(__GNUC__) \ jpayne@69: && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)) jpayne@69: # define XML_ATTR_MALLOC __attribute__((__malloc__)) jpayne@69: #else jpayne@69: # define XML_ATTR_MALLOC jpayne@69: #endif jpayne@69: jpayne@69: #if defined(__GNUC__) \ jpayne@69: && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) jpayne@69: # define XML_ATTR_ALLOC_SIZE(x) __attribute__((__alloc_size__(x))) jpayne@69: #else jpayne@69: # define XML_ATTR_ALLOC_SIZE(x) jpayne@69: #endif jpayne@69: jpayne@69: #define XMLPARSEAPI(type) XMLIMPORT type XMLCALL jpayne@69: jpayne@69: #ifdef __cplusplus jpayne@69: extern "C" { jpayne@69: #endif jpayne@69: jpayne@69: #ifdef XML_UNICODE_WCHAR_T jpayne@69: # ifndef XML_UNICODE jpayne@69: # define XML_UNICODE jpayne@69: # endif jpayne@69: # if defined(__SIZEOF_WCHAR_T__) && (__SIZEOF_WCHAR_T__ != 2) jpayne@69: # error "sizeof(wchar_t) != 2; Need -fshort-wchar for both Expat and libc" jpayne@69: # endif jpayne@69: #endif jpayne@69: jpayne@69: #ifdef XML_UNICODE /* Information is UTF-16 encoded. */ jpayne@69: # ifdef XML_UNICODE_WCHAR_T jpayne@69: typedef wchar_t XML_Char; jpayne@69: typedef wchar_t XML_LChar; jpayne@69: # else jpayne@69: typedef unsigned short XML_Char; jpayne@69: typedef char XML_LChar; jpayne@69: # endif /* XML_UNICODE_WCHAR_T */ jpayne@69: #else /* Information is UTF-8 encoded. */ jpayne@69: typedef char XML_Char; jpayne@69: typedef char XML_LChar; jpayne@69: #endif /* XML_UNICODE */ jpayne@69: jpayne@69: #ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */ jpayne@69: typedef long long XML_Index; jpayne@69: typedef unsigned long long XML_Size; jpayne@69: #else jpayne@69: typedef long XML_Index; jpayne@69: typedef unsigned long XML_Size; jpayne@69: #endif /* XML_LARGE_SIZE */ jpayne@69: jpayne@69: #ifdef __cplusplus jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: #endif /* not Expat_External_INCLUDED */