libxml.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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. #ifndef __XML_LIBXML_H__
  9. #define __XML_LIBXML_H__
  10. #include <libxml/xmlstring.h>
  11. #ifndef NO_LARGEFILE_SOURCE
  12. #ifndef _LARGEFILE_SOURCE
  13. #define _LARGEFILE_SOURCE
  14. #endif
  15. #ifndef _FILE_OFFSET_BITS
  16. #define _FILE_OFFSET_BITS 64
  17. #endif
  18. #endif
  19. #if defined(macintosh)
  20. #include "config-mac.h"
  21. #elif defined(_WIN32_WCE) || defined(_WIN32)
  22. /*
  23. * Windows CE compatibility definitions and functions
  24. * This is needed to compile libxml2 for Windows CE.
  25. * At least I tested it with WinCE 5.0 for Emulator and WinCE 4.2/SH4 target
  26. */
  27. #include <win32config.h>
  28. #include <libxml/xmlversion.h>
  29. #else
  30. /*
  31. * Currently supported platforms use either autoconf or
  32. * copy to config.h own "preset" configuration file.
  33. * As result ifdef HAVE_CONFIG_H is omitted here.
  34. */
  35. #include "config.h"
  36. #include <libxml/xmlversion.h>
  37. #endif
  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. #ifndef WITH_TRIO
  45. #include <stdio.h>
  46. #else
  47. /**
  48. * TRIO_REPLACE_STDIO:
  49. *
  50. * This macro is defined if the trio string formatting functions are to
  51. * be used instead of the default stdio ones.
  52. */
  53. #define TRIO_REPLACE_STDIO
  54. #include "trio.h"
  55. #endif
  56. #if defined(__clang__) || \
  57. (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406))
  58. #define XML_IGNORE_PEDANTIC_WARNINGS \
  59. _Pragma("GCC diagnostic push") \
  60. _Pragma("GCC diagnostic ignored \"-Wpedantic\"")
  61. #define XML_POP_WARNINGS \
  62. _Pragma("GCC diagnostic pop")
  63. #else
  64. #define XML_IGNORE_PEDANTIC_WARNINGS
  65. #define XML_POP_WARNINGS
  66. #endif
  67. #if defined(__clang__) || \
  68. (defined(__GNUC__) && (__GNUC__ >= 8))
  69. #define ATTRIBUTE_NO_SANITIZE(arg) __attribute__((no_sanitize(arg)))
  70. #else
  71. #define ATTRIBUTE_NO_SANITIZE(arg)
  72. #endif
  73. /*
  74. * Internal variable indicating if a callback has been registered for
  75. * node creation/destruction. It avoids spending a lot of time in locking
  76. * function while checking if the callback exists.
  77. */
  78. extern int __xmlRegisterCallbacks;
  79. /*
  80. * internal error reporting routines, shared but not part of the API.
  81. */
  82. void __xmlIOErr(int domain, int code, const char *extra);
  83. void __xmlLoaderErr(void *ctx, const char *msg, const char *filename) LIBXML_ATTR_FORMAT(2,0);
  84. #ifdef LIBXML_HTML_ENABLED
  85. /*
  86. * internal function of HTML parser needed for xmlParseInNodeContext
  87. * but not part of the API
  88. */
  89. void __htmlParseContent(void *ctx);
  90. #endif
  91. /*
  92. * internal global initialization critical section routines.
  93. */
  94. void __xmlGlobalInitMutexLock(void);
  95. void __xmlGlobalInitMutexUnlock(void);
  96. void __xmlGlobalInitMutexDestroy(void);
  97. int __xmlInitializeDict(void);
  98. #if defined(HAVE_RAND) && defined(HAVE_SRAND) && defined(HAVE_TIME)
  99. /*
  100. * internal thread safe random function
  101. */
  102. int __xmlRandom(void);
  103. #endif
  104. XMLPUBFUN xmlChar * XMLCALL xmlEscapeFormatString(xmlChar **msg);
  105. int xmlInputReadCallbackNop(void *context, char *buffer, int len);
  106. #ifdef IN_LIBXML
  107. #ifdef __GNUC__
  108. #ifdef PIC
  109. #ifdef __linux__
  110. #if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (__GNUC__ > 3)
  111. #include "elfgcchack.h"
  112. #endif
  113. #endif
  114. #endif
  115. #endif
  116. #endif
  117. #if !defined(PIC) && !defined(NOLIBTOOL) && !defined(LIBXML_STATIC)
  118. # define LIBXML_STATIC
  119. #endif
  120. #endif /* ! __XML_LIBXML_H__ */