blob: 64e30f77046f2bcd1df026a162f8d96a8ea57d86 [file] [log] [blame]
Bjorn Reese70a9da52001-04-21 16:57:29 +00001/*
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
David Kilzer502f6a62016-05-23 14:58:41 +080012#include <libxml/xmlstring.h>
13
Daniel Veillard3e59fc52003-04-18 12:34:58 +000014#ifndef NO_LARGEFILE_SOURCE
15#ifndef _LARGEFILE_SOURCE
16#define _LARGEFILE_SOURCE
17#endif
18#ifndef _FILE_OFFSET_BITS
19#define _FILE_OFFSET_BITS 64
20#endif
21#endif
22
Igor Zlatkovica6ceeb42003-08-28 10:25:13 +000023#if defined(macintosh)
Daniel Veillardd3b08822001-12-05 12:03:33 +000024#include "config-mac.h"
Daniel Veillard509ed2a2007-04-18 07:51:50 +000025#elif defined(_WIN32_WCE)
26/*
27 * Windows CE compatibility definitions and functions
28 * This is needed to compile libxml2 for Windows CE.
29 * At least I tested it with WinCE 5.0 for Emulator and WinCE 4.2/SH4 target
30 */
31#include <win32config.h>
32#include <libxml/xmlversion.h>
Bjorn Reese70a9da52001-04-21 16:57:29 +000033#else
Roumen Petrov1f0453f2012-08-13 16:56:11 +080034/*
35 * Currently supported platforms use either autoconf or
36 * copy to config.h own "preset" configuration file.
37 * As result ifdef HAVE_CONFIG_H is omited here.
38 */
Bjorn Reese70a9da52001-04-21 16:57:29 +000039#include "config.h"
Bjorn Reese70a9da52001-04-21 16:57:29 +000040#include <libxml/xmlversion.h>
Daniel Veillard87ee9142001-06-28 12:54:16 +000041#endif
Bjorn Reese70a9da52001-04-21 16:57:29 +000042
Daniel Veillardf79fbfc2006-05-31 13:35:28 +000043#if defined(__Lynx__)
44#include <stdio.h> /* pull definition of size_t */
45#include <varargs.h>
46int snprintf(char *, size_t, const char *, ...);
47int vfprintf(FILE *, const char *, va_list);
48#endif
49
Daniel Veillard7cf5e442001-09-10 20:16:32 +000050#ifndef WITH_TRIO
Bjorn Reese70a9da52001-04-21 16:57:29 +000051#include <stdio.h>
52#else
Daniel Veillard5e2dace2001-07-18 19:30:27 +000053/**
54 * TRIO_REPLACE_STDIO:
55 *
56 * This macro is defined if teh trio string formatting functions are to
57 * be used instead of the default stdio ones.
58 */
Bjorn Reese70a9da52001-04-21 16:57:29 +000059#define TRIO_REPLACE_STDIO
60#include "trio.h"
61#endif
Bjorn Reese70a9da52001-04-21 16:57:29 +000062
Nick Wellnhofer13acadb2017-11-12 17:28:12 +010063#if defined(__clang__) || \
64 (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 406))
65#define XML_IGNORE_PEDANTIC_WARNINGS \
66 _Pragma("GCC diagnostic push") \
67 _Pragma("GCC diagnostic ignored \"-Wpedantic\"")
68#define XML_POP_WARNINGS \
69 _Pragma("GCC diagnostic pop")
70#else
71#define XML_IGNORE_PEDANTIC_WARNINGS
72#define XML_POP_WARNINGS
73#endif
74
Daniel Veillarda880b122003-04-21 21:36:41 +000075/*
76 * Internal variable indicating if a callback has been registered for
77 * node creation/destruction. It avoids spending a lot of time in locking
78 * function while checking if the callback exists.
79 */
80extern int __xmlRegisterCallbacks;
Daniel Veillarde8039df2003-10-27 11:25:13 +000081/*
82 * internal error reporting routines, shared but not partof the API.
83 */
Daniel Veillard2b0f8792003-10-10 19:36:36 +000084void __xmlIOErr(int domain, int code, const char *extra);
David Kilzer4472c3a2016-05-13 15:13:17 +080085void __xmlLoaderErr(void *ctx, const char *msg, const char *filename) LIBXML_ATTR_FORMAT(2,0);
Daniel Veillard499cc922006-01-18 17:22:35 +000086#ifdef LIBXML_HTML_ENABLED
87/*
88 * internal function of HTML parser needed for xmlParseInNodeContext
89 * but not part of the API
90 */
91void __htmlParseContent(void *ctx);
92#endif
93
Daniel Veillardfde5b0b2007-02-12 17:31:53 +000094/*
95 * internal global initialization critical section routines.
96 */
97void __xmlGlobalInitMutexLock(void);
98void __xmlGlobalInitMutexUnlock(void);
Rob Richards91eb5602007-11-16 10:54:59 +000099void __xmlGlobalInitMutexDestroy(void);
Daniel Veillarda2351322004-06-27 12:08:10 +0000100
Daniel Veillard5fe9e9e2013-04-05 23:10:41 +0800101int __xmlInitializeDict(void);
102
Daniel Veillard379ebc12012-05-18 15:41:31 +0800103#if defined(HAVE_RAND) && defined(HAVE_SRAND) && defined(HAVE_TIME)
104/*
105 * internal thread safe random function
106 */
107int __xmlRandom(void);
108#endif
109
David Kilzer502f6a62016-05-23 14:58:41 +0800110XMLPUBFUN xmlChar * XMLCALL xmlEscapeFormatString(xmlChar **msg);
Vlad Tsyrklevich28f52fe2017-08-10 15:08:48 -0700111int xmlInputReadCallbackNop(void *context, char *buffer, int len);
Daniel Veillard153cf152012-10-26 13:50:47 +0800112
Daniel Veillarda2351322004-06-27 12:08:10 +0000113#ifdef IN_LIBXML
114#ifdef __GNUC__
Daniel Veillardbe3eb202004-07-09 12:05:25 +0000115#ifdef PIC
Nick Wellnhofer2cdaaab2017-09-14 21:30:51 +0200116#ifdef __linux__
Daniel Veillardc0c6ce22005-03-10 09:22:07 +0000117#if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (__GNUC__ > 3)
Daniel Veillarda2351322004-06-27 12:08:10 +0000118#include "elfgcchack.h"
119#endif
120#endif
121#endif
Daniel Veillardbe3eb202004-07-09 12:05:25 +0000122#endif
Daniel Veillardc0c6ce22005-03-10 09:22:07 +0000123#endif
J. Peter Mugaas8bc6c872017-10-21 13:57:44 +0200124#if !defined(PIC) && !defined(NOLIBTOOL) && !defined(LIBXML_STATIC)
Roumen Petrov120a2692010-03-10 10:07:49 +0100125# define LIBXML_STATIC
126#endif
Bjorn Reese70a9da52001-04-21 16:57:29 +0000127#endif /* ! __XML_LIBXML_H__ */