/*1__ __ _2___\ \/ /_ __ __ _| |_3/ _ \\ /| '_ \ / _` | __|4| __// \| |_) | (_| | |_5\___/_/\_\ .__/ \__,_|\__|6|_| XML parser78Copyright (c) 1997-2000 Thai Open Source Software Center Ltd9Copyright (c) 2000 Clark Cooper <[email protected]>10Copyright (c) 2000-2004 Fred L. Drake, Jr. <[email protected]>11Copyright (c) 2001-2002 Greg Stein <[email protected]>12Copyright (c) 2002-2006 Karl Waclawek <[email protected]>13Copyright (c) 2016 Cristian Rodríguez <[email protected]>14Copyright (c) 2016-2019 Sebastian Pipping <[email protected]>15Copyright (c) 2017 Rhodri James <[email protected]>16Copyright (c) 2018 Yury Gribov <[email protected]>17Licensed under the MIT license:1819Permission is hereby granted, free of charge, to any person obtaining20a copy of this software and associated documentation files (the21"Software"), to deal in the Software without restriction, including22without limitation the rights to use, copy, modify, merge, publish,23distribute, sublicense, and/or sell copies of the Software, and to permit24persons to whom the Software is furnished to do so, subject to the25following conditions:2627The above copyright notice and this permission notice shall be included28in all copies or substantial portions of the Software.2930THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,31EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF32MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN33NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,34DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR35OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE36USE OR OTHER DEALINGS IN THE SOFTWARE.37*/3839#ifndef Expat_External_INCLUDED40#define Expat_External_INCLUDED 14142/* External API definitions */4344/* Expat tries very hard to make the API boundary very specifically45defined. There are two macros defined to control this boundary;46each of these can be defined before including this header to47achieve some different behavior, but doing so it not recommended or48tested frequently.4950XMLCALL - The calling convention to use for all calls across the51"library boundary." This will default to cdecl, and52try really hard to tell the compiler that's what we53want.5455XMLIMPORT - Whatever magic is needed to note that a function is56to be imported from a dynamically loaded library57(.dll, .so, or .sl, depending on your platform).5859The XMLCALL macro was added in Expat 1.95.7. The only one which is60expected to be directly useful in client code is XMLCALL.6162Note that on at least some Unix versions, the Expat library must be63compiled with the cdecl calling convention as the default since64system headers may assume the cdecl convention.65*/66#ifndef XMLCALL67# if defined(_MSC_VER)68# define XMLCALL __cdecl69# elif defined(__GNUC__) && defined(__i386) && ! defined(__INTEL_COMPILER)70# define XMLCALL __attribute__((cdecl))71# else72/* For any platform which uses this definition and supports more than73one calling convention, we need to extend this definition to74declare the convention used on that platform, if it's possible to75do so.7677If this is the case for your platform, please file a bug report78with information on how to identify your platform via the C79pre-processor and how to specify the same calling convention as the80platform's malloc() implementation.81*/82# define XMLCALL83# endif84#endif /* not defined XMLCALL */8586/* Build within CMake hard-codes use of a static library. */87#define XML_STATIC8889#if ! defined(XML_STATIC) && ! defined(XMLIMPORT)90# ifndef XML_BUILDING_EXPAT91/* using Expat from an application */9293# if defined(_MSC_EXTENSIONS) && ! defined(__BEOS__) && ! defined(__CYGWIN__)94# define XMLIMPORT __declspec(dllimport)95# endif9697# endif98#endif /* not defined XML_STATIC */99100#ifndef XML_ENABLE_VISIBILITY101# define XML_ENABLE_VISIBILITY 0102#endif103104#if ! defined(XMLIMPORT) && XML_ENABLE_VISIBILITY105# define XMLIMPORT __attribute__((visibility("default")))106#endif107108/* If we didn't define it above, define it away: */109#ifndef XMLIMPORT110# define XMLIMPORT111#endif112113#if defined(__GNUC__) \114&& (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96))115# define XML_ATTR_MALLOC __attribute__((__malloc__))116#else117# define XML_ATTR_MALLOC118#endif119120#if defined(__GNUC__) \121&& ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))122# define XML_ATTR_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))123#else124# define XML_ATTR_ALLOC_SIZE(x)125#endif126127#define XMLPARSEAPI(type) XMLIMPORT type XMLCALL128129#ifdef __cplusplus130extern "C" {131#endif132133#ifdef XML_UNICODE_WCHAR_T134# ifndef XML_UNICODE135# define XML_UNICODE136# endif137# if defined(__SIZEOF_WCHAR_T__) && (__SIZEOF_WCHAR_T__ != 2)138# error "sizeof(wchar_t) != 2; Need -fshort-wchar for both Expat and libc"139# endif140#endif141142#ifdef XML_UNICODE /* Information is UTF-16 encoded. */143# ifdef XML_UNICODE_WCHAR_T144typedef wchar_t XML_Char;145typedef wchar_t XML_LChar;146# else147typedef unsigned short XML_Char;148typedef char XML_LChar;149# endif /* XML_UNICODE_WCHAR_T */150#else /* Information is UTF-8 encoded. */151typedef char XML_Char;152typedef char XML_LChar;153#endif /* XML_UNICODE */154155#ifdef XML_LARGE_SIZE /* Use large integers for file/stream positions. */156typedef long long XML_Index;157typedef unsigned long long XML_Size;158#else159typedef long XML_Index;160typedef unsigned long XML_Size;161#endif /* XML_LARGE_SIZE */162163#ifdef __cplusplus164}165#endif166167#endif /* not Expat_External_INCLUDED */168169170