1 /* 2 * libxml.h: internal header only used during the compilation of libxml 3 * 4 * See COPYRIGHT for the status of this software 5 * 6 * Author: breese@users.sourceforge.net 7 */ 8 9 #ifndef __XML_LIBXML_H__ 10 #define __XML_LIBXML_H__ 11 12 /* 13 * These macros must be defined before including system headers. 14 * Do not add any #include directives above this block. 15 */ 16 #ifndef NO_LARGEFILE_SOURCE 17 #ifndef _LARGEFILE_SOURCE 18 #define _LARGEFILE_SOURCE 19 #endif 20 #ifndef _FILE_OFFSET_BITS 21 #define _FILE_OFFSET_BITS 64 22 #endif 23 #endif 24 25 /* 26 * Currently supported platforms use either autoconf or 27 * copy to config.h own "preset" configuration file. 28 * As result ifdef HAVE_CONFIG_H is omitted here. 29 */ 30 #include "config.h" 31 #include <libxml/xmlversion.h> 32 #include <libxml/xmlstring.h> 33 34 #ifndef SYSCONFDIR 35 #define SYSCONFDIR "/etc" 36 #endif 37 38 #if defined(__Lynx__) 39 #include <stdio.h> /* pull definition of size_t */ 40 #include <varargs.h> 41 int snprintf(char *, size_t, const char *, ...); 42 int vfprintf(FILE *, const char *, va_list); 43 #endif 44 45 #ifndef WITH_TRIO 46 #include <stdio.h> 47 #else 48 /** 49 * TRIO_REPLACE_STDIO: 50 * 51 * This macro is defined if the trio string formatting functions are to 52 * be used instead of the default stdio ones. 53 */ 54 #define TRIO_REPLACE_STDIO 55 #include "trio.h" 56 #endif 57 58 #if defined(__clang__) || \ 59 (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)) 60 #define XML_IGNORE_PEDANTIC_WARNINGS \ 61 _Pragma("GCC diagnostic push") \ 62 _Pragma("GCC diagnostic ignored \"-Wpedantic\"") 63 #define XML_POP_WARNINGS \ 64 _Pragma("GCC diagnostic pop") 65 #else 66 #define XML_IGNORE_PEDANTIC_WARNINGS 67 #define XML_POP_WARNINGS 68 #endif 69 70 #if defined(__clang__) || \ 71 (defined(__GNUC__) && (__GNUC__ >= 8)) 72 #define ATTRIBUTE_NO_SANITIZE(arg) __attribute__((no_sanitize(arg))) 73 #else 74 #define ATTRIBUTE_NO_SANITIZE(arg) 75 #endif 76 77 /* 78 * Internal variable indicating if a callback has been registered for 79 * node creation/destruction. It avoids spending a lot of time in locking 80 * function while checking if the callback exists. 81 */ 82 extern int __xmlRegisterCallbacks; 83 /* 84 * internal error reporting routines, shared but not part of the API. 85 */ 86 void __xmlIOErr(int domain, int code, const char *extra); 87 void __xmlLoaderErr(void *ctx, const char *msg, const char *filename) LIBXML_ATTR_FORMAT(2,0); 88 #ifdef LIBXML_HTML_ENABLED 89 /* 90 * internal function of HTML parser needed for xmlParseInNodeContext 91 * but not part of the API 92 */ 93 void __htmlParseContent(void *ctx); 94 #endif 95 96 /* 97 * internal global initialization critical section routines. 98 */ 99 void __xmlGlobalInitMutexLock(void); 100 void __xmlGlobalInitMutexUnlock(void); 101 void __xmlGlobalInitMutexDestroy(void); 102 103 int __xmlInitializeDict(void); 104 105 /* 106 * internal thread safe random function 107 */ 108 int __xmlRandom(void); 109 110 XMLPUBFUN xmlChar * XMLCALL xmlEscapeFormatString(xmlChar **msg); 111 int xmlInputReadCallbackNop(void *context, char *buffer, int len); 112 113 #if !defined(PIC) && !defined(NOLIBTOOL) && !defined(LIBXML_STATIC) 114 # define LIBXML_STATIC 115 #endif 116 #endif /* ! __XML_LIBXML_H__ */ 117