2 * libxml.h: internal header only used during the compilation of libxml
4 * See COPYRIGHT for the status of this software
6 * Author: breese@users.sourceforge.net
9 #ifndef __XML_LIBXML_H__
10 #define __XML_LIBXML_H__
13 * These macros must be defined before including system headers.
14 * Do not add any #include directives above this block.
16 #ifndef NO_LARGEFILE_SOURCE
17 #ifndef _LARGEFILE_SOURCE
18 #define _LARGEFILE_SOURCE
20 #ifndef _FILE_OFFSET_BITS
21 #define _FILE_OFFSET_BITS 64
25 #if defined(macintosh)
26 #include "config-mac.h"
27 #elif defined(_WIN32_WCE) || defined(_WIN32)
29 * Windows CE compatibility definitions and functions
30 * This is needed to compile libxml2 for Windows CE.
31 * At least I tested it with WinCE 5.0 for Emulator and WinCE 4.2/SH4 target
33 #include <win32config.h>
34 #include <libxml/xmlversion.h>
37 * Currently supported platforms use either autoconf or
38 * copy to config.h own "preset" configuration file.
39 * As result ifdef HAVE_CONFIG_H is omitted here.
42 #include <libxml/xmlversion.h>
44 #include <libxml/xmlstring.h>
47 #include <stdio.h> /* pull definition of size_t */
49 int snprintf(char *, size_t, const char *, ...);
50 int vfprintf(FILE *, const char *, va_list);
59 * This macro is defined if the trio string formatting functions are to
60 * be used instead of the default stdio ones.
62 #define TRIO_REPLACE_STDIO
66 #if defined(__clang__) || \
67 (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406))
68 #define XML_IGNORE_PEDANTIC_WARNINGS \
69 _Pragma("GCC diagnostic push") \
70 _Pragma("GCC diagnostic ignored \"-Wpedantic\"")
71 #define XML_POP_WARNINGS \
72 _Pragma("GCC diagnostic pop")
74 #define XML_IGNORE_PEDANTIC_WARNINGS
75 #define XML_POP_WARNINGS
78 #if defined(__clang__) || \
79 (defined(__GNUC__) && (__GNUC__ >= 8))
80 #define ATTRIBUTE_NO_SANITIZE(arg) __attribute__((no_sanitize(arg)))
82 #define ATTRIBUTE_NO_SANITIZE(arg)
86 * Internal variable indicating if a callback has been registered for
87 * node creation/destruction. It avoids spending a lot of time in locking
88 * function while checking if the callback exists.
90 extern int __xmlRegisterCallbacks
;
92 * internal error reporting routines, shared but not part of the API.
94 void __xmlIOErr(int domain
, int code
, const char *extra
);
95 void __xmlLoaderErr(void *ctx
, const char *msg
, const char *filename
) LIBXML_ATTR_FORMAT(2,0);
96 #ifdef LIBXML_HTML_ENABLED
98 * internal function of HTML parser needed for xmlParseInNodeContext
99 * but not part of the API
101 void __htmlParseContent(void *ctx
);
105 * internal global initialization critical section routines.
107 void __xmlGlobalInitMutexLock(void);
108 void __xmlGlobalInitMutexUnlock(void);
109 void __xmlGlobalInitMutexDestroy(void);
111 int __xmlInitializeDict(void);
113 #if defined(HAVE_RAND) && defined(HAVE_SRAND) && defined(HAVE_TIME)
115 * internal thread safe random function
117 int __xmlRandom(void);
120 XMLPUBFUN xmlChar
* XMLCALL
xmlEscapeFormatString(xmlChar
**msg
);
121 int xmlInputReadCallbackNop(void *context
, char *buffer
, int len
);
127 #if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (__GNUC__ > 3)
128 #include "elfgcchack.h"
134 #if !defined(PIC) && !defined(NOLIBTOOL) && !defined(LIBXML_STATIC)
135 # define LIBXML_STATIC
137 #endif /* ! __XML_LIBXML_H__ */