Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- pgsql/include/internal/c.h +1377 -0
- pgsql/include/internal/fe-auth-sasl.h +131 -0
- pgsql/include/internal/libpq-int.h +940 -0
- pgsql/include/internal/port.h +520 -0
- pgsql/include/internal/postgres_fe.h +29 -0
- pgsql/include/internal/pqexpbuffer.h +192 -0
- pgsql/include/libpq/libpq-fs.h +24 -0
- pgsql/include/libxml/HTMLparser.h +320 -0
- pgsql/include/libxml/HTMLtree.h +147 -0
- pgsql/include/libxml/SAX.h +204 -0
- pgsql/include/libxml/SAX2.h +173 -0
- pgsql/include/libxml/c14n.h +128 -0
- pgsql/include/libxml/catalog.h +182 -0
- pgsql/include/libxml/chvalid.h +230 -0
- pgsql/include/libxml/debugXML.h +217 -0
- pgsql/include/libxml/dict.h +81 -0
- pgsql/include/libxml/encoding.h +233 -0
- pgsql/include/libxml/entities.h +151 -0
- pgsql/include/libxml/globals.h +529 -0
- pgsql/include/libxml/hash.h +236 -0
- pgsql/include/libxml/list.h +137 -0
- pgsql/include/libxml/nanoftp.h +186 -0
- pgsql/include/libxml/nanohttp.h +81 -0
- pgsql/include/libxml/parser.h +1265 -0
- pgsql/include/libxml/parserInternals.h +662 -0
- pgsql/include/libxml/pattern.h +100 -0
- pgsql/include/libxml/relaxng.h +218 -0
- pgsql/include/libxml/schemasInternals.h +958 -0
- pgsql/include/libxml/schematron.h +142 -0
- pgsql/include/libxml/threads.h +94 -0
- pgsql/include/libxml/tree.h +1314 -0
- pgsql/include/libxml/uri.h +94 -0
- pgsql/include/libxml/valid.h +448 -0
- pgsql/include/libxml/xinclude.h +129 -0
- pgsql/include/libxml/xlink.h +189 -0
- pgsql/include/libxml/xmlIO.h +369 -0
- pgsql/include/libxml/xmlautomata.h +146 -0
- pgsql/include/libxml/xmlerror.h +919 -0
- pgsql/include/libxml/xmlexports.h +50 -0
- pgsql/include/libxml/xmlmemory.h +228 -0
- pgsql/include/libxml/xmlmodule.h +57 -0
- pgsql/include/libxml/xmlreader.h +428 -0
- pgsql/include/libxml/xmlregexp.h +222 -0
- pgsql/include/libxml/xmlsave.h +88 -0
- pgsql/include/libxml/xmlschemas.h +246 -0
- pgsql/include/libxml/xmlschemastypes.h +152 -0
- pgsql/include/libxml/xmlstring.h +140 -0
- pgsql/include/libxml/xmlunicode.h +202 -0
- pgsql/include/libxml/xmlversion.h +526 -0
- pgsql/include/libxml/xmlwriter.h +488 -0
pgsql/include/internal/c.h
ADDED
|
@@ -0,0 +1,1377 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*-------------------------------------------------------------------------
|
| 2 |
+
*
|
| 3 |
+
* c.h
|
| 4 |
+
* Fundamental C definitions. This is included by every .c file in
|
| 5 |
+
* PostgreSQL (via either postgres.h or postgres_fe.h, as appropriate).
|
| 6 |
+
*
|
| 7 |
+
* Note that the definitions here are not intended to be exposed to clients
|
| 8 |
+
* of the frontend interface libraries --- so we don't worry much about
|
| 9 |
+
* polluting the namespace with lots of stuff...
|
| 10 |
+
*
|
| 11 |
+
*
|
| 12 |
+
* Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
|
| 13 |
+
* Portions Copyright (c) 1994, Regents of the University of California
|
| 14 |
+
*
|
| 15 |
+
* src/include/c.h
|
| 16 |
+
*
|
| 17 |
+
*-------------------------------------------------------------------------
|
| 18 |
+
*/
|
| 19 |
+
/*
|
| 20 |
+
*----------------------------------------------------------------
|
| 21 |
+
* TABLE OF CONTENTS
|
| 22 |
+
*
|
| 23 |
+
* When adding stuff to this file, please try to put stuff
|
| 24 |
+
* into the relevant section, or add new sections as appropriate.
|
| 25 |
+
*
|
| 26 |
+
* section description
|
| 27 |
+
* ------- ------------------------------------------------
|
| 28 |
+
* 0) pg_config.h and standard system headers
|
| 29 |
+
* 1) compiler characteristics
|
| 30 |
+
* 2) bool, true, false
|
| 31 |
+
* 3) standard system types
|
| 32 |
+
* 4) IsValid macros for system types
|
| 33 |
+
* 5) lengthof, alignment
|
| 34 |
+
* 6) assertions
|
| 35 |
+
* 7) widely useful macros
|
| 36 |
+
* 8) random stuff
|
| 37 |
+
* 9) system-specific hacks
|
| 38 |
+
*
|
| 39 |
+
* NOTE: since this file is included by both frontend and backend modules,
|
| 40 |
+
* it's usually wrong to put an "extern" declaration here, unless it's
|
| 41 |
+
* ifdef'd so that it's seen in only one case or the other.
|
| 42 |
+
* typedefs and macros are the kind of thing that might go here.
|
| 43 |
+
*
|
| 44 |
+
*----------------------------------------------------------------
|
| 45 |
+
*/
|
| 46 |
+
#ifndef C_H
|
| 47 |
+
#define C_H
|
| 48 |
+
|
| 49 |
+
#include "postgres_ext.h"
|
| 50 |
+
|
| 51 |
+
/* Must undef pg_config_ext.h symbols before including pg_config.h */
|
| 52 |
+
#undef PG_INT64_TYPE
|
| 53 |
+
|
| 54 |
+
#include "pg_config.h"
|
| 55 |
+
#include "pg_config_manual.h" /* must be after pg_config.h */
|
| 56 |
+
#include "pg_config_os.h" /* must be before any system header files */
|
| 57 |
+
|
| 58 |
+
/* System header files that should be available everywhere in Postgres */
|
| 59 |
+
#include <stdio.h>
|
| 60 |
+
#include <stdlib.h>
|
| 61 |
+
#include <string.h>
|
| 62 |
+
#include <stddef.h>
|
| 63 |
+
#include <stdarg.h>
|
| 64 |
+
#ifdef HAVE_STRINGS_H
|
| 65 |
+
#include <strings.h>
|
| 66 |
+
#endif
|
| 67 |
+
#include <stdint.h>
|
| 68 |
+
#include <sys/types.h>
|
| 69 |
+
#include <errno.h>
|
| 70 |
+
#if defined(WIN32) || defined(__CYGWIN__)
|
| 71 |
+
#include <fcntl.h> /* ensure O_BINARY is available */
|
| 72 |
+
#endif
|
| 73 |
+
#include <locale.h>
|
| 74 |
+
#ifdef ENABLE_NLS
|
| 75 |
+
#include <libintl.h>
|
| 76 |
+
#endif
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
/* ----------------------------------------------------------------
|
| 80 |
+
* Section 1: compiler characteristics
|
| 81 |
+
*
|
| 82 |
+
* type prefixes (const, signed, volatile, inline) are handled in pg_config.h.
|
| 83 |
+
* ----------------------------------------------------------------
|
| 84 |
+
*/
|
| 85 |
+
|
| 86 |
+
/*
|
| 87 |
+
* Disable "inline" if PG_FORCE_DISABLE_INLINE is defined.
|
| 88 |
+
* This is used to work around compiler bugs and might also be useful for
|
| 89 |
+
* investigatory purposes.
|
| 90 |
+
*/
|
| 91 |
+
#ifdef PG_FORCE_DISABLE_INLINE
|
| 92 |
+
#undef inline
|
| 93 |
+
#define inline
|
| 94 |
+
#endif
|
| 95 |
+
|
| 96 |
+
/*
|
| 97 |
+
* Attribute macros
|
| 98 |
+
*
|
| 99 |
+
* GCC: https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
|
| 100 |
+
* GCC: https://gcc.gnu.org/onlinedocs/gcc/Type-Attributes.html
|
| 101 |
+
* Clang: https://clang.llvm.org/docs/AttributeReference.html
|
| 102 |
+
* Sunpro: https://docs.oracle.com/cd/E18659_01/html/821-1384/gjzke.html
|
| 103 |
+
* XLC: https://www.ibm.com/support/knowledgecenter/SSGH2K_13.1.2/com.ibm.xlc131.aix.doc/language_ref/function_attributes.html
|
| 104 |
+
* XLC: https://www.ibm.com/support/knowledgecenter/SSGH2K_13.1.2/com.ibm.xlc131.aix.doc/language_ref/type_attrib.html
|
| 105 |
+
*/
|
| 106 |
+
|
| 107 |
+
/*
|
| 108 |
+
* For compilers which don't support __has_attribute, we just define
|
| 109 |
+
* __has_attribute(x) to 0 so that we can define macros for various
|
| 110 |
+
* __attribute__s more easily below.
|
| 111 |
+
*/
|
| 112 |
+
#ifndef __has_attribute
|
| 113 |
+
#define __has_attribute(attribute) 0
|
| 114 |
+
#endif
|
| 115 |
+
|
| 116 |
+
/* only GCC supports the unused attribute */
|
| 117 |
+
#ifdef __GNUC__
|
| 118 |
+
#define pg_attribute_unused() __attribute__((unused))
|
| 119 |
+
#else
|
| 120 |
+
#define pg_attribute_unused()
|
| 121 |
+
#endif
|
| 122 |
+
|
| 123 |
+
/*
|
| 124 |
+
* pg_nodiscard means the compiler should warn if the result of a function
|
| 125 |
+
* call is ignored. The name "nodiscard" is chosen in alignment with
|
| 126 |
+
* (possibly future) C and C++ standards. For maximum compatibility, use it
|
| 127 |
+
* as a function declaration specifier, so it goes before the return type.
|
| 128 |
+
*/
|
| 129 |
+
#ifdef __GNUC__
|
| 130 |
+
#define pg_nodiscard __attribute__((warn_unused_result))
|
| 131 |
+
#else
|
| 132 |
+
#define pg_nodiscard
|
| 133 |
+
#endif
|
| 134 |
+
|
| 135 |
+
/*
|
| 136 |
+
* Place this macro before functions that should be allowed to make misaligned
|
| 137 |
+
* accesses. Think twice before using it on non-x86-specific code!
|
| 138 |
+
* Testing can be done with "-fsanitize=alignment -fsanitize-trap=alignment"
|
| 139 |
+
* on clang, or "-fsanitize=alignment -fno-sanitize-recover=alignment" on gcc.
|
| 140 |
+
*/
|
| 141 |
+
#if __clang_major__ >= 7 || __GNUC__ >= 8
|
| 142 |
+
#define pg_attribute_no_sanitize_alignment() __attribute__((no_sanitize("alignment")))
|
| 143 |
+
#else
|
| 144 |
+
#define pg_attribute_no_sanitize_alignment()
|
| 145 |
+
#endif
|
| 146 |
+
|
| 147 |
+
/*
|
| 148 |
+
* pg_attribute_nonnull means the compiler should warn if the function is
|
| 149 |
+
* called with the listed arguments set to NULL. If no arguments are
|
| 150 |
+
* listed, the compiler should warn if any pointer arguments are set to NULL.
|
| 151 |
+
*/
|
| 152 |
+
#if __has_attribute (nonnull)
|
| 153 |
+
#define pg_attribute_nonnull(...) __attribute__((nonnull(__VA_ARGS__)))
|
| 154 |
+
#else
|
| 155 |
+
#define pg_attribute_nonnull(...)
|
| 156 |
+
#endif
|
| 157 |
+
|
| 158 |
+
/*
|
| 159 |
+
* Append PG_USED_FOR_ASSERTS_ONLY to definitions of variables that are only
|
| 160 |
+
* used in assert-enabled builds, to avoid compiler warnings about unused
|
| 161 |
+
* variables in assert-disabled builds.
|
| 162 |
+
*/
|
| 163 |
+
#ifdef USE_ASSERT_CHECKING
|
| 164 |
+
#define PG_USED_FOR_ASSERTS_ONLY
|
| 165 |
+
#else
|
| 166 |
+
#define PG_USED_FOR_ASSERTS_ONLY pg_attribute_unused()
|
| 167 |
+
#endif
|
| 168 |
+
|
| 169 |
+
/* GCC and XLC support format attributes */
|
| 170 |
+
#if defined(__GNUC__) || defined(__IBMC__)
|
| 171 |
+
#define pg_attribute_format_arg(a) __attribute__((format_arg(a)))
|
| 172 |
+
#define pg_attribute_printf(f,a) __attribute__((format(PG_PRINTF_ATTRIBUTE, f, a)))
|
| 173 |
+
#else
|
| 174 |
+
#define pg_attribute_format_arg(a)
|
| 175 |
+
#define pg_attribute_printf(f,a)
|
| 176 |
+
#endif
|
| 177 |
+
|
| 178 |
+
/* GCC, Sunpro and XLC support aligned, packed and noreturn */
|
| 179 |
+
#if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__IBMC__)
|
| 180 |
+
#define pg_attribute_aligned(a) __attribute__((aligned(a)))
|
| 181 |
+
#define pg_attribute_noreturn() __attribute__((noreturn))
|
| 182 |
+
#define pg_attribute_packed() __attribute__((packed))
|
| 183 |
+
#define HAVE_PG_ATTRIBUTE_NORETURN 1
|
| 184 |
+
#elif defined(_MSC_VER)
|
| 185 |
+
/*
|
| 186 |
+
* MSVC supports aligned. noreturn is also possible but in MSVC it is
|
| 187 |
+
* declared before the definition while pg_attribute_noreturn() macro
|
| 188 |
+
* is currently used after the definition.
|
| 189 |
+
*
|
| 190 |
+
* Packing is also possible but only by wrapping the entire struct definition
|
| 191 |
+
* which doesn't fit into our current macro declarations.
|
| 192 |
+
*/
|
| 193 |
+
#define pg_attribute_aligned(a) __declspec(align(a))
|
| 194 |
+
#define pg_attribute_noreturn()
|
| 195 |
+
#else
|
| 196 |
+
/*
|
| 197 |
+
* NB: aligned and packed are not given default definitions because they
|
| 198 |
+
* affect code functionality; they *must* be implemented by the compiler
|
| 199 |
+
* if they are to be used.
|
| 200 |
+
*/
|
| 201 |
+
#define pg_attribute_noreturn()
|
| 202 |
+
#endif
|
| 203 |
+
|
| 204 |
+
/*
|
| 205 |
+
* Use "pg_attribute_always_inline" in place of "inline" for functions that
|
| 206 |
+
* we wish to force inlining of, even when the compiler's heuristics would
|
| 207 |
+
* choose not to. But, if possible, don't force inlining in unoptimized
|
| 208 |
+
* debug builds.
|
| 209 |
+
*/
|
| 210 |
+
#if (defined(__GNUC__) && __GNUC__ > 3 && defined(__OPTIMIZE__)) || defined(__SUNPRO_C) || defined(__IBMC__)
|
| 211 |
+
/* GCC > 3, Sunpro and XLC support always_inline via __attribute__ */
|
| 212 |
+
#define pg_attribute_always_inline __attribute__((always_inline)) inline
|
| 213 |
+
#elif defined(_MSC_VER)
|
| 214 |
+
/* MSVC has a special keyword for this */
|
| 215 |
+
#define pg_attribute_always_inline __forceinline
|
| 216 |
+
#else
|
| 217 |
+
/* Otherwise, the best we can do is to say "inline" */
|
| 218 |
+
#define pg_attribute_always_inline inline
|
| 219 |
+
#endif
|
| 220 |
+
|
| 221 |
+
/*
|
| 222 |
+
* Forcing a function not to be inlined can be useful if it's the slow path of
|
| 223 |
+
* a performance-critical function, or should be visible in profiles to allow
|
| 224 |
+
* for proper cost attribution. Note that unlike the pg_attribute_XXX macros
|
| 225 |
+
* above, this should be placed before the function's return type and name.
|
| 226 |
+
*/
|
| 227 |
+
/* GCC, Sunpro and XLC support noinline via __attribute__ */
|
| 228 |
+
#if (defined(__GNUC__) && __GNUC__ > 2) || defined(__SUNPRO_C) || defined(__IBMC__)
|
| 229 |
+
#define pg_noinline __attribute__((noinline))
|
| 230 |
+
/* msvc via declspec */
|
| 231 |
+
#elif defined(_MSC_VER)
|
| 232 |
+
#define pg_noinline __declspec(noinline)
|
| 233 |
+
#else
|
| 234 |
+
#define pg_noinline
|
| 235 |
+
#endif
|
| 236 |
+
|
| 237 |
+
/*
|
| 238 |
+
* For now, just define pg_attribute_cold and pg_attribute_hot to be empty
|
| 239 |
+
* macros on minGW 8.1. There appears to be a compiler bug that results in
|
| 240 |
+
* compilation failure. At this time, we still have at least one buildfarm
|
| 241 |
+
* animal running that compiler, so this should make that green again. It's
|
| 242 |
+
* likely this compiler is not popular enough to warrant keeping this code
|
| 243 |
+
* around forever, so let's just remove it once the last buildfarm animal
|
| 244 |
+
* upgrades.
|
| 245 |
+
*/
|
| 246 |
+
#if defined(__MINGW64__) && __GNUC__ == 8 && __GNUC_MINOR__ == 1
|
| 247 |
+
|
| 248 |
+
#define pg_attribute_cold
|
| 249 |
+
#define pg_attribute_hot
|
| 250 |
+
|
| 251 |
+
#else
|
| 252 |
+
/*
|
| 253 |
+
* Marking certain functions as "hot" or "cold" can be useful to assist the
|
| 254 |
+
* compiler in arranging the assembly code in a more efficient way.
|
| 255 |
+
*/
|
| 256 |
+
#if __has_attribute (cold)
|
| 257 |
+
#define pg_attribute_cold __attribute__((cold))
|
| 258 |
+
#else
|
| 259 |
+
#define pg_attribute_cold
|
| 260 |
+
#endif
|
| 261 |
+
|
| 262 |
+
#if __has_attribute (hot)
|
| 263 |
+
#define pg_attribute_hot __attribute__((hot))
|
| 264 |
+
#else
|
| 265 |
+
#define pg_attribute_hot
|
| 266 |
+
#endif
|
| 267 |
+
|
| 268 |
+
#endif /* defined(__MINGW64__) && __GNUC__ == 8 &&
|
| 269 |
+
* __GNUC_MINOR__ == 1 */
|
| 270 |
+
/*
|
| 271 |
+
* Mark a point as unreachable in a portable fashion. This should preferably
|
| 272 |
+
* be something that the compiler understands, to aid code generation.
|
| 273 |
+
* In assert-enabled builds, we prefer abort() for debugging reasons.
|
| 274 |
+
*/
|
| 275 |
+
#if defined(HAVE__BUILTIN_UNREACHABLE) && !defined(USE_ASSERT_CHECKING)
|
| 276 |
+
#define pg_unreachable() __builtin_unreachable()
|
| 277 |
+
#elif defined(_MSC_VER) && !defined(USE_ASSERT_CHECKING)
|
| 278 |
+
#define pg_unreachable() __assume(0)
|
| 279 |
+
#else
|
| 280 |
+
#define pg_unreachable() abort()
|
| 281 |
+
#endif
|
| 282 |
+
|
| 283 |
+
/*
|
| 284 |
+
* Hints to the compiler about the likelihood of a branch. Both likely() and
|
| 285 |
+
* unlikely() return the boolean value of the contained expression.
|
| 286 |
+
*
|
| 287 |
+
* These should only be used sparingly, in very hot code paths. It's very easy
|
| 288 |
+
* to mis-estimate likelihoods.
|
| 289 |
+
*/
|
| 290 |
+
#if __GNUC__ >= 3
|
| 291 |
+
#define likely(x) __builtin_expect((x) != 0, 1)
|
| 292 |
+
#define unlikely(x) __builtin_expect((x) != 0, 0)
|
| 293 |
+
#else
|
| 294 |
+
#define likely(x) ((x) != 0)
|
| 295 |
+
#define unlikely(x) ((x) != 0)
|
| 296 |
+
#endif
|
| 297 |
+
|
| 298 |
+
/*
|
| 299 |
+
* CppAsString
|
| 300 |
+
* Convert the argument to a string, using the C preprocessor.
|
| 301 |
+
* CppAsString2
|
| 302 |
+
* Convert the argument to a string, after one round of macro expansion.
|
| 303 |
+
* CppConcat
|
| 304 |
+
* Concatenate two arguments together, using the C preprocessor.
|
| 305 |
+
*
|
| 306 |
+
* Note: There used to be support here for pre-ANSI C compilers that didn't
|
| 307 |
+
* support # and ##. Nowadays, these macros are just for clarity and/or
|
| 308 |
+
* backward compatibility with existing PostgreSQL code.
|
| 309 |
+
*/
|
| 310 |
+
#define CppAsString(identifier) #identifier
|
| 311 |
+
#define CppAsString2(x) CppAsString(x)
|
| 312 |
+
#define CppConcat(x, y) x##y
|
| 313 |
+
|
| 314 |
+
/*
|
| 315 |
+
* VA_ARGS_NARGS
|
| 316 |
+
* Returns the number of macro arguments it is passed.
|
| 317 |
+
*
|
| 318 |
+
* An empty argument still counts as an argument, so effectively, this is
|
| 319 |
+
* "one more than the number of commas in the argument list".
|
| 320 |
+
*
|
| 321 |
+
* This works for up to 63 arguments. Internally, VA_ARGS_NARGS_() is passed
|
| 322 |
+
* 64+N arguments, and the C99 standard only requires macros to allow up to
|
| 323 |
+
* 127 arguments, so we can't portably go higher. The implementation is
|
| 324 |
+
* pretty trivial: VA_ARGS_NARGS_() returns its 64th argument, and we set up
|
| 325 |
+
* the call so that that is the appropriate one of the list of constants.
|
| 326 |
+
* This idea is due to Laurent Deniau.
|
| 327 |
+
*
|
| 328 |
+
* MSVC has an implementation of __VA_ARGS__ that doesn't conform to the
|
| 329 |
+
* standard unless you use the /Zc:preprocessor compiler flag, but that
|
| 330 |
+
* isn't available before Visual Studio 2019. For now, use a different
|
| 331 |
+
* definition that also works on older compilers.
|
| 332 |
+
*/
|
| 333 |
+
#ifdef _MSC_VER
|
| 334 |
+
#define EXPAND(args) args
|
| 335 |
+
#define VA_ARGS_NARGS(...) \
|
| 336 |
+
VA_ARGS_NARGS_ EXPAND((__VA_ARGS__, \
|
| 337 |
+
63,62,61,60, \
|
| 338 |
+
59,58,57,56,55,54,53,52,51,50, \
|
| 339 |
+
49,48,47,46,45,44,43,42,41,40, \
|
| 340 |
+
39,38,37,36,35,34,33,32,31,30, \
|
| 341 |
+
29,28,27,26,25,24,23,22,21,20, \
|
| 342 |
+
19,18,17,16,15,14,13,12,11,10, \
|
| 343 |
+
9, 8, 7, 6, 5, 4, 3, 2, 1, 0))
|
| 344 |
+
#else
|
| 345 |
+
|
| 346 |
+
#define VA_ARGS_NARGS(...) \
|
| 347 |
+
VA_ARGS_NARGS_(__VA_ARGS__, \
|
| 348 |
+
63,62,61,60, \
|
| 349 |
+
59,58,57,56,55,54,53,52,51,50, \
|
| 350 |
+
49,48,47,46,45,44,43,42,41,40, \
|
| 351 |
+
39,38,37,36,35,34,33,32,31,30, \
|
| 352 |
+
29,28,27,26,25,24,23,22,21,20, \
|
| 353 |
+
19,18,17,16,15,14,13,12,11,10, \
|
| 354 |
+
9, 8, 7, 6, 5, 4, 3, 2, 1, 0)
|
| 355 |
+
#endif
|
| 356 |
+
|
| 357 |
+
#define VA_ARGS_NARGS_( \
|
| 358 |
+
_01,_02,_03,_04,_05,_06,_07,_08,_09,_10, \
|
| 359 |
+
_11,_12,_13,_14,_15,_16,_17,_18,_19,_20, \
|
| 360 |
+
_21,_22,_23,_24,_25,_26,_27,_28,_29,_30, \
|
| 361 |
+
_31,_32,_33,_34,_35,_36,_37,_38,_39,_40, \
|
| 362 |
+
_41,_42,_43,_44,_45,_46,_47,_48,_49,_50, \
|
| 363 |
+
_51,_52,_53,_54,_55,_56,_57,_58,_59,_60, \
|
| 364 |
+
_61,_62,_63, N, ...) \
|
| 365 |
+
(N)
|
| 366 |
+
|
| 367 |
+
/*
|
| 368 |
+
* Generic function pointer. This can be used in the rare cases where it's
|
| 369 |
+
* necessary to cast a function pointer to a seemingly incompatible function
|
| 370 |
+
* pointer type while avoiding gcc's -Wcast-function-type warnings.
|
| 371 |
+
*/
|
| 372 |
+
typedef void (*pg_funcptr_t) (void);
|
| 373 |
+
|
| 374 |
+
/*
|
| 375 |
+
* We require C99, hence the compiler should understand flexible array
|
| 376 |
+
* members. However, for documentation purposes we still consider it to be
|
| 377 |
+
* project style to write "field[FLEXIBLE_ARRAY_MEMBER]" not just "field[]".
|
| 378 |
+
* When computing the size of such an object, use "offsetof(struct s, f)"
|
| 379 |
+
* for portability. Don't use "offsetof(struct s, f[0])", as this doesn't
|
| 380 |
+
* work with MSVC and with C++ compilers.
|
| 381 |
+
*/
|
| 382 |
+
#define FLEXIBLE_ARRAY_MEMBER /* empty */
|
| 383 |
+
|
| 384 |
+
/*
|
| 385 |
+
* Does the compiler support #pragma GCC system_header? We optionally use it
|
| 386 |
+
* to avoid warnings that we can't fix (e.g. in the perl headers).
|
| 387 |
+
* See https://gcc.gnu.org/onlinedocs/cpp/System-Headers.html
|
| 388 |
+
*
|
| 389 |
+
* Headers for which we do not want to show compiler warnings can,
|
| 390 |
+
* conditionally, use #pragma GCC system_header to avoid warnings. Obviously
|
| 391 |
+
* this should only be used for external headers over which we do not have
|
| 392 |
+
* control.
|
| 393 |
+
*
|
| 394 |
+
* Support for the pragma is tested here, instead of during configure, as gcc
|
| 395 |
+
* also warns about the pragma being used in a .c file. It's surprisingly hard
|
| 396 |
+
* to get autoconf to use .h as the file-ending. Looks like gcc has
|
| 397 |
+
* implemented the pragma since the 2000, so this test should suffice.
|
| 398 |
+
*
|
| 399 |
+
*
|
| 400 |
+
* Alternatively, we could add the include paths for problematic headers with
|
| 401 |
+
* -isystem, but that is a larger hammer and is harder to search for.
|
| 402 |
+
*
|
| 403 |
+
* A more granular alternative would be to use #pragma GCC diagnostic
|
| 404 |
+
* push/ignored/pop, but gcc warns about unknown warnings being ignored, so
|
| 405 |
+
* every to-be-ignored-temporarily compiler warning would require its own
|
| 406 |
+
* pg_config.h symbol and #ifdef.
|
| 407 |
+
*/
|
| 408 |
+
#ifdef __GNUC__
|
| 409 |
+
#define HAVE_PRAGMA_GCC_SYSTEM_HEADER 1
|
| 410 |
+
#endif
|
| 411 |
+
|
| 412 |
+
|
| 413 |
+
/* ----------------------------------------------------------------
|
| 414 |
+
* Section 2: bool, true, false
|
| 415 |
+
* ----------------------------------------------------------------
|
| 416 |
+
*/
|
| 417 |
+
|
| 418 |
+
/*
|
| 419 |
+
* bool
|
| 420 |
+
* Boolean value, either true or false.
|
| 421 |
+
*
|
| 422 |
+
* We use stdbool.h if available and its bool has size 1. That's useful for
|
| 423 |
+
* better compiler and debugger output and for compatibility with third-party
|
| 424 |
+
* libraries. But PostgreSQL currently cannot deal with bool of other sizes;
|
| 425 |
+
* there are static assertions around the code to prevent that.
|
| 426 |
+
*
|
| 427 |
+
* For C++ compilers, we assume the compiler has a compatible built-in
|
| 428 |
+
* definition of bool.
|
| 429 |
+
*
|
| 430 |
+
* See also the version of this code in src/interfaces/ecpg/include/ecpglib.h.
|
| 431 |
+
*/
|
| 432 |
+
|
| 433 |
+
#ifndef __cplusplus
|
| 434 |
+
|
| 435 |
+
#ifdef PG_USE_STDBOOL
|
| 436 |
+
#include <stdbool.h>
|
| 437 |
+
#else
|
| 438 |
+
|
| 439 |
+
#ifndef bool
|
| 440 |
+
typedef unsigned char bool;
|
| 441 |
+
#endif
|
| 442 |
+
|
| 443 |
+
#ifndef true
|
| 444 |
+
#define true ((bool) 1)
|
| 445 |
+
#endif
|
| 446 |
+
|
| 447 |
+
#ifndef false
|
| 448 |
+
#define false ((bool) 0)
|
| 449 |
+
#endif
|
| 450 |
+
|
| 451 |
+
#endif /* not PG_USE_STDBOOL */
|
| 452 |
+
#endif /* not C++ */
|
| 453 |
+
|
| 454 |
+
|
| 455 |
+
/* ----------------------------------------------------------------
|
| 456 |
+
* Section 3: standard system types
|
| 457 |
+
* ----------------------------------------------------------------
|
| 458 |
+
*/
|
| 459 |
+
|
| 460 |
+
/*
|
| 461 |
+
* Pointer
|
| 462 |
+
* Variable holding address of any memory resident object.
|
| 463 |
+
*
|
| 464 |
+
* XXX Pointer arithmetic is done with this, so it can't be void *
|
| 465 |
+
* under "true" ANSI compilers.
|
| 466 |
+
*/
|
| 467 |
+
typedef char *Pointer;
|
| 468 |
+
|
| 469 |
+
/*
|
| 470 |
+
* intN
|
| 471 |
+
* Signed integer, EXACTLY N BITS IN SIZE,
|
| 472 |
+
* used for numerical computations and the
|
| 473 |
+
* frontend/backend protocol.
|
| 474 |
+
*/
|
| 475 |
+
#ifndef HAVE_INT8
|
| 476 |
+
typedef signed char int8; /* == 8 bits */
|
| 477 |
+
typedef signed short int16; /* == 16 bits */
|
| 478 |
+
typedef signed int int32; /* == 32 bits */
|
| 479 |
+
#endif /* not HAVE_INT8 */
|
| 480 |
+
|
| 481 |
+
/*
|
| 482 |
+
* uintN
|
| 483 |
+
* Unsigned integer, EXACTLY N BITS IN SIZE,
|
| 484 |
+
* used for numerical computations and the
|
| 485 |
+
* frontend/backend protocol.
|
| 486 |
+
*/
|
| 487 |
+
#ifndef HAVE_UINT8
|
| 488 |
+
typedef unsigned char uint8; /* == 8 bits */
|
| 489 |
+
typedef unsigned short uint16; /* == 16 bits */
|
| 490 |
+
typedef unsigned int uint32; /* == 32 bits */
|
| 491 |
+
#endif /* not HAVE_UINT8 */
|
| 492 |
+
|
| 493 |
+
/*
|
| 494 |
+
* bitsN
|
| 495 |
+
* Unit of bitwise operation, AT LEAST N BITS IN SIZE.
|
| 496 |
+
*/
|
| 497 |
+
typedef uint8 bits8; /* >= 8 bits */
|
| 498 |
+
typedef uint16 bits16; /* >= 16 bits */
|
| 499 |
+
typedef uint32 bits32; /* >= 32 bits */
|
| 500 |
+
|
| 501 |
+
/*
|
| 502 |
+
* 64-bit integers
|
| 503 |
+
*/
|
| 504 |
+
#ifdef HAVE_LONG_INT_64
|
| 505 |
+
/* Plain "long int" fits, use it */
|
| 506 |
+
|
| 507 |
+
#ifndef HAVE_INT64
|
| 508 |
+
typedef long int int64;
|
| 509 |
+
#endif
|
| 510 |
+
#ifndef HAVE_UINT64
|
| 511 |
+
typedef unsigned long int uint64;
|
| 512 |
+
#endif
|
| 513 |
+
#define INT64CONST(x) (x##L)
|
| 514 |
+
#define UINT64CONST(x) (x##UL)
|
| 515 |
+
#elif defined(HAVE_LONG_LONG_INT_64)
|
| 516 |
+
/* We have working support for "long long int", use that */
|
| 517 |
+
|
| 518 |
+
#ifndef HAVE_INT64
|
| 519 |
+
typedef long long int int64;
|
| 520 |
+
#endif
|
| 521 |
+
#ifndef HAVE_UINT64
|
| 522 |
+
typedef unsigned long long int uint64;
|
| 523 |
+
#endif
|
| 524 |
+
#define INT64CONST(x) (x##LL)
|
| 525 |
+
#define UINT64CONST(x) (x##ULL)
|
| 526 |
+
#else
|
| 527 |
+
/* neither HAVE_LONG_INT_64 nor HAVE_LONG_LONG_INT_64 */
|
| 528 |
+
#error must have a working 64-bit integer datatype
|
| 529 |
+
#endif
|
| 530 |
+
|
| 531 |
+
/* snprintf format strings to use for 64-bit integers */
|
| 532 |
+
#define INT64_FORMAT "%" INT64_MODIFIER "d"
|
| 533 |
+
#define UINT64_FORMAT "%" INT64_MODIFIER "u"
|
| 534 |
+
|
| 535 |
+
/*
|
| 536 |
+
* 128-bit signed and unsigned integers
|
| 537 |
+
* There currently is only limited support for such types.
|
| 538 |
+
* E.g. 128bit literals and snprintf are not supported; but math is.
|
| 539 |
+
* Also, because we exclude such types when choosing MAXIMUM_ALIGNOF,
|
| 540 |
+
* it must be possible to coerce the compiler to allocate them on no
|
| 541 |
+
* more than MAXALIGN boundaries.
|
| 542 |
+
*/
|
| 543 |
+
#if defined(PG_INT128_TYPE)
|
| 544 |
+
#if defined(pg_attribute_aligned) || ALIGNOF_PG_INT128_TYPE <= MAXIMUM_ALIGNOF
|
| 545 |
+
#define HAVE_INT128 1
|
| 546 |
+
|
| 547 |
+
typedef PG_INT128_TYPE int128
|
| 548 |
+
#if defined(pg_attribute_aligned)
|
| 549 |
+
pg_attribute_aligned(MAXIMUM_ALIGNOF)
|
| 550 |
+
#endif
|
| 551 |
+
;
|
| 552 |
+
|
| 553 |
+
typedef unsigned PG_INT128_TYPE uint128
|
| 554 |
+
#if defined(pg_attribute_aligned)
|
| 555 |
+
pg_attribute_aligned(MAXIMUM_ALIGNOF)
|
| 556 |
+
#endif
|
| 557 |
+
;
|
| 558 |
+
|
| 559 |
+
#endif
|
| 560 |
+
#endif
|
| 561 |
+
|
| 562 |
+
/*
|
| 563 |
+
* stdint.h limits aren't guaranteed to have compatible types with our fixed
|
| 564 |
+
* width types. So just define our own.
|
| 565 |
+
*/
|
| 566 |
+
#define PG_INT8_MIN (-0x7F-1)
|
| 567 |
+
#define PG_INT8_MAX (0x7F)
|
| 568 |
+
#define PG_UINT8_MAX (0xFF)
|
| 569 |
+
#define PG_INT16_MIN (-0x7FFF-1)
|
| 570 |
+
#define PG_INT16_MAX (0x7FFF)
|
| 571 |
+
#define PG_UINT16_MAX (0xFFFF)
|
| 572 |
+
#define PG_INT32_MIN (-0x7FFFFFFF-1)
|
| 573 |
+
#define PG_INT32_MAX (0x7FFFFFFF)
|
| 574 |
+
#define PG_UINT32_MAX (0xFFFFFFFFU)
|
| 575 |
+
#define PG_INT64_MIN (-INT64CONST(0x7FFFFFFFFFFFFFFF) - 1)
|
| 576 |
+
#define PG_INT64_MAX INT64CONST(0x7FFFFFFFFFFFFFFF)
|
| 577 |
+
#define PG_UINT64_MAX UINT64CONST(0xFFFFFFFFFFFFFFFF)
|
| 578 |
+
|
| 579 |
+
/*
|
| 580 |
+
* We now always use int64 timestamps, but keep this symbol defined for the
|
| 581 |
+
* benefit of external code that might test it.
|
| 582 |
+
*/
|
| 583 |
+
#define HAVE_INT64_TIMESTAMP
|
| 584 |
+
|
| 585 |
+
/*
|
| 586 |
+
* Size
|
| 587 |
+
* Size of any memory resident object, as returned by sizeof.
|
| 588 |
+
*/
|
| 589 |
+
typedef size_t Size;
|
| 590 |
+
|
| 591 |
+
/*
|
| 592 |
+
* Index
|
| 593 |
+
* Index into any memory resident array.
|
| 594 |
+
*
|
| 595 |
+
* Note:
|
| 596 |
+
* Indices are non negative.
|
| 597 |
+
*/
|
| 598 |
+
typedef unsigned int Index;
|
| 599 |
+
|
| 600 |
+
/*
|
| 601 |
+
* Offset
|
| 602 |
+
* Offset into any memory resident array.
|
| 603 |
+
*
|
| 604 |
+
* Note:
|
| 605 |
+
* This differs from an Index in that an Index is always
|
| 606 |
+
* non negative, whereas Offset may be negative.
|
| 607 |
+
*/
|
| 608 |
+
typedef signed int Offset;
|
| 609 |
+
|
| 610 |
+
/*
|
| 611 |
+
* Common Postgres datatype names (as used in the catalogs)
|
| 612 |
+
*/
|
| 613 |
+
typedef float float4;
|
| 614 |
+
typedef double float8;
|
| 615 |
+
|
| 616 |
+
#ifdef USE_FLOAT8_BYVAL
|
| 617 |
+
#define FLOAT8PASSBYVAL true
|
| 618 |
+
#else
|
| 619 |
+
#define FLOAT8PASSBYVAL false
|
| 620 |
+
#endif
|
| 621 |
+
|
| 622 |
+
/*
|
| 623 |
+
* Oid, RegProcedure, TransactionId, SubTransactionId, MultiXactId,
|
| 624 |
+
* CommandId
|
| 625 |
+
*/
|
| 626 |
+
|
| 627 |
+
/* typedef Oid is in postgres_ext.h */
|
| 628 |
+
|
| 629 |
+
/*
|
| 630 |
+
* regproc is the type name used in the include/catalog headers, but
|
| 631 |
+
* RegProcedure is the preferred name in C code.
|
| 632 |
+
*/
|
| 633 |
+
typedef Oid regproc;
|
| 634 |
+
typedef regproc RegProcedure;
|
| 635 |
+
|
| 636 |
+
typedef uint32 TransactionId;
|
| 637 |
+
|
| 638 |
+
typedef uint32 LocalTransactionId;
|
| 639 |
+
|
| 640 |
+
typedef uint32 SubTransactionId;
|
| 641 |
+
|
| 642 |
+
#define InvalidSubTransactionId ((SubTransactionId) 0)
|
| 643 |
+
#define TopSubTransactionId ((SubTransactionId) 1)
|
| 644 |
+
|
| 645 |
+
/* MultiXactId must be equivalent to TransactionId, to fit in t_xmax */
|
| 646 |
+
typedef TransactionId MultiXactId;
|
| 647 |
+
|
| 648 |
+
typedef uint32 MultiXactOffset;
|
| 649 |
+
|
| 650 |
+
typedef uint32 CommandId;
|
| 651 |
+
|
| 652 |
+
#define FirstCommandId ((CommandId) 0)
|
| 653 |
+
#define InvalidCommandId (~(CommandId)0)
|
| 654 |
+
|
| 655 |
+
|
| 656 |
+
/* ----------------
|
| 657 |
+
* Variable-length datatypes all share the 'struct varlena' header.
|
| 658 |
+
*
|
| 659 |
+
* NOTE: for TOASTable types, this is an oversimplification, since the value
|
| 660 |
+
* may be compressed or moved out-of-line. However datatype-specific routines
|
| 661 |
+
* are mostly content to deal with de-TOASTed values only, and of course
|
| 662 |
+
* client-side routines should never see a TOASTed value. But even in a
|
| 663 |
+
* de-TOASTed value, beware of touching vl_len_ directly, as its
|
| 664 |
+
* representation is no longer convenient. It's recommended that code always
|
| 665 |
+
* use macros VARDATA_ANY, VARSIZE_ANY, VARSIZE_ANY_EXHDR, VARDATA, VARSIZE,
|
| 666 |
+
* and SET_VARSIZE instead of relying on direct mentions of the struct fields.
|
| 667 |
+
* See postgres.h for details of the TOASTed form.
|
| 668 |
+
* ----------------
|
| 669 |
+
*/
|
| 670 |
+
struct varlena
|
| 671 |
+
{
|
| 672 |
+
char vl_len_[4]; /* Do not touch this field directly! */
|
| 673 |
+
char vl_dat[FLEXIBLE_ARRAY_MEMBER]; /* Data content is here */
|
| 674 |
+
};
|
| 675 |
+
|
| 676 |
+
#define VARHDRSZ ((int32) sizeof(int32))
|
| 677 |
+
|
| 678 |
+
/*
|
| 679 |
+
* These widely-used datatypes are just a varlena header and the data bytes.
|
| 680 |
+
* There is no terminating null or anything like that --- the data length is
|
| 681 |
+
* always VARSIZE_ANY_EXHDR(ptr).
|
| 682 |
+
*/
|
| 683 |
+
typedef struct varlena bytea;
|
| 684 |
+
typedef struct varlena text;
|
| 685 |
+
typedef struct varlena BpChar; /* blank-padded char, ie SQL char(n) */
|
| 686 |
+
typedef struct varlena VarChar; /* var-length char, ie SQL varchar(n) */
|
| 687 |
+
|
| 688 |
+
/*
|
| 689 |
+
* Specialized array types. These are physically laid out just the same
|
| 690 |
+
* as regular arrays (so that the regular array subscripting code works
|
| 691 |
+
* with them). They exist as distinct types mostly for historical reasons:
|
| 692 |
+
* they have nonstandard I/O behavior which we don't want to change for fear
|
| 693 |
+
* of breaking applications that look at the system catalogs. There is also
|
| 694 |
+
* an implementation issue for oidvector: it's part of the primary key for
|
| 695 |
+
* pg_proc, and we can't use the normal btree array support routines for that
|
| 696 |
+
* without circularity.
|
| 697 |
+
*/
|
| 698 |
+
typedef struct
|
| 699 |
+
{
|
| 700 |
+
int32 vl_len_; /* these fields must match ArrayType! */
|
| 701 |
+
int ndim; /* always 1 for int2vector */
|
| 702 |
+
int32 dataoffset; /* always 0 for int2vector */
|
| 703 |
+
Oid elemtype;
|
| 704 |
+
int dim1;
|
| 705 |
+
int lbound1;
|
| 706 |
+
int16 values[FLEXIBLE_ARRAY_MEMBER];
|
| 707 |
+
} int2vector;
|
| 708 |
+
|
| 709 |
+
typedef struct
|
| 710 |
+
{
|
| 711 |
+
int32 vl_len_; /* these fields must match ArrayType! */
|
| 712 |
+
int ndim; /* always 1 for oidvector */
|
| 713 |
+
int32 dataoffset; /* always 0 for oidvector */
|
| 714 |
+
Oid elemtype;
|
| 715 |
+
int dim1;
|
| 716 |
+
int lbound1;
|
| 717 |
+
Oid values[FLEXIBLE_ARRAY_MEMBER];
|
| 718 |
+
} oidvector;
|
| 719 |
+
|
| 720 |
+
/*
|
| 721 |
+
* Representation of a Name: effectively just a C string, but null-padded to
|
| 722 |
+
* exactly NAMEDATALEN bytes. The use of a struct is historical.
|
| 723 |
+
*/
|
| 724 |
+
typedef struct nameData
|
| 725 |
+
{
|
| 726 |
+
char data[NAMEDATALEN];
|
| 727 |
+
} NameData;
|
| 728 |
+
typedef NameData *Name;
|
| 729 |
+
|
| 730 |
+
#define NameStr(name) ((name).data)
|
| 731 |
+
|
| 732 |
+
|
| 733 |
+
/* ----------------------------------------------------------------
|
| 734 |
+
* Section 4: IsValid macros for system types
|
| 735 |
+
* ----------------------------------------------------------------
|
| 736 |
+
*/
|
| 737 |
+
/*
|
| 738 |
+
* BoolIsValid
|
| 739 |
+
* True iff bool is valid.
|
| 740 |
+
*/
|
| 741 |
+
#define BoolIsValid(boolean) ((boolean) == false || (boolean) == true)
|
| 742 |
+
|
| 743 |
+
/*
|
| 744 |
+
* PointerIsValid
|
| 745 |
+
* True iff pointer is valid.
|
| 746 |
+
*/
|
| 747 |
+
#define PointerIsValid(pointer) ((const void*)(pointer) != NULL)
|
| 748 |
+
|
| 749 |
+
/*
|
| 750 |
+
* PointerIsAligned
|
| 751 |
+
* True iff pointer is properly aligned to point to the given type.
|
| 752 |
+
*/
|
| 753 |
+
#define PointerIsAligned(pointer, type) \
|
| 754 |
+
(((uintptr_t)(pointer) % (sizeof (type))) == 0)
|
| 755 |
+
|
| 756 |
+
#define OffsetToPointer(base, offset) \
|
| 757 |
+
((void *)((char *) base + offset))
|
| 758 |
+
|
| 759 |
+
#define OidIsValid(objectId) ((bool) ((objectId) != InvalidOid))
|
| 760 |
+
|
| 761 |
+
#define RegProcedureIsValid(p) OidIsValid(p)
|
| 762 |
+
|
| 763 |
+
|
| 764 |
+
/* ----------------------------------------------------------------
|
| 765 |
+
* Section 5: lengthof, alignment
|
| 766 |
+
* ----------------------------------------------------------------
|
| 767 |
+
*/
|
| 768 |
+
/*
|
| 769 |
+
* lengthof
|
| 770 |
+
* Number of elements in an array.
|
| 771 |
+
*/
|
| 772 |
+
#define lengthof(array) (sizeof (array) / sizeof ((array)[0]))
|
| 773 |
+
|
| 774 |
+
/* ----------------
|
| 775 |
+
* Alignment macros: align a length or address appropriately for a given type.
|
| 776 |
+
* The fooALIGN() macros round up to a multiple of the required alignment,
|
| 777 |
+
* while the fooALIGN_DOWN() macros round down. The latter are more useful
|
| 778 |
+
* for problems like "how many X-sized structures will fit in a page?".
|
| 779 |
+
*
|
| 780 |
+
* NOTE: TYPEALIGN[_DOWN] will not work if ALIGNVAL is not a power of 2.
|
| 781 |
+
* That case seems extremely unlikely to be needed in practice, however.
|
| 782 |
+
*
|
| 783 |
+
* NOTE: MAXIMUM_ALIGNOF, and hence MAXALIGN(), intentionally exclude any
|
| 784 |
+
* larger-than-8-byte types the compiler might have.
|
| 785 |
+
* ----------------
|
| 786 |
+
*/
|
| 787 |
+
|
| 788 |
+
#define TYPEALIGN(ALIGNVAL,LEN) \
|
| 789 |
+
(((uintptr_t) (LEN) + ((ALIGNVAL) - 1)) & ~((uintptr_t) ((ALIGNVAL) - 1)))
|
| 790 |
+
|
| 791 |
+
#define SHORTALIGN(LEN) TYPEALIGN(ALIGNOF_SHORT, (LEN))
|
| 792 |
+
#define INTALIGN(LEN) TYPEALIGN(ALIGNOF_INT, (LEN))
|
| 793 |
+
#define LONGALIGN(LEN) TYPEALIGN(ALIGNOF_LONG, (LEN))
|
| 794 |
+
#define DOUBLEALIGN(LEN) TYPEALIGN(ALIGNOF_DOUBLE, (LEN))
|
| 795 |
+
#define MAXALIGN(LEN) TYPEALIGN(MAXIMUM_ALIGNOF, (LEN))
|
| 796 |
+
/* MAXALIGN covers only built-in types, not buffers */
|
| 797 |
+
#define BUFFERALIGN(LEN) TYPEALIGN(ALIGNOF_BUFFER, (LEN))
|
| 798 |
+
#define CACHELINEALIGN(LEN) TYPEALIGN(PG_CACHE_LINE_SIZE, (LEN))
|
| 799 |
+
|
| 800 |
+
#define TYPEALIGN_DOWN(ALIGNVAL,LEN) \
|
| 801 |
+
(((uintptr_t) (LEN)) & ~((uintptr_t) ((ALIGNVAL) - 1)))
|
| 802 |
+
|
| 803 |
+
#define SHORTALIGN_DOWN(LEN) TYPEALIGN_DOWN(ALIGNOF_SHORT, (LEN))
|
| 804 |
+
#define INTALIGN_DOWN(LEN) TYPEALIGN_DOWN(ALIGNOF_INT, (LEN))
|
| 805 |
+
#define LONGALIGN_DOWN(LEN) TYPEALIGN_DOWN(ALIGNOF_LONG, (LEN))
|
| 806 |
+
#define DOUBLEALIGN_DOWN(LEN) TYPEALIGN_DOWN(ALIGNOF_DOUBLE, (LEN))
|
| 807 |
+
#define MAXALIGN_DOWN(LEN) TYPEALIGN_DOWN(MAXIMUM_ALIGNOF, (LEN))
|
| 808 |
+
#define BUFFERALIGN_DOWN(LEN) TYPEALIGN_DOWN(ALIGNOF_BUFFER, (LEN))
|
| 809 |
+
|
| 810 |
+
/*
|
| 811 |
+
* The above macros will not work with types wider than uintptr_t, like with
|
| 812 |
+
* uint64 on 32-bit platforms. That's not problem for the usual use where a
|
| 813 |
+
* pointer or a length is aligned, but for the odd case that you need to
|
| 814 |
+
* align something (potentially) wider, use TYPEALIGN64.
|
| 815 |
+
*/
|
| 816 |
+
#define TYPEALIGN64(ALIGNVAL,LEN) \
|
| 817 |
+
(((uint64) (LEN) + ((ALIGNVAL) - 1)) & ~((uint64) ((ALIGNVAL) - 1)))
|
| 818 |
+
|
| 819 |
+
/* we don't currently need wider versions of the other ALIGN macros */
|
| 820 |
+
#define MAXALIGN64(LEN) TYPEALIGN64(MAXIMUM_ALIGNOF, (LEN))
|
| 821 |
+
|
| 822 |
+
|
| 823 |
+
/* ----------------------------------------------------------------
|
| 824 |
+
* Section 6: assertions
|
| 825 |
+
* ----------------------------------------------------------------
|
| 826 |
+
*/
|
| 827 |
+
|
| 828 |
+
/*
|
| 829 |
+
* USE_ASSERT_CHECKING, if defined, turns on all the assertions.
|
| 830 |
+
* - plai 9/5/90
|
| 831 |
+
*
|
| 832 |
+
* It should _NOT_ be defined in releases or in benchmark copies
|
| 833 |
+
*/
|
| 834 |
+
|
| 835 |
+
/*
|
| 836 |
+
* Assert() can be used in both frontend and backend code. In frontend code it
|
| 837 |
+
* just calls the standard assert, if it's available. If use of assertions is
|
| 838 |
+
* not configured, it does nothing.
|
| 839 |
+
*/
|
| 840 |
+
#ifndef USE_ASSERT_CHECKING
|
| 841 |
+
|
| 842 |
+
#define Assert(condition) ((void)true)
|
| 843 |
+
#define AssertMacro(condition) ((void)true)
|
| 844 |
+
|
| 845 |
+
#elif defined(FRONTEND)
|
| 846 |
+
|
| 847 |
+
#include <assert.h>
|
| 848 |
+
#define Assert(p) assert(p)
|
| 849 |
+
#define AssertMacro(p) ((void) assert(p))
|
| 850 |
+
|
| 851 |
+
#else /* USE_ASSERT_CHECKING && !FRONTEND */
|
| 852 |
+
|
| 853 |
+
/*
|
| 854 |
+
* Assert
|
| 855 |
+
* Generates a fatal exception if the given condition is false.
|
| 856 |
+
*/
|
| 857 |
+
#define Assert(condition) \
|
| 858 |
+
do { \
|
| 859 |
+
if (!(condition)) \
|
| 860 |
+
ExceptionalCondition(#condition, __FILE__, __LINE__); \
|
| 861 |
+
} while (0)
|
| 862 |
+
|
| 863 |
+
/*
|
| 864 |
+
* AssertMacro is the same as Assert but it's suitable for use in
|
| 865 |
+
* expression-like macros, for example:
|
| 866 |
+
*
|
| 867 |
+
* #define foo(x) (AssertMacro(x != 0), bar(x))
|
| 868 |
+
*/
|
| 869 |
+
#define AssertMacro(condition) \
|
| 870 |
+
((void) ((condition) || \
|
| 871 |
+
(ExceptionalCondition(#condition, __FILE__, __LINE__), 0)))
|
| 872 |
+
|
| 873 |
+
#endif /* USE_ASSERT_CHECKING && !FRONTEND */
|
| 874 |
+
|
| 875 |
+
/*
|
| 876 |
+
* Check that `ptr' is `bndr' aligned.
|
| 877 |
+
*/
|
| 878 |
+
#define AssertPointerAlignment(ptr, bndr) \
|
| 879 |
+
Assert(TYPEALIGN(bndr, (uintptr_t)(ptr)) == (uintptr_t)(ptr))
|
| 880 |
+
|
| 881 |
+
/*
|
| 882 |
+
* ExceptionalCondition is compiled into the backend whether or not
|
| 883 |
+
* USE_ASSERT_CHECKING is defined, so as to support use of extensions
|
| 884 |
+
* that are built with that #define with a backend that isn't. Hence,
|
| 885 |
+
* we should declare it as long as !FRONTEND.
|
| 886 |
+
*/
|
| 887 |
+
#ifndef FRONTEND
|
| 888 |
+
extern void ExceptionalCondition(const char *conditionName,
|
| 889 |
+
const char *fileName, int lineNumber) pg_attribute_noreturn();
|
| 890 |
+
#endif
|
| 891 |
+
|
| 892 |
+
/*
|
| 893 |
+
* Macros to support compile-time assertion checks.
|
| 894 |
+
*
|
| 895 |
+
* If the "condition" (a compile-time-constant expression) evaluates to false,
|
| 896 |
+
* throw a compile error using the "errmessage" (a string literal).
|
| 897 |
+
*
|
| 898 |
+
* C11 has _Static_assert(), and most C99 compilers already support that. For
|
| 899 |
+
* portability, we wrap it into StaticAssertDecl(). _Static_assert() is a
|
| 900 |
+
* "declaration", and so it must be placed where for example a variable
|
| 901 |
+
* declaration would be valid. As long as we compile with
|
| 902 |
+
* -Wno-declaration-after-statement, that also means it cannot be placed after
|
| 903 |
+
* statements in a function. Macros StaticAssertStmt() and StaticAssertExpr()
|
| 904 |
+
* make it safe to use as a statement or in an expression, respectively.
|
| 905 |
+
*
|
| 906 |
+
* For compilers without _Static_assert(), we fall back on a kluge that
|
| 907 |
+
* assumes the compiler will complain about a negative width for a struct
|
| 908 |
+
* bit-field. This will not include a helpful error message, but it beats not
|
| 909 |
+
* getting an error at all.
|
| 910 |
+
*/
|
| 911 |
+
#ifndef __cplusplus
|
| 912 |
+
#ifdef HAVE__STATIC_ASSERT
|
| 913 |
+
#define StaticAssertDecl(condition, errmessage) \
|
| 914 |
+
_Static_assert(condition, errmessage)
|
| 915 |
+
#define StaticAssertStmt(condition, errmessage) \
|
| 916 |
+
do { _Static_assert(condition, errmessage); } while(0)
|
| 917 |
+
#define StaticAssertExpr(condition, errmessage) \
|
| 918 |
+
((void) ({ StaticAssertStmt(condition, errmessage); true; }))
|
| 919 |
+
#else /* !HAVE__STATIC_ASSERT */
|
| 920 |
+
#define StaticAssertDecl(condition, errmessage) \
|
| 921 |
+
extern void static_assert_func(int static_assert_failure[(condition) ? 1 : -1])
|
| 922 |
+
#define StaticAssertStmt(condition, errmessage) \
|
| 923 |
+
((void) sizeof(struct { int static_assert_failure : (condition) ? 1 : -1; }))
|
| 924 |
+
#define StaticAssertExpr(condition, errmessage) \
|
| 925 |
+
StaticAssertStmt(condition, errmessage)
|
| 926 |
+
#endif /* HAVE__STATIC_ASSERT */
|
| 927 |
+
#else /* C++ */
|
| 928 |
+
#if defined(__cpp_static_assert) && __cpp_static_assert >= 200410
|
| 929 |
+
#define StaticAssertDecl(condition, errmessage) \
|
| 930 |
+
static_assert(condition, errmessage)
|
| 931 |
+
#define StaticAssertStmt(condition, errmessage) \
|
| 932 |
+
static_assert(condition, errmessage)
|
| 933 |
+
#define StaticAssertExpr(condition, errmessage) \
|
| 934 |
+
({ static_assert(condition, errmessage); })
|
| 935 |
+
#else /* !__cpp_static_assert */
|
| 936 |
+
#define StaticAssertDecl(condition, errmessage) \
|
| 937 |
+
extern void static_assert_func(int static_assert_failure[(condition) ? 1 : -1])
|
| 938 |
+
#define StaticAssertStmt(condition, errmessage) \
|
| 939 |
+
do { struct static_assert_struct { int static_assert_failure : (condition) ? 1 : -1; }; } while(0)
|
| 940 |
+
#define StaticAssertExpr(condition, errmessage) \
|
| 941 |
+
((void) ({ StaticAssertStmt(condition, errmessage); }))
|
| 942 |
+
#endif /* __cpp_static_assert */
|
| 943 |
+
#endif /* C++ */
|
| 944 |
+
|
| 945 |
+
|
| 946 |
+
/*
|
| 947 |
+
* Compile-time checks that a variable (or expression) has the specified type.
|
| 948 |
+
*
|
| 949 |
+
* AssertVariableIsOfType() can be used as a statement.
|
| 950 |
+
* AssertVariableIsOfTypeMacro() is intended for use in macros, eg
|
| 951 |
+
* #define foo(x) (AssertVariableIsOfTypeMacro(x, int), bar(x))
|
| 952 |
+
*
|
| 953 |
+
* If we don't have __builtin_types_compatible_p, we can still assert that
|
| 954 |
+
* the types have the same size. This is far from ideal (especially on 32-bit
|
| 955 |
+
* platforms) but it provides at least some coverage.
|
| 956 |
+
*/
|
| 957 |
+
#ifdef HAVE__BUILTIN_TYPES_COMPATIBLE_P
|
| 958 |
+
#define AssertVariableIsOfType(varname, typename) \
|
| 959 |
+
StaticAssertStmt(__builtin_types_compatible_p(__typeof__(varname), typename), \
|
| 960 |
+
CppAsString(varname) " does not have type " CppAsString(typename))
|
| 961 |
+
#define AssertVariableIsOfTypeMacro(varname, typename) \
|
| 962 |
+
(StaticAssertExpr(__builtin_types_compatible_p(__typeof__(varname), typename), \
|
| 963 |
+
CppAsString(varname) " does not have type " CppAsString(typename)))
|
| 964 |
+
#else /* !HAVE__BUILTIN_TYPES_COMPATIBLE_P */
|
| 965 |
+
#define AssertVariableIsOfType(varname, typename) \
|
| 966 |
+
StaticAssertStmt(sizeof(varname) == sizeof(typename), \
|
| 967 |
+
CppAsString(varname) " does not have type " CppAsString(typename))
|
| 968 |
+
#define AssertVariableIsOfTypeMacro(varname, typename) \
|
| 969 |
+
(StaticAssertExpr(sizeof(varname) == sizeof(typename), \
|
| 970 |
+
CppAsString(varname) " does not have type " CppAsString(typename)))
|
| 971 |
+
#endif /* HAVE__BUILTIN_TYPES_COMPATIBLE_P */
|
| 972 |
+
|
| 973 |
+
|
| 974 |
+
/* ----------------------------------------------------------------
|
| 975 |
+
* Section 7: widely useful macros
|
| 976 |
+
* ----------------------------------------------------------------
|
| 977 |
+
*/
|
| 978 |
+
/*
|
| 979 |
+
* Max
|
| 980 |
+
* Return the maximum of two numbers.
|
| 981 |
+
*/
|
| 982 |
+
#define Max(x, y) ((x) > (y) ? (x) : (y))
|
| 983 |
+
|
| 984 |
+
/*
|
| 985 |
+
* Min
|
| 986 |
+
* Return the minimum of two numbers.
|
| 987 |
+
*/
|
| 988 |
+
#define Min(x, y) ((x) < (y) ? (x) : (y))
|
| 989 |
+
|
| 990 |
+
|
| 991 |
+
/* Get a bit mask of the bits set in non-long aligned addresses */
|
| 992 |
+
#define LONG_ALIGN_MASK (sizeof(long) - 1)
|
| 993 |
+
|
| 994 |
+
/*
|
| 995 |
+
* MemSet
|
| 996 |
+
* Exactly the same as standard library function memset(), but considerably
|
| 997 |
+
* faster for zeroing small word-aligned structures (such as parsetree nodes).
|
| 998 |
+
* This has to be a macro because the main point is to avoid function-call
|
| 999 |
+
* overhead. However, we have also found that the loop is faster than
|
| 1000 |
+
* native libc memset() on some platforms, even those with assembler
|
| 1001 |
+
* memset() functions. More research needs to be done, perhaps with
|
| 1002 |
+
* MEMSET_LOOP_LIMIT tests in configure.
|
| 1003 |
+
*/
|
| 1004 |
+
#define MemSet(start, val, len) \
|
| 1005 |
+
do \
|
| 1006 |
+
{ \
|
| 1007 |
+
/* must be void* because we don't know if it is integer aligned yet */ \
|
| 1008 |
+
void *_vstart = (void *) (start); \
|
| 1009 |
+
int _val = (val); \
|
| 1010 |
+
Size _len = (len); \
|
| 1011 |
+
\
|
| 1012 |
+
if ((((uintptr_t) _vstart) & LONG_ALIGN_MASK) == 0 && \
|
| 1013 |
+
(_len & LONG_ALIGN_MASK) == 0 && \
|
| 1014 |
+
_val == 0 && \
|
| 1015 |
+
_len <= MEMSET_LOOP_LIMIT && \
|
| 1016 |
+
/* \
|
| 1017 |
+
* If MEMSET_LOOP_LIMIT == 0, optimizer should find \
|
| 1018 |
+
* the whole "if" false at compile time. \
|
| 1019 |
+
*/ \
|
| 1020 |
+
MEMSET_LOOP_LIMIT != 0) \
|
| 1021 |
+
{ \
|
| 1022 |
+
long *_start = (long *) _vstart; \
|
| 1023 |
+
long *_stop = (long *) ((char *) _start + _len); \
|
| 1024 |
+
while (_start < _stop) \
|
| 1025 |
+
*_start++ = 0; \
|
| 1026 |
+
} \
|
| 1027 |
+
else \
|
| 1028 |
+
memset(_vstart, _val, _len); \
|
| 1029 |
+
} while (0)
|
| 1030 |
+
|
| 1031 |
+
/*
|
| 1032 |
+
* MemSetAligned is the same as MemSet except it omits the test to see if
|
| 1033 |
+
* "start" is word-aligned. This is okay to use if the caller knows a-priori
|
| 1034 |
+
* that the pointer is suitably aligned (typically, because he just got it
|
| 1035 |
+
* from palloc(), which always delivers a max-aligned pointer).
|
| 1036 |
+
*/
|
| 1037 |
+
#define MemSetAligned(start, val, len) \
|
| 1038 |
+
do \
|
| 1039 |
+
{ \
|
| 1040 |
+
long *_start = (long *) (start); \
|
| 1041 |
+
int _val = (val); \
|
| 1042 |
+
Size _len = (len); \
|
| 1043 |
+
\
|
| 1044 |
+
if ((_len & LONG_ALIGN_MASK) == 0 && \
|
| 1045 |
+
_val == 0 && \
|
| 1046 |
+
_len <= MEMSET_LOOP_LIMIT && \
|
| 1047 |
+
MEMSET_LOOP_LIMIT != 0) \
|
| 1048 |
+
{ \
|
| 1049 |
+
long *_stop = (long *) ((char *) _start + _len); \
|
| 1050 |
+
while (_start < _stop) \
|
| 1051 |
+
*_start++ = 0; \
|
| 1052 |
+
} \
|
| 1053 |
+
else \
|
| 1054 |
+
memset(_start, _val, _len); \
|
| 1055 |
+
} while (0)
|
| 1056 |
+
|
| 1057 |
+
|
| 1058 |
+
/*
|
| 1059 |
+
* MemSetTest/MemSetLoop are a variant version that allow all the tests in
|
| 1060 |
+
* MemSet to be done at compile time in cases where "val" and "len" are
|
| 1061 |
+
* constants *and* we know the "start" pointer must be word-aligned.
|
| 1062 |
+
* If MemSetTest succeeds, then it is okay to use MemSetLoop, otherwise use
|
| 1063 |
+
* MemSetAligned. Beware of multiple evaluations of the arguments when using
|
| 1064 |
+
* this approach.
|
| 1065 |
+
*/
|
| 1066 |
+
#define MemSetTest(val, len) \
|
| 1067 |
+
( ((len) & LONG_ALIGN_MASK) == 0 && \
|
| 1068 |
+
(len) <= MEMSET_LOOP_LIMIT && \
|
| 1069 |
+
MEMSET_LOOP_LIMIT != 0 && \
|
| 1070 |
+
(val) == 0 )
|
| 1071 |
+
|
| 1072 |
+
#define MemSetLoop(start, val, len) \
|
| 1073 |
+
do \
|
| 1074 |
+
{ \
|
| 1075 |
+
long * _start = (long *) (start); \
|
| 1076 |
+
long * _stop = (long *) ((char *) _start + (Size) (len)); \
|
| 1077 |
+
\
|
| 1078 |
+
while (_start < _stop) \
|
| 1079 |
+
*_start++ = 0; \
|
| 1080 |
+
} while (0)
|
| 1081 |
+
|
| 1082 |
+
/*
|
| 1083 |
+
* Macros for range-checking float values before converting to integer.
|
| 1084 |
+
* We must be careful here that the boundary values are expressed exactly
|
| 1085 |
+
* in the float domain. PG_INTnn_MIN is an exact power of 2, so it will
|
| 1086 |
+
* be represented exactly; but PG_INTnn_MAX isn't, and might get rounded
|
| 1087 |
+
* off, so avoid using that.
|
| 1088 |
+
* The input must be rounded to an integer beforehand, typically with rint(),
|
| 1089 |
+
* else we might draw the wrong conclusion about close-to-the-limit values.
|
| 1090 |
+
* These macros will do the right thing for Inf, but not necessarily for NaN,
|
| 1091 |
+
* so check isnan(num) first if that's a possibility.
|
| 1092 |
+
*/
|
| 1093 |
+
#define FLOAT4_FITS_IN_INT16(num) \
|
| 1094 |
+
((num) >= (float4) PG_INT16_MIN && (num) < -((float4) PG_INT16_MIN))
|
| 1095 |
+
#define FLOAT4_FITS_IN_INT32(num) \
|
| 1096 |
+
((num) >= (float4) PG_INT32_MIN && (num) < -((float4) PG_INT32_MIN))
|
| 1097 |
+
#define FLOAT4_FITS_IN_INT64(num) \
|
| 1098 |
+
((num) >= (float4) PG_INT64_MIN && (num) < -((float4) PG_INT64_MIN))
|
| 1099 |
+
#define FLOAT8_FITS_IN_INT16(num) \
|
| 1100 |
+
((num) >= (float8) PG_INT16_MIN && (num) < -((float8) PG_INT16_MIN))
|
| 1101 |
+
#define FLOAT8_FITS_IN_INT32(num) \
|
| 1102 |
+
((num) >= (float8) PG_INT32_MIN && (num) < -((float8) PG_INT32_MIN))
|
| 1103 |
+
#define FLOAT8_FITS_IN_INT64(num) \
|
| 1104 |
+
((num) >= (float8) PG_INT64_MIN && (num) < -((float8) PG_INT64_MIN))
|
| 1105 |
+
|
| 1106 |
+
|
| 1107 |
+
/* ----------------------------------------------------------------
|
| 1108 |
+
* Section 8: random stuff
|
| 1109 |
+
* ----------------------------------------------------------------
|
| 1110 |
+
*/
|
| 1111 |
+
|
| 1112 |
+
/*
|
| 1113 |
+
* Invert the sign of a qsort-style comparison result, ie, exchange negative
|
| 1114 |
+
* and positive integer values, being careful not to get the wrong answer
|
| 1115 |
+
* for INT_MIN. The argument should be an integral variable.
|
| 1116 |
+
*/
|
| 1117 |
+
#define INVERT_COMPARE_RESULT(var) \
|
| 1118 |
+
((var) = ((var) < 0) ? 1 : -(var))
|
| 1119 |
+
|
| 1120 |
+
/*
|
| 1121 |
+
* Use this, not "char buf[BLCKSZ]", to declare a field or local variable
|
| 1122 |
+
* holding a page buffer, if that page might be accessed as a page. Otherwise
|
| 1123 |
+
* the variable might be under-aligned, causing problems on alignment-picky
|
| 1124 |
+
* hardware. We include both "double" and "int64" in the union to ensure that
|
| 1125 |
+
* the compiler knows the value must be MAXALIGN'ed (cf. configure's
|
| 1126 |
+
* computation of MAXIMUM_ALIGNOF).
|
| 1127 |
+
*/
|
| 1128 |
+
typedef union PGAlignedBlock
|
| 1129 |
+
{
|
| 1130 |
+
char data[BLCKSZ];
|
| 1131 |
+
double force_align_d;
|
| 1132 |
+
int64 force_align_i64;
|
| 1133 |
+
} PGAlignedBlock;
|
| 1134 |
+
|
| 1135 |
+
/*
|
| 1136 |
+
* Use this to declare a field or local variable holding a page buffer, if that
|
| 1137 |
+
* page might be accessed as a page or passed to an SMgr I/O function. If
|
| 1138 |
+
* allocating using the MemoryContext API, the aligned allocation functions
|
| 1139 |
+
* should be used with PG_IO_ALIGN_SIZE. This alignment may be more efficient
|
| 1140 |
+
* for I/O in general, but may be strictly required on some platforms when
|
| 1141 |
+
* using direct I/O.
|
| 1142 |
+
*/
|
| 1143 |
+
typedef union PGIOAlignedBlock
|
| 1144 |
+
{
|
| 1145 |
+
#ifdef pg_attribute_aligned
|
| 1146 |
+
pg_attribute_aligned(PG_IO_ALIGN_SIZE)
|
| 1147 |
+
#endif
|
| 1148 |
+
char data[BLCKSZ];
|
| 1149 |
+
double force_align_d;
|
| 1150 |
+
int64 force_align_i64;
|
| 1151 |
+
} PGIOAlignedBlock;
|
| 1152 |
+
|
| 1153 |
+
/* Same, but for an XLOG_BLCKSZ-sized buffer */
|
| 1154 |
+
typedef union PGAlignedXLogBlock
|
| 1155 |
+
{
|
| 1156 |
+
#ifdef pg_attribute_aligned
|
| 1157 |
+
pg_attribute_aligned(PG_IO_ALIGN_SIZE)
|
| 1158 |
+
#endif
|
| 1159 |
+
char data[XLOG_BLCKSZ];
|
| 1160 |
+
double force_align_d;
|
| 1161 |
+
int64 force_align_i64;
|
| 1162 |
+
} PGAlignedXLogBlock;
|
| 1163 |
+
|
| 1164 |
+
/* msb for char */
|
| 1165 |
+
#define HIGHBIT (0x80)
|
| 1166 |
+
#define IS_HIGHBIT_SET(ch) ((unsigned char)(ch) & HIGHBIT)
|
| 1167 |
+
|
| 1168 |
+
/*
|
| 1169 |
+
* Support macros for escaping strings. escape_backslash should be true
|
| 1170 |
+
* if generating a non-standard-conforming string. Prefixing a string
|
| 1171 |
+
* with ESCAPE_STRING_SYNTAX guarantees it is non-standard-conforming.
|
| 1172 |
+
* Beware of multiple evaluation of the "ch" argument!
|
| 1173 |
+
*/
|
| 1174 |
+
#define SQL_STR_DOUBLE(ch, escape_backslash) \
|
| 1175 |
+
((ch) == '\'' || ((ch) == '\\' && (escape_backslash)))
|
| 1176 |
+
|
| 1177 |
+
#define ESCAPE_STRING_SYNTAX 'E'
|
| 1178 |
+
|
| 1179 |
+
|
| 1180 |
+
#define STATUS_OK (0)
|
| 1181 |
+
#define STATUS_ERROR (-1)
|
| 1182 |
+
#define STATUS_EOF (-2)
|
| 1183 |
+
|
| 1184 |
+
/*
|
| 1185 |
+
* gettext support
|
| 1186 |
+
*/
|
| 1187 |
+
|
| 1188 |
+
#ifndef ENABLE_NLS
|
| 1189 |
+
/* stuff we'd otherwise get from <libintl.h> */
|
| 1190 |
+
#define gettext(x) (x)
|
| 1191 |
+
#define dgettext(d,x) (x)
|
| 1192 |
+
#define ngettext(s,p,n) ((n) == 1 ? (s) : (p))
|
| 1193 |
+
#define dngettext(d,s,p,n) ((n) == 1 ? (s) : (p))
|
| 1194 |
+
#endif
|
| 1195 |
+
|
| 1196 |
+
#define _(x) gettext(x)
|
| 1197 |
+
|
| 1198 |
+
/*
|
| 1199 |
+
* Use this to mark string constants as needing translation at some later
|
| 1200 |
+
* time, rather than immediately. This is useful for cases where you need
|
| 1201 |
+
* access to the original string and translated string, and for cases where
|
| 1202 |
+
* immediate translation is not possible, like when initializing global
|
| 1203 |
+
* variables.
|
| 1204 |
+
*
|
| 1205 |
+
* https://www.gnu.org/software/gettext/manual/html_node/Special-cases.html
|
| 1206 |
+
*/
|
| 1207 |
+
#define gettext_noop(x) (x)
|
| 1208 |
+
|
| 1209 |
+
/*
|
| 1210 |
+
* To better support parallel installations of major PostgreSQL
|
| 1211 |
+
* versions as well as parallel installations of major library soname
|
| 1212 |
+
* versions, we mangle the gettext domain name by appending those
|
| 1213 |
+
* version numbers. The coding rule ought to be that wherever the
|
| 1214 |
+
* domain name is mentioned as a literal, it must be wrapped into
|
| 1215 |
+
* PG_TEXTDOMAIN(). The macros below do not work on non-literals; but
|
| 1216 |
+
* that is somewhat intentional because it avoids having to worry
|
| 1217 |
+
* about multiple states of premangling and postmangling as the values
|
| 1218 |
+
* are being passed around.
|
| 1219 |
+
*
|
| 1220 |
+
* Make sure this matches the installation rules in nls-global.mk.
|
| 1221 |
+
*/
|
| 1222 |
+
#ifdef SO_MAJOR_VERSION
|
| 1223 |
+
#define PG_TEXTDOMAIN(domain) (domain CppAsString2(SO_MAJOR_VERSION) "-" PG_MAJORVERSION)
|
| 1224 |
+
#else
|
| 1225 |
+
#define PG_TEXTDOMAIN(domain) (domain "-" PG_MAJORVERSION)
|
| 1226 |
+
#endif
|
| 1227 |
+
|
| 1228 |
+
/*
|
| 1229 |
+
* Macro that allows to cast constness and volatile away from an expression, but doesn't
|
| 1230 |
+
* allow changing the underlying type. Enforcement of the latter
|
| 1231 |
+
* currently only works for gcc like compilers.
|
| 1232 |
+
*
|
| 1233 |
+
* Please note IT IS NOT SAFE to cast constness away if the result will ever
|
| 1234 |
+
* be modified (it would be undefined behaviour). Doing so anyway can cause
|
| 1235 |
+
* compiler misoptimizations or runtime crashes (modifying readonly memory).
|
| 1236 |
+
* It is only safe to use when the result will not be modified, but API
|
| 1237 |
+
* design or language restrictions prevent you from declaring that
|
| 1238 |
+
* (e.g. because a function returns both const and non-const variables).
|
| 1239 |
+
*
|
| 1240 |
+
* Note that this only works in function scope, not for global variables (it'd
|
| 1241 |
+
* be nice, but not trivial, to improve that).
|
| 1242 |
+
*/
|
| 1243 |
+
#if defined(HAVE__BUILTIN_TYPES_COMPATIBLE_P)
|
| 1244 |
+
#define unconstify(underlying_type, expr) \
|
| 1245 |
+
(StaticAssertExpr(__builtin_types_compatible_p(__typeof(expr), const underlying_type), \
|
| 1246 |
+
"wrong cast"), \
|
| 1247 |
+
(underlying_type) (expr))
|
| 1248 |
+
#define unvolatize(underlying_type, expr) \
|
| 1249 |
+
(StaticAssertExpr(__builtin_types_compatible_p(__typeof(expr), volatile underlying_type), \
|
| 1250 |
+
"wrong cast"), \
|
| 1251 |
+
(underlying_type) (expr))
|
| 1252 |
+
#else
|
| 1253 |
+
#define unconstify(underlying_type, expr) \
|
| 1254 |
+
((underlying_type) (expr))
|
| 1255 |
+
#define unvolatize(underlying_type, expr) \
|
| 1256 |
+
((underlying_type) (expr))
|
| 1257 |
+
#endif
|
| 1258 |
+
|
| 1259 |
+
/* ----------------------------------------------------------------
|
| 1260 |
+
* Section 9: system-specific hacks
|
| 1261 |
+
*
|
| 1262 |
+
* This should be limited to things that absolutely have to be
|
| 1263 |
+
* included in every source file. The port-specific header file
|
| 1264 |
+
* is usually a better place for this sort of thing.
|
| 1265 |
+
* ----------------------------------------------------------------
|
| 1266 |
+
*/
|
| 1267 |
+
|
| 1268 |
+
/*
|
| 1269 |
+
* NOTE: this is also used for opening text files.
|
| 1270 |
+
* WIN32 treats Control-Z as EOF in files opened in text mode.
|
| 1271 |
+
* Therefore, we open files in binary mode on Win32 so we can read
|
| 1272 |
+
* literal control-Z. The other affect is that we see CRLF, but
|
| 1273 |
+
* that is OK because we can already handle those cleanly.
|
| 1274 |
+
*/
|
| 1275 |
+
#if defined(WIN32) || defined(__CYGWIN__)
|
| 1276 |
+
#define PG_BINARY O_BINARY
|
| 1277 |
+
#define PG_BINARY_A "ab"
|
| 1278 |
+
#define PG_BINARY_R "rb"
|
| 1279 |
+
#define PG_BINARY_W "wb"
|
| 1280 |
+
#else
|
| 1281 |
+
#define PG_BINARY 0
|
| 1282 |
+
#define PG_BINARY_A "a"
|
| 1283 |
+
#define PG_BINARY_R "r"
|
| 1284 |
+
#define PG_BINARY_W "w"
|
| 1285 |
+
#endif
|
| 1286 |
+
|
| 1287 |
+
/*
|
| 1288 |
+
* Provide prototypes for routines not present in a particular machine's
|
| 1289 |
+
* standard C library.
|
| 1290 |
+
*/
|
| 1291 |
+
|
| 1292 |
+
#if !HAVE_DECL_FDATASYNC
|
| 1293 |
+
extern int fdatasync(int fildes);
|
| 1294 |
+
#endif
|
| 1295 |
+
|
| 1296 |
+
/*
|
| 1297 |
+
* Thin wrappers that convert strings to exactly 64-bit integers, matching our
|
| 1298 |
+
* definition of int64. (For the naming, compare that POSIX has
|
| 1299 |
+
* strtoimax()/strtoumax() which return intmax_t/uintmax_t.)
|
| 1300 |
+
*/
|
| 1301 |
+
#ifdef HAVE_LONG_INT_64
|
| 1302 |
+
#define strtoi64(str, endptr, base) ((int64) strtol(str, endptr, base))
|
| 1303 |
+
#define strtou64(str, endptr, base) ((uint64) strtoul(str, endptr, base))
|
| 1304 |
+
#else
|
| 1305 |
+
#define strtoi64(str, endptr, base) ((int64) strtoll(str, endptr, base))
|
| 1306 |
+
#define strtou64(str, endptr, base) ((uint64) strtoull(str, endptr, base))
|
| 1307 |
+
#endif
|
| 1308 |
+
|
| 1309 |
+
/*
|
| 1310 |
+
* Similarly, wrappers around labs()/llabs() matching our int64.
|
| 1311 |
+
*/
|
| 1312 |
+
#ifdef HAVE_LONG_INT_64
|
| 1313 |
+
#define i64abs(i) labs(i)
|
| 1314 |
+
#else
|
| 1315 |
+
#define i64abs(i) llabs(i)
|
| 1316 |
+
#endif
|
| 1317 |
+
|
| 1318 |
+
/*
|
| 1319 |
+
* Use "extern PGDLLIMPORT ..." to declare variables that are defined
|
| 1320 |
+
* in the core backend and need to be accessible by loadable modules.
|
| 1321 |
+
* No special marking is required on most ports.
|
| 1322 |
+
*/
|
| 1323 |
+
#ifndef PGDLLIMPORT
|
| 1324 |
+
#define PGDLLIMPORT
|
| 1325 |
+
#endif
|
| 1326 |
+
|
| 1327 |
+
/*
|
| 1328 |
+
* Use "extern PGDLLEXPORT ..." to declare functions that are defined in
|
| 1329 |
+
* loadable modules and need to be callable by the core backend or other
|
| 1330 |
+
* loadable modules.
|
| 1331 |
+
* If the compiler knows __attribute__((visibility("*"))), we use that,
|
| 1332 |
+
* unless we already have a platform-specific definition. Otherwise,
|
| 1333 |
+
* no special marking is required.
|
| 1334 |
+
*/
|
| 1335 |
+
#ifndef PGDLLEXPORT
|
| 1336 |
+
#ifdef HAVE_VISIBILITY_ATTRIBUTE
|
| 1337 |
+
#define PGDLLEXPORT __attribute__((visibility("default")))
|
| 1338 |
+
#else
|
| 1339 |
+
#define PGDLLEXPORT
|
| 1340 |
+
#endif
|
| 1341 |
+
#endif
|
| 1342 |
+
|
| 1343 |
+
/*
|
| 1344 |
+
* The following is used as the arg list for signal handlers. Any ports
|
| 1345 |
+
* that take something other than an int argument should override this in
|
| 1346 |
+
* their pg_config_os.h file. Note that variable names are required
|
| 1347 |
+
* because it is used in both the prototypes as well as the definitions.
|
| 1348 |
+
* Note also the long name. We expect that this won't collide with
|
| 1349 |
+
* other names causing compiler warnings.
|
| 1350 |
+
*/
|
| 1351 |
+
|
| 1352 |
+
#ifndef SIGNAL_ARGS
|
| 1353 |
+
#define SIGNAL_ARGS int postgres_signal_arg
|
| 1354 |
+
#endif
|
| 1355 |
+
|
| 1356 |
+
/*
|
| 1357 |
+
* When there is no sigsetjmp, its functionality is provided by plain
|
| 1358 |
+
* setjmp. We now support the case only on Windows. However, it seems
|
| 1359 |
+
* that MinGW-64 has some longstanding issues in its setjmp support,
|
| 1360 |
+
* so on that toolchain we cheat and use gcc's builtins.
|
| 1361 |
+
*/
|
| 1362 |
+
#ifdef WIN32
|
| 1363 |
+
#ifdef __MINGW64__
|
| 1364 |
+
typedef intptr_t sigjmp_buf[5];
|
| 1365 |
+
#define sigsetjmp(x,y) __builtin_setjmp(x)
|
| 1366 |
+
#define siglongjmp __builtin_longjmp
|
| 1367 |
+
#else /* !__MINGW64__ */
|
| 1368 |
+
#define sigjmp_buf jmp_buf
|
| 1369 |
+
#define sigsetjmp(x,y) setjmp(x)
|
| 1370 |
+
#define siglongjmp longjmp
|
| 1371 |
+
#endif /* __MINGW64__ */
|
| 1372 |
+
#endif /* WIN32 */
|
| 1373 |
+
|
| 1374 |
+
/* /port compatibility functions */
|
| 1375 |
+
#include "port.h"
|
| 1376 |
+
|
| 1377 |
+
#endif /* C_H */
|
pgsql/include/internal/fe-auth-sasl.h
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*-------------------------------------------------------------------------
|
| 2 |
+
*
|
| 3 |
+
* fe-auth-sasl.h
|
| 4 |
+
* Defines the SASL mechanism interface for libpq.
|
| 5 |
+
*
|
| 6 |
+
* Each SASL mechanism defines a frontend and a backend callback structure.
|
| 7 |
+
* This is not part of the public API for applications.
|
| 8 |
+
*
|
| 9 |
+
* See src/include/libpq/sasl.h for the backend counterpart.
|
| 10 |
+
*
|
| 11 |
+
* Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
|
| 12 |
+
* Portions Copyright (c) 1994, Regents of the University of California
|
| 13 |
+
*
|
| 14 |
+
* src/interfaces/libpq/fe-auth-sasl.h
|
| 15 |
+
*
|
| 16 |
+
*-------------------------------------------------------------------------
|
| 17 |
+
*/
|
| 18 |
+
|
| 19 |
+
#ifndef FE_AUTH_SASL_H
|
| 20 |
+
#define FE_AUTH_SASL_H
|
| 21 |
+
|
| 22 |
+
#include "libpq-fe.h"
|
| 23 |
+
|
| 24 |
+
/*
|
| 25 |
+
* Frontend SASL mechanism callbacks.
|
| 26 |
+
*
|
| 27 |
+
* To implement a frontend mechanism, declare a pg_be_sasl_mech struct with
|
| 28 |
+
* appropriate callback implementations, then hook it into conn->sasl during
|
| 29 |
+
* pg_SASL_init()'s mechanism negotiation.
|
| 30 |
+
*/
|
| 31 |
+
typedef struct pg_fe_sasl_mech
|
| 32 |
+
{
|
| 33 |
+
/*-------
|
| 34 |
+
* init()
|
| 35 |
+
*
|
| 36 |
+
* Initializes mechanism-specific state for a connection. This
|
| 37 |
+
* callback must return a pointer to its allocated state, which will
|
| 38 |
+
* be passed as-is as the first argument to the other callbacks.
|
| 39 |
+
* the free() callback is called to release any state resources.
|
| 40 |
+
*
|
| 41 |
+
* If state allocation fails, the implementation should return NULL to
|
| 42 |
+
* fail the authentication exchange.
|
| 43 |
+
*
|
| 44 |
+
* Input parameters:
|
| 45 |
+
*
|
| 46 |
+
* conn: The connection to the server
|
| 47 |
+
*
|
| 48 |
+
* password: The user's supplied password for the current connection
|
| 49 |
+
*
|
| 50 |
+
* mech: The mechanism name in use, for implementations that may
|
| 51 |
+
* advertise more than one name (such as *-PLUS variants).
|
| 52 |
+
*-------
|
| 53 |
+
*/
|
| 54 |
+
void *(*init) (PGconn *conn, const char *password, const char *mech);
|
| 55 |
+
|
| 56 |
+
/*--------
|
| 57 |
+
* exchange()
|
| 58 |
+
*
|
| 59 |
+
* Produces a client response to a server challenge. As a special case
|
| 60 |
+
* for client-first SASL mechanisms, exchange() is called with a NULL
|
| 61 |
+
* server response once at the start of the authentication exchange to
|
| 62 |
+
* generate an initial response.
|
| 63 |
+
*
|
| 64 |
+
* Input parameters:
|
| 65 |
+
*
|
| 66 |
+
* state: The opaque mechanism state returned by init()
|
| 67 |
+
*
|
| 68 |
+
* input: The challenge data sent by the server, or NULL when
|
| 69 |
+
* generating a client-first initial response (that is, when
|
| 70 |
+
* the server expects the client to send a message to start
|
| 71 |
+
* the exchange). This is guaranteed to be null-terminated
|
| 72 |
+
* for safety, but SASL allows embedded nulls in challenges,
|
| 73 |
+
* so mechanisms must be careful to check inputlen.
|
| 74 |
+
*
|
| 75 |
+
* inputlen: The length of the challenge data sent by the server, or -1
|
| 76 |
+
* during client-first initial response generation.
|
| 77 |
+
*
|
| 78 |
+
* Output parameters, to be set by the callback function:
|
| 79 |
+
*
|
| 80 |
+
* output: A malloc'd buffer containing the client's response to
|
| 81 |
+
* the server (can be empty), or NULL if the exchange should
|
| 82 |
+
* be aborted. (*success should be set to false in the
|
| 83 |
+
* latter case.)
|
| 84 |
+
*
|
| 85 |
+
* outputlen: The length (0 or higher) of the client response buffer,
|
| 86 |
+
* ignored if output is NULL.
|
| 87 |
+
*
|
| 88 |
+
* done: Set to true if the SASL exchange should not continue,
|
| 89 |
+
* because the exchange is either complete or failed
|
| 90 |
+
*
|
| 91 |
+
* success: Set to true if the SASL exchange completed successfully.
|
| 92 |
+
* Ignored if *done is false.
|
| 93 |
+
*--------
|
| 94 |
+
*/
|
| 95 |
+
void (*exchange) (void *state, char *input, int inputlen,
|
| 96 |
+
char **output, int *outputlen,
|
| 97 |
+
bool *done, bool *success);
|
| 98 |
+
|
| 99 |
+
/*--------
|
| 100 |
+
* channel_bound()
|
| 101 |
+
*
|
| 102 |
+
* Returns true if the connection has an established channel binding. A
|
| 103 |
+
* mechanism implementation must ensure that a SASL exchange has actually
|
| 104 |
+
* been completed, in addition to checking that channel binding is in use.
|
| 105 |
+
*
|
| 106 |
+
* Mechanisms that do not implement channel binding may simply return
|
| 107 |
+
* false.
|
| 108 |
+
*
|
| 109 |
+
* Input parameters:
|
| 110 |
+
*
|
| 111 |
+
* state: The opaque mechanism state returned by init()
|
| 112 |
+
*--------
|
| 113 |
+
*/
|
| 114 |
+
bool (*channel_bound) (void *state);
|
| 115 |
+
|
| 116 |
+
/*--------
|
| 117 |
+
* free()
|
| 118 |
+
*
|
| 119 |
+
* Frees the state allocated by init(). This is called when the connection
|
| 120 |
+
* is dropped, not when the exchange is completed.
|
| 121 |
+
*
|
| 122 |
+
* Input parameters:
|
| 123 |
+
*
|
| 124 |
+
* state: The opaque mechanism state returned by init()
|
| 125 |
+
*--------
|
| 126 |
+
*/
|
| 127 |
+
void (*free) (void *state);
|
| 128 |
+
|
| 129 |
+
} pg_fe_sasl_mech;
|
| 130 |
+
|
| 131 |
+
#endif /* FE_AUTH_SASL_H */
|
pgsql/include/internal/libpq-int.h
ADDED
|
@@ -0,0 +1,940 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*-------------------------------------------------------------------------
|
| 2 |
+
*
|
| 3 |
+
* libpq-int.h
|
| 4 |
+
* This file contains internal definitions meant to be used only by
|
| 5 |
+
* the frontend libpq library, not by applications that call it.
|
| 6 |
+
*
|
| 7 |
+
* An application can include this file if it wants to bypass the
|
| 8 |
+
* official API defined by libpq-fe.h, but code that does so is much
|
| 9 |
+
* more likely to break across PostgreSQL releases than code that uses
|
| 10 |
+
* only the official API.
|
| 11 |
+
*
|
| 12 |
+
* Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
|
| 13 |
+
* Portions Copyright (c) 1994, Regents of the University of California
|
| 14 |
+
*
|
| 15 |
+
* src/interfaces/libpq/libpq-int.h
|
| 16 |
+
*
|
| 17 |
+
*-------------------------------------------------------------------------
|
| 18 |
+
*/
|
| 19 |
+
|
| 20 |
+
#ifndef LIBPQ_INT_H
|
| 21 |
+
#define LIBPQ_INT_H
|
| 22 |
+
|
| 23 |
+
/* We assume libpq-fe.h has already been included. */
|
| 24 |
+
#include "libpq-events.h"
|
| 25 |
+
|
| 26 |
+
#include <netdb.h>
|
| 27 |
+
#include <sys/socket.h>
|
| 28 |
+
#include <time.h>
|
| 29 |
+
/* MinGW has sys/time.h, but MSVC doesn't */
|
| 30 |
+
#ifndef _MSC_VER
|
| 31 |
+
#include <sys/time.h>
|
| 32 |
+
#endif
|
| 33 |
+
|
| 34 |
+
#ifdef ENABLE_THREAD_SAFETY
|
| 35 |
+
#ifdef WIN32
|
| 36 |
+
#include "pthread-win32.h"
|
| 37 |
+
#else
|
| 38 |
+
#include <pthread.h>
|
| 39 |
+
#endif
|
| 40 |
+
#include <signal.h>
|
| 41 |
+
#endif
|
| 42 |
+
|
| 43 |
+
/* include stuff common to fe and be */
|
| 44 |
+
#include "libpq/pqcomm.h"
|
| 45 |
+
/* include stuff found in fe only */
|
| 46 |
+
#include "fe-auth-sasl.h"
|
| 47 |
+
#include "pqexpbuffer.h"
|
| 48 |
+
|
| 49 |
+
#ifdef ENABLE_GSS
|
| 50 |
+
#if defined(HAVE_GSSAPI_H)
|
| 51 |
+
#include <gssapi.h>
|
| 52 |
+
#else
|
| 53 |
+
#include <gssapi/gssapi.h>
|
| 54 |
+
#endif
|
| 55 |
+
#endif
|
| 56 |
+
|
| 57 |
+
#ifdef ENABLE_SSPI
|
| 58 |
+
#define SECURITY_WIN32
|
| 59 |
+
#if defined(WIN32) && !defined(_MSC_VER)
|
| 60 |
+
#include <ntsecapi.h>
|
| 61 |
+
#endif
|
| 62 |
+
#include <security.h>
|
| 63 |
+
#undef SECURITY_WIN32
|
| 64 |
+
|
| 65 |
+
#ifndef ENABLE_GSS
|
| 66 |
+
/*
|
| 67 |
+
* Define a fake structure compatible with GSSAPI on Unix.
|
| 68 |
+
*/
|
| 69 |
+
typedef struct
|
| 70 |
+
{
|
| 71 |
+
void *value;
|
| 72 |
+
int length;
|
| 73 |
+
} gss_buffer_desc;
|
| 74 |
+
#endif
|
| 75 |
+
#endif /* ENABLE_SSPI */
|
| 76 |
+
|
| 77 |
+
#ifdef USE_OPENSSL
|
| 78 |
+
#include <openssl/ssl.h>
|
| 79 |
+
#include <openssl/err.h>
|
| 80 |
+
|
| 81 |
+
#ifndef OPENSSL_NO_ENGINE
|
| 82 |
+
#define USE_SSL_ENGINE
|
| 83 |
+
#endif
|
| 84 |
+
#endif /* USE_OPENSSL */
|
| 85 |
+
|
| 86 |
+
#include "common/pg_prng.h"
|
| 87 |
+
|
| 88 |
+
/*
|
| 89 |
+
* POSTGRES backend dependent Constants.
|
| 90 |
+
*/
|
| 91 |
+
#define CMDSTATUS_LEN 64 /* should match COMPLETION_TAG_BUFSIZE */
|
| 92 |
+
|
| 93 |
+
/*
|
| 94 |
+
* PGresult and the subsidiary types PGresAttDesc, PGresAttValue
|
| 95 |
+
* represent the result of a query (or more precisely, of a single SQL
|
| 96 |
+
* command --- a query string given to PQexec can contain multiple commands).
|
| 97 |
+
* Note we assume that a single command can return at most one tuple group,
|
| 98 |
+
* hence there is no need for multiple descriptor sets.
|
| 99 |
+
*/
|
| 100 |
+
|
| 101 |
+
/* Subsidiary-storage management structure for PGresult.
|
| 102 |
+
* See space management routines in fe-exec.c for details.
|
| 103 |
+
* Note that space[k] refers to the k'th byte starting from the physical
|
| 104 |
+
* head of the block --- it's a union, not a struct!
|
| 105 |
+
*/
|
| 106 |
+
typedef union pgresult_data PGresult_data;
|
| 107 |
+
|
| 108 |
+
union pgresult_data
|
| 109 |
+
{
|
| 110 |
+
PGresult_data *next; /* link to next block, or NULL */
|
| 111 |
+
char space[1]; /* dummy for accessing block as bytes */
|
| 112 |
+
};
|
| 113 |
+
|
| 114 |
+
/* Data about a single parameter of a prepared statement */
|
| 115 |
+
typedef struct pgresParamDesc
|
| 116 |
+
{
|
| 117 |
+
Oid typid; /* type id */
|
| 118 |
+
} PGresParamDesc;
|
| 119 |
+
|
| 120 |
+
/*
|
| 121 |
+
* Data for a single attribute of a single tuple
|
| 122 |
+
*
|
| 123 |
+
* We use char* for Attribute values.
|
| 124 |
+
*
|
| 125 |
+
* The value pointer always points to a null-terminated area; we add a
|
| 126 |
+
* null (zero) byte after whatever the backend sends us. This is only
|
| 127 |
+
* particularly useful for text values ... with a binary value, the
|
| 128 |
+
* value might have embedded nulls, so the application can't use C string
|
| 129 |
+
* operators on it. But we add a null anyway for consistency.
|
| 130 |
+
* Note that the value itself does not contain a length word.
|
| 131 |
+
*
|
| 132 |
+
* A NULL attribute is a special case in two ways: its len field is NULL_LEN
|
| 133 |
+
* and its value field points to null_field in the owning PGresult. All the
|
| 134 |
+
* NULL attributes in a query result point to the same place (there's no need
|
| 135 |
+
* to store a null string separately for each one).
|
| 136 |
+
*/
|
| 137 |
+
|
| 138 |
+
#define NULL_LEN (-1) /* pg_result len for NULL value */
|
| 139 |
+
|
| 140 |
+
typedef struct pgresAttValue
|
| 141 |
+
{
|
| 142 |
+
int len; /* length in bytes of the value */
|
| 143 |
+
char *value; /* actual value, plus terminating zero byte */
|
| 144 |
+
} PGresAttValue;
|
| 145 |
+
|
| 146 |
+
/* Typedef for message-field list entries */
|
| 147 |
+
typedef struct pgMessageField
|
| 148 |
+
{
|
| 149 |
+
struct pgMessageField *next; /* list link */
|
| 150 |
+
char code; /* field code */
|
| 151 |
+
char contents[FLEXIBLE_ARRAY_MEMBER]; /* value, nul-terminated */
|
| 152 |
+
} PGMessageField;
|
| 153 |
+
|
| 154 |
+
/* Fields needed for notice handling */
|
| 155 |
+
typedef struct
|
| 156 |
+
{
|
| 157 |
+
PQnoticeReceiver noticeRec; /* notice message receiver */
|
| 158 |
+
void *noticeRecArg;
|
| 159 |
+
PQnoticeProcessor noticeProc; /* notice message processor */
|
| 160 |
+
void *noticeProcArg;
|
| 161 |
+
} PGNoticeHooks;
|
| 162 |
+
|
| 163 |
+
typedef struct PGEvent
|
| 164 |
+
{
|
| 165 |
+
PGEventProc proc; /* the function to call on events */
|
| 166 |
+
char *name; /* used only for error messages */
|
| 167 |
+
void *passThrough; /* pointer supplied at registration time */
|
| 168 |
+
void *data; /* optional state (instance) data */
|
| 169 |
+
bool resultInitialized; /* T if RESULTCREATE/COPY succeeded */
|
| 170 |
+
} PGEvent;
|
| 171 |
+
|
| 172 |
+
struct pg_result
|
| 173 |
+
{
|
| 174 |
+
int ntups;
|
| 175 |
+
int numAttributes;
|
| 176 |
+
PGresAttDesc *attDescs;
|
| 177 |
+
PGresAttValue **tuples; /* each PGresult tuple is an array of
|
| 178 |
+
* PGresAttValue's */
|
| 179 |
+
int tupArrSize; /* allocated size of tuples array */
|
| 180 |
+
int numParameters;
|
| 181 |
+
PGresParamDesc *paramDescs;
|
| 182 |
+
ExecStatusType resultStatus;
|
| 183 |
+
char cmdStatus[CMDSTATUS_LEN]; /* cmd status from the query */
|
| 184 |
+
int binary; /* binary tuple values if binary == 1,
|
| 185 |
+
* otherwise text */
|
| 186 |
+
|
| 187 |
+
/*
|
| 188 |
+
* These fields are copied from the originating PGconn, so that operations
|
| 189 |
+
* on the PGresult don't have to reference the PGconn.
|
| 190 |
+
*/
|
| 191 |
+
PGNoticeHooks noticeHooks;
|
| 192 |
+
PGEvent *events;
|
| 193 |
+
int nEvents;
|
| 194 |
+
int client_encoding; /* encoding id */
|
| 195 |
+
|
| 196 |
+
/*
|
| 197 |
+
* Error information (all NULL if not an error result). errMsg is the
|
| 198 |
+
* "overall" error message returned by PQresultErrorMessage. If we have
|
| 199 |
+
* per-field info then it is stored in a linked list.
|
| 200 |
+
*/
|
| 201 |
+
char *errMsg; /* error message, or NULL if no error */
|
| 202 |
+
PGMessageField *errFields; /* message broken into fields */
|
| 203 |
+
char *errQuery; /* text of triggering query, if available */
|
| 204 |
+
|
| 205 |
+
/* All NULL attributes in the query result point to this null string */
|
| 206 |
+
char null_field[1];
|
| 207 |
+
|
| 208 |
+
/*
|
| 209 |
+
* Space management information. Note that attDescs and error stuff, if
|
| 210 |
+
* not null, point into allocated blocks. But tuples points to a
|
| 211 |
+
* separately malloc'd block, so that we can realloc it.
|
| 212 |
+
*/
|
| 213 |
+
PGresult_data *curBlock; /* most recently allocated block */
|
| 214 |
+
int curOffset; /* start offset of free space in block */
|
| 215 |
+
int spaceLeft; /* number of free bytes remaining in block */
|
| 216 |
+
|
| 217 |
+
size_t memorySize; /* total space allocated for this PGresult */
|
| 218 |
+
};
|
| 219 |
+
|
| 220 |
+
/* PGAsyncStatusType defines the state of the query-execution state machine */
|
| 221 |
+
typedef enum
|
| 222 |
+
{
|
| 223 |
+
PGASYNC_IDLE, /* nothing's happening, dude */
|
| 224 |
+
PGASYNC_BUSY, /* query in progress */
|
| 225 |
+
PGASYNC_READY, /* query done, waiting for client to fetch
|
| 226 |
+
* result */
|
| 227 |
+
PGASYNC_READY_MORE, /* query done, waiting for client to fetch
|
| 228 |
+
* result, more results expected from this
|
| 229 |
+
* query */
|
| 230 |
+
PGASYNC_COPY_IN, /* Copy In data transfer in progress */
|
| 231 |
+
PGASYNC_COPY_OUT, /* Copy Out data transfer in progress */
|
| 232 |
+
PGASYNC_COPY_BOTH, /* Copy In/Out data transfer in progress */
|
| 233 |
+
PGASYNC_PIPELINE_IDLE, /* "Idle" between commands in pipeline mode */
|
| 234 |
+
} PGAsyncStatusType;
|
| 235 |
+
|
| 236 |
+
/* Target server type (decoded value of target_session_attrs) */
|
| 237 |
+
typedef enum
|
| 238 |
+
{
|
| 239 |
+
SERVER_TYPE_ANY = 0, /* Any server (default) */
|
| 240 |
+
SERVER_TYPE_READ_WRITE, /* Read-write server */
|
| 241 |
+
SERVER_TYPE_READ_ONLY, /* Read-only server */
|
| 242 |
+
SERVER_TYPE_PRIMARY, /* Primary server */
|
| 243 |
+
SERVER_TYPE_STANDBY, /* Standby server */
|
| 244 |
+
SERVER_TYPE_PREFER_STANDBY, /* Prefer standby server */
|
| 245 |
+
SERVER_TYPE_PREFER_STANDBY_PASS2 /* second pass - behaves same as ANY */
|
| 246 |
+
} PGTargetServerType;
|
| 247 |
+
|
| 248 |
+
/* Target server type (decoded value of load_balance_hosts) */
|
| 249 |
+
typedef enum
|
| 250 |
+
{
|
| 251 |
+
LOAD_BALANCE_DISABLE = 0, /* Use the existing host order (default) */
|
| 252 |
+
LOAD_BALANCE_RANDOM, /* Randomly shuffle the hosts */
|
| 253 |
+
} PGLoadBalanceType;
|
| 254 |
+
|
| 255 |
+
/* Boolean value plus a not-known state, for GUCs we might have to fetch */
|
| 256 |
+
typedef enum
|
| 257 |
+
{
|
| 258 |
+
PG_BOOL_UNKNOWN = 0, /* Currently unknown */
|
| 259 |
+
PG_BOOL_YES, /* Yes (true) */
|
| 260 |
+
PG_BOOL_NO /* No (false) */
|
| 261 |
+
} PGTernaryBool;
|
| 262 |
+
|
| 263 |
+
/* Typedef for the EnvironmentOptions[] array */
|
| 264 |
+
typedef struct PQEnvironmentOption
|
| 265 |
+
{
|
| 266 |
+
const char *envName, /* name of an environment variable */
|
| 267 |
+
*pgName; /* name of corresponding SET variable */
|
| 268 |
+
} PQEnvironmentOption;
|
| 269 |
+
|
| 270 |
+
/* Typedef for parameter-status list entries */
|
| 271 |
+
typedef struct pgParameterStatus
|
| 272 |
+
{
|
| 273 |
+
struct pgParameterStatus *next; /* list link */
|
| 274 |
+
char *name; /* parameter name */
|
| 275 |
+
char *value; /* parameter value */
|
| 276 |
+
/* Note: name and value are stored in same malloc block as struct is */
|
| 277 |
+
} pgParameterStatus;
|
| 278 |
+
|
| 279 |
+
/* large-object-access data ... allocated only if large-object code is used. */
|
| 280 |
+
typedef struct pgLobjfuncs
|
| 281 |
+
{
|
| 282 |
+
Oid fn_lo_open; /* OID of backend function lo_open */
|
| 283 |
+
Oid fn_lo_close; /* OID of backend function lo_close */
|
| 284 |
+
Oid fn_lo_creat; /* OID of backend function lo_creat */
|
| 285 |
+
Oid fn_lo_create; /* OID of backend function lo_create */
|
| 286 |
+
Oid fn_lo_unlink; /* OID of backend function lo_unlink */
|
| 287 |
+
Oid fn_lo_lseek; /* OID of backend function lo_lseek */
|
| 288 |
+
Oid fn_lo_lseek64; /* OID of backend function lo_lseek64 */
|
| 289 |
+
Oid fn_lo_tell; /* OID of backend function lo_tell */
|
| 290 |
+
Oid fn_lo_tell64; /* OID of backend function lo_tell64 */
|
| 291 |
+
Oid fn_lo_truncate; /* OID of backend function lo_truncate */
|
| 292 |
+
Oid fn_lo_truncate64; /* OID of function lo_truncate64 */
|
| 293 |
+
Oid fn_lo_read; /* OID of backend function LOread */
|
| 294 |
+
Oid fn_lo_write; /* OID of backend function LOwrite */
|
| 295 |
+
} PGlobjfuncs;
|
| 296 |
+
|
| 297 |
+
/* PGdataValue represents a data field value being passed to a row processor.
|
| 298 |
+
* It could be either text or binary data; text data is not zero-terminated.
|
| 299 |
+
* A SQL NULL is represented by len < 0; then value is still valid but there
|
| 300 |
+
* are no data bytes there.
|
| 301 |
+
*/
|
| 302 |
+
typedef struct pgDataValue
|
| 303 |
+
{
|
| 304 |
+
int len; /* data length in bytes, or <0 if NULL */
|
| 305 |
+
const char *value; /* data value, without zero-termination */
|
| 306 |
+
} PGdataValue;
|
| 307 |
+
|
| 308 |
+
/* Host address type enum for struct pg_conn_host */
|
| 309 |
+
typedef enum pg_conn_host_type
|
| 310 |
+
{
|
| 311 |
+
CHT_HOST_NAME,
|
| 312 |
+
CHT_HOST_ADDRESS,
|
| 313 |
+
CHT_UNIX_SOCKET
|
| 314 |
+
} pg_conn_host_type;
|
| 315 |
+
|
| 316 |
+
/*
|
| 317 |
+
* PGQueryClass tracks which query protocol is in use for each command queue
|
| 318 |
+
* entry, or special operation in execution
|
| 319 |
+
*/
|
| 320 |
+
typedef enum
|
| 321 |
+
{
|
| 322 |
+
PGQUERY_SIMPLE, /* simple Query protocol (PQexec) */
|
| 323 |
+
PGQUERY_EXTENDED, /* full Extended protocol (PQexecParams) */
|
| 324 |
+
PGQUERY_PREPARE, /* Parse only (PQprepare) */
|
| 325 |
+
PGQUERY_DESCRIBE, /* Describe Statement or Portal */
|
| 326 |
+
PGQUERY_SYNC, /* Sync (at end of a pipeline) */
|
| 327 |
+
PGQUERY_CLOSE
|
| 328 |
+
} PGQueryClass;
|
| 329 |
+
|
| 330 |
+
/*
|
| 331 |
+
* An entry in the pending command queue.
|
| 332 |
+
*/
|
| 333 |
+
typedef struct PGcmdQueueEntry
|
| 334 |
+
{
|
| 335 |
+
PGQueryClass queryclass; /* Query type */
|
| 336 |
+
char *query; /* SQL command, or NULL if none/unknown/OOM */
|
| 337 |
+
struct PGcmdQueueEntry *next; /* list link */
|
| 338 |
+
} PGcmdQueueEntry;
|
| 339 |
+
|
| 340 |
+
/*
|
| 341 |
+
* pg_conn_host stores all information about each of possibly several hosts
|
| 342 |
+
* mentioned in the connection string. Most fields are derived by splitting
|
| 343 |
+
* the relevant connection parameter (e.g., pghost) at commas.
|
| 344 |
+
*/
|
| 345 |
+
typedef struct pg_conn_host
|
| 346 |
+
{
|
| 347 |
+
pg_conn_host_type type; /* type of host address */
|
| 348 |
+
char *host; /* host name or socket path */
|
| 349 |
+
char *hostaddr; /* host numeric IP address */
|
| 350 |
+
char *port; /* port number (always provided) */
|
| 351 |
+
char *password; /* password for this host, read from the
|
| 352 |
+
* password file; NULL if not sought or not
|
| 353 |
+
* found in password file. */
|
| 354 |
+
} pg_conn_host;
|
| 355 |
+
|
| 356 |
+
/*
|
| 357 |
+
* PGconn stores all the state data associated with a single connection
|
| 358 |
+
* to a backend.
|
| 359 |
+
*/
|
| 360 |
+
struct pg_conn
|
| 361 |
+
{
|
| 362 |
+
/* Saved values of connection options */
|
| 363 |
+
char *pghost; /* the machine on which the server is running,
|
| 364 |
+
* or a path to a UNIX-domain socket, or a
|
| 365 |
+
* comma-separated list of machines and/or
|
| 366 |
+
* paths; if NULL, use DEFAULT_PGSOCKET_DIR */
|
| 367 |
+
char *pghostaddr; /* the numeric IP address of the machine on
|
| 368 |
+
* which the server is running, or a
|
| 369 |
+
* comma-separated list of same. Takes
|
| 370 |
+
* precedence over pghost. */
|
| 371 |
+
char *pgport; /* the server's communication port number, or
|
| 372 |
+
* a comma-separated list of ports */
|
| 373 |
+
char *connect_timeout; /* connection timeout (numeric string) */
|
| 374 |
+
char *pgtcp_user_timeout; /* tcp user timeout (numeric string) */
|
| 375 |
+
char *client_encoding_initial; /* encoding to use */
|
| 376 |
+
char *pgoptions; /* options to start the backend with */
|
| 377 |
+
char *appname; /* application name */
|
| 378 |
+
char *fbappname; /* fallback application name */
|
| 379 |
+
char *dbName; /* database name */
|
| 380 |
+
char *replication; /* connect as the replication standby? */
|
| 381 |
+
char *pguser; /* Postgres username and password, if any */
|
| 382 |
+
char *pgpass;
|
| 383 |
+
char *pgpassfile; /* path to a file containing password(s) */
|
| 384 |
+
char *channel_binding; /* channel binding mode
|
| 385 |
+
* (require,prefer,disable) */
|
| 386 |
+
char *keepalives; /* use TCP keepalives? */
|
| 387 |
+
char *keepalives_idle; /* time between TCP keepalives */
|
| 388 |
+
char *keepalives_interval; /* time between TCP keepalive
|
| 389 |
+
* retransmits */
|
| 390 |
+
char *keepalives_count; /* maximum number of TCP keepalive
|
| 391 |
+
* retransmits */
|
| 392 |
+
char *sslmode; /* SSL mode (require,prefer,allow,disable) */
|
| 393 |
+
char *sslcompression; /* SSL compression (0 or 1) */
|
| 394 |
+
char *sslkey; /* client key filename */
|
| 395 |
+
char *sslcert; /* client certificate filename */
|
| 396 |
+
char *sslpassword; /* client key file password */
|
| 397 |
+
char *sslcertmode; /* client cert mode (require,allow,disable) */
|
| 398 |
+
char *sslrootcert; /* root certificate filename */
|
| 399 |
+
char *sslcrl; /* certificate revocation list filename */
|
| 400 |
+
char *sslcrldir; /* certificate revocation list directory name */
|
| 401 |
+
char *sslsni; /* use SSL SNI extension (0 or 1) */
|
| 402 |
+
char *requirepeer; /* required peer credentials for local sockets */
|
| 403 |
+
char *gssencmode; /* GSS mode (require,prefer,disable) */
|
| 404 |
+
char *krbsrvname; /* Kerberos service name */
|
| 405 |
+
char *gsslib; /* What GSS library to use ("gssapi" or
|
| 406 |
+
* "sspi") */
|
| 407 |
+
char *gssdelegation; /* Try to delegate GSS credentials? (0 or 1) */
|
| 408 |
+
char *ssl_min_protocol_version; /* minimum TLS protocol version */
|
| 409 |
+
char *ssl_max_protocol_version; /* maximum TLS protocol version */
|
| 410 |
+
char *target_session_attrs; /* desired session properties */
|
| 411 |
+
char *require_auth; /* name of the expected auth method */
|
| 412 |
+
char *load_balance_hosts; /* load balance over hosts */
|
| 413 |
+
|
| 414 |
+
/* Optional file to write trace info to */
|
| 415 |
+
FILE *Pfdebug;
|
| 416 |
+
int traceFlags;
|
| 417 |
+
|
| 418 |
+
/* Callback procedures for notice message processing */
|
| 419 |
+
PGNoticeHooks noticeHooks;
|
| 420 |
+
|
| 421 |
+
/* Event procs registered via PQregisterEventProc */
|
| 422 |
+
PGEvent *events; /* expandable array of event data */
|
| 423 |
+
int nEvents; /* number of active events */
|
| 424 |
+
int eventArraySize; /* allocated array size */
|
| 425 |
+
|
| 426 |
+
/* Status indicators */
|
| 427 |
+
ConnStatusType status;
|
| 428 |
+
PGAsyncStatusType asyncStatus;
|
| 429 |
+
PGTransactionStatusType xactStatus; /* never changes to ACTIVE */
|
| 430 |
+
char last_sqlstate[6]; /* last reported SQLSTATE */
|
| 431 |
+
bool options_valid; /* true if OK to attempt connection */
|
| 432 |
+
bool nonblocking; /* whether this connection is using nonblock
|
| 433 |
+
* sending semantics */
|
| 434 |
+
PGpipelineStatus pipelineStatus; /* status of pipeline mode */
|
| 435 |
+
bool singleRowMode; /* return current query result row-by-row? */
|
| 436 |
+
char copy_is_binary; /* 1 = copy binary, 0 = copy text */
|
| 437 |
+
int copy_already_done; /* # bytes already returned in COPY OUT */
|
| 438 |
+
PGnotify *notifyHead; /* oldest unreported Notify msg */
|
| 439 |
+
PGnotify *notifyTail; /* newest unreported Notify msg */
|
| 440 |
+
|
| 441 |
+
/* Support for multiple hosts in connection string */
|
| 442 |
+
int nconnhost; /* # of hosts named in conn string */
|
| 443 |
+
int whichhost; /* host we're currently trying/connected to */
|
| 444 |
+
pg_conn_host *connhost; /* details about each named host */
|
| 445 |
+
char *connip; /* IP address for current network connection */
|
| 446 |
+
|
| 447 |
+
/*
|
| 448 |
+
* The pending command queue as a singly-linked list. Head is the command
|
| 449 |
+
* currently in execution, tail is where new commands are added.
|
| 450 |
+
*/
|
| 451 |
+
PGcmdQueueEntry *cmd_queue_head;
|
| 452 |
+
PGcmdQueueEntry *cmd_queue_tail;
|
| 453 |
+
|
| 454 |
+
/*
|
| 455 |
+
* To save malloc traffic, we don't free entries right away; instead we
|
| 456 |
+
* save them in this list for possible reuse.
|
| 457 |
+
*/
|
| 458 |
+
PGcmdQueueEntry *cmd_queue_recycle;
|
| 459 |
+
|
| 460 |
+
/* Connection data */
|
| 461 |
+
pgsocket sock; /* FD for socket, PGINVALID_SOCKET if
|
| 462 |
+
* unconnected */
|
| 463 |
+
SockAddr laddr; /* Local address */
|
| 464 |
+
SockAddr raddr; /* Remote address */
|
| 465 |
+
ProtocolVersion pversion; /* FE/BE protocol version in use */
|
| 466 |
+
int sversion; /* server version, e.g. 70401 for 7.4.1 */
|
| 467 |
+
bool auth_req_received; /* true if any type of auth req received */
|
| 468 |
+
bool password_needed; /* true if server demanded a password */
|
| 469 |
+
bool gssapi_used; /* true if authenticated via gssapi */
|
| 470 |
+
bool sigpipe_so; /* have we masked SIGPIPE via SO_NOSIGPIPE? */
|
| 471 |
+
bool sigpipe_flag; /* can we mask SIGPIPE via MSG_NOSIGNAL? */
|
| 472 |
+
bool write_failed; /* have we had a write failure on sock? */
|
| 473 |
+
char *write_err_msg; /* write error message, or NULL if OOM */
|
| 474 |
+
|
| 475 |
+
bool auth_required; /* require an authentication challenge from
|
| 476 |
+
* the server? */
|
| 477 |
+
uint32 allowed_auth_methods; /* bitmask of acceptable AuthRequest
|
| 478 |
+
* codes */
|
| 479 |
+
bool client_finished_auth; /* have we finished our half of the
|
| 480 |
+
* authentication exchange? */
|
| 481 |
+
|
| 482 |
+
|
| 483 |
+
/* Transient state needed while establishing connection */
|
| 484 |
+
PGTargetServerType target_server_type; /* desired session properties */
|
| 485 |
+
PGLoadBalanceType load_balance_type; /* desired load balancing
|
| 486 |
+
* algorithm */
|
| 487 |
+
bool try_next_addr; /* time to advance to next address/host? */
|
| 488 |
+
bool try_next_host; /* time to advance to next connhost[]? */
|
| 489 |
+
int naddr; /* number of addresses returned by getaddrinfo */
|
| 490 |
+
int whichaddr; /* the address currently being tried */
|
| 491 |
+
AddrInfo *addr; /* the array of addresses for the currently
|
| 492 |
+
* tried host */
|
| 493 |
+
bool send_appname; /* okay to send application_name? */
|
| 494 |
+
|
| 495 |
+
/* Miscellaneous stuff */
|
| 496 |
+
int be_pid; /* PID of backend --- needed for cancels */
|
| 497 |
+
int be_key; /* key of backend --- needed for cancels */
|
| 498 |
+
pgParameterStatus *pstatus; /* ParameterStatus data */
|
| 499 |
+
int client_encoding; /* encoding id */
|
| 500 |
+
bool std_strings; /* standard_conforming_strings */
|
| 501 |
+
PGTernaryBool default_transaction_read_only; /* default_transaction_read_only */
|
| 502 |
+
PGTernaryBool in_hot_standby; /* in_hot_standby */
|
| 503 |
+
PGVerbosity verbosity; /* error/notice message verbosity */
|
| 504 |
+
PGContextVisibility show_context; /* whether to show CONTEXT field */
|
| 505 |
+
PGlobjfuncs *lobjfuncs; /* private state for large-object access fns */
|
| 506 |
+
pg_prng_state prng_state; /* prng state for load balancing connections */
|
| 507 |
+
|
| 508 |
+
|
| 509 |
+
/* Buffer for data received from backend and not yet processed */
|
| 510 |
+
char *inBuffer; /* currently allocated buffer */
|
| 511 |
+
int inBufSize; /* allocated size of buffer */
|
| 512 |
+
int inStart; /* offset to first unconsumed data in buffer */
|
| 513 |
+
int inCursor; /* next byte to tentatively consume */
|
| 514 |
+
int inEnd; /* offset to first position after avail data */
|
| 515 |
+
|
| 516 |
+
/* Buffer for data not yet sent to backend */
|
| 517 |
+
char *outBuffer; /* currently allocated buffer */
|
| 518 |
+
int outBufSize; /* allocated size of buffer */
|
| 519 |
+
int outCount; /* number of chars waiting in buffer */
|
| 520 |
+
|
| 521 |
+
/* State for constructing messages in outBuffer */
|
| 522 |
+
int outMsgStart; /* offset to msg start (length word); if -1,
|
| 523 |
+
* msg has no length word */
|
| 524 |
+
int outMsgEnd; /* offset to msg end (so far) */
|
| 525 |
+
|
| 526 |
+
/* Row processor interface workspace */
|
| 527 |
+
PGdataValue *rowBuf; /* array for passing values to rowProcessor */
|
| 528 |
+
int rowBufLen; /* number of entries allocated in rowBuf */
|
| 529 |
+
|
| 530 |
+
/*
|
| 531 |
+
* Status for asynchronous result construction. If result isn't NULL, it
|
| 532 |
+
* is a result being constructed or ready to return. If result is NULL
|
| 533 |
+
* and error_result is true, then we need to return a PGRES_FATAL_ERROR
|
| 534 |
+
* result, but haven't yet constructed it; text for the error has been
|
| 535 |
+
* appended to conn->errorMessage. (Delaying construction simplifies
|
| 536 |
+
* dealing with out-of-memory cases.) If next_result isn't NULL, it is a
|
| 537 |
+
* PGresult that will replace "result" after we return that one.
|
| 538 |
+
*/
|
| 539 |
+
PGresult *result; /* result being constructed */
|
| 540 |
+
bool error_result; /* do we need to make an ERROR result? */
|
| 541 |
+
PGresult *next_result; /* next result (used in single-row mode) */
|
| 542 |
+
|
| 543 |
+
/* Assorted state for SASL, SSL, GSS, etc */
|
| 544 |
+
const pg_fe_sasl_mech *sasl;
|
| 545 |
+
void *sasl_state;
|
| 546 |
+
int scram_sha_256_iterations;
|
| 547 |
+
|
| 548 |
+
/* SSL structures */
|
| 549 |
+
bool ssl_in_use;
|
| 550 |
+
bool ssl_cert_requested; /* Did the server ask us for a cert? */
|
| 551 |
+
bool ssl_cert_sent; /* Did we send one in reply? */
|
| 552 |
+
|
| 553 |
+
#ifdef USE_SSL
|
| 554 |
+
bool allow_ssl_try; /* Allowed to try SSL negotiation */
|
| 555 |
+
bool wait_ssl_try; /* Delay SSL negotiation until after
|
| 556 |
+
* attempting normal connection */
|
| 557 |
+
#ifdef USE_OPENSSL
|
| 558 |
+
SSL *ssl; /* SSL status, if have SSL connection */
|
| 559 |
+
X509 *peer; /* X509 cert of server */
|
| 560 |
+
#ifdef USE_SSL_ENGINE
|
| 561 |
+
ENGINE *engine; /* SSL engine, if any */
|
| 562 |
+
#else
|
| 563 |
+
void *engine; /* dummy field to keep struct the same if
|
| 564 |
+
* OpenSSL version changes */
|
| 565 |
+
#endif
|
| 566 |
+
bool crypto_loaded; /* Track if libcrypto locking callbacks have
|
| 567 |
+
* been done for this connection. This can be
|
| 568 |
+
* removed once support for OpenSSL 1.0.2 is
|
| 569 |
+
* removed as this locking is handled
|
| 570 |
+
* internally in OpenSSL >= 1.1.0. */
|
| 571 |
+
#endif /* USE_OPENSSL */
|
| 572 |
+
#endif /* USE_SSL */
|
| 573 |
+
|
| 574 |
+
#ifdef ENABLE_GSS
|
| 575 |
+
gss_ctx_id_t gctx; /* GSS context */
|
| 576 |
+
gss_name_t gtarg_nam; /* GSS target name */
|
| 577 |
+
|
| 578 |
+
/* The following are encryption-only */
|
| 579 |
+
bool try_gss; /* GSS attempting permitted */
|
| 580 |
+
bool gssenc; /* GSS encryption is usable */
|
| 581 |
+
gss_cred_id_t gcred; /* GSS credential temp storage. */
|
| 582 |
+
|
| 583 |
+
/* GSS encryption I/O state --- see fe-secure-gssapi.c */
|
| 584 |
+
char *gss_SendBuffer; /* Encrypted data waiting to be sent */
|
| 585 |
+
int gss_SendLength; /* End of data available in gss_SendBuffer */
|
| 586 |
+
int gss_SendNext; /* Next index to send a byte from
|
| 587 |
+
* gss_SendBuffer */
|
| 588 |
+
int gss_SendConsumed; /* Number of source bytes encrypted but
|
| 589 |
+
* not yet reported as sent */
|
| 590 |
+
char *gss_RecvBuffer; /* Received, encrypted data */
|
| 591 |
+
int gss_RecvLength; /* End of data available in gss_RecvBuffer */
|
| 592 |
+
char *gss_ResultBuffer; /* Decryption of data in gss_RecvBuffer */
|
| 593 |
+
int gss_ResultLength; /* End of data available in
|
| 594 |
+
* gss_ResultBuffer */
|
| 595 |
+
int gss_ResultNext; /* Next index to read a byte from
|
| 596 |
+
* gss_ResultBuffer */
|
| 597 |
+
uint32 gss_MaxPktSize; /* Maximum size we can encrypt and fit the
|
| 598 |
+
* results into our output buffer */
|
| 599 |
+
#endif
|
| 600 |
+
|
| 601 |
+
#ifdef ENABLE_SSPI
|
| 602 |
+
CredHandle *sspicred; /* SSPI credentials handle */
|
| 603 |
+
CtxtHandle *sspictx; /* SSPI context */
|
| 604 |
+
char *sspitarget; /* SSPI target name */
|
| 605 |
+
int usesspi; /* Indicate if SSPI is in use on the
|
| 606 |
+
* connection */
|
| 607 |
+
#endif
|
| 608 |
+
|
| 609 |
+
/*
|
| 610 |
+
* Buffer for current error message. This is cleared at the start of any
|
| 611 |
+
* connection attempt or query cycle; after that, all code should append
|
| 612 |
+
* messages to it, never overwrite.
|
| 613 |
+
*
|
| 614 |
+
* In some situations we might report an error more than once in a query
|
| 615 |
+
* cycle. If so, errorMessage accumulates text from all the errors, and
|
| 616 |
+
* errorReported tracks how much we've already reported, so that the
|
| 617 |
+
* individual error PGresult objects don't contain duplicative text.
|
| 618 |
+
*/
|
| 619 |
+
PQExpBufferData errorMessage; /* expansible string */
|
| 620 |
+
int errorReported; /* # bytes of string already reported */
|
| 621 |
+
|
| 622 |
+
/* Buffer for receiving various parts of messages */
|
| 623 |
+
PQExpBufferData workBuffer; /* expansible string */
|
| 624 |
+
};
|
| 625 |
+
|
| 626 |
+
/* PGcancel stores all data necessary to cancel a connection. A copy of this
|
| 627 |
+
* data is required to safely cancel a connection running on a different
|
| 628 |
+
* thread.
|
| 629 |
+
*/
|
| 630 |
+
struct pg_cancel
|
| 631 |
+
{
|
| 632 |
+
SockAddr raddr; /* Remote address */
|
| 633 |
+
int be_pid; /* PID of backend --- needed for cancels */
|
| 634 |
+
int be_key; /* key of backend --- needed for cancels */
|
| 635 |
+
int pgtcp_user_timeout; /* tcp user timeout */
|
| 636 |
+
int keepalives; /* use TCP keepalives? */
|
| 637 |
+
int keepalives_idle; /* time between TCP keepalives */
|
| 638 |
+
int keepalives_interval; /* time between TCP keepalive
|
| 639 |
+
* retransmits */
|
| 640 |
+
int keepalives_count; /* maximum number of TCP keepalive
|
| 641 |
+
* retransmits */
|
| 642 |
+
};
|
| 643 |
+
|
| 644 |
+
|
| 645 |
+
/* String descriptions of the ExecStatusTypes.
|
| 646 |
+
* direct use of this array is deprecated; call PQresStatus() instead.
|
| 647 |
+
*/
|
| 648 |
+
extern char *const pgresStatus[];
|
| 649 |
+
|
| 650 |
+
|
| 651 |
+
#ifdef USE_SSL
|
| 652 |
+
|
| 653 |
+
#ifndef WIN32
|
| 654 |
+
#define USER_CERT_FILE ".postgresql/postgresql.crt"
|
| 655 |
+
#define USER_KEY_FILE ".postgresql/postgresql.key"
|
| 656 |
+
#define ROOT_CERT_FILE ".postgresql/root.crt"
|
| 657 |
+
#define ROOT_CRL_FILE ".postgresql/root.crl"
|
| 658 |
+
#else
|
| 659 |
+
/* On Windows, the "home" directory is already PostgreSQL-specific */
|
| 660 |
+
#define USER_CERT_FILE "postgresql.crt"
|
| 661 |
+
#define USER_KEY_FILE "postgresql.key"
|
| 662 |
+
#define ROOT_CERT_FILE "root.crt"
|
| 663 |
+
#define ROOT_CRL_FILE "root.crl"
|
| 664 |
+
#endif
|
| 665 |
+
|
| 666 |
+
#endif /* USE_SSL */
|
| 667 |
+
|
| 668 |
+
/* ----------------
|
| 669 |
+
* Internal functions of libpq
|
| 670 |
+
* Functions declared here need to be visible across files of libpq,
|
| 671 |
+
* but are not intended to be called by applications. We use the
|
| 672 |
+
* convention "pqXXX" for internal functions, vs. the "PQxxx" names
|
| 673 |
+
* used for application-visible routines.
|
| 674 |
+
* ----------------
|
| 675 |
+
*/
|
| 676 |
+
|
| 677 |
+
/* === in fe-connect.c === */
|
| 678 |
+
|
| 679 |
+
extern void pqDropConnection(PGconn *conn, bool flushInput);
|
| 680 |
+
extern int pqPacketSend(PGconn *conn, char pack_type,
|
| 681 |
+
const void *buf, size_t buf_len);
|
| 682 |
+
extern bool pqGetHomeDirectory(char *buf, int bufsize);
|
| 683 |
+
|
| 684 |
+
#ifdef ENABLE_THREAD_SAFETY
|
| 685 |
+
extern pgthreadlock_t pg_g_threadlock;
|
| 686 |
+
|
| 687 |
+
#define pglock_thread() pg_g_threadlock(true)
|
| 688 |
+
#define pgunlock_thread() pg_g_threadlock(false)
|
| 689 |
+
#else
|
| 690 |
+
#define pglock_thread() ((void) 0)
|
| 691 |
+
#define pgunlock_thread() ((void) 0)
|
| 692 |
+
#endif
|
| 693 |
+
|
| 694 |
+
/* === in fe-exec.c === */
|
| 695 |
+
|
| 696 |
+
extern void pqSetResultError(PGresult *res, PQExpBuffer errorMessage, int offset);
|
| 697 |
+
extern void *pqResultAlloc(PGresult *res, size_t nBytes, bool isBinary);
|
| 698 |
+
extern char *pqResultStrdup(PGresult *res, const char *str);
|
| 699 |
+
extern void pqClearAsyncResult(PGconn *conn);
|
| 700 |
+
extern void pqSaveErrorResult(PGconn *conn);
|
| 701 |
+
extern PGresult *pqPrepareAsyncResult(PGconn *conn);
|
| 702 |
+
extern void pqInternalNotice(const PGNoticeHooks *hooks, const char *fmt,...) pg_attribute_printf(2, 3);
|
| 703 |
+
extern void pqSaveMessageField(PGresult *res, char code,
|
| 704 |
+
const char *value);
|
| 705 |
+
extern void pqSaveParameterStatus(PGconn *conn, const char *name,
|
| 706 |
+
const char *value);
|
| 707 |
+
extern int pqRowProcessor(PGconn *conn, const char **errmsgp);
|
| 708 |
+
extern void pqCommandQueueAdvance(PGconn *conn, bool isReadyForQuery,
|
| 709 |
+
bool gotSync);
|
| 710 |
+
extern int PQsendQueryContinue(PGconn *conn, const char *query);
|
| 711 |
+
|
| 712 |
+
/* === in fe-protocol3.c === */
|
| 713 |
+
|
| 714 |
+
extern char *pqBuildStartupPacket3(PGconn *conn, int *packetlen,
|
| 715 |
+
const PQEnvironmentOption *options);
|
| 716 |
+
extern void pqParseInput3(PGconn *conn);
|
| 717 |
+
extern int pqGetErrorNotice3(PGconn *conn, bool isError);
|
| 718 |
+
extern void pqBuildErrorMessage3(PQExpBuffer msg, const PGresult *res,
|
| 719 |
+
PGVerbosity verbosity, PGContextVisibility show_context);
|
| 720 |
+
extern int pqGetNegotiateProtocolVersion3(PGconn *conn);
|
| 721 |
+
extern int pqGetCopyData3(PGconn *conn, char **buffer, int async);
|
| 722 |
+
extern int pqGetline3(PGconn *conn, char *s, int maxlen);
|
| 723 |
+
extern int pqGetlineAsync3(PGconn *conn, char *buffer, int bufsize);
|
| 724 |
+
extern int pqEndcopy3(PGconn *conn);
|
| 725 |
+
extern PGresult *pqFunctionCall3(PGconn *conn, Oid fnid,
|
| 726 |
+
int *result_buf, int *actual_result_len,
|
| 727 |
+
int result_is_int,
|
| 728 |
+
const PQArgBlock *args, int nargs);
|
| 729 |
+
|
| 730 |
+
/* === in fe-misc.c === */
|
| 731 |
+
|
| 732 |
+
/*
|
| 733 |
+
* "Get" and "Put" routines return 0 if successful, EOF if not. Note that for
|
| 734 |
+
* Get, EOF merely means the buffer is exhausted, not that there is
|
| 735 |
+
* necessarily any error.
|
| 736 |
+
*/
|
| 737 |
+
extern int pqCheckOutBufferSpace(size_t bytes_needed, PGconn *conn);
|
| 738 |
+
extern int pqCheckInBufferSpace(size_t bytes_needed, PGconn *conn);
|
| 739 |
+
extern int pqGetc(char *result, PGconn *conn);
|
| 740 |
+
extern int pqPutc(char c, PGconn *conn);
|
| 741 |
+
extern int pqGets(PQExpBuffer buf, PGconn *conn);
|
| 742 |
+
extern int pqGets_append(PQExpBuffer buf, PGconn *conn);
|
| 743 |
+
extern int pqPuts(const char *s, PGconn *conn);
|
| 744 |
+
extern int pqGetnchar(char *s, size_t len, PGconn *conn);
|
| 745 |
+
extern int pqSkipnchar(size_t len, PGconn *conn);
|
| 746 |
+
extern int pqPutnchar(const char *s, size_t len, PGconn *conn);
|
| 747 |
+
extern int pqGetInt(int *result, size_t bytes, PGconn *conn);
|
| 748 |
+
extern int pqPutInt(int value, size_t bytes, PGconn *conn);
|
| 749 |
+
extern int pqPutMsgStart(char msg_type, PGconn *conn);
|
| 750 |
+
extern int pqPutMsgEnd(PGconn *conn);
|
| 751 |
+
extern int pqReadData(PGconn *conn);
|
| 752 |
+
extern int pqFlush(PGconn *conn);
|
| 753 |
+
extern int pqWait(int forRead, int forWrite, PGconn *conn);
|
| 754 |
+
extern int pqWaitTimed(int forRead, int forWrite, PGconn *conn,
|
| 755 |
+
time_t finish_time);
|
| 756 |
+
extern int pqReadReady(PGconn *conn);
|
| 757 |
+
extern int pqWriteReady(PGconn *conn);
|
| 758 |
+
|
| 759 |
+
/* === in fe-secure.c === */
|
| 760 |
+
|
| 761 |
+
extern int pqsecure_initialize(PGconn *, bool, bool);
|
| 762 |
+
extern PostgresPollingStatusType pqsecure_open_client(PGconn *);
|
| 763 |
+
extern void pqsecure_close(PGconn *);
|
| 764 |
+
extern ssize_t pqsecure_read(PGconn *, void *ptr, size_t len);
|
| 765 |
+
extern ssize_t pqsecure_write(PGconn *, const void *ptr, size_t len);
|
| 766 |
+
extern ssize_t pqsecure_raw_read(PGconn *, void *ptr, size_t len);
|
| 767 |
+
extern ssize_t pqsecure_raw_write(PGconn *, const void *ptr, size_t len);
|
| 768 |
+
|
| 769 |
+
#if defined(ENABLE_THREAD_SAFETY) && !defined(WIN32)
|
| 770 |
+
extern int pq_block_sigpipe(sigset_t *osigset, bool *sigpipe_pending);
|
| 771 |
+
extern void pq_reset_sigpipe(sigset_t *osigset, bool sigpipe_pending,
|
| 772 |
+
bool got_epipe);
|
| 773 |
+
#endif
|
| 774 |
+
|
| 775 |
+
/* === SSL === */
|
| 776 |
+
|
| 777 |
+
/*
|
| 778 |
+
* The SSL implementation provides these functions.
|
| 779 |
+
*/
|
| 780 |
+
|
| 781 |
+
/*
|
| 782 |
+
* Implementation of PQinitSSL().
|
| 783 |
+
*/
|
| 784 |
+
extern void pgtls_init_library(bool do_ssl, int do_crypto);
|
| 785 |
+
|
| 786 |
+
/*
|
| 787 |
+
* Initialize SSL library.
|
| 788 |
+
*
|
| 789 |
+
* The conn parameter is only used to be able to pass back an error
|
| 790 |
+
* message - no connection-local setup is made here. do_ssl controls
|
| 791 |
+
* if SSL is initialized, and do_crypto does the same for the crypto
|
| 792 |
+
* part.
|
| 793 |
+
*
|
| 794 |
+
* Returns 0 if OK, -1 on failure (adding a message to conn->errorMessage).
|
| 795 |
+
*/
|
| 796 |
+
extern int pgtls_init(PGconn *conn, bool do_ssl, bool do_crypto);
|
| 797 |
+
|
| 798 |
+
/*
|
| 799 |
+
* Begin or continue negotiating a secure session.
|
| 800 |
+
*/
|
| 801 |
+
extern PostgresPollingStatusType pgtls_open_client(PGconn *conn);
|
| 802 |
+
|
| 803 |
+
/*
|
| 804 |
+
* Close SSL connection.
|
| 805 |
+
*/
|
| 806 |
+
extern void pgtls_close(PGconn *conn);
|
| 807 |
+
|
| 808 |
+
/*
|
| 809 |
+
* Read data from a secure connection.
|
| 810 |
+
*
|
| 811 |
+
* On failure, this function is responsible for appending a suitable message
|
| 812 |
+
* to conn->errorMessage. The caller must still inspect errno, but only
|
| 813 |
+
* to determine whether to continue/retry after error.
|
| 814 |
+
*/
|
| 815 |
+
extern ssize_t pgtls_read(PGconn *conn, void *ptr, size_t len);
|
| 816 |
+
|
| 817 |
+
/*
|
| 818 |
+
* Is there unread data waiting in the SSL read buffer?
|
| 819 |
+
*/
|
| 820 |
+
extern bool pgtls_read_pending(PGconn *conn);
|
| 821 |
+
|
| 822 |
+
/*
|
| 823 |
+
* Write data to a secure connection.
|
| 824 |
+
*
|
| 825 |
+
* On failure, this function is responsible for appending a suitable message
|
| 826 |
+
* to conn->errorMessage. The caller must still inspect errno, but only
|
| 827 |
+
* to determine whether to continue/retry after error.
|
| 828 |
+
*/
|
| 829 |
+
extern ssize_t pgtls_write(PGconn *conn, const void *ptr, size_t len);
|
| 830 |
+
|
| 831 |
+
/*
|
| 832 |
+
* Get the hash of the server certificate, for SCRAM channel binding type
|
| 833 |
+
* tls-server-end-point.
|
| 834 |
+
*
|
| 835 |
+
* NULL is sent back to the caller in the event of an error, with an
|
| 836 |
+
* error message for the caller to consume.
|
| 837 |
+
*
|
| 838 |
+
* This is not supported with old versions of OpenSSL that don't have
|
| 839 |
+
* the X509_get_signature_nid() function.
|
| 840 |
+
*/
|
| 841 |
+
#if defined(USE_OPENSSL) && (defined(HAVE_X509_GET_SIGNATURE_NID) || defined(HAVE_X509_GET_SIGNATURE_INFO))
|
| 842 |
+
#define HAVE_PGTLS_GET_PEER_CERTIFICATE_HASH
|
| 843 |
+
extern char *pgtls_get_peer_certificate_hash(PGconn *conn, size_t *len);
|
| 844 |
+
#endif
|
| 845 |
+
|
| 846 |
+
/*
|
| 847 |
+
* Verify that the server certificate matches the host name we connected to.
|
| 848 |
+
*
|
| 849 |
+
* The certificate's Common Name and Subject Alternative Names are considered.
|
| 850 |
+
*
|
| 851 |
+
* Returns 1 if the name matches, and 0 if it does not. On error, returns
|
| 852 |
+
* -1, and sets the libpq error message.
|
| 853 |
+
*
|
| 854 |
+
*/
|
| 855 |
+
extern int pgtls_verify_peer_name_matches_certificate_guts(PGconn *conn,
|
| 856 |
+
int *names_examined,
|
| 857 |
+
char **first_name);
|
| 858 |
+
|
| 859 |
+
/* === GSSAPI === */
|
| 860 |
+
|
| 861 |
+
#ifdef ENABLE_GSS
|
| 862 |
+
|
| 863 |
+
/*
|
| 864 |
+
* Establish a GSSAPI-encrypted connection.
|
| 865 |
+
*/
|
| 866 |
+
extern PostgresPollingStatusType pqsecure_open_gss(PGconn *conn);
|
| 867 |
+
|
| 868 |
+
/*
|
| 869 |
+
* Read and write functions for GSSAPI-encrypted connections, with internal
|
| 870 |
+
* buffering to handle nonblocking sockets.
|
| 871 |
+
*/
|
| 872 |
+
extern ssize_t pg_GSS_write(PGconn *conn, const void *ptr, size_t len);
|
| 873 |
+
extern ssize_t pg_GSS_read(PGconn *conn, void *ptr, size_t len);
|
| 874 |
+
#endif
|
| 875 |
+
|
| 876 |
+
/* === in fe-trace.c === */
|
| 877 |
+
|
| 878 |
+
extern void pqTraceOutputMessage(PGconn *conn, const char *message,
|
| 879 |
+
bool toServer);
|
| 880 |
+
extern void pqTraceOutputNoTypeByteMessage(PGconn *conn, const char *message);
|
| 881 |
+
|
| 882 |
+
/* === miscellaneous macros === */
|
| 883 |
+
|
| 884 |
+
/*
|
| 885 |
+
* Reset the conn's error-reporting state.
|
| 886 |
+
*/
|
| 887 |
+
#define pqClearConnErrorState(conn) \
|
| 888 |
+
(resetPQExpBuffer(&(conn)->errorMessage), \
|
| 889 |
+
(conn)->errorReported = 0)
|
| 890 |
+
|
| 891 |
+
/*
|
| 892 |
+
* Check whether we have a PGresult pending to be returned --- either a
|
| 893 |
+
* constructed one in conn->result, or a "virtual" error result that we
|
| 894 |
+
* don't intend to materialize until the end of the query cycle.
|
| 895 |
+
*/
|
| 896 |
+
#define pgHavePendingResult(conn) \
|
| 897 |
+
((conn)->result != NULL || (conn)->error_result)
|
| 898 |
+
|
| 899 |
+
/*
|
| 900 |
+
* this is so that we can check if a connection is non-blocking internally
|
| 901 |
+
* without the overhead of a function call
|
| 902 |
+
*/
|
| 903 |
+
#define pqIsnonblocking(conn) ((conn)->nonblocking)
|
| 904 |
+
|
| 905 |
+
/*
|
| 906 |
+
* Connection's outbuffer threshold, for pipeline mode.
|
| 907 |
+
*/
|
| 908 |
+
#define OUTBUFFER_THRESHOLD 65536
|
| 909 |
+
|
| 910 |
+
#ifdef ENABLE_NLS
|
| 911 |
+
extern char *libpq_gettext(const char *msgid) pg_attribute_format_arg(1);
|
| 912 |
+
extern char *libpq_ngettext(const char *msgid, const char *msgid_plural, unsigned long n) pg_attribute_format_arg(1) pg_attribute_format_arg(2);
|
| 913 |
+
#else
|
| 914 |
+
#define libpq_gettext(x) (x)
|
| 915 |
+
#define libpq_ngettext(s, p, n) ((n) == 1 ? (s) : (p))
|
| 916 |
+
#endif
|
| 917 |
+
/*
|
| 918 |
+
* libpq code should use the above, not _(), since that would use the
|
| 919 |
+
* surrounding programs's message catalog.
|
| 920 |
+
*/
|
| 921 |
+
#undef _
|
| 922 |
+
|
| 923 |
+
extern void libpq_append_error(PQExpBuffer errorMessage, const char *fmt,...) pg_attribute_printf(2, 3);
|
| 924 |
+
extern void libpq_append_conn_error(PGconn *conn, const char *fmt,...) pg_attribute_printf(2, 3);
|
| 925 |
+
|
| 926 |
+
/*
|
| 927 |
+
* These macros are needed to let error-handling code be portable between
|
| 928 |
+
* Unix and Windows. (ugh)
|
| 929 |
+
*/
|
| 930 |
+
#ifdef WIN32
|
| 931 |
+
#define SOCK_ERRNO (WSAGetLastError())
|
| 932 |
+
#define SOCK_STRERROR winsock_strerror
|
| 933 |
+
#define SOCK_ERRNO_SET(e) WSASetLastError(e)
|
| 934 |
+
#else
|
| 935 |
+
#define SOCK_ERRNO errno
|
| 936 |
+
#define SOCK_STRERROR strerror_r
|
| 937 |
+
#define SOCK_ERRNO_SET(e) (errno = (e))
|
| 938 |
+
#endif
|
| 939 |
+
|
| 940 |
+
#endif /* LIBPQ_INT_H */
|
pgsql/include/internal/port.h
ADDED
|
@@ -0,0 +1,520 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
+
*
|
| 3 |
+
* port.h
|
| 4 |
+
* Header for src/port/ compatibility functions.
|
| 5 |
+
*
|
| 6 |
+
* Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
|
| 7 |
+
* Portions Copyright (c) 1994, Regents of the University of California
|
| 8 |
+
*
|
| 9 |
+
* src/include/port.h
|
| 10 |
+
*
|
| 11 |
+
*-------------------------------------------------------------------------
|
| 12 |
+
*/
|
| 13 |
+
#ifndef PG_PORT_H
|
| 14 |
+
#define PG_PORT_H
|
| 15 |
+
|
| 16 |
+
#include <ctype.h>
|
| 17 |
+
|
| 18 |
+
/*
|
| 19 |
+
* Windows has enough specialized port stuff that we push most of it off
|
| 20 |
+
* into another file.
|
| 21 |
+
* Note: Some CYGWIN includes might #define WIN32.
|
| 22 |
+
*/
|
| 23 |
+
#if defined(WIN32) && !defined(__CYGWIN__)
|
| 24 |
+
#include "port/win32_port.h"
|
| 25 |
+
#endif
|
| 26 |
+
|
| 27 |
+
/* socket has a different definition on WIN32 */
|
| 28 |
+
#ifndef WIN32
|
| 29 |
+
typedef int pgsocket;
|
| 30 |
+
|
| 31 |
+
#define PGINVALID_SOCKET (-1)
|
| 32 |
+
#else
|
| 33 |
+
typedef SOCKET pgsocket;
|
| 34 |
+
|
| 35 |
+
#define PGINVALID_SOCKET INVALID_SOCKET
|
| 36 |
+
#endif
|
| 37 |
+
|
| 38 |
+
/* if platform lacks socklen_t, we assume this will work */
|
| 39 |
+
#ifndef HAVE_SOCKLEN_T
|
| 40 |
+
typedef unsigned int socklen_t;
|
| 41 |
+
#endif
|
| 42 |
+
|
| 43 |
+
/* non-blocking */
|
| 44 |
+
extern bool pg_set_noblock(pgsocket sock);
|
| 45 |
+
extern bool pg_set_block(pgsocket sock);
|
| 46 |
+
|
| 47 |
+
/* Portable path handling for Unix/Win32 (in path.c) */
|
| 48 |
+
|
| 49 |
+
extern bool has_drive_prefix(const char *path);
|
| 50 |
+
extern char *first_dir_separator(const char *filename);
|
| 51 |
+
extern char *last_dir_separator(const char *filename);
|
| 52 |
+
extern char *first_path_var_separator(const char *pathlist);
|
| 53 |
+
extern void join_path_components(char *ret_path,
|
| 54 |
+
const char *head, const char *tail);
|
| 55 |
+
extern void canonicalize_path(char *path);
|
| 56 |
+
extern void make_native_path(char *filename);
|
| 57 |
+
extern void cleanup_path(char *path);
|
| 58 |
+
extern bool path_contains_parent_reference(const char *path);
|
| 59 |
+
extern bool path_is_relative_and_below_cwd(const char *path);
|
| 60 |
+
extern bool path_is_prefix_of_path(const char *path1, const char *path2);
|
| 61 |
+
extern char *make_absolute_path(const char *path);
|
| 62 |
+
extern const char *get_progname(const char *argv0);
|
| 63 |
+
extern void get_share_path(const char *my_exec_path, char *ret_path);
|
| 64 |
+
extern void get_etc_path(const char *my_exec_path, char *ret_path);
|
| 65 |
+
extern void get_include_path(const char *my_exec_path, char *ret_path);
|
| 66 |
+
extern void get_pkginclude_path(const char *my_exec_path, char *ret_path);
|
| 67 |
+
extern void get_includeserver_path(const char *my_exec_path, char *ret_path);
|
| 68 |
+
extern void get_lib_path(const char *my_exec_path, char *ret_path);
|
| 69 |
+
extern void get_pkglib_path(const char *my_exec_path, char *ret_path);
|
| 70 |
+
extern void get_locale_path(const char *my_exec_path, char *ret_path);
|
| 71 |
+
extern void get_doc_path(const char *my_exec_path, char *ret_path);
|
| 72 |
+
extern void get_html_path(const char *my_exec_path, char *ret_path);
|
| 73 |
+
extern void get_man_path(const char *my_exec_path, char *ret_path);
|
| 74 |
+
extern bool get_home_path(char *ret_path);
|
| 75 |
+
extern void get_parent_directory(char *path);
|
| 76 |
+
|
| 77 |
+
/* common/pgfnames.c */
|
| 78 |
+
extern char **pgfnames(const char *path);
|
| 79 |
+
extern void pgfnames_cleanup(char **filenames);
|
| 80 |
+
|
| 81 |
+
#define IS_NONWINDOWS_DIR_SEP(ch) ((ch) == '/')
|
| 82 |
+
#define is_nonwindows_absolute_path(filename) \
|
| 83 |
+
( \
|
| 84 |
+
IS_NONWINDOWS_DIR_SEP((filename)[0]) \
|
| 85 |
+
)
|
| 86 |
+
|
| 87 |
+
#define IS_WINDOWS_DIR_SEP(ch) ((ch) == '/' || (ch) == '\\')
|
| 88 |
+
/* See path_is_relative_and_below_cwd() for how we handle 'E:abc'. */
|
| 89 |
+
#define is_windows_absolute_path(filename) \
|
| 90 |
+
( \
|
| 91 |
+
IS_WINDOWS_DIR_SEP((filename)[0]) || \
|
| 92 |
+
(isalpha((unsigned char) ((filename)[0])) && (filename)[1] == ':' && \
|
| 93 |
+
IS_WINDOWS_DIR_SEP((filename)[2])) \
|
| 94 |
+
)
|
| 95 |
+
|
| 96 |
+
/*
|
| 97 |
+
* is_absolute_path and IS_DIR_SEP
|
| 98 |
+
*
|
| 99 |
+
* By using macros here we avoid needing to include path.c in libpq.
|
| 100 |
+
*/
|
| 101 |
+
#ifndef WIN32
|
| 102 |
+
#define IS_DIR_SEP(ch) IS_NONWINDOWS_DIR_SEP(ch)
|
| 103 |
+
#define is_absolute_path(filename) is_nonwindows_absolute_path(filename)
|
| 104 |
+
#else
|
| 105 |
+
#define IS_DIR_SEP(ch) IS_WINDOWS_DIR_SEP(ch)
|
| 106 |
+
#define is_absolute_path(filename) is_windows_absolute_path(filename)
|
| 107 |
+
#endif
|
| 108 |
+
|
| 109 |
+
/*
|
| 110 |
+
* This macro provides a centralized list of all errnos that identify
|
| 111 |
+
* hard failure of a previously-established network connection.
|
| 112 |
+
* The macro is intended to be used in a switch statement, in the form
|
| 113 |
+
* "case ALL_CONNECTION_FAILURE_ERRNOS:".
|
| 114 |
+
*
|
| 115 |
+
* Note: this groups EPIPE and ECONNRESET, which we take to indicate a
|
| 116 |
+
* probable server crash, with other errors that indicate loss of network
|
| 117 |
+
* connectivity without proving much about the server's state. Places that
|
| 118 |
+
* are actually reporting errors typically single out EPIPE and ECONNRESET,
|
| 119 |
+
* while allowing the network failures to be reported generically.
|
| 120 |
+
*/
|
| 121 |
+
#define ALL_CONNECTION_FAILURE_ERRNOS \
|
| 122 |
+
EPIPE: \
|
| 123 |
+
case ECONNRESET: \
|
| 124 |
+
case ECONNABORTED: \
|
| 125 |
+
case EHOSTDOWN: \
|
| 126 |
+
case EHOSTUNREACH: \
|
| 127 |
+
case ENETDOWN: \
|
| 128 |
+
case ENETRESET: \
|
| 129 |
+
case ENETUNREACH: \
|
| 130 |
+
case ETIMEDOUT
|
| 131 |
+
|
| 132 |
+
/* Portable locale initialization (in exec.c) */
|
| 133 |
+
extern void set_pglocale_pgservice(const char *argv0, const char *app);
|
| 134 |
+
|
| 135 |
+
/* Portable way to find and execute binaries (in exec.c) */
|
| 136 |
+
extern int validate_exec(const char *path);
|
| 137 |
+
extern int find_my_exec(const char *argv0, char *retpath);
|
| 138 |
+
extern int find_other_exec(const char *argv0, const char *target,
|
| 139 |
+
const char *versionstr, char *retpath);
|
| 140 |
+
extern char *pipe_read_line(char *cmd, char *line, int maxsize);
|
| 141 |
+
|
| 142 |
+
/* Doesn't belong here, but this is used with find_other_exec(), so... */
|
| 143 |
+
#define PG_BACKEND_VERSIONSTR "postgres (PostgreSQL) " PG_VERSION "\n"
|
| 144 |
+
|
| 145 |
+
#ifdef EXEC_BACKEND
|
| 146 |
+
/* Disable ASLR before exec, for developer builds only (in exec.c) */
|
| 147 |
+
extern int pg_disable_aslr(void);
|
| 148 |
+
#endif
|
| 149 |
+
|
| 150 |
+
|
| 151 |
+
#if defined(WIN32) || defined(__CYGWIN__)
|
| 152 |
+
#define EXE ".exe"
|
| 153 |
+
#else
|
| 154 |
+
#define EXE ""
|
| 155 |
+
#endif
|
| 156 |
+
|
| 157 |
+
#if defined(WIN32) && !defined(__CYGWIN__)
|
| 158 |
+
#define DEVNULL "nul"
|
| 159 |
+
#else
|
| 160 |
+
#define DEVNULL "/dev/null"
|
| 161 |
+
#endif
|
| 162 |
+
|
| 163 |
+
/* Portable delay handling */
|
| 164 |
+
extern void pg_usleep(long microsec);
|
| 165 |
+
|
| 166 |
+
/* Portable SQL-like case-independent comparisons and conversions */
|
| 167 |
+
extern int pg_strcasecmp(const char *s1, const char *s2);
|
| 168 |
+
extern int pg_strncasecmp(const char *s1, const char *s2, size_t n);
|
| 169 |
+
extern unsigned char pg_toupper(unsigned char ch);
|
| 170 |
+
extern unsigned char pg_tolower(unsigned char ch);
|
| 171 |
+
extern unsigned char pg_ascii_toupper(unsigned char ch);
|
| 172 |
+
extern unsigned char pg_ascii_tolower(unsigned char ch);
|
| 173 |
+
|
| 174 |
+
/*
|
| 175 |
+
* Beginning in v12, we always replace snprintf() and friends with our own
|
| 176 |
+
* implementation. This symbol is no longer consulted by the core code,
|
| 177 |
+
* but keep it defined anyway in case any extensions are looking at it.
|
| 178 |
+
*/
|
| 179 |
+
#define USE_REPL_SNPRINTF 1
|
| 180 |
+
|
| 181 |
+
/*
|
| 182 |
+
* Versions of libintl >= 0.13 try to replace printf() and friends with
|
| 183 |
+
* macros to their own versions that understand the %$ format. We do the
|
| 184 |
+
* same, so disable their macros, if they exist.
|
| 185 |
+
*/
|
| 186 |
+
#ifdef vsnprintf
|
| 187 |
+
#undef vsnprintf
|
| 188 |
+
#endif
|
| 189 |
+
#ifdef snprintf
|
| 190 |
+
#undef snprintf
|
| 191 |
+
#endif
|
| 192 |
+
#ifdef vsprintf
|
| 193 |
+
#undef vsprintf
|
| 194 |
+
#endif
|
| 195 |
+
#ifdef sprintf
|
| 196 |
+
#undef sprintf
|
| 197 |
+
#endif
|
| 198 |
+
#ifdef vfprintf
|
| 199 |
+
#undef vfprintf
|
| 200 |
+
#endif
|
| 201 |
+
#ifdef fprintf
|
| 202 |
+
#undef fprintf
|
| 203 |
+
#endif
|
| 204 |
+
#ifdef vprintf
|
| 205 |
+
#undef vprintf
|
| 206 |
+
#endif
|
| 207 |
+
#ifdef printf
|
| 208 |
+
#undef printf
|
| 209 |
+
#endif
|
| 210 |
+
|
| 211 |
+
extern int pg_vsnprintf(char *str, size_t count, const char *fmt, va_list args) pg_attribute_printf(3, 0);
|
| 212 |
+
extern int pg_snprintf(char *str, size_t count, const char *fmt,...) pg_attribute_printf(3, 4);
|
| 213 |
+
extern int pg_vsprintf(char *str, const char *fmt, va_list args) pg_attribute_printf(2, 0);
|
| 214 |
+
extern int pg_sprintf(char *str, const char *fmt,...) pg_attribute_printf(2, 3);
|
| 215 |
+
extern int pg_vfprintf(FILE *stream, const char *fmt, va_list args) pg_attribute_printf(2, 0);
|
| 216 |
+
extern int pg_fprintf(FILE *stream, const char *fmt,...) pg_attribute_printf(2, 3);
|
| 217 |
+
extern int pg_vprintf(const char *fmt, va_list args) pg_attribute_printf(1, 0);
|
| 218 |
+
extern int pg_printf(const char *fmt,...) pg_attribute_printf(1, 2);
|
| 219 |
+
|
| 220 |
+
#ifndef WIN32
|
| 221 |
+
/*
|
| 222 |
+
* We add a pg_ prefix as a warning that the Windows implementations have the
|
| 223 |
+
* non-standard side-effect of changing the current file position.
|
| 224 |
+
*/
|
| 225 |
+
#define pg_pread pread
|
| 226 |
+
#define pg_pwrite pwrite
|
| 227 |
+
#endif
|
| 228 |
+
|
| 229 |
+
/*
|
| 230 |
+
* We use __VA_ARGS__ for printf to prevent replacing references to
|
| 231 |
+
* the "printf" format archetype in format() attribute declarations.
|
| 232 |
+
* That unfortunately means that taking a function pointer to printf
|
| 233 |
+
* will not do what we'd wish. (If you need to do that, you must name
|
| 234 |
+
* pg_printf explicitly.) For printf's sibling functions, use
|
| 235 |
+
* parameterless macros so that function pointers will work unsurprisingly.
|
| 236 |
+
*/
|
| 237 |
+
#define vsnprintf pg_vsnprintf
|
| 238 |
+
#define snprintf pg_snprintf
|
| 239 |
+
#define vsprintf pg_vsprintf
|
| 240 |
+
#define sprintf pg_sprintf
|
| 241 |
+
#define vfprintf pg_vfprintf
|
| 242 |
+
#define fprintf pg_fprintf
|
| 243 |
+
#define vprintf pg_vprintf
|
| 244 |
+
#define printf(...) pg_printf(__VA_ARGS__)
|
| 245 |
+
|
| 246 |
+
/* This is also provided by snprintf.c */
|
| 247 |
+
extern int pg_strfromd(char *str, size_t count, int precision, double value);
|
| 248 |
+
|
| 249 |
+
/* Replace strerror() with our own, somewhat more robust wrapper */
|
| 250 |
+
extern char *pg_strerror(int errnum);
|
| 251 |
+
#define strerror pg_strerror
|
| 252 |
+
|
| 253 |
+
/* Likewise for strerror_r(); note we prefer the GNU API for that */
|
| 254 |
+
extern char *pg_strerror_r(int errnum, char *buf, size_t buflen);
|
| 255 |
+
#define strerror_r pg_strerror_r
|
| 256 |
+
#define PG_STRERROR_R_BUFLEN 256 /* Recommended buffer size for strerror_r */
|
| 257 |
+
|
| 258 |
+
/* Wrap strsignal(), or provide our own version if necessary */
|
| 259 |
+
extern const char *pg_strsignal(int signum);
|
| 260 |
+
|
| 261 |
+
extern int pclose_check(FILE *stream);
|
| 262 |
+
|
| 263 |
+
/* Global variable holding time zone information. */
|
| 264 |
+
#if defined(WIN32) || defined(__CYGWIN__)
|
| 265 |
+
#define TIMEZONE_GLOBAL _timezone
|
| 266 |
+
#define TZNAME_GLOBAL _tzname
|
| 267 |
+
#else
|
| 268 |
+
#define TIMEZONE_GLOBAL timezone
|
| 269 |
+
#define TZNAME_GLOBAL tzname
|
| 270 |
+
#endif
|
| 271 |
+
|
| 272 |
+
#if defined(WIN32) || defined(__CYGWIN__)
|
| 273 |
+
/*
|
| 274 |
+
* Win32 doesn't have reliable rename/unlink during concurrent access.
|
| 275 |
+
*/
|
| 276 |
+
extern int pgrename(const char *from, const char *to);
|
| 277 |
+
extern int pgunlink(const char *path);
|
| 278 |
+
|
| 279 |
+
/* Include this first so later includes don't see these defines */
|
| 280 |
+
#ifdef _MSC_VER
|
| 281 |
+
#include <io.h>
|
| 282 |
+
#endif
|
| 283 |
+
|
| 284 |
+
#define rename(from, to) pgrename(from, to)
|
| 285 |
+
#define unlink(path) pgunlink(path)
|
| 286 |
+
#endif /* defined(WIN32) || defined(__CYGWIN__) */
|
| 287 |
+
|
| 288 |
+
/*
|
| 289 |
+
* Win32 also doesn't have symlinks, but we can emulate them with
|
| 290 |
+
* junction points on newer Win32 versions.
|
| 291 |
+
*
|
| 292 |
+
* Cygwin has its own symlinks which work on Win95/98/ME where
|
| 293 |
+
* junction points don't, so use those instead. We have no way of
|
| 294 |
+
* knowing what type of system Cygwin binaries will be run on.
|
| 295 |
+
* Note: Some CYGWIN includes might #define WIN32.
|
| 296 |
+
*/
|
| 297 |
+
#if defined(WIN32) && !defined(__CYGWIN__)
|
| 298 |
+
extern int pgsymlink(const char *oldpath, const char *newpath);
|
| 299 |
+
extern int pgreadlink(const char *path, char *buf, size_t size);
|
| 300 |
+
|
| 301 |
+
#define symlink(oldpath, newpath) pgsymlink(oldpath, newpath)
|
| 302 |
+
#define readlink(path, buf, size) pgreadlink(path, buf, size)
|
| 303 |
+
#endif
|
| 304 |
+
|
| 305 |
+
extern bool rmtree(const char *path, bool rmtopdir);
|
| 306 |
+
|
| 307 |
+
#if defined(WIN32) && !defined(__CYGWIN__)
|
| 308 |
+
|
| 309 |
+
/*
|
| 310 |
+
* open() and fopen() replacements to allow deletion of open files and
|
| 311 |
+
* passing of other special options.
|
| 312 |
+
*/
|
| 313 |
+
#define O_DIRECT 0x80000000
|
| 314 |
+
extern HANDLE pgwin32_open_handle(const char *, int, bool);
|
| 315 |
+
extern int pgwin32_open(const char *, int,...);
|
| 316 |
+
extern FILE *pgwin32_fopen(const char *, const char *);
|
| 317 |
+
#define open(a,b,c) pgwin32_open(a,b,c)
|
| 318 |
+
#define fopen(a,b) pgwin32_fopen(a,b)
|
| 319 |
+
|
| 320 |
+
/*
|
| 321 |
+
* Mingw-w64 headers #define popen and pclose to _popen and _pclose. We want
|
| 322 |
+
* to use our popen wrapper, rather than plain _popen, so override that. For
|
| 323 |
+
* consistency, use our version of pclose, too.
|
| 324 |
+
*/
|
| 325 |
+
#ifdef popen
|
| 326 |
+
#undef popen
|
| 327 |
+
#endif
|
| 328 |
+
#ifdef pclose
|
| 329 |
+
#undef pclose
|
| 330 |
+
#endif
|
| 331 |
+
|
| 332 |
+
/*
|
| 333 |
+
* system() and popen() replacements to enclose the command in an extra
|
| 334 |
+
* pair of quotes.
|
| 335 |
+
*/
|
| 336 |
+
extern int pgwin32_system(const char *command);
|
| 337 |
+
extern FILE *pgwin32_popen(const char *command, const char *type);
|
| 338 |
+
|
| 339 |
+
#define system(a) pgwin32_system(a)
|
| 340 |
+
#define popen(a,b) pgwin32_popen(a,b)
|
| 341 |
+
#define pclose(a) _pclose(a)
|
| 342 |
+
|
| 343 |
+
#else /* !WIN32 */
|
| 344 |
+
|
| 345 |
+
/*
|
| 346 |
+
* Win32 requires a special close for sockets and pipes, while on Unix
|
| 347 |
+
* close() does them all.
|
| 348 |
+
*/
|
| 349 |
+
#define closesocket close
|
| 350 |
+
#endif /* WIN32 */
|
| 351 |
+
|
| 352 |
+
/*
|
| 353 |
+
* On Windows, setvbuf() does not support _IOLBF mode, and interprets that
|
| 354 |
+
* as _IOFBF. To add insult to injury, setvbuf(file, NULL, _IOFBF, 0)
|
| 355 |
+
* crashes outright if "parameter validation" is enabled. Therefore, in
|
| 356 |
+
* places where we'd like to select line-buffered mode, we fall back to
|
| 357 |
+
* unbuffered mode instead on Windows. Always use PG_IOLBF not _IOLBF
|
| 358 |
+
* directly in order to implement this behavior.
|
| 359 |
+
*/
|
| 360 |
+
#ifndef WIN32
|
| 361 |
+
#define PG_IOLBF _IOLBF
|
| 362 |
+
#else
|
| 363 |
+
#define PG_IOLBF _IONBF
|
| 364 |
+
#endif
|
| 365 |
+
|
| 366 |
+
/*
|
| 367 |
+
* Default "extern" declarations or macro substitutes for library routines.
|
| 368 |
+
* When necessary, these routines are provided by files in src/port/.
|
| 369 |
+
*/
|
| 370 |
+
|
| 371 |
+
/* Type to use with fseeko/ftello */
|
| 372 |
+
#ifndef WIN32 /* WIN32 is handled in port/win32_port.h */
|
| 373 |
+
#define pgoff_t off_t
|
| 374 |
+
#endif
|
| 375 |
+
|
| 376 |
+
#ifndef HAVE_GETPEEREID
|
| 377 |
+
/* On Windows, Perl might have incompatible definitions of uid_t and gid_t. */
|
| 378 |
+
#ifndef PLPERL_HAVE_UID_GID
|
| 379 |
+
extern int getpeereid(int sock, uid_t *uid, gid_t *gid);
|
| 380 |
+
#endif
|
| 381 |
+
#endif
|
| 382 |
+
|
| 383 |
+
/*
|
| 384 |
+
* Glibc doesn't use the builtin for clang due to a *gcc* bug in a version
|
| 385 |
+
* newer than the gcc compatibility clang claims to have. This would cause a
|
| 386 |
+
* *lot* of superfluous function calls, therefore revert when using clang. In
|
| 387 |
+
* C++ there's issues with libc++ (not libstdc++), so disable as well.
|
| 388 |
+
*/
|
| 389 |
+
#if defined(__clang__) && !defined(__cplusplus)
|
| 390 |
+
/* needs to be separate to not confuse other compilers */
|
| 391 |
+
#if __has_builtin(__builtin_isinf)
|
| 392 |
+
/* need to include before, to avoid getting overwritten */
|
| 393 |
+
#include <math.h>
|
| 394 |
+
#undef isinf
|
| 395 |
+
#define isinf __builtin_isinf
|
| 396 |
+
#endif /* __has_builtin(isinf) */
|
| 397 |
+
#endif /* __clang__ && !__cplusplus */
|
| 398 |
+
|
| 399 |
+
#ifndef HAVE_EXPLICIT_BZERO
|
| 400 |
+
extern void explicit_bzero(void *buf, size_t len);
|
| 401 |
+
#endif
|
| 402 |
+
|
| 403 |
+
#ifdef HAVE_BUGGY_STRTOF
|
| 404 |
+
extern float pg_strtof(const char *nptr, char **endptr);
|
| 405 |
+
#define strtof(a,b) (pg_strtof((a),(b)))
|
| 406 |
+
#endif
|
| 407 |
+
|
| 408 |
+
#ifdef WIN32
|
| 409 |
+
/* src/port/win32link.c */
|
| 410 |
+
extern int link(const char *src, const char *dst);
|
| 411 |
+
#endif
|
| 412 |
+
|
| 413 |
+
#ifndef HAVE_MKDTEMP
|
| 414 |
+
extern char *mkdtemp(char *path);
|
| 415 |
+
#endif
|
| 416 |
+
|
| 417 |
+
#ifndef HAVE_INET_ATON
|
| 418 |
+
#include <netinet/in.h>
|
| 419 |
+
#include <arpa/inet.h>
|
| 420 |
+
extern int inet_aton(const char *cp, struct in_addr *addr);
|
| 421 |
+
#endif
|
| 422 |
+
|
| 423 |
+
#if !HAVE_DECL_STRLCAT
|
| 424 |
+
extern size_t strlcat(char *dst, const char *src, size_t siz);
|
| 425 |
+
#endif
|
| 426 |
+
|
| 427 |
+
#if !HAVE_DECL_STRLCPY
|
| 428 |
+
extern size_t strlcpy(char *dst, const char *src, size_t siz);
|
| 429 |
+
#endif
|
| 430 |
+
|
| 431 |
+
#if !HAVE_DECL_STRNLEN
|
| 432 |
+
extern size_t strnlen(const char *str, size_t maxlen);
|
| 433 |
+
#endif
|
| 434 |
+
|
| 435 |
+
/* thread.c */
|
| 436 |
+
#ifndef WIN32
|
| 437 |
+
extern bool pg_get_user_name(uid_t user_id, char *buffer, size_t buflen);
|
| 438 |
+
extern bool pg_get_user_home_dir(uid_t user_id, char *buffer, size_t buflen);
|
| 439 |
+
#endif
|
| 440 |
+
|
| 441 |
+
extern void pg_qsort(void *base, size_t nel, size_t elsize,
|
| 442 |
+
int (*cmp) (const void *, const void *));
|
| 443 |
+
extern int pg_qsort_strcmp(const void *a, const void *b);
|
| 444 |
+
|
| 445 |
+
#define qsort(a,b,c,d) pg_qsort(a,b,c,d)
|
| 446 |
+
|
| 447 |
+
typedef int (*qsort_arg_comparator) (const void *a, const void *b, void *arg);
|
| 448 |
+
|
| 449 |
+
extern void qsort_arg(void *base, size_t nel, size_t elsize,
|
| 450 |
+
qsort_arg_comparator cmp, void *arg);
|
| 451 |
+
|
| 452 |
+
extern void qsort_interruptible(void *base, size_t nel, size_t elsize,
|
| 453 |
+
qsort_arg_comparator cmp, void *arg);
|
| 454 |
+
|
| 455 |
+
extern void *bsearch_arg(const void *key, const void *base0,
|
| 456 |
+
size_t nmemb, size_t size,
|
| 457 |
+
int (*compar) (const void *, const void *, void *),
|
| 458 |
+
void *arg);
|
| 459 |
+
|
| 460 |
+
/* port/chklocale.c */
|
| 461 |
+
extern int pg_get_encoding_from_locale(const char *ctype, bool write_message);
|
| 462 |
+
|
| 463 |
+
#if defined(WIN32) && !defined(FRONTEND)
|
| 464 |
+
extern int pg_codepage_to_encoding(UINT cp);
|
| 465 |
+
#endif
|
| 466 |
+
|
| 467 |
+
/* port/inet_net_ntop.c */
|
| 468 |
+
extern char *pg_inet_net_ntop(int af, const void *src, int bits,
|
| 469 |
+
char *dst, size_t size);
|
| 470 |
+
|
| 471 |
+
/* port/pg_strong_random.c */
|
| 472 |
+
extern void pg_strong_random_init(void);
|
| 473 |
+
extern bool pg_strong_random(void *buf, size_t len);
|
| 474 |
+
|
| 475 |
+
/*
|
| 476 |
+
* pg_backend_random used to be a wrapper for pg_strong_random before
|
| 477 |
+
* Postgres 12 for the backend code.
|
| 478 |
+
*/
|
| 479 |
+
#define pg_backend_random pg_strong_random
|
| 480 |
+
|
| 481 |
+
/* port/pgcheckdir.c */
|
| 482 |
+
extern int pg_check_dir(const char *dir);
|
| 483 |
+
|
| 484 |
+
/* port/pgmkdirp.c */
|
| 485 |
+
extern int pg_mkdir_p(char *path, int omode);
|
| 486 |
+
|
| 487 |
+
/* port/pqsignal.c */
|
| 488 |
+
typedef void (*pqsigfunc) (SIGNAL_ARGS);
|
| 489 |
+
extern pqsigfunc pqsignal(int signo, pqsigfunc func);
|
| 490 |
+
|
| 491 |
+
/* port/quotes.c */
|
| 492 |
+
extern char *escape_single_quotes_ascii(const char *src);
|
| 493 |
+
|
| 494 |
+
/* common/wait_error.c */
|
| 495 |
+
extern char *wait_result_to_str(int exitstatus);
|
| 496 |
+
extern bool wait_result_is_signal(int exit_status, int signum);
|
| 497 |
+
extern bool wait_result_is_any_signal(int exit_status, bool include_command_not_found);
|
| 498 |
+
extern int wait_result_to_exit_code(int exit_status);
|
| 499 |
+
|
| 500 |
+
/*
|
| 501 |
+
* Interfaces that we assume all Unix system have. We retain individual macros
|
| 502 |
+
* for better documentation.
|
| 503 |
+
*
|
| 504 |
+
* For symlink-related functions, there is often no need to test these macros,
|
| 505 |
+
* because we provided basic support on Windows that can work with absolute
|
| 506 |
+
* paths to directories. Code that wants to test for complete symlink support
|
| 507 |
+
* (including relative paths and non-directories) should be conditional on
|
| 508 |
+
* HAVE_READLINK or HAVE_SYMLINK.
|
| 509 |
+
*/
|
| 510 |
+
#ifndef WIN32
|
| 511 |
+
#define HAVE_GETRLIMIT 1
|
| 512 |
+
#define HAVE_POLL 1
|
| 513 |
+
#define HAVE_POLL_H 1
|
| 514 |
+
#define HAVE_READLINK 1
|
| 515 |
+
#define HAVE_SETSID 1
|
| 516 |
+
#define HAVE_SHM_OPEN 1
|
| 517 |
+
#define HAVE_SYMLINK 1
|
| 518 |
+
#endif
|
| 519 |
+
|
| 520 |
+
#endif /* PG_PORT_H */
|
pgsql/include/internal/postgres_fe.h
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*-------------------------------------------------------------------------
|
| 2 |
+
*
|
| 3 |
+
* postgres_fe.h
|
| 4 |
+
* Primary include file for PostgreSQL client-side .c files
|
| 5 |
+
*
|
| 6 |
+
* This should be the first file included by PostgreSQL client libraries and
|
| 7 |
+
* application programs --- but not by backend modules, which should include
|
| 8 |
+
* postgres.h.
|
| 9 |
+
*
|
| 10 |
+
*
|
| 11 |
+
* Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
|
| 12 |
+
* Portions Copyright (c) 1995, Regents of the University of California
|
| 13 |
+
*
|
| 14 |
+
* src/include/postgres_fe.h
|
| 15 |
+
*
|
| 16 |
+
*-------------------------------------------------------------------------
|
| 17 |
+
*/
|
| 18 |
+
#ifndef POSTGRES_FE_H
|
| 19 |
+
#define POSTGRES_FE_H
|
| 20 |
+
|
| 21 |
+
#ifndef FRONTEND
|
| 22 |
+
#define FRON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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*-------------------------------------------------------------------------
|
| 2 |
+
*
|
| 3 |
+
* pqexpbuffer.h
|
| 4 |
+
* Declarations/definitions for "PQExpBuffer" functions.
|
| 5 |
+
*
|
| 6 |
+
* PQExpBuffer provides an indefinitely-extensible string data type.
|
| 7 |
+
* It can be used to buffer either ordinary C strings (null-terminated text)
|
| 8 |
+
* or arbitrary binary data. All storage is allocated with malloc().
|
| 9 |
+
*
|
| 10 |
+
* This module is essentially the same as the backend's StringInfo data type,
|
| 11 |
+
* but it is intended for use in frontend libpq and client applications.
|
| 12 |
+
* Thus, it does not rely on palloc() nor elog().
|
| 13 |
+
*
|
| 14 |
+
* It does rely on vsnprintf(); if configure finds that libc doesn't provide
|
| 15 |
+
* a usable vsnprintf(), then a copy of our own implementation of it will
|
| 16 |
+
* be linked into libpq.
|
| 17 |
+
*
|
| 18 |
+
* Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
|
| 19 |
+
* Portions Copyright (c) 1994, Regents of the University of California
|
| 20 |
+
*
|
| 21 |
+
* src/interfaces/libpq/pqexpbuffer.h
|
| 22 |
+
*
|
| 23 |
+
*-------------------------------------------------------------------------
|
| 24 |
+
*/
|
| 25 |
+
#ifndef PQEXPBUFFER_H
|
| 26 |
+
#define PQEXPBUFFER_H
|
| 27 |
+
|
| 28 |
+
/*-------------------------
|
| 29 |
+
* PQExpBufferData holds information about an extensible string.
|
| 30 |
+
* data is the current buffer for the string (allocated with malloc).
|
| 31 |
+
* len is the current string length. There is guaranteed to be
|
| 32 |
+
* a terminating '\0' at data[len], although this is not very
|
| 33 |
+
* useful when the string holds binary data rather than text.
|
| 34 |
+
* maxlen is the allocated size in bytes of 'data', i.e. the maximum
|
| 35 |
+
* string size (including the terminating '\0' char) that we can
|
| 36 |
+
* currently store in 'data' without having to reallocate
|
| 37 |
+
* more space. We must always have maxlen > len.
|
| 38 |
+
*
|
| 39 |
+
* An exception occurs if we failed to allocate enough memory for the string
|
| 40 |
+
* buffer. In that case data points to a statically allocated empty string,
|
| 41 |
+
* and len = maxlen = 0.
|
| 42 |
+
*-------------------------
|
| 43 |
+
*/
|
| 44 |
+
typedef struct PQExpBufferData
|
| 45 |
+
{
|
| 46 |
+
char *data;
|
| 47 |
+
size_t len;
|
| 48 |
+
size_t maxlen;
|
| 49 |
+
} PQExpBufferData;
|
| 50 |
+
|
| 51 |
+
typedef PQExpBufferData *PQExpBuffer;
|
| 52 |
+
|
| 53 |
+
/*------------------------
|
| 54 |
+
* Test for a broken (out of memory) PQExpBuffer.
|
| 55 |
+
* When a buffer is "broken", all operations except resetting or deleting it
|
| 56 |
+
* are no-ops.
|
| 57 |
+
*------------------------
|
| 58 |
+
*/
|
| 59 |
+
#define PQExpBufferBroken(str) \
|
| 60 |
+
((str) == NULL || (str)->maxlen == 0)
|
| 61 |
+
|
| 62 |
+
/*------------------------
|
| 63 |
+
* Same, but for use when using a static or local PQExpBufferData struct.
|
| 64 |
+
* For that, a null-pointer test is useless and may draw compiler warnings.
|
| 65 |
+
*------------------------
|
| 66 |
+
*/
|
| 67 |
+
#define PQExpBufferDataBroken(buf) \
|
| 68 |
+
((buf).maxlen == 0)
|
| 69 |
+
|
| 70 |
+
/*------------------------
|
| 71 |
+
* Initial size of the data buffer in a PQExpBuffer.
|
| 72 |
+
* NB: this must be large enough to hold error messages that might
|
| 73 |
+
* be returned by PQrequestCancel().
|
| 74 |
+
*------------------------
|
| 75 |
+
*/
|
| 76 |
+
#define INITIAL_EXPBUFFER_SIZE 256
|
| 77 |
+
|
| 78 |
+
/*------------------------
|
| 79 |
+
* There are two ways to create a PQExpBuffer object initially:
|
| 80 |
+
*
|
| 81 |
+
* PQExpBuffer stringptr = createPQExpBuffer();
|
| 82 |
+
* Both the PQExpBufferData and the data buffer are malloc'd.
|
| 83 |
+
*
|
| 84 |
+
* PQExpBufferData string;
|
| 85 |
+
* initPQExpBuffer(&string);
|
| 86 |
+
* The data buffer is malloc'd but the PQExpBufferData is presupplied.
|
| 87 |
+
* This is appropriate if the PQExpBufferData is a field of another
|
| 88 |
+
* struct.
|
| 89 |
+
*-------------------------
|
| 90 |
+
*/
|
| 91 |
+
|
| 92 |
+
/*------------------------
|
| 93 |
+
* createPQExpBuffer
|
| 94 |
+
* Create an empty 'PQExpBufferData' & return a pointer to it.
|
| 95 |
+
*/
|
| 96 |
+
extern PQExpBuffer createPQExpBuffer(void);
|
| 97 |
+
|
| 98 |
+
/*------------------------
|
| 99 |
+
* initPQExpBuffer
|
| 100 |
+
* Initialize a PQExpBufferData struct (with previously undefined contents)
|
| 101 |
+
* to describe an empty string.
|
| 102 |
+
*/
|
| 103 |
+
extern void initPQExpBuffer(PQExpBuffer str);
|
| 104 |
+
|
| 105 |
+
/*------------------------
|
| 106 |
+
* To destroy a PQExpBuffer, use either:
|
| 107 |
+
*
|
| 108 |
+
* destroyPQExpBuffer(str);
|
| 109 |
+
* free()s both the data buffer and the PQExpBufferData.
|
| 110 |
+
* This is the inverse of createPQExpBuffer().
|
| 111 |
+
*
|
| 112 |
+
* termPQExpBuffer(str)
|
| 113 |
+
* free()s the data buffer but not the PQExpBufferData itself.
|
| 114 |
+
* This is the inverse of initPQExpBuffer().
|
| 115 |
+
*
|
| 116 |
+
* NOTE: some routines build up a string using PQExpBuffer, and then
|
| 117 |
+
* release the PQExpBufferData but return the data string itself to their
|
| 118 |
+
* caller. At that point the data string looks like a plain malloc'd
|
| 119 |
+
* string.
|
| 120 |
+
*/
|
| 121 |
+
extern void destroyPQExpBuffer(PQExpBuffer str);
|
| 122 |
+
extern void termPQExpBuffer(PQExpBuffer str);
|
| 123 |
+
|
| 124 |
+
/*------------------------
|
| 125 |
+
* resetPQExpBuffer
|
| 126 |
+
* Reset a PQExpBuffer to empty
|
| 127 |
+
*
|
| 128 |
+
* Note: if possible, a "broken" PQExpBuffer is returned to normal.
|
| 129 |
+
*/
|
| 130 |
+
extern void resetPQExpBuffer(PQExpBuffer str);
|
| 131 |
+
|
| 132 |
+
/*------------------------
|
| 133 |
+
* enlargePQExpBuffer
|
| 134 |
+
* Make sure there is enough space for 'needed' more bytes in the buffer
|
| 135 |
+
* ('needed' does not include the terminating null).
|
| 136 |
+
*
|
| 137 |
+
* Returns 1 if OK, 0 if failed to enlarge buffer. (In the latter case
|
| 138 |
+
* the buffer is left in "broken" state.)
|
| 139 |
+
*/
|
| 140 |
+
extern int enlargePQExpBuffer(PQExpBuffer str, size_t needed);
|
| 141 |
+
|
| 142 |
+
/*------------------------
|
| 143 |
+
* printfPQExpBuffer
|
| 144 |
+
* Format text data under the control of fmt (an sprintf-like format string)
|
| 145 |
+
* and insert it into str. More space is allocated to str if necessary.
|
| 146 |
+
* This is a convenience routine that does the same thing as
|
| 147 |
+
* resetPQExpBuffer() followed by appendPQExpBuffer().
|
| 148 |
+
*/
|
| 149 |
+
extern void printfPQExpBuffer(PQExpBuffer str, const char *fmt,...) pg_attribute_printf(2, 3);
|
| 150 |
+
|
| 151 |
+
/*------------------------
|
| 152 |
+
* appendPQExpBuffer
|
| 153 |
+
* Format text data under the control of fmt (an sprintf-like format string)
|
| 154 |
+
* and append it to whatever is already in str. More space is allocated
|
| 155 |
+
* to str if necessary. This is sort of like a combination of sprintf and
|
| 156 |
+
* strcat.
|
| 157 |
+
*/
|
| 158 |
+
extern void appendPQExpBuffer(PQExpBuffer str, const char *fmt,...) pg_attribute_printf(2, 3);
|
| 159 |
+
|
| 160 |
+
/*------------------------
|
| 161 |
+
* appendPQExpBufferVA
|
| 162 |
+
* Attempt to format data and append it to str. Returns true if done
|
| 163 |
+
* (either successful or hard failure), false if need to retry.
|
| 164 |
+
*
|
| 165 |
+
* Caution: callers must be sure to preserve their entry-time errno
|
| 166 |
+
* when looping, in case the fmt contains "%m".
|
| 167 |
+
*/
|
| 168 |
+
extern bool appendPQExpBufferVA(PQExpBuffer str, const char *fmt, va_list args) pg_attribute_printf(2, 0);
|
| 169 |
+
|
| 170 |
+
/*------------------------
|
| 171 |
+
* appendPQExpBufferStr
|
| 172 |
+
* Append the given string to a PQExpBuffer, allocating more space
|
| 173 |
+
* if necessary.
|
| 174 |
+
*/
|
| 175 |
+
extern void appendPQExpBufferStr(PQExpBuffer str, const char *data);
|
| 176 |
+
|
| 177 |
+
/*------------------------
|
| 178 |
+
* appendPQExpBufferChar
|
| 179 |
+
* Append a single byte to str.
|
| 180 |
+
* Like appendPQExpBuffer(str, "%c", ch) but much faster.
|
| 181 |
+
*/
|
| 182 |
+
extern void appendPQExpBufferChar(PQExpBuffer str, char ch);
|
| 183 |
+
|
| 184 |
+
/*------------------------
|
| 185 |
+
* appendBinaryPQExpBuffer
|
| 186 |
+
* Append arbitrary binary data to a PQExpBuffer, allocating more space
|
| 187 |
+
* if necessary.
|
| 188 |
+
*/
|
| 189 |
+
extern void appendBinaryPQExpBuffer(PQExpBuffer str,
|
| 190 |
+
const char *data, size_t datalen);
|
| 191 |
+
|
| 192 |
+
#endif /* PQEXPBUFFER_H */
|
pgsql/include/libpq/libpq-fs.h
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*-------------------------------------------------------------------------
|
| 2 |
+
*
|
| 3 |
+
* libpq-fs.h
|
| 4 |
+
* definitions for using Inversion file system routines (ie, large objects)
|
| 5 |
+
*
|
| 6 |
+
*
|
| 7 |
+
* Portions Copyright (c) 1996-2023, PostgreSQL Global Development Group
|
| 8 |
+
* Portions Copyright (c) 1994, Regents of the University of California
|
| 9 |
+
*
|
| 10 |
+
* src/include/libpq/libpq-fs.h
|
| 11 |
+
*
|
| 12 |
+
*-------------------------------------------------------------------------
|
| 13 |
+
*/
|
| 14 |
+
#ifndef LIBPQ_FS_H
|
| 15 |
+
#define LIBPQ_FS_H
|
| 16 |
+
|
| 17 |
+
/*
|
| 18 |
+
* Read/write mode flags for inversion (large object) calls
|
| 19 |
+
*/
|
| 20 |
+
|
| 21 |
+
#define INV_WRITE 0x00020000
|
| 22 |
+
#define INV_READ 0x00040000
|
| 23 |
+
|
| 24 |
+
#endif /* LIBPQ_FS_H */
|
pgsql/include/libxml/HTMLparser.h
ADDED
|
@@ -0,0 +1,320 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: interface for an HTML 4.0 non-verifying parser
|
| 3 |
+
* Description: this module implements an HTML 4.0 non-verifying parser
|
| 4 |
+
* with API compatible with the XML parser ones. It should
|
| 5 |
+
* be able to parse "real world" HTML, even if severely
|
| 6 |
+
* broken from a specification point of view.
|
| 7 |
+
*
|
| 8 |
+
* Copy: See Copyright for the status of this software.
|
| 9 |
+
*
|
| 10 |
+
* Author: Daniel Veillard
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
#ifndef __HTML_PARSER_H__
|
| 14 |
+
#define __HTML_PARSER_H__
|
| 15 |
+
#include <libxml/xmlversion.h>
|
| 16 |
+
#include <libxml/parser.h>
|
| 17 |
+
|
| 18 |
+
#ifdef LIBXML_HTML_ENABLED
|
| 19 |
+
|
| 20 |
+
#ifdef __cplusplus
|
| 21 |
+
extern "C" {
|
| 22 |
+
#endif
|
| 23 |
+
|
| 24 |
+
/*
|
| 25 |
+
* Most of the back-end structures from XML and HTML are shared.
|
| 26 |
+
*/
|
| 27 |
+
typedef xmlParserCtxt htmlParserCtxt;
|
| 28 |
+
typedef xmlParserCtxtPtr htmlParserCtxtPtr;
|
| 29 |
+
typedef xmlParserNodeInfo htmlParserNodeInfo;
|
| 30 |
+
typedef xmlSAXHandler htmlSAXHandler;
|
| 31 |
+
typedef xmlSAXHandlerPtr htmlSAXHandlerPtr;
|
| 32 |
+
typedef xmlParserInput htmlParserInput;
|
| 33 |
+
typedef xmlParserInputPtr htmlParserInputPtr;
|
| 34 |
+
typedef xmlDocPtr htmlDocPtr;
|
| 35 |
+
typedef xmlNodePtr htmlNodePtr;
|
| 36 |
+
|
| 37 |
+
/*
|
| 38 |
+
* Internal description of an HTML element, representing HTML 4.01
|
| 39 |
+
* and XHTML 1.0 (which share the same structure).
|
| 40 |
+
*/
|
| 41 |
+
typedef struct _htmlElemDesc htmlElemDesc;
|
| 42 |
+
typedef htmlElemDesc *htmlElemDescPtr;
|
| 43 |
+
struct _htmlElemDesc {
|
| 44 |
+
const char *name; /* The tag name */
|
| 45 |
+
char startTag; /* Whether the start tag can be implied */
|
| 46 |
+
char endTag; /* Whether the end tag can be implied */
|
| 47 |
+
char saveEndTag; /* Whether the end tag should be saved */
|
| 48 |
+
char empty; /* Is this an empty element ? */
|
| 49 |
+
char depr; /* Is this a deprecated element ? */
|
| 50 |
+
char dtd; /* 1: only in Loose DTD, 2: only Frameset one */
|
| 51 |
+
char isinline; /* is this a block 0 or inline 1 element */
|
| 52 |
+
const char *desc; /* the description */
|
| 53 |
+
|
| 54 |
+
/* NRK Jan.2003
|
| 55 |
+
* New fields encapsulating HTML structure
|
| 56 |
+
*
|
| 57 |
+
* Bugs:
|
| 58 |
+
* This is a very limited representation. It fails to tell us when
|
| 59 |
+
* an element *requires* subelements (we only have whether they're
|
| 60 |
+
* allowed or not), and it doesn't tell us where CDATA and PCDATA
|
| 61 |
+
* are allowed. Some element relationships are not fully represented:
|
| 62 |
+
* these are flagged with the word MODIFIER
|
| 63 |
+
*/
|
| 64 |
+
const char** subelts; /* allowed sub-elements of this element */
|
| 65 |
+
const char* defaultsubelt; /* subelement for suggested auto-repair
|
| 66 |
+
if necessary or NULL */
|
| 67 |
+
const char** attrs_opt; /* Optional Attributes */
|
| 68 |
+
const char** attrs_depr; /* Additional deprecated attributes */
|
| 69 |
+
const char** attrs_req; /* Required attributes */
|
| 70 |
+
};
|
| 71 |
+
|
| 72 |
+
/*
|
| 73 |
+
* Internal description of an HTML entity.
|
| 74 |
+
*/
|
| 75 |
+
typedef struct _htmlEntityDesc htmlEntityDesc;
|
| 76 |
+
typedef htmlEntityDesc *htmlEntityDescPtr;
|
| 77 |
+
struct _htmlEntityDesc {
|
| 78 |
+
unsigned int value; /* the UNICODE value for the character */
|
| 79 |
+
const char *name; /* The entity name */
|
| 80 |
+
const char *desc; /* the description */
|
| 81 |
+
};
|
| 82 |
+
|
| 83 |
+
/*
|
| 84 |
+
* There is only few public functions.
|
| 85 |
+
*/
|
| 86 |
+
XML_DEPRECATED
|
| 87 |
+
XMLPUBFUN void
|
| 88 |
+
htmlInitAutoClose (void);
|
| 89 |
+
XMLPUBFUN const htmlElemDesc *
|
| 90 |
+
htmlTagLookup (const xmlChar *tag);
|
| 91 |
+
XMLPUBFUN const htmlEntityDesc *
|
| 92 |
+
htmlEntityLookup(const xmlChar *name);
|
| 93 |
+
XMLPUBFUN const htmlEntityDesc *
|
| 94 |
+
htmlEntityValueLookup(unsigned int value);
|
| 95 |
+
|
| 96 |
+
XMLPUBFUN int
|
| 97 |
+
htmlIsAutoClosed(htmlDocPtr doc,
|
| 98 |
+
htmlNodePtr elem);
|
| 99 |
+
XMLPUBFUN int
|
| 100 |
+
htmlAutoCloseTag(htmlDocPtr doc,
|
| 101 |
+
const xmlChar *name,
|
| 102 |
+
htmlNodePtr elem);
|
| 103 |
+
XML_DEPRECATED
|
| 104 |
+
XMLPUBFUN const htmlEntityDesc *
|
| 105 |
+
htmlParseEntityRef(htmlParserCtxtPtr ctxt,
|
| 106 |
+
const xmlChar **str);
|
| 107 |
+
XML_DEPRECATED
|
| 108 |
+
XMLPUBFUN int
|
| 109 |
+
htmlParseCharRef(htmlParserCtxtPtr ctxt);
|
| 110 |
+
XML_DEPRECATED
|
| 111 |
+
XMLPUBFUN void
|
| 112 |
+
htmlParseElement(htmlParserCtxtPtr ctxt);
|
| 113 |
+
|
| 114 |
+
XMLPUBFUN htmlParserCtxtPtr
|
| 115 |
+
htmlNewParserCtxt(void);
|
| 116 |
+
XMLPUBFUN htmlParserCtxtPtr
|
| 117 |
+
htmlNewSAXParserCtxt(const htmlSAXHandler *sax,
|
| 118 |
+
void *userData);
|
| 119 |
+
|
| 120 |
+
XMLPUBFUN htmlParserCtxtPtr
|
| 121 |
+
htmlCreateMemoryParserCtxt(const char *buffer,
|
| 122 |
+
int size);
|
| 123 |
+
|
| 124 |
+
XMLPUBFUN int
|
| 125 |
+
htmlParseDocument(htmlParserCtxtPtr ctxt);
|
| 126 |
+
XML_DEPRECATED
|
| 127 |
+
XMLPUBFUN htmlDocPtr
|
| 128 |
+
htmlSAXParseDoc (const xmlChar *cur,
|
| 129 |
+
const char *encoding,
|
| 130 |
+
htmlSAXHandlerPtr sax,
|
| 131 |
+
void *userData);
|
| 132 |
+
XMLPUBFUN htmlDocPtr
|
| 133 |
+
htmlParseDoc (const xmlChar *cur,
|
| 134 |
+
const char *encoding);
|
| 135 |
+
XMLPUBFUN htmlParserCtxtPtr
|
| 136 |
+
htmlCreateFileParserCtxt(const char *filename,
|
| 137 |
+
const char *encoding);
|
| 138 |
+
XML_DEPRECATED
|
| 139 |
+
XMLPUBFUN htmlDocPtr
|
| 140 |
+
htmlSAXParseFile(const char *filename,
|
| 141 |
+
const char *encoding,
|
| 142 |
+
htmlSAXHandlerPtr sax,
|
| 143 |
+
void *userData);
|
| 144 |
+
XMLPUBFUN htmlDocPtr
|
| 145 |
+
htmlParseFile (const char *filename,
|
| 146 |
+
const char *encoding);
|
| 147 |
+
XMLPUBFUN int
|
| 148 |
+
UTF8ToHtml (unsigned char *out,
|
| 149 |
+
int *outlen,
|
| 150 |
+
const unsigned char *in,
|
| 151 |
+
int *inlen);
|
| 152 |
+
XMLPUBFUN int
|
| 153 |
+
htmlEncodeEntities(unsigned char *out,
|
| 154 |
+
int *outlen,
|
| 155 |
+
const unsigned char *in,
|
| 156 |
+
int *inlen, int quoteChar);
|
| 157 |
+
XMLPUBFUN int
|
| 158 |
+
htmlIsScriptAttribute(const xmlChar *name);
|
| 159 |
+
XMLPUBFUN int
|
| 160 |
+
htmlHandleOmittedElem(int val);
|
| 161 |
+
|
| 162 |
+
#ifdef LIBXML_PUSH_ENABLED
|
| 163 |
+
/**
|
| 164 |
+
* Interfaces for the Push mode.
|
| 165 |
+
*/
|
| 166 |
+
XMLPUBFUN htmlParserCtxtPtr
|
| 167 |
+
htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax,
|
| 168 |
+
void *user_data,
|
| 169 |
+
const char *chunk,
|
| 170 |
+
int size,
|
| 171 |
+
const char *filename,
|
| 172 |
+
xmlCharEncoding enc);
|
| 173 |
+
XMLPUBFUN int
|
| 174 |
+
htmlParseChunk (htmlParserCtxtPtr ctxt,
|
| 175 |
+
const char *chunk,
|
| 176 |
+
int size,
|
| 177 |
+
int terminate);
|
| 178 |
+
#endif /* LIBXML_PUSH_ENABLED */
|
| 179 |
+
|
| 180 |
+
XMLPUBFUN void
|
| 181 |
+
htmlFreeParserCtxt (htmlParserCtxtPtr ctxt);
|
| 182 |
+
|
| 183 |
+
/*
|
| 184 |
+
* New set of simpler/more flexible APIs
|
| 185 |
+
*/
|
| 186 |
+
/**
|
| 187 |
+
* xmlParserOption:
|
| 188 |
+
*
|
| 189 |
+
* This is the set of XML parser options that can be passed down
|
| 190 |
+
* to the xmlReadDoc() and similar calls.
|
| 191 |
+
*/
|
| 192 |
+
typedef enum {
|
| 193 |
+
HTML_PARSE_RECOVER = 1<<0, /* Relaxed parsing */
|
| 194 |
+
HTML_PARSE_NODEFDTD = 1<<2, /* do not default a doctype if not found */
|
| 195 |
+
HTML_PARSE_NOERROR = 1<<5, /* suppress error reports */
|
| 196 |
+
HTML_PARSE_NOWARNING= 1<<6, /* suppress warning reports */
|
| 197 |
+
HTML_PARSE_PEDANTIC = 1<<7, /* pedantic error reporting */
|
| 198 |
+
HTML_PARSE_NOBLANKS = 1<<8, /* remove blank nodes */
|
| 199 |
+
HTML_PARSE_NONET = 1<<11,/* Forbid network access */
|
| 200 |
+
HTML_PARSE_NOIMPLIED= 1<<13,/* Do not add implied html/body... elements */
|
| 201 |
+
HTML_PARSE_COMPACT = 1<<16,/* compact small text nodes */
|
| 202 |
+
HTML_PARSE_IGNORE_ENC=1<<21 /* ignore internal document encoding hint */
|
| 203 |
+
} htmlParserOption;
|
| 204 |
+
|
| 205 |
+
XMLPUBFUN void
|
| 206 |
+
htmlCtxtReset (htmlParserCtxtPtr ctxt);
|
| 207 |
+
XMLPUBFUN int
|
| 208 |
+
htmlCtxtUseOptions (htmlParserCtxtPtr ctxt,
|
| 209 |
+
int options);
|
| 210 |
+
XMLPUBFUN htmlDocPtr
|
| 211 |
+
htmlReadDoc (const xmlChar *cur,
|
| 212 |
+
const char *URL,
|
| 213 |
+
const char *encoding,
|
| 214 |
+
int options);
|
| 215 |
+
XMLPUBFUN htmlDocPtr
|
| 216 |
+
htmlReadFile (const char *URL,
|
| 217 |
+
const char *encoding,
|
| 218 |
+
int options);
|
| 219 |
+
XMLPUBFUN htmlDocPtr
|
| 220 |
+
htmlReadMemory (const char *buffer,
|
| 221 |
+
int size,
|
| 222 |
+
const char *URL,
|
| 223 |
+
const char *encoding,
|
| 224 |
+
int options);
|
| 225 |
+
XMLPUBFUN htmlDocPtr
|
| 226 |
+
htmlReadFd (int fd,
|
| 227 |
+
const char *URL,
|
| 228 |
+
const char *encoding,
|
| 229 |
+
int options);
|
| 230 |
+
XMLPUBFUN htmlDocPtr
|
| 231 |
+
htmlReadIO (xmlInputReadCallback ioread,
|
| 232 |
+
xmlInputCloseCallback ioclose,
|
| 233 |
+
void *ioctx,
|
| 234 |
+
const char *URL,
|
| 235 |
+
const char *encoding,
|
| 236 |
+
int options);
|
| 237 |
+
XMLPUBFUN htmlDocPtr
|
| 238 |
+
htmlCtxtReadDoc (xmlParserCtxtPtr ctxt,
|
| 239 |
+
const xmlChar *cur,
|
| 240 |
+
const char *URL,
|
| 241 |
+
const char *encoding,
|
| 242 |
+
int options);
|
| 243 |
+
XMLPUBFUN htmlDocPtr
|
| 244 |
+
htmlCtxtReadFile (xmlParserCtxtPtr ctxt,
|
| 245 |
+
const char *filename,
|
| 246 |
+
const char *encoding,
|
| 247 |
+
int options);
|
| 248 |
+
XMLPUBFUN htmlDocPtr
|
| 249 |
+
htmlCtxtReadMemory (xmlParserCtxtPtr ctxt,
|
| 250 |
+
const char *buffer,
|
| 251 |
+
int size,
|
| 252 |
+
const char *URL,
|
| 253 |
+
const char *encoding,
|
| 254 |
+
int options);
|
| 255 |
+
XMLPUBFUN htmlDocPtr
|
| 256 |
+
htmlCtxtReadFd (xmlParserCtxtPtr ctxt,
|
| 257 |
+
int fd,
|
| 258 |
+
const char *URL,
|
| 259 |
+
const char *encoding,
|
| 260 |
+
int options);
|
| 261 |
+
XMLPUBFUN htmlDocPtr
|
| 262 |
+
htmlCtxtReadIO (xmlParserCtxtPtr ctxt,
|
| 263 |
+
xmlInputReadCallback ioread,
|
| 264 |
+
xmlInputCloseCallback ioclose,
|
| 265 |
+
void *ioctx,
|
| 266 |
+
const char *URL,
|
| 267 |
+
const char *encoding,
|
| 268 |
+
int options);
|
| 269 |
+
|
| 270 |
+
/* NRK/Jan2003: further knowledge of HTML structure
|
| 271 |
+
*/
|
| 272 |
+
typedef enum {
|
| 273 |
+
HTML_NA = 0 , /* something we don't check at all */
|
| 274 |
+
HTML_INVALID = 0x1 ,
|
| 275 |
+
HTML_DEPRECATED = 0x2 ,
|
| 276 |
+
HTML_VALID = 0x4 ,
|
| 277 |
+
HTML_REQUIRED = 0xc /* VALID bit set so ( & HTML_VALID ) is TRUE */
|
| 278 |
+
} htmlStatus ;
|
| 279 |
+
|
| 280 |
+
/* Using htmlElemDesc rather than name here, to emphasise the fact
|
| 281 |
+
that otherwise there's a lookup overhead
|
| 282 |
+
*/
|
| 283 |
+
XMLPUBFUN htmlStatus htmlAttrAllowed(const htmlElemDesc*, const xmlChar*, int) ;
|
| 284 |
+
XMLPUBFUN int htmlElementAllowedHere(const htmlElemDesc*, const xmlChar*) ;
|
| 285 |
+
XMLPUBFUN htmlStatus htmlElementStatusHere(const htmlElemDesc*, const htmlElemDesc*) ;
|
| 286 |
+
XMLPUBFUN htmlStatus htmlNodeStatus(const htmlNodePtr, int) ;
|
| 287 |
+
/**
|
| 288 |
+
* htmlDefaultSubelement:
|
| 289 |
+
* @elt: HTML element
|
| 290 |
+
*
|
| 291 |
+
* Returns the default subelement for this element
|
| 292 |
+
*/
|
| 293 |
+
#define htmlDefaultSubelement(elt) elt->defaultsubelt
|
| 294 |
+
/**
|
| 295 |
+
* htmlElementAllowedHereDesc:
|
| 296 |
+
* @parent: HTML parent element
|
| 297 |
+
* @elt: HTML element
|
| 298 |
+
*
|
| 299 |
+
* Checks whether an HTML element description may be a
|
| 300 |
+
* direct child of the specified element.
|
| 301 |
+
*
|
| 302 |
+
* Returns 1 if allowed; 0 otherwise.
|
| 303 |
+
*/
|
| 304 |
+
#define htmlElementAllowedHereDesc(parent,elt) \
|
| 305 |
+
htmlElementAllowedHere((parent), (elt)->name)
|
| 306 |
+
/**
|
| 307 |
+
* htmlRequiredAttrs:
|
| 308 |
+
* @elt: HTML element
|
| 309 |
+
*
|
| 310 |
+
* Returns the attributes required for the specified element.
|
| 311 |
+
*/
|
| 312 |
+
#define htmlRequiredAttrs(elt) (elt)->attrs_req
|
| 313 |
+
|
| 314 |
+
|
| 315 |
+
#ifdef __cplusplus
|
| 316 |
+
}
|
| 317 |
+
#endif
|
| 318 |
+
|
| 319 |
+
#endif /* LIBXML_HTML_ENABLED */
|
| 320 |
+
#endif /* __HTML_PARSER_H__ */
|
pgsql/include/libxml/HTMLtree.h
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: specific APIs to process HTML tree, especially serialization
|
| 3 |
+
* Description: this module implements a few function needed to process
|
| 4 |
+
* tree in an HTML specific way.
|
| 5 |
+
*
|
| 6 |
+
* Copy: See Copyright for the status of this software.
|
| 7 |
+
*
|
| 8 |
+
* Author: Daniel Veillard
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
#ifndef __HTML_TREE_H__
|
| 12 |
+
#define __HTML_TREE_H__
|
| 13 |
+
|
| 14 |
+
#include <stdio.h>
|
| 15 |
+
#include <libxml/xmlversion.h>
|
| 16 |
+
#include <libxml/tree.h>
|
| 17 |
+
#include <libxml/HTMLparser.h>
|
| 18 |
+
|
| 19 |
+
#ifdef LIBXML_HTML_ENABLED
|
| 20 |
+
|
| 21 |
+
#ifdef __cplusplus
|
| 22 |
+
extern "C" {
|
| 23 |
+
#endif
|
| 24 |
+
|
| 25 |
+
|
| 26 |
+
/**
|
| 27 |
+
* HTML_TEXT_NODE:
|
| 28 |
+
*
|
| 29 |
+
* Macro. A text node in a HTML document is really implemented
|
| 30 |
+
* the same way as a text node in an XML document.
|
| 31 |
+
*/
|
| 32 |
+
#define HTML_TEXT_NODE XML_TEXT_NODE
|
| 33 |
+
/**
|
| 34 |
+
* HTML_ENTITY_REF_NODE:
|
| 35 |
+
*
|
| 36 |
+
* Macro. An entity reference in a HTML document is really implemented
|
| 37 |
+
* the same way as an entity reference in an XML document.
|
| 38 |
+
*/
|
| 39 |
+
#define HTML_ENTITY_REF_NODE XML_ENTITY_REF_NODE
|
| 40 |
+
/**
|
| 41 |
+
* HTML_COMMENT_NODE:
|
| 42 |
+
*
|
| 43 |
+
* Macro. A comment in a HTML document is really implemented
|
| 44 |
+
* the same way as a comment in an XML document.
|
| 45 |
+
*/
|
| 46 |
+
#define HTML_COMMENT_NODE XML_COMMENT_NODE
|
| 47 |
+
/**
|
| 48 |
+
* HTML_PRESERVE_NODE:
|
| 49 |
+
*
|
| 50 |
+
* Macro. A preserved node in a HTML document is really implemented
|
| 51 |
+
* the same way as a CDATA section in an XML document.
|
| 52 |
+
*/
|
| 53 |
+
#define HTML_PRESERVE_NODE XML_CDATA_SECTION_NODE
|
| 54 |
+
/**
|
| 55 |
+
* HTML_PI_NODE:
|
| 56 |
+
*
|
| 57 |
+
* Macro. A processing instruction in a HTML document is really implemented
|
| 58 |
+
* the same way as a processing instruction in an XML document.
|
| 59 |
+
*/
|
| 60 |
+
#define HTML_PI_NODE XML_PI_NODE
|
| 61 |
+
|
| 62 |
+
XMLPUBFUN htmlDocPtr
|
| 63 |
+
htmlNewDoc (const xmlChar *URI,
|
| 64 |
+
const xmlChar *ExternalID);
|
| 65 |
+
XMLPUBFUN htmlDocPtr
|
| 66 |
+
htmlNewDocNoDtD (const xmlChar *URI,
|
| 67 |
+
const xmlChar *ExternalID);
|
| 68 |
+
XMLPUBFUN const xmlChar *
|
| 69 |
+
htmlGetMetaEncoding (htmlDocPtr doc);
|
| 70 |
+
XMLPUBFUN int
|
| 71 |
+
htmlSetMetaEncoding (htmlDocPtr doc,
|
| 72 |
+
const xmlChar *encoding);
|
| 73 |
+
#ifdef LIBXML_OUTPUT_ENABLED
|
| 74 |
+
XMLPUBFUN void
|
| 75 |
+
htmlDocDumpMemory (xmlDocPtr cur,
|
| 76 |
+
xmlChar **mem,
|
| 77 |
+
int *size);
|
| 78 |
+
XMLPUBFUN void
|
| 79 |
+
htmlDocDumpMemoryFormat (xmlDocPtr cur,
|
| 80 |
+
xmlChar **mem,
|
| 81 |
+
int *size,
|
| 82 |
+
int format);
|
| 83 |
+
XMLPUBFUN int
|
| 84 |
+
htmlDocDump (FILE *f,
|
| 85 |
+
xmlDocPtr cur);
|
| 86 |
+
XMLPUBFUN int
|
| 87 |
+
htmlSaveFile (const char *filename,
|
| 88 |
+
xmlDocPtr cur);
|
| 89 |
+
XMLPUBFUN int
|
| 90 |
+
htmlNodeDump (xmlBufferPtr buf,
|
| 91 |
+
xmlDocPtr doc,
|
| 92 |
+
xmlNodePtr cur);
|
| 93 |
+
XMLPUBFUN void
|
| 94 |
+
htmlNodeDumpFile (FILE *out,
|
| 95 |
+
xmlDocPtr doc,
|
| 96 |
+
xmlNodePtr cur);
|
| 97 |
+
XMLPUBFUN int
|
| 98 |
+
htmlNodeDumpFileFormat (FILE *out,
|
| 99 |
+
xmlDocPtr doc,
|
| 100 |
+
xmlNodePtr cur,
|
| 101 |
+
const char *encoding,
|
| 102 |
+
int format);
|
| 103 |
+
XMLPUBFUN int
|
| 104 |
+
htmlSaveFileEnc (const char *filename,
|
| 105 |
+
xmlDocPtr cur,
|
| 106 |
+
const char *encoding);
|
| 107 |
+
XMLPUBFUN int
|
| 108 |
+
htmlSaveFileFormat (const char *filename,
|
| 109 |
+
xmlDocPtr cur,
|
| 110 |
+
const char *encoding,
|
| 111 |
+
int format);
|
| 112 |
+
|
| 113 |
+
XMLPUBFUN void
|
| 114 |
+
htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf,
|
| 115 |
+
xmlDocPtr doc,
|
| 116 |
+
xmlNodePtr cur,
|
| 117 |
+
const char *encoding,
|
| 118 |
+
int format);
|
| 119 |
+
XMLPUBFUN void
|
| 120 |
+
htmlDocContentDumpOutput(xmlOutputBufferPtr buf,
|
| 121 |
+
xmlDocPtr cur,
|
| 122 |
+
const char *encoding);
|
| 123 |
+
XMLPUBFUN void
|
| 124 |
+
htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf,
|
| 125 |
+
xmlDocPtr cur,
|
| 126 |
+
const char *encoding,
|
| 127 |
+
int format);
|
| 128 |
+
XMLPUBFUN void
|
| 129 |
+
htmlNodeDumpOutput (xmlOutputBufferPtr buf,
|
| 130 |
+
xmlDocPtr doc,
|
| 131 |
+
xmlNodePtr cur,
|
| 132 |
+
const char *encoding);
|
| 133 |
+
|
| 134 |
+
#endif /* LIBXML_OUTPUT_ENABLED */
|
| 135 |
+
|
| 136 |
+
XMLPUBFUN int
|
| 137 |
+
htmlIsBooleanAttr (const xmlChar *name);
|
| 138 |
+
|
| 139 |
+
|
| 140 |
+
#ifdef __cplusplus
|
| 141 |
+
}
|
| 142 |
+
#endif
|
| 143 |
+
|
| 144 |
+
#endif /* LIBXML_HTML_ENABLED */
|
| 145 |
+
|
| 146 |
+
#endif /* __HTML_TREE_H__ */
|
| 147 |
+
|
pgsql/include/libxml/SAX.h
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: Old SAX version 1 handler, deprecated
|
| 3 |
+
* Description: DEPRECATED set of SAX version 1 interfaces used to
|
| 4 |
+
* build the DOM tree.
|
| 5 |
+
*
|
| 6 |
+
* Copy: See Copyright for the status of this software.
|
| 7 |
+
*
|
| 8 |
+
* Author: Daniel Veillard
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
#ifndef __XML_SAX_H__
|
| 13 |
+
#define __XML_SAX_H__
|
| 14 |
+
|
| 15 |
+
#include <stdio.h>
|
| 16 |
+
#include <stdlib.h>
|
| 17 |
+
#include <libxml/xmlversion.h>
|
| 18 |
+
#include <libxml/parser.h>
|
| 19 |
+
|
| 20 |
+
#ifdef LIBXML_LEGACY_ENABLED
|
| 21 |
+
|
| 22 |
+
#ifdef __cplusplus
|
| 23 |
+
extern "C" {
|
| 24 |
+
#endif
|
| 25 |
+
XML_DEPRECATED
|
| 26 |
+
XMLPUBFUN const xmlChar *
|
| 27 |
+
getPublicId (void *ctx);
|
| 28 |
+
XML_DEPRECATED
|
| 29 |
+
XMLPUBFUN const xmlChar *
|
| 30 |
+
getSystemId (void *ctx);
|
| 31 |
+
XML_DEPRECATED
|
| 32 |
+
XMLPUBFUN void
|
| 33 |
+
setDocumentLocator (void *ctx,
|
| 34 |
+
xmlSAXLocatorPtr loc);
|
| 35 |
+
|
| 36 |
+
XML_DEPRECATED
|
| 37 |
+
XMLPUBFUN int
|
| 38 |
+
getLineNumber (void *ctx);
|
| 39 |
+
XML_DEPRECATED
|
| 40 |
+
XMLPUBFUN int
|
| 41 |
+
getColumnNumber (void *ctx);
|
| 42 |
+
|
| 43 |
+
XML_DEPRECATED
|
| 44 |
+
XMLPUBFUN int
|
| 45 |
+
isStandalone (void *ctx);
|
| 46 |
+
XML_DEPRECATED
|
| 47 |
+
XMLPUBFUN int
|
| 48 |
+
hasInternalSubset (void *ctx);
|
| 49 |
+
XML_DEPRECATED
|
| 50 |
+
XMLPUBFUN int
|
| 51 |
+
hasExternalSubset (void *ctx);
|
| 52 |
+
|
| 53 |
+
XML_DEPRECATED
|
| 54 |
+
XMLPUBFUN void
|
| 55 |
+
internalSubset (void *ctx,
|
| 56 |
+
const xmlChar *name,
|
| 57 |
+
const xmlChar *ExternalID,
|
| 58 |
+
const xmlChar *SystemID);
|
| 59 |
+
XML_DEPRECATED
|
| 60 |
+
XMLPUBFUN void
|
| 61 |
+
externalSubset (void *ctx,
|
| 62 |
+
const xmlChar *name,
|
| 63 |
+
const xmlChar *ExternalID,
|
| 64 |
+
const xmlChar *SystemID);
|
| 65 |
+
XML_DEPRECATED
|
| 66 |
+
XMLPUBFUN xmlEntityPtr
|
| 67 |
+
getEntity (void *ctx,
|
| 68 |
+
const xmlChar *name);
|
| 69 |
+
XML_DEPRECATED
|
| 70 |
+
XMLPUBFUN xmlEntityPtr
|
| 71 |
+
getParameterEntity (void *ctx,
|
| 72 |
+
const xmlChar *name);
|
| 73 |
+
XML_DEPRECATED
|
| 74 |
+
XMLPUBFUN xmlParserInputPtr
|
| 75 |
+
resolveEntity (void *ctx,
|
| 76 |
+
const xmlChar *publicId,
|
| 77 |
+
const xmlChar *systemId);
|
| 78 |
+
|
| 79 |
+
XML_DEPRECATED
|
| 80 |
+
XMLPUBFUN void
|
| 81 |
+
entityDecl (void *ctx,
|
| 82 |
+
const xmlChar *name,
|
| 83 |
+
int type,
|
| 84 |
+
const xmlChar *publicId,
|
| 85 |
+
const xmlChar *systemId,
|
| 86 |
+
xmlChar *content);
|
| 87 |
+
XML_DEPRECATED
|
| 88 |
+
XMLPUBFUN void
|
| 89 |
+
attributeDecl (void *ctx,
|
| 90 |
+
const xmlChar *elem,
|
| 91 |
+
const xmlChar *fullname,
|
| 92 |
+
int type,
|
| 93 |
+
int def,
|
| 94 |
+
const xmlChar *defaultValue,
|
| 95 |
+
xmlEnumerationPtr tree);
|
| 96 |
+
XML_DEPRECATED
|
| 97 |
+
XMLPUBFUN void
|
| 98 |
+
elementDecl (void *ctx,
|
| 99 |
+
const xmlChar *name,
|
| 100 |
+
int type,
|
| 101 |
+
xmlElementContentPtr content);
|
| 102 |
+
XML_DEPRECATED
|
| 103 |
+
XMLPUBFUN void
|
| 104 |
+
notationDecl (void *ctx,
|
| 105 |
+
const xmlChar *name,
|
| 106 |
+
const xmlChar *publicId,
|
| 107 |
+
const xmlChar *systemId);
|
| 108 |
+
XML_DEPRECATED
|
| 109 |
+
XMLPUBFUN void
|
| 110 |
+
unparsedEntityDecl (void *ctx,
|
| 111 |
+
const xmlChar *name,
|
| 112 |
+
const xmlChar *publicId,
|
| 113 |
+
const xmlChar *systemId,
|
| 114 |
+
const xmlChar *notationName);
|
| 115 |
+
|
| 116 |
+
XML_DEPRECATED
|
| 117 |
+
XMLPUBFUN void
|
| 118 |
+
startDocument (void *ctx);
|
| 119 |
+
XML_DEPRECATED
|
| 120 |
+
XMLPUBFUN void
|
| 121 |
+
endDocument (void *ctx);
|
| 122 |
+
XML_DEPRECATED
|
| 123 |
+
XMLPUBFUN void
|
| 124 |
+
attribute (void *ctx,
|
| 125 |
+
const xmlChar *fullname,
|
| 126 |
+
const xmlChar *value);
|
| 127 |
+
XML_DEPRECATED
|
| 128 |
+
XMLPUBFUN void
|
| 129 |
+
startElement (void *ctx,
|
| 130 |
+
const xmlChar *fullname,
|
| 131 |
+
const xmlChar **atts);
|
| 132 |
+
XML_DEPRECATED
|
| 133 |
+
XMLPUBFUN void
|
| 134 |
+
endElement (void *ctx,
|
| 135 |
+
const xmlChar *name);
|
| 136 |
+
XML_DEPRECATED
|
| 137 |
+
XMLPUBFUN void
|
| 138 |
+
reference (void *ctx,
|
| 139 |
+
const xmlChar *name);
|
| 140 |
+
XML_DEPRECATED
|
| 141 |
+
XMLPUBFUN void
|
| 142 |
+
characters (void *ctx,
|
| 143 |
+
const xmlChar *ch,
|
| 144 |
+
int len);
|
| 145 |
+
XML_DEPRECATED
|
| 146 |
+
XMLPUBFUN void
|
| 147 |
+
ignorableWhitespace (void *ctx,
|
| 148 |
+
const xmlChar *ch,
|
| 149 |
+
int len);
|
| 150 |
+
XML_DEPRECATED
|
| 151 |
+
XMLPUBFUN void
|
| 152 |
+
processingInstruction (void *ctx,
|
| 153 |
+
const xmlChar *target,
|
| 154 |
+
const xmlChar *data);
|
| 155 |
+
XML_DEPRECATED
|
| 156 |
+
XMLPUBFUN void
|
| 157 |
+
globalNamespace (void *ctx,
|
| 158 |
+
const xmlChar *href,
|
| 159 |
+
const xmlChar *prefix);
|
| 160 |
+
XML_DEPRECATED
|
| 161 |
+
XMLPUBFUN void
|
| 162 |
+
setNamespace (void *ctx,
|
| 163 |
+
const xmlChar *name);
|
| 164 |
+
XML_DEPRECATED
|
| 165 |
+
XMLPUBFUN xmlNsPtr
|
| 166 |
+
getNamespace (void *ctx);
|
| 167 |
+
XML_DEPRECATED
|
| 168 |
+
XMLPUBFUN int
|
| 169 |
+
checkNamespace (void *ctx,
|
| 170 |
+
xmlChar *nameSpace);
|
| 171 |
+
XML_DEPRECATED
|
| 172 |
+
XMLPUBFUN void
|
| 173 |
+
namespaceDecl (void *ctx,
|
| 174 |
+
const xmlChar *href,
|
| 175 |
+
const xmlChar *prefix);
|
| 176 |
+
XML_DEPRECATED
|
| 177 |
+
XMLPUBFUN void
|
| 178 |
+
comment (void *ctx,
|
| 179 |
+
const xmlChar *value);
|
| 180 |
+
XML_DEPRECATED
|
| 181 |
+
XMLPUBFUN void
|
| 182 |
+
cdataBlock (void *ctx,
|
| 183 |
+
const xmlChar *value,
|
| 184 |
+
int len);
|
| 185 |
+
|
| 186 |
+
#ifdef LIBXML_SAX1_ENABLED
|
| 187 |
+
XML_DEPRECATED
|
| 188 |
+
XMLPUBFUN void
|
| 189 |
+
initxmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr,
|
| 190 |
+
int warning);
|
| 191 |
+
#ifdef LIBXML_HTML_ENABLED
|
| 192 |
+
XML_DEPRECATED
|
| 193 |
+
XMLPUBFUN void
|
| 194 |
+
inithtmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr);
|
| 195 |
+
#endif
|
| 196 |
+
#endif /* LIBXML_SAX1_ENABLED */
|
| 197 |
+
|
| 198 |
+
#ifdef __cplusplus
|
| 199 |
+
}
|
| 200 |
+
#endif
|
| 201 |
+
|
| 202 |
+
#endif /* LIBXML_LEGACY_ENABLED */
|
| 203 |
+
|
| 204 |
+
#endif /* __XML_SAX_H__ */
|
pgsql/include/libxml/SAX2.h
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: SAX2 parser interface used to build the DOM tree
|
| 3 |
+
* Description: those are the default SAX2 interfaces used by
|
| 4 |
+
* the library when building DOM tree.
|
| 5 |
+
*
|
| 6 |
+
* Copy: See Copyright for the status of this software.
|
| 7 |
+
*
|
| 8 |
+
* Author: Daniel Veillard
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
#ifndef __XML_SAX2_H__
|
| 13 |
+
#define __XML_SAX2_H__
|
| 14 |
+
|
| 15 |
+
#include <stdio.h>
|
| 16 |
+
#include <stdlib.h>
|
| 17 |
+
#include <libxml/xmlversion.h>
|
| 18 |
+
#include <libxml/parser.h>
|
| 19 |
+
|
| 20 |
+
#ifdef __cplusplus
|
| 21 |
+
extern "C" {
|
| 22 |
+
#endif
|
| 23 |
+
XMLPUBFUN const xmlChar *
|
| 24 |
+
xmlSAX2GetPublicId (void *ctx);
|
| 25 |
+
XMLPUBFUN const xmlChar *
|
| 26 |
+
xmlSAX2GetSystemId (void *ctx);
|
| 27 |
+
XMLPUBFUN void
|
| 28 |
+
xmlSAX2SetDocumentLocator (void *ctx,
|
| 29 |
+
xmlSAXLocatorPtr loc);
|
| 30 |
+
|
| 31 |
+
XMLPUBFUN int
|
| 32 |
+
xmlSAX2GetLineNumber (void *ctx);
|
| 33 |
+
XMLPUBFUN int
|
| 34 |
+
xmlSAX2GetColumnNumber (void *ctx);
|
| 35 |
+
|
| 36 |
+
XMLPUBFUN int
|
| 37 |
+
xmlSAX2IsStandalone (void *ctx);
|
| 38 |
+
XMLPUBFUN int
|
| 39 |
+
xmlSAX2HasInternalSubset (void *ctx);
|
| 40 |
+
XMLPUBFUN int
|
| 41 |
+
xmlSAX2HasExternalSubset (void *ctx);
|
| 42 |
+
|
| 43 |
+
XMLPUBFUN void
|
| 44 |
+
xmlSAX2InternalSubset (void *ctx,
|
| 45 |
+
const xmlChar *name,
|
| 46 |
+
const xmlChar *ExternalID,
|
| 47 |
+
const xmlChar *SystemID);
|
| 48 |
+
XMLPUBFUN void
|
| 49 |
+
xmlSAX2ExternalSubset (void *ctx,
|
| 50 |
+
const xmlChar *name,
|
| 51 |
+
const xmlChar *ExternalID,
|
| 52 |
+
const xmlChar *SystemID);
|
| 53 |
+
XMLPUBFUN xmlEntityPtr
|
| 54 |
+
xmlSAX2GetEntity (void *ctx,
|
| 55 |
+
const xmlChar *name);
|
| 56 |
+
XMLPUBFUN xmlEntityPtr
|
| 57 |
+
xmlSAX2GetParameterEntity (void *ctx,
|
| 58 |
+
const xmlChar *name);
|
| 59 |
+
XMLPUBFUN xmlParserInputPtr
|
| 60 |
+
xmlSAX2ResolveEntity (void *ctx,
|
| 61 |
+
const xmlChar *publicId,
|
| 62 |
+
const xmlChar *systemId);
|
| 63 |
+
|
| 64 |
+
XMLPUBFUN void
|
| 65 |
+
xmlSAX2EntityDecl (void *ctx,
|
| 66 |
+
const xmlChar *name,
|
| 67 |
+
int type,
|
| 68 |
+
const xmlChar *publicId,
|
| 69 |
+
const xmlChar *systemId,
|
| 70 |
+
xmlChar *content);
|
| 71 |
+
XMLPUBFUN void
|
| 72 |
+
xmlSAX2AttributeDecl (void *ctx,
|
| 73 |
+
const xmlChar *elem,
|
| 74 |
+
const xmlChar *fullname,
|
| 75 |
+
int type,
|
| 76 |
+
int def,
|
| 77 |
+
const xmlChar *defaultValue,
|
| 78 |
+
xmlEnumerationPtr tree);
|
| 79 |
+
XMLPUBFUN void
|
| 80 |
+
xmlSAX2ElementDecl (void *ctx,
|
| 81 |
+
const xmlChar *name,
|
| 82 |
+
int type,
|
| 83 |
+
xmlElementContentPtr content);
|
| 84 |
+
XMLPUBFUN void
|
| 85 |
+
xmlSAX2NotationDecl (void *ctx,
|
| 86 |
+
const xmlChar *name,
|
| 87 |
+
const xmlChar *publicId,
|
| 88 |
+
const xmlChar *systemId);
|
| 89 |
+
XMLPUBFUN void
|
| 90 |
+
xmlSAX2UnparsedEntityDecl (void *ctx,
|
| 91 |
+
const xmlChar *name,
|
| 92 |
+
const xmlChar *publicId,
|
| 93 |
+
const xmlChar *systemId,
|
| 94 |
+
const xmlChar *notationName);
|
| 95 |
+
|
| 96 |
+
XMLPUBFUN void
|
| 97 |
+
xmlSAX2StartDocument (void *ctx);
|
| 98 |
+
XMLPUBFUN void
|
| 99 |
+
xmlSAX2EndDocument (void *ctx);
|
| 100 |
+
#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED) || \
|
| 101 |
+
defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_LEGACY_ENABLED)
|
| 102 |
+
XMLPUBFUN void
|
| 103 |
+
xmlSAX2StartElement (void *ctx,
|
| 104 |
+
const xmlChar *fullname,
|
| 105 |
+
const xmlChar **atts);
|
| 106 |
+
XMLPUBFUN void
|
| 107 |
+
xmlSAX2EndElement (void *ctx,
|
| 108 |
+
const xmlChar *name);
|
| 109 |
+
#endif /* LIBXML_SAX1_ENABLED or LIBXML_HTML_ENABLED or LIBXML_LEGACY_ENABLED */
|
| 110 |
+
XMLPUBFUN void
|
| 111 |
+
xmlSAX2StartElementNs (void *ctx,
|
| 112 |
+
const xmlChar *localname,
|
| 113 |
+
const xmlChar *prefix,
|
| 114 |
+
const xmlChar *URI,
|
| 115 |
+
int nb_namespaces,
|
| 116 |
+
const xmlChar **namespaces,
|
| 117 |
+
int nb_attributes,
|
| 118 |
+
int nb_defaulted,
|
| 119 |
+
const xmlChar **attributes);
|
| 120 |
+
XMLPUBFUN void
|
| 121 |
+
xmlSAX2EndElementNs (void *ctx,
|
| 122 |
+
const xmlChar *localname,
|
| 123 |
+
const xmlChar *prefix,
|
| 124 |
+
const xmlChar *URI);
|
| 125 |
+
XMLPUBFUN void
|
| 126 |
+
xmlSAX2Reference (void *ctx,
|
| 127 |
+
const xmlChar *name);
|
| 128 |
+
XMLPUBFUN void
|
| 129 |
+
xmlSAX2Characters (void *ctx,
|
| 130 |
+
const xmlChar *ch,
|
| 131 |
+
int len);
|
| 132 |
+
XMLPUBFUN void
|
| 133 |
+
xmlSAX2IgnorableWhitespace (void *ctx,
|
| 134 |
+
const xmlChar *ch,
|
| 135 |
+
int len);
|
| 136 |
+
XMLPUBFUN void
|
| 137 |
+
xmlSAX2ProcessingInstruction (void *ctx,
|
| 138 |
+
const xmlChar *target,
|
| 139 |
+
const xmlChar *data);
|
| 140 |
+
XMLPUBFUN void
|
| 141 |
+
xmlSAX2Comment (void *ctx,
|
| 142 |
+
const xmlChar *value);
|
| 143 |
+
XMLPUBFUN void
|
| 144 |
+
xmlSAX2CDataBlock (void *ctx,
|
| 145 |
+
const xmlChar *value,
|
| 146 |
+
int len);
|
| 147 |
+
|
| 148 |
+
#ifdef LIBXML_SAX1_ENABLED
|
| 149 |
+
XML_DEPRECATED
|
| 150 |
+
XMLPUBFUN int
|
| 151 |
+
xmlSAXDefaultVersion (int version);
|
| 152 |
+
#endif /* LIBXML_SAX1_ENABLED */
|
| 153 |
+
|
| 154 |
+
XMLPUBFUN int
|
| 155 |
+
xmlSAXVersion (xmlSAXHandler *hdlr,
|
| 156 |
+
int version);
|
| 157 |
+
XMLPUBFUN void
|
| 158 |
+
xmlSAX2InitDefaultSAXHandler (xmlSAXHandler *hdlr,
|
| 159 |
+
int warning);
|
| 160 |
+
#ifdef LIBXML_HTML_ENABLED
|
| 161 |
+
XMLPUBFUN void
|
| 162 |
+
xmlSAX2InitHtmlDefaultSAXHandler(xmlSAXHandler *hdlr);
|
| 163 |
+
XML_DEPRECATED
|
| 164 |
+
XMLPUBFUN void
|
| 165 |
+
htmlDefaultSAXHandlerInit (void);
|
| 166 |
+
#endif
|
| 167 |
+
XML_DEPRECATED
|
| 168 |
+
XMLPUBFUN void
|
| 169 |
+
xmlDefaultSAXHandlerInit (void);
|
| 170 |
+
#ifdef __cplusplus
|
| 171 |
+
}
|
| 172 |
+
#endif
|
| 173 |
+
#endif /* __XML_SAX2_H__ */
|
pgsql/include/libxml/c14n.h
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: Provide Canonical XML and Exclusive XML Canonicalization
|
| 3 |
+
* Description: the c14n modules provides a
|
| 4 |
+
*
|
| 5 |
+
* "Canonical XML" implementation
|
| 6 |
+
* http://www.w3.org/TR/xml-c14n
|
| 7 |
+
*
|
| 8 |
+
* and an
|
| 9 |
+
*
|
| 10 |
+
* "Exclusive XML Canonicalization" implementation
|
| 11 |
+
* http://www.w3.org/TR/xml-exc-c14n
|
| 12 |
+
|
| 13 |
+
* Copy: See Copyright for the status of this software.
|
| 14 |
+
*
|
| 15 |
+
* Author: Aleksey Sanin <aleksey@aleksey.com>
|
| 16 |
+
*/
|
| 17 |
+
#ifndef __XML_C14N_H__
|
| 18 |
+
#define __XML_C14N_H__
|
| 19 |
+
|
| 20 |
+
#include <libxml/xmlversion.h>
|
| 21 |
+
|
| 22 |
+
#ifdef LIBXML_C14N_ENABLED
|
| 23 |
+
#ifdef LIBXML_OUTPUT_ENABLED
|
| 24 |
+
|
| 25 |
+
#include <libxml/tree.h>
|
| 26 |
+
#include <libxml/xpath.h>
|
| 27 |
+
|
| 28 |
+
#ifdef __cplusplus
|
| 29 |
+
extern "C" {
|
| 30 |
+
#endif /* __cplusplus */
|
| 31 |
+
|
| 32 |
+
/*
|
| 33 |
+
* XML Canonicalization
|
| 34 |
+
* http://www.w3.org/TR/xml-c14n
|
| 35 |
+
*
|
| 36 |
+
* Exclusive XML Canonicalization
|
| 37 |
+
* http://www.w3.org/TR/xml-exc-c14n
|
| 38 |
+
*
|
| 39 |
+
* Canonical form of an XML document could be created if and only if
|
| 40 |
+
* a) default attributes (if any) are added to all nodes
|
| 41 |
+
* b) all character and parsed entity references are resolved
|
| 42 |
+
* In order to achieve this in libxml2 the document MUST be loaded with
|
| 43 |
+
* following global settings:
|
| 44 |
+
*
|
| 45 |
+
* xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
|
| 46 |
+
* xmlSubstituteEntitiesDefault(1);
|
| 47 |
+
*
|
| 48 |
+
* or corresponding parser context setting:
|
| 49 |
+
* xmlParserCtxtPtr ctxt;
|
| 50 |
+
*
|
| 51 |
+
* ...
|
| 52 |
+
* ctxt->loadsubset = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
|
| 53 |
+
* ctxt->replaceEntities = 1;
|
| 54 |
+
* ...
|
| 55 |
+
*/
|
| 56 |
+
|
| 57 |
+
/*
|
| 58 |
+
* xmlC14NMode:
|
| 59 |
+
*
|
| 60 |
+
* Predefined values for C14N modes
|
| 61 |
+
*
|
| 62 |
+
*/
|
| 63 |
+
typedef enum {
|
| 64 |
+
XML_C14N_1_0 = 0, /* Original C14N 1.0 spec */
|
| 65 |
+
XML_C14N_EXCLUSIVE_1_0 = 1, /* Exclusive C14N 1.0 spec */
|
| 66 |
+
XML_C14N_1_1 = 2 /* C14N 1.1 spec */
|
| 67 |
+
} xmlC14NMode;
|
| 68 |
+
|
| 69 |
+
XMLPUBFUN int
|
| 70 |
+
xmlC14NDocSaveTo (xmlDocPtr doc,
|
| 71 |
+
xmlNodeSetPtr nodes,
|
| 72 |
+
int mode, /* a xmlC14NMode */
|
| 73 |
+
xmlChar **inclusive_ns_prefixes,
|
| 74 |
+
int with_comments,
|
| 75 |
+
xmlOutputBufferPtr buf);
|
| 76 |
+
|
| 77 |
+
XMLPUBFUN int
|
| 78 |
+
xmlC14NDocDumpMemory (xmlDocPtr doc,
|
| 79 |
+
xmlNodeSetPtr nodes,
|
| 80 |
+
int mode, /* a xmlC14NMode */
|
| 81 |
+
xmlChar **inclusive_ns_prefixes,
|
| 82 |
+
int with_comments,
|
| 83 |
+
xmlChar **doc_txt_ptr);
|
| 84 |
+
|
| 85 |
+
XMLPUBFUN int
|
| 86 |
+
xmlC14NDocSave (xmlDocPtr doc,
|
| 87 |
+
xmlNodeSetPtr nodes,
|
| 88 |
+
int mode, /* a xmlC14NMode */
|
| 89 |
+
xmlChar **inclusive_ns_prefixes,
|
| 90 |
+
int with_comments,
|
| 91 |
+
const char* filename,
|
| 92 |
+
int compression);
|
| 93 |
+
|
| 94 |
+
|
| 95 |
+
/**
|
| 96 |
+
* This is the core C14N function
|
| 97 |
+
*/
|
| 98 |
+
/**
|
| 99 |
+
* xmlC14NIsVisibleCallback:
|
| 100 |
+
* @user_data: user data
|
| 101 |
+
* @node: the current node
|
| 102 |
+
* @parent: the parent node
|
| 103 |
+
*
|
| 104 |
+
* Signature for a C14N callback on visible nodes
|
| 105 |
+
*
|
| 106 |
+
* Returns 1 if the node should be included
|
| 107 |
+
*/
|
| 108 |
+
typedef int (*xmlC14NIsVisibleCallback) (void* user_data,
|
| 109 |
+
xmlNodePtr node,
|
| 110 |
+
xmlNodePtr parent);
|
| 111 |
+
|
| 112 |
+
XMLPUBFUN int
|
| 113 |
+
xmlC14NExecute (xmlDocPtr doc,
|
| 114 |
+
xmlC14NIsVisibleCallback is_visible_callback,
|
| 115 |
+
void* user_data,
|
| 116 |
+
int mode, /* a xmlC14NMode */
|
| 117 |
+
xmlChar **inclusive_ns_prefixes,
|
| 118 |
+
int with_comments,
|
| 119 |
+
xmlOutputBufferPtr buf);
|
| 120 |
+
|
| 121 |
+
#ifdef __cplusplus
|
| 122 |
+
}
|
| 123 |
+
#endif /* __cplusplus */
|
| 124 |
+
|
| 125 |
+
#endif /* LIBXML_OUTPUT_ENABLED */
|
| 126 |
+
#endif /* LIBXML_C14N_ENABLED */
|
| 127 |
+
#endif /* __XML_C14N_H__ */
|
| 128 |
+
|
pgsql/include/libxml/catalog.h
ADDED
|
@@ -0,0 +1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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Summary: interfaces to the Catalog handling system
|
| 3 |
+
* Description: the catalog module implements the support for
|
| 4 |
+
* XML Catalogs and SGML catalogs
|
| 5 |
+
*
|
| 6 |
+
* SGML Open Technical Resolution TR9401:1997.
|
| 7 |
+
* http://www.jclark.com/sp/catalog.htm
|
| 8 |
+
*
|
| 9 |
+
* XML Catalogs Working Draft 06 August 2001
|
| 10 |
+
* http://www.oasis-open.org/committees/entity/spec-2001-08-06.html
|
| 11 |
+
*
|
| 12 |
+
* Copy: See Copyright for the status of this software.
|
| 13 |
+
*
|
| 14 |
+
* Author: Daniel Veillard
|
| 15 |
+
*/
|
| 16 |
+
|
| 17 |
+
#ifndef __XML_CATALOG_H__
|
| 18 |
+
#define __XML_CATALOG_H__
|
| 19 |
+
|
| 20 |
+
#include <stdio.h>
|
| 21 |
+
|
| 22 |
+
#include <libxml/xmlversion.h>
|
| 23 |
+
#include <libxml/xmlstring.h>
|
| 24 |
+
#include <libxml/tree.h>
|
| 25 |
+
|
| 26 |
+
#ifdef LIBXML_CATALOG_ENABLED
|
| 27 |
+
|
| 28 |
+
#ifdef __cplusplus
|
| 29 |
+
extern "C" {
|
| 30 |
+
#endif
|
| 31 |
+
|
| 32 |
+
/**
|
| 33 |
+
* XML_CATALOGS_NAMESPACE:
|
| 34 |
+
*
|
| 35 |
+
* The namespace for the XML Catalogs elements.
|
| 36 |
+
*/
|
| 37 |
+
#define XML_CATALOGS_NAMESPACE \
|
| 38 |
+
(const xmlChar *) "urn:oasis:names:tc:entity:xmlns:xml:catalog"
|
| 39 |
+
/**
|
| 40 |
+
* XML_CATALOG_PI:
|
| 41 |
+
*
|
| 42 |
+
* The specific XML Catalog Processing Instruction name.
|
| 43 |
+
*/
|
| 44 |
+
#define XML_CATALOG_PI \
|
| 45 |
+
(const xmlChar *) "oasis-xml-catalog"
|
| 46 |
+
|
| 47 |
+
/*
|
| 48 |
+
* The API is voluntarily limited to general cataloging.
|
| 49 |
+
*/
|
| 50 |
+
typedef enum {
|
| 51 |
+
XML_CATA_PREFER_NONE = 0,
|
| 52 |
+
XML_CATA_PREFER_PUBLIC = 1,
|
| 53 |
+
XML_CATA_PREFER_SYSTEM
|
| 54 |
+
} xmlCatalogPrefer;
|
| 55 |
+
|
| 56 |
+
typedef enum {
|
| 57 |
+
XML_CATA_ALLOW_NONE = 0,
|
| 58 |
+
XML_CATA_ALLOW_GLOBAL = 1,
|
| 59 |
+
XML_CATA_ALLOW_DOCUMENT = 2,
|
| 60 |
+
XML_CATA_ALLOW_ALL = 3
|
| 61 |
+
} xmlCatalogAllow;
|
| 62 |
+
|
| 63 |
+
typedef struct _xmlCatalog xmlCatalog;
|
| 64 |
+
typedef xmlCatalog *xmlCatalogPtr;
|
| 65 |
+
|
| 66 |
+
/*
|
| 67 |
+
* Operations on a given catalog.
|
| 68 |
+
*/
|
| 69 |
+
XMLPUBFUN xmlCatalogPtr
|
| 70 |
+
xmlNewCatalog (int sgml);
|
| 71 |
+
XMLPUBFUN xmlCatalogPtr
|
| 72 |
+
xmlLoadACatalog (const char *filename);
|
| 73 |
+
XMLPUBFUN xmlCatalogPtr
|
| 74 |
+
xmlLoadSGMLSuperCatalog (const char *filename);
|
| 75 |
+
XMLPUBFUN int
|
| 76 |
+
xmlConvertSGMLCatalog (xmlCatalogPtr catal);
|
| 77 |
+
XMLPUBFUN int
|
| 78 |
+
xmlACatalogAdd (xmlCatalogPtr catal,
|
| 79 |
+
const xmlChar *type,
|
| 80 |
+
const xmlChar *orig,
|
| 81 |
+
const xmlChar *replace);
|
| 82 |
+
XMLPUBFUN int
|
| 83 |
+
xmlACatalogRemove (xmlCatalogPtr catal,
|
| 84 |
+
const xmlChar *value);
|
| 85 |
+
XMLPUBFUN xmlChar *
|
| 86 |
+
xmlACatalogResolve (xmlCatalogPtr catal,
|
| 87 |
+
const xmlChar *pubID,
|
| 88 |
+
const xmlChar *sysID);
|
| 89 |
+
XMLPUBFUN xmlChar *
|
| 90 |
+
xmlACatalogResolveSystem(xmlCatalogPtr catal,
|
| 91 |
+
const xmlChar *sysID);
|
| 92 |
+
XMLPUBFUN xmlChar *
|
| 93 |
+
xmlACatalogResolvePublic(xmlCatalogPtr catal,
|
| 94 |
+
const xmlChar *pubID);
|
| 95 |
+
XMLPUBFUN xmlChar *
|
| 96 |
+
xmlACatalogResolveURI (xmlCatalogPtr catal,
|
| 97 |
+
const xmlChar *URI);
|
| 98 |
+
#ifdef LIBXML_OUTPUT_ENABLED
|
| 99 |
+
XMLPUBFUN void
|
| 100 |
+
xmlACatalogDump (xmlCatalogPtr catal,
|
| 101 |
+
FILE *out);
|
| 102 |
+
#endif /* LIBXML_OUTPUT_ENABLED */
|
| 103 |
+
XMLPUBFUN void
|
| 104 |
+
xmlFreeCatalog (xmlCatalogPtr catal);
|
| 105 |
+
XMLPUBFUN int
|
| 106 |
+
xmlCatalogIsEmpty (xmlCatalogPtr catal);
|
| 107 |
+
|
| 108 |
+
/*
|
| 109 |
+
* Global operations.
|
| 110 |
+
*/
|
| 111 |
+
XMLPUBFUN void
|
| 112 |
+
xmlInitializeCatalog (void);
|
| 113 |
+
XMLPUBFUN int
|
| 114 |
+
xmlLoadCatalog (const char *filename);
|
| 115 |
+
XMLPUBFUN void
|
| 116 |
+
xmlLoadCatalogs (const char *paths);
|
| 117 |
+
XMLPUBFUN void
|
| 118 |
+
xmlCatalogCleanup (void);
|
| 119 |
+
#ifdef LIBXML_OUTPUT_ENABLED
|
| 120 |
+
XMLPUBFUN void
|
| 121 |
+
xmlCatalogDump (FILE *out);
|
| 122 |
+
#endif /* LIBXML_OUTPUT_ENABLED */
|
| 123 |
+
XMLPUBFUN xmlChar *
|
| 124 |
+
xmlCatalogResolve (const xmlChar *pubID,
|
| 125 |
+
const xmlChar *sysID);
|
| 126 |
+
XMLPUBFUN xmlChar *
|
| 127 |
+
xmlCatalogResolveSystem (const xmlChar *sysID);
|
| 128 |
+
XMLPUBFUN xmlChar *
|
| 129 |
+
xmlCatalogResolvePublic (const xmlChar *pubID);
|
| 130 |
+
XMLPUBFUN xmlChar *
|
| 131 |
+
xmlCatalogResolveURI (const xmlChar *URI);
|
| 132 |
+
XMLPUBFUN int
|
| 133 |
+
xmlCatalogAdd (const xmlChar *type,
|
| 134 |
+
const xmlChar *orig,
|
| 135 |
+
const xmlChar *replace);
|
| 136 |
+
XMLPUBFUN int
|
| 137 |
+
xmlCatalogRemove (const xmlChar *value);
|
| 138 |
+
XMLPUBFUN xmlDocPtr
|
| 139 |
+
xmlParseCatalogFile (const char *filename);
|
| 140 |
+
XMLPUBFUN int
|
| 141 |
+
xmlCatalogConvert (void);
|
| 142 |
+
|
| 143 |
+
/*
|
| 144 |
+
* Strictly minimal interfaces for per-document catalogs used
|
| 145 |
+
* by the parser.
|
| 146 |
+
*/
|
| 147 |
+
XMLPUBFUN void
|
| 148 |
+
xmlCatalogFreeLocal (void *catalogs);
|
| 149 |
+
XMLPUBFUN void *
|
| 150 |
+
xmlCatalogAddLocal (void *catalogs,
|
| 151 |
+
const xmlChar *URL);
|
| 152 |
+
XMLPUBFUN xmlChar *
|
| 153 |
+
xmlCatalogLocalResolve (void *catalogs,
|
| 154 |
+
const xmlChar *pubID,
|
| 155 |
+
const xmlChar *sysID);
|
| 156 |
+
XMLPUBFUN xmlChar *
|
| 157 |
+
xmlCatalogLocalResolveURI(void *catalogs,
|
| 158 |
+
const xmlChar *URI);
|
| 159 |
+
/*
|
| 160 |
+
* Preference settings.
|
| 161 |
+
*/
|
| 162 |
+
XMLPUBFUN int
|
| 163 |
+
xmlCatalogSetDebug (int level);
|
| 164 |
+
XMLPUBFUN xmlCatalogPrefer
|
| 165 |
+
xmlCatalogSetDefaultPrefer(xmlCatalogPrefer prefer);
|
| 166 |
+
XMLPUBFUN void
|
| 167 |
+
xmlCatalogSetDefaults (xmlCatalogAllow allow);
|
| 168 |
+
XMLPUBFUN xmlCatalogAllow
|
| 169 |
+
xmlCatalogGetDefaults (void);
|
| 170 |
+
|
| 171 |
+
|
| 172 |
+
/* DEPRECATED interfaces */
|
| 173 |
+
XMLPUBFUN const xmlChar *
|
| 174 |
+
xmlCatalogGetSystem (const xmlChar *sysID);
|
| 175 |
+
XMLPUBFUN const xmlChar *
|
| 176 |
+
xmlCatalogGetPublic (const xmlChar *pubID);
|
| 177 |
+
|
| 178 |
+
#ifdef __cplusplus
|
| 179 |
+
}
|
| 180 |
+
#endif
|
| 181 |
+
#endif /* LIBXML_CATALOG_ENABLED */
|
| 182 |
+
#endif /* __XML_CATALOG_H__ */
|
pgsql/include/libxml/chvalid.h
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: Unicode character range checking
|
| 3 |
+
* Description: this module exports interfaces for the character
|
| 4 |
+
* range validation APIs
|
| 5 |
+
*
|
| 6 |
+
* This file is automatically generated from the cvs source
|
| 7 |
+
* definition files using the genChRanges.py Python script
|
| 8 |
+
*
|
| 9 |
+
* Generation date: Mon Mar 27 11:09:48 2006
|
| 10 |
+
* Sources: chvalid.def
|
| 11 |
+
* Author: William Brack <wbrack@mmm.com.hk>
|
| 12 |
+
*/
|
| 13 |
+
|
| 14 |
+
#ifndef __XML_CHVALID_H__
|
| 15 |
+
#define __XML_CHVALID_H__
|
| 16 |
+
|
| 17 |
+
#include <libxml/xmlversion.h>
|
| 18 |
+
#include <libxml/xmlstring.h>
|
| 19 |
+
|
| 20 |
+
#ifdef __cplusplus
|
| 21 |
+
extern "C" {
|
| 22 |
+
#endif
|
| 23 |
+
|
| 24 |
+
/*
|
| 25 |
+
* Define our typedefs and structures
|
| 26 |
+
*
|
| 27 |
+
*/
|
| 28 |
+
typedef struct _xmlChSRange xmlChSRange;
|
| 29 |
+
typedef xmlChSRange *xmlChSRangePtr;
|
| 30 |
+
struct _xmlChSRange {
|
| 31 |
+
unsigned short low;
|
| 32 |
+
unsigned short high;
|
| 33 |
+
};
|
| 34 |
+
|
| 35 |
+
typedef struct _xmlChLRange xmlChLRange;
|
| 36 |
+
typedef xmlChLRange *xmlChLRangePtr;
|
| 37 |
+
struct _xmlChLRange {
|
| 38 |
+
unsigned int low;
|
| 39 |
+
unsigned int high;
|
| 40 |
+
};
|
| 41 |
+
|
| 42 |
+
typedef struct _xmlChRangeGroup xmlChRangeGroup;
|
| 43 |
+
typedef xmlChRangeGroup *xmlChRangeGroupPtr;
|
| 44 |
+
struct _xmlChRangeGroup {
|
| 45 |
+
int nbShortRange;
|
| 46 |
+
int nbLongRange;
|
| 47 |
+
const xmlChSRange *shortRange; /* points to an array of ranges */
|
| 48 |
+
const xmlChLRange *longRange;
|
| 49 |
+
};
|
| 50 |
+
|
| 51 |
+
/**
|
| 52 |
+
* Range checking routine
|
| 53 |
+
*/
|
| 54 |
+
XMLPUBFUN int
|
| 55 |
+
xmlCharInRange(unsigned int val, const xmlChRangeGroup *group);
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
/**
|
| 59 |
+
* xmlIsBaseChar_ch:
|
| 60 |
+
* @c: char to validate
|
| 61 |
+
*
|
| 62 |
+
* Automatically generated by genChRanges.py
|
| 63 |
+
*/
|
| 64 |
+
#define xmlIsBaseChar_ch(c) (((0x41 <= (c)) && ((c) <= 0x5a)) || \
|
| 65 |
+
((0x61 <= (c)) && ((c) <= 0x7a)) || \
|
| 66 |
+
((0xc0 <= (c)) && ((c) <= 0xd6)) || \
|
| 67 |
+
((0xd8 <= (c)) && ((c) <= 0xf6)) || \
|
| 68 |
+
(0xf8 <= (c)))
|
| 69 |
+
|
| 70 |
+
/**
|
| 71 |
+
* xmlIsBaseCharQ:
|
| 72 |
+
* @c: char to validate
|
| 73 |
+
*
|
| 74 |
+
* Automatically generated by genChRanges.py
|
| 75 |
+
*/
|
| 76 |
+
#define xmlIsBaseCharQ(c) (((c) < 0x100) ? \
|
| 77 |
+
xmlIsBaseChar_ch((c)) : \
|
| 78 |
+
xmlCharInRange((c), &xmlIsBaseCharGroup))
|
| 79 |
+
|
| 80 |
+
XMLPUBVAR const xmlChRangeGroup xmlIsBaseCharGroup;
|
| 81 |
+
|
| 82 |
+
/**
|
| 83 |
+
* xmlIsBlank_ch:
|
| 84 |
+
* @c: char to validate
|
| 85 |
+
*
|
| 86 |
+
* Automatically generated by genChRanges.py
|
| 87 |
+
*/
|
| 88 |
+
#define xmlIsBlank_ch(c) (((c) == 0x20) || \
|
| 89 |
+
((0x9 <= (c)) && ((c) <= 0xa)) || \
|
| 90 |
+
((c) == 0xd))
|
| 91 |
+
|
| 92 |
+
/**
|
| 93 |
+
* xmlIsBlankQ:
|
| 94 |
+
* @c: char to validate
|
| 95 |
+
*
|
| 96 |
+
* Automatically generated by genChRanges.py
|
| 97 |
+
*/
|
| 98 |
+
#define xmlIsBlankQ(c) (((c) < 0x100) ? \
|
| 99 |
+
xmlIsBlank_ch((c)) : 0)
|
| 100 |
+
|
| 101 |
+
|
| 102 |
+
/**
|
| 103 |
+
* xmlIsChar_ch:
|
| 104 |
+
* @c: char to validate
|
| 105 |
+
*
|
| 106 |
+
* Automatically generated by genChRanges.py
|
| 107 |
+
*/
|
| 108 |
+
#define xmlIsChar_ch(c) (((0x9 <= (c)) && ((c) <= 0xa)) || \
|
| 109 |
+
((c) == 0xd) || \
|
| 110 |
+
(0x20 <= (c)))
|
| 111 |
+
|
| 112 |
+
/**
|
| 113 |
+
* xmlIsCharQ:
|
| 114 |
+
* @c: char to validate
|
| 115 |
+
*
|
| 116 |
+
* Automatically generated by genChRanges.py
|
| 117 |
+
*/
|
| 118 |
+
#define xmlIsCharQ(c) (((c) < 0x100) ? \
|
| 119 |
+
xmlIsChar_ch((c)) :\
|
| 120 |
+
(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
|
| 121 |
+
((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
|
| 122 |
+
((0x10000 <= (c)) && ((c) <= 0x10ffff))))
|
| 123 |
+
|
| 124 |
+
XMLPUBVAR const xmlChRangeGroup xmlIsCharGroup;
|
| 125 |
+
|
| 126 |
+
/**
|
| 127 |
+
* xmlIsCombiningQ:
|
| 128 |
+
* @c: char to validate
|
| 129 |
+
*
|
| 130 |
+
* Automatically generated by genChRanges.py
|
| 131 |
+
*/
|
| 132 |
+
#define xmlIsCombiningQ(c) (((c) < 0x100) ? \
|
| 133 |
+
0 : \
|
| 134 |
+
xmlCharInRange((c), &xmlIsCombiningGroup))
|
| 135 |
+
|
| 136 |
+
XMLPUBVAR const xmlChRangeGroup xmlIsCombiningGroup;
|
| 137 |
+
|
| 138 |
+
/**
|
| 139 |
+
* xmlIsDigit_ch:
|
| 140 |
+
* @c: char to validate
|
| 141 |
+
*
|
| 142 |
+
* Automatically generated by genChRanges.py
|
| 143 |
+
*/
|
| 144 |
+
#define xmlIsDigit_ch(c) (((0x30 <= (c)) && ((c) <= 0x39)))
|
| 145 |
+
|
| 146 |
+
/**
|
| 147 |
+
* xmlIsDigitQ:
|
| 148 |
+
* @c: char to validate
|
| 149 |
+
*
|
| 150 |
+
* Automatically generated by genChRanges.py
|
| 151 |
+
*/
|
| 152 |
+
#define xmlIsDigitQ(c) (((c) < 0x100) ? \
|
| 153 |
+
xmlIsDigit_ch((c)) : \
|
| 154 |
+
xmlCharInRange((c), &xmlIsDigitGroup))
|
| 155 |
+
|
| 156 |
+
XMLPUBVAR const xmlChRangeGroup xmlIsDigitGroup;
|
| 157 |
+
|
| 158 |
+
/**
|
| 159 |
+
* xmlIsExtender_ch:
|
| 160 |
+
* @c: char to validate
|
| 161 |
+
*
|
| 162 |
+
* Automatically generated by genChRanges.py
|
| 163 |
+
*/
|
| 164 |
+
#define xmlIsExtender_ch(c) (((c) == 0xb7))
|
| 165 |
+
|
| 166 |
+
/**
|
| 167 |
+
* xmlIsExtenderQ:
|
| 168 |
+
* @c: char to validate
|
| 169 |
+
*
|
| 170 |
+
* Automatically generated by genChRanges.py
|
| 171 |
+
*/
|
| 172 |
+
#define xmlIsExtenderQ(c) (((c) < 0x100) ? \
|
| 173 |
+
xmlIsExtender_ch((c)) : \
|
| 174 |
+
xmlCharInRange((c), &xmlIsExtenderGroup))
|
| 175 |
+
|
| 176 |
+
XMLPUBVAR const xmlChRangeGroup xmlIsExtenderGroup;
|
| 177 |
+
|
| 178 |
+
/**
|
| 179 |
+
* xmlIsIdeographicQ:
|
| 180 |
+
* @c: char to validate
|
| 181 |
+
*
|
| 182 |
+
* Automatically generated by genChRanges.py
|
| 183 |
+
*/
|
| 184 |
+
#define xmlIsIdeographicQ(c) (((c) < 0x100) ? \
|
| 185 |
+
0 :\
|
| 186 |
+
(((0x4e00 <= (c)) && ((c) <= 0x9fa5)) || \
|
| 187 |
+
((c) == 0x3007) || \
|
| 188 |
+
((0x3021 <= (c)) && ((c) <= 0x3029))))
|
| 189 |
+
|
| 190 |
+
XMLPUBVAR const xmlChRangeGroup xmlIsIdeographicGroup;
|
| 191 |
+
XMLPUBVAR const unsigned char xmlIsPubidChar_tab[256];
|
| 192 |
+
|
| 193 |
+
/**
|
| 194 |
+
* xmlIsPubidChar_ch:
|
| 195 |
+
* @c: char to validate
|
| 196 |
+
*
|
| 197 |
+
* Automatically generated by genChRanges.py
|
| 198 |
+
*/
|
| 199 |
+
#define xmlIsPubidChar_ch(c) (xmlIsPubidChar_tab[(c)])
|
| 200 |
+
|
| 201 |
+
/**
|
| 202 |
+
* xmlIsPubidCharQ:
|
| 203 |
+
* @c: char to validate
|
| 204 |
+
*
|
| 205 |
+
* Automatically generated by genChRanges.py
|
| 206 |
+
*/
|
| 207 |
+
#define xmlIsPubidCharQ(c) (((c) < 0x100) ? \
|
| 208 |
+
xmlIsPubidChar_ch((c)) : 0)
|
| 209 |
+
|
| 210 |
+
XMLPUBFUN int
|
| 211 |
+
xmlIsBaseChar(unsigned int ch);
|
| 212 |
+
XMLPUBFUN int
|
| 213 |
+
xmlIsBlank(unsigned int ch);
|
| 214 |
+
XMLPUBFUN int
|
| 215 |
+
xmlIsChar(unsigned int ch);
|
| 216 |
+
XMLPUBFUN int
|
| 217 |
+
xmlIsCombining(unsigned int ch);
|
| 218 |
+
XMLPUBFUN int
|
| 219 |
+
xmlIsDigit(unsigned int ch);
|
| 220 |
+
XMLPUBFUN int
|
| 221 |
+
xmlIsExtender(unsigned int ch);
|
| 222 |
+
XMLPUBFUN int
|
| 223 |
+
xmlIsIdeographic(unsigned int ch);
|
| 224 |
+
XMLPUBFUN int
|
| 225 |
+
xmlIsPubidChar(unsigned int ch);
|
| 226 |
+
|
| 227 |
+
#ifdef __cplusplus
|
| 228 |
+
}
|
| 229 |
+
#endif
|
| 230 |
+
#endif /* __XML_CHVALID_H__ */
|
pgsql/include/libxml/debugXML.h
ADDED
|
@@ -0,0 +1,217 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: Tree debugging APIs
|
| 3 |
+
* Description: Interfaces to a set of routines used for debugging the tree
|
| 4 |
+
* produced by the XML parser.
|
| 5 |
+
*
|
| 6 |
+
* Copy: See Copyright for the status of this software.
|
| 7 |
+
*
|
| 8 |
+
* Author: Daniel Veillard
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
#ifndef __DEBUG_XML__
|
| 12 |
+
#define __DEBUG_XML__
|
| 13 |
+
#include <stdio.h>
|
| 14 |
+
#include <libxml/xmlversion.h>
|
| 15 |
+
#include <libxml/tree.h>
|
| 16 |
+
|
| 17 |
+
#ifdef LIBXML_DEBUG_ENABLED
|
| 18 |
+
|
| 19 |
+
#include <libxml/xpath.h>
|
| 20 |
+
|
| 21 |
+
#ifdef __cplusplus
|
| 22 |
+
extern "C" {
|
| 23 |
+
#endif
|
| 24 |
+
|
| 25 |
+
/*
|
| 26 |
+
* The standard Dump routines.
|
| 27 |
+
*/
|
| 28 |
+
XMLPUBFUN void
|
| 29 |
+
xmlDebugDumpString (FILE *output,
|
| 30 |
+
const xmlChar *str);
|
| 31 |
+
XMLPUBFUN void
|
| 32 |
+
xmlDebugDumpAttr (FILE *output,
|
| 33 |
+
xmlAttrPtr attr,
|
| 34 |
+
int depth);
|
| 35 |
+
XMLPUBFUN void
|
| 36 |
+
xmlDebugDumpAttrList (FILE *output,
|
| 37 |
+
xmlAttrPtr attr,
|
| 38 |
+
int depth);
|
| 39 |
+
XMLPUBFUN void
|
| 40 |
+
xmlDebugDumpOneNode (FILE *output,
|
| 41 |
+
xmlNodePtr node,
|
| 42 |
+
int depth);
|
| 43 |
+
XMLPUBFUN void
|
| 44 |
+
xmlDebugDumpNode (FILE *output,
|
| 45 |
+
xmlNodePtr node,
|
| 46 |
+
int depth);
|
| 47 |
+
XMLPUBFUN void
|
| 48 |
+
xmlDebugDumpNodeList (FILE *output,
|
| 49 |
+
xmlNodePtr node,
|
| 50 |
+
int depth);
|
| 51 |
+
XMLPUBFUN void
|
| 52 |
+
xmlDebugDumpDocumentHead(FILE *output,
|
| 53 |
+
xmlDocPtr doc);
|
| 54 |
+
XMLPUBFUN void
|
| 55 |
+
xmlDebugDumpDocument (FILE *output,
|
| 56 |
+
xmlDocPtr doc);
|
| 57 |
+
XMLPUBFUN void
|
| 58 |
+
xmlDebugDumpDTD (FILE *output,
|
| 59 |
+
xmlDtdPtr dtd);
|
| 60 |
+
XMLPUBFUN void
|
| 61 |
+
xmlDebugDumpEntities (FILE *output,
|
| 62 |
+
xmlDocPtr doc);
|
| 63 |
+
|
| 64 |
+
/****************************************************************
|
| 65 |
+
* *
|
| 66 |
+
* Checking routines *
|
| 67 |
+
* *
|
| 68 |
+
****************************************************************/
|
| 69 |
+
|
| 70 |
+
XMLPUBFUN int
|
| 71 |
+
xmlDebugCheckDocument (FILE * output,
|
| 72 |
+
xmlDocPtr doc);
|
| 73 |
+
|
| 74 |
+
/****************************************************************
|
| 75 |
+
* *
|
| 76 |
+
* XML shell helpers *
|
| 77 |
+
* *
|
| 78 |
+
****************************************************************/
|
| 79 |
+
|
| 80 |
+
XMLPUBFUN void
|
| 81 |
+
xmlLsOneNode (FILE *output, xmlNodePtr node);
|
| 82 |
+
XMLPUBFUN int
|
| 83 |
+
xmlLsCountNode (xmlNodePtr node);
|
| 84 |
+
|
| 85 |
+
XMLPUBFUN const char *
|
| 86 |
+
xmlBoolToText (int boolval);
|
| 87 |
+
|
| 88 |
+
/****************************************************************
|
| 89 |
+
* *
|
| 90 |
+
* The XML shell related structures and functions *
|
| 91 |
+
* *
|
| 92 |
+
****************************************************************/
|
| 93 |
+
|
| 94 |
+
#ifdef LIBXML_XPATH_ENABLED
|
| 95 |
+
/**
|
| 96 |
+
* xmlShellReadlineFunc:
|
| 97 |
+
* @prompt: a string prompt
|
| 98 |
+
*
|
| 99 |
+
* This is a generic signature for the XML shell input function.
|
| 100 |
+
*
|
| 101 |
+
* Returns a string which will be freed by the Shell.
|
| 102 |
+
*/
|
| 103 |
+
typedef char * (* xmlShellReadlineFunc)(char *prompt);
|
| 104 |
+
|
| 105 |
+
/**
|
| 106 |
+
* xmlShellCtxt:
|
| 107 |
+
*
|
| 108 |
+
* A debugging shell context.
|
| 109 |
+
* TODO: add the defined function tables.
|
| 110 |
+
*/
|
| 111 |
+
typedef struct _xmlShellCtxt xmlShellCtxt;
|
| 112 |
+
typedef xmlShellCtxt *xmlShellCtxtPtr;
|
| 113 |
+
struct _xmlShellCtxt {
|
| 114 |
+
char *filename;
|
| 115 |
+
xmlDocPtr doc;
|
| 116 |
+
xmlNodePtr node;
|
| 117 |
+
xmlXPathContextPtr pctxt;
|
| 118 |
+
int loaded;
|
| 119 |
+
FILE *output;
|
| 120 |
+
xmlShellReadlineFunc input;
|
| 121 |
+
};
|
| 122 |
+
|
| 123 |
+
/**
|
| 124 |
+
* xmlShellCmd:
|
| 125 |
+
* @ctxt: a shell context
|
| 126 |
+
* @arg: a string argument
|
| 127 |
+
* @node: a first node
|
| 128 |
+
* @node2: a second node
|
| 129 |
+
*
|
| 130 |
+
* This is a generic signature for the XML shell functions.
|
| 131 |
+
*
|
| 132 |
+
* Returns an int, negative returns indicating errors.
|
| 133 |
+
*/
|
| 134 |
+
typedef int (* xmlShellCmd) (xmlShellCtxtPtr ctxt,
|
| 135 |
+
char *arg,
|
| 136 |
+
xmlNodePtr node,
|
| 137 |
+
xmlNodePtr node2);
|
| 138 |
+
|
| 139 |
+
XMLPUBFUN void
|
| 140 |
+
xmlShellPrintXPathError (int errorType,
|
| 141 |
+
const char *arg);
|
| 142 |
+
XMLPUBFUN void
|
| 143 |
+
xmlShellPrintXPathResult(xmlXPathObjectPtr list);
|
| 144 |
+
XMLPUBFUN int
|
| 145 |
+
xmlShellList (xmlShellCtxtPtr ctxt,
|
| 146 |
+
char *arg,
|
| 147 |
+
xmlNodePtr node,
|
| 148 |
+
xmlNodePtr node2);
|
| 149 |
+
XMLPUBFUN int
|
| 150 |
+
xmlShellBase (xmlShellCtxtPtr ctxt,
|
| 151 |
+
char *arg,
|
| 152 |
+
xmlNodePtr node,
|
| 153 |
+
xmlNodePtr node2);
|
| 154 |
+
XMLPUBFUN int
|
| 155 |
+
xmlShellDir (xmlShellCtxtPtr ctxt,
|
| 156 |
+
char *arg,
|
| 157 |
+
xmlNodePtr node,
|
| 158 |
+
xmlNodePtr node2);
|
| 159 |
+
XMLPUBFUN int
|
| 160 |
+
xmlShellLoad (xmlShellCtxtPtr ctxt,
|
| 161 |
+
char *filename,
|
| 162 |
+
xmlNodePtr node,
|
| 163 |
+
xmlNodePtr node2);
|
| 164 |
+
#ifdef LIBXML_OUTPUT_ENABLED
|
| 165 |
+
XMLPUBFUN void
|
| 166 |
+
xmlShellPrintNode (xmlNodePtr node);
|
| 167 |
+
XMLPUBFUN int
|
| 168 |
+
xmlShellCat (xmlShellCtxtPtr ctxt,
|
| 169 |
+
char *arg,
|
| 170 |
+
xmlNodePtr node,
|
| 171 |
+
xmlNodePtr node2);
|
| 172 |
+
XMLPUBFUN int
|
| 173 |
+
xmlShellWrite (xmlShellCtxtPtr ctxt,
|
| 174 |
+
char *filename,
|
| 175 |
+
xmlNodePtr node,
|
| 176 |
+
xmlNodePtr node2);
|
| 177 |
+
XMLPUBFUN int
|
| 178 |
+
xmlShellSave (xmlShellCtxtPtr ctxt,
|
| 179 |
+
char *filename,
|
| 180 |
+
xmlNodePtr node,
|
| 181 |
+
xmlNodePtr node2);
|
| 182 |
+
#endif /* LIBXML_OUTPUT_ENABLED */
|
| 183 |
+
#ifdef LIBXML_VALID_ENABLED
|
| 184 |
+
XMLPUBFUN int
|
| 185 |
+
xmlShellValidate (xmlShellCtxtPtr ctxt,
|
| 186 |
+
char *dtd,
|
| 187 |
+
xmlNodePtr node,
|
| 188 |
+
xmlNodePtr node2);
|
| 189 |
+
#endif /* LIBXML_VALID_ENABLED */
|
| 190 |
+
XMLPUBFUN int
|
| 191 |
+
xmlShellDu (xmlShellCtxtPtr ctxt,
|
| 192 |
+
char *arg,
|
| 193 |
+
xmlNodePtr tree,
|
| 194 |
+
xmlNodePtr node2);
|
| 195 |
+
XMLPUBFUN int
|
| 196 |
+
xmlShellPwd (xmlShellCtxtPtr ctxt,
|
| 197 |
+
char *buffer,
|
| 198 |
+
xmlNodePtr node,
|
| 199 |
+
xmlNodePtr node2);
|
| 200 |
+
|
| 201 |
+
/*
|
| 202 |
+
* The Shell interface.
|
| 203 |
+
*/
|
| 204 |
+
XMLPUBFUN void
|
| 205 |
+
xmlShell (xmlDocPtr doc,
|
| 206 |
+
char *filename,
|
| 207 |
+
xmlShellReadlineFunc input,
|
| 208 |
+
FILE *output);
|
| 209 |
+
|
| 210 |
+
#endif /* LIBXML_XPATH_ENABLED */
|
| 211 |
+
|
| 212 |
+
#ifdef __cplusplus
|
| 213 |
+
}
|
| 214 |
+
#endif
|
| 215 |
+
|
| 216 |
+
#endif /* LIBXML_DEBUG_ENABLED */
|
| 217 |
+
#endif /* __DEBUG_XML__ */
|
pgsql/include/libxml/dict.h
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: string dictionary
|
| 3 |
+
* Description: dictionary of reusable strings, just used to avoid allocation
|
| 4 |
+
* and freeing operations.
|
| 5 |
+
*
|
| 6 |
+
* Copy: See Copyright for the status of this software.
|
| 7 |
+
*
|
| 8 |
+
* Author: Daniel Veillard
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
#ifndef __XML_DICT_H__
|
| 12 |
+
#define __XML_DICT_H__
|
| 13 |
+
|
| 14 |
+
#include <stddef.h>
|
| 15 |
+
#include <libxml/xmlversion.h>
|
| 16 |
+
|
| 17 |
+
#ifdef __cplusplus
|
| 18 |
+
extern "C" {
|
| 19 |
+
#endif
|
| 20 |
+
|
| 21 |
+
/*
|
| 22 |
+
* The dictionary.
|
| 23 |
+
*/
|
| 24 |
+
typedef struct _xmlDict xmlDict;
|
| 25 |
+
typedef xmlDict *xmlDictPtr;
|
| 26 |
+
|
| 27 |
+
/*
|
| 28 |
+
* Initializer
|
| 29 |
+
*/
|
| 30 |
+
XML_DEPRECATED
|
| 31 |
+
XMLPUBFUN int xmlInitializeDict(void);
|
| 32 |
+
|
| 33 |
+
/*
|
| 34 |
+
* Constructor and destructor.
|
| 35 |
+
*/
|
| 36 |
+
XMLPUBFUN xmlDictPtr
|
| 37 |
+
xmlDictCreate (void);
|
| 38 |
+
XMLPUBFUN size_t
|
| 39 |
+
xmlDictSetLimit (xmlDictPtr dict,
|
| 40 |
+
size_t limit);
|
| 41 |
+
XMLPUBFUN size_t
|
| 42 |
+
xmlDictGetUsage (xmlDictPtr dict);
|
| 43 |
+
XMLPUBFUN xmlDictPtr
|
| 44 |
+
xmlDictCreateSub(xmlDictPtr sub);
|
| 45 |
+
XMLPUBFUN int
|
| 46 |
+
xmlDictReference(xmlDictPtr dict);
|
| 47 |
+
XMLPUBFUN void
|
| 48 |
+
xmlDictFree (xmlDictPtr dict);
|
| 49 |
+
|
| 50 |
+
/*
|
| 51 |
+
* Lookup of entry in the dictionary.
|
| 52 |
+
*/
|
| 53 |
+
XMLPUBFUN const xmlChar *
|
| 54 |
+
xmlDictLookup (xmlDictPtr dict,
|
| 55 |
+
const xmlChar *name,
|
| 56 |
+
int len);
|
| 57 |
+
XMLPUBFUN const xmlChar *
|
| 58 |
+
xmlDictExists (xmlDictPtr dict,
|
| 59 |
+
const xmlChar *name,
|
| 60 |
+
int len);
|
| 61 |
+
XMLPUBFUN const xmlChar *
|
| 62 |
+
xmlDictQLookup (xmlDictPtr dict,
|
| 63 |
+
const xmlChar *prefix,
|
| 64 |
+
const xmlChar *name);
|
| 65 |
+
XMLPUBFUN int
|
| 66 |
+
xmlDictOwns (xmlDictPtr dict,
|
| 67 |
+
const xmlChar *str);
|
| 68 |
+
XMLPUBFUN int
|
| 69 |
+
xmlDictSize (xmlDictPtr dict);
|
| 70 |
+
|
| 71 |
+
/*
|
| 72 |
+
* Cleanup function
|
| 73 |
+
*/
|
| 74 |
+
XML_DEPRECATED
|
| 75 |
+
XMLPUBFUN void
|
| 76 |
+
xmlDictCleanup (void);
|
| 77 |
+
|
| 78 |
+
#ifdef __cplusplus
|
| 79 |
+
}
|
| 80 |
+
#endif
|
| 81 |
+
#endif /* ! __XML_DICT_H__ */
|
pgsql/include/libxml/encoding.h
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: interface for the encoding conversion functions
|
| 3 |
+
* Description: interface for the encoding conversion functions needed for
|
| 4 |
+
* XML basic encoding and iconv() support.
|
| 5 |
+
*
|
| 6 |
+
* Related specs are
|
| 7 |
+
* rfc2044 (UTF-8 and UTF-16) F. Yergeau Alis Technologies
|
| 8 |
+
* [ISO-10646] UTF-8 and UTF-16 in Annexes
|
| 9 |
+
* [ISO-8859-1] ISO Latin-1 characters codes.
|
| 10 |
+
* [UNICODE] The Unicode Consortium, "The Unicode Standard --
|
| 11 |
+
* Worldwide Character Encoding -- Version 1.0", Addison-
|
| 12 |
+
* Wesley, Volume 1, 1991, Volume 2, 1992. UTF-8 is
|
| 13 |
+
* described in Unicode Technical Report #4.
|
| 14 |
+
* [US-ASCII] Coded Character Set--7-bit American Standard Code for
|
| 15 |
+
* Information Interchange, ANSI X3.4-1986.
|
| 16 |
+
*
|
| 17 |
+
* Copy: See Copyright for the status of this software.
|
| 18 |
+
*
|
| 19 |
+
* Author: Daniel Veillard
|
| 20 |
+
*/
|
| 21 |
+
|
| 22 |
+
#ifndef __XML_CHAR_ENCODING_H__
|
| 23 |
+
#define __XML_CHAR_ENCODING_H__
|
| 24 |
+
|
| 25 |
+
#include <libxml/xmlversion.h>
|
| 26 |
+
|
| 27 |
+
#ifdef LIBXML_ICONV_ENABLED
|
| 28 |
+
#include <iconv.h>
|
| 29 |
+
#endif
|
| 30 |
+
|
| 31 |
+
#ifdef __cplusplus
|
| 32 |
+
extern "C" {
|
| 33 |
+
#endif
|
| 34 |
+
|
| 35 |
+
/*
|
| 36 |
+
* xmlCharEncoding:
|
| 37 |
+
*
|
| 38 |
+
* Predefined values for some standard encodings.
|
| 39 |
+
* Libxml does not do beforehand translation on UTF8 and ISOLatinX.
|
| 40 |
+
* It also supports ASCII, ISO-8859-1, and UTF16 (LE and BE) by default.
|
| 41 |
+
*
|
| 42 |
+
* Anything else would have to be translated to UTF8 before being
|
| 43 |
+
* given to the parser itself. The BOM for UTF16 and the encoding
|
| 44 |
+
* declaration are looked at and a converter is looked for at that
|
| 45 |
+
* point. If not found the parser stops here as asked by the XML REC. A
|
| 46 |
+
* converter can be registered by the user using xmlRegisterCharEncodingHandler
|
| 47 |
+
* but the current form doesn't allow stateful transcoding (a serious
|
| 48 |
+
* problem agreed !). If iconv has been found it will be used
|
| 49 |
+
* automatically and allow stateful transcoding, the simplest is then
|
| 50 |
+
* to be sure to enable iconv and to provide iconv libs for the encoding
|
| 51 |
+
* support needed.
|
| 52 |
+
*
|
| 53 |
+
* Note that the generic "UTF-16" is not a predefined value. Instead, only
|
| 54 |
+
* the specific UTF-16LE and UTF-16BE are present.
|
| 55 |
+
*/
|
| 56 |
+
typedef enum {
|
| 57 |
+
XML_CHAR_ENCODING_ERROR= -1, /* No char encoding detected */
|
| 58 |
+
XML_CHAR_ENCODING_NONE= 0, /* No char encoding detected */
|
| 59 |
+
XML_CHAR_ENCODING_UTF8= 1, /* UTF-8 */
|
| 60 |
+
XML_CHAR_ENCODING_UTF16LE= 2, /* UTF-16 little endian */
|
| 61 |
+
XML_CHAR_ENCODING_UTF16BE= 3, /* UTF-16 big endian */
|
| 62 |
+
XML_CHAR_ENCODING_UCS4LE= 4, /* UCS-4 little endian */
|
| 63 |
+
XML_CHAR_ENCODING_UCS4BE= 5, /* UCS-4 big endian */
|
| 64 |
+
XML_CHAR_ENCODING_EBCDIC= 6, /* EBCDIC uh! */
|
| 65 |
+
XML_CHAR_ENCODING_UCS4_2143=7, /* UCS-4 unusual ordering */
|
| 66 |
+
XML_CHAR_ENCODING_UCS4_3412=8, /* UCS-4 unusual ordering */
|
| 67 |
+
XML_CHAR_ENCODING_UCS2= 9, /* UCS-2 */
|
| 68 |
+
XML_CHAR_ENCODING_8859_1= 10,/* ISO-8859-1 ISO Latin 1 */
|
| 69 |
+
XML_CHAR_ENCODING_8859_2= 11,/* ISO-8859-2 ISO Latin 2 */
|
| 70 |
+
XML_CHAR_ENCODING_8859_3= 12,/* ISO-8859-3 */
|
| 71 |
+
XML_CHAR_ENCODING_8859_4= 13,/* ISO-8859-4 */
|
| 72 |
+
XML_CHAR_ENCODING_8859_5= 14,/* ISO-8859-5 */
|
| 73 |
+
XML_CHAR_ENCODING_8859_6= 15,/* ISO-8859-6 */
|
| 74 |
+
XML_CHAR_ENCODING_8859_7= 16,/* ISO-8859-7 */
|
| 75 |
+
XML_CHAR_ENCODING_8859_8= 17,/* ISO-8859-8 */
|
| 76 |
+
XML_CHAR_ENCODING_8859_9= 18,/* ISO-8859-9 */
|
| 77 |
+
XML_CHAR_ENCODING_2022_JP= 19,/* ISO-2022-JP */
|
| 78 |
+
XML_CHAR_ENCODING_SHIFT_JIS=20,/* Shift_JIS */
|
| 79 |
+
XML_CHAR_ENCODING_EUC_JP= 21,/* EUC-JP */
|
| 80 |
+
XML_CHAR_ENCODING_ASCII= 22 /* pure ASCII */
|
| 81 |
+
} xmlCharEncoding;
|
| 82 |
+
|
| 83 |
+
/**
|
| 84 |
+
* xmlCharEncodingInputFunc:
|
| 85 |
+
* @out: a pointer to an array of bytes to store the UTF-8 result
|
| 86 |
+
* @outlen: the length of @out
|
| 87 |
+
* @in: a pointer to an array of chars in the original encoding
|
| 88 |
+
* @inlen: the length of @in
|
| 89 |
+
*
|
| 90 |
+
* Take a block of chars in the original encoding and try to convert
|
| 91 |
+
* it to an UTF-8 block of chars out.
|
| 92 |
+
*
|
| 93 |
+
* Returns the number of bytes written, -1 if lack of space, or -2
|
| 94 |
+
* if the transcoding failed.
|
| 95 |
+
* The value of @inlen after return is the number of octets consumed
|
| 96 |
+
* if the return value is positive, else unpredictiable.
|
| 97 |
+
* The value of @outlen after return is the number of octets consumed.
|
| 98 |
+
*/
|
| 99 |
+
typedef int (* xmlCharEncodingInputFunc)(unsigned char *out, int *outlen,
|
| 100 |
+
const unsigned char *in, int *inlen);
|
| 101 |
+
|
| 102 |
+
|
| 103 |
+
/**
|
| 104 |
+
* xmlCharEncodingOutputFunc:
|
| 105 |
+
* @out: a pointer to an array of bytes to store the result
|
| 106 |
+
* @outlen: the length of @out
|
| 107 |
+
* @in: a pointer to an array of UTF-8 chars
|
| 108 |
+
* @inlen: the length of @in
|
| 109 |
+
*
|
| 110 |
+
* Take a block of UTF-8 chars in and try to convert it to another
|
| 111 |
+
* encoding.
|
| 112 |
+
* Note: a first call designed to produce heading info is called with
|
| 113 |
+
* in = NULL. If stateful this should also initialize the encoder state.
|
| 114 |
+
*
|
| 115 |
+
* Returns the number of bytes written, -1 if lack of space, or -2
|
| 116 |
+
* if the transcoding failed.
|
| 117 |
+
* The value of @inlen after return is the number of octets consumed
|
| 118 |
+
* if the return value is positive, else unpredictiable.
|
| 119 |
+
* The value of @outlen after return is the number of octets produced.
|
| 120 |
+
*/
|
| 121 |
+
typedef int (* xmlCharEncodingOutputFunc)(unsigned char *out, int *outlen,
|
| 122 |
+
const unsigned char *in, int *inlen);
|
| 123 |
+
|
| 124 |
+
|
| 125 |
+
/*
|
| 126 |
+
* Block defining the handlers for non UTF-8 encodings.
|
| 127 |
+
* If iconv is supported, there are two extra fields.
|
| 128 |
+
*/
|
| 129 |
+
typedef struct _xmlCharEncodingHandler xmlCharEncodingHandler;
|
| 130 |
+
typedef xmlCharEncodingHandler *xmlCharEncodingHandlerPtr;
|
| 131 |
+
struct _xmlCharEncodingHandler {
|
| 132 |
+
char *name;
|
| 133 |
+
xmlCharEncodingInputFunc input;
|
| 134 |
+
xmlCharEncodingOutputFunc output;
|
| 135 |
+
#ifdef LIBXML_ICONV_ENABLED
|
| 136 |
+
iconv_t iconv_in;
|
| 137 |
+
iconv_t iconv_out;
|
| 138 |
+
#endif /* LIBXML_ICONV_ENABLED */
|
| 139 |
+
#ifdef LIBXML_ICU_ENABLED
|
| 140 |
+
struct _uconv_t *uconv_in;
|
| 141 |
+
struct _uconv_t *uconv_out;
|
| 142 |
+
#endif /* LIBXML_ICU_ENABLED */
|
| 143 |
+
};
|
| 144 |
+
|
| 145 |
+
#ifdef __cplusplus
|
| 146 |
+
}
|
| 147 |
+
#endif
|
| 148 |
+
#include <libxml/tree.h>
|
| 149 |
+
#ifdef __cplusplus
|
| 150 |
+
extern "C" {
|
| 151 |
+
#endif
|
| 152 |
+
|
| 153 |
+
/*
|
| 154 |
+
* Interfaces for encoding handlers.
|
| 155 |
+
*/
|
| 156 |
+
XML_DEPRECATED
|
| 157 |
+
XMLPUBFUN void
|
| 158 |
+
xmlInitCharEncodingHandlers (void);
|
| 159 |
+
XML_DEPRECATED
|
| 160 |
+
XMLPUBFUN void
|
| 161 |
+
xmlCleanupCharEncodingHandlers (void);
|
| 162 |
+
XMLPUBFUN void
|
| 163 |
+
xmlRegisterCharEncodingHandler (xmlCharEncodingHandlerPtr handler);
|
| 164 |
+
XMLPUBFUN xmlCharEncodingHandlerPtr
|
| 165 |
+
xmlGetCharEncodingHandler (xmlCharEncoding enc);
|
| 166 |
+
XMLPUBFUN xmlCharEncodingHandlerPtr
|
| 167 |
+
xmlFindCharEncodingHandler (const char *name);
|
| 168 |
+
XMLPUBFUN xmlCharEncodingHandlerPtr
|
| 169 |
+
xmlNewCharEncodingHandler (const char *name,
|
| 170 |
+
xmlCharEncodingInputFunc input,
|
| 171 |
+
xmlCharEncodingOutputFunc output);
|
| 172 |
+
|
| 173 |
+
/*
|
| 174 |
+
* Interfaces for encoding names and aliases.
|
| 175 |
+
*/
|
| 176 |
+
XMLPUBFUN int
|
| 177 |
+
xmlAddEncodingAlias (const char *name,
|
| 178 |
+
const char *alias);
|
| 179 |
+
XMLPUBFUN int
|
| 180 |
+
xmlDelEncodingAlias (const char *alias);
|
| 181 |
+
XMLPUBFUN const char *
|
| 182 |
+
xmlGetEncodingAlias (const char *alias);
|
| 183 |
+
XMLPUBFUN void
|
| 184 |
+
xmlCleanupEncodingAliases (void);
|
| 185 |
+
XMLPUBFUN xmlCharEncoding
|
| 186 |
+
xmlParseCharEncoding (const char *name);
|
| 187 |
+
XMLPUBFUN const char *
|
| 188 |
+
xmlGetCharEncodingName (xmlCharEncoding enc);
|
| 189 |
+
|
| 190 |
+
/*
|
| 191 |
+
* Interfaces directly used by the parsers.
|
| 192 |
+
*/
|
| 193 |
+
XMLPUBFUN xmlCharEncoding
|
| 194 |
+
xmlDetectCharEncoding (const unsigned char *in,
|
| 195 |
+
int len);
|
| 196 |
+
|
| 197 |
+
XMLPUBFUN int
|
| 198 |
+
xmlCharEncOutFunc (xmlCharEncodingHandler *handler,
|
| 199 |
+
xmlBufferPtr out,
|
| 200 |
+
xmlBufferPtr in);
|
| 201 |
+
|
| 202 |
+
XMLPUBFUN int
|
| 203 |
+
xmlCharEncInFunc (xmlCharEncodingHandler *handler,
|
| 204 |
+
xmlBufferPtr out,
|
| 205 |
+
xmlBufferPtr in);
|
| 206 |
+
XML_DEPRECATED
|
| 207 |
+
XMLPUBFUN int
|
| 208 |
+
xmlCharEncFirstLine (xmlCharEncodingHandler *handler,
|
| 209 |
+
xmlBufferPtr out,
|
| 210 |
+
xmlBufferPtr in);
|
| 211 |
+
XMLPUBFUN int
|
| 212 |
+
xmlCharEncCloseFunc (xmlCharEncodingHandler *handler);
|
| 213 |
+
|
| 214 |
+
/*
|
| 215 |
+
* Export a few useful functions
|
| 216 |
+
*/
|
| 217 |
+
#ifdef LIBXML_OUTPUT_ENABLED
|
| 218 |
+
XMLPUBFUN int
|
| 219 |
+
UTF8Toisolat1 (unsigned char *out,
|
| 220 |
+
int *outlen,
|
| 221 |
+
const unsigned char *in,
|
| 222 |
+
int *inlen);
|
| 223 |
+
#endif /* LIBXML_OUTPUT_ENABLED */
|
| 224 |
+
XMLPUBFUN int
|
| 225 |
+
isolat1ToUTF8 (unsigned char *out,
|
| 226 |
+
int *outlen,
|
| 227 |
+
const unsigned char *in,
|
| 228 |
+
int *inlen);
|
| 229 |
+
#ifdef __cplusplus
|
| 230 |
+
}
|
| 231 |
+
#endif
|
| 232 |
+
|
| 233 |
+
#endif /* __XML_CHAR_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ity API needed
|
| 4 |
+
* for the parser and applications.
|
| 5 |
+
*
|
| 6 |
+
* Copy: See Copyright for the status of this software.
|
| 7 |
+
*
|
| 8 |
+
* Author: Daniel Veillard
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
#ifndef __XML_ENTITIES_H__
|
| 12 |
+
#define __XML_ENTITIES_H__
|
| 13 |
+
|
| 14 |
+
#include <libxml/xmlversion.h>
|
| 15 |
+
#include <libxml/tree.h>
|
| 16 |
+
|
| 17 |
+
#ifdef __cplusplus
|
| 18 |
+
extern "C" {
|
| 19 |
+
#endif
|
| 20 |
+
|
| 21 |
+
/*
|
| 22 |
+
* The different valid entity types.
|
| 23 |
+
*/
|
| 24 |
+
typedef enum {
|
| 25 |
+
XML_INTERNAL_GENERAL_ENTITY = 1,
|
| 26 |
+
XML_EXTERNAL_GENERAL_PARSED_ENTITY = 2,
|
| 27 |
+
XML_EXTERNAL_GENERAL_UNPARSED_ENTITY = 3,
|
| 28 |
+
XML_INTERNAL_PARAMETER_ENTITY = 4,
|
| 29 |
+
XML_EXTERNAL_PARAMETER_ENTITY = 5,
|
| 30 |
+
XML_INTERNAL_PREDEFINED_ENTITY = 6
|
| 31 |
+
} xmlEntityType;
|
| 32 |
+
|
| 33 |
+
/*
|
| 34 |
+
* An unit of storage for an entity, contains the string, the value
|
| 35 |
+
* and the linkind data needed for the linking in the hash table.
|
| 36 |
+
*/
|
| 37 |
+
|
| 38 |
+
struct _xmlEntity {
|
| 39 |
+
void *_private; /* application data */
|
| 40 |
+
xmlElementType type; /* XML_ENTITY_DECL, must be second ! */
|
| 41 |
+
const xmlChar *name; /* Entity name */
|
| 42 |
+
struct _xmlNode *children; /* First child link */
|
| 43 |
+
struct _xmlNode *last; /* Last child link */
|
| 44 |
+
struct _xmlDtd *parent; /* -> DTD */
|
| 45 |
+
struct _xmlNode *next; /* next sibling link */
|
| 46 |
+
struct _xmlNode *prev; /* previous sibling link */
|
| 47 |
+
struct _xmlDoc *doc; /* the containing document */
|
| 48 |
+
|
| 49 |
+
xmlChar *orig; /* content without ref substitution */
|
| 50 |
+
xmlChar *content; /* content or ndata if unparsed */
|
| 51 |
+
int length; /* the content length */
|
| 52 |
+
xmlEntityType etype; /* The entity type */
|
| 53 |
+
const xmlChar *ExternalID; /* External identifier for PUBLIC */
|
| 54 |
+
const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC Entity */
|
| 55 |
+
|
| 56 |
+
struct _xmlEntity *nexte; /* unused */
|
| 57 |
+
const xmlChar *URI; /* the full URI as computed */
|
| 58 |
+
int owner; /* does the entity own the childrens */
|
| 59 |
+
int flags; /* various flags */
|
| 60 |
+
unsigned long expandedSize; /* expanded size */
|
| 61 |
+
};
|
| 62 |
+
|
| 63 |
+
/*
|
| 64 |
+
* All entities are stored in an hash table.
|
| 65 |
+
* There is 2 separate hash tables for global and parameter entities.
|
| 66 |
+
*/
|
| 67 |
+
|
| 68 |
+
typedef struct _xmlHashTable xmlEntitiesTable;
|
| 69 |
+
typedef xmlEntitiesTable *xmlEntitiesTablePtr;
|
| 70 |
+
|
| 71 |
+
/*
|
| 72 |
+
* External functions:
|
| 73 |
+
*/
|
| 74 |
+
|
| 75 |
+
#ifdef LIBXML_LEGACY_ENABLED
|
| 76 |
+
XML_DEPRECATED
|
| 77 |
+
XMLPUBFUN void
|
| 78 |
+
xmlInitializePredefinedEntities (void);
|
| 79 |
+
#endif /* LIBXML_LEGACY_ENABLED */
|
| 80 |
+
|
| 81 |
+
XMLPUBFUN xmlEntityPtr
|
| 82 |
+
xmlNewEntity (xmlDocPtr doc,
|
| 83 |
+
const xmlChar *name,
|
| 84 |
+
int type,
|
| 85 |
+
const xmlChar *ExternalID,
|
| 86 |
+
const xmlChar *SystemID,
|
| 87 |
+
const xmlChar *content);
|
| 88 |
+
XMLPUBFUN xmlEntityPtr
|
| 89 |
+
xmlAddDocEntity (xmlDocPtr doc,
|
| 90 |
+
const xmlChar *name,
|
| 91 |
+
int type,
|
| 92 |
+
const xmlChar *ExternalID,
|
| 93 |
+
const xmlChar *SystemID,
|
| 94 |
+
const xmlChar *content);
|
| 95 |
+
XMLPUBFUN xmlEntityPtr
|
| 96 |
+
xmlAddDtdEntity (xmlDocPtr doc,
|
| 97 |
+
const xmlChar *name,
|
| 98 |
+
int type,
|
| 99 |
+
const xmlChar *ExternalID,
|
| 100 |
+
const xmlChar *SystemID,
|
| 101 |
+
const xmlChar *content);
|
| 102 |
+
XMLPUBFUN xmlEntityPtr
|
| 103 |
+
xmlGetPredefinedEntity (const xmlChar *name);
|
| 104 |
+
XMLPUBFUN xmlEntityPtr
|
| 105 |
+
xmlGetDocEntity (const xmlDoc *doc,
|
| 106 |
+
const xmlChar *name);
|
| 107 |
+
XMLPUBFUN xmlEntityPtr
|
| 108 |
+
xmlGetDtdEntity (xmlDocPtr doc,
|
| 109 |
+
const xmlChar *name);
|
| 110 |
+
XMLPUBFUN xmlEntityPtr
|
| 111 |
+
xmlGetParameterEntity (xmlDocPtr doc,
|
| 112 |
+
const xmlChar *name);
|
| 113 |
+
#ifdef LIBXML_LEGACY_ENABLED
|
| 114 |
+
XML_DEPRECATED
|
| 115 |
+
XMLPUBFUN const xmlChar *
|
| 116 |
+
xmlEncodeEntities (xmlDocPtr doc,
|
| 117 |
+
const xmlChar *input);
|
| 118 |
+
#endif /* LIBXML_LEGACY_ENABLED */
|
| 119 |
+
XMLPUBFUN xmlChar *
|
| 120 |
+
xmlEncodeEntitiesReentrant(xmlDocPtr doc,
|
| 121 |
+
const xmlChar *input);
|
| 122 |
+
XMLPUBFUN xmlChar *
|
| 123 |
+
xmlEncodeSpecialChars (const xmlDoc *doc,
|
| 124 |
+
const xmlChar *input);
|
| 125 |
+
XMLPUBFUN xmlEntitiesTablePtr
|
| 126 |
+
xmlCreateEntitiesTable (void);
|
| 127 |
+
#ifdef LIBXML_TREE_ENABLED
|
| 128 |
+
XMLPUBFUN xmlEntitiesTablePtr
|
| 129 |
+
xmlCopyEntitiesTable (xmlEntitiesTablePtr table);
|
| 130 |
+
#endif /* LIBXML_TREE_ENABLED */
|
| 131 |
+
XMLPUBFUN void
|
| 132 |
+
xmlFreeEntitiesTable (xmlEntitiesTablePtr table);
|
| 133 |
+
#ifdef LIBXML_OUTPUT_ENABLED
|
| 134 |
+
XMLPUBFUN void
|
| 135 |
+
xmlDumpEntitiesTable (xmlBufferPtr buf,
|
| 136 |
+
xmlEntitiesTablePtr table);
|
| 137 |
+
XMLPUBFUN void
|
| 138 |
+
xmlDumpEntityDecl (xmlBufferPtr buf,
|
| 139 |
+
xmlEntityPtr ent);
|
| 140 |
+
#endif /* LIBXML_OUTPUT_ENABLED */
|
| 141 |
+
#ifdef LIBXML_LEGACY_ENABLED
|
| 142 |
+
XMLPUBFUN void
|
| 143 |
+
xmlCleanupPredefinedEntities(void);
|
| 144 |
+
#endif /* LIBXML_LEGACY_ENABLED */
|
| 145 |
+
|
| 146 |
+
|
| 147 |
+
#ifdef __cplusplus
|
| 148 |
+
}
|
| 149 |
+
#endif
|
| 150 |
+
|
| 151 |
+
# endif /* __XML_ENTITIES_H__ */
|
pgsql/include/libxml/globals.h
ADDED
|
@@ -0,0 +1,529 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: interface for all global variables of the library
|
| 3 |
+
* Description: all the global variables and thread handling for
|
| 4 |
+
* those variables is handled by this module.
|
| 5 |
+
*
|
| 6 |
+
* The bottom of this file is automatically generated by build_glob.py
|
| 7 |
+
* based on the description file global.data
|
| 8 |
+
*
|
| 9 |
+
* Copy: See Copyright for the status of this software.
|
| 10 |
+
*
|
| 11 |
+
* Author: Gary Pennington <Gary.Pennington@uk.sun.com>, Daniel Veillard
|
| 12 |
+
*/
|
| 13 |
+
|
| 14 |
+
#ifndef __XML_GLOBALS_H
|
| 15 |
+
#define __XML_GLOBALS_H
|
| 16 |
+
|
| 17 |
+
#include <libxml/xmlversion.h>
|
| 18 |
+
#include <libxml/parser.h>
|
| 19 |
+
#include <libxml/xmlerror.h>
|
| 20 |
+
#include <libxml/SAX2.h>
|
| 21 |
+
#include <libxml/xmlmemory.h>
|
| 22 |
+
|
| 23 |
+
#ifdef __cplusplus
|
| 24 |
+
extern "C" {
|
| 25 |
+
#endif
|
| 26 |
+
|
| 27 |
+
XML_DEPRECATED
|
| 28 |
+
XMLPUBFUN void xmlInitGlobals(void);
|
| 29 |
+
XML_DEPRECATED
|
| 30 |
+
XMLPUBFUN void xmlCleanupGlobals(void);
|
| 31 |
+
|
| 32 |
+
/**
|
| 33 |
+
* xmlParserInputBufferCreateFilenameFunc:
|
| 34 |
+
* @URI: the URI to read from
|
| 35 |
+
* @enc: the requested source encoding
|
| 36 |
+
*
|
| 37 |
+
* Signature for the function doing the lookup for a suitable input method
|
| 38 |
+
* corresponding to an URI.
|
| 39 |
+
*
|
| 40 |
+
* Returns the new xmlParserInputBufferPtr in case of success or NULL if no
|
| 41 |
+
* method was found.
|
| 42 |
+
*/
|
| 43 |
+
typedef xmlParserInputBufferPtr (*xmlParserInputBufferCreateFilenameFunc) (const char *URI,
|
| 44 |
+
xmlCharEncoding enc);
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
/**
|
| 48 |
+
* xmlOutputBufferCreateFilenameFunc:
|
| 49 |
+
* @URI: the URI to write to
|
| 50 |
+
* @enc: the requested target encoding
|
| 51 |
+
*
|
| 52 |
+
* Signature for the function doing the lookup for a suitable output method
|
| 53 |
+
* corresponding to an URI.
|
| 54 |
+
*
|
| 55 |
+
* Returns the new xmlOutputBufferPtr in case of success or NULL if no
|
| 56 |
+
* method was found.
|
| 57 |
+
*/
|
| 58 |
+
typedef xmlOutputBufferPtr (*xmlOutputBufferCreateFilenameFunc) (const char *URI,
|
| 59 |
+
xmlCharEncodingHandlerPtr encoder,
|
| 60 |
+
int compression);
|
| 61 |
+
|
| 62 |
+
XMLPUBFUN xmlParserInputBufferCreateFilenameFunc
|
| 63 |
+
xmlParserInputBufferCreateFilenameDefault (xmlParserInputBufferCreateFilenameFunc func);
|
| 64 |
+
XMLPUBFUN xmlOutputBufferCreateFilenameFunc
|
| 65 |
+
xmlOutputBufferCreateFilenameDefault (xmlOutputBufferCreateFilenameFunc func);
|
| 66 |
+
|
| 67 |
+
/*
|
| 68 |
+
* Externally global symbols which need to be protected for backwards
|
| 69 |
+
* compatibility support.
|
| 70 |
+
*/
|
| 71 |
+
|
| 72 |
+
#undef htmlDefaultSAXHandler
|
| 73 |
+
#undef oldXMLWDcompatibility
|
| 74 |
+
#undef xmlBufferAllocScheme
|
| 75 |
+
#undef xmlDefaultBufferSize
|
| 76 |
+
#undef xmlDefaultSAXHandler
|
| 77 |
+
#undef xmlDefaultSAXLocator
|
| 78 |
+
#undef xmlDoValidityCheckingDefaultValue
|
| 79 |
+
#undef xmlFree
|
| 80 |
+
#undef xmlGenericError
|
| 81 |
+
#undef xmlStructuredError
|
| 82 |
+
#undef xmlGenericErrorContext
|
| 83 |
+
#undef xmlStructuredErrorContext
|
| 84 |
+
#undef xmlGetWarningsDefaultValue
|
| 85 |
+
#undef xmlIndentTreeOutput
|
| 86 |
+
#undef xmlTreeIndentString
|
| 87 |
+
#undef xmlKeepBlanksDefaultValue
|
| 88 |
+
#undef xmlLineNumbersDefaultValue
|
| 89 |
+
#undef xmlLoadExtDtdDefaultValue
|
| 90 |
+
#undef xmlMalloc
|
| 91 |
+
#undef xmlMallocAtomic
|
| 92 |
+
#undef xmlMemStrdup
|
| 93 |
+
#undef xmlParserDebugEntities
|
| 94 |
+
#undef xmlParserVersion
|
| 95 |
+
#undef xmlPedanticParserDefaultValue
|
| 96 |
+
#undef xmlRealloc
|
| 97 |
+
#undef xmlSaveNoEmptyTags
|
| 98 |
+
#undef xmlSubstituteEntitiesDefaultValue
|
| 99 |
+
#undef xmlRegisterNodeDefaultValue
|
| 100 |
+
#undef xmlDeregisterNodeDefaultValue
|
| 101 |
+
#undef xmlLastError
|
| 102 |
+
#undef xmlParserInputBufferCreateFilenameValue
|
| 103 |
+
#undef xmlOutputBufferCreateFilenameValue
|
| 104 |
+
|
| 105 |
+
/**
|
| 106 |
+
* xmlRegisterNodeFunc:
|
| 107 |
+
* @node: the current node
|
| 108 |
+
*
|
| 109 |
+
* Signature for the registration callback of a created node
|
| 110 |
+
*/
|
| 111 |
+
typedef void (*xmlRegisterNodeFunc) (xmlNodePtr node);
|
| 112 |
+
/**
|
| 113 |
+
* xmlDeregisterNodeFunc:
|
| 114 |
+
* @node: the current node
|
| 115 |
+
*
|
| 116 |
+
* Signature for the deregistration callback of a discarded node
|
| 117 |
+
*/
|
| 118 |
+
typedef void (*xmlDeregisterNodeFunc) (xmlNodePtr node);
|
| 119 |
+
|
| 120 |
+
typedef struct _xmlGlobalState xmlGlobalState;
|
| 121 |
+
typedef xmlGlobalState *xmlGlobalStatePtr;
|
| 122 |
+
struct _xmlGlobalState
|
| 123 |
+
{
|
| 124 |
+
const char *xmlParserVersion;
|
| 125 |
+
|
| 126 |
+
xmlSAXLocator xmlDefaultSAXLocator;
|
| 127 |
+
xmlSAXHandlerV1 xmlDefaultSAXHandler;
|
| 128 |
+
xmlSAXHandlerV1 docbDefaultSAXHandler; /* unused */
|
| 129 |
+
xmlSAXHandlerV1 htmlDefaultSAXHandler;
|
| 130 |
+
|
| 131 |
+
xmlFreeFunc xmlFree;
|
| 132 |
+
xmlMallocFunc xmlMalloc;
|
| 133 |
+
xmlStrdupFunc xmlMemStrdup;
|
| 134 |
+
xmlReallocFunc xmlRealloc;
|
| 135 |
+
|
| 136 |
+
xmlGenericErrorFunc xmlGenericError;
|
| 137 |
+
xmlStructuredErrorFunc xmlStructuredError;
|
| 138 |
+
void *xmlGenericErrorContext;
|
| 139 |
+
|
| 140 |
+
int oldXMLWDcompatibility;
|
| 141 |
+
|
| 142 |
+
xmlBufferAllocationScheme xmlBufferAllocScheme;
|
| 143 |
+
int xmlDefaultBufferSize;
|
| 144 |
+
|
| 145 |
+
int xmlSubstituteEntitiesDefaultValue;
|
| 146 |
+
int xmlDoValidityCheckingDefaultValue;
|
| 147 |
+
int xmlGetWarningsDefaultValue;
|
| 148 |
+
int xmlKeepBlanksDefaultValue;
|
| 149 |
+
int xmlLineNumbersDefaultValue;
|
| 150 |
+
int xmlLoadExtDtdDefaultValue;
|
| 151 |
+
int xmlParserDebugEntities;
|
| 152 |
+
int xmlPedanticParserDefaultValue;
|
| 153 |
+
|
| 154 |
+
int xmlSaveNoEmptyTags;
|
| 155 |
+
int xmlIndentTreeOutput;
|
| 156 |
+
const char *xmlTreeIndentString;
|
| 157 |
+
|
| 158 |
+
xmlRegisterNodeFunc xmlRegisterNodeDefaultValue;
|
| 159 |
+
xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue;
|
| 160 |
+
|
| 161 |
+
xmlMallocFunc xmlMallocAtomic;
|
| 162 |
+
xmlError xmlLastError;
|
| 163 |
+
|
| 164 |
+
xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue;
|
| 165 |
+
xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue;
|
| 166 |
+
|
| 167 |
+
void *xmlStructuredErrorContext;
|
| 168 |
+
};
|
| 169 |
+
|
| 170 |
+
#ifdef __cplusplus
|
| 171 |
+
}
|
| 172 |
+
#endif
|
| 173 |
+
#include <libxml/threads.h>
|
| 174 |
+
#ifdef __cplusplus
|
| 175 |
+
extern "C" {
|
| 176 |
+
#endif
|
| 177 |
+
|
| 178 |
+
XMLPUBFUN void xmlInitializeGlobalState(xmlGlobalStatePtr gs);
|
| 179 |
+
|
| 180 |
+
XMLPUBFUN void xmlThrDefSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler);
|
| 181 |
+
|
| 182 |
+
XMLPUBFUN void xmlThrDefSetStructuredErrorFunc(void *ctx, xmlStructuredErrorFunc handler);
|
| 183 |
+
|
| 184 |
+
XMLPUBFUN xmlRegisterNodeFunc xmlRegisterNodeDefault(xmlRegisterNodeFunc func);
|
| 185 |
+
XMLPUBFUN xmlRegisterNodeFunc xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func);
|
| 186 |
+
XMLPUBFUN xmlDeregisterNodeFunc xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func);
|
| 187 |
+
XMLPUBFUN xmlDeregisterNodeFunc xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func);
|
| 188 |
+
|
| 189 |
+
XMLPUBFUN xmlOutputBufferCreateFilenameFunc
|
| 190 |
+
xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func);
|
| 191 |
+
XMLPUBFUN xmlParserInputBufferCreateFilenameFunc
|
| 192 |
+
xmlThrDefParserInputBufferCreateFilenameDefault(
|
| 193 |
+
xmlParserInputBufferCreateFilenameFunc func);
|
| 194 |
+
|
| 195 |
+
/*
|
| 196 |
+
* In general the memory allocation entry points are not kept
|
| 197 |
+
* thread specific but this can be overridden by LIBXML_THREAD_ALLOC_ENABLED
|
| 198 |
+
* - xmlMalloc
|
| 199 |
+
* - xmlMallocAtomic
|
| 200 |
+
* - xmlRealloc
|
| 201 |
+
* - xmlMemStrdup
|
| 202 |
+
* - xmlFree
|
| 203 |
+
*/
|
| 204 |
+
|
| 205 |
+
#ifdef LIBXML_THREAD_ALLOC_ENABLED
|
| 206 |
+
/** DOC_DISABLE */
|
| 207 |
+
|
| 208 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 209 |
+
XMLPUBFUN xmlMallocFunc * __xmlMalloc(void);
|
| 210 |
+
#define xmlMalloc \
|
| 211 |
+
(*(__xmlMalloc()))
|
| 212 |
+
#else
|
| 213 |
+
XMLPUBVAR xmlMallocFunc xmlMalloc;
|
| 214 |
+
#endif
|
| 215 |
+
|
| 216 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 217 |
+
XMLPUBFUN xmlMallocFunc * __xmlMallocAtomic(void);
|
| 218 |
+
#define xmlMallocAtomic \
|
| 219 |
+
(*(__xmlMallocAtomic()))
|
| 220 |
+
#else
|
| 221 |
+
XMLPUBVAR xmlMallocFunc xmlMallocAtomic;
|
| 222 |
+
#endif
|
| 223 |
+
|
| 224 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 225 |
+
XMLPUBFUN xmlReallocFunc * __xmlRealloc(void);
|
| 226 |
+
#define xmlRealloc \
|
| 227 |
+
(*(__xmlRealloc()))
|
| 228 |
+
#else
|
| 229 |
+
XMLPUBVAR xmlReallocFunc xmlRealloc;
|
| 230 |
+
#endif
|
| 231 |
+
|
| 232 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 233 |
+
XMLPUBFUN xmlFreeFunc * __xmlFree(void);
|
| 234 |
+
#define xmlFree \
|
| 235 |
+
(*(__xmlFree()))
|
| 236 |
+
#else
|
| 237 |
+
XMLPUBVAR xmlFreeFunc xmlFree;
|
| 238 |
+
#endif
|
| 239 |
+
|
| 240 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 241 |
+
XMLPUBFUN xmlStrdupFunc * __xmlMemStrdup(void);
|
| 242 |
+
#define xmlMemStrdup \
|
| 243 |
+
(*(__xmlMemStrdup()))
|
| 244 |
+
#else
|
| 245 |
+
XMLPUBVAR xmlStrdupFunc xmlMemStrdup;
|
| 246 |
+
#endif
|
| 247 |
+
|
| 248 |
+
/** DOC_ENABLE */
|
| 249 |
+
#else /* !LIBXML_THREAD_ALLOC_ENABLED */
|
| 250 |
+
XMLPUBVAR xmlMallocFunc xmlMalloc;
|
| 251 |
+
XMLPUBVAR xmlMallocFunc xmlMallocAtomic;
|
| 252 |
+
XMLPUBVAR xmlReallocFunc xmlRealloc;
|
| 253 |
+
XMLPUBVAR xmlFreeFunc xmlFree;
|
| 254 |
+
XMLPUBVAR xmlStrdupFunc xmlMemStrdup;
|
| 255 |
+
#endif /* LIBXML_THREAD_ALLOC_ENABLED */
|
| 256 |
+
|
| 257 |
+
#ifdef LIBXML_HTML_ENABLED
|
| 258 |
+
XML_DEPRECATED
|
| 259 |
+
XMLPUBFUN xmlSAXHandlerV1 * __htmlDefaultSAXHandler(void);
|
| 260 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 261 |
+
#define htmlDefaultSAXHandler \
|
| 262 |
+
(*(__htmlDefaultSAXHandler()))
|
| 263 |
+
#else
|
| 264 |
+
XML_DEPRECATED
|
| 265 |
+
XMLPUBVAR xmlSAXHandlerV1 htmlDefaultSAXHandler;
|
| 266 |
+
#endif
|
| 267 |
+
#endif
|
| 268 |
+
|
| 269 |
+
XMLPUBFUN xmlError * __xmlLastError(void);
|
| 270 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 271 |
+
#define xmlLastError \
|
| 272 |
+
(*(__xmlLastError()))
|
| 273 |
+
#else
|
| 274 |
+
XMLPUBVAR xmlError xmlLastError;
|
| 275 |
+
#endif
|
| 276 |
+
|
| 277 |
+
/*
|
| 278 |
+
* Everything starting from the line below is
|
| 279 |
+
* Automatically generated by build_glob.py.
|
| 280 |
+
* Do not modify the previous line.
|
| 281 |
+
*/
|
| 282 |
+
|
| 283 |
+
|
| 284 |
+
XML_DEPRECATED
|
| 285 |
+
XMLPUBFUN int * __oldXMLWDcompatibility(void);
|
| 286 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 287 |
+
#define oldXMLWDcompatibility \
|
| 288 |
+
(*(__oldXMLWDcompatibility()))
|
| 289 |
+
#else
|
| 290 |
+
XML_DEPRECATED
|
| 291 |
+
XMLPUBVAR int oldXMLWDcompatibility;
|
| 292 |
+
#endif
|
| 293 |
+
|
| 294 |
+
XML_DEPRECATED
|
| 295 |
+
XMLPUBFUN xmlBufferAllocationScheme * __xmlBufferAllocScheme(void);
|
| 296 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 297 |
+
#define xmlBufferAllocScheme \
|
| 298 |
+
(*(__xmlBufferAllocScheme()))
|
| 299 |
+
#else
|
| 300 |
+
XML_DEPRECATED
|
| 301 |
+
XMLPUBVAR xmlBufferAllocationScheme xmlBufferAllocScheme;
|
| 302 |
+
#endif
|
| 303 |
+
XML_DEPRECATED
|
| 304 |
+
XMLPUBFUN xmlBufferAllocationScheme
|
| 305 |
+
xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v);
|
| 306 |
+
|
| 307 |
+
XML_DEPRECATED
|
| 308 |
+
XMLPUBFUN int * __xmlDefaultBufferSize(void);
|
| 309 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 310 |
+
#define xmlDefaultBufferSize \
|
| 311 |
+
(*(__xmlDefaultBufferSize()))
|
| 312 |
+
#else
|
| 313 |
+
XML_DEPRECATED
|
| 314 |
+
XMLPUBVAR int xmlDefaultBufferSize;
|
| 315 |
+
#endif
|
| 316 |
+
XML_DEPRECATED
|
| 317 |
+
XMLPUBFUN int xmlThrDefDefaultBufferSize(int v);
|
| 318 |
+
|
| 319 |
+
XML_DEPRECATED
|
| 320 |
+
XMLPUBFUN xmlSAXHandlerV1 * __xmlDefaultSAXHandler(void);
|
| 321 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 322 |
+
#define xmlDefaultSAXHandler \
|
| 323 |
+
(*(__xmlDefaultSAXHandler()))
|
| 324 |
+
#else
|
| 325 |
+
XML_DEPRECATED
|
| 326 |
+
XMLPUBVAR xmlSAXHandlerV1 xmlDefaultSAXHandler;
|
| 327 |
+
#endif
|
| 328 |
+
|
| 329 |
+
XML_DEPRECATED
|
| 330 |
+
XMLPUBFUN xmlSAXLocator * __xmlDefaultSAXLocator(void);
|
| 331 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 332 |
+
#define xmlDefaultSAXLocator \
|
| 333 |
+
(*(__xmlDefaultSAXLocator()))
|
| 334 |
+
#else
|
| 335 |
+
XML_DEPRECATED
|
| 336 |
+
XMLPUBVAR xmlSAXLocator xmlDefaultSAXLocator;
|
| 337 |
+
#endif
|
| 338 |
+
|
| 339 |
+
XMLPUBFUN int * __xmlDoValidityCheckingDefaultValue(void);
|
| 340 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 341 |
+
#define xmlDoValidityCheckingDefaultValue \
|
| 342 |
+
(*(__xmlDoValidityCheckingDefaultValue()))
|
| 343 |
+
#else
|
| 344 |
+
XMLPUBVAR int xmlDoValidityCheckingDefaultValue;
|
| 345 |
+
#endif
|
| 346 |
+
XMLPUBFUN int xmlThrDefDoValidityCheckingDefaultValue(int v);
|
| 347 |
+
|
| 348 |
+
XMLPUBFUN xmlGenericErrorFunc * __xmlGenericError(void);
|
| 349 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 350 |
+
#define xmlGenericError \
|
| 351 |
+
(*(__xmlGenericError()))
|
| 352 |
+
#else
|
| 353 |
+
XMLPUBVAR xmlGenericErrorFunc xmlGenericError;
|
| 354 |
+
#endif
|
| 355 |
+
|
| 356 |
+
XMLPUBFUN xmlStructuredErrorFunc * __xmlStructuredError(void);
|
| 357 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 358 |
+
#define xmlStructuredError \
|
| 359 |
+
(*(__xmlStructuredError()))
|
| 360 |
+
#else
|
| 361 |
+
XMLPUBVAR xmlStructuredErrorFunc xmlStructuredError;
|
| 362 |
+
#endif
|
| 363 |
+
|
| 364 |
+
XMLPUBFUN void * * __xmlGenericErrorContext(void);
|
| 365 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 366 |
+
#define xmlGenericErrorContext \
|
| 367 |
+
(*(__xmlGenericErrorContext()))
|
| 368 |
+
#else
|
| 369 |
+
XMLPUBVAR void * xmlGenericErrorContext;
|
| 370 |
+
#endif
|
| 371 |
+
|
| 372 |
+
XMLPUBFUN void * * __xmlStructuredErrorContext(void);
|
| 373 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 374 |
+
#define xmlStructuredErrorContext \
|
| 375 |
+
(*(__xmlStructuredErrorContext()))
|
| 376 |
+
#else
|
| 377 |
+
XMLPUBVAR void * xmlStructuredErrorContext;
|
| 378 |
+
#endif
|
| 379 |
+
|
| 380 |
+
XMLPUBFUN int * __xmlGetWarningsDefaultValue(void);
|
| 381 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 382 |
+
#define xmlGetWarningsDefaultValue \
|
| 383 |
+
(*(__xmlGetWarningsDefaultValue()))
|
| 384 |
+
#else
|
| 385 |
+
XMLPUBVAR int xmlGetWarningsDefaultValue;
|
| 386 |
+
#endif
|
| 387 |
+
XMLPUBFUN int xmlThrDefGetWarningsDefaultValue(int v);
|
| 388 |
+
|
| 389 |
+
XMLPUBFUN int * __xmlIndentTreeOutput(void);
|
| 390 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 391 |
+
#define xmlIndentTreeOutput \
|
| 392 |
+
(*(__xmlIndentTreeOutput()))
|
| 393 |
+
#else
|
| 394 |
+
XMLPUBVAR int xmlIndentTreeOutput;
|
| 395 |
+
#endif
|
| 396 |
+
XMLPUBFUN int xmlThrDefIndentTreeOutput(int v);
|
| 397 |
+
|
| 398 |
+
XMLPUBFUN const char * * __xmlTreeIndentString(void);
|
| 399 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 400 |
+
#define xmlTreeIndentString \
|
| 401 |
+
(*(__xmlTreeIndentString()))
|
| 402 |
+
#else
|
| 403 |
+
XMLPUBVAR const char * xmlTreeIndentString;
|
| 404 |
+
#endif
|
| 405 |
+
XMLPUBFUN const char * xmlThrDefTreeIndentString(const char * v);
|
| 406 |
+
|
| 407 |
+
XMLPUBFUN int * __xmlKeepBlanksDefaultValue(void);
|
| 408 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 409 |
+
#define xmlKeepBlanksDefaultValue \
|
| 410 |
+
(*(__xmlKeepBlanksDefaultValue()))
|
| 411 |
+
#else
|
| 412 |
+
XMLPUBVAR int xmlKeepBlanksDefaultValue;
|
| 413 |
+
#endif
|
| 414 |
+
XMLPUBFUN int xmlThrDefKeepBlanksDefaultValue(int v);
|
| 415 |
+
|
| 416 |
+
XML_DEPRECATED
|
| 417 |
+
XMLPUBFUN int * __xmlLineNumbersDefaultValue(void);
|
| 418 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 419 |
+
#define xmlLineNumbersDefaultValue \
|
| 420 |
+
(*(__xmlLineNumbersDefaultValue()))
|
| 421 |
+
#else
|
| 422 |
+
XML_DEPRECATED
|
| 423 |
+
XMLPUBVAR int xmlLineNumbersDefaultValue;
|
| 424 |
+
#endif
|
| 425 |
+
XML_DEPRECATED
|
| 426 |
+
XMLPUBFUN int xmlThrDefLineNumbersDefaultValue(int v);
|
| 427 |
+
|
| 428 |
+
XMLPUBFUN int * __xmlLoadExtDtdDefaultValue(void);
|
| 429 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 430 |
+
#define xmlLoadExtDtdDefaultValue \
|
| 431 |
+
(*(__xmlLoadExtDtdDefaultValue()))
|
| 432 |
+
#else
|
| 433 |
+
XMLPUBVAR int xmlLoadExtDtdDefaultValue;
|
| 434 |
+
#endif
|
| 435 |
+
XMLPUBFUN int xmlThrDefLoadExtDtdDefaultValue(int v);
|
| 436 |
+
|
| 437 |
+
XMLPUBFUN int * __xmlParserDebugEntities(void);
|
| 438 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 439 |
+
#define xmlParserDebugEntities \
|
| 440 |
+
(*(__xmlParserDebugEntities()))
|
| 441 |
+
#else
|
| 442 |
+
XMLPUBVAR int xmlParserDebugEntities;
|
| 443 |
+
#endif
|
| 444 |
+
XMLPUBFUN int xmlThrDefParserDebugEntities(int v);
|
| 445 |
+
|
| 446 |
+
XMLPUBFUN const char * * __xmlParserVersion(void);
|
| 447 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 448 |
+
#define xmlParserVersion \
|
| 449 |
+
(*(__xmlParserVersion()))
|
| 450 |
+
#else
|
| 451 |
+
XMLPUBVAR const char * xmlParserVersion;
|
| 452 |
+
#endif
|
| 453 |
+
|
| 454 |
+
XML_DEPRECATED
|
| 455 |
+
XMLPUBFUN int * __xmlPedanticParserDefaultValue(void);
|
| 456 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 457 |
+
#define xmlPedanticParserDefaultValue \
|
| 458 |
+
(*(__xmlPedanticParserDefaultValue()))
|
| 459 |
+
#else
|
| 460 |
+
XML_DEPRECATED
|
| 461 |
+
XMLPUBVAR int xmlPedanticParserDefaultValue;
|
| 462 |
+
#endif
|
| 463 |
+
XML_DEPRECATED
|
| 464 |
+
XMLPUBFUN int xmlThrDefPedanticParserDefaultValue(int v);
|
| 465 |
+
|
| 466 |
+
XMLPUBFUN int * __xmlSaveNoEmptyTags(void);
|
| 467 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 468 |
+
#define xmlSaveNoEmptyTags \
|
| 469 |
+
(*(__xmlSaveNoEmptyTags()))
|
| 470 |
+
#else
|
| 471 |
+
XMLPUBVAR int xmlSaveNoEmptyTags;
|
| 472 |
+
#endif
|
| 473 |
+
XMLPUBFUN int xmlThrDefSaveNoEmptyTags(int v);
|
| 474 |
+
|
| 475 |
+
XMLPUBFUN int * __xmlSubstituteEntitiesDefaultValue(void);
|
| 476 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 477 |
+
#define xmlSubstituteEntitiesDefaultValue \
|
| 478 |
+
(*(__xmlSubstituteEntitiesDefaultValue()))
|
| 479 |
+
#else
|
| 480 |
+
XMLPUBVAR int xmlSubstituteEntitiesDefaultValue;
|
| 481 |
+
#endif
|
| 482 |
+
XMLPUBFUN int xmlThrDefSubstituteEntitiesDefaultValue(int v);
|
| 483 |
+
|
| 484 |
+
XML_DEPRECATED
|
| 485 |
+
XMLPUBFUN xmlRegisterNodeFunc * __xmlRegisterNodeDefaultValue(void);
|
| 486 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 487 |
+
#define xmlRegisterNodeDefaultValue \
|
| 488 |
+
(*(__xmlRegisterNodeDefaultValue()))
|
| 489 |
+
#else
|
| 490 |
+
XML_DEPRECATED
|
| 491 |
+
XMLPUBVAR xmlRegisterNodeFunc xmlRegisterNodeDefaultValue;
|
| 492 |
+
#endif
|
| 493 |
+
|
| 494 |
+
XML_DEPRECATED
|
| 495 |
+
XMLPUBFUN xmlDeregisterNodeFunc * __xmlDeregisterNodeDefaultValue(void);
|
| 496 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 497 |
+
#define xmlDeregisterNodeDefaultValue \
|
| 498 |
+
(*(__xmlDeregisterNodeDefaultValue()))
|
| 499 |
+
#else
|
| 500 |
+
XML_DEPRECATED
|
| 501 |
+
XMLPUBVAR xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue;
|
| 502 |
+
#endif
|
| 503 |
+
|
| 504 |
+
XML_DEPRECATED
|
| 505 |
+
XMLPUBFUN xmlParserInputBufferCreateFilenameFunc * \
|
| 506 |
+
__xmlParserInputBufferCreateFilenameValue(void);
|
| 507 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 508 |
+
#define xmlParserInputBufferCreateFilenameValue \
|
| 509 |
+
(*(__xmlParserInputBufferCreateFilenameValue()))
|
| 510 |
+
#else
|
| 511 |
+
XML_DEPRECATED
|
| 512 |
+
XMLPUBVAR xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue;
|
| 513 |
+
#endif
|
| 514 |
+
|
| 515 |
+
XML_DEPRECATED
|
| 516 |
+
XMLPUBFUN xmlOutputBufferCreateFilenameFunc * __xmlOutputBufferCreateFilenameValue(void);
|
| 517 |
+
#ifdef LIBXML_THREAD_ENABLED
|
| 518 |
+
#define xmlOutputBufferCreateFilenameValue \
|
| 519 |
+
(*(__xmlOutputBufferCreateFilenameValue()))
|
| 520 |
+
#else
|
| 521 |
+
XML_DEPRECATED
|
| 522 |
+
XMLPUBVAR xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue;
|
| 523 |
+
#endif
|
| 524 |
+
|
| 525 |
+
#ifdef __cplusplus
|
| 526 |
+
}
|
| 527 |
+
#endif
|
| 528 |
+
|
| 529 |
+
#endif /* __XML_GLOBALS_H */
|
pgsql/include/libxml/hash.h
ADDED
|
@@ -0,0 +1,236 @@
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: Chained hash tables
|
| 3 |
+
* Description: This module implements the hash table support used in
|
| 4 |
+
* various places in the library.
|
| 5 |
+
*
|
| 6 |
+
* Copy: See Copyright for the status of this software.
|
| 7 |
+
*
|
| 8 |
+
* Author: Bjorn Reese <bjorn.reese@systematic.dk>
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
#ifndef __XML_HASH_H__
|
| 12 |
+
#define __XML_HASH_H__
|
| 13 |
+
|
| 14 |
+
#ifdef __cplusplus
|
| 15 |
+
extern "C" {
|
| 16 |
+
#endif
|
| 17 |
+
|
| 18 |
+
/*
|
| 19 |
+
* The hash table.
|
| 20 |
+
*/
|
| 21 |
+
typedef struct _xmlHashTable xmlHashTable;
|
| 22 |
+
typedef xmlHashTable *xmlHashTablePtr;
|
| 23 |
+
|
| 24 |
+
#ifdef __cplusplus
|
| 25 |
+
}
|
| 26 |
+
#endif
|
| 27 |
+
|
| 28 |
+
#include <libxml/xmlversion.h>
|
| 29 |
+
#include <libxml/parser.h>
|
| 30 |
+
#include <libxml/dict.h>
|
| 31 |
+
|
| 32 |
+
#ifdef __cplusplus
|
| 33 |
+
extern "C" {
|
| 34 |
+
#endif
|
| 35 |
+
|
| 36 |
+
/*
|
| 37 |
+
* Recent version of gcc produce a warning when a function pointer is assigned
|
| 38 |
+
* to an object pointer, or vice versa. The following macro is a dirty hack
|
| 39 |
+
* to allow suppression of the warning. If your architecture has function
|
| 40 |
+
* pointers which are a different size than a void pointer, there may be some
|
| 41 |
+
* serious trouble within the library.
|
| 42 |
+
*/
|
| 43 |
+
/**
|
| 44 |
+
* XML_CAST_FPTR:
|
| 45 |
+
* @fptr: pointer to a function
|
| 46 |
+
*
|
| 47 |
+
* Macro to do a casting from an object pointer to a
|
| 48 |
+
* function pointer without encountering a warning from
|
| 49 |
+
* gcc
|
| 50 |
+
*
|
| 51 |
+
* #define XML_CAST_FPTR(fptr) (*(void **)(&fptr))
|
| 52 |
+
* This macro violated ISO C aliasing rules (gcc4 on s390 broke)
|
| 53 |
+
* so it is disabled now
|
| 54 |
+
*/
|
| 55 |
+
|
| 56 |
+
#define XML_CAST_FPTR(fptr) fptr
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
/*
|
| 60 |
+
* function types:
|
| 61 |
+
*/
|
| 62 |
+
/**
|
| 63 |
+
* xmlHashDeallocator:
|
| 64 |
+
* @payload: the data in the hash
|
| 65 |
+
* @name: the name associated
|
| 66 |
+
*
|
| 67 |
+
* Callback to free data from a hash.
|
| 68 |
+
*/
|
| 69 |
+
typedef void (*xmlHashDeallocator)(void *payload, const xmlChar *name);
|
| 70 |
+
/**
|
| 71 |
+
* xmlHashCopier:
|
| 72 |
+
* @payload: the data in the hash
|
| 73 |
+
* @name: the name associated
|
| 74 |
+
*
|
| 75 |
+
* Callback to copy data from a hash.
|
| 76 |
+
*
|
| 77 |
+
* Returns a copy of the data or NULL in case of error.
|
| 78 |
+
*/
|
| 79 |
+
typedef void *(*xmlHashCopier)(void *payload, const xmlChar *name);
|
| 80 |
+
/**
|
| 81 |
+
* xmlHashScanner:
|
| 82 |
+
* @payload: the data in the hash
|
| 83 |
+
* @data: extra scanner data
|
| 84 |
+
* @name: the name associated
|
| 85 |
+
*
|
| 86 |
+
* Callback when scanning data in a hash with the simple scanner.
|
| 87 |
+
*/
|
| 88 |
+
typedef void (*xmlHashScanner)(void *payload, void *data, const xmlChar *name);
|
| 89 |
+
/**
|
| 90 |
+
* xmlHashScannerFull:
|
| 91 |
+
* @payload: the data in the hash
|
| 92 |
+
* @data: extra scanner data
|
| 93 |
+
* @name: the name associated
|
| 94 |
+
* @name2: the second name associated
|
| 95 |
+
* @name3: the third name associated
|
| 96 |
+
*
|
| 97 |
+
* Callback when scanning data in a hash with the full scanner.
|
| 98 |
+
*/
|
| 99 |
+
typedef void (*xmlHashScannerFull)(void *payload, void *data,
|
| 100 |
+
const xmlChar *name, const xmlChar *name2,
|
| 101 |
+
const xmlChar *name3);
|
| 102 |
+
|
| 103 |
+
/*
|
| 104 |
+
* Constructor and destructor.
|
| 105 |
+
*/
|
| 106 |
+
XMLPUBFUN xmlHashTablePtr
|
| 107 |
+
xmlHashCreate (int size);
|
| 108 |
+
XMLPUBFUN xmlHashTablePtr
|
| 109 |
+
xmlHashCreateDict(int size,
|
| 110 |
+
xmlDictPtr dict);
|
| 111 |
+
XMLPUBFUN void
|
| 112 |
+
xmlHashFree (xmlHashTablePtr table,
|
| 113 |
+
xmlHashDeallocator f);
|
| 114 |
+
XMLPUBFUN void
|
| 115 |
+
xmlHashDefaultDeallocator(void *entry,
|
| 116 |
+
const xmlChar *name);
|
| 117 |
+
|
| 118 |
+
/*
|
| 119 |
+
* Add a new entry to the hash table.
|
| 120 |
+
*/
|
| 121 |
+
XMLPUBFUN int
|
| 122 |
+
xmlHashAddEntry (xmlHashTablePtr table,
|
| 123 |
+
const xmlChar *name,
|
| 124 |
+
void *userdata);
|
| 125 |
+
XMLPUBFUN int
|
| 126 |
+
xmlHashUpdateEntry(xmlHashTablePtr table,
|
| 127 |
+
const xmlChar *name,
|
| 128 |
+
void *userdata,
|
| 129 |
+
xmlHashDeallocator f);
|
| 130 |
+
XMLPUBFUN int
|
| 131 |
+
xmlHashAddEntry2(xmlHashTablePtr table,
|
| 132 |
+
const xmlChar *name,
|
| 133 |
+
const xmlChar *name2,
|
| 134 |
+
void *userdata);
|
| 135 |
+
XMLPUBFUN int
|
| 136 |
+
xmlHashUpdateEntry2(xmlHashTablePtr table,
|
| 137 |
+
const xmlChar *name,
|
| 138 |
+
const xmlChar *name2,
|
| 139 |
+
void *userdata,
|
| 140 |
+
xmlHashDeallocator f);
|
| 141 |
+
XMLPUBFUN int
|
| 142 |
+
xmlHashAddEntry3(xmlHashTablePtr table,
|
| 143 |
+
const xmlChar *name,
|
| 144 |
+
const xmlChar *name2,
|
| 145 |
+
const xmlChar *name3,
|
| 146 |
+
void *userdata);
|
| 147 |
+
XMLPUBFUN int
|
| 148 |
+
xmlHashUpdateEntry3(xmlHashTablePtr table,
|
| 149 |
+
const xmlChar *name,
|
| 150 |
+
const xmlChar *name2,
|
| 151 |
+
const xmlChar *name3,
|
| 152 |
+
void *userdata,
|
| 153 |
+
xmlHashDeallocator f);
|
| 154 |
+
|
| 155 |
+
/*
|
| 156 |
+
* Remove an entry from the hash table.
|
| 157 |
+
*/
|
| 158 |
+
XMLPUBFUN int
|
| 159 |
+
xmlHashRemoveEntry(xmlHashTablePtr table, const xmlChar *name,
|
| 160 |
+
xmlHashDeallocator f);
|
| 161 |
+
XMLPUBFUN int
|
| 162 |
+
xmlHashRemoveEntry2(xmlHashTablePtr table, const xmlChar *name,
|
| 163 |
+
const xmlChar *name2, xmlHashDeallocator f);
|
| 164 |
+
XMLPUBFUN int
|
| 165 |
+
xmlHashRemoveEntry3(xmlHashTablePtr table, const xmlChar *name,
|
| 166 |
+
const xmlChar *name2, const xmlChar *name3,
|
| 167 |
+
xmlHashDeallocator f);
|
| 168 |
+
|
| 169 |
+
/*
|
| 170 |
+
* Retrieve the userdata.
|
| 171 |
+
*/
|
| 172 |
+
XMLPUBFUN void *
|
| 173 |
+
xmlHashLookup (xmlHashTablePtr table,
|
| 174 |
+
const xmlChar *name);
|
| 175 |
+
XMLPUBFUN void *
|
| 176 |
+
xmlHashLookup2 (xmlHashTablePtr table,
|
| 177 |
+
const xmlChar *name,
|
| 178 |
+
const xmlChar *name2);
|
| 179 |
+
XMLPUBFUN void *
|
| 180 |
+
xmlHashLookup3 (xmlHashTablePtr table,
|
| 181 |
+
const xmlChar *name,
|
| 182 |
+
const xmlChar *name2,
|
| 183 |
+
const xmlChar *name3);
|
| 184 |
+
XMLPUBFUN void *
|
| 185 |
+
xmlHashQLookup (xmlHashTablePtr table,
|
| 186 |
+
const xmlChar *name,
|
| 187 |
+
const xmlChar *prefix);
|
| 188 |
+
XMLPUBFUN void *
|
| 189 |
+
xmlHashQLookup2 (xmlHashTablePtr table,
|
| 190 |
+
const xmlChar *name,
|
| 191 |
+
const xmlChar *prefix,
|
| 192 |
+
const xmlChar *name2,
|
| 193 |
+
const xmlChar *prefix2);
|
| 194 |
+
XMLPUBFUN void *
|
| 195 |
+
xmlHashQLookup3 (xmlHashTablePtr table,
|
| 196 |
+
const xmlChar *name,
|
| 197 |
+
const xmlChar *prefix,
|
| 198 |
+
const xmlChar *name2,
|
| 199 |
+
const xmlChar *prefix2,
|
| 200 |
+
const xmlChar *name3,
|
| 201 |
+
const xmlChar *prefix3);
|
| 202 |
+
|
| 203 |
+
/*
|
| 204 |
+
* Helpers.
|
| 205 |
+
*/
|
| 206 |
+
XMLPUBFUN xmlHashTablePtr
|
| 207 |
+
xmlHashCopy (xmlHashTablePtr table,
|
| 208 |
+
xmlHashCopier f);
|
| 209 |
+
XMLPUBFUN int
|
| 210 |
+
xmlHashSize (xmlHashTablePtr table);
|
| 211 |
+
XMLPUBFUN void
|
| 212 |
+
xmlHashScan (xmlHashTablePtr table,
|
| 213 |
+
xmlHashScanner f,
|
| 214 |
+
void *data);
|
| 215 |
+
XMLPUBFUN void
|
| 216 |
+
xmlHashScan3 (xmlHashTablePtr table,
|
| 217 |
+
const xmlChar *name,
|
| 218 |
+
const xmlChar *name2,
|
| 219 |
+
const xmlChar *name3,
|
| 220 |
+
xmlHashScanner f,
|
| 221 |
+
void *data);
|
| 222 |
+
XMLPUBFUN void
|
| 223 |
+
xmlHashScanFull (xmlHashTablePtr table,
|
| 224 |
+
xmlHashScannerFull f,
|
| 225 |
+
void *data);
|
| 226 |
+
XMLPUBFUN void
|
| 227 |
+
xmlHashScanFull3(xmlHashTablePtr table,
|
| 228 |
+
const xmlChar *name,
|
| 229 |
+
const xmlChar *name2,
|
| 230 |
+
const xmlChar *name3,
|
| 231 |
+
xmlHashScannerFull f,
|
| 232 |
+
void *data);
|
| 233 |
+
#ifdef __cplusplus
|
| 234 |
+
}
|
| 235 |
+
#endif
|
| 236 |
+
#endif /* ! __XML_HASH_H__ */
|
pgsql/include/libxml/list.h
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: lists interfaces
|
| 3 |
+
* Description: this module implement the list support used in
|
| 4 |
+
* various place in the library.
|
| 5 |
+
*
|
| 6 |
+
* Copy: See Copyright for the status of this software.
|
| 7 |
+
*
|
| 8 |
+
* Author: Gary Pennington <Gary.Pennington@uk.sun.com>
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
#ifndef __XML_LINK_INCLUDE__
|
| 12 |
+
#define __XML_LINK_INCLUDE__
|
| 13 |
+
|
| 14 |
+
#include <libxml/xmlversion.h>
|
| 15 |
+
|
| 16 |
+
#ifdef __cplusplus
|
| 17 |
+
extern "C" {
|
| 18 |
+
#endif
|
| 19 |
+
|
| 20 |
+
typedef struct _xmlLink xmlLink;
|
| 21 |
+
typedef xmlLink *xmlLinkPtr;
|
| 22 |
+
|
| 23 |
+
typedef struct _xmlList xmlList;
|
| 24 |
+
typedef xmlList *xmlListPtr;
|
| 25 |
+
|
| 26 |
+
/**
|
| 27 |
+
* xmlListDeallocator:
|
| 28 |
+
* @lk: the data to deallocate
|
| 29 |
+
*
|
| 30 |
+
* Callback function used to free data from a list.
|
| 31 |
+
*/
|
| 32 |
+
typedef void (*xmlListDeallocator) (xmlLinkPtr lk);
|
| 33 |
+
/**
|
| 34 |
+
* xmlListDataCompare:
|
| 35 |
+
* @data0: the first data
|
| 36 |
+
* @data1: the second data
|
| 37 |
+
*
|
| 38 |
+
* Callback function used to compare 2 data.
|
| 39 |
+
*
|
| 40 |
+
* Returns 0 is equality, -1 or 1 otherwise depending on the ordering.
|
| 41 |
+
*/
|
| 42 |
+
typedef int (*xmlListDataCompare) (const void *data0, const void *data1);
|
| 43 |
+
/**
|
| 44 |
+
* xmlListWalker:
|
| 45 |
+
* @data: the data found in the list
|
| 46 |
+
* @user: extra user provided data to the walker
|
| 47 |
+
*
|
| 48 |
+
* Callback function used when walking a list with xmlListWalk().
|
| 49 |
+
*
|
| 50 |
+
* Returns 0 to stop walking the list, 1 otherwise.
|
| 51 |
+
*/
|
| 52 |
+
typedef int (*xmlListWalker) (const void *data, void *user);
|
| 53 |
+
|
| 54 |
+
/* Creation/Deletion */
|
| 55 |
+
XMLPUBFUN xmlListPtr
|
| 56 |
+
xmlListCreate (xmlListDeallocator deallocator,
|
| 57 |
+
xmlListDataCompare compare);
|
| 58 |
+
XMLPUBFUN void
|
| 59 |
+
xmlListDelete (xmlListPtr l);
|
| 60 |
+
|
| 61 |
+
/* Basic Operators */
|
| 62 |
+
XMLPUBFUN void *
|
| 63 |
+
xmlListSearch (xmlListPtr l,
|
| 64 |
+
void *data);
|
| 65 |
+
XMLPUBFUN void *
|
| 66 |
+
xmlListReverseSearch (xmlListPtr l,
|
| 67 |
+
void *data);
|
| 68 |
+
XMLPUBFUN int
|
| 69 |
+
xmlListInsert (xmlListPtr l,
|
| 70 |
+
void *data) ;
|
| 71 |
+
XMLPUBFUN int
|
| 72 |
+
xmlListAppend (xmlListPtr l,
|
| 73 |
+
void *data) ;
|
| 74 |
+
XMLPUBFUN int
|
| 75 |
+
xmlListRemoveFirst (xmlListPtr l,
|
| 76 |
+
void *data);
|
| 77 |
+
XMLPUBFUN int
|
| 78 |
+
xmlListRemoveLast (xmlListPtr l,
|
| 79 |
+
void *data);
|
| 80 |
+
XMLPUBFUN int
|
| 81 |
+
xmlListRemoveAll (xmlListPtr l,
|
| 82 |
+
void *data);
|
| 83 |
+
XMLPUBFUN void
|
| 84 |
+
xmlListClear (xmlListPtr l);
|
| 85 |
+
XMLPUBFUN int
|
| 86 |
+
xmlListEmpty (xmlListPtr l);
|
| 87 |
+
XMLPUBFUN xmlLinkPtr
|
| 88 |
+
xmlListFront (xmlListPtr l);
|
| 89 |
+
XMLPUBFUN xmlLinkPtr
|
| 90 |
+
xmlListEnd (xmlListPtr l);
|
| 91 |
+
XMLPUBFUN int
|
| 92 |
+
xmlListSize (xmlListPtr l);
|
| 93 |
+
|
| 94 |
+
XMLPUBFUN void
|
| 95 |
+
xmlListPopFront (xmlListPtr l);
|
| 96 |
+
XMLPUBFUN void
|
| 97 |
+
xmlListPopBack (xmlListPtr l);
|
| 98 |
+
XMLPUBFUN int
|
| 99 |
+
xmlListPushFront (xmlListPtr l,
|
| 100 |
+
void *data);
|
| 101 |
+
XMLPUBFUN int
|
| 102 |
+
xmlListPushBack (xmlListPtr l,
|
| 103 |
+
void *data);
|
| 104 |
+
|
| 105 |
+
/* Advanced Operators */
|
| 106 |
+
XMLPUBFUN void
|
| 107 |
+
xmlListReverse (xmlListPtr l);
|
| 108 |
+
XMLPUBFUN void
|
| 109 |
+
xmlListSort (xmlListPtr l);
|
| 110 |
+
XMLPUBFUN void
|
| 111 |
+
xmlListWalk (xmlListPtr l,
|
| 112 |
+
xmlListWalker walker,
|
| 113 |
+
void *user);
|
| 114 |
+
XMLPUBFUN void
|
| 115 |
+
xmlListReverseWalk (xmlListPtr l,
|
| 116 |
+
xmlListWalker walker,
|
| 117 |
+
void *user);
|
| 118 |
+
XMLPUBFUN void
|
| 119 |
+
xmlListMerge (xmlListPtr l1,
|
| 120 |
+
xmlListPtr l2);
|
| 121 |
+
XMLPUBFUN xmlListPtr
|
| 122 |
+
xmlListDup (const xmlListPtr old);
|
| 123 |
+
XMLPUBFUN int
|
| 124 |
+
xmlListCopy (xmlListPtr cur,
|
| 125 |
+
const xmlListPtr old);
|
| 126 |
+
/* Link operators */
|
| 127 |
+
XMLPUBFUN void *
|
| 128 |
+
xmlLinkGetData (xmlLinkPtr lk);
|
| 129 |
+
|
| 130 |
+
/* xmlListUnique() */
|
| 131 |
+
/* xmlListSwap */
|
| 132 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: minimal FTP implementation
|
| 3 |
+
* Description: minimal FTP implementation allowing to fetch resources
|
| 4 |
+
* like external subset. This module is DEPRECATED, do not
|
| 5 |
+
* use any of its functions.
|
| 6 |
+
*
|
| 7 |
+
* Copy: See Copyright for the status of this software.
|
| 8 |
+
*
|
| 9 |
+
* Author: Daniel Veillard
|
| 10 |
+
*/
|
| 11 |
+
|
| 12 |
+
#ifndef __NANO_FTP_H__
|
| 13 |
+
#define __NANO_FTP_H__
|
| 14 |
+
|
| 15 |
+
#include <libxml/xmlversion.h>
|
| 16 |
+
|
| 17 |
+
#ifdef LIBXML_FTP_ENABLED
|
| 18 |
+
|
| 19 |
+
/* Needed for portability to Windows 64 bits */
|
| 20 |
+
#if defined(_WIN32)
|
| 21 |
+
#include <winsock2.h>
|
| 22 |
+
#else
|
| 23 |
+
/**
|
| 24 |
+
* SOCKET:
|
| 25 |
+
*
|
| 26 |
+
* macro used to provide portability of code to windows sockets
|
| 27 |
+
*/
|
| 28 |
+
#define SOCKET int
|
| 29 |
+
/**
|
| 30 |
+
* INVALID_SOCKET:
|
| 31 |
+
*
|
| 32 |
+
* macro used to provide portability of code to windows sockets
|
| 33 |
+
* the value to be used when the socket is not valid
|
| 34 |
+
*/
|
| 35 |
+
#undef INVALID_SOCKET
|
| 36 |
+
#define INVALID_SOCKET (-1)
|
| 37 |
+
#endif
|
| 38 |
+
|
| 39 |
+
#ifdef __cplusplus
|
| 40 |
+
extern "C" {
|
| 41 |
+
#endif
|
| 42 |
+
|
| 43 |
+
/**
|
| 44 |
+
* ftpListCallback:
|
| 45 |
+
* @userData: user provided data for the callback
|
| 46 |
+
* @filename: the file name (including "->" when links are shown)
|
| 47 |
+
* @attrib: the attribute string
|
| 48 |
+
* @owner: the owner string
|
| 49 |
+
* @group: the group string
|
| 50 |
+
* @size: the file size
|
| 51 |
+
* @links: the link count
|
| 52 |
+
* @year: the year
|
| 53 |
+
* @month: the month
|
| 54 |
+
* @day: the day
|
| 55 |
+
* @hour: the hour
|
| 56 |
+
* @minute: the minute
|
| 57 |
+
*
|
| 58 |
+
* A callback for the xmlNanoFTPList command.
|
| 59 |
+
* Note that only one of year and day:minute are specified.
|
| 60 |
+
*/
|
| 61 |
+
typedef void (*ftpListCallback) (void *userData,
|
| 62 |
+
const char *filename, const char *attrib,
|
| 63 |
+
const char *owner, const char *group,
|
| 64 |
+
unsigned long size, int links, int year,
|
| 65 |
+
const char *month, int day, int hour,
|
| 66 |
+
int minute);
|
| 67 |
+
/**
|
| 68 |
+
* ftpDataCallback:
|
| 69 |
+
* @userData: the user provided context
|
| 70 |
+
* @data: the data received
|
| 71 |
+
* @len: its size in bytes
|
| 72 |
+
*
|
| 73 |
+
* A callback for the xmlNanoFTPGet command.
|
| 74 |
+
*/
|
| 75 |
+
typedef void (*ftpDataCallback) (void *userData,
|
| 76 |
+
const char *data,
|
| 77 |
+
int len);
|
| 78 |
+
|
| 79 |
+
/*
|
| 80 |
+
* Init
|
| 81 |
+
*/
|
| 82 |
+
XML_DEPRECATED
|
| 83 |
+
XMLPUBFUN void
|
| 84 |
+
xmlNanoFTPInit (void);
|
| 85 |
+
XML_DEPRECATED
|
| 86 |
+
XMLPUBFUN void
|
| 87 |
+
xmlNanoFTPCleanup (void);
|
| 88 |
+
|
| 89 |
+
/*
|
| 90 |
+
* Creating/freeing contexts.
|
| 91 |
+
*/
|
| 92 |
+
XML_DEPRECATED
|
| 93 |
+
XMLPUBFUN void *
|
| 94 |
+
xmlNanoFTPNewCtxt (const char *URL);
|
| 95 |
+
XML_DEPRECATED
|
| 96 |
+
XMLPUBFUN void
|
| 97 |
+
xmlNanoFTPFreeCtxt (void * ctx);
|
| 98 |
+
XML_DEPRECATED
|
| 99 |
+
XMLPUBFUN void *
|
| 100 |
+
xmlNanoFTPConnectTo (const char *server,
|
| 101 |
+
int port);
|
| 102 |
+
/*
|
| 103 |
+
* Opening/closing session connections.
|
| 104 |
+
*/
|
| 105 |
+
XML_DEPRECATED
|
| 106 |
+
XMLPUBFUN void *
|
| 107 |
+
xmlNanoFTPOpen (const char *URL);
|
| 108 |
+
XML_DEPRECATED
|
| 109 |
+
XMLPUBFUN int
|
| 110 |
+
xmlNanoFTPConnect (void *ctx);
|
| 111 |
+
XML_DEPRECATED
|
| 112 |
+
XMLPUBFUN int
|
| 113 |
+
xmlNanoFTPClose (void *ctx);
|
| 114 |
+
XML_DEPRECATED
|
| 115 |
+
XMLPUBFUN int
|
| 116 |
+
xmlNanoFTPQuit (void *ctx);
|
| 117 |
+
XML_DEPRECATED
|
| 118 |
+
XMLPUBFUN void
|
| 119 |
+
xmlNanoFTPScanProxy (const char *URL);
|
| 120 |
+
XML_DEPRECATED
|
| 121 |
+
XMLPUBFUN void
|
| 122 |
+
xmlNanoFTPProxy (const char *host,
|
| 123 |
+
int port,
|
| 124 |
+
const char *user,
|
| 125 |
+
const char *passwd,
|
| 126 |
+
int type);
|
| 127 |
+
XML_DEPRECATED
|
| 128 |
+
XMLPUBFUN int
|
| 129 |
+
xmlNanoFTPUpdateURL (void *ctx,
|
| 130 |
+
const char *URL);
|
| 131 |
+
|
| 132 |
+
/*
|
| 133 |
+
* Rather internal commands.
|
| 134 |
+
*/
|
| 135 |
+
XML_DEPRECATED
|
| 136 |
+
XMLPUBFUN int
|
| 137 |
+
xmlNanoFTPGetResponse (void *ctx);
|
| 138 |
+
XML_DEPRECATED
|
| 139 |
+
XMLPUBFUN int
|
| 140 |
+
xmlNanoFTPCheckResponse (void *ctx);
|
| 141 |
+
|
| 142 |
+
/*
|
| 143 |
+
* CD/DIR/GET handlers.
|
| 144 |
+
*/
|
| 145 |
+
XML_DEPRECATED
|
| 146 |
+
XMLPUBFUN int
|
| 147 |
+
xmlNanoFTPCwd (void *ctx,
|
| 148 |
+
const char *directory);
|
| 149 |
+
XML_DEPRECATED
|
| 150 |
+
XMLPUBFUN int
|
| 151 |
+
xmlNanoFTPDele (void *ctx,
|
| 152 |
+
const char *file);
|
| 153 |
+
|
| 154 |
+
XML_DEPRECATED
|
| 155 |
+
XMLPUBFUN SOCKET
|
| 156 |
+
xmlNanoFTPGetConnection (void *ctx);
|
| 157 |
+
XML_DEPRECATED
|
| 158 |
+
XMLPUBFUN int
|
| 159 |
+
xmlNanoFTPCloseConnection(void *ctx);
|
| 160 |
+
XML_DEPRECATED
|
| 161 |
+
XMLPUBFUN int
|
| 162 |
+
xmlNanoFTPList (void *ctx,
|
| 163 |
+
ftpListCallback callback,
|
| 164 |
+
void *userData,
|
| 165 |
+
const char *filename);
|
| 166 |
+
XML_DEPRECATED
|
| 167 |
+
XMLPUBFUN SOCKET
|
| 168 |
+
xmlNanoFTPGetSocket (void *ctx,
|
| 169 |
+
const char *filename);
|
| 170 |
+
XML_DEPRECATED
|
| 171 |
+
XMLPUBFUN int
|
| 172 |
+
xmlNanoFTPGet (void *ctx,
|
| 173 |
+
ftpDataCallback callback,
|
| 174 |
+
void *userData,
|
| 175 |
+
const char *filename);
|
| 176 |
+
XML_DEPRECATED
|
| 177 |
+
XMLPUBFUN int
|
| 178 |
+
xmlNanoFTPRead (void *ctx,
|
| 179 |
+
void *dest,
|
| 180 |
+
int len);
|
| 181 |
+
|
| 182 |
+
#ifdef __cplusplus
|
| 183 |
+
}
|
| 184 |
+
#endif
|
| 185 |
+
#endif /* LIBXML_FTP_ENABLED */
|
| 186 |
+
#endif /* __NANO_FTP_H__ */
|
pgsql/include/libxml/nanohttp.h
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: minimal HTTP implementation
|
| 3 |
+
* Description: minimal HTTP implementation allowing to fetch resources
|
| 4 |
+
* like external subset.
|
| 5 |
+
*
|
| 6 |
+
* Copy: See Copyright for the status of this software.
|
| 7 |
+
*
|
| 8 |
+
* Author: Daniel Veillard
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
#ifndef __NANO_HTTP_H__
|
| 12 |
+
#define __NANO_HTTP_H__
|
| 13 |
+
|
| 14 |
+
#include <libxml/xmlversion.h>
|
| 15 |
+
|
| 16 |
+
#ifdef LIBXML_HTTP_ENABLED
|
| 17 |
+
|
| 18 |
+
#ifdef __cplusplus
|
| 19 |
+
extern "C" {
|
| 20 |
+
#endif
|
| 21 |
+
XMLPUBFUN void
|
| 22 |
+
xmlNanoHTTPInit (void);
|
| 23 |
+
XMLPUBFUN void
|
| 24 |
+
xmlNanoHTTPCleanup (void);
|
| 25 |
+
XMLPUBFUN void
|
| 26 |
+
xmlNanoHTTPScanProxy (const char *URL);
|
| 27 |
+
XMLPUBFUN int
|
| 28 |
+
xmlNanoHTTPFetch (const char *URL,
|
| 29 |
+
const char *filename,
|
| 30 |
+
char **contentType);
|
| 31 |
+
XMLPUBFUN void *
|
| 32 |
+
xmlNanoHTTPMethod (const char *URL,
|
| 33 |
+
const char *method,
|
| 34 |
+
const char *input,
|
| 35 |
+
char **contentType,
|
| 36 |
+
const char *headers,
|
| 37 |
+
int ilen);
|
| 38 |
+
XMLPUBFUN void *
|
| 39 |
+
xmlNanoHTTPMethodRedir (const char *URL,
|
| 40 |
+
const char *method,
|
| 41 |
+
const char *input,
|
| 42 |
+
char **contentType,
|
| 43 |
+
char **redir,
|
| 44 |
+
const char *headers,
|
| 45 |
+
int ilen);
|
| 46 |
+
XMLPUBFUN void *
|
| 47 |
+
xmlNanoHTTPOpen (const char *URL,
|
| 48 |
+
char **contentType);
|
| 49 |
+
XMLPUBFUN void *
|
| 50 |
+
xmlNanoHTTPOpenRedir (const char *URL,
|
| 51 |
+
char **contentType,
|
| 52 |
+
char **redir);
|
| 53 |
+
XMLPUBFUN int
|
| 54 |
+
xmlNanoHTTPReturnCode (void *ctx);
|
| 55 |
+
XMLPUBFUN const char *
|
| 56 |
+
xmlNanoHTTPAuthHeader (void *ctx);
|
| 57 |
+
XMLPUBFUN const char *
|
| 58 |
+
xmlNanoHTTPRedir (void *ctx);
|
| 59 |
+
XMLPUBFUN int
|
| 60 |
+
xmlNanoHTTPContentLength( void * ctx );
|
| 61 |
+
XMLPUBFUN const char *
|
| 62 |
+
xmlNanoHTTPEncoding (void *ctx);
|
| 63 |
+
XMLPUBFUN const char *
|
| 64 |
+
xmlNanoHTTPMimeType (void *ctx);
|
| 65 |
+
XMLPUBFUN int
|
| 66 |
+
xmlNanoHTTPRead (void *ctx,
|
| 67 |
+
void *dest,
|
| 68 |
+
int len);
|
| 69 |
+
#ifdef LIBXML_OUTPUT_ENABLED
|
| 70 |
+
XMLPUBFUN int
|
| 71 |
+
xmlNanoHTTPSave (void *ctxt,
|
| 72 |
+
const char *filename);
|
|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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: the core parser module
|
| 3 |
+
* Description: Interfaces, constants and types related to the XML parser
|
| 4 |
+
*
|
| 5 |
+
* Copy: See Copyright for the status of this software.
|
| 6 |
+
*
|
| 7 |
+
* Author: Daniel Veillard
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef __XML_PARSER_H__
|
| 11 |
+
#define __XML_PARSER_H__
|
| 12 |
+
|
| 13 |
+
#include <libxml/xmlversion.h>
|
| 14 |
+
#include <libxml/tree.h>
|
| 15 |
+
#include <libxml/dict.h>
|
| 16 |
+
#include <libxml/hash.h>
|
| 17 |
+
#include <libxml/valid.h>
|
| 18 |
+
#include <libxml/entities.h>
|
| 19 |
+
#include <libxml/xmlerror.h>
|
| 20 |
+
#include <libxml/xmlstring.h>
|
| 21 |
+
|
| 22 |
+
#ifdef __cplusplus
|
| 23 |
+
extern "C" {
|
| 24 |
+
#endif
|
| 25 |
+
|
| 26 |
+
/**
|
| 27 |
+
* XML_DEFAULT_VERSION:
|
| 28 |
+
*
|
| 29 |
+
* The default version of XML used: 1.0
|
| 30 |
+
*/
|
| 31 |
+
#define XML_DEFAULT_VERSION "1.0"
|
| 32 |
+
|
| 33 |
+
/**
|
| 34 |
+
* xmlParserInput:
|
| 35 |
+
*
|
| 36 |
+
* An xmlParserInput is an input flow for the XML processor.
|
| 37 |
+
* Each entity parsed is associated an xmlParserInput (except the
|
| 38 |
+
* few predefined ones). This is the case both for internal entities
|
| 39 |
+
* - in which case the flow is already completely in memory - or
|
| 40 |
+
* external entities - in which case we use the buf structure for
|
| 41 |
+
* progressive reading and I18N conversions to the internal UTF-8 format.
|
| 42 |
+
*/
|
| 43 |
+
|
| 44 |
+
/**
|
| 45 |
+
* xmlParserInputDeallocate:
|
| 46 |
+
* @str: the string to deallocate
|
| 47 |
+
*
|
| 48 |
+
* Callback for freeing some parser input allocations.
|
| 49 |
+
*/
|
| 50 |
+
typedef void (* xmlParserInputDeallocate)(xmlChar *str);
|
| 51 |
+
|
| 52 |
+
struct _xmlParserInput {
|
| 53 |
+
/* Input buffer */
|
| 54 |
+
xmlParserInputBufferPtr buf; /* UTF-8 encoded buffer */
|
| 55 |
+
|
| 56 |
+
const char *filename; /* The file analyzed, if any */
|
| 57 |
+
const char *directory; /* the directory/base of the file */
|
| 58 |
+
const xmlChar *base; /* Base of the array to parse */
|
| 59 |
+
const xmlChar *cur; /* Current char being parsed */
|
| 60 |
+
const xmlChar *end; /* end of the array to parse */
|
| 61 |
+
int length; /* length if known */
|
| 62 |
+
int line; /* Current line */
|
| 63 |
+
int col; /* Current column */
|
| 64 |
+
unsigned long consumed; /* How many xmlChars already consumed */
|
| 65 |
+
xmlParserInputDeallocate free; /* function to deallocate the base */
|
| 66 |
+
const xmlChar *encoding; /* the encoding string for entity */
|
| 67 |
+
const xmlChar *version; /* the version string for entity */
|
| 68 |
+
int standalone; /* Was that entity marked standalone */
|
| 69 |
+
int id; /* an unique identifier for the entity */
|
| 70 |
+
unsigned long parentConsumed; /* consumed bytes from parents */
|
| 71 |
+
xmlEntityPtr entity; /* entity, if any */
|
| 72 |
+
};
|
| 73 |
+
|
| 74 |
+
/**
|
| 75 |
+
* xmlParserNodeInfo:
|
| 76 |
+
*
|
| 77 |
+
* The parser can be asked to collect Node information, i.e. at what
|
| 78 |
+
* place in the file they were detected.
|
| 79 |
+
* NOTE: This is off by default and not very well tested.
|
| 80 |
+
*/
|
| 81 |
+
typedef struct _xmlParserNodeInfo xmlParserNodeInfo;
|
| 82 |
+
typedef xmlParserNodeInfo *xmlParserNodeInfoPtr;
|
| 83 |
+
|
| 84 |
+
struct _xmlParserNodeInfo {
|
| 85 |
+
const struct _xmlNode* node;
|
| 86 |
+
/* Position & line # that text that created the node begins & ends on */
|
| 87 |
+
unsigned long begin_pos;
|
| 88 |
+
unsigned long begin_line;
|
| 89 |
+
unsigned long end_pos;
|
| 90 |
+
unsigned long end_line;
|
| 91 |
+
};
|
| 92 |
+
|
| 93 |
+
typedef struct _xmlParserNodeInfoSeq xmlParserNodeInfoSeq;
|
| 94 |
+
typedef xmlParserNodeInfoSeq *xmlParserNodeInfoSeqPtr;
|
| 95 |
+
struct _xmlParserNodeInfoSeq {
|
| 96 |
+
unsigned long maximum;
|
| 97 |
+
unsigned long length;
|
| 98 |
+
xmlParserNodeInfo* buffer;
|
| 99 |
+
};
|
| 100 |
+
|
| 101 |
+
/**
|
| 102 |
+
* xmlParserInputState:
|
| 103 |
+
*
|
| 104 |
+
* The parser is now working also as a state based parser.
|
| 105 |
+
* The recursive one use the state info for entities processing.
|
| 106 |
+
*/
|
| 107 |
+
typedef enum {
|
| 108 |
+
XML_PARSER_EOF = -1, /* nothing is to be parsed */
|
| 109 |
+
XML_PARSER_START = 0, /* nothing has been parsed */
|
| 110 |
+
XML_PARSER_MISC, /* Misc* before int subset */
|
| 111 |
+
XML_PARSER_PI, /* Within a processing instruction */
|
| 112 |
+
XML_PARSER_DTD, /* within some DTD content */
|
| 113 |
+
XML_PARSER_PROLOG, /* Misc* after internal subset */
|
| 114 |
+
XML_PARSER_COMMENT, /* within a comment */
|
| 115 |
+
XML_PARSER_START_TAG, /* within a start tag */
|
| 116 |
+
XML_PARSER_CONTENT, /* within the content */
|
| 117 |
+
XML_PARSER_CDATA_SECTION, /* within a CDATA section */
|
| 118 |
+
XML_PARSER_END_TAG, /* within a closing tag */
|
| 119 |
+
XML_PARSER_ENTITY_DECL, /* within an entity declaration */
|
| 120 |
+
XML_PARSER_ENTITY_VALUE, /* within an entity value in a decl */
|
| 121 |
+
XML_PARSER_ATTRIBUTE_VALUE, /* within an attribute value */
|
| 122 |
+
XML_PARSER_SYSTEM_LITERAL, /* within a SYSTEM value */
|
| 123 |
+
XML_PARSER_EPILOG, /* the Misc* after the last end tag */
|
| 124 |
+
XML_PARSER_IGNORE, /* within an IGNORED section */
|
| 125 |
+
XML_PARSER_PUBLIC_LITERAL /* within a PUBLIC value */
|
| 126 |
+
} xmlParserInputState;
|
| 127 |
+
|
| 128 |
+
/**
|
| 129 |
+
* XML_DETECT_IDS:
|
| 130 |
+
*
|
| 131 |
+
* Bit in the loadsubset context field to tell to do ID/REFs lookups.
|
| 132 |
+
* Use it to initialize xmlLoadExtDtdDefaultValue.
|
| 133 |
+
*/
|
| 134 |
+
#define XML_DETECT_IDS 2
|
| 135 |
+
|
| 136 |
+
/**
|
| 137 |
+
* XML_COMPLETE_ATTRS:
|
| 138 |
+
*
|
| 139 |
+
* Bit in the loadsubset context field to tell to do complete the
|
| 140 |
+
* elements attributes lists with the ones defaulted from the DTDs.
|
| 141 |
+
* Use it to initialize xmlLoadExtDtdDefaultValue.
|
| 142 |
+
*/
|
| 143 |
+
#define XML_COMPLETE_ATTRS 4
|
| 144 |
+
|
| 145 |
+
/**
|
| 146 |
+
* XML_SKIP_IDS:
|
| 147 |
+
*
|
| 148 |
+
* Bit in the loadsubset context field to tell to not do ID/REFs registration.
|
| 149 |
+
* Used to initialize xmlLoadExtDtdDefaultValue in some special cases.
|
| 150 |
+
*/
|
| 151 |
+
#define XML_SKIP_IDS 8
|
| 152 |
+
|
| 153 |
+
/**
|
| 154 |
+
* xmlParserMode:
|
| 155 |
+
*
|
| 156 |
+
* A parser can operate in various modes
|
| 157 |
+
*/
|
| 158 |
+
typedef enum {
|
| 159 |
+
XML_PARSE_UNKNOWN = 0,
|
| 160 |
+
XML_PARSE_DOM = 1,
|
| 161 |
+
XML_PARSE_SAX = 2,
|
| 162 |
+
XML_PARSE_PUSH_DOM = 3,
|
| 163 |
+
XML_PARSE_PUSH_SAX = 4,
|
| 164 |
+
XML_PARSE_READER = 5
|
| 165 |
+
} xmlParserMode;
|
| 166 |
+
|
| 167 |
+
typedef struct _xmlStartTag xmlStartTag;
|
| 168 |
+
|
| 169 |
+
/**
|
| 170 |
+
* xmlParserCtxt:
|
| 171 |
+
*
|
| 172 |
+
* The parser context.
|
| 173 |
+
* NOTE This doesn't completely define the parser state, the (current ?)
|
| 174 |
+
* design of the parser uses recursive function calls since this allow
|
| 175 |
+
* and easy mapping from the production rules of the specification
|
| 176 |
+
* to the actual code. The drawback is that the actual function call
|
| 177 |
+
* also reflect the parser state. However most of the parsing routines
|
| 178 |
+
* takes as the only argument the parser context pointer, so migrating
|
| 179 |
+
* to a state based parser for progressive parsing shouldn't be too hard.
|
| 180 |
+
*/
|
| 181 |
+
struct _xmlParserCtxt {
|
| 182 |
+
struct _xmlSAXHandler *sax; /* The SAX handler */
|
| 183 |
+
void *userData; /* For SAX interface only, used by DOM build */
|
| 184 |
+
xmlDocPtr myDoc; /* the document being built */
|
| 185 |
+
int wellFormed; /* is the document well formed */
|
| 186 |
+
int replaceEntities; /* shall we replace entities ? */
|
| 187 |
+
const xmlChar *version; /* the XML version string */
|
| 188 |
+
const xmlChar *encoding; /* the declared encoding, if any */
|
| 189 |
+
int standalone; /* standalone document */
|
| 190 |
+
int html; /* an HTML(1) document
|
| 191 |
+
* 3 is HTML after <head>
|
| 192 |
+
* 10 is HTML after <body>
|
| 193 |
+
*/
|
| 194 |
+
|
| 195 |
+
/* Input stream stack */
|
| 196 |
+
xmlParserInputPtr input; /* Current input stream */
|
| 197 |
+
int inputNr; /* Number of current input streams */
|
| 198 |
+
int inputMax; /* Max number of input streams */
|
| 199 |
+
xmlParserInputPtr *inputTab; /* stack of inputs */
|
| 200 |
+
|
| 201 |
+
/* Node analysis stack only used for DOM building */
|
| 202 |
+
xmlNodePtr node; /* Current parsed Node */
|
| 203 |
+
int nodeNr; /* Depth of the parsing stack */
|
| 204 |
+
int nodeMax; /* Max depth of the parsing stack */
|
| 205 |
+
xmlNodePtr *nodeTab; /* array of nodes */
|
| 206 |
+
|
| 207 |
+
int record_info; /* Whether node info should be kept */
|
| 208 |
+
xmlParserNodeInfoSeq node_seq; /* info about each node parsed */
|
| 209 |
+
|
| 210 |
+
int errNo; /* error code */
|
| 211 |
+
|
| 212 |
+
int hasExternalSubset; /* reference and external subset */
|
| 213 |
+
int hasPErefs; /* the internal subset has PE refs */
|
| 214 |
+
int external; /* are we parsing an external entity */
|
| 215 |
+
|
| 216 |
+
int valid; /* is the document valid */
|
| 217 |
+
int validate; /* shall we try to validate ? */
|
| 218 |
+
xmlValidCtxt vctxt; /* The validity context */
|
| 219 |
+
|
| 220 |
+
xmlParserInputState instate; /* current type of input */
|
| 221 |
+
int token; /* next char look-ahead */
|
| 222 |
+
|
| 223 |
+
char *directory; /* the data directory */
|
| 224 |
+
|
| 225 |
+
/* Node name stack */
|
| 226 |
+
const xmlChar *name; /* Current parsed Node */
|
| 227 |
+
int nameNr; /* Depth of the parsing stack */
|
| 228 |
+
int nameMax; /* Max depth of the parsing stack */
|
| 229 |
+
const xmlChar * *nameTab; /* array of nodes */
|
| 230 |
+
|
| 231 |
+
long nbChars; /* unused */
|
| 232 |
+
long checkIndex; /* used by progressive parsing lookup */
|
| 233 |
+
int keepBlanks; /* ugly but ... */
|
| 234 |
+
int disableSAX; /* SAX callbacks are disabled */
|
| 235 |
+
int inSubset; /* Parsing is in int 1/ext 2 subset */
|
| 236 |
+
const xmlChar * intSubName; /* name of subset */
|
| 237 |
+
xmlChar * extSubURI; /* URI of external subset */
|
| 238 |
+
xmlChar * extSubSystem; /* SYSTEM ID of external subset */
|
| 239 |
+
|
| 240 |
+
/* xml:space values */
|
| 241 |
+
int * space; /* Should the parser preserve spaces */
|
| 242 |
+
int spaceNr; /* Depth of the parsing stack */
|
| 243 |
+
int spaceMax; /* Max depth of the parsing stack */
|
| 244 |
+
int * spaceTab; /* array of space infos */
|
| 245 |
+
|
| 246 |
+
int depth; /* to prevent entity substitution loops */
|
| 247 |
+
xmlParserInputPtr entity; /* used to check entities boundaries */
|
| 248 |
+
int charset; /* encoding of the in-memory content
|
| 249 |
+
actually an xmlCharEncoding */
|
| 250 |
+
int nodelen; /* Those two fields are there to */
|
| 251 |
+
int nodemem; /* Speed up large node parsing */
|
| 252 |
+
int pedantic; /* signal pedantic warnings */
|
| 253 |
+
void *_private; /* For user data, libxml won't touch it */
|
| 254 |
+
|
| 255 |
+
int loadsubset; /* should the external subset be loaded */
|
| 256 |
+
int linenumbers; /* set line number in element content */
|
| 257 |
+
void *catalogs; /* document's own catalog */
|
| 258 |
+
int recovery; /* run in recovery mode */
|
| 259 |
+
int progressive; /* is this a progressive parsing */
|
| 260 |
+
xmlDictPtr dict; /* dictionary for the parser */
|
| 261 |
+
const xmlChar * *atts; /* array for the attributes callbacks */
|
| 262 |
+
int maxatts; /* the size of the array */
|
| 263 |
+
int docdict; /* use strings from dict to build tree */
|
| 264 |
+
|
| 265 |
+
/*
|
| 266 |
+
* pre-interned strings
|
| 267 |
+
*/
|
| 268 |
+
const xmlChar *str_xml;
|
| 269 |
+
const xmlChar *str_xmlns;
|
| 270 |
+
const xmlChar *str_xml_ns;
|
| 271 |
+
|
| 272 |
+
/*
|
| 273 |
+
* Everything below is used only by the new SAX mode
|
| 274 |
+
*/
|
| 275 |
+
int sax2; /* operating in the new SAX mode */
|
| 276 |
+
int nsNr; /* the number of inherited namespaces */
|
| 277 |
+
int nsMax; /* the size of the arrays */
|
| 278 |
+
const xmlChar * *nsTab; /* the array of prefix/namespace name */
|
| 279 |
+
int *attallocs; /* which attribute were allocated */
|
| 280 |
+
xmlStartTag *pushTab; /* array of data for push */
|
| 281 |
+
xmlHashTablePtr attsDefault; /* defaulted attributes if any */
|
| 282 |
+
xmlHashTablePtr attsSpecial; /* non-CDATA attributes if any */
|
| 283 |
+
int nsWellFormed; /* is the document XML Namespace okay */
|
| 284 |
+
int options; /* Extra options */
|
| 285 |
+
|
| 286 |
+
/*
|
| 287 |
+
* Those fields are needed only for streaming parsing so far
|
| 288 |
+
*/
|
| 289 |
+
int dictNames; /* Use dictionary names for the tree */
|
| 290 |
+
int freeElemsNr; /* number of freed element nodes */
|
| 291 |
+
xmlNodePtr freeElems; /* List of freed element nodes */
|
| 292 |
+
int freeAttrsNr; /* number of freed attributes nodes */
|
| 293 |
+
xmlAttrPtr freeAttrs; /* List of freed attributes nodes */
|
| 294 |
+
|
| 295 |
+
/*
|
| 296 |
+
* the complete error information for the last error.
|
| 297 |
+
*/
|
| 298 |
+
xmlError lastError;
|
| 299 |
+
xmlParserMode parseMode; /* the parser mode */
|
| 300 |
+
unsigned long nbentities; /* unused */
|
| 301 |
+
unsigned long sizeentities; /* size of parsed entities */
|
| 302 |
+
|
| 303 |
+
/* for use by HTML non-recursive parser */
|
| 304 |
+
xmlParserNodeInfo *nodeInfo; /* Current NodeInfo */
|
| 305 |
+
int nodeInfoNr; /* Depth of the parsing stack */
|
| 306 |
+
int nodeInfoMax; /* Max depth of the parsing stack */
|
| 307 |
+
xmlParserNodeInfo *nodeInfoTab; /* array of nodeInfos */
|
| 308 |
+
|
| 309 |
+
int input_id; /* we need to label inputs */
|
| 310 |
+
unsigned long sizeentcopy; /* volume of entity copy */
|
| 311 |
+
|
| 312 |
+
int endCheckState; /* quote state for push parser */
|
| 313 |
+
unsigned short nbErrors; /* number of errors */
|
| 314 |
+
unsigned short nbWarnings; /* number of warnings */
|
| 315 |
+
};
|
| 316 |
+
|
| 317 |
+
/**
|
| 318 |
+
* xmlSAXLocator:
|
| 319 |
+
*
|
| 320 |
+
* A SAX Locator.
|
| 321 |
+
*/
|
| 322 |
+
struct _xmlSAXLocator {
|
| 323 |
+
const xmlChar *(*getPublicId)(void *ctx);
|
| 324 |
+
const xmlChar *(*getSystemId)(void *ctx);
|
| 325 |
+
int (*getLineNumber)(void *ctx);
|
| 326 |
+
int (*getColumnNumber)(void *ctx);
|
| 327 |
+
};
|
| 328 |
+
|
| 329 |
+
/**
|
| 330 |
+
* xmlSAXHandler:
|
| 331 |
+
*
|
| 332 |
+
* A SAX handler is bunch of callbacks called by the parser when processing
|
| 333 |
+
* of the input generate data or structure information.
|
| 334 |
+
*/
|
| 335 |
+
|
| 336 |
+
/**
|
| 337 |
+
* resolveEntitySAXFunc:
|
| 338 |
+
* @ctx: the user data (XML parser context)
|
| 339 |
+
* @publicId: The public ID of the entity
|
| 340 |
+
* @systemId: The system ID of the entity
|
| 341 |
+
*
|
| 342 |
+
* Callback:
|
| 343 |
+
* The entity loader, to control the loading of external entities,
|
| 344 |
+
* the application can either:
|
| 345 |
+
* - override this resolveEntity() callback in the SAX block
|
| 346 |
+
* - or better use the xmlSetExternalEntityLoader() function to
|
| 347 |
+
* set up it's own entity resolution routine
|
| 348 |
+
*
|
| 349 |
+
* Returns the xmlParserInputPtr if inlined or NULL for DOM behaviour.
|
| 350 |
+
*/
|
| 351 |
+
typedef xmlParserInputPtr (*resolveEntitySAXFunc) (void *ctx,
|
| 352 |
+
const xmlChar *publicId,
|
| 353 |
+
const xmlChar *systemId);
|
| 354 |
+
/**
|
| 355 |
+
* internalSubsetSAXFunc:
|
| 356 |
+
* @ctx: the user data (XML parser context)
|
| 357 |
+
* @name: the root element name
|
| 358 |
+
* @ExternalID: the external ID
|
| 359 |
+
* @SystemID: the SYSTEM ID (e.g. filename or URL)
|
| 360 |
+
*
|
| 361 |
+
* Callback on internal subset declaration.
|
| 362 |
+
*/
|
| 363 |
+
typedef void (*internalSubsetSAXFunc) (void *ctx,
|
| 364 |
+
const xmlChar *name,
|
| 365 |
+
const xmlChar *ExternalID,
|
| 366 |
+
const xmlChar *SystemID);
|
| 367 |
+
/**
|
| 368 |
+
* externalSubsetSAXFunc:
|
| 369 |
+
* @ctx: the user data (XML parser context)
|
| 370 |
+
* @name: the root element name
|
| 371 |
+
* @ExternalID: the external ID
|
| 372 |
+
* @SystemID: the SYSTEM ID (e.g. filename or URL)
|
| 373 |
+
*
|
| 374 |
+
* Callback on external subset declaration.
|
| 375 |
+
*/
|
| 376 |
+
typedef void (*externalSubsetSAXFunc) (void *ctx,
|
| 377 |
+
const xmlChar *name,
|
| 378 |
+
const xmlChar *ExternalID,
|
| 379 |
+
const xmlChar *SystemID);
|
| 380 |
+
/**
|
| 381 |
+
* getEntitySAXFunc:
|
| 382 |
+
* @ctx: the user data (XML parser context)
|
| 383 |
+
* @name: The entity name
|
| 384 |
+
*
|
| 385 |
+
* Get an entity by name.
|
| 386 |
+
*
|
| 387 |
+
* Returns the xmlEntityPtr if found.
|
| 388 |
+
*/
|
| 389 |
+
typedef xmlEntityPtr (*getEntitySAXFunc) (void *ctx,
|
| 390 |
+
const xmlChar *name);
|
| 391 |
+
/**
|
| 392 |
+
* getParameterEntitySAXFunc:
|
| 393 |
+
* @ctx: the user data (XML parser context)
|
| 394 |
+
* @name: The entity name
|
| 395 |
+
*
|
| 396 |
+
* Get a parameter entity by name.
|
| 397 |
+
*
|
| 398 |
+
* Returns the xmlEntityPtr if found.
|
| 399 |
+
*/
|
| 400 |
+
typedef xmlEntityPtr (*getParameterEntitySAXFunc) (void *ctx,
|
| 401 |
+
const xmlChar *name);
|
| 402 |
+
/**
|
| 403 |
+
* entityDeclSAXFunc:
|
| 404 |
+
* @ctx: the user data (XML parser context)
|
| 405 |
+
* @name: the entity name
|
| 406 |
+
* @type: the entity type
|
| 407 |
+
* @publicId: The public ID of the entity
|
| 408 |
+
* @systemId: The system ID of the entity
|
| 409 |
+
* @content: the entity value (without processing).
|
| 410 |
+
*
|
| 411 |
+
* An entity definition has been parsed.
|
| 412 |
+
*/
|
| 413 |
+
typedef void (*entityDeclSAXFunc) (void *ctx,
|
| 414 |
+
const xmlChar *name,
|
| 415 |
+
int type,
|
| 416 |
+
const xmlChar *publicId,
|
| 417 |
+
const xmlChar *systemId,
|
| 418 |
+
xmlChar *content);
|
| 419 |
+
/**
|
| 420 |
+
* notationDeclSAXFunc:
|
| 421 |
+
* @ctx: the user data (XML parser context)
|
| 422 |
+
* @name: The name of the notation
|
| 423 |
+
* @publicId: The public ID of the entity
|
| 424 |
+
* @systemId: The system ID of the entity
|
| 425 |
+
*
|
| 426 |
+
* What to do when a notation declaration has been parsed.
|
| 427 |
+
*/
|
| 428 |
+
typedef void (*notationDeclSAXFunc)(void *ctx,
|
| 429 |
+
const xmlChar *name,
|
| 430 |
+
const xmlChar *publicId,
|
| 431 |
+
const xmlChar *systemId);
|
| 432 |
+
/**
|
| 433 |
+
* attributeDeclSAXFunc:
|
| 434 |
+
* @ctx: the user data (XML parser context)
|
| 435 |
+
* @elem: the name of the element
|
| 436 |
+
* @fullname: the attribute name
|
| 437 |
+
* @type: the attribute type
|
| 438 |
+
* @def: the type of default value
|
| 439 |
+
* @defaultValue: the attribute default value
|
| 440 |
+
* @tree: the tree of enumerated value set
|
| 441 |
+
*
|
| 442 |
+
* An attribute definition has been parsed.
|
| 443 |
+
*/
|
| 444 |
+
typedef void (*attributeDeclSAXFunc)(void *ctx,
|
| 445 |
+
const xmlChar *elem,
|
| 446 |
+
const xmlChar *fullname,
|
| 447 |
+
int type,
|
| 448 |
+
int def,
|
| 449 |
+
const xmlChar *defaultValue,
|
| 450 |
+
xmlEnumerationPtr tree);
|
| 451 |
+
/**
|
| 452 |
+
* elementDeclSAXFunc:
|
| 453 |
+
* @ctx: the user data (XML parser context)
|
| 454 |
+
* @name: the element name
|
| 455 |
+
* @type: the element type
|
| 456 |
+
* @content: the element value tree
|
| 457 |
+
*
|
| 458 |
+
* An element definition has been parsed.
|
| 459 |
+
*/
|
| 460 |
+
typedef void (*elementDeclSAXFunc)(void *ctx,
|
| 461 |
+
const xmlChar *name,
|
| 462 |
+
int type,
|
| 463 |
+
xmlElementContentPtr content);
|
| 464 |
+
/**
|
| 465 |
+
* unparsedEntityDeclSAXFunc:
|
| 466 |
+
* @ctx: the user data (XML parser context)
|
| 467 |
+
* @name: The name of the entity
|
| 468 |
+
* @publicId: The public ID of the entity
|
| 469 |
+
* @systemId: The system ID of the entity
|
| 470 |
+
* @notationName: the name of the notation
|
| 471 |
+
*
|
| 472 |
+
* What to do when an unparsed entity declaration is parsed.
|
| 473 |
+
*/
|
| 474 |
+
typedef void (*unparsedEntityDeclSAXFunc)(void *ctx,
|
| 475 |
+
const xmlChar *name,
|
| 476 |
+
const xmlChar *publicId,
|
| 477 |
+
const xmlChar *systemId,
|
| 478 |
+
const xmlChar *notationName);
|
| 479 |
+
/**
|
| 480 |
+
* setDocumentLocatorSAXFunc:
|
| 481 |
+
* @ctx: the user data (XML parser context)
|
| 482 |
+
* @loc: A SAX Locator
|
| 483 |
+
*
|
| 484 |
+
* Receive the document locator at startup, actually xmlDefaultSAXLocator.
|
| 485 |
+
* Everything is available on the context, so this is useless in our case.
|
| 486 |
+
*/
|
| 487 |
+
typedef void (*setDocumentLocatorSAXFunc) (void *ctx,
|
| 488 |
+
xmlSAXLocatorPtr loc);
|
| 489 |
+
/**
|
| 490 |
+
* startDocumentSAXFunc:
|
| 491 |
+
* @ctx: the user data (XML parser context)
|
| 492 |
+
*
|
| 493 |
+
* Called when the document start being processed.
|
| 494 |
+
*/
|
| 495 |
+
typedef void (*startDocumentSAXFunc) (void *ctx);
|
| 496 |
+
/**
|
| 497 |
+
* endDocumentSAXFunc:
|
| 498 |
+
* @ctx: the user data (XML parser context)
|
| 499 |
+
*
|
| 500 |
+
* Called when the document end has been detected.
|
| 501 |
+
*/
|
| 502 |
+
typedef void (*endDocumentSAXFunc) (void *ctx);
|
| 503 |
+
/**
|
| 504 |
+
* startElementSAXFunc:
|
| 505 |
+
* @ctx: the user data (XML parser context)
|
| 506 |
+
* @name: The element name, including namespace prefix
|
| 507 |
+
* @atts: An array of name/value attributes pairs, NULL terminated
|
| 508 |
+
*
|
| 509 |
+
* Called when an opening tag has been processed.
|
| 510 |
+
*/
|
| 511 |
+
typedef void (*startElementSAXFunc) (void *ctx,
|
| 512 |
+
const xmlChar *name,
|
| 513 |
+
const xmlChar **atts);
|
| 514 |
+
/**
|
| 515 |
+
* endElementSAXFunc:
|
| 516 |
+
* @ctx: the user data (XML parser context)
|
| 517 |
+
* @name: The element name
|
| 518 |
+
*
|
| 519 |
+
* Called when the end of an element has been detected.
|
| 520 |
+
*/
|
| 521 |
+
typedef void (*endElementSAXFunc) (void *ctx,
|
| 522 |
+
const xmlChar *name);
|
| 523 |
+
/**
|
| 524 |
+
* attributeSAXFunc:
|
| 525 |
+
* @ctx: the user data (XML parser context)
|
| 526 |
+
* @name: The attribute name, including namespace prefix
|
| 527 |
+
* @value: The attribute value
|
| 528 |
+
*
|
| 529 |
+
* Handle an attribute that has been read by the parser.
|
| 530 |
+
* The default handling is to convert the attribute into an
|
| 531 |
+
* DOM subtree and past it in a new xmlAttr element added to
|
| 532 |
+
* the element.
|
| 533 |
+
*/
|
| 534 |
+
typedef void (*attributeSAXFunc) (void *ctx,
|
| 535 |
+
const xmlChar *name,
|
| 536 |
+
const xmlChar *value);
|
| 537 |
+
/**
|
| 538 |
+
* referenceSAXFunc:
|
| 539 |
+
* @ctx: the user data (XML parser context)
|
| 540 |
+
* @name: The entity name
|
| 541 |
+
*
|
| 542 |
+
* Called when an entity reference is detected.
|
| 543 |
+
*/
|
| 544 |
+
typedef void (*referenceSAXFunc) (void *ctx,
|
| 545 |
+
const xmlChar *name);
|
| 546 |
+
/**
|
| 547 |
+
* charactersSAXFunc:
|
| 548 |
+
* @ctx: the user data (XML parser context)
|
| 549 |
+
* @ch: a xmlChar string
|
| 550 |
+
* @len: the number of xmlChar
|
| 551 |
+
*
|
| 552 |
+
* Receiving some chars from the parser.
|
| 553 |
+
*/
|
| 554 |
+
typedef void (*charactersSAXFunc) (void *ctx,
|
| 555 |
+
const xmlChar *ch,
|
| 556 |
+
int len);
|
| 557 |
+
/**
|
| 558 |
+
* ignorableWhitespaceSAXFunc:
|
| 559 |
+
* @ctx: the user data (XML parser context)
|
| 560 |
+
* @ch: a xmlChar string
|
| 561 |
+
* @len: the number of xmlChar
|
| 562 |
+
*
|
| 563 |
+
* Receiving some ignorable whitespaces from the parser.
|
| 564 |
+
* UNUSED: by default the DOM building will use characters.
|
| 565 |
+
*/
|
| 566 |
+
typedef void (*ignorableWhitespaceSAXFunc) (void *ctx,
|
| 567 |
+
const xmlChar *ch,
|
| 568 |
+
int len);
|
| 569 |
+
/**
|
| 570 |
+
* processingInstructionSAXFunc:
|
| 571 |
+
* @ctx: the user data (XML parser context)
|
| 572 |
+
* @target: the target name
|
| 573 |
+
* @data: the PI data's
|
| 574 |
+
*
|
| 575 |
+
* A processing instruction has been parsed.
|
| 576 |
+
*/
|
| 577 |
+
typedef void (*processingInstructionSAXFunc) (void *ctx,
|
| 578 |
+
const xmlChar *target,
|
| 579 |
+
const xmlChar *data);
|
| 580 |
+
/**
|
| 581 |
+
* commentSAXFunc:
|
| 582 |
+
* @ctx: the user data (XML parser context)
|
| 583 |
+
* @value: the comment content
|
| 584 |
+
*
|
| 585 |
+
* A comment has been parsed.
|
| 586 |
+
*/
|
| 587 |
+
typedef void (*commentSAXFunc) (void *ctx,
|
| 588 |
+
const xmlChar *value);
|
| 589 |
+
/**
|
| 590 |
+
* cdataBlockSAXFunc:
|
| 591 |
+
* @ctx: the user data (XML parser context)
|
| 592 |
+
* @value: The pcdata content
|
| 593 |
+
* @len: the block length
|
| 594 |
+
*
|
| 595 |
+
* Called when a pcdata block has been parsed.
|
| 596 |
+
*/
|
| 597 |
+
typedef void (*cdataBlockSAXFunc) (
|
| 598 |
+
void *ctx,
|
| 599 |
+
const xmlChar *value,
|
| 600 |
+
int len);
|
| 601 |
+
/**
|
| 602 |
+
* warningSAXFunc:
|
| 603 |
+
* @ctx: an XML parser context
|
| 604 |
+
* @msg: the message to display/transmit
|
| 605 |
+
* @...: extra parameters for the message display
|
| 606 |
+
*
|
| 607 |
+
* Display and format a warning messages, callback.
|
| 608 |
+
*/
|
| 609 |
+
typedef void (*warningSAXFunc) (void *ctx,
|
| 610 |
+
const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
|
| 611 |
+
/**
|
| 612 |
+
* errorSAXFunc:
|
| 613 |
+
* @ctx: an XML parser context
|
| 614 |
+
* @msg: the message to display/transmit
|
| 615 |
+
* @...: extra parameters for the message display
|
| 616 |
+
*
|
| 617 |
+
* Display and format an error messages, callback.
|
| 618 |
+
*/
|
| 619 |
+
typedef void (*errorSAXFunc) (void *ctx,
|
| 620 |
+
const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
|
| 621 |
+
/**
|
| 622 |
+
* fatalErrorSAXFunc:
|
| 623 |
+
* @ctx: an XML parser context
|
| 624 |
+
* @msg: the message to display/transmit
|
| 625 |
+
* @...: extra parameters for the message display
|
| 626 |
+
*
|
| 627 |
+
* Display and format fatal error messages, callback.
|
| 628 |
+
* Note: so far fatalError() SAX callbacks are not used, error()
|
| 629 |
+
* get all the callbacks for errors.
|
| 630 |
+
*/
|
| 631 |
+
typedef void (*fatalErrorSAXFunc) (void *ctx,
|
| 632 |
+
const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
|
| 633 |
+
/**
|
| 634 |
+
* isStandaloneSAXFunc:
|
| 635 |
+
* @ctx: the user data (XML parser context)
|
| 636 |
+
*
|
| 637 |
+
* Is this document tagged standalone?
|
| 638 |
+
*
|
| 639 |
+
* Returns 1 if true
|
| 640 |
+
*/
|
| 641 |
+
typedef int (*isStandaloneSAXFunc) (void *ctx);
|
| 642 |
+
/**
|
| 643 |
+
* hasInternalSubsetSAXFunc:
|
| 644 |
+
* @ctx: the user data (XML parser context)
|
| 645 |
+
*
|
| 646 |
+
* Does this document has an internal subset.
|
| 647 |
+
*
|
| 648 |
+
* Returns 1 if true
|
| 649 |
+
*/
|
| 650 |
+
typedef int (*hasInternalSubsetSAXFunc) (void *ctx);
|
| 651 |
+
|
| 652 |
+
/**
|
| 653 |
+
* hasExternalSubsetSAXFunc:
|
| 654 |
+
* @ctx: the user data (XML parser context)
|
| 655 |
+
*
|
| 656 |
+
* Does this document has an external subset?
|
| 657 |
+
*
|
| 658 |
+
* Returns 1 if true
|
| 659 |
+
*/
|
| 660 |
+
typedef int (*hasExternalSubsetSAXFunc) (void *ctx);
|
| 661 |
+
|
| 662 |
+
/************************************************************************
|
| 663 |
+
* *
|
| 664 |
+
* The SAX version 2 API extensions *
|
| 665 |
+
* *
|
| 666 |
+
************************************************************************/
|
| 667 |
+
/**
|
| 668 |
+
* XML_SAX2_MAGIC:
|
| 669 |
+
*
|
| 670 |
+
* Special constant found in SAX2 blocks initialized fields
|
| 671 |
+
*/
|
| 672 |
+
#define XML_SAX2_MAGIC 0xDEEDBEAF
|
| 673 |
+
|
| 674 |
+
/**
|
| 675 |
+
* startElementNsSAX2Func:
|
| 676 |
+
* @ctx: the user data (XML parser context)
|
| 677 |
+
* @localname: the local name of the element
|
| 678 |
+
* @prefix: the element namespace prefix if available
|
| 679 |
+
* @URI: the element namespace name if available
|
| 680 |
+
* @nb_namespaces: number of namespace definitions on that node
|
| 681 |
+
* @namespaces: pointer to the array of prefix/URI pairs namespace definitions
|
| 682 |
+
* @nb_attributes: the number of attributes on that node
|
| 683 |
+
* @nb_defaulted: the number of defaulted attributes. The defaulted
|
| 684 |
+
* ones are at the end of the array
|
| 685 |
+
* @attributes: pointer to the array of (localname/prefix/URI/value/end)
|
| 686 |
+
* attribute values.
|
| 687 |
+
*
|
| 688 |
+
* SAX2 callback when an element start has been detected by the parser.
|
| 689 |
+
* It provides the namespace information for the element, as well as
|
| 690 |
+
* the new namespace declarations on the element.
|
| 691 |
+
*/
|
| 692 |
+
|
| 693 |
+
typedef void (*startElementNsSAX2Func) (void *ctx,
|
| 694 |
+
const xmlChar *localname,
|
| 695 |
+
const xmlChar *prefix,
|
| 696 |
+
const xmlChar *URI,
|
| 697 |
+
int nb_namespaces,
|
| 698 |
+
const xmlChar **namespaces,
|
| 699 |
+
int nb_attributes,
|
| 700 |
+
int nb_defaulted,
|
| 701 |
+
const xmlChar **attributes);
|
| 702 |
+
|
| 703 |
+
/**
|
| 704 |
+
* endElementNsSAX2Func:
|
| 705 |
+
* @ctx: the user data (XML parser context)
|
| 706 |
+
* @localname: the local name of the element
|
| 707 |
+
* @prefix: the element namespace prefix if available
|
| 708 |
+
* @URI: the element namespace name if available
|
| 709 |
+
*
|
| 710 |
+
* SAX2 callback when an element end has been detected by the parser.
|
| 711 |
+
* It provides the namespace information for the element.
|
| 712 |
+
*/
|
| 713 |
+
|
| 714 |
+
typedef void (*endElementNsSAX2Func) (void *ctx,
|
| 715 |
+
const xmlChar *localname,
|
| 716 |
+
const xmlChar *prefix,
|
| 717 |
+
const xmlChar *URI);
|
| 718 |
+
|
| 719 |
+
|
| 720 |
+
struct _xmlSAXHandler {
|
| 721 |
+
internalSubsetSAXFunc internalSubset;
|
| 722 |
+
isStandaloneSAXFunc isStandalone;
|
| 723 |
+
hasInternalSubsetSAXFunc hasInternalSubset;
|
| 724 |
+
hasExternalSubsetSAXFunc hasExternalSubset;
|
| 725 |
+
resolveEntitySAXFunc resolveEntity;
|
| 726 |
+
getEntitySAXFunc getEntity;
|
| 727 |
+
entityDeclSAXFunc entityDecl;
|
| 728 |
+
notationDeclSAXFunc notationDecl;
|
| 729 |
+
attributeDeclSAXFunc attributeDecl;
|
| 730 |
+
elementDeclSAXFunc elementDecl;
|
| 731 |
+
unparsedEntityDeclSAXFunc unparsedEntityDecl;
|
| 732 |
+
setDocumentLocatorSAXFunc setDocumentLocator;
|
| 733 |
+
startDocumentSAXFunc startDocument;
|
| 734 |
+
endDocumentSAXFunc endDocument;
|
| 735 |
+
startElementSAXFunc startElement;
|
| 736 |
+
endElementSAXFunc endElement;
|
| 737 |
+
referenceSAXFunc reference;
|
| 738 |
+
charactersSAXFunc characters;
|
| 739 |
+
ignorableWhitespaceSAXFunc ignorableWhitespace;
|
| 740 |
+
processingInstructionSAXFunc processingInstruction;
|
| 741 |
+
commentSAXFunc comment;
|
| 742 |
+
warningSAXFunc warning;
|
| 743 |
+
errorSAXFunc error;
|
| 744 |
+
fatalErrorSAXFunc fatalError; /* unused error() get all the errors */
|
| 745 |
+
getParameterEntitySAXFunc getParameterEntity;
|
| 746 |
+
cdataBlockSAXFunc cdataBlock;
|
| 747 |
+
externalSubsetSAXFunc externalSubset;
|
| 748 |
+
unsigned int initialized;
|
| 749 |
+
/* The following fields are extensions available only on version 2 */
|
| 750 |
+
void *_private;
|
| 751 |
+
startElementNsSAX2Func startElementNs;
|
| 752 |
+
endElementNsSAX2Func endElementNs;
|
| 753 |
+
xmlStructuredErrorFunc serror;
|
| 754 |
+
};
|
| 755 |
+
|
| 756 |
+
/*
|
| 757 |
+
* SAX Version 1
|
| 758 |
+
*/
|
| 759 |
+
typedef struct _xmlSAXHandlerV1 xmlSAXHandlerV1;
|
| 760 |
+
typedef xmlSAXHandlerV1 *xmlSAXHandlerV1Ptr;
|
| 761 |
+
struct _xmlSAXHandlerV1 {
|
| 762 |
+
internalSubsetSAXFunc internalSubset;
|
| 763 |
+
isStandaloneSAXFunc isStandalone;
|
| 764 |
+
hasInternalSubsetSAXFunc hasInternalSubset;
|
| 765 |
+
hasExternalSubsetSAXFunc hasExternalSubset;
|
| 766 |
+
resolveEntitySAXFunc resolveEntity;
|
| 767 |
+
getEntitySAXFunc getEntity;
|
| 768 |
+
entityDeclSAXFunc entityDecl;
|
| 769 |
+
notationDeclSAXFunc notationDecl;
|
| 770 |
+
attributeDeclSAXFunc attributeDecl;
|
| 771 |
+
elementDeclSAXFunc elementDecl;
|
| 772 |
+
unparsedEntityDeclSAXFunc unparsedEntityDecl;
|
| 773 |
+
setDocumentLocatorSAXFunc setDocumentLocator;
|
| 774 |
+
startDocumentSAXFunc startDocument;
|
| 775 |
+
endDocumentSAXFunc endDocument;
|
| 776 |
+
startElementSAXFunc startElement;
|
| 777 |
+
endElementSAXFunc endElement;
|
| 778 |
+
referenceSAXFunc reference;
|
| 779 |
+
charactersSAXFunc characters;
|
| 780 |
+
ignorableWhitespaceSAXFunc ignorableWhitespace;
|
| 781 |
+
processingInstructionSAXFunc processingInstruction;
|
| 782 |
+
commentSAXFunc comment;
|
| 783 |
+
warningSAXFunc warning;
|
| 784 |
+
errorSAXFunc error;
|
| 785 |
+
fatalErrorSAXFunc fatalError; /* unused error() get all the errors */
|
| 786 |
+
getParameterEntitySAXFunc getParameterEntity;
|
| 787 |
+
cdataBlockSAXFunc cdataBlock;
|
| 788 |
+
externalSubsetSAXFunc externalSubset;
|
| 789 |
+
unsigned int initialized;
|
| 790 |
+
};
|
| 791 |
+
|
| 792 |
+
|
| 793 |
+
/**
|
| 794 |
+
* xmlExternalEntityLoader:
|
| 795 |
+
* @URL: The System ID of the resource requested
|
| 796 |
+
* @ID: The Public ID of the resource requested
|
| 797 |
+
* @context: the XML parser context
|
| 798 |
+
*
|
| 799 |
+
* External entity loaders types.
|
| 800 |
+
*
|
| 801 |
+
* Returns the entity input parser.
|
| 802 |
+
*/
|
| 803 |
+
typedef xmlParserInputPtr (*xmlExternalEntityLoader) (const char *URL,
|
| 804 |
+
const char *ID,
|
| 805 |
+
xmlParserCtxtPtr context);
|
| 806 |
+
|
| 807 |
+
#ifdef __cplusplus
|
| 808 |
+
}
|
| 809 |
+
#endif
|
| 810 |
+
|
| 811 |
+
#include <libxml/encoding.h>
|
| 812 |
+
#include <libxml/xmlIO.h>
|
| 813 |
+
#include <libxml/globals.h>
|
| 814 |
+
|
| 815 |
+
#ifdef __cplusplus
|
| 816 |
+
extern "C" {
|
| 817 |
+
#endif
|
| 818 |
+
|
| 819 |
+
|
| 820 |
+
/*
|
| 821 |
+
* Init/Cleanup
|
| 822 |
+
*/
|
| 823 |
+
XMLPUBFUN void
|
| 824 |
+
xmlInitParser (void);
|
| 825 |
+
XMLPUBFUN void
|
| 826 |
+
xmlCleanupParser (void);
|
| 827 |
+
|
| 828 |
+
/*
|
| 829 |
+
* Input functions
|
| 830 |
+
*/
|
| 831 |
+
XML_DEPRECATED
|
| 832 |
+
XMLPUBFUN int
|
| 833 |
+
xmlParserInputRead (xmlParserInputPtr in,
|
| 834 |
+
int len);
|
| 835 |
+
XML_DEPRECATED
|
| 836 |
+
XMLPUBFUN int
|
| 837 |
+
xmlParserInputGrow (xmlParserInputPtr in,
|
| 838 |
+
int len);
|
| 839 |
+
|
| 840 |
+
/*
|
| 841 |
+
* Basic parsing Interfaces
|
| 842 |
+
*/
|
| 843 |
+
#ifdef LIBXML_SAX1_ENABLED
|
| 844 |
+
XMLPUBFUN xmlDocPtr
|
| 845 |
+
xmlParseDoc (const xmlChar *cur);
|
| 846 |
+
XMLPUBFUN xmlDocPtr
|
| 847 |
+
xmlParseFile (const char *filename);
|
| 848 |
+
XMLPUBFUN xmlDocPtr
|
| 849 |
+
xmlParseMemory (const char *buffer,
|
| 850 |
+
int size);
|
| 851 |
+
#endif /* LIBXML_SAX1_ENABLED */
|
| 852 |
+
XMLPUBFUN int
|
| 853 |
+
xmlSubstituteEntitiesDefault(int val);
|
| 854 |
+
XMLPUBFUN int
|
| 855 |
+
xmlKeepBlanksDefault (int val);
|
| 856 |
+
XMLPUBFUN void
|
| 857 |
+
xmlStopParser (xmlParserCtxtPtr ctxt);
|
| 858 |
+
XMLPUBFUN int
|
| 859 |
+
xmlPedanticParserDefault(int val);
|
| 860 |
+
XMLPUBFUN int
|
| 861 |
+
xmlLineNumbersDefault (int val);
|
| 862 |
+
|
| 863 |
+
#ifdef LIBXML_SAX1_ENABLED
|
| 864 |
+
/*
|
| 865 |
+
* Recovery mode
|
| 866 |
+
*/
|
| 867 |
+
XML_DEPRECATED
|
| 868 |
+
XMLPUBFUN xmlDocPtr
|
| 869 |
+
xmlRecoverDoc (const xmlChar *cur);
|
| 870 |
+
XML_DEPRECATED
|
| 871 |
+
XMLPUBFUN xmlDocPtr
|
| 872 |
+
xmlRecoverMemory (const char *buffer,
|
| 873 |
+
int size);
|
| 874 |
+
XML_DEPRECATED
|
| 875 |
+
XMLPUBFUN xmlDocPtr
|
| 876 |
+
xmlRecoverFile (const char *filename);
|
| 877 |
+
#endif /* LIBXML_SAX1_ENABLED */
|
| 878 |
+
|
| 879 |
+
/*
|
| 880 |
+
* Less common routines and SAX interfaces
|
| 881 |
+
*/
|
| 882 |
+
XMLPUBFUN int
|
| 883 |
+
xmlParseDocument (xmlParserCtxtPtr ctxt);
|
| 884 |
+
XMLPUBFUN int
|
| 885 |
+
xmlParseExtParsedEnt (xmlParserCtxtPtr ctxt);
|
| 886 |
+
#ifdef LIBXML_SAX1_ENABLED
|
| 887 |
+
XML_DEPRECATED
|
| 888 |
+
XMLPUBFUN int
|
| 889 |
+
xmlSAXUserParseFile (xmlSAXHandlerPtr sax,
|
| 890 |
+
void *user_data,
|
| 891 |
+
const char *filename);
|
| 892 |
+
XML_DEPRECATED
|
| 893 |
+
XMLPUBFUN int
|
| 894 |
+
xmlSAXUserParseMemory (xmlSAXHandlerPtr sax,
|
| 895 |
+
void *user_data,
|
| 896 |
+
const char *buffer,
|
| 897 |
+
int size);
|
| 898 |
+
XML_DEPRECATED
|
| 899 |
+
XMLPUBFUN xmlDocPtr
|
| 900 |
+
xmlSAXParseDoc (xmlSAXHandlerPtr sax,
|
| 901 |
+
const xmlChar *cur,
|
| 902 |
+
int recovery);
|
| 903 |
+
XML_DEPRECATED
|
| 904 |
+
XMLPUBFUN xmlDocPtr
|
| 905 |
+
xmlSAXParseMemory (xmlSAXHandlerPtr sax,
|
| 906 |
+
const char *buffer,
|
| 907 |
+
int size,
|
| 908 |
+
int recovery);
|
| 909 |
+
XML_DEPRECATED
|
| 910 |
+
XMLPUBFUN xmlDocPtr
|
| 911 |
+
xmlSAXParseMemoryWithData (xmlSAXHandlerPtr sax,
|
| 912 |
+
const char *buffer,
|
| 913 |
+
int size,
|
| 914 |
+
int recovery,
|
| 915 |
+
void *data);
|
| 916 |
+
XML_DEPRECATED
|
| 917 |
+
XMLPUBFUN xmlDocPtr
|
| 918 |
+
xmlSAXParseFile (xmlSAXHandlerPtr sax,
|
| 919 |
+
const char *filename,
|
| 920 |
+
int recovery);
|
| 921 |
+
XML_DEPRECATED
|
| 922 |
+
XMLPUBFUN xmlDocPtr
|
| 923 |
+
xmlSAXParseFileWithData (xmlSAXHandlerPtr sax,
|
| 924 |
+
const char *filename,
|
| 925 |
+
int recovery,
|
| 926 |
+
void *data);
|
| 927 |
+
XML_DEPRECATED
|
| 928 |
+
XMLPUBFUN xmlDocPtr
|
| 929 |
+
xmlSAXParseEntity (xmlSAXHandlerPtr sax,
|
| 930 |
+
const char *filename);
|
| 931 |
+
XML_DEPRECATED
|
| 932 |
+
XMLPUBFUN xmlDocPtr
|
| 933 |
+
xmlParseEntity (const char *filename);
|
| 934 |
+
#endif /* LIBXML_SAX1_ENABLED */
|
| 935 |
+
|
| 936 |
+
#ifdef LIBXML_VALID_ENABLED
|
| 937 |
+
XML_DEPRECATED
|
| 938 |
+
XMLPUBFUN xmlDtdPtr
|
| 939 |
+
xmlSAXParseDTD (xmlSAXHandlerPtr sax,
|
| 940 |
+
const xmlChar *ExternalID,
|
| 941 |
+
const xmlChar *SystemID);
|
| 942 |
+
XMLPUBFUN xmlDtdPtr
|
| 943 |
+
xmlParseDTD (const xmlChar *ExternalID,
|
| 944 |
+
const xmlChar *SystemID);
|
| 945 |
+
XMLPUBFUN xmlDtdPtr
|
| 946 |
+
xmlIOParseDTD (xmlSAXHandlerPtr sax,
|
| 947 |
+
xmlParserInputBufferPtr input,
|
| 948 |
+
xmlCharEncoding enc);
|
| 949 |
+
#endif /* LIBXML_VALID_ENABLE */
|
| 950 |
+
#ifdef LIBXML_SAX1_ENABLED
|
| 951 |
+
XMLPUBFUN int
|
| 952 |
+
xmlParseBalancedChunkMemory(xmlDocPtr doc,
|
| 953 |
+
xmlSAXHandlerPtr sax,
|
| 954 |
+
void *user_data,
|
| 955 |
+
int depth,
|
| 956 |
+
const xmlChar *string,
|
| 957 |
+
xmlNodePtr *lst);
|
| 958 |
+
#endif /* LIBXML_SAX1_ENABLED */
|
| 959 |
+
XMLPUBFUN xmlParserErrors
|
| 960 |
+
xmlParseInNodeContext (xmlNodePtr node,
|
| 961 |
+
const char *data,
|
| 962 |
+
int datalen,
|
| 963 |
+
int options,
|
| 964 |
+
xmlNodePtr *lst);
|
| 965 |
+
#ifdef LIBXML_SAX1_ENABLED
|
| 966 |
+
XMLPUBFUN int
|
| 967 |
+
xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc,
|
| 968 |
+
xmlSAXHandlerPtr sax,
|
| 969 |
+
void *user_data,
|
| 970 |
+
int depth,
|
| 971 |
+
const xmlChar *string,
|
| 972 |
+
xmlNodePtr *lst,
|
| 973 |
+
int recover);
|
| 974 |
+
XML_DEPRECATED
|
| 975 |
+
XMLPUBFUN int
|
| 976 |
+
xmlParseExternalEntity (xmlDocPtr doc,
|
| 977 |
+
xmlSAXHandlerPtr sax,
|
| 978 |
+
void *user_data,
|
| 979 |
+
int depth,
|
| 980 |
+
const xmlChar *URL,
|
| 981 |
+
const xmlChar *ID,
|
| 982 |
+
xmlNodePtr *lst);
|
| 983 |
+
#endif /* LIBXML_SAX1_ENABLED */
|
| 984 |
+
XMLPUBFUN int
|
| 985 |
+
xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx,
|
| 986 |
+
const xmlChar *URL,
|
| 987 |
+
const xmlChar *ID,
|
| 988 |
+
xmlNodePtr *lst);
|
| 989 |
+
|
| 990 |
+
/*
|
| 991 |
+
* Parser contexts handling.
|
| 992 |
+
*/
|
| 993 |
+
XMLPUBFUN xmlParserCtxtPtr
|
| 994 |
+
xmlNewParserCtxt (void);
|
| 995 |
+
XMLPUBFUN xmlParserCtxtPtr
|
| 996 |
+
xmlNewSAXParserCtxt (const xmlSAXHandler *sax,
|
| 997 |
+
void *userData);
|
| 998 |
+
XMLPUBFUN int
|
| 999 |
+
xmlInitParserCtxt (xmlParserCtxtPtr ctxt);
|
| 1000 |
+
XMLPUBFUN void
|
| 1001 |
+
xmlClearParserCtxt (xmlParserCtxtPtr ctxt);
|
| 1002 |
+
XMLPUBFUN void
|
| 1003 |
+
xmlFreeParserCtxt (xmlParserCtxtPtr ctxt);
|
| 1004 |
+
#ifdef LIBXML_SAX1_ENABLED
|
| 1005 |
+
XML_DEPRECATED
|
| 1006 |
+
XMLPUBFUN void
|
| 1007 |
+
xmlSetupParserForBuffer (xmlParserCtxtPtr ctxt,
|
| 1008 |
+
const xmlChar* buffer,
|
| 1009 |
+
const char *filename);
|
| 1010 |
+
#endif /* LIBXML_SAX1_ENABLED */
|
| 1011 |
+
XMLPUBFUN xmlParserCtxtPtr
|
| 1012 |
+
xmlCreateDocParserCtxt (const xmlChar *cur);
|
| 1013 |
+
|
| 1014 |
+
#ifdef LIBXML_LEGACY_ENABLED
|
| 1015 |
+
/*
|
| 1016 |
+
* Reading/setting optional parsing features.
|
| 1017 |
+
*/
|
| 1018 |
+
XML_DEPRECATED
|
| 1019 |
+
XMLPUBFUN int
|
| 1020 |
+
xmlGetFeaturesList (int *len,
|
| 1021 |
+
const char **result);
|
| 1022 |
+
XML_DEPRECATED
|
| 1023 |
+
XMLPUBFUN int
|
| 1024 |
+
xmlGetFeature (xmlParserCtxtPtr ctxt,
|
| 1025 |
+
const char *name,
|
| 1026 |
+
void *result);
|
| 1027 |
+
XML_DEPRECATED
|
| 1028 |
+
XMLPUBFUN int
|
| 1029 |
+
xmlSetFeature (xmlParserCtxtPtr ctxt,
|
| 1030 |
+
const char *name,
|
| 1031 |
+
void *value);
|
| 1032 |
+
#endif /* LIBXML_LEGACY_ENABLED */
|
| 1033 |
+
|
| 1034 |
+
#ifdef LIBXML_PUSH_ENABLED
|
| 1035 |
+
/*
|
| 1036 |
+
* Interfaces for the Push mode.
|
| 1037 |
+
*/
|
| 1038 |
+
XMLPUBFUN xmlParserCtxtPtr
|
| 1039 |
+
xmlCreatePushParserCtxt(xmlSAXHandlerPtr sax,
|
| 1040 |
+
void *user_data,
|
| 1041 |
+
const char *chunk,
|
| 1042 |
+
int size,
|
| 1043 |
+
const char *filename);
|
| 1044 |
+
XMLPUBFUN int
|
| 1045 |
+
xmlParseChunk (xmlParserCtxtPtr ctxt,
|
| 1046 |
+
const char *chunk,
|
| 1047 |
+
int size,
|
| 1048 |
+
int terminate);
|
| 1049 |
+
#endif /* LIBXML_PUSH_ENABLED */
|
| 1050 |
+
|
| 1051 |
+
/*
|
| 1052 |
+
* Special I/O mode.
|
| 1053 |
+
*/
|
| 1054 |
+
|
| 1055 |
+
XMLPUBFUN xmlParserCtxtPtr
|
| 1056 |
+
xmlCreateIOParserCtxt (xmlSAXHandlerPtr sax,
|
| 1057 |
+
void *user_data,
|
| 1058 |
+
xmlInputReadCallback ioread,
|
| 1059 |
+
xmlInputCloseCallback ioclose,
|
| 1060 |
+
void *ioctx,
|
| 1061 |
+
xmlCharEncoding enc);
|
| 1062 |
+
|
| 1063 |
+
XMLPUBFUN xmlParserInputPtr
|
| 1064 |
+
xmlNewIOInputStream (xmlParserCtxtPtr ctxt,
|
| 1065 |
+
xmlParserInputBufferPtr input,
|
| 1066 |
+
xmlCharEncoding enc);
|
| 1067 |
+
|
| 1068 |
+
/*
|
| 1069 |
+
* Node infos.
|
| 1070 |
+
*/
|
| 1071 |
+
XMLPUBFUN const xmlParserNodeInfo*
|
| 1072 |
+
xmlParserFindNodeInfo (const xmlParserCtxtPtr ctxt,
|
| 1073 |
+
const xmlNodePtr node);
|
| 1074 |
+
XMLPUBFUN void
|
| 1075 |
+
xmlInitNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
|
| 1076 |
+
XMLPUBFUN void
|
| 1077 |
+
xmlClearNodeInfoSeq (xmlParserNodeInfoSeqPtr seq);
|
| 1078 |
+
XMLPUBFUN unsigned long
|
| 1079 |
+
xmlParserFindNodeInfoIndex(const xmlParserNodeInfoSeqPtr seq,
|
| 1080 |
+
const xmlNodePtr node);
|
| 1081 |
+
XMLPUBFUN void
|
| 1082 |
+
xmlParserAddNodeInfo (xmlParserCtxtPtr ctxt,
|
| 1083 |
+
const xmlParserNodeInfoPtr info);
|
| 1084 |
+
|
| 1085 |
+
/*
|
| 1086 |
+
* External entities handling actually implemented in xmlIO.
|
| 1087 |
+
*/
|
| 1088 |
+
|
| 1089 |
+
XMLPUBFUN void
|
| 1090 |
+
xmlSetExternalEntityLoader(xmlExternalEntityLoader f);
|
| 1091 |
+
XMLPUBFUN xmlExternalEntityLoader
|
| 1092 |
+
xmlGetExternalEntityLoader(void);
|
| 1093 |
+
XMLPUBFUN xmlParserInputPtr
|
| 1094 |
+
xmlLoadExternalEntity (const char *URL,
|
| 1095 |
+
const char *ID,
|
| 1096 |
+
xmlParserCtxtPtr ctxt);
|
| 1097 |
+
|
| 1098 |
+
/*
|
| 1099 |
+
* Index lookup, actually implemented in the encoding module
|
| 1100 |
+
*/
|
| 1101 |
+
XMLPUBFUN long
|
| 1102 |
+
xmlByteConsumed (xmlParserCtxtPtr ctxt);
|
| 1103 |
+
|
| 1104 |
+
/*
|
| 1105 |
+
* New set of simpler/more flexible APIs
|
| 1106 |
+
*/
|
| 1107 |
+
/**
|
| 1108 |
+
* xmlParserOption:
|
| 1109 |
+
*
|
| 1110 |
+
* This is the set of XML parser options that can be passed down
|
| 1111 |
+
* to the xmlReadDoc() and similar calls.
|
| 1112 |
+
*/
|
| 1113 |
+
typedef enum {
|
| 1114 |
+
XML_PARSE_RECOVER = 1<<0, /* recover on errors */
|
| 1115 |
+
XML_PARSE_NOENT = 1<<1, /* substitute entities */
|
| 1116 |
+
XML_PARSE_DTDLOAD = 1<<2, /* load the external subset */
|
| 1117 |
+
XML_PARSE_DTDATTR = 1<<3, /* default DTD attributes */
|
| 1118 |
+
XML_PARSE_DTDVALID = 1<<4, /* validate with the DTD */
|
| 1119 |
+
XML_PARSE_NOERROR = 1<<5, /* suppress error reports */
|
| 1120 |
+
XML_PARSE_NOWARNING = 1<<6, /* suppress warning reports */
|
| 1121 |
+
XML_PARSE_PEDANTIC = 1<<7, /* pedantic error reporting */
|
| 1122 |
+
XML_PARSE_NOBLANKS = 1<<8, /* remove blank nodes */
|
| 1123 |
+
XML_PARSE_SAX1 = 1<<9, /* use the SAX1 interface internally */
|
| 1124 |
+
XML_PARSE_XINCLUDE = 1<<10,/* Implement XInclude substitution */
|
| 1125 |
+
XML_PARSE_NONET = 1<<11,/* Forbid network access */
|
| 1126 |
+
XML_PARSE_NODICT = 1<<12,/* Do not reuse the context dictionary */
|
| 1127 |
+
XML_PARSE_NSCLEAN = 1<<13,/* remove redundant namespaces declarations */
|
| 1128 |
+
XML_PARSE_NOCDATA = 1<<14,/* merge CDATA as text nodes */
|
| 1129 |
+
XML_PARSE_NOXINCNODE= 1<<15,/* do not generate XINCLUDE START/END nodes */
|
| 1130 |
+
XML_PARSE_COMPACT = 1<<16,/* compact small text nodes; no modification of
|
| 1131 |
+
the tree allowed afterwards (will possibly
|
| 1132 |
+
crash if you try to modify the tree) */
|
| 1133 |
+
XML_PARSE_OLD10 = 1<<17,/* parse using XML-1.0 before update 5 */
|
| 1134 |
+
XML_PARSE_NOBASEFIX = 1<<18,/* do not fixup XINCLUDE xml:base uris */
|
| 1135 |
+
XML_PARSE_HUGE = 1<<19,/* relax any hardcoded limit from the parser */
|
| 1136 |
+
XML_PARSE_OLDSAX = 1<<20,/* parse using SAX2 interface before 2.7.0 */
|
| 1137 |
+
XML_PARSE_IGNORE_ENC= 1<<21,/* ignore internal document encoding hint */
|
| 1138 |
+
XML_PARSE_BIG_LINES = 1<<22 /* Store big lines numbers in text PSVI field */
|
| 1139 |
+
} xmlParserOption;
|
| 1140 |
+
|
| 1141 |
+
XMLPUBFUN void
|
| 1142 |
+
xmlCtxtReset (xmlParserCtxtPtr ctxt);
|
| 1143 |
+
XMLPUBFUN int
|
| 1144 |
+
xmlCtxtResetPush (xmlParserCtxtPtr ctxt,
|
| 1145 |
+
const char *chunk,
|
| 1146 |
+
int size,
|
| 1147 |
+
const char *filename,
|
| 1148 |
+
const char *encoding);
|
| 1149 |
+
XMLPUBFUN int
|
| 1150 |
+
xmlCtxtUseOptions (xmlParserCtxtPtr ctxt,
|
| 1151 |
+
int options);
|
| 1152 |
+
XMLPUBFUN xmlDocPtr
|
| 1153 |
+
xmlReadDoc (const xmlChar *cur,
|
| 1154 |
+
const char *URL,
|
| 1155 |
+
const char *encoding,
|
| 1156 |
+
int options);
|
| 1157 |
+
XMLPUBFUN xmlDocPtr
|
| 1158 |
+
xmlReadFile (const char *URL,
|
| 1159 |
+
const char *encoding,
|
| 1160 |
+
int options);
|
| 1161 |
+
XMLPUBFUN xmlDocPtr
|
| 1162 |
+
xmlReadMemory (const char *buffer,
|
| 1163 |
+
int size,
|
| 1164 |
+
const char *URL,
|
| 1165 |
+
const char *encoding,
|
| 1166 |
+
int options);
|
| 1167 |
+
XMLPUBFUN xmlDocPtr
|
| 1168 |
+
xmlReadFd (int fd,
|
| 1169 |
+
const char *URL,
|
| 1170 |
+
const char *encoding,
|
| 1171 |
+
int options);
|
| 1172 |
+
XMLPUBFUN xmlDocPtr
|
| 1173 |
+
xmlReadIO (xmlInputReadCallback ioread,
|
| 1174 |
+
xmlInputCloseCallback ioclose,
|
| 1175 |
+
void *ioctx,
|
| 1176 |
+
const char *URL,
|
| 1177 |
+
const char *encoding,
|
| 1178 |
+
int options);
|
| 1179 |
+
XMLPUBFUN xmlDocPtr
|
| 1180 |
+
xmlCtxtReadDoc (xmlParserCtxtPtr ctxt,
|
| 1181 |
+
const xmlChar *cur,
|
| 1182 |
+
const char *URL,
|
| 1183 |
+
const char *encoding,
|
| 1184 |
+
int options);
|
| 1185 |
+
XMLPUBFUN xmlDocPtr
|
| 1186 |
+
xmlCtxtReadFile (xmlParserCtxtPtr ctxt,
|
| 1187 |
+
const char *filename,
|
| 1188 |
+
const char *encoding,
|
| 1189 |
+
int options);
|
| 1190 |
+
XMLPUBFUN xmlDocPtr
|
| 1191 |
+
xmlCtxtReadMemory (xmlParserCtxtPtr ctxt,
|
| 1192 |
+
const char *buffer,
|
| 1193 |
+
int size,
|
| 1194 |
+
const char *URL,
|
| 1195 |
+
const char *encoding,
|
| 1196 |
+
int options);
|
| 1197 |
+
XMLPUBFUN xmlDocPtr
|
| 1198 |
+
xmlCtxtReadFd (xmlParserCtxtPtr ctxt,
|
| 1199 |
+
int fd,
|
| 1200 |
+
const char *URL,
|
| 1201 |
+
const char *encoding,
|
| 1202 |
+
int options);
|
| 1203 |
+
XMLPUBFUN xmlDocPtr
|
| 1204 |
+
xmlCtxtReadIO (xmlParserCtxtPtr ctxt,
|
| 1205 |
+
xmlInputReadCallback ioread,
|
| 1206 |
+
xmlInputCloseCallback ioclose,
|
| 1207 |
+
void *ioctx,
|
| 1208 |
+
const char *URL,
|
| 1209 |
+
const char *encoding,
|
| 1210 |
+
int options);
|
| 1211 |
+
|
| 1212 |
+
/*
|
| 1213 |
+
* Library wide options
|
| 1214 |
+
*/
|
| 1215 |
+
/**
|
| 1216 |
+
* xmlFeature:
|
| 1217 |
+
*
|
| 1218 |
+
* Used to examine the existence of features that can be enabled
|
| 1219 |
+
* or disabled at compile-time.
|
| 1220 |
+
* They used to be called XML_FEATURE_xxx but this clashed with Expat
|
| 1221 |
+
*/
|
| 1222 |
+
typedef enum {
|
| 1223 |
+
XML_WITH_THREAD = 1,
|
| 1224 |
+
XML_WITH_TREE = 2,
|
| 1225 |
+
XML_WITH_OUTPUT = 3,
|
| 1226 |
+
XML_WITH_PUSH = 4,
|
| 1227 |
+
XML_WITH_READER = 5,
|
| 1228 |
+
XML_WITH_PATTERN = 6,
|
| 1229 |
+
XML_WITH_WRITER = 7,
|
| 1230 |
+
XML_WITH_SAX1 = 8,
|
| 1231 |
+
XML_WITH_FTP = 9,
|
| 1232 |
+
XML_WITH_HTTP = 10,
|
| 1233 |
+
XML_WITH_VALID = 11,
|
| 1234 |
+
XML_WITH_HTML = 12,
|
| 1235 |
+
XML_WITH_LEGACY = 13,
|
| 1236 |
+
XML_WITH_C14N = 14,
|
| 1237 |
+
XML_WITH_CATALOG = 15,
|
| 1238 |
+
XML_WITH_XPATH = 16,
|
| 1239 |
+
XML_WITH_XPTR = 17,
|
| 1240 |
+
XML_WITH_XINCLUDE = 18,
|
| 1241 |
+
XML_WITH_ICONV = 19,
|
| 1242 |
+
XML_WITH_ISO8859X = 20,
|
| 1243 |
+
XML_WITH_UNICODE = 21,
|
| 1244 |
+
XML_WITH_REGEXP = 22,
|
| 1245 |
+
XML_WITH_AUTOMATA = 23,
|
| 1246 |
+
XML_WITH_EXPR = 24,
|
| 1247 |
+
XML_WITH_SCHEMAS = 25,
|
| 1248 |
+
XML_WITH_SCHEMATRON = 26,
|
| 1249 |
+
XML_WITH_MODULES = 27,
|
| 1250 |
+
XML_WITH_DEBUG = 28,
|
| 1251 |
+
XML_WITH_DEBUG_MEM = 29,
|
| 1252 |
+
XML_WITH_DEBUG_RUN = 30,
|
| 1253 |
+
XML_WITH_ZLIB = 31,
|
| 1254 |
+
XML_WITH_ICU = 32,
|
| 1255 |
+
XML_WITH_LZMA = 33,
|
| 1256 |
+
XML_WITH_NONE = 99999 /* just to be sure of allocation size */
|
| 1257 |
+
} xmlFeature;
|
| 1258 |
+
|
| 1259 |
+
XMLPUBFUN int
|
| 1260 |
+
xmlHasFeature (xmlFeature feature);
|
| 1261 |
+
|
| 1262 |
+
#ifdef __cplusplus
|
| 1263 |
+
}
|
| 1264 |
+
#endif
|
| 1265 |
+
#endif /* __XML_PARSER_H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ines
|
| 4 |
+
* they are not really all intended for applications but
|
| 5 |
+
* can prove useful doing low level processing.
|
| 6 |
+
*
|
| 7 |
+
* Copy: See Copyright for the status of this software.
|
| 8 |
+
*
|
| 9 |
+
* Author: Daniel Veillard
|
| 10 |
+
*/
|
| 11 |
+
|
| 12 |
+
#ifndef __XML_PARSER_INTERNALS_H__
|
| 13 |
+
#define __XML_PARSER_INTERNALS_H__
|
| 14 |
+
|
| 15 |
+
#include <libxml/xmlversion.h>
|
| 16 |
+
#include <libxml/parser.h>
|
| 17 |
+
#include <libxml/HTMLparser.h>
|
| 18 |
+
#include <libxml/chvalid.h>
|
| 19 |
+
|
| 20 |
+
#ifdef __cplusplus
|
| 21 |
+
extern "C" {
|
| 22 |
+
#endif
|
| 23 |
+
|
| 24 |
+
/**
|
| 25 |
+
* xmlParserMaxDepth:
|
| 26 |
+
*
|
| 27 |
+
* arbitrary depth limit for the XML documents that we allow to
|
| 28 |
+
* process. This is not a limitation of the parser but a safety
|
| 29 |
+
* boundary feature, use XML_PARSE_HUGE option to override it.
|
| 30 |
+
*/
|
| 31 |
+
XMLPUBVAR unsigned int xmlParserMaxDepth;
|
| 32 |
+
|
| 33 |
+
/**
|
| 34 |
+
* XML_MAX_TEXT_LENGTH:
|
| 35 |
+
*
|
| 36 |
+
* Maximum size allowed for a single text node when building a tree.
|
| 37 |
+
* This is not a limitation of the parser but a safety boundary feature,
|
| 38 |
+
* use XML_PARSE_HUGE option to override it.
|
| 39 |
+
* Introduced in 2.9.0
|
| 40 |
+
*/
|
| 41 |
+
#define XML_MAX_TEXT_LENGTH 10000000
|
| 42 |
+
|
| 43 |
+
/**
|
| 44 |
+
* XML_MAX_HUGE_LENGTH:
|
| 45 |
+
*
|
| 46 |
+
* Maximum size allowed when XML_PARSE_HUGE is set.
|
| 47 |
+
*/
|
| 48 |
+
#define XML_MAX_HUGE_LENGTH 1000000000
|
| 49 |
+
|
| 50 |
+
/**
|
| 51 |
+
* XML_MAX_NAME_LENGTH:
|
| 52 |
+
*
|
| 53 |
+
* Maximum size allowed for a markup identifier.
|
| 54 |
+
* This is not a limitation of the parser but a safety boundary feature,
|
| 55 |
+
* use XML_PARSE_HUGE option to override it.
|
| 56 |
+
* Note that with the use of parsing dictionaries overriding the limit
|
| 57 |
+
* may result in more runtime memory usage in face of "unfriendly' content
|
| 58 |
+
* Introduced in 2.9.0
|
| 59 |
+
*/
|
| 60 |
+
#define XML_MAX_NAME_LENGTH 50000
|
| 61 |
+
|
| 62 |
+
/**
|
| 63 |
+
* XML_MAX_DICTIONARY_LIMIT:
|
| 64 |
+
*
|
| 65 |
+
* Maximum size allowed by the parser for a dictionary by default
|
| 66 |
+
* This is not a limitation of the parser but a safety boundary feature,
|
| 67 |
+
* use XML_PARSE_HUGE option to override it.
|
| 68 |
+
* Introduced in 2.9.0
|
| 69 |
+
*/
|
| 70 |
+
#define XML_MAX_DICTIONARY_LIMIT 10000000
|
| 71 |
+
|
| 72 |
+
/**
|
| 73 |
+
* XML_MAX_LOOKUP_LIMIT:
|
| 74 |
+
*
|
| 75 |
+
* Maximum size allowed by the parser for ahead lookup
|
| 76 |
+
* This is an upper boundary enforced by the parser to avoid bad
|
| 77 |
+
* behaviour on "unfriendly' content
|
| 78 |
+
* Introduced in 2.9.0
|
| 79 |
+
*/
|
| 80 |
+
#define XML_MAX_LOOKUP_LIMIT 10000000
|
| 81 |
+
|
| 82 |
+
/**
|
| 83 |
+
* XML_MAX_NAMELEN:
|
| 84 |
+
*
|
| 85 |
+
* Identifiers can be longer, but this will be more costly
|
| 86 |
+
* at runtime.
|
| 87 |
+
*/
|
| 88 |
+
#define XML_MAX_NAMELEN 100
|
| 89 |
+
|
| 90 |
+
/**
|
| 91 |
+
* INPUT_CHUNK:
|
| 92 |
+
*
|
| 93 |
+
* The parser tries to always have that amount of input ready.
|
| 94 |
+
* One of the point is providing context when reporting errors.
|
| 95 |
+
*/
|
| 96 |
+
#define INPUT_CHUNK 250
|
| 97 |
+
|
| 98 |
+
/************************************************************************
|
| 99 |
+
* *
|
| 100 |
+
* UNICODE version of the macros. *
|
| 101 |
+
* *
|
| 102 |
+
************************************************************************/
|
| 103 |
+
/**
|
| 104 |
+
* IS_BYTE_CHAR:
|
| 105 |
+
* @c: an byte value (int)
|
| 106 |
+
*
|
| 107 |
+
* Macro to check the following production in the XML spec:
|
| 108 |
+
*
|
| 109 |
+
* [2] Char ::= #x9 | #xA | #xD | [#x20...]
|
| 110 |
+
* any byte character in the accepted range
|
| 111 |
+
*/
|
| 112 |
+
#define IS_BYTE_CHAR(c) xmlIsChar_ch(c)
|
| 113 |
+
|
| 114 |
+
/**
|
| 115 |
+
* IS_CHAR:
|
| 116 |
+
* @c: an UNICODE value (int)
|
| 117 |
+
*
|
| 118 |
+
* Macro to check the following production in the XML spec:
|
| 119 |
+
*
|
| 120 |
+
* [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]
|
| 121 |
+
* | [#x10000-#x10FFFF]
|
| 122 |
+
* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF.
|
| 123 |
+
*/
|
| 124 |
+
#define IS_CHAR(c) xmlIsCharQ(c)
|
| 125 |
+
|
| 126 |
+
/**
|
| 127 |
+
* IS_CHAR_CH:
|
| 128 |
+
* @c: an xmlChar (usually an unsigned char)
|
| 129 |
+
*
|
| 130 |
+
* Behaves like IS_CHAR on single-byte value
|
| 131 |
+
*/
|
| 132 |
+
#define IS_CHAR_CH(c) xmlIsChar_ch(c)
|
| 133 |
+
|
| 134 |
+
/**
|
| 135 |
+
* IS_BLANK:
|
| 136 |
+
* @c: an UNICODE value (int)
|
| 137 |
+
*
|
| 138 |
+
* Macro to check the following production in the XML spec:
|
| 139 |
+
*
|
| 140 |
+
* [3] S ::= (#x20 | #x9 | #xD | #xA)+
|
| 141 |
+
*/
|
| 142 |
+
#define IS_BLANK(c) xmlIsBlankQ(c)
|
| 143 |
+
|
| 144 |
+
/**
|
| 145 |
+
* IS_BLANK_CH:
|
| 146 |
+
* @c: an xmlChar value (normally unsigned char)
|
| 147 |
+
*
|
| 148 |
+
* Behaviour same as IS_BLANK
|
| 149 |
+
*/
|
| 150 |
+
#define IS_BLANK_CH(c) xmlIsBlank_ch(c)
|
| 151 |
+
|
| 152 |
+
/**
|
| 153 |
+
* IS_BASECHAR:
|
| 154 |
+
* @c: an UNICODE value (int)
|
| 155 |
+
*
|
| 156 |
+
* Macro to check the following production in the XML spec:
|
| 157 |
+
*
|
| 158 |
+
* [85] BaseChar ::= ... long list see REC ...
|
| 159 |
+
*/
|
| 160 |
+
#define IS_BASECHAR(c) xmlIsBaseCharQ(c)
|
| 161 |
+
|
| 162 |
+
/**
|
| 163 |
+
* IS_DIGIT:
|
| 164 |
+
* @c: an UNICODE value (int)
|
| 165 |
+
*
|
| 166 |
+
* Macro to check the following production in the XML spec:
|
| 167 |
+
*
|
| 168 |
+
* [88] Digit ::= ... long list see REC ...
|
| 169 |
+
*/
|
| 170 |
+
#define IS_DIGIT(c) xmlIsDigitQ(c)
|
| 171 |
+
|
| 172 |
+
/**
|
| 173 |
+
* IS_DIGIT_CH:
|
| 174 |
+
* @c: an xmlChar value (usually an unsigned char)
|
| 175 |
+
*
|
| 176 |
+
* Behaves like IS_DIGIT but with a single byte argument
|
| 177 |
+
*/
|
| 178 |
+
#define IS_DIGIT_CH(c) xmlIsDigit_ch(c)
|
| 179 |
+
|
| 180 |
+
/**
|
| 181 |
+
* IS_COMBINING:
|
| 182 |
+
* @c: an UNICODE value (int)
|
| 183 |
+
*
|
| 184 |
+
* Macro to check the following production in the XML spec:
|
| 185 |
+
*
|
| 186 |
+
* [87] CombiningChar ::= ... long list see REC ...
|
| 187 |
+
*/
|
| 188 |
+
#define IS_COMBINING(c) xmlIsCombiningQ(c)
|
| 189 |
+
|
| 190 |
+
/**
|
| 191 |
+
* IS_COMBINING_CH:
|
| 192 |
+
* @c: an xmlChar (usually an unsigned char)
|
| 193 |
+
*
|
| 194 |
+
* Always false (all combining chars > 0xff)
|
| 195 |
+
*/
|
| 196 |
+
#define IS_COMBINING_CH(c) 0
|
| 197 |
+
|
| 198 |
+
/**
|
| 199 |
+
* IS_EXTENDER:
|
| 200 |
+
* @c: an UNICODE value (int)
|
| 201 |
+
*
|
| 202 |
+
* Macro to check the following production in the XML spec:
|
| 203 |
+
*
|
| 204 |
+
*
|
| 205 |
+
* [89] Extender ::= #x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 |
|
| 206 |
+
* #x0E46 | #x0EC6 | #x3005 | [#x3031-#x3035] |
|
| 207 |
+
* [#x309D-#x309E] | [#x30FC-#x30FE]
|
| 208 |
+
*/
|
| 209 |
+
#define IS_EXTENDER(c) xmlIsExtenderQ(c)
|
| 210 |
+
|
| 211 |
+
/**
|
| 212 |
+
* IS_EXTENDER_CH:
|
| 213 |
+
* @c: an xmlChar value (usually an unsigned char)
|
| 214 |
+
*
|
| 215 |
+
* Behaves like IS_EXTENDER but with a single-byte argument
|
| 216 |
+
*/
|
| 217 |
+
#define IS_EXTENDER_CH(c) xmlIsExtender_ch(c)
|
| 218 |
+
|
| 219 |
+
/**
|
| 220 |
+
* IS_IDEOGRAPHIC:
|
| 221 |
+
* @c: an UNICODE value (int)
|
| 222 |
+
*
|
| 223 |
+
* Macro to check the following production in the XML spec:
|
| 224 |
+
*
|
| 225 |
+
*
|
| 226 |
+
* [86] Ideographic ::= [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029]
|
| 227 |
+
*/
|
| 228 |
+
#define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c)
|
| 229 |
+
|
| 230 |
+
/**
|
| 231 |
+
* IS_LETTER:
|
| 232 |
+
* @c: an UNICODE value (int)
|
| 233 |
+
*
|
| 234 |
+
* Macro to check the following production in the XML spec:
|
| 235 |
+
*
|
| 236 |
+
*
|
| 237 |
+
* [84] Letter ::= BaseChar | Ideographic
|
| 238 |
+
*/
|
| 239 |
+
#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
|
| 240 |
+
|
| 241 |
+
/**
|
| 242 |
+
* IS_LETTER_CH:
|
| 243 |
+
* @c: an xmlChar value (normally unsigned char)
|
| 244 |
+
*
|
| 245 |
+
* Macro behaves like IS_LETTER, but only check base chars
|
| 246 |
+
*
|
| 247 |
+
*/
|
| 248 |
+
#define IS_LETTER_CH(c) xmlIsBaseChar_ch(c)
|
| 249 |
+
|
| 250 |
+
/**
|
| 251 |
+
* IS_ASCII_LETTER:
|
| 252 |
+
* @c: an xmlChar value
|
| 253 |
+
*
|
| 254 |
+
* Macro to check [a-zA-Z]
|
| 255 |
+
*
|
| 256 |
+
*/
|
| 257 |
+
#define IS_ASCII_LETTER(c) (((0x41 <= (c)) && ((c) <= 0x5a)) || \
|
| 258 |
+
((0x61 <= (c)) && ((c) <= 0x7a)))
|
| 259 |
+
|
| 260 |
+
/**
|
| 261 |
+
* IS_ASCII_DIGIT:
|
| 262 |
+
* @c: an xmlChar value
|
| 263 |
+
*
|
| 264 |
+
* Macro to check [0-9]
|
| 265 |
+
*
|
| 266 |
+
*/
|
| 267 |
+
#define IS_ASCII_DIGIT(c) ((0x30 <= (c)) && ((c) <= 0x39))
|
| 268 |
+
|
| 269 |
+
/**
|
| 270 |
+
* IS_PUBIDCHAR:
|
| 271 |
+
* @c: an UNICODE value (int)
|
| 272 |
+
*
|
| 273 |
+
* Macro to check the following production in the XML spec:
|
| 274 |
+
*
|
| 275 |
+
*
|
| 276 |
+
* [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
|
| 277 |
+
*/
|
| 278 |
+
#define IS_PUBIDCHAR(c) xmlIsPubidCharQ(c)
|
| 279 |
+
|
| 280 |
+
/**
|
| 281 |
+
* IS_PUBIDCHAR_CH:
|
| 282 |
+
* @c: an xmlChar value (normally unsigned char)
|
| 283 |
+
*
|
| 284 |
+
* Same as IS_PUBIDCHAR but for single-byte value
|
| 285 |
+
*/
|
| 286 |
+
#define IS_PUBIDCHAR_CH(c) xmlIsPubidChar_ch(c)
|
| 287 |
+
|
| 288 |
+
/**
|
| 289 |
+
* Global variables used for predefined strings.
|
| 290 |
+
*/
|
| 291 |
+
XMLPUBVAR const xmlChar xmlStringText[];
|
| 292 |
+
XMLPUBVAR const xmlChar xmlStringTextNoenc[];
|
| 293 |
+
XMLPUBVAR const xmlChar xmlStringComment[];
|
| 294 |
+
|
| 295 |
+
/*
|
| 296 |
+
* Function to finish the work of the macros where needed.
|
| 297 |
+
*/
|
| 298 |
+
XMLPUBFUN int xmlIsLetter (int c);
|
| 299 |
+
|
| 300 |
+
/**
|
| 301 |
+
* Parser context.
|
| 302 |
+
*/
|
| 303 |
+
XMLPUBFUN xmlParserCtxtPtr
|
| 304 |
+
xmlCreateFileParserCtxt (const char *filename);
|
| 305 |
+
XMLPUBFUN xmlParserCtxtPtr
|
| 306 |
+
xmlCreateURLParserCtxt (const char *filename,
|
| 307 |
+
int options);
|
| 308 |
+
XMLPUBFUN xmlParserCtxtPtr
|
| 309 |
+
xmlCreateMemoryParserCtxt(const char *buffer,
|
| 310 |
+
int size);
|
| 311 |
+
XMLPUBFUN xmlParserCtxtPtr
|
| 312 |
+
xmlCreateEntityParserCtxt(const xmlChar *URL,
|
| 313 |
+
const xmlChar *ID,
|
| 314 |
+
const xmlChar *base);
|
| 315 |
+
XMLPUBFUN int
|
| 316 |
+
xmlSwitchEncoding (xmlParserCtxtPtr ctxt,
|
| 317 |
+
xmlCharEncoding enc);
|
| 318 |
+
XMLPUBFUN int
|
| 319 |
+
xmlSwitchToEncoding (xmlParserCtxtPtr ctxt,
|
| 320 |
+
xmlCharEncodingHandlerPtr handler);
|
| 321 |
+
XML_DEPRECATED
|
| 322 |
+
XMLPUBFUN int
|
| 323 |
+
xmlSwitchInputEncoding (xmlParserCtxtPtr ctxt,
|
| 324 |
+
xmlParserInputPtr input,
|
| 325 |
+
xmlCharEncodingHandlerPtr handler);
|
| 326 |
+
|
| 327 |
+
/**
|
| 328 |
+
* Input Streams.
|
| 329 |
+
*/
|
| 330 |
+
XMLPUBFUN xmlParserInputPtr
|
| 331 |
+
xmlNewStringInputStream (xmlParserCtxtPtr ctxt,
|
| 332 |
+
const xmlChar *buffer);
|
| 333 |
+
XML_DEPRECATED
|
| 334 |
+
XMLPUBFUN xmlParserInputPtr
|
| 335 |
+
xmlNewEntityInputStream (xmlParserCtxtPtr ctxt,
|
| 336 |
+
xmlEntityPtr entity);
|
| 337 |
+
XMLPUBFUN int
|
| 338 |
+
xmlPushInput (xmlParserCtxtPtr ctxt,
|
| 339 |
+
xmlParserInputPtr input);
|
| 340 |
+
XMLPUBFUN xmlChar
|
| 341 |
+
xmlPopInput (xmlParserCtxtPtr ctxt);
|
| 342 |
+
XMLPUBFUN void
|
| 343 |
+
xmlFreeInputStream (xmlParserInputPtr input);
|
| 344 |
+
XMLPUBFUN xmlParserInputPtr
|
| 345 |
+
xmlNewInputFromFile (xmlParserCtxtPtr ctxt,
|
| 346 |
+
const char *filename);
|
| 347 |
+
XMLPUBFUN xmlParserInputPtr
|
| 348 |
+
xmlNewInputStream (xmlParserCtxtPtr ctxt);
|
| 349 |
+
|
| 350 |
+
/**
|
| 351 |
+
* Namespaces.
|
| 352 |
+
*/
|
| 353 |
+
XMLPUBFUN xmlChar *
|
| 354 |
+
xmlSplitQName (xmlParserCtxtPtr ctxt,
|
| 355 |
+
const xmlChar *name,
|
| 356 |
+
xmlChar **prefix);
|
| 357 |
+
|
| 358 |
+
/**
|
| 359 |
+
* Generic production rules.
|
| 360 |
+
*/
|
| 361 |
+
XML_DEPRECATED
|
| 362 |
+
XMLPUBFUN const xmlChar *
|
| 363 |
+
xmlParseName (xmlParserCtxtPtr ctxt);
|
| 364 |
+
XML_DEPRECATED
|
| 365 |
+
XMLPUBFUN xmlChar *
|
| 366 |
+
xmlParseNmtoken (xmlParserCtxtPtr ctxt);
|
| 367 |
+
XML_DEPRECATED
|
| 368 |
+
XMLPUBFUN xmlChar *
|
| 369 |
+
xmlParseEntityValue (xmlParserCtxtPtr ctxt,
|
| 370 |
+
xmlChar **orig);
|
| 371 |
+
XML_DEPRECATED
|
| 372 |
+
XMLPUBFUN xmlChar *
|
| 373 |
+
xmlParseAttValue (xmlParserCtxtPtr ctxt);
|
| 374 |
+
XML_DEPRECATED
|
| 375 |
+
XMLPUBFUN xmlChar *
|
| 376 |
+
xmlParseSystemLiteral (xmlParserCtxtPtr ctxt);
|
| 377 |
+
XML_DEPRECATED
|
| 378 |
+
XMLPUBFUN xmlChar *
|
| 379 |
+
xmlParsePubidLiteral (xmlParserCtxtPtr ctxt);
|
| 380 |
+
XML_DEPRECATED
|
| 381 |
+
XMLPUBFUN void
|
| 382 |
+
xmlParseCharData (xmlParserCtxtPtr ctxt,
|
| 383 |
+
int cdata);
|
| 384 |
+
XML_DEPRECATED
|
| 385 |
+
XMLPUBFUN xmlChar *
|
| 386 |
+
xmlParseExternalID (xmlParserCtxtPtr ctxt,
|
| 387 |
+
xmlChar **publicID,
|
| 388 |
+
int strict);
|
| 389 |
+
XML_DEPRECATED
|
| 390 |
+
XMLPUBFUN void
|
| 391 |
+
xmlParseComment (xmlParserCtxtPtr ctxt);
|
| 392 |
+
XML_DEPRECATED
|
| 393 |
+
XMLPUBFUN const xmlChar *
|
| 394 |
+
xmlParsePITarget (xmlParserCtxtPtr ctxt);
|
| 395 |
+
XML_DEPRECATED
|
| 396 |
+
XMLPUBFUN void
|
| 397 |
+
xmlParsePI (xmlParserCtxtPtr ctxt);
|
| 398 |
+
XML_DEPRECATED
|
| 399 |
+
XMLPUBFUN void
|
| 400 |
+
xmlParseNotationDecl (xmlParserCtxtPtr ctxt);
|
| 401 |
+
XML_DEPRECATED
|
| 402 |
+
XMLPUBFUN void
|
| 403 |
+
xmlParseEntityDecl (xmlParserCtxtPtr ctxt);
|
| 404 |
+
XML_DEPRECATED
|
| 405 |
+
XMLPUBFUN int
|
| 406 |
+
xmlParseDefaultDecl (xmlParserCtxtPtr ctxt,
|
| 407 |
+
xmlChar **value);
|
| 408 |
+
XML_DEPRECATED
|
| 409 |
+
XMLPUBFUN xmlEnumerationPtr
|
| 410 |
+
xmlParseNotationType (xmlParserCtxtPtr ctxt);
|
| 411 |
+
XML_DEPRECATED
|
| 412 |
+
XMLPUBFUN xmlEnumerationPtr
|
| 413 |
+
xmlParseEnumerationType (xmlParserCtxtPtr ctxt);
|
| 414 |
+
XML_DEPRECATED
|
| 415 |
+
XMLPUBFUN int
|
| 416 |
+
xmlParseEnumeratedType (xmlParserCtxtPtr ctxt,
|
| 417 |
+
xmlEnumerationPtr *tree);
|
| 418 |
+
XML_DEPRECATED
|
| 419 |
+
XMLPUBFUN int
|
| 420 |
+
xmlParseAttributeType (xmlParserCtxtPtr ctxt,
|
| 421 |
+
xmlEnumerationPtr *tree);
|
| 422 |
+
XML_DEPRECATED
|
| 423 |
+
XMLPUBFUN void
|
| 424 |
+
xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt);
|
| 425 |
+
XML_DEPRECATED
|
| 426 |
+
XMLPUBFUN xmlElementContentPtr
|
| 427 |
+
xmlParseElementMixedContentDecl
|
| 428 |
+
(xmlParserCtxtPtr ctxt,
|
| 429 |
+
int inputchk);
|
| 430 |
+
XML_DEPRECATED
|
| 431 |
+
XMLPUBFUN xmlElementContentPtr
|
| 432 |
+
xmlParseElementChildrenContentDecl
|
| 433 |
+
(xmlParserCtxtPtr ctxt,
|
| 434 |
+
int inputchk);
|
| 435 |
+
XML_DEPRECATED
|
| 436 |
+
XMLPUBFUN int
|
| 437 |
+
xmlParseElementContentDecl(xmlParserCtxtPtr ctxt,
|
| 438 |
+
const xmlChar *name,
|
| 439 |
+
xmlElementContentPtr *result);
|
| 440 |
+
XML_DEPRECATED
|
| 441 |
+
XMLPUBFUN int
|
| 442 |
+
xmlParseElementDecl (xmlParserCtxtPtr ctxt);
|
| 443 |
+
XML_DEPRECATED
|
| 444 |
+
XMLPUBFUN void
|
| 445 |
+
xmlParseMarkupDecl (xmlParserCtxtPtr ctxt);
|
| 446 |
+
XML_DEPRECATED
|
| 447 |
+
XMLPUBFUN int
|
| 448 |
+
xmlParseCharRef (xmlParserCtxtPtr ctxt);
|
| 449 |
+
XML_DEPRECATED
|
| 450 |
+
XMLPUBFUN xmlEntityPtr
|
| 451 |
+
xmlParseEntityRef (xmlParserCtxtPtr ctxt);
|
| 452 |
+
XML_DEPRECATED
|
| 453 |
+
XMLPUBFUN void
|
| 454 |
+
xmlParseReference (xmlParserCtxtPtr ctxt);
|
| 455 |
+
XML_DEPRECATED
|
| 456 |
+
XMLPUBFUN void
|
| 457 |
+
xmlParsePEReference (xmlParserCtxtPtr ctxt);
|
| 458 |
+
XML_DEPRECATED
|
| 459 |
+
XMLPUBFUN void
|
| 460 |
+
xmlParseDocTypeDecl (xmlParserCtxtPtr ctxt);
|
| 461 |
+
#ifdef LIBXML_SAX1_ENABLED
|
| 462 |
+
XML_DEPRECATED
|
| 463 |
+
XMLPUBFUN const xmlChar *
|
| 464 |
+
xmlParseAttribute (xmlParserCtxtPtr ctxt,
|
| 465 |
+
xmlChar **value);
|
| 466 |
+
XML_DEPRECATED
|
| 467 |
+
XMLPUBFUN const xmlChar *
|
| 468 |
+
xmlParseStartTag (xmlParserCtxtPtr ctxt);
|
| 469 |
+
XML_DEPRECATED
|
| 470 |
+
XMLPUBFUN void
|
| 471 |
+
xmlParseEndTag (xmlParserCtxtPtr ctxt);
|
| 472 |
+
#endif /* LIBXML_SAX1_ENABLED */
|
| 473 |
+
XML_DEPRECATED
|
| 474 |
+
XMLPUBFUN void
|
| 475 |
+
xmlParseCDSect (xmlParserCtxtPtr ctxt);
|
| 476 |
+
XMLPUBFUN void
|
| 477 |
+
xmlParseContent (xmlParserCtxtPtr ctxt);
|
| 478 |
+
XML_DEPRECATED
|
| 479 |
+
XMLPUBFUN void
|
| 480 |
+
xmlParseElement (xmlParserCtxtPtr ctxt);
|
| 481 |
+
XML_DEPRECATED
|
| 482 |
+
XMLPUBFUN xmlChar *
|
| 483 |
+
xmlParseVersionNum (xmlParserCtxtPtr ctxt);
|
| 484 |
+
XML_DEPRECATED
|
| 485 |
+
XMLPUBFUN xmlChar *
|
| 486 |
+
xmlParseVersionInfo (xmlParserCtxtPtr ctxt);
|
| 487 |
+
XML_DEPRECATED
|
| 488 |
+
XMLPUBFUN xmlChar *
|
| 489 |
+
xmlParseEncName (xmlParserCtxtPtr ctxt);
|
| 490 |
+
XML_DEPRECATED
|
| 491 |
+
XMLPUBFUN const xmlChar *
|
| 492 |
+
xmlParseEncodingDecl (xmlParserCtxtPtr ctxt);
|
| 493 |
+
XML_DEPRECATED
|
| 494 |
+
XMLPUBFUN int
|
| 495 |
+
xmlParseSDDecl (xmlParserCtxtPtr ctxt);
|
| 496 |
+
XML_DEPRECATED
|
| 497 |
+
XMLPUBFUN void
|
| 498 |
+
xmlParseXMLDecl (xmlParserCtxtPtr ctxt);
|
| 499 |
+
XML_DEPRECATED
|
| 500 |
+
XMLPUBFUN void
|
| 501 |
+
xmlParseTextDecl (xmlParserCtxtPtr ctxt);
|
| 502 |
+
XML_DEPRECATED
|
| 503 |
+
XMLPUBFUN void
|
| 504 |
+
xmlParseMisc (xmlParserCtxtPtr ctxt);
|
| 505 |
+
XMLPUBFUN void
|
| 506 |
+
xmlParseExternalSubset (xmlParserCtxtPtr ctxt,
|
| 507 |
+
const xmlChar *ExternalID,
|
| 508 |
+
const xmlChar *SystemID);
|
| 509 |
+
/**
|
| 510 |
+
* XML_SUBSTITUTE_NONE:
|
| 511 |
+
*
|
| 512 |
+
* If no entities need to be substituted.
|
| 513 |
+
*/
|
| 514 |
+
#define XML_SUBSTITUTE_NONE 0
|
| 515 |
+
/**
|
| 516 |
+
* XML_SUBSTITUTE_REF:
|
| 517 |
+
*
|
| 518 |
+
* Whether general entities need to be substituted.
|
| 519 |
+
*/
|
| 520 |
+
#define XML_SUBSTITUTE_REF 1
|
| 521 |
+
/**
|
| 522 |
+
* XML_SUBSTITUTE_PEREF:
|
| 523 |
+
*
|
| 524 |
+
* Whether parameter entities need to be substituted.
|
| 525 |
+
*/
|
| 526 |
+
#define XML_SUBSTITUTE_PEREF 2
|
| 527 |
+
/**
|
| 528 |
+
* XML_SUBSTITUTE_BOTH:
|
| 529 |
+
*
|
| 530 |
+
* Both general and parameter entities need to be substituted.
|
| 531 |
+
*/
|
| 532 |
+
#define XML_SUBSTITUTE_BOTH 3
|
| 533 |
+
|
| 534 |
+
XML_DEPRECATED
|
| 535 |
+
XMLPUBFUN xmlChar *
|
| 536 |
+
xmlStringDecodeEntities (xmlParserCtxtPtr ctxt,
|
| 537 |
+
const xmlChar *str,
|
| 538 |
+
int what,
|
| 539 |
+
xmlChar end,
|
| 540 |
+
xmlChar end2,
|
| 541 |
+
xmlChar end3);
|
| 542 |
+
XML_DEPRECATED
|
| 543 |
+
XMLPUBFUN xmlChar *
|
| 544 |
+
xmlStringLenDecodeEntities (xmlParserCtxtPtr ctxt,
|
| 545 |
+
const xmlChar *str,
|
| 546 |
+
int len,
|
| 547 |
+
int what,
|
| 548 |
+
xmlChar end,
|
| 549 |
+
xmlChar end2,
|
| 550 |
+
xmlChar end3);
|
| 551 |
+
|
| 552 |
+
/*
|
| 553 |
+
* Generated by MACROS on top of parser.c c.f. PUSH_AND_POP.
|
| 554 |
+
*/
|
| 555 |
+
XML_DEPRECATED
|
| 556 |
+
XMLPUBFUN int nodePush (xmlParserCtxtPtr ctxt,
|
| 557 |
+
xmlNodePtr value);
|
| 558 |
+
XML_DEPRECATED
|
| 559 |
+
XMLPUBFUN xmlNodePtr nodePop (xmlParserCtxtPtr ctxt);
|
| 560 |
+
XMLPUBFUN int inputPush (xmlParserCtxtPtr ctxt,
|
| 561 |
+
xmlParserInputPtr value);
|
| 562 |
+
XMLPUBFUN xmlParserInputPtr inputPop (xmlParserCtxtPtr ctxt);
|
| 563 |
+
XML_DEPRECATED
|
| 564 |
+
XMLPUBFUN const xmlChar * namePop (xmlParserCtxtPtr ctxt);
|
| 565 |
+
XML_DEPRECATED
|
| 566 |
+
XMLPUBFUN int namePush (xmlParserCtxtPtr ctxt,
|
| 567 |
+
const xmlChar *value);
|
| 568 |
+
|
| 569 |
+
/*
|
| 570 |
+
* other commodities shared between parser.c and parserInternals.
|
| 571 |
+
*/
|
| 572 |
+
XML_DEPRECATED
|
| 573 |
+
XMLPUBFUN int xmlSkipBlankChars (xmlParserCtxtPtr ctxt);
|
| 574 |
+
XML_DEPRECATED
|
| 575 |
+
XMLPUBFUN int xmlStringCurrentChar (xmlParserCtxtPtr ctxt,
|
| 576 |
+
const xmlChar *cur,
|
| 577 |
+
int *len);
|
| 578 |
+
XML_DEPRECATED
|
| 579 |
+
XMLPUBFUN void xmlParserHandlePEReference(xmlParserCtxtPtr ctxt);
|
| 580 |
+
XML_DEPRECATED
|
| 581 |
+
XMLPUBFUN int xmlCheckLanguageID (const xmlChar *lang);
|
| 582 |
+
|
| 583 |
+
/*
|
| 584 |
+
* Really core function shared with HTML parser.
|
| 585 |
+
*/
|
| 586 |
+
XML_DEPRECATED
|
| 587 |
+
XMLPUBFUN int xmlCurrentChar (xmlParserCtxtPtr ctxt,
|
| 588 |
+
int *len);
|
| 589 |
+
XMLPUBFUN int xmlCopyCharMultiByte (xmlChar *out,
|
| 590 |
+
int val);
|
| 591 |
+
XMLPUBFUN int xmlCopyChar (int len,
|
| 592 |
+
xmlChar *out,
|
| 593 |
+
int val);
|
| 594 |
+
XML_DEPRECATED
|
| 595 |
+
XMLPUBFUN void xmlNextChar (xmlParserCtxtPtr ctxt);
|
| 596 |
+
XML_DEPRECATED
|
| 597 |
+
XMLPUBFUN void xmlParserInputShrink (xmlParserInputPtr in);
|
| 598 |
+
|
| 599 |
+
/*
|
| 600 |
+
* Specific function to keep track of entities references
|
| 601 |
+
* and used by the XSLT debugger.
|
| 602 |
+
*/
|
| 603 |
+
#ifdef LIBXML_LEGACY_ENABLED
|
| 604 |
+
/**
|
| 605 |
+
* xmlEntityReferenceFunc:
|
| 606 |
+
* @ent: the entity
|
| 607 |
+
* @firstNode: the fist node in the chunk
|
| 608 |
+
* @lastNode: the last nod in the chunk
|
| 609 |
+
*
|
| 610 |
+
* Callback function used when one needs to be able to track back the
|
| 611 |
+
* provenance of a chunk of nodes inherited from an entity replacement.
|
| 612 |
+
*/
|
| 613 |
+
typedef void (*xmlEntityReferenceFunc) (xmlEntityPtr ent,
|
| 614 |
+
xmlNodePtr firstNode,
|
| 615 |
+
xmlNodePtr lastNode);
|
| 616 |
+
|
| 617 |
+
XML_DEPRECATED
|
| 618 |
+
XMLPUBFUN void xmlSetEntityReferenceFunc (xmlEntityReferenceFunc func);
|
| 619 |
+
|
| 620 |
+
XML_DEPRECATED
|
| 621 |
+
XMLPUBFUN xmlChar *
|
| 622 |
+
xmlParseQuotedString (xmlParserCtxtPtr ctxt);
|
| 623 |
+
XML_DEPRECATED
|
| 624 |
+
XMLPUBFUN void
|
| 625 |
+
xmlParseNamespace (xmlParserCtxtPtr ctxt);
|
| 626 |
+
XML_DEPRECATED
|
| 627 |
+
XMLPUBFUN xmlChar *
|
| 628 |
+
xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt);
|
| 629 |
+
XML_DEPRECATED
|
| 630 |
+
XMLPUBFUN xmlChar *
|
| 631 |
+
xmlScanName (xmlParserCtxtPtr ctxt);
|
| 632 |
+
XML_DEPRECATED
|
| 633 |
+
XMLPUBFUN xmlChar *
|
| 634 |
+
xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt);
|
| 635 |
+
XML_DEPRECATED
|
| 636 |
+
XMLPUBFUN void xmlParserHandleReference(xmlParserCtxtPtr ctxt);
|
| 637 |
+
XML_DEPRECATED
|
| 638 |
+
XMLPUBFUN xmlChar *
|
| 639 |
+
xmlNamespaceParseQName (xmlParserCtxtPtr ctxt,
|
| 640 |
+
xmlChar **prefix);
|
| 641 |
+
/**
|
| 642 |
+
* Entities
|
| 643 |
+
*/
|
| 644 |
+
XML_DEPRECATED
|
| 645 |
+
XMLPUBFUN xmlChar *
|
| 646 |
+
xmlDecodeEntities (xmlParserCtxtPtr ctxt,
|
| 647 |
+
int len,
|
| 648 |
+
int what,
|
| 649 |
+
xmlChar end,
|
| 650 |
+
xmlChar end2,
|
| 651 |
+
xmlChar end3);
|
| 652 |
+
XML_DEPRECATED
|
| 653 |
+
XMLPUBFUN void
|
| 654 |
+
xmlHandleEntity (xmlParserCtxtPtr ctxt,
|
| 655 |
+
xmlEntityPtr entity);
|
| 656 |
+
|
| 657 |
+
#endif /* LIBXML_LEGACY_ENABLED */
|
| 658 |
+
|
| 659 |
+
#ifdef __cplusplus
|
| 660 |
+
}
|
| 661 |
+
#endif
|
| 662 |
+
#endif /* __XML_PARSER_INTERNALS_H__ */
|
pgsql/include/libxml/pattern.h
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: pattern expression handling
|
| 3 |
+
* Description: allows to compile and test pattern expressions for nodes
|
| 4 |
+
* either in a tree or based on a parser state.
|
| 5 |
+
*
|
| 6 |
+
* Copy: See Copyright for the status of this software.
|
| 7 |
+
*
|
| 8 |
+
* Author: Daniel Veillard
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
#ifndef __XML_PATTERN_H__
|
| 12 |
+
#define __XML_PATTERN_H__
|
| 13 |
+
|
| 14 |
+
#include <libxml/xmlversion.h>
|
| 15 |
+
#include <libxml/tree.h>
|
| 16 |
+
#include <libxml/dict.h>
|
| 17 |
+
|
| 18 |
+
#ifdef LIBXML_PATTERN_ENABLED
|
| 19 |
+
|
| 20 |
+
#ifdef __cplusplus
|
| 21 |
+
extern "C" {
|
| 22 |
+
#endif
|
| 23 |
+
|
| 24 |
+
/**
|
| 25 |
+
* xmlPattern:
|
| 26 |
+
*
|
| 27 |
+
* A compiled (XPath based) pattern to select nodes
|
| 28 |
+
*/
|
| 29 |
+
typedef struct _xmlPattern xmlPattern;
|
| 30 |
+
typedef xmlPattern *xmlPatternPtr;
|
| 31 |
+
|
| 32 |
+
/**
|
| 33 |
+
* xmlPatternFlags:
|
| 34 |
+
*
|
| 35 |
+
* This is the set of options affecting the behaviour of pattern
|
| 36 |
+
* matching with this module
|
| 37 |
+
*
|
| 38 |
+
*/
|
| 39 |
+
typedef enum {
|
| 40 |
+
XML_PATTERN_DEFAULT = 0, /* simple pattern match */
|
| 41 |
+
XML_PATTERN_XPATH = 1<<0, /* standard XPath pattern */
|
| 42 |
+
XML_PATTERN_XSSEL = 1<<1, /* XPath subset for schema selector */
|
| 43 |
+
XML_PATTERN_XSFIELD = 1<<2 /* XPath subset for schema field */
|
| 44 |
+
} xmlPatternFlags;
|
| 45 |
+
|
| 46 |
+
XMLPUBFUN void
|
| 47 |
+
xmlFreePattern (xmlPatternPtr comp);
|
| 48 |
+
|
| 49 |
+
XMLPUBFUN void
|
| 50 |
+
xmlFreePatternList (xmlPatternPtr comp);
|
| 51 |
+
|
| 52 |
+
XMLPUBFUN xmlPatternPtr
|
| 53 |
+
xmlPatterncompile (const xmlChar *pattern,
|
| 54 |
+
xmlDict *dict,
|
| 55 |
+
int flags,
|
| 56 |
+
const xmlChar **namespaces);
|
| 57 |
+
XMLPUBFUN int
|
| 58 |
+
xmlPatternMatch (xmlPatternPtr comp,
|
| 59 |
+
xmlNodePtr node);
|
| 60 |
+
|
| 61 |
+
/* streaming interfaces */
|
| 62 |
+
typedef struct _xmlStreamCtxt xmlStreamCtxt;
|
| 63 |
+
typedef xmlStreamCtxt *xmlStreamCtxtPtr;
|
| 64 |
+
|
| 65 |
+
XMLPUBFUN int
|
| 66 |
+
xmlPatternStreamable (xmlPatternPtr comp);
|
| 67 |
+
XMLPUBFUN int
|
| 68 |
+
xmlPatternMaxDepth (xmlPatternPtr comp);
|
| 69 |
+
XMLPUBFUN int
|
| 70 |
+
xmlPatternMinDepth (xmlPatternPtr comp);
|
| 71 |
+
XMLPUBFUN int
|
| 72 |
+
xmlPatternFromRoot (xmlPatternPtr comp);
|
| 73 |
+
XMLPUBFUN xmlStreamCtxtPtr
|
| 74 |
+
xmlPatternGetStreamCtxt (xmlPatternPtr comp);
|
| 75 |
+
XMLPUBFUN void
|
| 76 |
+
xmlFreeStreamCtxt (xmlStreamCtxtPtr stream);
|
| 77 |
+
XMLPUBFUN int
|
| 78 |
+
xmlStreamPushNode (xmlStreamCtxtPtr stream,
|
| 79 |
+
const xmlChar *name,
|
| 80 |
+
const xmlChar *ns,
|
| 81 |
+
int nodeType);
|
| 82 |
+
XMLPUBFUN int
|
| 83 |
+
xmlStreamPush (xmlStreamCtxtPtr stream,
|
| 84 |
+
const xmlChar *name,
|
| 85 |
+
const xmlChar *ns);
|
| 86 |
+
XMLPUBFUN int
|
| 87 |
+
xmlStreamPushAttr (xmlStreamCtxtPtr stream,
|
| 88 |
+
const xmlChar *name,
|
| 89 |
+
const xmlChar *ns);
|
| 90 |
+
XMLPUBFUN int
|
| 91 |
+
xmlStreamPop (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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: implementation of the Relax-NG validation
|
| 3 |
+
* Description: implementation of the Relax-NG validation
|
| 4 |
+
*
|
| 5 |
+
* Copy: See Copyright for the status of this software.
|
| 6 |
+
*
|
| 7 |
+
* Author: Daniel Veillard
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef __XML_RELAX_NG__
|
| 11 |
+
#define __XML_RELAX_NG__
|
| 12 |
+
|
| 13 |
+
#include <libxml/xmlversion.h>
|
| 14 |
+
#include <libxml/hash.h>
|
| 15 |
+
#include <libxml/xmlstring.h>
|
| 16 |
+
|
| 17 |
+
#ifdef LIBXML_SCHEMAS_ENABLED
|
| 18 |
+
|
| 19 |
+
#ifdef __cplusplus
|
| 20 |
+
extern "C" {
|
| 21 |
+
#endif
|
| 22 |
+
|
| 23 |
+
typedef struct _xmlRelaxNG xmlRelaxNG;
|
| 24 |
+
typedef xmlRelaxNG *xmlRelaxNGPtr;
|
| 25 |
+
|
| 26 |
+
|
| 27 |
+
/**
|
| 28 |
+
* xmlRelaxNGValidityErrorFunc:
|
| 29 |
+
* @ctx: the validation context
|
| 30 |
+
* @msg: the message
|
| 31 |
+
* @...: extra arguments
|
| 32 |
+
*
|
| 33 |
+
* Signature of an error callback from a Relax-NG validation
|
| 34 |
+
*/
|
| 35 |
+
typedef void (*xmlRelaxNGValidityErrorFunc) (void *ctx,
|
| 36 |
+
const char *msg,
|
| 37 |
+
...) LIBXML_ATTR_FORMAT(2,3);
|
| 38 |
+
|
| 39 |
+
/**
|
| 40 |
+
* xmlRelaxNGValidityWarningFunc:
|
| 41 |
+
* @ctx: the validation context
|
| 42 |
+
* @msg: the message
|
| 43 |
+
* @...: extra arguments
|
| 44 |
+
*
|
| 45 |
+
* Signature of a warning callback from a Relax-NG validation
|
| 46 |
+
*/
|
| 47 |
+
typedef void (*xmlRelaxNGValidityWarningFunc) (void *ctx,
|
| 48 |
+
const char *msg,
|
| 49 |
+
...) LIBXML_ATTR_FORMAT(2,3);
|
| 50 |
+
|
| 51 |
+
/**
|
| 52 |
+
* A schemas validation context
|
| 53 |
+
*/
|
| 54 |
+
typedef struct _xmlRelaxNGParserCtxt xmlRelaxNGParserCtxt;
|
| 55 |
+
typedef xmlRelaxNGParserCtxt *xmlRelaxNGParserCtxtPtr;
|
| 56 |
+
|
| 57 |
+
typedef struct _xmlRelaxNGValidCtxt xmlRelaxNGValidCtxt;
|
| 58 |
+
typedef xmlRelaxNGValidCtxt *xmlRelaxNGValidCtxtPtr;
|
| 59 |
+
|
| 60 |
+
/*
|
| 61 |
+
* xmlRelaxNGValidErr:
|
| 62 |
+
*
|
| 63 |
+
* List of possible Relax NG validation errors
|
| 64 |
+
*/
|
| 65 |
+
typedef enum {
|
| 66 |
+
XML_RELAXNG_OK = 0,
|
| 67 |
+
XML_RELAXNG_ERR_MEMORY,
|
| 68 |
+
XML_RELAXNG_ERR_TYPE,
|
| 69 |
+
XML_RELAXNG_ERR_TYPEVAL,
|
| 70 |
+
XML_RELAXNG_ERR_DUPID,
|
| 71 |
+
XML_RELAXNG_ERR_TYPECMP,
|
| 72 |
+
XML_RELAXNG_ERR_NOSTATE,
|
| 73 |
+
XML_RELAXNG_ERR_NODEFINE,
|
| 74 |
+
XML_RELAXNG_ERR_LISTEXTRA,
|
| 75 |
+
XML_RELAXNG_ERR_LISTEMPTY,
|
| 76 |
+
XML_RELAXNG_ERR_INTERNODATA,
|
| 77 |
+
XML_RELAXNG_ERR_INTERSEQ,
|
| 78 |
+
XML_RELAXNG_ERR_INTEREXTRA,
|
| 79 |
+
XML_RELAXNG_ERR_ELEMNAME,
|
| 80 |
+
XML_RELAXNG_ERR_ATTRNAME,
|
| 81 |
+
XML_RELAXNG_ERR_ELEMNONS,
|
| 82 |
+
XML_RELAXNG_ERR_ATTRNONS,
|
| 83 |
+
XML_RELAXNG_ERR_ELEMWRONGNS,
|
| 84 |
+
XML_RELAXNG_ERR_ATTRWRONGNS,
|
| 85 |
+
XML_RELAXNG_ERR_ELEMEXTRANS,
|
| 86 |
+
XML_RELAXNG_ERR_ATTREXTRANS,
|
| 87 |
+
XML_RELAXNG_ERR_ELEMNOTEMPTY,
|
| 88 |
+
XML_RELAXNG_ERR_NOELEM,
|
| 89 |
+
XML_RELAXNG_ERR_NOTELEM,
|
| 90 |
+
XML_RELAXNG_ERR_ATTRVALID,
|
| 91 |
+
XML_RELAXNG_ERR_CONTENTVALID,
|
| 92 |
+
XML_RELAXNG_ERR_EXTRACONTENT,
|
| 93 |
+
XML_RELAXNG_ERR_INVALIDATTR,
|
| 94 |
+
XML_RELAXNG_ERR_DATAELEM,
|
| 95 |
+
XML_RELAXNG_ERR_VALELEM,
|
| 96 |
+
XML_RELAXNG_ERR_LISTELEM,
|
| 97 |
+
XML_RELAXNG_ERR_DATATYPE,
|
| 98 |
+
XML_RELAXNG_ERR_VALUE,
|
| 99 |
+
XML_RELAXNG_ERR_LIST,
|
| 100 |
+
XML_RELAXNG_ERR_NOGRAMMAR,
|
| 101 |
+
XML_RELAXNG_ERR_EXTRADATA,
|
| 102 |
+
XML_RELAXNG_ERR_LACKDATA,
|
| 103 |
+
XML_RELAXNG_ERR_INTERNAL,
|
| 104 |
+
XML_RELAXNG_ERR_ELEMWRONG,
|
| 105 |
+
XML_RELAXNG_ERR_TEXTWRONG
|
| 106 |
+
} xmlRelaxNGValidErr;
|
| 107 |
+
|
| 108 |
+
/*
|
| 109 |
+
* xmlRelaxNGParserFlags:
|
| 110 |
+
*
|
| 111 |
+
* List of possible Relax NG Parser flags
|
| 112 |
+
*/
|
| 113 |
+
typedef enum {
|
| 114 |
+
XML_RELAXNGP_NONE = 0,
|
| 115 |
+
XML_RELAXNGP_FREE_DOC = 1,
|
| 116 |
+
XML_RELAXNGP_CRNG = 2
|
| 117 |
+
} xmlRelaxNGParserFlag;
|
| 118 |
+
|
| 119 |
+
XMLPUBFUN int
|
| 120 |
+
xmlRelaxNGInitTypes (void);
|
| 121 |
+
XML_DEPRECATED
|
| 122 |
+
XMLPUBFUN void
|
| 123 |
+
xmlRelaxNGCleanupTypes (void);
|
| 124 |
+
|
| 125 |
+
/*
|
| 126 |
+
* Interfaces for parsing.
|
| 127 |
+
*/
|
| 128 |
+
XMLPUBFUN xmlRelaxNGParserCtxtPtr
|
| 129 |
+
xmlRelaxNGNewParserCtxt (const char *URL);
|
| 130 |
+
XMLPUBFUN xmlRelaxNGParserCtxtPtr
|
| 131 |
+
xmlRelaxNGNewMemParserCtxt (const char *buffer,
|
| 132 |
+
int size);
|
| 133 |
+
XMLPUBFUN xmlRelaxNGParserCtxtPtr
|
| 134 |
+
xmlRelaxNGNewDocParserCtxt (xmlDocPtr doc);
|
| 135 |
+
|
| 136 |
+
XMLPUBFUN int
|
| 137 |
+
xmlRelaxParserSetFlag (xmlRelaxNGParserCtxtPtr ctxt,
|
| 138 |
+
int flag);
|
| 139 |
+
|
| 140 |
+
XMLPUBFUN void
|
| 141 |
+
xmlRelaxNGFreeParserCtxt (xmlRelaxNGParserCtxtPtr ctxt);
|
| 142 |
+
XMLPUBFUN void
|
| 143 |
+
xmlRelaxNGSetParserErrors(xmlRelaxNGParserCtxtPtr ctxt,
|
| 144 |
+
xmlRelaxNGValidityErrorFunc err,
|
| 145 |
+
xmlRelaxNGValidityWarningFunc warn,
|
| 146 |
+
void *ctx);
|
| 147 |
+
XMLPUBFUN int
|
| 148 |
+
xmlRelaxNGGetParserErrors(xmlRelaxNGParserCtxtPtr ctxt,
|
| 149 |
+
xmlRelaxNGValidityErrorFunc *err,
|
| 150 |
+
xmlRelaxNGValidityWarningFunc *warn,
|
| 151 |
+
void **ctx);
|
| 152 |
+
XMLPUBFUN void
|
| 153 |
+
xmlRelaxNGSetParserStructuredErrors(
|
| 154 |
+
xmlRelaxNGParserCtxtPtr ctxt,
|
| 155 |
+
xmlStructuredErrorFunc serror,
|
| 156 |
+
void *ctx);
|
| 157 |
+
XMLPUBFUN xmlRelaxNGPtr
|
| 158 |
+
xmlRelaxNGParse (xmlRelaxNGParserCtxtPtr ctxt);
|
| 159 |
+
XMLPUBFUN void
|
| 160 |
+
xmlRelaxNGFree (xmlRelaxNGPtr schema);
|
| 161 |
+
#ifdef LIBXML_OUTPUT_ENABLED
|
| 162 |
+
XMLPUBFUN void
|
| 163 |
+
xmlRelaxNGDump (FILE *output,
|
| 164 |
+
xmlRelaxNGPtr schema);
|
| 165 |
+
XMLPUBFUN void
|
| 166 |
+
xmlRelaxNGDumpTree (FILE * output,
|
| 167 |
+
xmlRelaxNGPtr schema);
|
| 168 |
+
#endif /* LIBXML_OUTPUT_ENABLED */
|
| 169 |
+
/*
|
| 170 |
+
* Interfaces for validating
|
| 171 |
+
*/
|
| 172 |
+
XMLPUBFUN void
|
| 173 |
+
xmlRelaxNGSetValidErrors(xmlRelaxNGValidCtxtPtr ctxt,
|
| 174 |
+
xmlRelaxNGValidityErrorFunc err,
|
| 175 |
+
xmlRelaxNGValidityWarningFunc warn,
|
| 176 |
+
void *ctx);
|
| 177 |
+
XMLPUBFUN int
|
| 178 |
+
xmlRelaxNGGetValidErrors(xmlRelaxNGValidCtxtPtr ctxt,
|
| 179 |
+
xmlRelaxNGValidityErrorFunc *err,
|
| 180 |
+
xmlRelaxNGValidityWarningFunc *warn,
|
| 181 |
+
void **ctx);
|
| 182 |
+
XMLPUBFUN void
|
| 183 |
+
xmlRelaxNGSetValidStructuredErrors(xmlRelaxNGValidCtxtPtr ctxt,
|
| 184 |
+
xmlStructuredErrorFunc serror, void *ctx);
|
| 185 |
+
XMLPUBFUN xmlRelaxNGValidCtxtPtr
|
| 186 |
+
xmlRelaxNGNewValidCtxt (xmlRelaxNGPtr schema);
|
| 187 |
+
XMLPUBFUN void
|
| 188 |
+
xmlRelaxNGFreeValidCtxt (xmlRelaxNGValidCtxtPtr ctxt);
|
| 189 |
+
XMLPUBFUN int
|
| 190 |
+
xmlRelaxNGValidateDoc (xmlRelaxNGValidCtxtPtr ctxt,
|
| 191 |
+
xmlDocPtr doc);
|
| 192 |
+
/*
|
| 193 |
+
* Interfaces for progressive validation when possible
|
| 194 |
+
*/
|
| 195 |
+
XMLPUBFUN int
|
| 196 |
+
xmlRelaxNGValidatePushElement (xmlRelaxNGValidCtxtPtr ctxt,
|
| 197 |
+
xmlDocPtr doc,
|
| 198 |
+
xmlNodePtr elem);
|
| 199 |
+
XMLPUBFUN int
|
| 200 |
+
xmlRelaxNGValidatePushCData (xmlRelaxNGValidCtxtPtr ctxt,
|
| 201 |
+
const xmlChar *data,
|
| 202 |
+
int len);
|
| 203 |
+
XMLPUBFUN int
|
| 204 |
+
xmlRelaxNGValidatePopElement (xmlRelaxNGValidCtxtPtr ctxt,
|
| 205 |
+
xmlDocPtr doc,
|
| 206 |
+
xmlNodePtr elem);
|
| 207 |
+
XMLPUBFUN int
|
| 208 |
+
xmlRelaxNGValidateFullElement (xmlRelaxNGValidCtxtPtr ctxt,
|
| 209 |
+
xmlDocPtr doc,
|
| 210 |
+
xmlNod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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: internal interfaces for XML Schemas
|
| 3 |
+
* Description: internal interfaces for the XML Schemas handling
|
| 4 |
+
* and schema validity checking
|
| 5 |
+
* The Schemas development is a Work In Progress.
|
| 6 |
+
* Some of those interfaces are not guaranteed to be API or ABI stable !
|
| 7 |
+
*
|
| 8 |
+
* Copy: See Copyright for the status of this software.
|
| 9 |
+
*
|
| 10 |
+
* Author: Daniel Veillard
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
#ifndef __XML_SCHEMA_INTERNALS_H__
|
| 15 |
+
#define __XML_SCHEMA_INTERNALS_H__
|
| 16 |
+
|
| 17 |
+
#include <libxml/xmlversion.h>
|
| 18 |
+
|
| 19 |
+
#ifdef LIBXML_SCHEMAS_ENABLED
|
| 20 |
+
|
| 21 |
+
#include <libxml/xmlregexp.h>
|
| 22 |
+
#include <libxml/hash.h>
|
| 23 |
+
#include <libxml/dict.h>
|
| 24 |
+
|
| 25 |
+
#ifdef __cplusplus
|
| 26 |
+
extern "C" {
|
| 27 |
+
#endif
|
| 28 |
+
|
| 29 |
+
typedef enum {
|
| 30 |
+
XML_SCHEMAS_UNKNOWN = 0,
|
| 31 |
+
XML_SCHEMAS_STRING = 1,
|
| 32 |
+
XML_SCHEMAS_NORMSTRING = 2,
|
| 33 |
+
XML_SCHEMAS_DECIMAL = 3,
|
| 34 |
+
XML_SCHEMAS_TIME = 4,
|
| 35 |
+
XML_SCHEMAS_GDAY = 5,
|
| 36 |
+
XML_SCHEMAS_GMONTH = 6,
|
| 37 |
+
XML_SCHEMAS_GMONTHDAY = 7,
|
| 38 |
+
XML_SCHEMAS_GYEAR = 8,
|
| 39 |
+
XML_SCHEMAS_GYEARMONTH = 9,
|
| 40 |
+
XML_SCHEMAS_DATE = 10,
|
| 41 |
+
XML_SCHEMAS_DATETIME = 11,
|
| 42 |
+
XML_SCHEMAS_DURATION = 12,
|
| 43 |
+
XML_SCHEMAS_FLOAT = 13,
|
| 44 |
+
XML_SCHEMAS_DOUBLE = 14,
|
| 45 |
+
XML_SCHEMAS_BOOLEAN = 15,
|
| 46 |
+
XML_SCHEMAS_TOKEN = 16,
|
| 47 |
+
XML_SCHEMAS_LANGUAGE = 17,
|
| 48 |
+
XML_SCHEMAS_NMTOKEN = 18,
|
| 49 |
+
XML_SCHEMAS_NMTOKENS = 19,
|
| 50 |
+
XML_SCHEMAS_NAME = 20,
|
| 51 |
+
XML_SCHEMAS_QNAME = 21,
|
| 52 |
+
XML_SCHEMAS_NCNAME = 22,
|
| 53 |
+
XML_SCHEMAS_ID = 23,
|
| 54 |
+
XML_SCHEMAS_IDREF = 24,
|
| 55 |
+
XML_SCHEMAS_IDREFS = 25,
|
| 56 |
+
XML_SCHEMAS_ENTITY = 26,
|
| 57 |
+
XML_SCHEMAS_ENTITIES = 27,
|
| 58 |
+
XML_SCHEMAS_NOTATION = 28,
|
| 59 |
+
XML_SCHEMAS_ANYURI = 29,
|
| 60 |
+
XML_SCHEMAS_INTEGER = 30,
|
| 61 |
+
XML_SCHEMAS_NPINTEGER = 31,
|
| 62 |
+
XML_SCHEMAS_NINTEGER = 32,
|
| 63 |
+
XML_SCHEMAS_NNINTEGER = 33,
|
| 64 |
+
XML_SCHEMAS_PINTEGER = 34,
|
| 65 |
+
XML_SCHEMAS_INT = 35,
|
| 66 |
+
XML_SCHEMAS_UINT = 36,
|
| 67 |
+
XML_SCHEMAS_LONG = 37,
|
| 68 |
+
XML_SCHEMAS_ULONG = 38,
|
| 69 |
+
XML_SCHEMAS_SHORT = 39,
|
| 70 |
+
XML_SCHEMAS_USHORT = 40,
|
| 71 |
+
XML_SCHEMAS_BYTE = 41,
|
| 72 |
+
XML_SCHEMAS_UBYTE = 42,
|
| 73 |
+
XML_SCHEMAS_HEXBINARY = 43,
|
| 74 |
+
XML_SCHEMAS_BASE64BINARY = 44,
|
| 75 |
+
XML_SCHEMAS_ANYTYPE = 45,
|
| 76 |
+
XML_SCHEMAS_ANYSIMPLETYPE = 46
|
| 77 |
+
} xmlSchemaValType;
|
| 78 |
+
|
| 79 |
+
/*
|
| 80 |
+
* XML Schemas defines multiple type of types.
|
| 81 |
+
*/
|
| 82 |
+
typedef enum {
|
| 83 |
+
XML_SCHEMA_TYPE_BASIC = 1, /* A built-in datatype */
|
| 84 |
+
XML_SCHEMA_TYPE_ANY,
|
| 85 |
+
XML_SCHEMA_TYPE_FACET,
|
| 86 |
+
XML_SCHEMA_TYPE_SIMPLE,
|
| 87 |
+
XML_SCHEMA_TYPE_COMPLEX,
|
| 88 |
+
XML_SCHEMA_TYPE_SEQUENCE = 6,
|
| 89 |
+
XML_SCHEMA_TYPE_CHOICE,
|
| 90 |
+
XML_SCHEMA_TYPE_ALL,
|
| 91 |
+
XML_SCHEMA_TYPE_SIMPLE_CONTENT,
|
| 92 |
+
XML_SCHEMA_TYPE_COMPLEX_CONTENT,
|
| 93 |
+
XML_SCHEMA_TYPE_UR,
|
| 94 |
+
XML_SCHEMA_TYPE_RESTRICTION,
|
| 95 |
+
XML_SCHEMA_TYPE_EXTENSION,
|
| 96 |
+
XML_SCHEMA_TYPE_ELEMENT,
|
| 97 |
+
XML_SCHEMA_TYPE_ATTRIBUTE,
|
| 98 |
+
XML_SCHEMA_TYPE_ATTRIBUTEGROUP,
|
| 99 |
+
XML_SCHEMA_TYPE_GROUP,
|
| 100 |
+
XML_SCHEMA_TYPE_NOTATION,
|
| 101 |
+
XML_SCHEMA_TYPE_LIST,
|
| 102 |
+
XML_SCHEMA_TYPE_UNION,
|
| 103 |
+
XML_SCHEMA_TYPE_ANY_ATTRIBUTE,
|
| 104 |
+
XML_SCHEMA_TYPE_IDC_UNIQUE,
|
| 105 |
+
XML_SCHEMA_TYPE_IDC_KEY,
|
| 106 |
+
XML_SCHEMA_TYPE_IDC_KEYREF,
|
| 107 |
+
XML_SCHEMA_TYPE_PARTICLE = 25,
|
| 108 |
+
XML_SCHEMA_TYPE_ATTRIBUTE_USE,
|
| 109 |
+
XML_SCHEMA_FACET_MININCLUSIVE = 1000,
|
| 110 |
+
XML_SCHEMA_FACET_MINEXCLUSIVE,
|
| 111 |
+
XML_SCHEMA_FACET_MAXINCLUSIVE,
|
| 112 |
+
XML_SCHEMA_FACET_MAXEXCLUSIVE,
|
| 113 |
+
XML_SCHEMA_FACET_TOTALDIGITS,
|
| 114 |
+
XML_SCHEMA_FACET_FRACTIONDIGITS,
|
| 115 |
+
XML_SCHEMA_FACET_PATTERN,
|
| 116 |
+
XML_SCHEMA_FACET_ENUMERATION,
|
| 117 |
+
XML_SCHEMA_FACET_WHITESPACE,
|
| 118 |
+
XML_SCHEMA_FACET_LENGTH,
|
| 119 |
+
XML_SCHEMA_FACET_MAXLENGTH,
|
| 120 |
+
XML_SCHEMA_FACET_MINLENGTH,
|
| 121 |
+
XML_SCHEMA_EXTRA_QNAMEREF = 2000,
|
| 122 |
+
XML_SCHEMA_EXTRA_ATTR_USE_PROHIB
|
| 123 |
+
} xmlSchemaTypeType;
|
| 124 |
+
|
| 125 |
+
typedef enum {
|
| 126 |
+
XML_SCHEMA_CONTENT_UNKNOWN = 0,
|
| 127 |
+
XML_SCHEMA_CONTENT_EMPTY = 1,
|
| 128 |
+
XML_SCHEMA_CONTENT_ELEMENTS,
|
| 129 |
+
XML_SCHEMA_CONTENT_MIXED,
|
| 130 |
+
XML_SCHEMA_CONTENT_SIMPLE,
|
| 131 |
+
XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTS, /* Obsolete */
|
| 132 |
+
XML_SCHEMA_CONTENT_BASIC,
|
| 133 |
+
XML_SCHEMA_CONTENT_ANY
|
| 134 |
+
} xmlSchemaContentType;
|
| 135 |
+
|
| 136 |
+
typedef struct _xmlSchemaVal xmlSchemaVal;
|
| 137 |
+
typedef xmlSchemaVal *xmlSchemaValPtr;
|
| 138 |
+
|
| 139 |
+
typedef struct _xmlSchemaType xmlSchemaType;
|
| 140 |
+
typedef xmlSchemaType *xmlSchemaTypePtr;
|
| 141 |
+
|
| 142 |
+
typedef struct _xmlSchemaFacet xmlSchemaFacet;
|
| 143 |
+
typedef xmlSchemaFacet *xmlSchemaFacetPtr;
|
| 144 |
+
|
| 145 |
+
/**
|
| 146 |
+
* Annotation
|
| 147 |
+
*/
|
| 148 |
+
typedef struct _xmlSchemaAnnot xmlSchemaAnnot;
|
| 149 |
+
typedef xmlSchemaAnnot *xmlSchemaAnnotPtr;
|
| 150 |
+
struct _xmlSchemaAnnot {
|
| 151 |
+
struct _xmlSchemaAnnot *next;
|
| 152 |
+
xmlNodePtr content; /* the annotation */
|
| 153 |
+
};
|
| 154 |
+
|
| 155 |
+
/**
|
| 156 |
+
* XML_SCHEMAS_ANYATTR_SKIP:
|
| 157 |
+
*
|
| 158 |
+
* Skip unknown attribute from validation
|
| 159 |
+
* Obsolete, not used anymore.
|
| 160 |
+
*/
|
| 161 |
+
#define XML_SCHEMAS_ANYATTR_SKIP 1
|
| 162 |
+
/**
|
| 163 |
+
* XML_SCHEMAS_ANYATTR_LAX:
|
| 164 |
+
*
|
| 165 |
+
* Ignore validation non definition on attributes
|
| 166 |
+
* Obsolete, not used anymore.
|
| 167 |
+
*/
|
| 168 |
+
#define XML_SCHEMAS_ANYATTR_LAX 2
|
| 169 |
+
/**
|
| 170 |
+
* XML_SCHEMAS_ANYATTR_STRICT:
|
| 171 |
+
*
|
| 172 |
+
* Apply strict validation rules on attributes
|
| 173 |
+
* Obsolete, not used anymore.
|
| 174 |
+
*/
|
| 175 |
+
#define XML_SCHEMAS_ANYATTR_STRICT 3
|
| 176 |
+
/**
|
| 177 |
+
* XML_SCHEMAS_ANY_SKIP:
|
| 178 |
+
*
|
| 179 |
+
* Skip unknown attribute from validation
|
| 180 |
+
*/
|
| 181 |
+
#define XML_SCHEMAS_ANY_SKIP 1
|
| 182 |
+
/**
|
| 183 |
+
* XML_SCHEMAS_ANY_LAX:
|
| 184 |
+
*
|
| 185 |
+
* Used by wildcards.
|
| 186 |
+
* Validate if type found, don't worry if not found
|
| 187 |
+
*/
|
| 188 |
+
#define XML_SCHEMAS_ANY_LAX 2
|
| 189 |
+
/**
|
| 190 |
+
* XML_SCHEMAS_ANY_STRICT:
|
| 191 |
+
*
|
| 192 |
+
* Used by wildcards.
|
| 193 |
+
* Apply strict validation rules
|
| 194 |
+
*/
|
| 195 |
+
#define XML_SCHEMAS_ANY_STRICT 3
|
| 196 |
+
/**
|
| 197 |
+
* XML_SCHEMAS_ATTR_USE_PROHIBITED:
|
| 198 |
+
*
|
| 199 |
+
* Used by wildcards.
|
| 200 |
+
* The attribute is prohibited.
|
| 201 |
+
*/
|
| 202 |
+
#define XML_SCHEMAS_ATTR_USE_PROHIBITED 0
|
| 203 |
+
/**
|
| 204 |
+
* XML_SCHEMAS_ATTR_USE_REQUIRED:
|
| 205 |
+
*
|
| 206 |
+
* The attribute is required.
|
| 207 |
+
*/
|
| 208 |
+
#define XML_SCHEMAS_ATTR_USE_REQUIRED 1
|
| 209 |
+
/**
|
| 210 |
+
* XML_SCHEMAS_ATTR_USE_OPTIONAL:
|
| 211 |
+
*
|
| 212 |
+
* The attribute is optional.
|
| 213 |
+
*/
|
| 214 |
+
#define XML_SCHEMAS_ATTR_USE_OPTIONAL 2
|
| 215 |
+
/**
|
| 216 |
+
* XML_SCHEMAS_ATTR_GLOBAL:
|
| 217 |
+
*
|
| 218 |
+
* allow elements in no namespace
|
| 219 |
+
*/
|
| 220 |
+
#define XML_SCHEMAS_ATTR_GLOBAL 1 << 0
|
| 221 |
+
/**
|
| 222 |
+
* XML_SCHEMAS_ATTR_NSDEFAULT:
|
| 223 |
+
*
|
| 224 |
+
* allow elements in no namespace
|
| 225 |
+
*/
|
| 226 |
+
#define XML_SCHEMAS_ATTR_NSDEFAULT 1 << 7
|
| 227 |
+
/**
|
| 228 |
+
* XML_SCHEMAS_ATTR_INTERNAL_RESOLVED:
|
| 229 |
+
*
|
| 230 |
+
* this is set when the "type" and "ref" references
|
| 231 |
+
* have been resolved.
|
| 232 |
+
*/
|
| 233 |
+
#define XML_SCHEMAS_ATTR_INTERNAL_RESOLVED 1 << 8
|
| 234 |
+
/**
|
| 235 |
+
* XML_SCHEMAS_ATTR_FIXED:
|
| 236 |
+
*
|
| 237 |
+
* the attribute has a fixed value
|
| 238 |
+
*/
|
| 239 |
+
#define XML_SCHEMAS_ATTR_FIXED 1 << 9
|
| 240 |
+
|
| 241 |
+
/**
|
| 242 |
+
* xmlSchemaAttribute:
|
| 243 |
+
* An attribute definition.
|
| 244 |
+
*/
|
| 245 |
+
|
| 246 |
+
typedef struct _xmlSchemaAttribute xmlSchemaAttribute;
|
| 247 |
+
typedef xmlSchemaAttribute *xmlSchemaAttributePtr;
|
| 248 |
+
struct _xmlSchemaAttribute {
|
| 249 |
+
xmlSchemaTypeType type;
|
| 250 |
+
struct _xmlSchemaAttribute *next; /* the next attribute (not used?) */
|
| 251 |
+
const xmlChar *name; /* the name of the declaration */
|
| 252 |
+
const xmlChar *id; /* Deprecated; not used */
|
| 253 |
+
const xmlChar *ref; /* Deprecated; not used */
|
| 254 |
+
const xmlChar *refNs; /* Deprecated; not used */
|
| 255 |
+
const xmlChar *typeName; /* the local name of the type definition */
|
| 256 |
+
const xmlChar *typeNs; /* the ns URI of the type definition */
|
| 257 |
+
xmlSchemaAnnotPtr annot;
|
| 258 |
+
|
| 259 |
+
xmlSchemaTypePtr base; /* Deprecated; not used */
|
| 260 |
+
int occurs; /* Deprecated; not used */
|
| 261 |
+
const xmlChar *defValue; /* The initial value of the value constraint */
|
| 262 |
+
xmlSchemaTypePtr subtypes; /* the type definition */
|
| 263 |
+
xmlNodePtr node;
|
| 264 |
+
const xmlChar *targetNamespace;
|
| 265 |
+
int flags;
|
| 266 |
+
const xmlChar *refPrefix; /* Deprecated; not used */
|
| 267 |
+
xmlSchemaValPtr defVal; /* The compiled value constraint */
|
| 268 |
+
xmlSchemaAttributePtr refDecl; /* Deprecated; not used */
|
| 269 |
+
};
|
| 270 |
+
|
| 271 |
+
/**
|
| 272 |
+
* xmlSchemaAttributeLink:
|
| 273 |
+
* Used to build a list of attribute uses on complexType definitions.
|
| 274 |
+
* WARNING: Deprecated; not used.
|
| 275 |
+
*/
|
| 276 |
+
typedef struct _xmlSchemaAttributeLink xmlSchemaAttributeLink;
|
| 277 |
+
typedef xmlSchemaAttributeLink *xmlSchemaAttributeLinkPtr;
|
| 278 |
+
struct _xmlSchemaAttributeLink {
|
| 279 |
+
struct _xmlSchemaAttributeLink *next;/* the next attribute link ... */
|
| 280 |
+
struct _xmlSchemaAttribute *attr;/* the linked attribute */
|
| 281 |
+
};
|
| 282 |
+
|
| 283 |
+
/**
|
| 284 |
+
* XML_SCHEMAS_WILDCARD_COMPLETE:
|
| 285 |
+
*
|
| 286 |
+
* If the wildcard is complete.
|
| 287 |
+
*/
|
| 288 |
+
#define XML_SCHEMAS_WILDCARD_COMPLETE 1 << 0
|
| 289 |
+
|
| 290 |
+
/**
|
| 291 |
+
* xmlSchemaCharValueLink:
|
| 292 |
+
* Used to build a list of namespaces on wildcards.
|
| 293 |
+
*/
|
| 294 |
+
typedef struct _xmlSchemaWildcardNs xmlSchemaWildcardNs;
|
| 295 |
+
typedef xmlSchemaWildcardNs *xmlSchemaWildcardNsPtr;
|
| 296 |
+
struct _xmlSchemaWildcardNs {
|
| 297 |
+
struct _xmlSchemaWildcardNs *next;/* the next constraint link ... */
|
| 298 |
+
const xmlChar *value;/* the value */
|
| 299 |
+
};
|
| 300 |
+
|
| 301 |
+
/**
|
| 302 |
+
* xmlSchemaWildcard.
|
| 303 |
+
* A wildcard.
|
| 304 |
+
*/
|
| 305 |
+
typedef struct _xmlSchemaWildcard xmlSchemaWildcard;
|
| 306 |
+
typedef xmlSchemaWildcard *xmlSchemaWildcardPtr;
|
| 307 |
+
struct _xmlSchemaWildcard {
|
| 308 |
+
xmlSchemaTypeType type; /* The kind of type */
|
| 309 |
+
const xmlChar *id; /* Deprecated; not used */
|
| 310 |
+
xmlSchemaAnnotPtr annot;
|
| 311 |
+
xmlNodePtr node;
|
| 312 |
+
int minOccurs; /* Deprecated; not used */
|
| 313 |
+
int maxOccurs; /* Deprecated; not used */
|
| 314 |
+
int processContents;
|
| 315 |
+
int any; /* Indicates if the ns constraint is of ##any */
|
| 316 |
+
xmlSchemaWildcardNsPtr nsSet; /* The list of allowed namespaces */
|
| 317 |
+
xmlSchemaWildcardNsPtr negNsSet; /* The negated namespace */
|
| 318 |
+
int flags;
|
| 319 |
+
};
|
| 320 |
+
|
| 321 |
+
/**
|
| 322 |
+
* XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED:
|
| 323 |
+
*
|
| 324 |
+
* The attribute wildcard has been built.
|
| 325 |
+
*/
|
| 326 |
+
#define XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED 1 << 0
|
| 327 |
+
/**
|
| 328 |
+
* XML_SCHEMAS_ATTRGROUP_GLOBAL:
|
| 329 |
+
*
|
| 330 |
+
* The attribute group has been defined.
|
| 331 |
+
*/
|
| 332 |
+
#define XML_SCHEMAS_ATTRGROUP_GLOBAL 1 << 1
|
| 333 |
+
/**
|
| 334 |
+
* XML_SCHEMAS_ATTRGROUP_MARKED:
|
| 335 |
+
*
|
| 336 |
+
* Marks the attr group as marked; used for circular checks.
|
| 337 |
+
*/
|
| 338 |
+
#define XML_SCHEMAS_ATTRGROUP_MARKED 1 << 2
|
| 339 |
+
|
| 340 |
+
/**
|
| 341 |
+
* XML_SCHEMAS_ATTRGROUP_REDEFINED:
|
| 342 |
+
*
|
| 343 |
+
* The attr group was redefined.
|
| 344 |
+
*/
|
| 345 |
+
#define XML_SCHEMAS_ATTRGROUP_REDEFINED 1 << 3
|
| 346 |
+
/**
|
| 347 |
+
* XML_SCHEMAS_ATTRGROUP_HAS_REFS:
|
| 348 |
+
*
|
| 349 |
+
* Whether this attr. group contains attr. group references.
|
| 350 |
+
*/
|
| 351 |
+
#define XML_SCHEMAS_ATTRGROUP_HAS_REFS 1 << 4
|
| 352 |
+
|
| 353 |
+
/**
|
| 354 |
+
* An attribute group definition.
|
| 355 |
+
*
|
| 356 |
+
* xmlSchemaAttribute and xmlSchemaAttributeGroup start of structures
|
| 357 |
+
* must be kept similar
|
| 358 |
+
*/
|
| 359 |
+
typedef struct _xmlSchemaAttributeGroup xmlSchemaAttributeGroup;
|
| 360 |
+
typedef xmlSchemaAttributeGroup *xmlSchemaAttributeGroupPtr;
|
| 361 |
+
struct _xmlSchemaAttributeGroup {
|
| 362 |
+
xmlSchemaTypeType type; /* The kind of type */
|
| 363 |
+
struct _xmlSchemaAttribute *next;/* the next attribute if in a group ... */
|
| 364 |
+
const xmlChar *name;
|
| 365 |
+
const xmlChar *id;
|
| 366 |
+
const xmlChar *ref; /* Deprecated; not used */
|
| 367 |
+
const xmlChar *refNs; /* Deprecated; not used */
|
| 368 |
+
xmlSchemaAnnotPtr annot;
|
| 369 |
+
|
| 370 |
+
xmlSchemaAttributePtr attributes; /* Deprecated; not used */
|
| 371 |
+
xmlNodePtr node;
|
| 372 |
+
int flags;
|
| 373 |
+
xmlSchemaWildcardPtr attributeWildcard;
|
| 374 |
+
const xmlChar *refPrefix; /* Deprecated; not used */
|
| 375 |
+
xmlSchemaAttributeGroupPtr refItem; /* Deprecated; not used */
|
| 376 |
+
const xmlChar *targetNamespace;
|
| 377 |
+
void *attrUses;
|
| 378 |
+
};
|
| 379 |
+
|
| 380 |
+
/**
|
| 381 |
+
* xmlSchemaTypeLink:
|
| 382 |
+
* Used to build a list of types (e.g. member types of
|
| 383 |
+
* simpleType with variety "union").
|
| 384 |
+
*/
|
| 385 |
+
typedef struct _xmlSchemaTypeLink xmlSchemaTypeLink;
|
| 386 |
+
typedef xmlSchemaTypeLink *xmlSchemaTypeLinkPtr;
|
| 387 |
+
struct _xmlSchemaTypeLink {
|
| 388 |
+
struct _xmlSchemaTypeLink *next;/* the next type link ... */
|
| 389 |
+
xmlSchemaTypePtr type;/* the linked type */
|
| 390 |
+
};
|
| 391 |
+
|
| 392 |
+
/**
|
| 393 |
+
* xmlSchemaFacetLink:
|
| 394 |
+
* Used to build a list of facets.
|
| 395 |
+
*/
|
| 396 |
+
typedef struct _xmlSchemaFacetLink xmlSchemaFacetLink;
|
| 397 |
+
typedef xmlSchemaFacetLink *xmlSchemaFacetLinkPtr;
|
| 398 |
+
struct _xmlSchemaFacetLink {
|
| 399 |
+
struct _xmlSchemaFacetLink *next;/* the next facet link ... */
|
| 400 |
+
xmlSchemaFacetPtr facet;/* the linked facet */
|
| 401 |
+
};
|
| 402 |
+
|
| 403 |
+
/**
|
| 404 |
+
* XML_SCHEMAS_TYPE_MIXED:
|
| 405 |
+
*
|
| 406 |
+
* the element content type is mixed
|
| 407 |
+
*/
|
| 408 |
+
#define XML_SCHEMAS_TYPE_MIXED 1 << 0
|
| 409 |
+
/**
|
| 410 |
+
* XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION:
|
| 411 |
+
*
|
| 412 |
+
* the simple or complex type has a derivation method of "extension".
|
| 413 |
+
*/
|
| 414 |
+
#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION 1 << 1
|
| 415 |
+
/**
|
| 416 |
+
* XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION:
|
| 417 |
+
*
|
| 418 |
+
* the simple or complex type has a derivation method of "restriction".
|
| 419 |
+
*/
|
| 420 |
+
#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION 1 << 2
|
| 421 |
+
/**
|
| 422 |
+
* XML_SCHEMAS_TYPE_GLOBAL:
|
| 423 |
+
*
|
| 424 |
+
* the type is global
|
| 425 |
+
*/
|
| 426 |
+
#define XML_SCHEMAS_TYPE_GLOBAL 1 << 3
|
| 427 |
+
/**
|
| 428 |
+
* XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD:
|
| 429 |
+
*
|
| 430 |
+
* the complexType owns an attribute wildcard, i.e.
|
| 431 |
+
* it can be freed by the complexType
|
| 432 |
+
*/
|
| 433 |
+
#define XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD 1 << 4 /* Obsolete. */
|
| 434 |
+
/**
|
| 435 |
+
* XML_SCHEMAS_TYPE_VARIETY_ABSENT:
|
| 436 |
+
*
|
| 437 |
+
* the simpleType has a variety of "absent".
|
| 438 |
+
* TODO: Actually not necessary :-/, since if
|
| 439 |
+
* none of the variety flags occur then it's
|
| 440 |
+
* automatically absent.
|
| 441 |
+
*/
|
| 442 |
+
#define XML_SCHEMAS_TYPE_VARIETY_ABSENT 1 << 5
|
| 443 |
+
/**
|
| 444 |
+
* XML_SCHEMAS_TYPE_VARIETY_LIST:
|
| 445 |
+
*
|
| 446 |
+
* the simpleType has a variety of "list".
|
| 447 |
+
*/
|
| 448 |
+
#define XML_SCHEMAS_TYPE_VARIETY_LIST 1 << 6
|
| 449 |
+
/**
|
| 450 |
+
* XML_SCHEMAS_TYPE_VARIETY_UNION:
|
| 451 |
+
*
|
| 452 |
+
* the simpleType has a variety of "union".
|
| 453 |
+
*/
|
| 454 |
+
#define XML_SCHEMAS_TYPE_VARIETY_UNION 1 << 7
|
| 455 |
+
/**
|
| 456 |
+
* XML_SCHEMAS_TYPE_VARIETY_ATOMIC:
|
| 457 |
+
*
|
| 458 |
+
* the simpleType has a variety of "union".
|
| 459 |
+
*/
|
| 460 |
+
#define XML_SCHEMAS_TYPE_VARIETY_ATOMIC 1 << 8
|
| 461 |
+
/**
|
| 462 |
+
* XML_SCHEMAS_TYPE_FINAL_EXTENSION:
|
| 463 |
+
*
|
| 464 |
+
* the complexType has a final of "extension".
|
| 465 |
+
*/
|
| 466 |
+
#define XML_SCHEMAS_TYPE_FINAL_EXTENSION 1 << 9
|
| 467 |
+
/**
|
| 468 |
+
* XML_SCHEMAS_TYPE_FINAL_RESTRICTION:
|
| 469 |
+
*
|
| 470 |
+
* the simpleType/complexType has a final of "restriction".
|
| 471 |
+
*/
|
| 472 |
+
#define XML_SCHEMAS_TYPE_FINAL_RESTRICTION 1 << 10
|
| 473 |
+
/**
|
| 474 |
+
* XML_SCHEMAS_TYPE_FINAL_LIST:
|
| 475 |
+
*
|
| 476 |
+
* the simpleType has a final of "list".
|
| 477 |
+
*/
|
| 478 |
+
#define XML_SCHEMAS_TYPE_FINAL_LIST 1 << 11
|
| 479 |
+
/**
|
| 480 |
+
* XML_SCHEMAS_TYPE_FINAL_UNION:
|
| 481 |
+
*
|
| 482 |
+
* the simpleType has a final of "union".
|
| 483 |
+
*/
|
| 484 |
+
#define XML_SCHEMAS_TYPE_FINAL_UNION 1 << 12
|
| 485 |
+
/**
|
| 486 |
+
* XML_SCHEMAS_TYPE_FINAL_DEFAULT:
|
| 487 |
+
*
|
| 488 |
+
* the simpleType has a final of "default".
|
| 489 |
+
*/
|
| 490 |
+
#define XML_SCHEMAS_TYPE_FINAL_DEFAULT 1 << 13
|
| 491 |
+
/**
|
| 492 |
+
* XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE:
|
| 493 |
+
*
|
| 494 |
+
* Marks the item as a builtin primitive.
|
| 495 |
+
*/
|
| 496 |
+
#define XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE 1 << 14
|
| 497 |
+
/**
|
| 498 |
+
* XML_SCHEMAS_TYPE_MARKED:
|
| 499 |
+
*
|
| 500 |
+
* Marks the item as marked; used for circular checks.
|
| 501 |
+
*/
|
| 502 |
+
#define XML_SCHEMAS_TYPE_MARKED 1 << 16
|
| 503 |
+
/**
|
| 504 |
+
* XML_SCHEMAS_TYPE_BLOCK_DEFAULT:
|
| 505 |
+
*
|
| 506 |
+
* the complexType did not specify 'block' so use the default of the
|
| 507 |
+
* <schema> item.
|
| 508 |
+
*/
|
| 509 |
+
#define XML_SCHEMAS_TYPE_BLOCK_DEFAULT 1 << 17
|
| 510 |
+
/**
|
| 511 |
+
* XML_SCHEMAS_TYPE_BLOCK_EXTENSION:
|
| 512 |
+
*
|
| 513 |
+
* the complexType has a 'block' of "extension".
|
| 514 |
+
*/
|
| 515 |
+
#define XML_SCHEMAS_TYPE_BLOCK_EXTENSION 1 << 18
|
| 516 |
+
/**
|
| 517 |
+
* XML_SCHEMAS_TYPE_BLOCK_RESTRICTION:
|
| 518 |
+
*
|
| 519 |
+
* the complexType has a 'block' of "restriction".
|
| 520 |
+
*/
|
| 521 |
+
#define XML_SCHEMAS_TYPE_BLOCK_RESTRICTION 1 << 19
|
| 522 |
+
/**
|
| 523 |
+
* XML_SCHEMAS_TYPE_ABSTRACT:
|
| 524 |
+
*
|
| 525 |
+
* the simple/complexType is abstract.
|
| 526 |
+
*/
|
| 527 |
+
#define XML_SCHEMAS_TYPE_ABSTRACT 1 << 20
|
| 528 |
+
/**
|
| 529 |
+
* XML_SCHEMAS_TYPE_FACETSNEEDVALUE:
|
| 530 |
+
*
|
| 531 |
+
* indicates if the facets need a computed value
|
| 532 |
+
*/
|
| 533 |
+
#define XML_SCHEMAS_TYPE_FACETSNEEDVALUE 1 << 21
|
| 534 |
+
/**
|
| 535 |
+
* XML_SCHEMAS_TYPE_INTERNAL_RESOLVED:
|
| 536 |
+
*
|
| 537 |
+
* indicates that the type was typefixed
|
| 538 |
+
*/
|
| 539 |
+
#define XML_SCHEMAS_TYPE_INTERNAL_RESOLVED 1 << 22
|
| 540 |
+
/**
|
| 541 |
+
* XML_SCHEMAS_TYPE_INTERNAL_INVALID:
|
| 542 |
+
*
|
| 543 |
+
* indicates that the type is invalid
|
| 544 |
+
*/
|
| 545 |
+
#define XML_SCHEMAS_TYPE_INTERNAL_INVALID 1 << 23
|
| 546 |
+
/**
|
| 547 |
+
* XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE:
|
| 548 |
+
*
|
| 549 |
+
* a whitespace-facet value of "preserve"
|
| 550 |
+
*/
|
| 551 |
+
#define XML_SCHEMAS_TYPE_WHITESPACE_PRESERVE 1 << 24
|
| 552 |
+
/**
|
| 553 |
+
* XML_SCHEMAS_TYPE_WHITESPACE_REPLACE:
|
| 554 |
+
*
|
| 555 |
+
* a whitespace-facet value of "replace"
|
| 556 |
+
*/
|
| 557 |
+
#define XML_SCHEMAS_TYPE_WHITESPACE_REPLACE 1 << 25
|
| 558 |
+
/**
|
| 559 |
+
* XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE:
|
| 560 |
+
*
|
| 561 |
+
* a whitespace-facet value of "collapse"
|
| 562 |
+
*/
|
| 563 |
+
#define XML_SCHEMAS_TYPE_WHITESPACE_COLLAPSE 1 << 26
|
| 564 |
+
/**
|
| 565 |
+
* XML_SCHEMAS_TYPE_HAS_FACETS:
|
| 566 |
+
*
|
| 567 |
+
* has facets
|
| 568 |
+
*/
|
| 569 |
+
#define XML_SCHEMAS_TYPE_HAS_FACETS 1 << 27
|
| 570 |
+
/**
|
| 571 |
+
* XML_SCHEMAS_TYPE_NORMVALUENEEDED:
|
| 572 |
+
*
|
| 573 |
+
* indicates if the facets (pattern) need a normalized value
|
| 574 |
+
*/
|
| 575 |
+
#define XML_SCHEMAS_TYPE_NORMVALUENEEDED 1 << 28
|
| 576 |
+
|
| 577 |
+
/**
|
| 578 |
+
* XML_SCHEMAS_TYPE_FIXUP_1:
|
| 579 |
+
*
|
| 580 |
+
* First stage of fixup was done.
|
| 581 |
+
*/
|
| 582 |
+
#define XML_SCHEMAS_TYPE_FIXUP_1 1 << 29
|
| 583 |
+
|
| 584 |
+
/**
|
| 585 |
+
* XML_SCHEMAS_TYPE_REDEFINED:
|
| 586 |
+
*
|
| 587 |
+
* The type was redefined.
|
| 588 |
+
*/
|
| 589 |
+
#define XML_SCHEMAS_TYPE_REDEFINED 1 << 30
|
| 590 |
+
/**
|
| 591 |
+
* XML_SCHEMAS_TYPE_REDEFINING:
|
| 592 |
+
*
|
| 593 |
+
* The type redefines an other type.
|
| 594 |
+
*/
|
| 595 |
+
/* #define XML_SCHEMAS_TYPE_REDEFINING 1 << 31 */
|
| 596 |
+
|
| 597 |
+
/**
|
| 598 |
+
* _xmlSchemaType:
|
| 599 |
+
*
|
| 600 |
+
* Schemas type definition.
|
| 601 |
+
*/
|
| 602 |
+
struct _xmlSchemaType {
|
| 603 |
+
xmlSchemaTypeType type; /* The kind of type */
|
| 604 |
+
struct _xmlSchemaType *next; /* the next type if in a sequence ... */
|
| 605 |
+
const xmlChar *name;
|
| 606 |
+
const xmlChar *id ; /* Deprecated; not used */
|
| 607 |
+
const xmlChar *ref; /* Deprecated; not used */
|
| 608 |
+
const xmlChar *refNs; /* Deprecated; not used */
|
| 609 |
+
xmlSchemaAnnotPtr annot;
|
| 610 |
+
xmlSchemaTypePtr subtypes;
|
| 611 |
+
xmlSchemaAttributePtr attributes; /* Deprecated; not used */
|
| 612 |
+
xmlNodePtr node;
|
| 613 |
+
int minOccurs; /* Deprecated; not used */
|
| 614 |
+
int maxOccurs; /* Deprecated; not used */
|
| 615 |
+
|
| 616 |
+
int flags;
|
| 617 |
+
xmlSchemaContentType contentType;
|
| 618 |
+
const xmlChar *base; /* Base type's local name */
|
| 619 |
+
const xmlChar *baseNs; /* Base type's target namespace */
|
| 620 |
+
xmlSchemaTypePtr baseType; /* The base type component */
|
| 621 |
+
xmlSchemaFacetPtr facets; /* Local facets */
|
| 622 |
+
struct _xmlSchemaType *redef; /* Deprecated; not used */
|
| 623 |
+
int recurse; /* Obsolete */
|
| 624 |
+
xmlSchemaAttributeLinkPtr *attributeUses; /* Deprecated; not used */
|
| 625 |
+
xmlSchemaWildcardPtr attributeWildcard;
|
| 626 |
+
int builtInType; /* Type of built-in types. */
|
| 627 |
+
xmlSchemaTypeLinkPtr memberTypes; /* member-types if a union type. */
|
| 628 |
+
xmlSchemaFacetLinkPtr facetSet; /* All facets (incl. inherited) */
|
| 629 |
+
const xmlChar *refPrefix; /* Deprecated; not used */
|
| 630 |
+
xmlSchemaTypePtr contentTypeDef; /* Used for the simple content of complex types.
|
| 631 |
+
Could we use @subtypes for this? */
|
| 632 |
+
xmlRegexpPtr contModel; /* Holds the automaton of the content model */
|
| 633 |
+
const xmlChar *targetNamespace;
|
| 634 |
+
void *attrUses;
|
| 635 |
+
};
|
| 636 |
+
|
| 637 |
+
/*
|
| 638 |
+
* xmlSchemaElement:
|
| 639 |
+
* An element definition.
|
| 640 |
+
*
|
| 641 |
+
* xmlSchemaType, xmlSchemaFacet and xmlSchemaElement start of
|
| 642 |
+
* structures must be kept similar
|
| 643 |
+
*/
|
| 644 |
+
/**
|
| 645 |
+
* XML_SCHEMAS_ELEM_NILLABLE:
|
| 646 |
+
*
|
| 647 |
+
* the element is nillable
|
| 648 |
+
*/
|
| 649 |
+
#define XML_SCHEMAS_ELEM_NILLABLE 1 << 0
|
| 650 |
+
/**
|
| 651 |
+
* XML_SCHEMAS_ELEM_GLOBAL:
|
| 652 |
+
*
|
| 653 |
+
* the element is global
|
| 654 |
+
*/
|
| 655 |
+
#define XML_SCHEMAS_ELEM_GLOBAL 1 << 1
|
| 656 |
+
/**
|
| 657 |
+
* XML_SCHEMAS_ELEM_DEFAULT:
|
| 658 |
+
*
|
| 659 |
+
* the element has a default value
|
| 660 |
+
*/
|
| 661 |
+
#define XML_SCHEMAS_ELEM_DEFAULT 1 << 2
|
| 662 |
+
/**
|
| 663 |
+
* XML_SCHEMAS_ELEM_FIXED:
|
| 664 |
+
*
|
| 665 |
+
* the element has a fixed value
|
| 666 |
+
*/
|
| 667 |
+
#define XML_SCHEMAS_ELEM_FIXED 1 << 3
|
| 668 |
+
/**
|
| 669 |
+
* XML_SCHEMAS_ELEM_ABSTRACT:
|
| 670 |
+
*
|
| 671 |
+
* the element is abstract
|
| 672 |
+
*/
|
| 673 |
+
#define XML_SCHEMAS_ELEM_ABSTRACT 1 << 4
|
| 674 |
+
/**
|
| 675 |
+
* XML_SCHEMAS_ELEM_TOPLEVEL:
|
| 676 |
+
*
|
| 677 |
+
* the element is top level
|
| 678 |
+
* obsolete: use XML_SCHEMAS_ELEM_GLOBAL instead
|
| 679 |
+
*/
|
| 680 |
+
#define XML_SCHEMAS_ELEM_TOPLEVEL 1 << 5
|
| 681 |
+
/**
|
| 682 |
+
* XML_SCHEMAS_ELEM_REF:
|
| 683 |
+
*
|
| 684 |
+
* the element is a reference to a type
|
| 685 |
+
*/
|
| 686 |
+
#define XML_SCHEMAS_ELEM_REF 1 << 6
|
| 687 |
+
/**
|
| 688 |
+
* XML_SCHEMAS_ELEM_NSDEFAULT:
|
| 689 |
+
*
|
| 690 |
+
* allow elements in no namespace
|
| 691 |
+
* Obsolete, not used anymore.
|
| 692 |
+
*/
|
| 693 |
+
#define XML_SCHEMAS_ELEM_NSDEFAULT 1 << 7
|
| 694 |
+
/**
|
| 695 |
+
* XML_SCHEMAS_ELEM_INTERNAL_RESOLVED:
|
| 696 |
+
*
|
| 697 |
+
* this is set when "type", "ref", "substitutionGroup"
|
| 698 |
+
* references have been resolved.
|
| 699 |
+
*/
|
| 700 |
+
#define XML_SCHEMAS_ELEM_INTERNAL_RESOLVED 1 << 8
|
| 701 |
+
/**
|
| 702 |
+
* XML_SCHEMAS_ELEM_CIRCULAR:
|
| 703 |
+
*
|
| 704 |
+
* a helper flag for the search of circular references.
|
| 705 |
+
*/
|
| 706 |
+
#define XML_SCHEMAS_ELEM_CIRCULAR 1 << 9
|
| 707 |
+
/**
|
| 708 |
+
* XML_SCHEMAS_ELEM_BLOCK_ABSENT:
|
| 709 |
+
*
|
| 710 |
+
* the "block" attribute is absent
|
| 711 |
+
*/
|
| 712 |
+
#define XML_SCHEMAS_ELEM_BLOCK_ABSENT 1 << 10
|
| 713 |
+
/**
|
| 714 |
+
* XML_SCHEMAS_ELEM_BLOCK_EXTENSION:
|
| 715 |
+
*
|
| 716 |
+
* disallowed substitutions are absent
|
| 717 |
+
*/
|
| 718 |
+
#define XML_SCHEMAS_ELEM_BLOCK_EXTENSION 1 << 11
|
| 719 |
+
/**
|
| 720 |
+
* XML_SCHEMAS_ELEM_BLOCK_RESTRICTION:
|
| 721 |
+
*
|
| 722 |
+
* disallowed substitutions: "restriction"
|
| 723 |
+
*/
|
| 724 |
+
#define XML_SCHEMAS_ELEM_BLOCK_RESTRICTION 1 << 12
|
| 725 |
+
/**
|
| 726 |
+
* XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION:
|
| 727 |
+
*
|
| 728 |
+
* disallowed substitutions: "substitution"
|
| 729 |
+
*/
|
| 730 |
+
#define XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION 1 << 13
|
| 731 |
+
/**
|
| 732 |
+
* XML_SCHEMAS_ELEM_FINAL_ABSENT:
|
| 733 |
+
*
|
| 734 |
+
* substitution group exclusions are absent
|
| 735 |
+
*/
|
| 736 |
+
#define XML_SCHEMAS_ELEM_FINAL_ABSENT 1 << 14
|
| 737 |
+
/**
|
| 738 |
+
* XML_SCHEMAS_ELEM_FINAL_EXTENSION:
|
| 739 |
+
*
|
| 740 |
+
* substitution group exclusions: "extension"
|
| 741 |
+
*/
|
| 742 |
+
#define XML_SCHEMAS_ELEM_FINAL_EXTENSION 1 << 15
|
| 743 |
+
/**
|
| 744 |
+
* XML_SCHEMAS_ELEM_FINAL_RESTRICTION:
|
| 745 |
+
*
|
| 746 |
+
* substitution group exclusions: "restriction"
|
| 747 |
+
*/
|
| 748 |
+
#define XML_SCHEMAS_ELEM_FINAL_RESTRICTION 1 << 16
|
| 749 |
+
/**
|
| 750 |
+
* XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD:
|
| 751 |
+
*
|
| 752 |
+
* the declaration is a substitution group head
|
| 753 |
+
*/
|
| 754 |
+
#define XML_SCHEMAS_ELEM_SUBST_GROUP_HEAD 1 << 17
|
| 755 |
+
/**
|
| 756 |
+
* XML_SCHEMAS_ELEM_INTERNAL_CHECKED:
|
| 757 |
+
*
|
| 758 |
+
* this is set when the elem decl has been checked against
|
| 759 |
+
* all constraints
|
| 760 |
+
*/
|
| 761 |
+
#define XML_SCHEMAS_ELEM_INTERNAL_CHECKED 1 << 18
|
| 762 |
+
|
| 763 |
+
typedef struct _xmlSchemaElement xmlSchemaElement;
|
| 764 |
+
typedef xmlSchemaElement *xmlSchemaElementPtr;
|
| 765 |
+
struct _xmlSchemaElement {
|
| 766 |
+
xmlSchemaTypeType type; /* The kind of type */
|
| 767 |
+
struct _xmlSchemaType *next; /* Not used? */
|
| 768 |
+
const xmlChar *name;
|
| 769 |
+
const xmlChar *id; /* Deprecated; not used */
|
| 770 |
+
const xmlChar *ref; /* Deprecated; not used */
|
| 771 |
+
const xmlChar *refNs; /* Deprecated; not used */
|
| 772 |
+
xmlSchemaAnnotPtr annot;
|
| 773 |
+
xmlSchemaTypePtr subtypes; /* the type definition */
|
| 774 |
+
xmlSchemaAttributePtr attributes;
|
| 775 |
+
xmlNodePtr node;
|
| 776 |
+
int minOccurs; /* Deprecated; not used */
|
| 777 |
+
int maxOccurs; /* Deprecated; not used */
|
| 778 |
+
|
| 779 |
+
int flags;
|
| 780 |
+
const xmlChar *targetNamespace;
|
| 781 |
+
const xmlChar *namedType;
|
| 782 |
+
const xmlChar *namedTypeNs;
|
| 783 |
+
const xmlChar *substGroup;
|
| 784 |
+
const xmlChar *substGroupNs;
|
| 785 |
+
const xmlChar *scope;
|
| 786 |
+
const xmlChar *value; /* The original value of the value constraint. */
|
| 787 |
+
struct _xmlSchemaElement *refDecl; /* This will now be used for the
|
| 788 |
+
substitution group affiliation */
|
| 789 |
+
xmlRegexpPtr contModel; /* Obsolete for WXS, maybe used for RelaxNG */
|
| 790 |
+
xmlSchemaContentType contentType;
|
| 791 |
+
const xmlChar *refPrefix; /* Deprecated; not used */
|
| 792 |
+
xmlSchemaValPtr defVal; /* The compiled value constraint. */
|
| 793 |
+
void *idcs; /* The identity-constraint defs */
|
| 794 |
+
};
|
| 795 |
+
|
| 796 |
+
/*
|
| 797 |
+
* XML_SCHEMAS_FACET_UNKNOWN:
|
| 798 |
+
*
|
| 799 |
+
* unknown facet handling
|
| 800 |
+
*/
|
| 801 |
+
#define XML_SCHEMAS_FACET_UNKNOWN 0
|
| 802 |
+
/*
|
| 803 |
+
* XML_SCHEMAS_FACET_PRESERVE:
|
| 804 |
+
*
|
| 805 |
+
* preserve the type of the facet
|
| 806 |
+
*/
|
| 807 |
+
#define XML_SCHEMAS_FACET_PRESERVE 1
|
| 808 |
+
/*
|
| 809 |
+
* XML_SCHEMAS_FACET_REPLACE:
|
| 810 |
+
*
|
| 811 |
+
* replace the type of the facet
|
| 812 |
+
*/
|
| 813 |
+
#define XML_SCHEMAS_FACET_REPLACE 2
|
| 814 |
+
/*
|
| 815 |
+
* XML_SCHEMAS_FACET_COLLAPSE:
|
| 816 |
+
*
|
| 817 |
+
* collapse the types of the facet
|
| 818 |
+
*/
|
| 819 |
+
#define XML_SCHEMAS_FACET_COLLAPSE 3
|
| 820 |
+
/**
|
| 821 |
+
* A facet definition.
|
| 822 |
+
*/
|
| 823 |
+
struct _xmlSchemaFacet {
|
| 824 |
+
xmlSchemaTypeType type; /* The kind of type */
|
| 825 |
+
struct _xmlSchemaFacet *next;/* the next type if in a sequence ... */
|
| 826 |
+
const xmlChar *value; /* The original value */
|
| 827 |
+
const xmlChar *id; /* Obsolete */
|
| 828 |
+
xmlSchemaAnnotPtr annot;
|
| 829 |
+
xmlNodePtr node;
|
| 830 |
+
int fixed; /* XML_SCHEMAS_FACET_PRESERVE, etc. */
|
| 831 |
+
int whitespace;
|
| 832 |
+
xmlSchemaValPtr val; /* The compiled value */
|
| 833 |
+
xmlRegexpPtr regexp; /* The regex for patterns */
|
| 834 |
+
};
|
| 835 |
+
|
| 836 |
+
/**
|
| 837 |
+
* A notation definition.
|
| 838 |
+
*/
|
| 839 |
+
typedef struct _xmlSchemaNotation xmlSchemaNotation;
|
| 840 |
+
typedef xmlSchemaNotation *xmlSchemaNotationPtr;
|
| 841 |
+
struct _xmlSchemaNotation {
|
| 842 |
+
xmlSchemaTypeType type; /* The kind of type */
|
| 843 |
+
const xmlChar *name;
|
| 844 |
+
xmlSchemaAnnotPtr annot;
|
| 845 |
+
const xmlChar *identifier;
|
| 846 |
+
const xmlChar *targetNamespace;
|
| 847 |
+
};
|
| 848 |
+
|
| 849 |
+
/*
|
| 850 |
+
* TODO: Actually all those flags used for the schema should sit
|
| 851 |
+
* on the schema parser context, since they are used only
|
| 852 |
+
* during parsing an XML schema document, and not available
|
| 853 |
+
* on the component level as per spec.
|
| 854 |
+
*/
|
| 855 |
+
/**
|
| 856 |
+
* XML_SCHEMAS_QUALIF_ELEM:
|
| 857 |
+
*
|
| 858 |
+
* Reflects elementFormDefault == qualified in
|
| 859 |
+
* an XML schema document.
|
| 860 |
+
*/
|
| 861 |
+
#define XML_SCHEMAS_QUALIF_ELEM 1 << 0
|
| 862 |
+
/**
|
| 863 |
+
* XML_SCHEMAS_QUALIF_ATTR:
|
| 864 |
+
*
|
| 865 |
+
* Reflects attributeFormDefault == qualified in
|
| 866 |
+
* an XML schema document.
|
| 867 |
+
*/
|
| 868 |
+
#define XML_SCHEMAS_QUALIF_ATTR 1 << 1
|
| 869 |
+
/**
|
| 870 |
+
* XML_SCHEMAS_FINAL_DEFAULT_EXTENSION:
|
| 871 |
+
*
|
| 872 |
+
* the schema has "extension" in the set of finalDefault.
|
| 873 |
+
*/
|
| 874 |
+
#define XML_SCHEMAS_FINAL_DEFAULT_EXTENSION 1 << 2
|
| 875 |
+
/**
|
| 876 |
+
* XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION:
|
| 877 |
+
*
|
| 878 |
+
* the schema has "restriction" in the set of finalDefault.
|
| 879 |
+
*/
|
| 880 |
+
#define XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION 1 << 3
|
| 881 |
+
/**
|
| 882 |
+
* XML_SCHEMAS_FINAL_DEFAULT_LIST:
|
| 883 |
+
*
|
| 884 |
+
* the schema has "list" in the set of finalDefault.
|
| 885 |
+
*/
|
| 886 |
+
#define XML_SCHEMAS_FINAL_DEFAULT_LIST 1 << 4
|
| 887 |
+
/**
|
| 888 |
+
* XML_SCHEMAS_FINAL_DEFAULT_UNION:
|
| 889 |
+
*
|
| 890 |
+
* the schema has "union" in the set of finalDefault.
|
| 891 |
+
*/
|
| 892 |
+
#define XML_SCHEMAS_FINAL_DEFAULT_UNION 1 << 5
|
| 893 |
+
/**
|
| 894 |
+
* XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION:
|
| 895 |
+
*
|
| 896 |
+
* the schema has "extension" in the set of blockDefault.
|
| 897 |
+
*/
|
| 898 |
+
#define XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION 1 << 6
|
| 899 |
+
/**
|
| 900 |
+
* XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION:
|
| 901 |
+
*
|
| 902 |
+
* the schema has "restriction" in the set of blockDefault.
|
| 903 |
+
*/
|
| 904 |
+
#define XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION 1 << 7
|
| 905 |
+
/**
|
| 906 |
+
* XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION:
|
| 907 |
+
*
|
| 908 |
+
* the schema has "substitution" in the set of blockDefault.
|
| 909 |
+
*/
|
| 910 |
+
#define XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION 1 << 8
|
| 911 |
+
/**
|
| 912 |
+
* XML_SCHEMAS_INCLUDING_CONVERT_NS:
|
| 913 |
+
*
|
| 914 |
+
* the schema is currently including an other schema with
|
| 915 |
+
* no target namespace.
|
| 916 |
+
*/
|
| 917 |
+
#define XML_SCHEMAS_INCLUDING_CONVERT_NS 1 << 9
|
| 918 |
+
/**
|
| 919 |
+
* _xmlSchema:
|
| 920 |
+
*
|
| 921 |
+
* A Schemas definition
|
| 922 |
+
*/
|
| 923 |
+
struct _xmlSchema {
|
| 924 |
+
const xmlChar *name; /* schema name */
|
| 925 |
+
const xmlChar *targetNamespace; /* the target namespace */
|
| 926 |
+
const xmlChar *version;
|
| 927 |
+
const xmlChar *id; /* Obsolete */
|
| 928 |
+
xmlDocPtr doc;
|
| 929 |
+
xmlSchemaAnnotPtr annot;
|
| 930 |
+
int flags;
|
| 931 |
+
|
| 932 |
+
xmlHashTablePtr typeDecl;
|
| 933 |
+
xmlHashTablePtr attrDecl;
|
| 934 |
+
xmlHashTablePtr attrgrpDecl;
|
| 935 |
+
xmlHashTablePtr elemDecl;
|
| 936 |
+
xmlHashTablePtr notaDecl;
|
| 937 |
+
|
| 938 |
+
xmlHashTablePtr schemasImports;
|
| 939 |
+
|
| 940 |
+
void *_private; /* unused by the library for users or bindings */
|
| 941 |
+
xmlHashTablePtr groupDecl;
|
| 942 |
+
xmlDictPtr dict;
|
| 943 |
+
void *includes; /* the includes, this is opaque for now */
|
| 944 |
+
int preserve; /* whether to free the document */
|
| 945 |
+
int counter; /* used to give anonymous components unique names */
|
| 946 |
+
xmlHashTablePtr idcDef; /* All identity-constraint defs. */
|
| 947 |
+
void *volatiles; /* Obsolete */
|
| 948 |
+
};
|
| 949 |
+
|
| 950 |
+
XMLPUBFUN void xmlSchemaFreeType (xmlSchemaTypePtr type);
|
| 951 |
+
XMLPUBFUN void xmlSchemaFreeWildcard(xmlSchemaWildcardPtr wildcard);
|
| 952 |
+
|
| 953 |
+
#ifdef __cplusplus
|
| 954 |
+
}
|
| 955 |
+
#endif
|
| 956 |
+
|
| 957 |
+
#endif /* LIBXML_SCHEMAS_ENABLED */
|
| 958 |
+
#endif /* __XML_SCHEMA_INTERNALS_H__ */
|
pgsql/include/libxml/schematron.h
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: XML Schematron implementation
|
| 3 |
+
* Description: interface to the XML Schematron validity checking.
|
| 4 |
+
*
|
| 5 |
+
* Copy: See Copyright for the status of this software.
|
| 6 |
+
*
|
| 7 |
+
* Author: Daniel Veillard
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
#ifndef __XML_SCHEMATRON_H__
|
| 12 |
+
#define __XML_SCHEMATRON_H__
|
| 13 |
+
|
| 14 |
+
#include <libxml/xmlversion.h>
|
| 15 |
+
|
| 16 |
+
#ifdef LIBXML_SCHEMATRON_ENABLED
|
| 17 |
+
|
| 18 |
+
#include <libxml/tree.h>
|
| 19 |
+
|
| 20 |
+
#ifdef __cplusplus
|
| 21 |
+
extern "C" {
|
| 22 |
+
#endif
|
| 23 |
+
|
| 24 |
+
typedef enum {
|
| 25 |
+
XML_SCHEMATRON_OUT_QUIET = 1 << 0, /* quiet no report */
|
| 26 |
+
XML_SCHEMATRON_OUT_TEXT = 1 << 1, /* build a textual report */
|
| 27 |
+
XML_SCHEMATRON_OUT_XML = 1 << 2, /* output SVRL */
|
| 28 |
+
XML_SCHEMATRON_OUT_ERROR = 1 << 3, /* output via xmlStructuredErrorFunc */
|
| 29 |
+
XML_SCHEMATRON_OUT_FILE = 1 << 8, /* output to a file descriptor */
|
| 30 |
+
XML_SCHEMATRON_OUT_BUFFER = 1 << 9, /* output to a buffer */
|
| 31 |
+
XML_SCHEMATRON_OUT_IO = 1 << 10 /* output to I/O mechanism */
|
| 32 |
+
} xmlSchematronValidOptions;
|
| 33 |
+
|
| 34 |
+
/**
|
| 35 |
+
* The schemas related types are kept internal
|
| 36 |
+
*/
|
| 37 |
+
typedef struct _xmlSchematron xmlSchematron;
|
| 38 |
+
typedef xmlSchematron *xmlSchematronPtr;
|
| 39 |
+
|
| 40 |
+
/**
|
| 41 |
+
* xmlSchematronValidityErrorFunc:
|
| 42 |
+
* @ctx: the validation context
|
| 43 |
+
* @msg: the message
|
| 44 |
+
* @...: extra arguments
|
| 45 |
+
*
|
| 46 |
+
* Signature of an error callback from a Schematron validation
|
| 47 |
+
*/
|
| 48 |
+
typedef void (*xmlSchematronValidityErrorFunc) (void *ctx, const char *msg, ...);
|
| 49 |
+
|
| 50 |
+
/**
|
| 51 |
+
* xmlSchematronValidityWarningFunc:
|
| 52 |
+
* @ctx: the validation context
|
| 53 |
+
* @msg: the message
|
| 54 |
+
* @...: extra arguments
|
| 55 |
+
*
|
| 56 |
+
* Signature of a warning callback from a Schematron validation
|
| 57 |
+
*/
|
| 58 |
+
typedef void (*xmlSchematronValidityWarningFunc) (void *ctx, const char *msg, ...);
|
| 59 |
+
|
| 60 |
+
/**
|
| 61 |
+
* A schemas validation context
|
| 62 |
+
*/
|
| 63 |
+
typedef struct _xmlSchematronParserCtxt xmlSchematronParserCtxt;
|
| 64 |
+
typedef xmlSchematronParserCtxt *xmlSchematronParserCtxtPtr;
|
| 65 |
+
|
| 66 |
+
typedef struct _xmlSchematronValidCtxt xmlSchematronValidCtxt;
|
| 67 |
+
typedef xmlSchematronValidCtxt *xmlSchematronValidCtxtPtr;
|
| 68 |
+
|
| 69 |
+
/*
|
| 70 |
+
* Interfaces for parsing.
|
| 71 |
+
*/
|
| 72 |
+
XMLPUBFUN xmlSchematronParserCtxtPtr
|
| 73 |
+
xmlSchematronNewParserCtxt (const char *URL);
|
| 74 |
+
XMLPUBFUN xmlSchematronParserCtxtPtr
|
| 75 |
+
xmlSchematronNewMemParserCtxt(const char *buffer,
|
| 76 |
+
int size);
|
| 77 |
+
XMLPUBFUN xmlSchematronParserCtxtPtr
|
| 78 |
+
xmlSchematronNewDocParserCtxt(xmlDocPtr doc);
|
| 79 |
+
XMLPUBFUN void
|
| 80 |
+
xmlSchematronFreeParserCtxt (xmlSchematronParserCtxtPtr ctxt);
|
| 81 |
+
/*****
|
| 82 |
+
XMLPUBFUN void
|
| 83 |
+
xmlSchematronSetParserErrors(xmlSchematronParserCtxtPtr ctxt,
|
| 84 |
+
xmlSchematronValidityErrorFunc err,
|
| 85 |
+
xmlSchematronValidityWarningFunc warn,
|
| 86 |
+
void *ctx);
|
| 87 |
+
XMLPUBFUN int
|
| 88 |
+
xmlSchematronGetParserErrors(xmlSchematronParserCtxtPtr ctxt,
|
| 89 |
+
xmlSchematronValidityErrorFunc * err,
|
| 90 |
+
xmlSchematronValidityWarningFunc * warn,
|
| 91 |
+
void **ctx);
|
| 92 |
+
XMLPUBFUN int
|
| 93 |
+
xmlSchematronIsValid (xmlSchematronValidCtxtPtr ctxt);
|
| 94 |
+
*****/
|
| 95 |
+
XMLPUBFUN xmlSchematronPtr
|
| 96 |
+
xmlSchematronParse (xmlSchematronParserCtxtPtr ctxt);
|
| 97 |
+
XMLPUBFUN void
|
| 98 |
+
xmlSchematronFree (xmlSchematronPtr schema);
|
| 99 |
+
/*
|
| 100 |
+
* Interfaces for validating
|
| 101 |
+
*/
|
| 102 |
+
XMLPUBFUN void
|
| 103 |
+
xmlSchematronSetValidStructuredErrors(
|
| 104 |
+
xmlSchematronValidCtxtPtr ctxt,
|
| 105 |
+
xmlStructuredErrorFunc serror,
|
| 106 |
+
void *ctx);
|
| 107 |
+
/******
|
| 108 |
+
XMLPUBFUN void
|
| 109 |
+
xmlSchematronSetValidErrors (xmlSchematronValidCtxtPtr ctxt,
|
| 110 |
+
xmlSchematronValidityErrorFunc err,
|
| 111 |
+
xmlSchematronValidityWarningFunc warn,
|
| 112 |
+
void *ctx);
|
| 113 |
+
XMLPUBFUN int
|
| 114 |
+
xmlSchematronGetValidErrors (xmlSchematronValidCtxtPtr ctxt,
|
| 115 |
+
xmlSchematronValidityErrorFunc *err,
|
| 116 |
+
xmlSchematronValidityWarningFunc *warn,
|
| 117 |
+
void **ctx);
|
| 118 |
+
XMLPUBFUN int
|
| 119 |
+
xmlSchematronSetValidOptions(xmlSchematronValidCtxtPtr ctxt,
|
| 120 |
+
int options);
|
| 121 |
+
XMLPUBFUN int
|
| 122 |
+
xmlSchematronValidCtxtGetOptions(xmlSchematronValidCtxtPtr ctxt);
|
| 123 |
+
XMLPUBFUN int
|
| 124 |
+
xmlSchematronValidateOneElement (xmlSchematronValidCtxtPtr ctxt,
|
| 125 |
+
xmlNodePtr elem);
|
| 126 |
+
*******/
|
| 127 |
+
|
| 128 |
+
XMLPUBFUN xmlSchematronValidCtxtPtr
|
| 129 |
+
xmlSchematronNewValidCtxt (xmlSchematronPtr schema,
|
| 130 |
+
int options);
|
| 131 |
+
XMLPUBFUN void
|
| 132 |
+
xmlSchematronFreeValidCtxt (xmlSchematronValidCtxtPtr ctxt);
|
| 133 |
+
XMLPUBFUN int
|
| 134 |
+
xmlSchematronValidateDoc (xmlSchematronValidCtxtPtr ctxt,
|
| 135 |
+
xmlDocPtr instance);
|
| 136 |
+
|
| 137 |
+
#ifdef __cplusplus
|
| 138 |
+
}
|
| 139 |
+
#endif
|
| 140 |
+
|
| 141 |
+
#endif /* LIBXML_SCHEMATRON_ENABLED */
|
| 142 |
+
#endif /* __XML_SCHEMATRON_H__ */
|
pgsql/include/libxml/threads.h
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Summary: interfaces for thread handling
|
| 3 |
+
* Description: set of generic threading related routines
|
| 4 |
+
* should work with pthreads, Windows native or TLS threads
|
| 5 |
+
*
|
| 6 |
+
* Copy: See Copyright for the status of this software.
|
| 7 |
+
*
|
| 8 |
+
* Author: Daniel Veillard
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
#ifndef __XML_THREADS_H__
|
| 12 |
+
#define __XML_THREADS_H__
|
| 13 |
+
|
| 14 |
+
#include <libxml/xmlversion.h>
|
| 15 |
+
|
| 16 |
+
#ifdef __cplusplus
|
| 17 |
+
extern "C" {
|
| 18 |
+
#endif
|
| 19 |
+
|
| 20 |
+
/*
|
| 21 |
+
* xmlMutex are a simple mutual exception locks.
|
| 22 |
+
*/
|
| 23 |
+
typedef struct _xmlMutex xmlMutex;
|
| 24 |
+
typedef xmlMutex *xmlMutexPtr;
|
| 25 |
+
|
| 26 |
+
/*
|
| 27 |
+
* xmlRMutex are reentrant mutual exception locks.
|
| 28 |
+
*/
|
| 29 |
+
typedef struct _xmlRMutex xmlRMutex;
|
| 30 |
+
typedef xmlRMutex *xmlRMutexPtr;
|
| 31 |
+
|
| 32 |
+
#ifdef __cplusplus
|
| 33 |
+
}
|
| 34 |
+
#endif
|
| 35 |
+
#include <libxml/globals.h>
|
| 36 |
+
#ifdef __cplusplus
|
| 37 |
+
extern "C" {
|
| 38 |
+
#endif
|
| 39 |
+
XMLPUBFUN xmlMutexPtr
|
| 40 |
+
xmlNewMutex (void);
|
| 41 |
+
XMLPUBFUN void
|
| 42 |
+
xmlMutexLock (xmlMutexPtr tok);
|
| 43 |
+
XMLPUBFUN void
|
| 44 |
+
xmlMutexUnlock (xmlMutexPtr tok);
|
| 45 |
+
XMLPUBFUN void
|
| 46 |
+
xmlFreeMutex (xmlMutexPtr tok);
|
| 47 |
+
|
| 48 |
+
XMLPUBFUN xmlRMutexPtr
|
| 49 |
+
xmlNewRMutex (void);
|
| 50 |
+
XMLPUBFUN void
|
| 51 |
+
xmlRMutexLock (xmlRMutexPtr tok);
|
| 52 |
+
XMLPUBFUN void
|
| 53 |
+
xmlRMutexUnlock (xmlRMutexPtr tok);
|
| 54 |
+
XMLPUBFUN void
|
| 55 |
+
xmlFreeRMutex (xmlRMutexPtr tok);
|
| 56 |
+
|
| 57 |
+
/*
|
| 58 |
+
* Library wide APIs.
|
| 59 |
+
*/
|
| 60 |
+
XML_DEPRECATED
|
| 61 |
+
XMLPUBFUN void
|
| 62 |
+
xmlInitThreads (void);
|
| 63 |
+
XMLPUBFUN void
|
| 64 |
+
xmlLockLibrary (void);
|
| 65 |
+
XMLPUBFUN void
|
| 66 |
+
xmlUnlockLibrary(void);
|
| 67 |
+
XML_DEPRECATED
|
| 68 |
+
XMLPUBFUN int
|
| 69 |
+
xmlGetThreadId (void);
|
| 70 |
+
XML_DEPRECATED
|
| 71 |
+
XMLPUBFUN int
|
| 72 |
+
xmlIsMainThread (void);
|
| 73 |
+
XML_DEPRECATED
|
| 74 |
+
XMLPUBFUN void
|
| 75 |
+
xmlCleanupThreads(void);
|
| 76 |
+
XML_DEPRECATED
|
| 77 |
+
XMLPUBFUN xmlGlobalStatePtr
|
| 78 |
+
xmlGetGlobalState(void);
|
| 79 |
+
|
| 80 |
+
/** DOC_DISABLE */
|
| 81 |
+
#if defined(LIBXML_THREAD_ENABLED) && defined(_WIN32) && \
|
| 82 |
+
!defined(HAVE_COMPILER_TLS) && defined(LIBXML_STATIC_FOR_DLL)
|
| 83 |
+
int
|
| 84 |
+
xmlDllMain(void *hinstDLL, unsigned long fdwReason,
|
| 85 |
+
void *lpvReserved);
|
| 86 |
+
#endif
|
| 87 |
+
/** DOC_ENABLE */
|
| 88 |
+
|
| 89 |
+
#ifdef __cplusplus
|
| 90 |
+
}
|
| 91 |
+
#endif
|
| 92 |
+
|
| 93 |
+
|
| 94 |
+
#endif /* __XML_THREADS_H__ */
|
pgsql/include/libxml/tree.h
ADDED
|
@@ -0,0 +1,1314 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: interfaces for tree manipulation
|
| 3 |
+
* Description: this module describes the structures found in an tree resulting
|
| 4 |
+
* from an XML or HTML parsing, as well as the API provided for
|
| 5 |
+
* various processing on that tree
|
| 6 |
+
*
|
| 7 |
+
* Copy: See Copyright for the status of this software.
|
| 8 |
+
*
|
| 9 |
+
* Author: Daniel Veillard
|
| 10 |
+
*/
|
| 11 |
+
|
| 12 |
+
#ifndef __XML_TREE_H__
|
| 13 |
+
#define __XML_TREE_H__
|
| 14 |
+
|
| 15 |
+
#include <stdio.h>
|
| 16 |
+
#include <limits.h>
|
| 17 |
+
#include <libxml/xmlversion.h>
|
| 18 |
+
#include <libxml/xmlstring.h>
|
| 19 |
+
|
| 20 |
+
#ifdef __cplusplus
|
| 21 |
+
extern "C" {
|
| 22 |
+
#endif
|
| 23 |
+
|
| 24 |
+
/*
|
| 25 |
+
* Some of the basic types pointer to structures:
|
| 26 |
+
*/
|
| 27 |
+
/* xmlIO.h */
|
| 28 |
+
typedef struct _xmlParserInputBuffer xmlParserInputBuffer;
|
| 29 |
+
typedef xmlParserInputBuffer *xmlParserInputBufferPtr;
|
| 30 |
+
|
| 31 |
+
typedef struct _xmlOutputBuffer xmlOutputBuffer;
|
| 32 |
+
typedef xmlOutputBuffer *xmlOutputBufferPtr;
|
| 33 |
+
|
| 34 |
+
/* parser.h */
|
| 35 |
+
typedef struct _xmlParserInput xmlParserInput;
|
| 36 |
+
typedef xmlParserInput *xmlParserInputPtr;
|
| 37 |
+
|
| 38 |
+
typedef struct _xmlParserCtxt xmlParserCtxt;
|
| 39 |
+
typedef xmlParserCtxt *xmlParserCtxtPtr;
|
| 40 |
+
|
| 41 |
+
typedef struct _xmlSAXLocator xmlSAXLocator;
|
| 42 |
+
typedef xmlSAXLocator *xmlSAXLocatorPtr;
|
| 43 |
+
|
| 44 |
+
typedef struct _xmlSAXHandler xmlSAXHandler;
|
| 45 |
+
typedef xmlSAXHandler *xmlSAXHandlerPtr;
|
| 46 |
+
|
| 47 |
+
/* entities.h */
|
| 48 |
+
typedef struct _xmlEntity xmlEntity;
|
| 49 |
+
typedef xmlEntity *xmlEntityPtr;
|
| 50 |
+
|
| 51 |
+
/**
|
| 52 |
+
* BASE_BUFFER_SIZE:
|
| 53 |
+
*
|
| 54 |
+
* default buffer size 4000.
|
| 55 |
+
*/
|
| 56 |
+
#define BASE_BUFFER_SIZE 4096
|
| 57 |
+
|
| 58 |
+
/**
|
| 59 |
+
* LIBXML_NAMESPACE_DICT:
|
| 60 |
+
*
|
| 61 |
+
* Defines experimental behaviour:
|
| 62 |
+
* 1) xmlNs gets an additional field @context (a xmlDoc)
|
| 63 |
+
* 2) when creating a tree, xmlNs->href is stored in the dict of xmlDoc.
|
| 64 |
+
*/
|
| 65 |
+
/* #define LIBXML_NAMESPACE_DICT */
|
| 66 |
+
|
| 67 |
+
/**
|
| 68 |
+
* xmlBufferAllocationScheme:
|
| 69 |
+
*
|
| 70 |
+
* A buffer allocation scheme can be defined to either match exactly the
|
| 71 |
+
* need or double it's allocated size each time it is found too small.
|
| 72 |
+
*/
|
| 73 |
+
|
| 74 |
+
typedef enum {
|
| 75 |
+
XML_BUFFER_ALLOC_DOUBLEIT, /* double each time one need to grow */
|
| 76 |
+
XML_BUFFER_ALLOC_EXACT, /* grow only to the minimal size */
|
| 77 |
+
XML_BUFFER_ALLOC_IMMUTABLE, /* immutable buffer, deprecated */
|
| 78 |
+
XML_BUFFER_ALLOC_IO, /* special allocation scheme used for I/O */
|
| 79 |
+
XML_BUFFER_ALLOC_HYBRID, /* exact up to a threshold, and doubleit thereafter */
|
| 80 |
+
XML_BUFFER_ALLOC_BOUNDED /* limit the upper size of the buffer */
|
| 81 |
+
} xmlBufferAllocationScheme;
|
| 82 |
+
|
| 83 |
+
/**
|
| 84 |
+
* xmlBuffer:
|
| 85 |
+
*
|
| 86 |
+
* A buffer structure, this old construct is limited to 2GB and
|
| 87 |
+
* is being deprecated, use API with xmlBuf instead
|
| 88 |
+
*/
|
| 89 |
+
typedef struct _xmlBuffer xmlBuffer;
|
| 90 |
+
typedef xmlBuffer *xmlBufferPtr;
|
| 91 |
+
struct _xmlBuffer {
|
| 92 |
+
xmlChar *content; /* The buffer content UTF8 */
|
| 93 |
+
unsigned int use; /* The buffer size used */
|
| 94 |
+
unsigned int size; /* The buffer size */
|
| 95 |
+
xmlBufferAllocationScheme alloc; /* The realloc method */
|
| 96 |
+
xmlChar *contentIO; /* in IO mode we may have a different base */
|
| 97 |
+
};
|
| 98 |
+
|
| 99 |
+
/**
|
| 100 |
+
* xmlBuf:
|
| 101 |
+
*
|
| 102 |
+
* A buffer structure, new one, the actual structure internals are not public
|
| 103 |
+
*/
|
| 104 |
+
|
| 105 |
+
typedef struct _xmlBuf xmlBuf;
|
| 106 |
+
|
| 107 |
+
/**
|
| 108 |
+
* xmlBufPtr:
|
| 109 |
+
*
|
| 110 |
+
* A pointer to a buffer structure, the actual structure internals are not
|
| 111 |
+
* public
|
| 112 |
+
*/
|
| 113 |
+
|
| 114 |
+
typedef xmlBuf *xmlBufPtr;
|
| 115 |
+
|
| 116 |
+
/*
|
| 117 |
+
* A few public routines for xmlBuf. As those are expected to be used
|
| 118 |
+
* mostly internally the bulk of the routines are internal in buf.h
|
| 119 |
+
*/
|
| 120 |
+
XMLPUBFUN xmlChar* xmlBufContent (const xmlBuf* buf);
|
| 121 |
+
XMLPUBFUN xmlChar* xmlBufEnd (xmlBufPtr buf);
|
| 122 |
+
XMLPUBFUN size_t xmlBufUse (const xmlBufPtr buf);
|
| 123 |
+
XMLPUBFUN size_t xmlBufShrink (xmlBufPtr buf, size_t len);
|
| 124 |
+
|
| 125 |
+
/*
|
| 126 |
+
* LIBXML2_NEW_BUFFER:
|
| 127 |
+
*
|
| 128 |
+
* Macro used to express that the API use the new buffers for
|
| 129 |
+
* xmlParserInputBuffer and xmlOutputBuffer. The change was
|
| 130 |
+
* introduced in 2.9.0.
|
| 131 |
+
*/
|
| 132 |
+
#define LIBXML2_NEW_BUFFER
|
| 133 |
+
|
| 134 |
+
/**
|
| 135 |
+
* XML_XML_NAMESPACE:
|
| 136 |
+
*
|
| 137 |
+
* This is the namespace for the special xml: prefix predefined in the
|
| 138 |
+
* XML Namespace specification.
|
| 139 |
+
*/
|
| 140 |
+
#define XML_XML_NAMESPACE \
|
| 141 |
+
(const xmlChar *) "http://www.w3.org/XML/1998/namespace"
|
| 142 |
+
|
| 143 |
+
/**
|
| 144 |
+
* XML_XML_ID:
|
| 145 |
+
*
|
| 146 |
+
* This is the name for the special xml:id attribute
|
| 147 |
+
*/
|
| 148 |
+
#define XML_XML_ID (const xmlChar *) "xml:id"
|
| 149 |
+
|
| 150 |
+
/*
|
| 151 |
+
* The different element types carried by an XML tree.
|
| 152 |
+
*
|
| 153 |
+
* NOTE: This is synchronized with DOM Level1 values
|
| 154 |
+
* See http://www.w3.org/TR/REC-DOM-Level-1/
|
| 155 |
+
*
|
| 156 |
+
* Actually this had diverged a bit, and now XML_DOCUMENT_TYPE_NODE should
|
| 157 |
+
* be deprecated to use an XML_DTD_NODE.
|
| 158 |
+
*/
|
| 159 |
+
typedef enum {
|
| 160 |
+
XML_ELEMENT_NODE= 1,
|
| 161 |
+
XML_ATTRIBUTE_NODE= 2,
|
| 162 |
+
XML_TEXT_NODE= 3,
|
| 163 |
+
XML_CDATA_SECTION_NODE= 4,
|
| 164 |
+
XML_ENTITY_REF_NODE= 5,
|
| 165 |
+
XML_ENTITY_NODE= 6,
|
| 166 |
+
XML_PI_NODE= 7,
|
| 167 |
+
XML_COMMENT_NODE= 8,
|
| 168 |
+
XML_DOCUMENT_NODE= 9,
|
| 169 |
+
XML_DOCUMENT_TYPE_NODE= 10,
|
| 170 |
+
XML_DOCUMENT_FRAG_NODE= 11,
|
| 171 |
+
XML_NOTATION_NODE= 12,
|
| 172 |
+
XML_HTML_DOCUMENT_NODE= 13,
|
| 173 |
+
XML_DTD_NODE= 14,
|
| 174 |
+
XML_ELEMENT_DECL= 15,
|
| 175 |
+
XML_ATTRIBUTE_DECL= 16,
|
| 176 |
+
XML_ENTITY_DECL= 17,
|
| 177 |
+
XML_NAMESPACE_DECL= 18,
|
| 178 |
+
XML_XINCLUDE_START= 19,
|
| 179 |
+
XML_XINCLUDE_END= 20
|
| 180 |
+
/* XML_DOCB_DOCUMENT_NODE= 21 */ /* removed */
|
| 181 |
+
} xmlElementType;
|
| 182 |
+
|
| 183 |
+
/** DOC_DISABLE */
|
| 184 |
+
/* For backward compatibility */
|
| 185 |
+
#define XML_DOCB_DOCUMENT_NODE 21
|
| 186 |
+
/** DOC_ENABLE */
|
| 187 |
+
|
| 188 |
+
/**
|
| 189 |
+
* xmlNotation:
|
| 190 |
+
*
|
| 191 |
+
* A DTD Notation definition.
|
| 192 |
+
*/
|
| 193 |
+
|
| 194 |
+
typedef struct _xmlNotation xmlNotation;
|
| 195 |
+
typedef xmlNotation *xmlNotationPtr;
|
| 196 |
+
struct _xmlNotation {
|
| 197 |
+
const xmlChar *name; /* Notation name */
|
| 198 |
+
const xmlChar *PublicID; /* Public identifier, if any */
|
| 199 |
+
const xmlChar *SystemID; /* System identifier, if any */
|
| 200 |
+
};
|
| 201 |
+
|
| 202 |
+
/**
|
| 203 |
+
* xmlAttributeType:
|
| 204 |
+
*
|
| 205 |
+
* A DTD Attribute type definition.
|
| 206 |
+
*/
|
| 207 |
+
|
| 208 |
+
typedef enum {
|
| 209 |
+
XML_ATTRIBUTE_CDATA = 1,
|
| 210 |
+
XML_ATTRIBUTE_ID,
|
| 211 |
+
XML_ATTRIBUTE_IDREF ,
|
| 212 |
+
XML_ATTRIBUTE_IDREFS,
|
| 213 |
+
XML_ATTRIBUTE_ENTITY,
|
| 214 |
+
XML_ATTRIBUTE_ENTITIES,
|
| 215 |
+
XML_ATTRIBUTE_NMTOKEN,
|
| 216 |
+
XML_ATTRIBUTE_NMTOKENS,
|
| 217 |
+
XML_ATTRIBUTE_ENUMERATION,
|
| 218 |
+
XML_ATTRIBUTE_NOTATION
|
| 219 |
+
} xmlAttributeType;
|
| 220 |
+
|
| 221 |
+
/**
|
| 222 |
+
* xmlAttributeDefault:
|
| 223 |
+
*
|
| 224 |
+
* A DTD Attribute default definition.
|
| 225 |
+
*/
|
| 226 |
+
|
| 227 |
+
typedef enum {
|
| 228 |
+
XML_ATTRIBUTE_NONE = 1,
|
| 229 |
+
XML_ATTRIBUTE_REQUIRED,
|
| 230 |
+
XML_ATTRIBUTE_IMPLIED,
|
| 231 |
+
XML_ATTRIBUTE_FIXED
|
| 232 |
+
} xmlAttributeDefault;
|
| 233 |
+
|
| 234 |
+
/**
|
| 235 |
+
* xmlEnumeration:
|
| 236 |
+
*
|
| 237 |
+
* List structure used when there is an enumeration in DTDs.
|
| 238 |
+
*/
|
| 239 |
+
|
| 240 |
+
typedef struct _xmlEnumeration xmlEnumeration;
|
| 241 |
+
typedef xmlEnumeration *xmlEnumerationPtr;
|
| 242 |
+
struct _xmlEnumeration {
|
| 243 |
+
struct _xmlEnumeration *next; /* next one */
|
| 244 |
+
const xmlChar *name; /* Enumeration name */
|
| 245 |
+
};
|
| 246 |
+
|
| 247 |
+
/**
|
| 248 |
+
* xmlAttribute:
|
| 249 |
+
*
|
| 250 |
+
* An Attribute declaration in a DTD.
|
| 251 |
+
*/
|
| 252 |
+
|
| 253 |
+
typedef struct _xmlAttribute xmlAttribute;
|
| 254 |
+
typedef xmlAttribute *xmlAttributePtr;
|
| 255 |
+
struct _xmlAttribute {
|
| 256 |
+
void *_private; /* application data */
|
| 257 |
+
xmlElementType type; /* XML_ATTRIBUTE_DECL, must be second ! */
|
| 258 |
+
const xmlChar *name; /* Attribute name */
|
| 259 |
+
struct _xmlNode *children; /* NULL */
|
| 260 |
+
struct _xmlNode *last; /* NULL */
|
| 261 |
+
struct _xmlDtd *parent; /* -> DTD */
|
| 262 |
+
struct _xmlNode *next; /* next sibling link */
|
| 263 |
+
struct _xmlNode *prev; /* previous sibling link */
|
| 264 |
+
struct _xmlDoc *doc; /* the containing document */
|
| 265 |
+
|
| 266 |
+
struct _xmlAttribute *nexth; /* next in hash table */
|
| 267 |
+
xmlAttributeType atype; /* The attribute type */
|
| 268 |
+
xmlAttributeDefault def; /* the default */
|
| 269 |
+
const xmlChar *defaultValue; /* or the default value */
|
| 270 |
+
xmlEnumerationPtr tree; /* or the enumeration tree if any */
|
| 271 |
+
const xmlChar *prefix; /* the namespace prefix if any */
|
| 272 |
+
const xmlChar *elem; /* Element holding the attribute */
|
| 273 |
+
};
|
| 274 |
+
|
| 275 |
+
/**
|
| 276 |
+
* xmlElementContentType:
|
| 277 |
+
*
|
| 278 |
+
* Possible definitions of element content types.
|
| 279 |
+
*/
|
| 280 |
+
typedef enum {
|
| 281 |
+
XML_ELEMENT_CONTENT_PCDATA = 1,
|
| 282 |
+
XML_ELEMENT_CONTENT_ELEMENT,
|
| 283 |
+
XML_ELEMENT_CONTENT_SEQ,
|
| 284 |
+
XML_ELEMENT_CONTENT_OR
|
| 285 |
+
} xmlElementContentType;
|
| 286 |
+
|
| 287 |
+
/**
|
| 288 |
+
* xmlElementContentOccur:
|
| 289 |
+
*
|
| 290 |
+
* Possible definitions of element content occurrences.
|
| 291 |
+
*/
|
| 292 |
+
typedef enum {
|
| 293 |
+
XML_ELEMENT_CONTENT_ONCE = 1,
|
| 294 |
+
XML_ELEMENT_CONTENT_OPT,
|
| 295 |
+
XML_ELEMENT_CONTENT_MULT,
|
| 296 |
+
XML_ELEMENT_CONTENT_PLUS
|
| 297 |
+
} xmlElementContentOccur;
|
| 298 |
+
|
| 299 |
+
/**
|
| 300 |
+
* xmlElementContent:
|
| 301 |
+
*
|
| 302 |
+
* An XML Element content as stored after parsing an element definition
|
| 303 |
+
* in a DTD.
|
| 304 |
+
*/
|
| 305 |
+
|
| 306 |
+
typedef struct _xmlElementContent xmlElementContent;
|
| 307 |
+
typedef xmlElementContent *xmlElementContentPtr;
|
| 308 |
+
struct _xmlElementContent {
|
| 309 |
+
xmlElementContentType type; /* PCDATA, ELEMENT, SEQ or OR */
|
| 310 |
+
xmlElementContentOccur ocur; /* ONCE, OPT, MULT or PLUS */
|
| 311 |
+
const xmlChar *name; /* Element name */
|
| 312 |
+
struct _xmlElementContent *c1; /* first child */
|
| 313 |
+
struct _xmlElementContent *c2; /* second child */
|
| 314 |
+
struct _xmlElementContent *parent; /* parent */
|
| 315 |
+
const xmlChar *prefix; /* Namespace prefix */
|
| 316 |
+
};
|
| 317 |
+
|
| 318 |
+
/**
|
| 319 |
+
* xmlElementTypeVal:
|
| 320 |
+
*
|
| 321 |
+
* The different possibilities for an element content type.
|
| 322 |
+
*/
|
| 323 |
+
|
| 324 |
+
typedef enum {
|
| 325 |
+
XML_ELEMENT_TYPE_UNDEFINED = 0,
|
| 326 |
+
XML_ELEMENT_TYPE_EMPTY = 1,
|
| 327 |
+
XML_ELEMENT_TYPE_ANY,
|
| 328 |
+
XML_ELEMENT_TYPE_MIXED,
|
| 329 |
+
XML_ELEMENT_TYPE_ELEMENT
|
| 330 |
+
} xmlElementTypeVal;
|
| 331 |
+
|
| 332 |
+
#ifdef __cplusplus
|
| 333 |
+
}
|
| 334 |
+
#endif
|
| 335 |
+
#include <libxml/xmlregexp.h>
|
| 336 |
+
#ifdef __cplusplus
|
| 337 |
+
extern "C" {
|
| 338 |
+
#endif
|
| 339 |
+
|
| 340 |
+
/**
|
| 341 |
+
* xmlElement:
|
| 342 |
+
*
|
| 343 |
+
* An XML Element declaration from a DTD.
|
| 344 |
+
*/
|
| 345 |
+
|
| 346 |
+
typedef struct _xmlElement xmlElement;
|
| 347 |
+
typedef xmlElement *xmlElementPtr;
|
| 348 |
+
struct _xmlElement {
|
| 349 |
+
void *_private; /* application data */
|
| 350 |
+
xmlElementType type; /* XML_ELEMENT_DECL, must be second ! */
|
| 351 |
+
const xmlChar *name; /* Element name */
|
| 352 |
+
struct _xmlNode *children; /* NULL */
|
| 353 |
+
struct _xmlNode *last; /* NULL */
|
| 354 |
+
struct _xmlDtd *parent; /* -> DTD */
|
| 355 |
+
struct _xmlNode *next; /* next sibling link */
|
| 356 |
+
struct _xmlNode *prev; /* previous sibling link */
|
| 357 |
+
struct _xmlDoc *doc; /* the containing document */
|
| 358 |
+
|
| 359 |
+
xmlElementTypeVal etype; /* The type */
|
| 360 |
+
xmlElementContentPtr content; /* the allowed element content */
|
| 361 |
+
xmlAttributePtr attributes; /* List of the declared attributes */
|
| 362 |
+
const xmlChar *prefix; /* the namespace prefix if any */
|
| 363 |
+
#ifdef LIBXML_REGEXP_ENABLED
|
| 364 |
+
xmlRegexpPtr contModel; /* the validating regexp */
|
| 365 |
+
#else
|
| 366 |
+
void *contModel;
|
| 367 |
+
#endif
|
| 368 |
+
};
|
| 369 |
+
|
| 370 |
+
|
| 371 |
+
/**
|
| 372 |
+
* XML_LOCAL_NAMESPACE:
|
| 373 |
+
*
|
| 374 |
+
* A namespace declaration node.
|
| 375 |
+
*/
|
| 376 |
+
#define XML_LOCAL_NAMESPACE XML_NAMESPACE_DECL
|
| 377 |
+
typedef xmlElementType xmlNsType;
|
| 378 |
+
|
| 379 |
+
/**
|
| 380 |
+
* xmlNs:
|
| 381 |
+
*
|
| 382 |
+
* An XML namespace.
|
| 383 |
+
* Note that prefix == NULL is valid, it defines the default namespace
|
| 384 |
+
* within the subtree (until overridden).
|
| 385 |
+
*
|
| 386 |
+
* xmlNsType is unified with xmlElementType.
|
| 387 |
+
*/
|
| 388 |
+
|
| 389 |
+
typedef struct _xmlNs xmlNs;
|
| 390 |
+
typedef xmlNs *xmlNsPtr;
|
| 391 |
+
struct _xmlNs {
|
| 392 |
+
struct _xmlNs *next; /* next Ns link for this node */
|
| 393 |
+
xmlNsType type; /* global or local */
|
| 394 |
+
const xmlChar *href; /* URL for the namespace */
|
| 395 |
+
const xmlChar *prefix; /* prefix for the namespace */
|
| 396 |
+
void *_private; /* application data */
|
| 397 |
+
struct _xmlDoc *context; /* normally an xmlDoc */
|
| 398 |
+
};
|
| 399 |
+
|
| 400 |
+
/**
|
| 401 |
+
* xmlDtd:
|
| 402 |
+
*
|
| 403 |
+
* An XML DTD, as defined by <!DOCTYPE ... There is actually one for
|
| 404 |
+
* the internal subset and for the external subset.
|
| 405 |
+
*/
|
| 406 |
+
typedef struct _xmlDtd xmlDtd;
|
| 407 |
+
typedef xmlDtd *xmlDtdPtr;
|
| 408 |
+
struct _xmlDtd {
|
| 409 |
+
void *_private; /* application data */
|
| 410 |
+
xmlElementType type; /* XML_DTD_NODE, must be second ! */
|
| 411 |
+
const xmlChar *name; /* Name of the DTD */
|
| 412 |
+
struct _xmlNode *children; /* the value of the property link */
|
| 413 |
+
struct _xmlNode *last; /* last child link */
|
| 414 |
+
struct _xmlDoc *parent; /* child->parent link */
|
| 415 |
+
struct _xmlNode *next; /* next sibling link */
|
| 416 |
+
struct _xmlNode *prev; /* previous sibling link */
|
| 417 |
+
struct _xmlDoc *doc; /* the containing document */
|
| 418 |
+
|
| 419 |
+
/* End of common part */
|
| 420 |
+
void *notations; /* Hash table for notations if any */
|
| 421 |
+
void *elements; /* Hash table for elements if any */
|
| 422 |
+
void *attributes; /* Hash table for attributes if any */
|
| 423 |
+
void *entities; /* Hash table for entities if any */
|
| 424 |
+
const xmlChar *ExternalID; /* External identifier for PUBLIC DTD */
|
| 425 |
+
const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC DTD */
|
| 426 |
+
void *pentities; /* Hash table for param entities if any */
|
| 427 |
+
};
|
| 428 |
+
|
| 429 |
+
/**
|
| 430 |
+
* xmlAttr:
|
| 431 |
+
*
|
| 432 |
+
* An attribute on an XML node.
|
| 433 |
+
*/
|
| 434 |
+
typedef struct _xmlAttr xmlAttr;
|
| 435 |
+
typedef xmlAttr *xmlAttrPtr;
|
| 436 |
+
struct _xmlAttr {
|
| 437 |
+
void *_private; /* application data */
|
| 438 |
+
xmlElementType type; /* XML_ATTRIBUTE_NODE, must be second ! */
|
| 439 |
+
const xmlChar *name; /* the name of the property */
|
| 440 |
+
struct _xmlNode *children; /* the value of the property */
|
| 441 |
+
struct _xmlNode *last; /* NULL */
|
| 442 |
+
struct _xmlNode *parent; /* child->parent link */
|
| 443 |
+
struct _xmlAttr *next; /* next sibling link */
|
| 444 |
+
struct _xmlAttr *prev; /* previous sibling link */
|
| 445 |
+
struct _xmlDoc *doc; /* the containing document */
|
| 446 |
+
xmlNs *ns; /* pointer to the associated namespace */
|
| 447 |
+
xmlAttributeType atype; /* the attribute type if validating */
|
| 448 |
+
void *psvi; /* for type/PSVI information */
|
| 449 |
+
};
|
| 450 |
+
|
| 451 |
+
/**
|
| 452 |
+
* xmlID:
|
| 453 |
+
*
|
| 454 |
+
* An XML ID instance.
|
| 455 |
+
*/
|
| 456 |
+
|
| 457 |
+
typedef struct _xmlID xmlID;
|
| 458 |
+
typedef xmlID *xmlIDPtr;
|
| 459 |
+
struct _xmlID {
|
| 460 |
+
struct _xmlID *next; /* next ID */
|
| 461 |
+
const xmlChar *value; /* The ID name */
|
| 462 |
+
xmlAttrPtr attr; /* The attribute holding it */
|
| 463 |
+
const xmlChar *name; /* The attribute if attr is not available */
|
| 464 |
+
int lineno; /* The line number if attr is not available */
|
| 465 |
+
struct _xmlDoc *doc; /* The document holding the ID */
|
| 466 |
+
};
|
| 467 |
+
|
| 468 |
+
/**
|
| 469 |
+
* xmlRef:
|
| 470 |
+
*
|
| 471 |
+
* An XML IDREF instance.
|
| 472 |
+
*/
|
| 473 |
+
|
| 474 |
+
typedef struct _xmlRef xmlRef;
|
| 475 |
+
typedef xmlRef *xmlRefPtr;
|
| 476 |
+
struct _xmlRef {
|
| 477 |
+
struct _xmlRef *next; /* next Ref */
|
| 478 |
+
const xmlChar *value; /* The Ref name */
|
| 479 |
+
xmlAttrPtr attr; /* The attribute holding it */
|
| 480 |
+
const xmlChar *name; /* The attribute if attr is not available */
|
| 481 |
+
int lineno; /* The line number if attr is not available */
|
| 482 |
+
};
|
| 483 |
+
|
| 484 |
+
/**
|
| 485 |
+
* xmlNode:
|
| 486 |
+
*
|
| 487 |
+
* A node in an XML tree.
|
| 488 |
+
*/
|
| 489 |
+
typedef struct _xmlNode xmlNode;
|
| 490 |
+
typedef xmlNode *xmlNodePtr;
|
| 491 |
+
struct _xmlNode {
|
| 492 |
+
void *_private; /* application data */
|
| 493 |
+
xmlElementType type; /* type number, must be second ! */
|
| 494 |
+
const xmlChar *name; /* the name of the node, or the entity */
|
| 495 |
+
struct _xmlNode *children; /* parent->childs link */
|
| 496 |
+
struct _xmlNode *last; /* last child link */
|
| 497 |
+
struct _xmlNode *parent; /* child->parent link */
|
| 498 |
+
struct _xmlNode *next; /* next sibling link */
|
| 499 |
+
struct _xmlNode *prev; /* previous sibling link */
|
| 500 |
+
struct _xmlDoc *doc; /* the containing document */
|
| 501 |
+
|
| 502 |
+
/* End of common part */
|
| 503 |
+
xmlNs *ns; /* pointer to the associated namespace */
|
| 504 |
+
xmlChar *content; /* the content */
|
| 505 |
+
struct _xmlAttr *properties;/* properties list */
|
| 506 |
+
xmlNs *nsDef; /* namespace definitions on this node */
|
| 507 |
+
void *psvi; /* for type/PSVI information */
|
| 508 |
+
unsigned short line; /* line number */
|
| 509 |
+
unsigned short extra; /* extra data for XPath/XSLT */
|
| 510 |
+
};
|
| 511 |
+
|
| 512 |
+
/**
|
| 513 |
+
* XML_GET_CONTENT:
|
| 514 |
+
*
|
| 515 |
+
* Macro to extract the content pointer of a node.
|
| 516 |
+
*/
|
| 517 |
+
#define XML_GET_CONTENT(n) \
|
| 518 |
+
((n)->type == XML_ELEMENT_NODE ? NULL : (n)->content)
|
| 519 |
+
|
| 520 |
+
/**
|
| 521 |
+
* XML_GET_LINE:
|
| 522 |
+
*
|
| 523 |
+
* Macro to extract the line number of an element node.
|
| 524 |
+
*/
|
| 525 |
+
#define XML_GET_LINE(n) \
|
| 526 |
+
(xmlGetLineNo(n))
|
| 527 |
+
|
| 528 |
+
/**
|
| 529 |
+
* xmlDocProperty
|
| 530 |
+
*
|
| 531 |
+
* Set of properties of the document as found by the parser
|
| 532 |
+
* Some of them are linked to similarly named xmlParserOption
|
| 533 |
+
*/
|
| 534 |
+
typedef enum {
|
| 535 |
+
XML_DOC_WELLFORMED = 1<<0, /* document is XML well formed */
|
| 536 |
+
XML_DOC_NSVALID = 1<<1, /* document is Namespace valid */
|
| 537 |
+
XML_DOC_OLD10 = 1<<2, /* parsed with old XML-1.0 parser */
|
| 538 |
+
XML_DOC_DTDVALID = 1<<3, /* DTD validation was successful */
|
| 539 |
+
XML_DOC_XINCLUDE = 1<<4, /* XInclude substitution was done */
|
| 540 |
+
XML_DOC_USERBUILT = 1<<5, /* Document was built using the API
|
| 541 |
+
and not by parsing an instance */
|
| 542 |
+
XML_DOC_INTERNAL = 1<<6, /* built for internal processing */
|
| 543 |
+
XML_DOC_HTML = 1<<7 /* parsed or built HTML document */
|
| 544 |
+
} xmlDocProperties;
|
| 545 |
+
|
| 546 |
+
/**
|
| 547 |
+
* xmlDoc:
|
| 548 |
+
*
|
| 549 |
+
* An XML document.
|
| 550 |
+
*/
|
| 551 |
+
typedef struct _xmlDoc xmlDoc;
|
| 552 |
+
typedef xmlDoc *xmlDocPtr;
|
| 553 |
+
struct _xmlDoc {
|
| 554 |
+
void *_private; /* application data */
|
| 555 |
+
xmlElementType type; /* XML_DOCUMENT_NODE, must be second ! */
|
| 556 |
+
char *name; /* name/filename/URI of the document */
|
| 557 |
+
struct _xmlNode *children; /* the document tree */
|
| 558 |
+
struct _xmlNode *last; /* last child link */
|
| 559 |
+
struct _xmlNode *parent; /* child->parent link */
|
| 560 |
+
struct _xmlNode *next; /* next sibling link */
|
| 561 |
+
struct _xmlNode *prev; /* previous sibling link */
|
| 562 |
+
struct _xmlDoc *doc; /* autoreference to itself */
|
| 563 |
+
|
| 564 |
+
/* End of common part */
|
| 565 |
+
int compression;/* level of zlib compression */
|
| 566 |
+
int standalone; /* standalone document (no external refs)
|
| 567 |
+
1 if standalone="yes"
|
| 568 |
+
0 if standalone="no"
|
| 569 |
+
-1 if there is no XML declaration
|
| 570 |
+
-2 if there is an XML declaration, but no
|
| 571 |
+
standalone attribute was specified */
|
| 572 |
+
struct _xmlDtd *intSubset; /* the document internal subset */
|
| 573 |
+
struct _xmlDtd *extSubset; /* the document external subset */
|
| 574 |
+
struct _xmlNs *oldNs; /* Global namespace, the old way */
|
| 575 |
+
const xmlChar *version; /* the XML version string */
|
| 576 |
+
const xmlChar *encoding; /* external initial encoding, if any */
|
| 577 |
+
void *ids; /* Hash table for ID attributes if any */
|
| 578 |
+
void *refs; /* Hash table for IDREFs attributes if any */
|
| 579 |
+
const xmlChar *URL; /* The URI for that document */
|
| 580 |
+
int charset; /* Internal flag for charset handling,
|
| 581 |
+
actually an xmlCharEncoding */
|
| 582 |
+
struct _xmlDict *dict; /* dict used to allocate names or NULL */
|
| 583 |
+
void *psvi; /* for type/PSVI information */
|
| 584 |
+
int parseFlags; /* set of xmlParserOption used to parse the
|
| 585 |
+
document */
|
| 586 |
+
int properties; /* set of xmlDocProperties for this document
|
| 587 |
+
set at the end of parsing */
|
| 588 |
+
};
|
| 589 |
+
|
| 590 |
+
|
| 591 |
+
typedef struct _xmlDOMWrapCtxt xmlDOMWrapCtxt;
|
| 592 |
+
typedef xmlDOMWrapCtxt *xmlDOMWrapCtxtPtr;
|
| 593 |
+
|
| 594 |
+
/**
|
| 595 |
+
* xmlDOMWrapAcquireNsFunction:
|
| 596 |
+
* @ctxt: a DOM wrapper context
|
| 597 |
+
* @node: the context node (element or attribute)
|
| 598 |
+
* @nsName: the requested namespace name
|
| 599 |
+
* @nsPrefix: the requested namespace prefix
|
| 600 |
+
*
|
| 601 |
+
* A function called to acquire namespaces (xmlNs) from the wrapper.
|
| 602 |
+
*
|
| 603 |
+
* Returns an xmlNsPtr or NULL in case of an error.
|
| 604 |
+
*/
|
| 605 |
+
typedef xmlNsPtr (*xmlDOMWrapAcquireNsFunction) (xmlDOMWrapCtxtPtr ctxt,
|
| 606 |
+
xmlNodePtr node,
|
| 607 |
+
const xmlChar *nsName,
|
| 608 |
+
const xmlChar *nsPrefix);
|
| 609 |
+
|
| 610 |
+
/**
|
| 611 |
+
* xmlDOMWrapCtxt:
|
| 612 |
+
*
|
| 613 |
+
* Context for DOM wrapper-operations.
|
| 614 |
+
*/
|
| 615 |
+
struct _xmlDOMWrapCtxt {
|
| 616 |
+
void * _private;
|
| 617 |
+
/*
|
| 618 |
+
* The type of this context, just in case we need specialized
|
| 619 |
+
* contexts in the future.
|
| 620 |
+
*/
|
| 621 |
+
int type;
|
| 622 |
+
/*
|
| 623 |
+
* Internal namespace map used for various operations.
|
| 624 |
+
*/
|
| 625 |
+
void * namespaceMap;
|
| 626 |
+
/*
|
| 627 |
+
* Use this one to acquire an xmlNsPtr intended for node->ns.
|
| 628 |
+
* (Note that this is not intended for elem->nsDef).
|
| 629 |
+
*/
|
| 630 |
+
xmlDOMWrapAcquireNsFunction getNsForNodeFunc;
|
| 631 |
+
};
|
| 632 |
+
|
| 633 |
+
/**
|
| 634 |
+
* xmlChildrenNode:
|
| 635 |
+
*
|
| 636 |
+
* Macro for compatibility naming layer with libxml1. Maps
|
| 637 |
+
* to "children."
|
| 638 |
+
*/
|
| 639 |
+
#ifndef xmlChildrenNode
|
| 640 |
+
#define xmlChildrenNode children
|
| 641 |
+
#endif
|
| 642 |
+
|
| 643 |
+
/**
|
| 644 |
+
* xmlRootNode:
|
| 645 |
+
*
|
| 646 |
+
* Macro for compatibility naming layer with libxml1. Maps
|
| 647 |
+
* to "children".
|
| 648 |
+
*/
|
| 649 |
+
#ifndef xmlRootNode
|
| 650 |
+
#define xmlRootNode children
|
| 651 |
+
#endif
|
| 652 |
+
|
| 653 |
+
/*
|
| 654 |
+
* Variables.
|
| 655 |
+
*/
|
| 656 |
+
|
| 657 |
+
/*
|
| 658 |
+
* Some helper functions
|
| 659 |
+
*/
|
| 660 |
+
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || \
|
| 661 |
+
defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || \
|
| 662 |
+
defined (LIBXML_HTML_ENABLED) || defined(LIBXML_SAX1_ENABLED) || \
|
| 663 |
+
defined(LIBXML_HTML_ENABLED) || defined(LIBXML_WRITER_ENABLED) || \
|
| 664 |
+
defined(LIBXML_LEGACY_ENABLED)
|
| 665 |
+
XMLPUBFUN int
|
| 666 |
+
xmlValidateNCName (const xmlChar *value,
|
| 667 |
+
int space);
|
| 668 |
+
#endif
|
| 669 |
+
|
| 670 |
+
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
|
| 671 |
+
XMLPUBFUN int
|
| 672 |
+
xmlValidateQName (const xmlChar *value,
|
| 673 |
+
int space);
|
| 674 |
+
XMLPUBFUN int
|
| 675 |
+
xmlValidateName (const xmlChar *value,
|
| 676 |
+
int space);
|
| 677 |
+
XMLPUBFUN int
|
| 678 |
+
xmlValidateNMToken (const xmlChar *value,
|
| 679 |
+
int space);
|
| 680 |
+
#endif
|
| 681 |
+
|
| 682 |
+
XMLPUBFUN xmlChar *
|
| 683 |
+
xmlBuildQName (const xmlChar *ncname,
|
| 684 |
+
const xmlChar *prefix,
|
| 685 |
+
xmlChar *memory,
|
| 686 |
+
int len);
|
| 687 |
+
XMLPUBFUN xmlChar *
|
| 688 |
+
xmlSplitQName2 (const xmlChar *name,
|
| 689 |
+
xmlChar **prefix);
|
| 690 |
+
XMLPUBFUN const xmlChar *
|
| 691 |
+
xmlSplitQName3 (const xmlChar *name,
|
| 692 |
+
int *len);
|
| 693 |
+
|
| 694 |
+
/*
|
| 695 |
+
* Handling Buffers, the old ones see @xmlBuf for the new ones.
|
| 696 |
+
*/
|
| 697 |
+
|
| 698 |
+
XMLPUBFUN void
|
| 699 |
+
xmlSetBufferAllocationScheme(xmlBufferAllocationScheme scheme);
|
| 700 |
+
XMLPUBFUN xmlBufferAllocationScheme
|
| 701 |
+
xmlGetBufferAllocationScheme(void);
|
| 702 |
+
|
| 703 |
+
XMLPUBFUN xmlBufferPtr
|
| 704 |
+
xmlBufferCreate (void);
|
| 705 |
+
XMLPUBFUN xmlBufferPtr
|
| 706 |
+
xmlBufferCreateSize (size_t size);
|
| 707 |
+
XMLPUBFUN xmlBufferPtr
|
| 708 |
+
xmlBufferCreateStatic (void *mem,
|
| 709 |
+
size_t size);
|
| 710 |
+
XMLPUBFUN int
|
| 711 |
+
xmlBufferResize (xmlBufferPtr buf,
|
| 712 |
+
unsigned int size);
|
| 713 |
+
XMLPUBFUN void
|
| 714 |
+
xmlBufferFree (xmlBufferPtr buf);
|
| 715 |
+
XMLPUBFUN int
|
| 716 |
+
xmlBufferDump (FILE *file,
|
| 717 |
+
xmlBufferPtr buf);
|
| 718 |
+
XMLPUBFUN int
|
| 719 |
+
xmlBufferAdd (xmlBufferPtr buf,
|
| 720 |
+
const xmlChar *str,
|
| 721 |
+
int len);
|
| 722 |
+
XMLPUBFUN int
|
| 723 |
+
xmlBufferAddHead (xmlBufferPtr buf,
|
| 724 |
+
const xmlChar *str,
|
| 725 |
+
int len);
|
| 726 |
+
XMLPUBFUN int
|
| 727 |
+
xmlBufferCat (xmlBufferPtr buf,
|
| 728 |
+
const xmlChar *str);
|
| 729 |
+
XMLPUBFUN int
|
| 730 |
+
xmlBufferCCat (xmlBufferPtr buf,
|
| 731 |
+
const char *str);
|
| 732 |
+
XMLPUBFUN int
|
| 733 |
+
xmlBufferShrink (xmlBufferPtr buf,
|
| 734 |
+
unsigned int len);
|
| 735 |
+
XMLPUBFUN int
|
| 736 |
+
xmlBufferGrow (xmlBufferPtr buf,
|
| 737 |
+
unsigned int len);
|
| 738 |
+
XMLPUBFUN void
|
| 739 |
+
xmlBufferEmpty (xmlBufferPtr buf);
|
| 740 |
+
XMLPUBFUN const xmlChar*
|
| 741 |
+
xmlBufferContent (const xmlBuffer *buf);
|
| 742 |
+
XMLPUBFUN xmlChar*
|
| 743 |
+
xmlBufferDetach (xmlBufferPtr buf);
|
| 744 |
+
XMLPUBFUN void
|
| 745 |
+
xmlBufferSetAllocationScheme(xmlBufferPtr buf,
|
| 746 |
+
xmlBufferAllocationScheme scheme);
|
| 747 |
+
XMLPUBFUN int
|
| 748 |
+
xmlBufferLength (const xmlBuffer *buf);
|
| 749 |
+
|
| 750 |
+
/*
|
| 751 |
+
* Creating/freeing new structures.
|
| 752 |
+
*/
|
| 753 |
+
XMLPUBFUN xmlDtdPtr
|
| 754 |
+
xmlCreateIntSubset (xmlDocPtr doc,
|
| 755 |
+
const xmlChar *name,
|
| 756 |
+
const xmlChar *ExternalID,
|
| 757 |
+
const xmlChar *SystemID);
|
| 758 |
+
XMLPUBFUN xmlDtdPtr
|
| 759 |
+
xmlNewDtd (xmlDocPtr doc,
|
| 760 |
+
const xmlChar *name,
|
| 761 |
+
const xmlChar *ExternalID,
|
| 762 |
+
const xmlChar *SystemID);
|
| 763 |
+
XMLPUBFUN xmlDtdPtr
|
| 764 |
+
xmlGetIntSubset (const xmlDoc *doc);
|
| 765 |
+
XMLPUBFUN void
|
| 766 |
+
xmlFreeDtd (xmlDtdPtr cur);
|
| 767 |
+
#ifdef LIBXML_LEGACY_ENABLED
|
| 768 |
+
XML_DEPRECATED
|
| 769 |
+
XMLPUBFUN xmlNsPtr
|
| 770 |
+
xmlNewGlobalNs (xmlDocPtr doc,
|
| 771 |
+
const xmlChar *href,
|
| 772 |
+
const xmlChar *prefix);
|
| 773 |
+
#endif /* LIBXML_LEGACY_ENABLED */
|
| 774 |
+
XMLPUBFUN xmlNsPtr
|
| 775 |
+
xmlNewNs (xmlNodePtr node,
|
| 776 |
+
const xmlChar *href,
|
| 777 |
+
const xmlChar *prefix);
|
| 778 |
+
XMLPUBFUN void
|
| 779 |
+
xmlFreeNs (xmlNsPtr cur);
|
| 780 |
+
XMLPUBFUN void
|
| 781 |
+
xmlFreeNsList (xmlNsPtr cur);
|
| 782 |
+
XMLPUBFUN xmlDocPtr
|
| 783 |
+
xmlNewDoc (const xmlChar *version);
|
| 784 |
+
XMLPUBFUN void
|
| 785 |
+
xmlFreeDoc (xmlDocPtr cur);
|
| 786 |
+
XMLPUBFUN xmlAttrPtr
|
| 787 |
+
xmlNewDocProp (xmlDocPtr doc,
|
| 788 |
+
const xmlChar *name,
|
| 789 |
+
const xmlChar *value);
|
| 790 |
+
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \
|
| 791 |
+
defined(LIBXML_SCHEMAS_ENABLED)
|
| 792 |
+
XMLPUBFUN xmlAttrPtr
|
| 793 |
+
xmlNewProp (xmlNodePtr node,
|
| 794 |
+
const xmlChar *name,
|
| 795 |
+
const xmlChar *value);
|
| 796 |
+
#endif
|
| 797 |
+
XMLPUBFUN xmlAttrPtr
|
| 798 |
+
xmlNewNsProp (xmlNodePtr node,
|
| 799 |
+
xmlNsPtr ns,
|
| 800 |
+
const xmlChar *name,
|
| 801 |
+
const xmlChar *value);
|
| 802 |
+
XMLPUBFUN xmlAttrPtr
|
| 803 |
+
xmlNewNsPropEatName (xmlNodePtr node,
|
| 804 |
+
xmlNsPtr ns,
|
| 805 |
+
xmlChar *name,
|
| 806 |
+
const xmlChar *value);
|
| 807 |
+
XMLPUBFUN void
|
| 808 |
+
xmlFreePropList (xmlAttrPtr cur);
|
| 809 |
+
XMLPUBFUN void
|
| 810 |
+
xmlFreeProp (xmlAttrPtr cur);
|
| 811 |
+
XMLPUBFUN xmlAttrPtr
|
| 812 |
+
xmlCopyProp (xmlNodePtr target,
|
| 813 |
+
xmlAttrPtr cur);
|
| 814 |
+
XMLPUBFUN xmlAttrPtr
|
| 815 |
+
xmlCopyPropList (xmlNodePtr target,
|
| 816 |
+
xmlAttrPtr cur);
|
| 817 |
+
#ifdef LIBXML_TREE_ENABLED
|
| 818 |
+
XMLPUBFUN xmlDtdPtr
|
| 819 |
+
xmlCopyDtd (xmlDtdPtr dtd);
|
| 820 |
+
#endif /* LIBXML_TREE_ENABLED */
|
| 821 |
+
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
|
| 822 |
+
XMLPUBFUN xmlDocPtr
|
| 823 |
+
xmlCopyDoc (xmlDocPtr doc,
|
| 824 |
+
int recursive);
|
| 825 |
+
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */
|
| 826 |
+
/*
|
| 827 |
+
* Creating new nodes.
|
| 828 |
+
*/
|
| 829 |
+
XMLPUBFUN xmlNodePtr
|
| 830 |
+
xmlNewDocNode (xmlDocPtr doc,
|
| 831 |
+
xmlNsPtr ns,
|
| 832 |
+
const xmlChar *name,
|
| 833 |
+
const xmlChar *content);
|
| 834 |
+
XMLPUBFUN xmlNodePtr
|
| 835 |
+
xmlNewDocNodeEatName (xmlDocPtr doc,
|
| 836 |
+
xmlNsPtr ns,
|
| 837 |
+
xmlChar *name,
|
| 838 |
+
const xmlChar *content);
|
| 839 |
+
XMLPUBFUN xmlNodePtr
|
| 840 |
+
xmlNewNode (xmlNsPtr ns,
|
| 841 |
+
const xmlChar *name);
|
| 842 |
+
XMLPUBFUN xmlNodePtr
|
| 843 |
+
xmlNewNodeEatName (xmlNsPtr ns,
|
| 844 |
+
xmlChar *name);
|
| 845 |
+
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
|
| 846 |
+
XMLPUBFUN xmlNodePtr
|
| 847 |
+
xmlNewChild (xmlNodePtr parent,
|
| 848 |
+
xmlNsPtr ns,
|
| 849 |
+
const xmlChar *name,
|
| 850 |
+
const xmlChar *content);
|
| 851 |
+
#endif
|
| 852 |
+
XMLPUBFUN xmlNodePtr
|
| 853 |
+
xmlNewDocText (const xmlDoc *doc,
|
| 854 |
+
const xmlChar *content);
|
| 855 |
+
XMLPUBFUN xmlNodePtr
|
| 856 |
+
xmlNewText (const xmlChar *content);
|
| 857 |
+
XMLPUBFUN xmlNodePtr
|
| 858 |
+
xmlNewDocPI (xmlDocPtr doc,
|
| 859 |
+
const xmlChar *name,
|
| 860 |
+
const xmlChar *content);
|
| 861 |
+
XMLPUBFUN xmlNodePtr
|
| 862 |
+
xmlNewPI (const xmlChar *name,
|
| 863 |
+
const xmlChar *content);
|
| 864 |
+
XMLPUBFUN xmlNodePtr
|
| 865 |
+
xmlNewDocTextLen (xmlDocPtr doc,
|
| 866 |
+
const xmlChar *content,
|
| 867 |
+
int len);
|
| 868 |
+
XMLPUBFUN xmlNodePtr
|
| 869 |
+
xmlNewTextLen (const xmlChar *content,
|
| 870 |
+
int len);
|
| 871 |
+
XMLPUBFUN xmlNodePtr
|
| 872 |
+
xmlNewDocComment (xmlDocPtr doc,
|
| 873 |
+
const xmlChar *content);
|
| 874 |
+
XMLPUBFUN xmlNodePtr
|
| 875 |
+
xmlNewComment (const xmlChar *content);
|
| 876 |
+
XMLPUBFUN xmlNodePtr
|
| 877 |
+
xmlNewCDataBlock (xmlDocPtr doc,
|
| 878 |
+
const xmlChar *content,
|
| 879 |
+
int len);
|
| 880 |
+
XMLPUBFUN xmlNodePtr
|
| 881 |
+
xmlNewCharRef (xmlDocPtr doc,
|
| 882 |
+
const xmlChar *name);
|
| 883 |
+
XMLPUBFUN xmlNodePtr
|
| 884 |
+
xmlNewReference (const xmlDoc *doc,
|
| 885 |
+
const xmlChar *name);
|
| 886 |
+
XMLPUBFUN xmlNodePtr
|
| 887 |
+
xmlCopyNode (xmlNodePtr node,
|
| 888 |
+
int recursive);
|
| 889 |
+
XMLPUBFUN xmlNodePtr
|
| 890 |
+
xmlDocCopyNode (xmlNodePtr node,
|
| 891 |
+
xmlDocPtr doc,
|
| 892 |
+
int recursive);
|
| 893 |
+
XMLPUBFUN xmlNodePtr
|
| 894 |
+
xmlDocCopyNodeList (xmlDocPtr doc,
|
| 895 |
+
xmlNodePtr node);
|
| 896 |
+
XMLPUBFUN xmlNodePtr
|
| 897 |
+
xmlCopyNodeList (xmlNodePtr node);
|
| 898 |
+
#ifdef LIBXML_TREE_ENABLED
|
| 899 |
+
XMLPUBFUN xmlNodePtr
|
| 900 |
+
xmlNewTextChild (xmlNodePtr parent,
|
| 901 |
+
xmlNsPtr ns,
|
| 902 |
+
const xmlChar *name,
|
| 903 |
+
const xmlChar *content);
|
| 904 |
+
XMLPUBFUN xmlNodePtr
|
| 905 |
+
xmlNewDocRawNode (xmlDocPtr doc,
|
| 906 |
+
xmlNsPtr ns,
|
| 907 |
+
const xmlChar *name,
|
| 908 |
+
const xmlChar *content);
|
| 909 |
+
XMLPUBFUN xmlNodePtr
|
| 910 |
+
xmlNewDocFragment (xmlDocPtr doc);
|
| 911 |
+
#endif /* LIBXML_TREE_ENABLED */
|
| 912 |
+
|
| 913 |
+
/*
|
| 914 |
+
* Navigating.
|
| 915 |
+
*/
|
| 916 |
+
XMLPUBFUN long
|
| 917 |
+
xmlGetLineNo (const xmlNode *node);
|
| 918 |
+
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
|
| 919 |
+
XMLPUBFUN xmlChar *
|
| 920 |
+
xmlGetNodePath (const xmlNode *node);
|
| 921 |
+
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) */
|
| 922 |
+
XMLPUBFUN xmlNodePtr
|
| 923 |
+
xmlDocGetRootElement (const xmlDoc *doc);
|
| 924 |
+
XMLPUBFUN xmlNodePtr
|
| 925 |
+
xmlGetLastChild (const xmlNode *parent);
|
| 926 |
+
XMLPUBFUN int
|
| 927 |
+
xmlNodeIsText (const xmlNode *node);
|
| 928 |
+
XMLPUBFUN int
|
| 929 |
+
xmlIsBlankNode (const xmlNode *node);
|
| 930 |
+
|
| 931 |
+
/*
|
| 932 |
+
* Changing the structure.
|
| 933 |
+
*/
|
| 934 |
+
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
|
| 935 |
+
XMLPUBFUN xmlNodePtr
|
| 936 |
+
xmlDocSetRootElement (xmlDocPtr doc,
|
| 937 |
+
xmlNodePtr root);
|
| 938 |
+
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */
|
| 939 |
+
#ifdef LIBXML_TREE_ENABLED
|
| 940 |
+
XMLPUBFUN void
|
| 941 |
+
xmlNodeSetName (xmlNodePtr cur,
|
| 942 |
+
const xmlChar *name);
|
| 943 |
+
#endif /* LIBXML_TREE_ENABLED */
|
| 944 |
+
XMLPUBFUN xmlNodePtr
|
| 945 |
+
xmlAddChild (xmlNodePtr parent,
|
| 946 |
+
xmlNodePtr cur);
|
| 947 |
+
XMLPUBFUN xmlNodePtr
|
| 948 |
+
xmlAddChildList (xmlNodePtr parent,
|
| 949 |
+
xmlNodePtr cur);
|
| 950 |
+
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED)
|
| 951 |
+
XMLPUBFUN xmlNodePtr
|
| 952 |
+
xmlReplaceNode (xmlNodePtr old,
|
| 953 |
+
xmlNodePtr cur);
|
| 954 |
+
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */
|
| 955 |
+
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_HTML_ENABLED) || \
|
| 956 |
+
defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
|
| 957 |
+
XMLPUBFUN xmlNodePtr
|
| 958 |
+
xmlAddPrevSibling (xmlNodePtr cur,
|
| 959 |
+
xmlNodePtr elem);
|
| 960 |
+
#endif /* LIBXML_TREE_ENABLED || LIBXML_HTML_ENABLED || LIBXML_SCHEMAS_ENABLED */
|
| 961 |
+
XMLPUBFUN xmlNodePtr
|
| 962 |
+
xmlAddSibling (xmlNodePtr cur,
|
| 963 |
+
xmlNodePtr elem);
|
| 964 |
+
XMLPUBFUN xmlNodePtr
|
| 965 |
+
xmlAddNextSibling (xmlNodePtr cur,
|
| 966 |
+
xmlNodePtr elem);
|
| 967 |
+
XMLPUBFUN void
|
| 968 |
+
xmlUnlinkNode (xmlNodePtr cur);
|
| 969 |
+
XMLPUBFUN xmlNodePtr
|
| 970 |
+
xmlTextMerge (xmlNodePtr first,
|
| 971 |
+
xmlNodePtr second);
|
| 972 |
+
XMLPUBFUN int
|
| 973 |
+
xmlTextConcat (xmlNodePtr node,
|
| 974 |
+
const xmlChar *content,
|
| 975 |
+
int len);
|
| 976 |
+
XMLPUBFUN void
|
| 977 |
+
xmlFreeNodeList (xmlNodePtr cur);
|
| 978 |
+
XMLPUBFUN void
|
| 979 |
+
xmlFreeNode (xmlNodePtr cur);
|
| 980 |
+
XMLPUBFUN void
|
| 981 |
+
xmlSetTreeDoc (xmlNodePtr tree,
|
| 982 |
+
xmlDocPtr doc);
|
| 983 |
+
XMLPUBFUN void
|
| 984 |
+
xmlSetListDoc (xmlNodePtr list,
|
| 985 |
+
xmlDocPtr doc);
|
| 986 |
+
/*
|
| 987 |
+
* Namespaces.
|
| 988 |
+
*/
|
| 989 |
+
XMLPUBFUN xmlNsPtr
|
| 990 |
+
xmlSearchNs (xmlDocPtr doc,
|
| 991 |
+
xmlNodePtr node,
|
| 992 |
+
const xmlChar *nameSpace);
|
| 993 |
+
XMLPUBFUN xmlNsPtr
|
| 994 |
+
xmlSearchNsByHref (xmlDocPtr doc,
|
| 995 |
+
xmlNodePtr node,
|
| 996 |
+
const xmlChar *href);
|
| 997 |
+
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || \
|
| 998 |
+
defined(LIBXML_SCHEMAS_ENABLED)
|
| 999 |
+
XMLPUBFUN xmlNsPtr *
|
| 1000 |
+
xmlGetNsList (const xmlDoc *doc,
|
| 1001 |
+
const xmlNode *node);
|
| 1002 |
+
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) */
|
| 1003 |
+
|
| 1004 |
+
XMLPUBFUN void
|
| 1005 |
+
xmlSetNs (xmlNodePtr node,
|
| 1006 |
+
xmlNsPtr ns);
|
| 1007 |
+
XMLPUBFUN xmlNsPtr
|
| 1008 |
+
xmlCopyNamespace (xmlNsPtr cur);
|
| 1009 |
+
XMLPUBFUN xmlNsPtr
|
| 1010 |
+
xmlCopyNamespaceList (xmlNsPtr cur);
|
| 1011 |
+
|
| 1012 |
+
/*
|
| 1013 |
+
* Changing the content.
|
| 1014 |
+
*/
|
| 1015 |
+
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || \
|
| 1016 |
+
defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED)
|
| 1017 |
+
XMLPUBFUN xmlAttrPtr
|
| 1018 |
+
xmlSetProp (xmlNodePtr node,
|
| 1019 |
+
const xmlChar *name,
|
| 1020 |
+
const xmlChar *value);
|
| 1021 |
+
XMLPUBFUN xmlAttrPtr
|
| 1022 |
+
xmlSetNsProp (xmlNodePtr node,
|
| 1023 |
+
xmlNsPtr ns,
|
| 1024 |
+
const xmlChar *name,
|
| 1025 |
+
const xmlChar *value);
|
| 1026 |
+
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED) || \
|
| 1027 |
+
defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_HTML_ENABLED) */
|
| 1028 |
+
XMLPUBFUN xmlChar *
|
| 1029 |
+
xmlGetNoNsProp (const xmlNode *node,
|
| 1030 |
+
const xmlChar *name);
|
| 1031 |
+
XMLPUBFUN xmlChar *
|
| 1032 |
+
xmlGetProp (const xmlNode *node,
|
| 1033 |
+
const xmlChar *name);
|
| 1034 |
+
XMLPUBFUN xmlAttrPtr
|
| 1035 |
+
xmlHasProp (const xmlNode *node,
|
| 1036 |
+
const xmlChar *name);
|
| 1037 |
+
XMLPUBFUN xmlAttrPtr
|
| 1038 |
+
xmlHasNsProp (const xmlNode *node,
|
| 1039 |
+
const xmlChar *name,
|
| 1040 |
+
const xmlChar *nameSpace);
|
| 1041 |
+
XMLPUBFUN xmlChar *
|
| 1042 |
+
xmlGetNsProp (const xmlNode *node,
|
| 1043 |
+
const xmlChar *name,
|
| 1044 |
+
const xmlChar *nameSpace);
|
| 1045 |
+
XMLPUBFUN xmlNodePtr
|
| 1046 |
+
xmlStringGetNodeList (const xmlDoc *doc,
|
| 1047 |
+
const xmlChar *value);
|
| 1048 |
+
XMLPUBFUN xmlNodePtr
|
| 1049 |
+
xmlStringLenGetNodeList (const xmlDoc *doc,
|
| 1050 |
+
const xmlChar *value,
|
| 1051 |
+
int len);
|
| 1052 |
+
XMLPUBFUN xmlChar *
|
| 1053 |
+
xmlNodeListGetString (xmlDocPtr doc,
|
| 1054 |
+
const xmlNode *list,
|
| 1055 |
+
int inLine);
|
| 1056 |
+
#ifdef LIBXML_TREE_ENABLED
|
| 1057 |
+
XMLPUBFUN xmlChar *
|
| 1058 |
+
xmlNodeListGetRawString (const xmlDoc *doc,
|
| 1059 |
+
const xmlNode *list,
|
| 1060 |
+
int inLine);
|
| 1061 |
+
#endif /* LIBXML_TREE_ENABLED */
|
| 1062 |
+
XMLPUBFUN void
|
| 1063 |
+
xmlNodeSetContent (xmlNodePtr cur,
|
| 1064 |
+
const xmlChar *content);
|
| 1065 |
+
#ifdef LIBXML_TREE_ENABLED
|
| 1066 |
+
XMLPUBFUN void
|
| 1067 |
+
xmlNodeSetContentLen (xmlNodePtr cur,
|
| 1068 |
+
const xmlChar *content,
|
| 1069 |
+
int len);
|
| 1070 |
+
#endif /* LIBXML_TREE_ENABLED */
|
| 1071 |
+
XMLPUBFUN void
|
| 1072 |
+
xmlNodeAddContent (xmlNodePtr cur,
|
| 1073 |
+
const xmlChar *content);
|
| 1074 |
+
XMLPUBFUN void
|
| 1075 |
+
xmlNodeAddContentLen (xmlNodePtr cur,
|
| 1076 |
+
const xmlChar *content,
|
| 1077 |
+
int len);
|
| 1078 |
+
XMLPUBFUN xmlChar *
|
| 1079 |
+
xmlNodeGetContent (const xmlNode *cur);
|
| 1080 |
+
|
| 1081 |
+
XMLPUBFUN int
|
| 1082 |
+
xmlNodeBufGetContent (xmlBufferPtr buffer,
|
| 1083 |
+
const xmlNode *cur);
|
| 1084 |
+
XMLPUBFUN int
|
| 1085 |
+
xmlBufGetNodeContent (xmlBufPtr buf,
|
| 1086 |
+
const xmlNode *cur);
|
| 1087 |
+
|
| 1088 |
+
XMLPUBFUN xmlChar *
|
| 1089 |
+
xmlNodeGetLang (const xmlNode *cur);
|
| 1090 |
+
XMLPUBFUN int
|
| 1091 |
+
xmlNodeGetSpacePreserve (const xmlNode *cur);
|
| 1092 |
+
#ifdef LIBXML_TREE_ENABLED
|
| 1093 |
+
XMLPUBFUN void
|
| 1094 |
+
xmlNodeSetLang (xmlNodePtr cur,
|
| 1095 |
+
const xmlChar *lang);
|
| 1096 |
+
XMLPUBFUN void
|
| 1097 |
+
xmlNodeSetSpacePreserve (xmlNodePtr cur,
|
| 1098 |
+
int val);
|
| 1099 |
+
#endif /* LIBXML_TREE_ENABLED */
|
| 1100 |
+
XMLPUBFUN xmlChar *
|
| 1101 |
+
xmlNodeGetBase (const xmlDoc *doc,
|
| 1102 |
+
const xmlNode *cur);
|
| 1103 |
+
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XINCLUDE_ENABLED)
|
| 1104 |
+
XMLPUBFUN void
|
| 1105 |
+
xmlNodeSetBase (xmlNodePtr cur,
|
| 1106 |
+
const xmlChar *uri);
|
| 1107 |
+
#endif
|
| 1108 |
+
|
| 1109 |
+
/*
|
| 1110 |
+
* Removing content.
|
| 1111 |
+
*/
|
| 1112 |
+
XMLPUBFUN int
|
| 1113 |
+
xmlRemoveProp (xmlAttrPtr cur);
|
| 1114 |
+
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
|
| 1115 |
+
XMLPUBFUN int
|
| 1116 |
+
xmlUnsetNsProp (xmlNodePtr node,
|
| 1117 |
+
xmlNsPtr ns,
|
| 1118 |
+
const xmlChar *name);
|
| 1119 |
+
XMLPUBFUN int
|
| 1120 |
+
xmlUnsetProp (xmlNodePtr node,
|
| 1121 |
+
const xmlChar *name);
|
| 1122 |
+
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */
|
| 1123 |
+
|
| 1124 |
+
/*
|
| 1125 |
+
* Internal, don't use.
|
| 1126 |
+
*/
|
| 1127 |
+
XMLPUBFUN void
|
| 1128 |
+
xmlBufferWriteCHAR (xmlBufferPtr buf,
|
| 1129 |
+
const xmlChar *string);
|
| 1130 |
+
XMLPUBFUN void
|
| 1131 |
+
xmlBufferWriteChar (xmlBufferPtr buf,
|
| 1132 |
+
const char *string);
|
| 1133 |
+
XMLPUBFUN void
|
| 1134 |
+
xmlBufferWriteQuotedString(xmlBufferPtr buf,
|
| 1135 |
+
const xmlChar *string);
|
| 1136 |
+
|
| 1137 |
+
#ifdef LIBXML_OUTPUT_ENABLED
|
| 1138 |
+
XMLPUBFUN void xmlAttrSerializeTxtContent(xmlBufferPtr buf,
|
| 1139 |
+
xmlDocPtr doc,
|
| 1140 |
+
xmlAttrPtr attr,
|
| 1141 |
+
const xmlChar *string);
|
| 1142 |
+
#endif /* LIBXML_OUTPUT_ENABLED */
|
| 1143 |
+
|
| 1144 |
+
#ifdef LIBXML_TREE_ENABLED
|
| 1145 |
+
/*
|
| 1146 |
+
* Namespace handling.
|
| 1147 |
+
*/
|
| 1148 |
+
XMLPUBFUN int
|
| 1149 |
+
xmlReconciliateNs (xmlDocPtr doc,
|
| 1150 |
+
xmlNodePtr tree);
|
| 1151 |
+
#endif
|
| 1152 |
+
|
| 1153 |
+
#ifdef LIBXML_OUTPUT_ENABLED
|
| 1154 |
+
/*
|
| 1155 |
+
* Saving.
|
| 1156 |
+
*/
|
| 1157 |
+
XMLPUBFUN void
|
| 1158 |
+
xmlDocDumpFormatMemory (xmlDocPtr cur,
|
| 1159 |
+
xmlChar **mem,
|
| 1160 |
+
int *size,
|
| 1161 |
+
int format);
|
| 1162 |
+
XMLPUBFUN void
|
| 1163 |
+
xmlDocDumpMemory (xmlDocPtr cur,
|
| 1164 |
+
xmlChar **mem,
|
| 1165 |
+
int *size);
|
| 1166 |
+
XMLPUBFUN void
|
| 1167 |
+
xmlDocDumpMemoryEnc (xmlDocPtr out_doc,
|
| 1168 |
+
xmlChar **doc_txt_ptr,
|
| 1169 |
+
int * doc_txt_len,
|
| 1170 |
+
const char *txt_encoding);
|
| 1171 |
+
XMLPUBFUN void
|
| 1172 |
+
xmlDocDumpFormatMemoryEnc(xmlDocPtr out_doc,
|
| 1173 |
+
xmlChar **doc_txt_ptr,
|
| 1174 |
+
int * doc_txt_len,
|
| 1175 |
+
const char *txt_encoding,
|
| 1176 |
+
int format);
|
| 1177 |
+
XMLPUBFUN int
|
| 1178 |
+
xmlDocFormatDump (FILE *f,
|
| 1179 |
+
xmlDocPtr cur,
|
| 1180 |
+
int format);
|
| 1181 |
+
XMLPUBFUN int
|
| 1182 |
+
xmlDocDump (FILE *f,
|
| 1183 |
+
xmlDocPtr cur);
|
| 1184 |
+
XMLPUBFUN void
|
| 1185 |
+
xmlElemDump (FILE *f,
|
| 1186 |
+
xmlDocPtr doc,
|
| 1187 |
+
xmlNodePtr cur);
|
| 1188 |
+
XMLPUBFUN int
|
| 1189 |
+
xmlSaveFile (const char *filename,
|
| 1190 |
+
xmlDocPtr cur);
|
| 1191 |
+
XMLPUBFUN int
|
| 1192 |
+
xmlSaveFormatFile (const char *filename,
|
| 1193 |
+
xmlDocPtr cur,
|
| 1194 |
+
int format);
|
| 1195 |
+
XMLPUBFUN size_t
|
| 1196 |
+
xmlBufNodeDump (xmlBufPtr buf,
|
| 1197 |
+
xmlDocPtr doc,
|
| 1198 |
+
xmlNodePtr cur,
|
| 1199 |
+
int level,
|
| 1200 |
+
int format);
|
| 1201 |
+
XMLPUBFUN int
|
| 1202 |
+
xmlNodeDump (xmlBufferPtr buf,
|
| 1203 |
+
xmlDocPtr doc,
|
| 1204 |
+
xmlNodePtr cur,
|
| 1205 |
+
int level,
|
| 1206 |
+
int format);
|
| 1207 |
+
|
| 1208 |
+
XMLPUBFUN int
|
| 1209 |
+
xmlSaveFileTo (xmlOutputBufferPtr buf,
|
| 1210 |
+
xmlDocPtr cur,
|
| 1211 |
+
const char *encoding);
|
| 1212 |
+
XMLPUBFUN int
|
| 1213 |
+
xmlSaveFormatFileTo (xmlOutputBufferPtr buf,
|
| 1214 |
+
xmlDocPtr cur,
|
| 1215 |
+
const char *encoding,
|
| 1216 |
+
int format);
|
| 1217 |
+
XMLPUBFUN void
|
| 1218 |
+
xmlNodeDumpOutput (xmlOutputBufferPtr buf,
|
| 1219 |
+
xmlDocPtr doc,
|
| 1220 |
+
xmlNodePtr cur,
|
| 1221 |
+
int level,
|
| 1222 |
+
int format,
|
| 1223 |
+
const char *encoding);
|
| 1224 |
+
|
| 1225 |
+
XMLPUBFUN int
|
| 1226 |
+
xmlSaveFormatFileEnc (const char *filename,
|
| 1227 |
+
xmlDocPtr cur,
|
| 1228 |
+
const char *encoding,
|
| 1229 |
+
int format);
|
| 1230 |
+
|
| 1231 |
+
XMLPUBFUN int
|
| 1232 |
+
xmlSaveFileEnc (const char *filename,
|
| 1233 |
+
xmlDocPtr cur,
|
| 1234 |
+
const char *encoding);
|
| 1235 |
+
|
| 1236 |
+
#endif /* LIBXML_OUTPUT_ENABLED */
|
| 1237 |
+
/*
|
| 1238 |
+
* XHTML
|
| 1239 |
+
*/
|
| 1240 |
+
XMLPUBFUN int
|
| 1241 |
+
xmlIsXHTML (const xmlChar *systemID,
|
| 1242 |
+
const xmlChar *publicID);
|
| 1243 |
+
|
| 1244 |
+
/*
|
| 1245 |
+
* Compression.
|
| 1246 |
+
*/
|
| 1247 |
+
XMLPUBFUN int
|
| 1248 |
+
xmlGetDocCompressMode (const xmlDoc *doc);
|
| 1249 |
+
XMLPUBFUN void
|
| 1250 |
+
xmlSetDocCompressMode (xmlDocPtr doc,
|
| 1251 |
+
int mode);
|
| 1252 |
+
XMLPUBFUN int
|
| 1253 |
+
xmlGetCompressMode (void);
|
| 1254 |
+
XMLPUBFUN void
|
| 1255 |
+
xmlSetCompressMode (int mode);
|
| 1256 |
+
|
| 1257 |
+
/*
|
| 1258 |
+
* DOM-wrapper helper functions.
|
| 1259 |
+
*/
|
| 1260 |
+
XMLPUBFUN xmlDOMWrapCtxtPtr
|
| 1261 |
+
xmlDOMWrapNewCtxt (void);
|
| 1262 |
+
XMLPUBFUN void
|
| 1263 |
+
xmlDOMWrapFreeCtxt (xmlDOMWrapCtxtPtr ctxt);
|
| 1264 |
+
XMLPUBFUN int
|
| 1265 |
+
xmlDOMWrapReconcileNamespaces(xmlDOMWrapCtxtPtr ctxt,
|
| 1266 |
+
xmlNodePtr elem,
|
| 1267 |
+
int options);
|
| 1268 |
+
XMLPUBFUN int
|
| 1269 |
+
xmlDOMWrapAdoptNode (xmlDOMWrapCtxtPtr ctxt,
|
| 1270 |
+
xmlDocPtr sourceDoc,
|
| 1271 |
+
xmlNodePtr node,
|
| 1272 |
+
xmlDocPtr destDoc,
|
| 1273 |
+
xmlNodePtr destParent,
|
| 1274 |
+
int options);
|
| 1275 |
+
XMLPUBFUN int
|
| 1276 |
+
xmlDOMWrapRemoveNode (xmlDOMWrapCtxtPtr ctxt,
|
| 1277 |
+
xmlDocPtr doc,
|
| 1278 |
+
xmlNodePtr node,
|
| 1279 |
+
int options);
|
| 1280 |
+
XMLPUBFUN int
|
| 1281 |
+
xmlDOMWrapCloneNode (xmlDOMWrapCtxtPtr ctxt,
|
| 1282 |
+
xmlDocPtr sourceDoc,
|
| 1283 |
+
xmlNodePtr node,
|
| 1284 |
+
xmlNodePtr *clonedNode,
|
| 1285 |
+
xmlDocPtr destDoc,
|
| 1286 |
+
xmlNodePtr destParent,
|
| 1287 |
+
int deep,
|
| 1288 |
+
int options);
|
| 1289 |
+
|
| 1290 |
+
#ifdef LIBXML_TREE_ENABLED
|
| 1291 |
+
/*
|
| 1292 |
+
* 5 interfaces from DOM ElementTraversal, but different in entities
|
| 1293 |
+
* traversal.
|
| 1294 |
+
*/
|
| 1295 |
+
XMLPUBFUN unsigned long
|
| 1296 |
+
xmlChildElementCount (xmlNodePtr parent);
|
| 1297 |
+
XMLPUBFUN xmlNodePtr
|
| 1298 |
+
xmlNextElementSibling (xmlNodePtr node);
|
| 1299 |
+
XMLPUBFUN xmlNodePtr
|
| 1300 |
+
xmlFirstElementChild (xmlNodePtr parent);
|
| 1301 |
+
XMLPUBFUN xmlNodePtr
|
| 1302 |
+
xmlLastElementChild (xmlNodePtr parent);
|
| 1303 |
+
XMLPUBFUN xmlNodePtr
|
| 1304 |
+
xmlPreviousElementSibling (xmlNodePtr node);
|
| 1305 |
+
#endif
|
| 1306 |
+
#ifdef __cplusplus
|
| 1307 |
+
}
|
| 1308 |
+
#endif
|
| 1309 |
+
#ifndef __XML_PARSER_H__
|
| 1310 |
+
#include <libxml/xmlmemory.h>
|
| 1311 |
+
#endif
|
| 1312 |
+
|
| 1313 |
+
#endif /* __XML_TREE_H__ */
|
| 1314 |
+
|
pgsql/include/libxml/uri.h
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Summary: library of generic URI related routines
|
| 3 |
+
* Description: library of generic URI related routines
|
| 4 |
+
* Implements RFC 2396
|
| 5 |
+
*
|
| 6 |
+
* Copy: See Copyright for the status of this software.
|
| 7 |
+
*
|
| 8 |
+
* Author: Daniel Veillard
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
#ifndef __XML_URI_H__
|
| 12 |
+
#define __XML_URI_H__
|
| 13 |
+
|
| 14 |
+
#include <libxml/xmlversion.h>
|
| 15 |
+
#include <libxml/tree.h>
|
| 16 |
+
|
| 17 |
+
#ifdef __cplusplus
|
| 18 |
+
extern "C" {
|
| 19 |
+
#endif
|
| 20 |
+
|
| 21 |
+
/**
|
| 22 |
+
* xmlURI:
|
| 23 |
+
*
|
| 24 |
+
* A parsed URI reference. This is a struct containing the various fields
|
| 25 |
+
* as described in RFC 2396 but separated for further processing.
|
| 26 |
+
*
|
| 27 |
+
* Note: query is a deprecated field which is incorrectly unescaped.
|
| 28 |
+
* query_raw takes precedence over query if the former is set.
|
| 29 |
+
* See: http://mail.gnome.org/archives/xml/2007-April/thread.html#00127
|
| 30 |
+
*/
|
| 31 |
+
typedef struct _xmlURI xmlURI;
|
| 32 |
+
typedef xmlURI *xmlURIPtr;
|
| 33 |
+
struct _xmlURI {
|
| 34 |
+
char *scheme; /* the URI scheme */
|
| 35 |
+
char *opaque; /* opaque part */
|
| 36 |
+
char *authority; /* the authority part */
|
| 37 |
+
char *server; /* the server part */
|
| 38 |
+
char *user; /* the user part */
|
| 39 |
+
int port; /* the port number */
|
| 40 |
+
char *path; /* the path string */
|
| 41 |
+
char *query; /* the query string (deprecated - use with caution) */
|
| 42 |
+
char *fragment; /* the fragment identifier */
|
| 43 |
+
int cleanup; /* parsing potentially unclean URI */
|
| 44 |
+
char *query_raw; /* the query string (as it appears in the URI) */
|
| 45 |
+
};
|
| 46 |
+
|
| 47 |
+
/*
|
| 48 |
+
* This function is in tree.h:
|
| 49 |
+
* xmlChar * xmlNodeGetBase (xmlDocPtr doc,
|
| 50 |
+
* xmlNodePtr cur);
|
| 51 |
+
*/
|
| 52 |
+
XMLPUBFUN xmlURIPtr
|
| 53 |
+
xmlCreateURI (void);
|
| 54 |
+
XMLPUBFUN xmlChar *
|
| 55 |
+
xmlBuildURI (const xmlChar *URI,
|
| 56 |
+
const xmlChar *base);
|
| 57 |
+
XMLPUBFUN xmlChar *
|
| 58 |
+
xmlBuildRelativeURI (const xmlChar *URI,
|
| 59 |
+
const xmlChar *base);
|
| 60 |
+
XMLPUBFUN xmlURIPtr
|
| 61 |
+
xmlParseURI (const char *str);
|
| 62 |
+
XMLPUBFUN xmlURIPtr
|
| 63 |
+
xmlParseURIRaw (const char *str,
|
| 64 |
+
int raw);
|
| 65 |
+
XMLPUBFUN int
|
| 66 |
+
xmlParseURIReference (xmlURIPtr uri,
|
| 67 |
+
const char *str);
|
| 68 |
+
XMLPUBFUN xmlChar *
|
| 69 |
+
xmlSaveUri (xmlURIPtr uri);
|
| 70 |
+
XMLPUBFUN void
|
| 71 |
+
xmlPrintURI (FILE *stream,
|
| 72 |
+
xmlURIPtr uri);
|
| 73 |
+
XMLPUBFUN xmlChar *
|
| 74 |
+
xmlURIEscapeStr (const xmlChar *str,
|
| 75 |
+
const xmlChar *list);
|
| 76 |
+
XMLPUBFUN char *
|
| 77 |
+
xmlURIUnescapeString (const char *str,
|
| 78 |
+
int len,
|
| 79 |
+
char *target);
|
| 80 |
+
XMLPUBFUN int
|
| 81 |
+
xmlNormalizeURIPath (char *path);
|
| 82 |
+
XMLPUBFUN xmlChar *
|
| 83 |
+
xmlURIEscape (const xmlChar *str);
|
| 84 |
+
XMLPUBFUN void
|
| 85 |
+
xmlFreeURI (xmlURIPtr uri);
|
| 86 |
+
XMLPUBFUN xmlChar*
|
| 87 |
+
xmlCanonicPath (const xmlChar *path);
|
| 88 |
+
XMLPUBFUN xmlChar*
|
| 89 |
+
xmlPath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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: The DTD validation
|
| 3 |
+
* Description: API for the DTD handling and the validity checking
|
| 4 |
+
*
|
| 5 |
+
* Copy: See Copyright for the status of this software.
|
| 6 |
+
*
|
| 7 |
+
* Author: Daniel Veillard
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
|
| 11 |
+
#ifndef __XML_VALID_H__
|
| 12 |
+
#define __XML_VALID_H__
|
| 13 |
+
|
| 14 |
+
#include <libxml/xmlversion.h>
|
| 15 |
+
#include <libxml/xmlerror.h>
|
| 16 |
+
#include <libxml/tree.h>
|
| 17 |
+
#include <libxml/list.h>
|
| 18 |
+
#include <libxml/xmlautomata.h>
|
| 19 |
+
#include <libxml/xmlregexp.h>
|
| 20 |
+
|
| 21 |
+
#ifdef __cplusplus
|
| 22 |
+
extern "C" {
|
| 23 |
+
#endif
|
| 24 |
+
|
| 25 |
+
/*
|
| 26 |
+
* Validation state added for non-determinist content model.
|
| 27 |
+
*/
|
| 28 |
+
typedef struct _xmlValidState xmlValidState;
|
| 29 |
+
typedef xmlValidState *xmlValidStatePtr;
|
| 30 |
+
|
| 31 |
+
/**
|
| 32 |
+
* xmlValidityErrorFunc:
|
| 33 |
+
* @ctx: usually an xmlValidCtxtPtr to a validity error context,
|
| 34 |
+
* but comes from ctxt->userData (which normally contains such
|
| 35 |
+
* a pointer); ctxt->userData can be changed by the user.
|
| 36 |
+
* @msg: the string to format *printf like vararg
|
| 37 |
+
* @...: remaining arguments to the format
|
| 38 |
+
*
|
| 39 |
+
* Callback called when a validity error is found. This is a message
|
| 40 |
+
* oriented function similar to an *printf function.
|
| 41 |
+
*/
|
| 42 |
+
typedef void (*xmlValidityErrorFunc) (void *ctx,
|
| 43 |
+
const char *msg,
|
| 44 |
+
...) LIBXML_ATTR_FORMAT(2,3);
|
| 45 |
+
|
| 46 |
+
/**
|
| 47 |
+
* xmlValidityWarningFunc:
|
| 48 |
+
* @ctx: usually an xmlValidCtxtPtr to a validity error context,
|
| 49 |
+
* but comes from ctxt->userData (which normally contains such
|
| 50 |
+
* a pointer); ctxt->userData can be changed by the user.
|
| 51 |
+
* @msg: the string to format *printf like vararg
|
| 52 |
+
* @...: remaining arguments to the format
|
| 53 |
+
*
|
| 54 |
+
* Callback called when a validity warning is found. This is a message
|
| 55 |
+
* oriented function similar to an *printf function.
|
| 56 |
+
*/
|
| 57 |
+
typedef void (*xmlValidityWarningFunc) (void *ctx,
|
| 58 |
+
const char *msg,
|
| 59 |
+
...) LIBXML_ATTR_FORMAT(2,3);
|
| 60 |
+
|
| 61 |
+
/*
|
| 62 |
+
* xmlValidCtxt:
|
| 63 |
+
* An xmlValidCtxt is used for error reporting when validating.
|
| 64 |
+
*/
|
| 65 |
+
typedef struct _xmlValidCtxt xmlValidCtxt;
|
| 66 |
+
typedef xmlValidCtxt *xmlValidCtxtPtr;
|
| 67 |
+
struct _xmlValidCtxt {
|
| 68 |
+
void *userData; /* user specific data block */
|
| 69 |
+
xmlValidityErrorFunc error; /* the callback in case of errors */
|
| 70 |
+
xmlValidityWarningFunc warning; /* the callback in case of warning */
|
| 71 |
+
|
| 72 |
+
/* Node analysis stack used when validating within entities */
|
| 73 |
+
xmlNodePtr node; /* Current parsed Node */
|
| 74 |
+
int nodeNr; /* Depth of the parsing stack */
|
| 75 |
+
int nodeMax; /* Max depth of the parsing stack */
|
| 76 |
+
xmlNodePtr *nodeTab; /* array of nodes */
|
| 77 |
+
|
| 78 |
+
unsigned int flags; /* internal flags */
|
| 79 |
+
xmlDocPtr doc; /* the document */
|
| 80 |
+
int valid; /* temporary validity check result */
|
| 81 |
+
|
| 82 |
+
/* state state used for non-determinist content validation */
|
| 83 |
+
xmlValidState *vstate; /* current state */
|
| 84 |
+
int vstateNr; /* Depth of the validation stack */
|
| 85 |
+
int vstateMax; /* Max depth of the validation stack */
|
| 86 |
+
xmlValidState *vstateTab; /* array of validation states */
|
| 87 |
+
|
| 88 |
+
#ifdef LIBXML_REGEXP_ENABLED
|
| 89 |
+
xmlAutomataPtr am; /* the automata */
|
| 90 |
+
xmlAutomataStatePtr state; /* used to build the automata */
|
| 91 |
+
#else
|
| 92 |
+
void *am;
|
| 93 |
+
void *state;
|
| 94 |
+
#endif
|
| 95 |
+
};
|
| 96 |
+
|
| 97 |
+
/*
|
| 98 |
+
* ALL notation declarations are stored in a table.
|
| 99 |
+
* There is one table per DTD.
|
| 100 |
+
*/
|
| 101 |
+
|
| 102 |
+
typedef struct _xmlHashTable xmlNotationTable;
|
| 103 |
+
typedef xmlNotationTable *xmlNotationTablePtr;
|
| 104 |
+
|
| 105 |
+
/*
|
| 106 |
+
* ALL element declarations are stored in a table.
|
| 107 |
+
* There is one table per DTD.
|
| 108 |
+
*/
|
| 109 |
+
|
| 110 |
+
typedef struct _xmlHashTable xmlElementTable;
|
| 111 |
+
typedef xmlElementTable *xmlElementTablePtr;
|
| 112 |
+
|
| 113 |
+
/*
|
| 114 |
+
* ALL attribute declarations are stored in a table.
|
| 115 |
+
* There is one table per DTD.
|
| 116 |
+
*/
|
| 117 |
+
|
| 118 |
+
typedef struct _xmlHashTable xmlAttributeTable;
|
| 119 |
+
typedef xmlAttributeTable *xmlAttributeTablePtr;
|
| 120 |
+
|
| 121 |
+
/*
|
| 122 |
+
* ALL IDs attributes are stored in a table.
|
| 123 |
+
* There is one table per document.
|
| 124 |
+
*/
|
| 125 |
+
|
| 126 |
+
typedef struct _xmlHashTable xmlIDTable;
|
| 127 |
+
typedef xmlIDTable *xmlIDTablePtr;
|
| 128 |
+
|
| 129 |
+
/*
|
| 130 |
+
* ALL Refs attributes are stored in a table.
|
| 131 |
+
* There is one table per document.
|
| 132 |
+
*/
|
| 133 |
+
|
| 134 |
+
typedef struct _xmlHashTable xmlRefTable;
|
| 135 |
+
typedef xmlRefTable *xmlRefTablePtr;
|
| 136 |
+
|
| 137 |
+
/* Notation */
|
| 138 |
+
XMLPUBFUN xmlNotationPtr
|
| 139 |
+
xmlAddNotationDecl (xmlValidCtxtPtr ctxt,
|
| 140 |
+
xmlDtdPtr dtd,
|
| 141 |
+
const xmlChar *name,
|
| 142 |
+
const xmlChar *PublicID,
|
| 143 |
+
const xmlChar *SystemID);
|
| 144 |
+
#ifdef LIBXML_TREE_ENABLED
|
| 145 |
+
XMLPUBFUN xmlNotationTablePtr
|
| 146 |
+
xmlCopyNotationTable (xmlNotationTablePtr table);
|
| 147 |
+
#endif /* LIBXML_TREE_ENABLED */
|
| 148 |
+
XMLPUBFUN void
|
| 149 |
+
xmlFreeNotationTable (xmlNotationTablePtr table);
|
| 150 |
+
#ifdef LIBXML_OUTPUT_ENABLED
|
| 151 |
+
XMLPUBFUN void
|
| 152 |
+
xmlDumpNotationDecl (xmlBufferPtr buf,
|
| 153 |
+
xmlNotationPtr nota);
|
| 154 |
+
XMLPUBFUN void
|
| 155 |
+
xmlDumpNotationTable (xmlBufferPtr buf,
|
| 156 |
+
xmlNotationTablePtr table);
|
| 157 |
+
#endif /* LIBXML_OUTPUT_ENABLED */
|
| 158 |
+
|
| 159 |
+
/* Element Content */
|
| 160 |
+
/* the non Doc version are being deprecated */
|
| 161 |
+
XMLPUBFUN xmlElementContentPtr
|
| 162 |
+
xmlNewElementContent (const xmlChar *name,
|
| 163 |
+
xmlElementContentType type);
|
| 164 |
+
XMLPUBFUN xmlElementContentPtr
|
| 165 |
+
xmlCopyElementContent (xmlElementContentPtr content);
|
| 166 |
+
XMLPUBFUN void
|
| 167 |
+
xmlFreeElementContent (xmlElementContentPtr cur);
|
| 168 |
+
/* the new versions with doc argument */
|
| 169 |
+
XMLPUBFUN xmlElementContentPtr
|
| 170 |
+
xmlNewDocElementContent (xmlDocPtr doc,
|
| 171 |
+
const xmlChar *name,
|
| 172 |
+
xmlElementContentType type);
|
| 173 |
+
XMLPUBFUN xmlElementContentPtr
|
| 174 |
+
xmlCopyDocElementContent(xmlDocPtr doc,
|
| 175 |
+
xmlElementContentPtr content);
|
| 176 |
+
XMLPUBFUN void
|
| 177 |
+
xmlFreeDocElementContent(xmlDocPtr doc,
|
| 178 |
+
xmlElementContentPtr cur);
|
| 179 |
+
XMLPUBFUN void
|
| 180 |
+
xmlSnprintfElementContent(char *buf,
|
| 181 |
+
int size,
|
| 182 |
+
xmlElementContentPtr content,
|
| 183 |
+
int englob);
|
| 184 |
+
#ifdef LIBXML_OUTPUT_ENABLED
|
| 185 |
+
/* DEPRECATED */
|
| 186 |
+
XMLPUBFUN void
|
| 187 |
+
xmlSprintfElementContent(char *buf,
|
| 188 |
+
xmlElementContentPtr content,
|
| 189 |
+
int englob);
|
| 190 |
+
#endif /* LIBXML_OUTPUT_ENABLED */
|
| 191 |
+
/* DEPRECATED */
|
| 192 |
+
|
| 193 |
+
/* Element */
|
| 194 |
+
XMLPUBFUN xmlElementPtr
|
| 195 |
+
xmlAddElementDecl (xmlValidCtxtPtr ctxt,
|
| 196 |
+
xmlDtdPtr dtd,
|
| 197 |
+
const xmlChar *name,
|
| 198 |
+
xmlElementTypeVal type,
|
| 199 |
+
xmlElementContentPtr content);
|
| 200 |
+
#ifdef LIBXML_TREE_ENABLED
|
| 201 |
+
XMLPUBFUN xmlElementTablePtr
|
| 202 |
+
xmlCopyElementTable (xmlElementTablePtr table);
|
| 203 |
+
#endif /* LIBXML_TREE_ENABLED */
|
| 204 |
+
XMLPUBFUN void
|
| 205 |
+
xmlFreeElementTable (xmlElementTablePtr table);
|
| 206 |
+
#ifdef LIBXML_OUTPUT_ENABLED
|
| 207 |
+
XMLPUBFUN void
|
| 208 |
+
xmlDumpElementTable (xmlBufferPtr buf,
|
| 209 |
+
xmlElementTablePtr table);
|
| 210 |
+
XMLPUBFUN void
|
| 211 |
+
xmlDumpElementDecl (xmlBufferPtr buf,
|
| 212 |
+
xmlElementPtr elem);
|
| 213 |
+
#endif /* LIBXML_OUTPUT_ENABLED */
|
| 214 |
+
|
| 215 |
+
/* Enumeration */
|
| 216 |
+
XMLPUBFUN xmlEnumerationPtr
|
| 217 |
+
xmlCreateEnumeration (const xmlChar *name);
|
| 218 |
+
XMLPUBFUN void
|
| 219 |
+
xmlFreeEnumeration (xmlEnumerationPtr cur);
|
| 220 |
+
#ifdef LIBXML_TREE_ENABLED
|
| 221 |
+
XMLPUBFUN xmlEnumerationPtr
|
| 222 |
+
xmlCopyEnumeration (xmlEnumerationPtr cur);
|
| 223 |
+
#endif /* LIBXML_TREE_ENABLED */
|
| 224 |
+
|
| 225 |
+
/* Attribute */
|
| 226 |
+
XMLPUBFUN xmlAttributePtr
|
| 227 |
+
xmlAddAttributeDecl (xmlValidCtxtPtr ctxt,
|
| 228 |
+
xmlDtdPtr dtd,
|
| 229 |
+
const xmlChar *elem,
|
| 230 |
+
const xmlChar *name,
|
| 231 |
+
const xmlChar *ns,
|
| 232 |
+
xmlAttributeType type,
|
| 233 |
+
xmlAttributeDefault def,
|
| 234 |
+
const xmlChar *defaultValue,
|
| 235 |
+
xmlEnumerationPtr tree);
|
| 236 |
+
#ifdef LIBXML_TREE_ENABLED
|
| 237 |
+
XMLPUBFUN xmlAttributeTablePtr
|
| 238 |
+
xmlCopyAttributeTable (xmlAttributeTablePtr table);
|
| 239 |
+
#endif /* LIBXML_TREE_ENABLED */
|
| 240 |
+
XMLPUBFUN void
|
| 241 |
+
xmlFreeAttributeTable (xmlAttributeTablePtr table);
|
| 242 |
+
#ifdef LIBXML_OUTPUT_ENABLED
|
| 243 |
+
XMLPUBFUN void
|
| 244 |
+
xmlDumpAttributeTable (xmlBufferPtr buf,
|
| 245 |
+
xmlAttributeTablePtr table);
|
| 246 |
+
XMLPUBFUN void
|
| 247 |
+
xmlDumpAttributeDecl (xmlBufferPtr buf,
|
| 248 |
+
xmlAttributePtr attr);
|
| 249 |
+
#endif /* LIBXML_OUTPUT_ENABLED */
|
| 250 |
+
|
| 251 |
+
/* IDs */
|
| 252 |
+
XMLPUBFUN xmlIDPtr
|
| 253 |
+
xmlAddID (xmlValidCtxtPtr ctxt,
|
| 254 |
+
xmlDocPtr doc,
|
| 255 |
+
const xmlChar *value,
|
| 256 |
+
xmlAttrPtr attr);
|
| 257 |
+
XMLPUBFUN void
|
| 258 |
+
xmlFreeIDTable (xmlIDTablePtr table);
|
| 259 |
+
XMLPUBFUN xmlAttrPtr
|
| 260 |
+
xmlGetID (xmlDocPtr doc,
|
| 261 |
+
const xmlChar *ID);
|
| 262 |
+
XMLPUBFUN int
|
| 263 |
+
xmlIsID (xmlDocPtr doc,
|
| 264 |
+
xmlNodePtr elem,
|
| 265 |
+
xmlAttrPtr attr);
|
| 266 |
+
XMLPUBFUN int
|
| 267 |
+
xmlRemoveID (xmlDocPtr doc,
|
| 268 |
+
xmlAttrPtr attr);
|
| 269 |
+
|
| 270 |
+
/* IDREFs */
|
| 271 |
+
XML_DEPRECATED
|
| 272 |
+
XMLPUBFUN xmlRefPtr
|
| 273 |
+
xmlAddRef (xmlValidCtxtPtr ctxt,
|
| 274 |
+
xmlDocPtr doc,
|
| 275 |
+
const xmlChar *value,
|
| 276 |
+
xmlAttrPtr attr);
|
| 277 |
+
XML_DEPRECATED
|
| 278 |
+
XMLPUBFUN void
|
| 279 |
+
xmlFreeRefTable (xmlRefTablePtr table);
|
| 280 |
+
XML_DEPRECATED
|
| 281 |
+
XMLPUBFUN int
|
| 282 |
+
xmlIsRef (xmlDocPtr doc,
|
| 283 |
+
xmlNodePtr elem,
|
| 284 |
+
xmlAttrPtr attr);
|
| 285 |
+
XML_DEPRECATED
|
| 286 |
+
XMLPUBFUN int
|
| 287 |
+
xmlRemoveRef (xmlDocPtr doc,
|
| 288 |
+
xmlAttrPtr attr);
|
| 289 |
+
XML_DEPRECATED
|
| 290 |
+
XMLPUBFUN xmlListPtr
|
| 291 |
+
xmlGetRefs (xmlDocPtr doc,
|
| 292 |
+
const xmlChar *ID);
|
| 293 |
+
|
| 294 |
+
/**
|
| 295 |
+
* The public function calls related to validity checking.
|
| 296 |
+
*/
|
| 297 |
+
#ifdef LIBXML_VALID_ENABLED
|
| 298 |
+
/* Allocate/Release Validation Contexts */
|
| 299 |
+
XMLPUBFUN xmlValidCtxtPtr
|
| 300 |
+
xmlNewValidCtxt(void);
|
| 301 |
+
XMLPUBFUN void
|
| 302 |
+
xmlFreeValidCtxt(xmlValidCtxtPtr);
|
| 303 |
+
|
| 304 |
+
XMLPUBFUN int
|
| 305 |
+
xmlValidateRoot (xmlValidCtxtPtr ctxt,
|
| 306 |
+
xmlDocPtr doc);
|
| 307 |
+
XMLPUBFUN int
|
| 308 |
+
xmlValidateElementDecl (xmlValidCtxtPtr ctxt,
|
| 309 |
+
xmlDocPtr doc,
|
| 310 |
+
xmlElementPtr elem);
|
| 311 |
+
XMLPUBFUN xmlChar *
|
| 312 |
+
xmlValidNormalizeAttributeValue(xmlDocPtr doc,
|
| 313 |
+
xmlNodePtr elem,
|
| 314 |
+
const xmlChar *name,
|
| 315 |
+
const xmlChar *value);
|
| 316 |
+
XMLPUBFUN xmlChar *
|
| 317 |
+
xmlValidCtxtNormalizeAttributeValue(xmlValidCtxtPtr ctxt,
|
| 318 |
+
xmlDocPtr doc,
|
| 319 |
+
xmlNodePtr elem,
|
| 320 |
+
const xmlChar *name,
|
| 321 |
+
const xmlChar *value);
|
| 322 |
+
XMLPUBFUN int
|
| 323 |
+
xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt,
|
| 324 |
+
xmlDocPtr doc,
|
| 325 |
+
xmlAttributePtr attr);
|
| 326 |
+
XMLPUBFUN int
|
| 327 |
+
xmlValidateAttributeValue(xmlAttributeType type,
|
| 328 |
+
const xmlChar *value);
|
| 329 |
+
XMLPUBFUN int
|
| 330 |
+
xmlValidateNotationDecl (xmlValidCtxtPtr ctxt,
|
| 331 |
+
xmlDocPtr doc,
|
| 332 |
+
xmlNotationPtr nota);
|
| 333 |
+
XMLPUBFUN int
|
| 334 |
+
xmlValidateDtd (xmlValidCtxtPtr ctxt,
|
| 335 |
+
xmlDocPtr doc,
|
| 336 |
+
xmlDtdPtr dtd);
|
| 337 |
+
XMLPUBFUN int
|
| 338 |
+
xmlValidateDtdFinal (xmlValidCtxtPtr ctxt,
|
| 339 |
+
xmlDocPtr doc);
|
| 340 |
+
XMLPUBFUN int
|
| 341 |
+
xmlValidateDocument (xmlValidCtxtPtr ctxt,
|
| 342 |
+
xmlDocPtr doc);
|
| 343 |
+
XMLPUBFUN int
|
| 344 |
+
xmlValidateElement (xmlValidCtxtPtr ctxt,
|
| 345 |
+
xmlDocPtr doc,
|
| 346 |
+
xmlNodePtr elem);
|
| 347 |
+
XMLPUBFUN int
|
| 348 |
+
xmlValidateOneElement (xmlValidCtxtPtr ctxt,
|
| 349 |
+
xmlDocPtr doc,
|
| 350 |
+
xmlNodePtr elem);
|
| 351 |
+
XMLPUBFUN int
|
| 352 |
+
xmlValidateOneAttribute (xmlValidCtxtPtr ctxt,
|
| 353 |
+
xmlDocPtr doc,
|
| 354 |
+
xmlNodePtr elem,
|
| 355 |
+
xmlAttrPtr attr,
|
| 356 |
+
const xmlChar *value);
|
| 357 |
+
XMLPUBFUN int
|
| 358 |
+
xmlValidateOneNamespace (xmlValidCtxtPtr ctxt,
|
| 359 |
+
xmlDocPtr doc,
|
| 360 |
+
xmlNodePtr elem,
|
| 361 |
+
const xmlChar *prefix,
|
| 362 |
+
xmlNsPtr ns,
|
| 363 |
+
const xmlChar *value);
|
| 364 |
+
XMLPUBFUN int
|
| 365 |
+
xmlValidateDocumentFinal(xmlValidCtxtPtr ctxt,
|
| 366 |
+
xmlDocPtr doc);
|
| 367 |
+
#endif /* LIBXML_VALID_ENABLED */
|
| 368 |
+
|
| 369 |
+
#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
|
| 370 |
+
XMLPUBFUN int
|
| 371 |
+
xmlValidateNotationUse (xmlValidCtxtPtr ctxt,
|
| 372 |
+
xmlDocPtr doc,
|
| 373 |
+
const xmlChar *notationName);
|
| 374 |
+
#endif /* LIBXML_VALID_ENABLED or LIBXML_SCHEMAS_ENABLED */
|
| 375 |
+
|
| 376 |
+
XMLPUBFUN int
|
| 377 |
+
xmlIsMixedElement (xmlDocPtr doc,
|
| 378 |
+
const xmlChar *name);
|
| 379 |
+
XMLPUBFUN xmlAttributePtr
|
| 380 |
+
xmlGetDtdAttrDesc (xmlDtdPtr dtd,
|
| 381 |
+
const xmlChar *elem,
|
| 382 |
+
const xmlChar *name);
|
| 383 |
+
XMLPUBFUN xmlAttributePtr
|
| 384 |
+
xmlGetDtdQAttrDesc (xmlDtdPtr dtd,
|
| 385 |
+
const xmlChar *elem,
|
| 386 |
+
const xmlChar *name,
|
| 387 |
+
const xmlChar *prefix);
|
| 388 |
+
XMLPUBFUN xmlNotationPtr
|
| 389 |
+
xmlGetDtdNotationDesc (xmlDtdPtr dtd,
|
| 390 |
+
const xmlChar *name);
|
| 391 |
+
XMLPUBFUN xmlElementPtr
|
| 392 |
+
xmlGetDtdQElementDesc (xmlDtdPtr dtd,
|
| 393 |
+
const xmlChar *name,
|
| 394 |
+
const xmlChar *prefix);
|
| 395 |
+
XMLPUBFUN xmlElementPtr
|
| 396 |
+
xmlGetDtdElementDesc (xmlDtdPtr dtd,
|
| 397 |
+
const xmlChar *name);
|
| 398 |
+
|
| 399 |
+
#ifdef LIBXML_VALID_ENABLED
|
| 400 |
+
|
| 401 |
+
XMLPUBFUN int
|
| 402 |
+
xmlValidGetPotentialChildren(xmlElementContent *ctree,
|
| 403 |
+
const xmlChar **names,
|
| 404 |
+
int *len,
|
| 405 |
+
int max);
|
| 406 |
+
|
| 407 |
+
XMLPUBFUN int
|
| 408 |
+
xmlValidGetValidElements(xmlNode *prev,
|
| 409 |
+
xmlNode *next,
|
| 410 |
+
const xmlChar **names,
|
| 411 |
+
int max);
|
| 412 |
+
XMLPUBFUN int
|
| 413 |
+
xmlValidateNameValue (const xmlChar *value);
|
| 414 |
+
XMLPUBFUN int
|
| 415 |
+
xmlValidateNamesValue (const xmlChar *value);
|
| 416 |
+
XMLPUBFUN int
|
| 417 |
+
xmlValidateNmtokenValue (const xmlChar *value);
|
| 418 |
+
XMLPUBFUN int
|
| 419 |
+
xmlValidateNmtokensValue(const xmlChar *value);
|
| 420 |
+
|
| 421 |
+
#ifdef LIBXML_REGEXP_ENABLED
|
| 422 |
+
/*
|
| 423 |
+
* Validation based on the regexp support
|
| 424 |
+
*/
|
| 425 |
+
XMLPUBFUN int
|
| 426 |
+
xmlValidBuildContentModel(xmlValidCtxtPtr ctxt,
|
| 427 |
+
xmlElementPtr elem);
|
| 428 |
+
|
| 429 |
+
XMLPUBFUN int
|
| 430 |
+
xmlValidatePushElement (xmlValidCtxtPtr ctxt,
|
| 431 |
+
xmlDocPtr doc,
|
| 432 |
+
xmlNodePtr elem,
|
| 433 |
+
const xmlChar *qname);
|
| 434 |
+
XMLPUBFUN int
|
| 435 |
+
xmlValidatePushCData (xmlValidCtxtPtr ctxt,
|
| 436 |
+
const xmlChar *data,
|
| 437 |
+
int len);
|
| 438 |
+
XMLPUBFUN int
|
| 439 |
+
xmlValidatePopElement (xmlValidCtxtPtr ctxt,
|
| 440 |
+
xmlDocPtr doc,
|
| 441 |
+
xmlNodePtr elem,
|
| 442 |
+
const xmlChar *qname);
|
| 443 |
+
#endif /* LIBXML_REGEXP_ENABLED */
|
| 444 |
+
#endif /* LIBXML_VALID_ENABLED */
|
| 445 |
+
#ifdef __cplusplus
|
| 446 |
+
}
|
| 447 |
+
#endif
|
| 448 |
+
#endif /* __XML_VALID_H__ */
|
pgsql/include/libxml/xinclude.h
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: implementation of XInclude
|
| 3 |
+
* Description: API to handle XInclude processing,
|
| 4 |
+
* implements the
|
| 5 |
+
* World Wide Web Consortium Last Call Working Draft 10 November 2003
|
| 6 |
+
* http://www.w3.org/TR/2003/WD-xinclude-20031110
|
| 7 |
+
*
|
| 8 |
+
* Copy: See Copyright for the status of this software.
|
| 9 |
+
*
|
| 10 |
+
* Author: Daniel Veillard
|
| 11 |
+
*/
|
| 12 |
+
|
| 13 |
+
#ifndef __XML_XINCLUDE_H__
|
| 14 |
+
#define __XML_XINCLUDE_H__
|
| 15 |
+
|
| 16 |
+
#include <libxml/xmlversion.h>
|
| 17 |
+
#include <libxml/tree.h>
|
| 18 |
+
|
| 19 |
+
#ifdef LIBXML_XINCLUDE_ENABLED
|
| 20 |
+
|
| 21 |
+
#ifdef __cplusplus
|
| 22 |
+
extern "C" {
|
| 23 |
+
#endif
|
| 24 |
+
|
| 25 |
+
/**
|
| 26 |
+
* XINCLUDE_NS:
|
| 27 |
+
*
|
| 28 |
+
* Macro defining the Xinclude namespace: http://www.w3.org/2003/XInclude
|
| 29 |
+
*/
|
| 30 |
+
#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude"
|
| 31 |
+
/**
|
| 32 |
+
* XINCLUDE_OLD_NS:
|
| 33 |
+
*
|
| 34 |
+
* Macro defining the draft Xinclude namespace: http://www.w3.org/2001/XInclude
|
| 35 |
+
*/
|
| 36 |
+
#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
|
| 37 |
+
/**
|
| 38 |
+
* XINCLUDE_NODE:
|
| 39 |
+
*
|
| 40 |
+
* Macro defining "include"
|
| 41 |
+
*/
|
| 42 |
+
#define XINCLUDE_NODE (const xmlChar *) "include"
|
| 43 |
+
/**
|
| 44 |
+
* XINCLUDE_FALLBACK:
|
| 45 |
+
*
|
| 46 |
+
* Macro defining "fallback"
|
| 47 |
+
*/
|
| 48 |
+
#define XINCLUDE_FALLBACK (const xmlChar *) "fallback"
|
| 49 |
+
/**
|
| 50 |
+
* XINCLUDE_HREF:
|
| 51 |
+
*
|
| 52 |
+
* Macro defining "href"
|
| 53 |
+
*/
|
| 54 |
+
#define XINCLUDE_HREF (const xmlChar *) "href"
|
| 55 |
+
/**
|
| 56 |
+
* XINCLUDE_PARSE:
|
| 57 |
+
*
|
| 58 |
+
* Macro defining "parse"
|
| 59 |
+
*/
|
| 60 |
+
#define XINCLUDE_PARSE (const xmlChar *) "parse"
|
| 61 |
+
/**
|
| 62 |
+
* XINCLUDE_PARSE_XML:
|
| 63 |
+
*
|
| 64 |
+
* Macro defining "xml"
|
| 65 |
+
*/
|
| 66 |
+
#define XINCLUDE_PARSE_XML (const xmlChar *) "xml"
|
| 67 |
+
/**
|
| 68 |
+
* XINCLUDE_PARSE_TEXT:
|
| 69 |
+
*
|
| 70 |
+
* Macro defining "text"
|
| 71 |
+
*/
|
| 72 |
+
#define XINCLUDE_PARSE_TEXT (const xmlChar *) "text"
|
| 73 |
+
/**
|
| 74 |
+
* XINCLUDE_PARSE_ENCODING:
|
| 75 |
+
*
|
| 76 |
+
* Macro defining "encoding"
|
| 77 |
+
*/
|
| 78 |
+
#define XINCLUDE_PARSE_ENCODING (const xmlChar *) "encoding"
|
| 79 |
+
/**
|
| 80 |
+
* XINCLUDE_PARSE_XPOINTER:
|
| 81 |
+
*
|
| 82 |
+
* Macro defining "xpointer"
|
| 83 |
+
*/
|
| 84 |
+
#define XINCLUDE_PARSE_XPOINTER (const xmlChar *) "xpointer"
|
| 85 |
+
|
| 86 |
+
typedef struct _xmlXIncludeCtxt xmlXIncludeCtxt;
|
| 87 |
+
typedef xmlXIncludeCtxt *xmlXIncludeCtxtPtr;
|
| 88 |
+
|
| 89 |
+
/*
|
| 90 |
+
* standalone processing
|
| 91 |
+
*/
|
| 92 |
+
XMLPUBFUN int
|
| 93 |
+
xmlXIncludeProcess (xmlDocPtr doc);
|
| 94 |
+
XMLPUBFUN int
|
| 95 |
+
xmlXIncludeProcessFlags (xmlDocPtr doc,
|
| 96 |
+
int flags);
|
| 97 |
+
XMLPUBFUN int
|
| 98 |
+
xmlXIncludeProcessFlagsData(xmlDocPtr doc,
|
| 99 |
+
int flags,
|
| 100 |
+
void *data);
|
| 101 |
+
XMLPUBFUN int
|
| 102 |
+
xmlXIncludeProcessTreeFlagsData(xmlNodePtr tree,
|
| 103 |
+
int flags,
|
| 104 |
+
void *data);
|
| 105 |
+
XMLPUBFUN int
|
| 106 |
+
xmlXIncludeProcessTree (xmlNodePtr tree);
|
| 107 |
+
XMLPUBFUN int
|
| 108 |
+
xmlXIncludeProcessTreeFlags(xmlNodePtr tree,
|
| 109 |
+
int flags);
|
| 110 |
+
/*
|
| 111 |
+
* contextual processing
|
| 112 |
+
*/
|
| 113 |
+
XMLPUBFUN xmlXIncludeCtxtPtr
|
| 114 |
+
xmlXIncludeNewContext (xmlDocPtr doc);
|
| 115 |
+
XMLPUBFUN int
|
| 116 |
+
xmlXIncludeSetFlags (xmlXIncludeCtxtPtr ctxt,
|
| 117 |
+
int flags);
|
| 118 |
+
XMLPUBFUN void
|
| 119 |
+
xmlXIncludeFreeContext (xmlXIncludeCtxtPtr ctxt);
|
| 120 |
+
XMLPUBFUN int
|
| 121 |
+
xmlXIncludeProcessNode (xmlXIncludeCtxtPtr ctxt,
|
| 122 |
+
xmlNodePtr tree);
|
| 123 |
+
#ifdef __cplusplus
|
| 124 |
+
}
|
| 125 |
+
#endif
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: unfinished XLink detection module
|
| 3 |
+
* Description: unfinished XLink detection module
|
| 4 |
+
*
|
| 5 |
+
* Copy: See Copyright for the status of this software.
|
| 6 |
+
*
|
| 7 |
+
* Author: Daniel Veillard
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef __XML_XLINK_H__
|
| 11 |
+
#define __XML_XLINK_H__
|
| 12 |
+
|
| 13 |
+
#include <libxml/xmlversion.h>
|
| 14 |
+
#include <libxml/tree.h>
|
| 15 |
+
|
| 16 |
+
#ifdef LIBXML_XPTR_ENABLED
|
| 17 |
+
|
| 18 |
+
#ifdef __cplusplus
|
| 19 |
+
extern "C" {
|
| 20 |
+
#endif
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* Various defines for the various Link properties.
|
| 24 |
+
*
|
| 25 |
+
* NOTE: the link detection layer will try to resolve QName expansion
|
| 26 |
+
* of namespaces. If "foo" is the prefix for "http://foo.com/"
|
| 27 |
+
* then the link detection layer will expand role="foo:myrole"
|
| 28 |
+
* to "http://foo.com/:myrole".
|
| 29 |
+
* NOTE: the link detection layer will expand URI-References found on
|
| 30 |
+
* href attributes by using the base mechanism if found.
|
| 31 |
+
*/
|
| 32 |
+
typedef xmlChar *xlinkHRef;
|
| 33 |
+
typedef xmlChar *xlinkRole;
|
| 34 |
+
typedef xmlChar *xlinkTitle;
|
| 35 |
+
|
| 36 |
+
typedef enum {
|
| 37 |
+
XLINK_TYPE_NONE = 0,
|
| 38 |
+
XLINK_TYPE_SIMPLE,
|
| 39 |
+
XLINK_TYPE_EXTENDED,
|
| 40 |
+
XLINK_TYPE_EXTENDED_SET
|
| 41 |
+
} xlinkType;
|
| 42 |
+
|
| 43 |
+
typedef enum {
|
| 44 |
+
XLINK_SHOW_NONE = 0,
|
| 45 |
+
XLINK_SHOW_NEW,
|
| 46 |
+
XLINK_SHOW_EMBED,
|
| 47 |
+
XLINK_SHOW_REPLACE
|
| 48 |
+
} xlinkShow;
|
| 49 |
+
|
| 50 |
+
typedef enum {
|
| 51 |
+
XLINK_ACTUATE_NONE = 0,
|
| 52 |
+
XLINK_ACTUATE_AUTO,
|
| 53 |
+
XLINK_ACTUATE_ONREQUEST
|
| 54 |
+
} xlinkActuate;
|
| 55 |
+
|
| 56 |
+
/**
|
| 57 |
+
* xlinkNodeDetectFunc:
|
| 58 |
+
* @ctx: user data pointer
|
| 59 |
+
* @node: the node to check
|
| 60 |
+
*
|
| 61 |
+
* This is the prototype for the link detection routine.
|
| 62 |
+
* It calls the default link detection callbacks upon link detection.
|
| 63 |
+
*/
|
| 64 |
+
typedef void (*xlinkNodeDetectFunc) (void *ctx, xmlNodePtr node);
|
| 65 |
+
|
| 66 |
+
/*
|
| 67 |
+
* The link detection module interact with the upper layers using
|
| 68 |
+
* a set of callback registered at parsing time.
|
| 69 |
+
*/
|
| 70 |
+
|
| 71 |
+
/**
|
| 72 |
+
* xlinkSimpleLinkFunk:
|
| 73 |
+
* @ctx: user data pointer
|
| 74 |
+
* @node: the node carrying the link
|
| 75 |
+
* @href: the target of the link
|
| 76 |
+
* @role: the role string
|
| 77 |
+
* @title: the link title
|
| 78 |
+
*
|
| 79 |
+
* This is the prototype for a simple link detection callback.
|
| 80 |
+
*/
|
| 81 |
+
typedef void
|
| 82 |
+
(*xlinkSimpleLinkFunk) (void *ctx,
|
| 83 |
+
xmlNodePtr node,
|
| 84 |
+
const xlinkHRef href,
|
| 85 |
+
const xlinkRole role,
|
| 86 |
+
const xlinkTitle title);
|
| 87 |
+
|
| 88 |
+
/**
|
| 89 |
+
* xlinkExtendedLinkFunk:
|
| 90 |
+
* @ctx: user data pointer
|
| 91 |
+
* @node: the node carrying the link
|
| 92 |
+
* @nbLocators: the number of locators detected on the link
|
| 93 |
+
* @hrefs: pointer to the array of locator hrefs
|
| 94 |
+
* @roles: pointer to the array of locator roles
|
| 95 |
+
* @nbArcs: the number of arcs detected on the link
|
| 96 |
+
* @from: pointer to the array of source roles found on the arcs
|
| 97 |
+
* @to: pointer to the array of target roles found on the arcs
|
| 98 |
+
* @show: array of values for the show attributes found on the arcs
|
| 99 |
+
* @actuate: array of values for the actuate attributes found on the arcs
|
| 100 |
+
* @nbTitles: the number of titles detected on the link
|
| 101 |
+
* @title: array of titles detected on the link
|
| 102 |
+
* @langs: array of xml:lang values for the titles
|
| 103 |
+
*
|
| 104 |
+
* This is the prototype for a extended link detection callback.
|
| 105 |
+
*/
|
| 106 |
+
typedef void
|
| 107 |
+
(*xlinkExtendedLinkFunk)(void *ctx,
|
| 108 |
+
xmlNodePtr node,
|
| 109 |
+
int nbLocators,
|
| 110 |
+
const xlinkHRef *hrefs,
|
| 111 |
+
const xlinkRole *roles,
|
| 112 |
+
int nbArcs,
|
| 113 |
+
const xlinkRole *from,
|
| 114 |
+
const xlinkRole *to,
|
| 115 |
+
xlinkShow *show,
|
| 116 |
+
xlinkActuate *actuate,
|
| 117 |
+
int nbTitles,
|
| 118 |
+
const xlinkTitle *titles,
|
| 119 |
+
const xmlChar **langs);
|
| 120 |
+
|
| 121 |
+
/**
|
| 122 |
+
* xlinkExtendedLinkSetFunk:
|
| 123 |
+
* @ctx: user data pointer
|
| 124 |
+
* @node: the node carrying the link
|
| 125 |
+
* @nbLocators: the number of locators detected on the link
|
| 126 |
+
* @hrefs: pointer to the array of locator hrefs
|
| 127 |
+
* @roles: pointer to the array of locator roles
|
| 128 |
+
* @nbTitles: the number of titles detected on the link
|
| 129 |
+
* @title: array of titles detected on the link
|
| 130 |
+
* @langs: array of xml:lang values for the titles
|
| 131 |
+
*
|
| 132 |
+
* This is the prototype for a extended link set detection callback.
|
| 133 |
+
*/
|
| 134 |
+
typedef void
|
| 135 |
+
(*xlinkExtendedLinkSetFunk) (void *ctx,
|
| 136 |
+
xmlNodePtr node,
|
| 137 |
+
int nbLocators,
|
| 138 |
+
const xlinkHRef *hrefs,
|
| 139 |
+
const xlinkRole *roles,
|
| 140 |
+
int nbTitles,
|
| 141 |
+
const xlinkTitle *titles,
|
| 142 |
+
const xmlChar **langs);
|
| 143 |
+
|
| 144 |
+
/**
|
| 145 |
+
* This is the structure containing a set of Links detection callbacks.
|
| 146 |
+
*
|
| 147 |
+
* There is no default xlink callbacks, if one want to get link
|
| 148 |
+
* recognition activated, those call backs must be provided before parsing.
|
| 149 |
+
*/
|
| 150 |
+
typedef struct _xlinkHandler xlinkHandler;
|
| 151 |
+
typedef xlinkHandler *xlinkHandlerPtr;
|
| 152 |
+
struct _xlinkHandler {
|
| 153 |
+
xlinkSimpleLinkFunk simple;
|
| 154 |
+
xlinkExtendedLinkFunk extended;
|
| 155 |
+
xlinkExtendedLinkSetFunk set;
|
| 156 |
+
};
|
| 157 |
+
|
| 158 |
+
/*
|
| 159 |
+
* The default detection routine, can be overridden, they call the default
|
| 160 |
+
* detection callbacks.
|
| 161 |
+
*/
|
| 162 |
+
|
| 163 |
+
XMLPUBFUN xlinkNodeDetectFunc
|
| 164 |
+
xlinkGetDefaultDetect (void);
|
| 165 |
+
XMLPUBFUN void
|
| 166 |
+
xlinkSetDefaultDetect (xlinkNodeDetectFunc func);
|
| 167 |
+
|
| 168 |
+
/*
|
| 169 |
+
* Routines to set/get the default handlers.
|
| 170 |
+
*/
|
| 171 |
+
XMLPUBFUN xlinkHandlerPtr
|
| 172 |
+
xlinkGetDefaultHandler (void);
|
| 173 |
+
XMLPUBFUN void
|
| 174 |
+
xlinkSetDefaultHandler (xlinkHandlerPtr handler);
|
| 175 |
+
|
| 176 |
+
/*
|
| 177 |
+
* Link detection module itself.
|
| 178 |
+
*/
|
| 179 |
+
XMLPUBFUN xlinkType
|
| 180 |
+
xlinkIsLink (xmlDocPtr doc,
|
| 181 |
+
xmlNodePtr node);
|
| 182 |
+
|
| 183 |
+
#ifdef __cplusplus
|
| 184 |
+
}
|
| 185 |
+
#endif
|
| 186 |
+
|
| 187 |
+
#endif /* LIBXML_XPTR_ENABLED */
|
| 188 |
+
|
| 189 |
+
#endif /* __XML_XLINK_H__ */
|
pgsql/include/libxml/xmlIO.h
ADDED
|
@@ -0,0 +1,369 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: interface for the I/O interfaces used by the parser
|
| 3 |
+
* Description: interface for the I/O interfaces used by the parser
|
| 4 |
+
*
|
| 5 |
+
* Copy: See Copyright for the status of this software.
|
| 6 |
+
*
|
| 7 |
+
* Author: Daniel Veillard
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef __XML_IO_H__
|
| 11 |
+
#define __XML_IO_H__
|
| 12 |
+
|
| 13 |
+
#include <stdio.h>
|
| 14 |
+
#include <libxml/xmlversion.h>
|
| 15 |
+
|
| 16 |
+
#ifdef __cplusplus
|
| 17 |
+
extern "C" {
|
| 18 |
+
#endif
|
| 19 |
+
|
| 20 |
+
/*
|
| 21 |
+
* Those are the functions and datatypes for the parser input
|
| 22 |
+
* I/O structures.
|
| 23 |
+
*/
|
| 24 |
+
|
| 25 |
+
/**
|
| 26 |
+
* xmlInputMatchCallback:
|
| 27 |
+
* @filename: the filename or URI
|
| 28 |
+
*
|
| 29 |
+
* Callback used in the I/O Input API to detect if the current handler
|
| 30 |
+
* can provide input functionality for this resource.
|
| 31 |
+
*
|
| 32 |
+
* Returns 1 if yes and 0 if another Input module should be used
|
| 33 |
+
*/
|
| 34 |
+
typedef int (*xmlInputMatchCallback) (char const *filename);
|
| 35 |
+
/**
|
| 36 |
+
* xmlInputOpenCallback:
|
| 37 |
+
* @filename: the filename or URI
|
| 38 |
+
*
|
| 39 |
+
* Callback used in the I/O Input API to open the resource
|
| 40 |
+
*
|
| 41 |
+
* Returns an Input context or NULL in case or error
|
| 42 |
+
*/
|
| 43 |
+
typedef void * (*xmlInputOpenCallback) (char const *filename);
|
| 44 |
+
/**
|
| 45 |
+
* xmlInputReadCallback:
|
| 46 |
+
* @context: an Input context
|
| 47 |
+
* @buffer: the buffer to store data read
|
| 48 |
+
* @len: the length of the buffer in bytes
|
| 49 |
+
*
|
| 50 |
+
* Callback used in the I/O Input API to read the resource
|
| 51 |
+
*
|
| 52 |
+
* Returns the number of bytes read or -1 in case of error
|
| 53 |
+
*/
|
| 54 |
+
typedef int (*xmlInputReadCallback) (void * context, char * buffer, int len);
|
| 55 |
+
/**
|
| 56 |
+
* xmlInputCloseCallback:
|
| 57 |
+
* @context: an Input context
|
| 58 |
+
*
|
| 59 |
+
* Callback used in the I/O Input API to close the resource
|
| 60 |
+
*
|
| 61 |
+
* Returns 0 or -1 in case of error
|
| 62 |
+
*/
|
| 63 |
+
typedef int (*xmlInputCloseCallback) (void * context);
|
| 64 |
+
|
| 65 |
+
#ifdef LIBXML_OUTPUT_ENABLED
|
| 66 |
+
/*
|
| 67 |
+
* Those are the functions and datatypes for the library output
|
| 68 |
+
* I/O structures.
|
| 69 |
+
*/
|
| 70 |
+
|
| 71 |
+
/**
|
| 72 |
+
* xmlOutputMatchCallback:
|
| 73 |
+
* @filename: the filename or URI
|
| 74 |
+
*
|
| 75 |
+
* Callback used in the I/O Output API to detect if the current handler
|
| 76 |
+
* can provide output functionality for this resource.
|
| 77 |
+
*
|
| 78 |
+
* Returns 1 if yes and 0 if another Output module should be used
|
| 79 |
+
*/
|
| 80 |
+
typedef int (*xmlOutputMatchCallback) (char const *filename);
|
| 81 |
+
/**
|
| 82 |
+
* xmlOutputOpenCallback:
|
| 83 |
+
* @filename: the filename or URI
|
| 84 |
+
*
|
| 85 |
+
* Callback used in the I/O Output API to open the resource
|
| 86 |
+
*
|
| 87 |
+
* Returns an Output context or NULL in case or error
|
| 88 |
+
*/
|
| 89 |
+
typedef void * (*xmlOutputOpenCallback) (char const *filename);
|
| 90 |
+
/**
|
| 91 |
+
* xmlOutputWriteCallback:
|
| 92 |
+
* @context: an Output context
|
| 93 |
+
* @buffer: the buffer of data to write
|
| 94 |
+
* @len: the length of the buffer in bytes
|
| 95 |
+
*
|
| 96 |
+
* Callback used in the I/O Output API to write to the resource
|
| 97 |
+
*
|
| 98 |
+
* Returns the number of bytes written or -1 in case of error
|
| 99 |
+
*/
|
| 100 |
+
typedef int (*xmlOutputWriteCallback) (void * context, const char * buffer,
|
| 101 |
+
int len);
|
| 102 |
+
/**
|
| 103 |
+
* xmlOutputCloseCallback:
|
| 104 |
+
* @context: an Output context
|
| 105 |
+
*
|
| 106 |
+
* Callback used in the I/O Output API to close the resource
|
| 107 |
+
*
|
| 108 |
+
* Returns 0 or -1 in case of error
|
| 109 |
+
*/
|
| 110 |
+
typedef int (*xmlOutputCloseCallback) (void * context);
|
| 111 |
+
#endif /* LIBXML_OUTPUT_ENABLED */
|
| 112 |
+
|
| 113 |
+
#ifdef __cplusplus
|
| 114 |
+
}
|
| 115 |
+
#endif
|
| 116 |
+
|
| 117 |
+
#include <libxml/globals.h>
|
| 118 |
+
#include <libxml/tree.h>
|
| 119 |
+
#include <libxml/parser.h>
|
| 120 |
+
#include <libxml/encoding.h>
|
| 121 |
+
|
| 122 |
+
#ifdef __cplusplus
|
| 123 |
+
extern "C" {
|
| 124 |
+
#endif
|
| 125 |
+
struct _xmlParserInputBuffer {
|
| 126 |
+
void* context;
|
| 127 |
+
xmlInputReadCallback readcallback;
|
| 128 |
+
xmlInputCloseCallback closecallback;
|
| 129 |
+
|
| 130 |
+
xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
|
| 131 |
+
|
| 132 |
+
xmlBufPtr buffer; /* Local buffer encoded in UTF-8 */
|
| 133 |
+
xmlBufPtr raw; /* if encoder != NULL buffer for raw input */
|
| 134 |
+
int compressed; /* -1=unknown, 0=not compressed, 1=compressed */
|
| 135 |
+
int error;
|
| 136 |
+
unsigned long rawconsumed;/* amount consumed from raw */
|
| 137 |
+
};
|
| 138 |
+
|
| 139 |
+
|
| 140 |
+
#ifdef LIBXML_OUTPUT_ENABLED
|
| 141 |
+
struct _xmlOutputBuffer {
|
| 142 |
+
void* context;
|
| 143 |
+
xmlOutputWriteCallback writecallback;
|
| 144 |
+
xmlOutputCloseCallback closecallback;
|
| 145 |
+
|
| 146 |
+
xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
|
| 147 |
+
|
| 148 |
+
xmlBufPtr buffer; /* Local buffer encoded in UTF-8 or ISOLatin */
|
| 149 |
+
xmlBufPtr conv; /* if encoder != NULL buffer for output */
|
| 150 |
+
int written; /* total number of byte written */
|
| 151 |
+
int error;
|
| 152 |
+
};
|
| 153 |
+
#endif /* LIBXML_OUTPUT_ENABLED */
|
| 154 |
+
|
| 155 |
+
/*
|
| 156 |
+
* Interfaces for input
|
| 157 |
+
*/
|
| 158 |
+
XMLPUBFUN void
|
| 159 |
+
xmlCleanupInputCallbacks (void);
|
| 160 |
+
|
| 161 |
+
XMLPUBFUN int
|
| 162 |
+
xmlPopInputCallbacks (void);
|
| 163 |
+
|
| 164 |
+
XMLPUBFUN void
|
| 165 |
+
xmlRegisterDefaultInputCallbacks (void);
|
| 166 |
+
XMLPUBFUN xmlParserInputBufferPtr
|
| 167 |
+
xmlAllocParserInputBuffer (xmlCharEncoding enc);
|
| 168 |
+
|
| 169 |
+
XMLPUBFUN xmlParserInputBufferPtr
|
| 170 |
+
xmlParserInputBufferCreateFilename (const char *URI,
|
| 171 |
+
xmlCharEncoding enc);
|
| 172 |
+
XMLPUBFUN xmlParserInputBufferPtr
|
| 173 |
+
xmlParserInputBufferCreateFile (FILE *file,
|
| 174 |
+
xmlCharEncoding enc);
|
| 175 |
+
XMLPUBFUN xmlParserInputBufferPtr
|
| 176 |
+
xmlParserInputBufferCreateFd (int fd,
|
| 177 |
+
xmlCharEncoding enc);
|
| 178 |
+
XMLPUBFUN xmlParserInputBufferPtr
|
| 179 |
+
xmlParserInputBufferCreateMem (const char *mem, int size,
|
| 180 |
+
xmlCharEncoding enc);
|
| 181 |
+
XML_DEPRECATED
|
| 182 |
+
XMLPUBFUN xmlParserInputBufferPtr
|
| 183 |
+
xmlParserInputBufferCreateStatic (const char *mem, int size,
|
| 184 |
+
xmlCharEncoding enc);
|
| 185 |
+
XMLPUBFUN xmlParserInputBufferPtr
|
| 186 |
+
xmlParserInputBufferCreateIO (xmlInputReadCallback ioread,
|
| 187 |
+
xmlInputCloseCallback ioclose,
|
| 188 |
+
void *ioctx,
|
| 189 |
+
xmlCharEncoding enc);
|
| 190 |
+
XMLPUBFUN int
|
| 191 |
+
xmlParserInputBufferRead (xmlParserInputBufferPtr in,
|
| 192 |
+
int len);
|
| 193 |
+
XMLPUBFUN int
|
| 194 |
+
xmlParserInputBufferGrow (xmlParserInputBufferPtr in,
|
| 195 |
+
int len);
|
| 196 |
+
XMLPUBFUN int
|
| 197 |
+
xmlParserInputBufferPush (xmlParserInputBufferPtr in,
|
| 198 |
+
int len,
|
| 199 |
+
const char *buf);
|
| 200 |
+
XMLPUBFUN void
|
| 201 |
+
xmlFreeParserInputBuffer (xmlParserInputBufferPtr in);
|
| 202 |
+
XMLPUBFUN char *
|
| 203 |
+
xmlParserGetDirectory (const char *filename);
|
| 204 |
+
|
| 205 |
+
XMLPUBFUN int
|
| 206 |
+
xmlRegisterInputCallbacks (xmlInputMatchCallback matchFunc,
|
| 207 |
+
xmlInputOpenCallback openFunc,
|
| 208 |
+
xmlInputReadCallback readFunc,
|
| 209 |
+
xmlInputCloseCallback closeFunc);
|
| 210 |
+
|
| 211 |
+
xmlParserInputBufferPtr
|
| 212 |
+
__xmlParserInputBufferCreateFilename(const char *URI,
|
| 213 |
+
xmlCharEncoding enc);
|
| 214 |
+
|
| 215 |
+
#ifdef LIBXML_OUTPUT_ENABLED
|
| 216 |
+
/*
|
| 217 |
+
* Interfaces for output
|
| 218 |
+
*/
|
| 219 |
+
XMLPUBFUN void
|
| 220 |
+
xmlCleanupOutputCallbacks (void);
|
| 221 |
+
XMLPUBFUN int
|
| 222 |
+
xmlPopOutputCallbacks (void);
|
| 223 |
+
XMLPUBFUN void
|
| 224 |
+
xmlRegisterDefaultOutputCallbacks(void);
|
| 225 |
+
XMLPUBFUN xmlOutputBufferPtr
|
| 226 |
+
xmlAllocOutputBuffer (xmlCharEncodingHandlerPtr encoder);
|
| 227 |
+
|
| 228 |
+
XMLPUBFUN xmlOutputBufferPtr
|
| 229 |
+
xmlOutputBufferCreateFilename (const char *URI,
|
| 230 |
+
xmlCharEncodingHandlerPtr encoder,
|
| 231 |
+
int compression);
|
| 232 |
+
|
| 233 |
+
XMLPUBFUN xmlOutputBufferPtr
|
| 234 |
+
xmlOutputBufferCreateFile (FILE *file,
|
| 235 |
+
xmlCharEncodingHandlerPtr encoder);
|
| 236 |
+
|
| 237 |
+
XMLPUBFUN xmlOutputBufferPtr
|
| 238 |
+
xmlOutputBufferCreateBuffer (xmlBufferPtr buffer,
|
| 239 |
+
xmlCharEncodingHandlerPtr encoder);
|
| 240 |
+
|
| 241 |
+
XMLPUBFUN xmlOutputBufferPtr
|
| 242 |
+
xmlOutputBufferCreateFd (int fd,
|
| 243 |
+
xmlCharEncodingHandlerPtr encoder);
|
| 244 |
+
|
| 245 |
+
XMLPUBFUN xmlOutputBufferPtr
|
| 246 |
+
xmlOutputBufferCreateIO (xmlOutputWriteCallback iowrite,
|
| 247 |
+
xmlOutputCloseCallback ioclose,
|
| 248 |
+
void *ioctx,
|
| 249 |
+
xmlCharEncodingHandlerPtr encoder);
|
| 250 |
+
|
| 251 |
+
/* Couple of APIs to get the output without digging into the buffers */
|
| 252 |
+
XMLPUBFUN const xmlChar *
|
| 253 |
+
xmlOutputBufferGetContent (xmlOutputBufferPtr out);
|
| 254 |
+
XMLPUBFUN size_t
|
| 255 |
+
xmlOutputBufferGetSize (xmlOutputBufferPtr out);
|
| 256 |
+
|
| 257 |
+
XMLPUBFUN int
|
| 258 |
+
xmlOutputBufferWrite (xmlOutputBufferPtr out,
|
| 259 |
+
int len,
|
| 260 |
+
const char *buf);
|
| 261 |
+
XMLPUBFUN int
|
| 262 |
+
xmlOutputBufferWriteString (xmlOutputBufferPtr out,
|
| 263 |
+
const char *str);
|
| 264 |
+
XMLPUBFUN int
|
| 265 |
+
xmlOutputBufferWriteEscape (xmlOutputBufferPtr out,
|
| 266 |
+
const xmlChar *str,
|
| 267 |
+
xmlCharEncodingOutputFunc escaping);
|
| 268 |
+
|
| 269 |
+
XMLPUBFUN int
|
| 270 |
+
xmlOutputBufferFlush (xmlOutputBufferPtr out);
|
| 271 |
+
XMLPUBFUN int
|
| 272 |
+
xmlOutputBufferClose (xmlOutputBufferPtr out);
|
| 273 |
+
|
| 274 |
+
XMLPUBFUN int
|
| 275 |
+
xmlRegisterOutputCallbacks (xmlOutputMatchCallback matchFunc,
|
| 276 |
+
xmlOutputOpenCallback openFunc,
|
| 277 |
+
xmlOutputWriteCallback writeFunc,
|
| 278 |
+
xmlOutputCloseCallback closeFunc);
|
| 279 |
+
|
| 280 |
+
xmlOutputBufferPtr
|
| 281 |
+
__xmlOutputBufferCreateFilename(const char *URI,
|
| 282 |
+
xmlCharEncodingHandlerPtr encoder,
|
| 283 |
+
int compression);
|
| 284 |
+
|
| 285 |
+
#ifdef LIBXML_HTTP_ENABLED
|
| 286 |
+
/* This function only exists if HTTP support built into the library */
|
| 287 |
+
XMLPUBFUN void
|
| 288 |
+
xmlRegisterHTTPPostCallbacks (void );
|
| 289 |
+
#endif /* LIBXML_HTTP_ENABLED */
|
| 290 |
+
|
| 291 |
+
#endif /* LIBXML_OUTPUT_ENABLED */
|
| 292 |
+
|
| 293 |
+
XMLPUBFUN xmlParserInputPtr
|
| 294 |
+
xmlCheckHTTPInput (xmlParserCtxtPtr ctxt,
|
| 295 |
+
xmlParserInputPtr ret);
|
| 296 |
+
|
| 297 |
+
/*
|
| 298 |
+
* A predefined entity loader disabling network accesses
|
| 299 |
+
*/
|
| 300 |
+
XMLPUBFUN xmlParserInputPtr
|
| 301 |
+
xmlNoNetExternalEntityLoader (const char *URL,
|
| 302 |
+
const char *ID,
|
| 303 |
+
xmlParserCtxtPtr ctxt);
|
| 304 |
+
|
| 305 |
+
/*
|
| 306 |
+
* xmlNormalizeWindowsPath is obsolete, don't use it.
|
| 307 |
+
* Check xmlCanonicPath in uri.h for a better alternative.
|
| 308 |
+
*/
|
| 309 |
+
XMLPUBFUN xmlChar *
|
| 310 |
+
xmlNormalizeWindowsPath (const xmlChar *path);
|
| 311 |
+
|
| 312 |
+
XMLPUBFUN int
|
| 313 |
+
xmlCheckFilename (const char *path);
|
| 314 |
+
/**
|
| 315 |
+
* Default 'file://' protocol callbacks
|
| 316 |
+
*/
|
| 317 |
+
XMLPUBFUN int
|
| 318 |
+
xmlFileMatch (const char *filename);
|
| 319 |
+
XMLPUBFUN void *
|
| 320 |
+
xmlFileOpen (const char *filename);
|
| 321 |
+
XMLPUBFUN int
|
| 322 |
+
xmlFileRead (void * context,
|
| 323 |
+
char * buffer,
|
| 324 |
+
int len);
|
| 325 |
+
XMLPUBFUN int
|
| 326 |
+
xmlFileClose (void * context);
|
| 327 |
+
|
| 328 |
+
/**
|
| 329 |
+
* Default 'http://' protocol callbacks
|
| 330 |
+
*/
|
| 331 |
+
#ifdef LIBXML_HTTP_ENABLED
|
| 332 |
+
XMLPUBFUN int
|
| 333 |
+
xmlIOHTTPMatch (const char *filename);
|
| 334 |
+
XMLPUBFUN void *
|
| 335 |
+
xmlIOHTTPOpen (const char *filename);
|
| 336 |
+
#ifdef LIBXML_OUTPUT_ENABLED
|
| 337 |
+
XMLPUBFUN void *
|
| 338 |
+
xmlIOHTTPOpenW (const char * post_uri,
|
| 339 |
+
int compression );
|
| 340 |
+
#endif /* LIBXML_OUTPUT_ENABLED */
|
| 341 |
+
XMLPUBFUN int
|
| 342 |
+
xmlIOHTTPRead (void * context,
|
| 343 |
+
char * buffer,
|
| 344 |
+
int len);
|
| 345 |
+
XMLPUBFUN int
|
| 346 |
+
xmlIOHTTPClose (void * context);
|
| 347 |
+
#endif /* LIBXML_HTTP_ENABLED */
|
| 348 |
+
|
| 349 |
+
/**
|
| 350 |
+
* Default 'ftp://' protocol callbacks
|
| 351 |
+
*/
|
| 352 |
+
#ifdef LIBXML_FTP_ENABLED
|
| 353 |
+
XMLPUBFUN int
|
| 354 |
+
xmlIOFTPMatch (const char *filename);
|
| 355 |
+
XMLPUBFUN void *
|
| 356 |
+
xmlIOFTPOpen (const char *filename);
|
| 357 |
+
XMLPUBFUN int
|
| 358 |
+
xmlIOFTPRead (void * context,
|
| 359 |
+
char * buffer,
|
| 360 |
+
int len);
|
| 361 |
+
XMLPUBFUN int
|
| 362 |
+
xmlIOFTPClose (void * context);
|
| 363 |
+
#endif /* LIBXML_FTP_ENABLED */
|
| 364 |
+
|
| 365 |
+
#ifdef __cplusplus
|
| 366 |
+
}
|
| 367 |
+
#endif
|
| 368 |
+
|
| 369 |
+
#endif /* __XML_IO_H__ */
|
pgsql/include/libxml/xmlautomata.h
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: API to build regexp automata
|
| 3 |
+
* Description: the API to build regexp automata
|
| 4 |
+
*
|
| 5 |
+
* Copy: See Copyright for the status of this software.
|
| 6 |
+
*
|
| 7 |
+
* Author: Daniel Veillard
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef __XML_AUTOMATA_H__
|
| 11 |
+
#define __XML_AUTOMATA_H__
|
| 12 |
+
|
| 13 |
+
#include <libxml/xmlversion.h>
|
| 14 |
+
|
| 15 |
+
#ifdef LIBXML_REGEXP_ENABLED
|
| 16 |
+
#ifdef LIBXML_AUTOMATA_ENABLED
|
| 17 |
+
|
| 18 |
+
#include <libxml/xmlstring.h>
|
| 19 |
+
|
| 20 |
+
#ifdef __cplusplus
|
| 21 |
+
extern "C" {
|
| 22 |
+
#endif
|
| 23 |
+
|
| 24 |
+
/**
|
| 25 |
+
* xmlAutomataPtr:
|
| 26 |
+
*
|
| 27 |
+
* A libxml automata description, It can be compiled into a regexp
|
| 28 |
+
*/
|
| 29 |
+
typedef struct _xmlAutomata xmlAutomata;
|
| 30 |
+
typedef xmlAutomata *xmlAutomataPtr;
|
| 31 |
+
|
| 32 |
+
/**
|
| 33 |
+
* xmlAutomataStatePtr:
|
| 34 |
+
*
|
| 35 |
+
* A state int the automata description,
|
| 36 |
+
*/
|
| 37 |
+
typedef struct _xmlAutomataState xmlAutomataState;
|
| 38 |
+
typedef xmlAutomataState *xmlAutomataStatePtr;
|
| 39 |
+
|
| 40 |
+
/*
|
| 41 |
+
* Building API
|
| 42 |
+
*/
|
| 43 |
+
XMLPUBFUN xmlAutomataPtr
|
| 44 |
+
xmlNewAutomata (void);
|
| 45 |
+
XMLPUBFUN void
|
| 46 |
+
xmlFreeAutomata (xmlAutomataPtr am);
|
| 47 |
+
|
| 48 |
+
XMLPUBFUN xmlAutomataStatePtr
|
| 49 |
+
xmlAutomataGetInitState (xmlAutomataPtr am);
|
| 50 |
+
XMLPUBFUN int
|
| 51 |
+
xmlAutomataSetFinalState (xmlAutomataPtr am,
|
| 52 |
+
xmlAutomataStatePtr state);
|
| 53 |
+
XMLPUBFUN xmlAutomataStatePtr
|
| 54 |
+
xmlAutomataNewState (xmlAutomataPtr am);
|
| 55 |
+
XMLPUBFUN xmlAutomataStatePtr
|
| 56 |
+
xmlAutomataNewTransition (xmlAutomataPtr am,
|
| 57 |
+
xmlAutomataStatePtr from,
|
| 58 |
+
xmlAutomataStatePtr to,
|
| 59 |
+
const xmlChar *token,
|
| 60 |
+
void *data);
|
| 61 |
+
XMLPUBFUN xmlAutomataStatePtr
|
| 62 |
+
xmlAutomataNewTransition2 (xmlAutomataPtr am,
|
| 63 |
+
xmlAutomataStatePtr from,
|
| 64 |
+
xmlAutomataStatePtr to,
|
| 65 |
+
const xmlChar *token,
|
| 66 |
+
const xmlChar *token2,
|
| 67 |
+
void *data);
|
| 68 |
+
XMLPUBFUN xmlAutomataStatePtr
|
| 69 |
+
xmlAutomataNewNegTrans (xmlAutomataPtr am,
|
| 70 |
+
xmlAutomataStatePtr from,
|
| 71 |
+
xmlAutomataStatePtr to,
|
| 72 |
+
const xmlChar *token,
|
| 73 |
+
const xmlChar *token2,
|
| 74 |
+
void *data);
|
| 75 |
+
|
| 76 |
+
XMLPUBFUN xmlAutomataStatePtr
|
| 77 |
+
xmlAutomataNewCountTrans (xmlAutomataPtr am,
|
| 78 |
+
xmlAutomataStatePtr from,
|
| 79 |
+
xmlAutomataStatePtr to,
|
| 80 |
+
const xmlChar *token,
|
| 81 |
+
int min,
|
| 82 |
+
int max,
|
| 83 |
+
void *data);
|
| 84 |
+
XMLPUBFUN xmlAutomataStatePtr
|
| 85 |
+
xmlAutomataNewCountTrans2 (xmlAutomataPtr am,
|
| 86 |
+
xmlAutomataStatePtr from,
|
| 87 |
+
xmlAutomataStatePtr to,
|
| 88 |
+
const xmlChar *token,
|
| 89 |
+
const xmlChar *token2,
|
| 90 |
+
int min,
|
| 91 |
+
int max,
|
| 92 |
+
void *data);
|
| 93 |
+
XMLPUBFUN xmlAutomataStatePtr
|
| 94 |
+
xmlAutomataNewOnceTrans (xmlAutomataPtr am,
|
| 95 |
+
xmlAutomataStatePtr from,
|
| 96 |
+
xmlAutomataStatePtr to,
|
| 97 |
+
const xmlChar *token,
|
| 98 |
+
int min,
|
| 99 |
+
int max,
|
| 100 |
+
void *data);
|
| 101 |
+
XMLPUBFUN xmlAutomataStatePtr
|
| 102 |
+
xmlAutomataNewOnceTrans2 (xmlAutomataPtr am,
|
| 103 |
+
xmlAutomataStatePtr from,
|
| 104 |
+
xmlAutomataStatePtr to,
|
| 105 |
+
const xmlChar *token,
|
| 106 |
+
const xmlChar *token2,
|
| 107 |
+
int min,
|
| 108 |
+
int max,
|
| 109 |
+
void *data);
|
| 110 |
+
XMLPUBFUN xmlAutomataStatePtr
|
| 111 |
+
xmlAutomataNewAllTrans (xmlAutomataPtr am,
|
| 112 |
+
xmlAutomataStatePtr from,
|
| 113 |
+
xmlAutomataStatePtr to,
|
| 114 |
+
int lax);
|
| 115 |
+
XMLPUBFUN xmlAutomataStatePtr
|
| 116 |
+
xmlAutomataNewEpsilon (xmlAutomataPtr am,
|
| 117 |
+
xmlAutomataStatePtr from,
|
| 118 |
+
xmlAutomataStatePtr to);
|
| 119 |
+
XMLPUBFUN xmlAutomataStatePtr
|
| 120 |
+
xmlAutomataNewCountedTrans (xmlAutomataPtr am,
|
| 121 |
+
xmlAutomataStatePtr from,
|
| 122 |
+
xmlAutomataStatePtr to,
|
| 123 |
+
int counter);
|
| 124 |
+
XMLPUBFUN xmlAutomataStatePtr
|
| 125 |
+
xmlAutomataNewCounterTrans (xmlAutomataPtr am,
|
| 126 |
+
xmlAutomataStatePtr from,
|
| 127 |
+
xmlAutomataStatePtr to,
|
| 128 |
+
int counter);
|
| 129 |
+
XMLPUBFUN int
|
| 130 |
+
xmlAutomataNewCounter (xmlAutomataPtr am,
|
| 131 |
+
int min,
|
| 132 |
+
int max);
|
| 133 |
+
|
| 134 |
+
XMLPUBFUN struct _xmlRegexp *
|
| 135 |
+
xmlAutomataCompile (xmlAutomataPtr am);
|
| 136 |
+
XMLPUBFUN int
|
| 137 |
+
xmlAutomataIsDeterminist (xmlAutomataPtr am);
|
| 138 |
+
|
| 139 |
+
#ifdef __cplusplus
|
| 140 |
+
}
|
| 141 |
+
#endif
|
| 142 |
+
|
| 143 |
+
#endif /* LIBXML_AUTOMATA_ENABLED */
|
| 144 |
+
#endif /* LIBXML_REGEXP_ENABLED */
|
| 145 |
+
|
| 146 |
+
#endif /* __XML_AUTOMATA_H__ */
|
pgsql/include/libxml/xmlerror.h
ADDED
|
@@ -0,0 +1,919 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: error handling
|
| 3 |
+
* Description: the API used to report errors
|
| 4 |
+
*
|
| 5 |
+
* Copy: See Copyright for the status of this software.
|
| 6 |
+
*
|
| 7 |
+
* Author: Daniel Veillard
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#include <libxml/parser.h>
|
| 11 |
+
|
| 12 |
+
#ifndef __XML_ERROR_H__
|
| 13 |
+
#define __XML_ERROR_H__
|
| 14 |
+
|
| 15 |
+
#ifdef __cplusplus
|
| 16 |
+
extern "C" {
|
| 17 |
+
#endif
|
| 18 |
+
|
| 19 |
+
/**
|
| 20 |
+
* xmlErrorLevel:
|
| 21 |
+
*
|
| 22 |
+
* Indicates the level of an error
|
| 23 |
+
*/
|
| 24 |
+
typedef enum {
|
| 25 |
+
XML_ERR_NONE = 0,
|
| 26 |
+
XML_ERR_WARNING = 1, /* A simple warning */
|
| 27 |
+
XML_ERR_ERROR = 2, /* A recoverable error */
|
| 28 |
+
XML_ERR_FATAL = 3 /* A fatal error */
|
| 29 |
+
} xmlErrorLevel;
|
| 30 |
+
|
| 31 |
+
/**
|
| 32 |
+
* xmlErrorDomain:
|
| 33 |
+
*
|
| 34 |
+
* Indicates where an error may have come from
|
| 35 |
+
*/
|
| 36 |
+
typedef enum {
|
| 37 |
+
XML_FROM_NONE = 0,
|
| 38 |
+
XML_FROM_PARSER, /* The XML parser */
|
| 39 |
+
XML_FROM_TREE, /* The tree module */
|
| 40 |
+
XML_FROM_NAMESPACE, /* The XML Namespace module */
|
| 41 |
+
XML_FROM_DTD, /* The XML DTD validation with parser context*/
|
| 42 |
+
XML_FROM_HTML, /* The HTML parser */
|
| 43 |
+
XML_FROM_MEMORY, /* The memory allocator */
|
| 44 |
+
XML_FROM_OUTPUT, /* The serialization code */
|
| 45 |
+
XML_FROM_IO, /* The Input/Output stack */
|
| 46 |
+
XML_FROM_FTP, /* The FTP module */
|
| 47 |
+
XML_FROM_HTTP, /* The HTTP module */
|
| 48 |
+
XML_FROM_XINCLUDE, /* The XInclude processing */
|
| 49 |
+
XML_FROM_XPATH, /* The XPath module */
|
| 50 |
+
XML_FROM_XPOINTER, /* The XPointer module */
|
| 51 |
+
XML_FROM_REGEXP, /* The regular expressions module */
|
| 52 |
+
XML_FROM_DATATYPE, /* The W3C XML Schemas Datatype module */
|
| 53 |
+
XML_FROM_SCHEMASP, /* The W3C XML Schemas parser module */
|
| 54 |
+
XML_FROM_SCHEMASV, /* The W3C XML Schemas validation module */
|
| 55 |
+
XML_FROM_RELAXNGP, /* The Relax-NG parser module */
|
| 56 |
+
XML_FROM_RELAXNGV, /* The Relax-NG validator module */
|
| 57 |
+
XML_FROM_CATALOG, /* The Catalog module */
|
| 58 |
+
XML_FROM_C14N, /* The Canonicalization module */
|
| 59 |
+
XML_FROM_XSLT, /* The XSLT engine from libxslt */
|
| 60 |
+
XML_FROM_VALID, /* The XML DTD validation with valid context */
|
| 61 |
+
XML_FROM_CHECK, /* The error checking module */
|
| 62 |
+
XML_FROM_WRITER, /* The xmlwriter module */
|
| 63 |
+
XML_FROM_MODULE, /* The dynamically loaded module module*/
|
| 64 |
+
XML_FROM_I18N, /* The module handling character conversion */
|
| 65 |
+
XML_FROM_SCHEMATRONV,/* The Schematron validator module */
|
| 66 |
+
XML_FROM_BUFFER, /* The buffers module */
|
| 67 |
+
XML_FROM_URI /* The URI module */
|
| 68 |
+
} xmlErrorDomain;
|
| 69 |
+
|
| 70 |
+
/**
|
| 71 |
+
* xmlError:
|
| 72 |
+
*
|
| 73 |
+
* An XML Error instance.
|
| 74 |
+
*/
|
| 75 |
+
|
| 76 |
+
typedef struct _xmlError xmlError;
|
| 77 |
+
typedef xmlError *xmlErrorPtr;
|
| 78 |
+
struct _xmlError {
|
| 79 |
+
int domain; /* What part of the library raised this error */
|
| 80 |
+
int code; /* The error code, e.g. an xmlParserError */
|
| 81 |
+
char *message;/* human-readable informative error message */
|
| 82 |
+
xmlErrorLevel level;/* how consequent is the error */
|
| 83 |
+
char *file; /* the filename */
|
| 84 |
+
int line; /* the line number if available */
|
| 85 |
+
char *str1; /* extra string information */
|
| 86 |
+
char *str2; /* extra string information */
|
| 87 |
+
char *str3; /* extra string information */
|
| 88 |
+
int int1; /* extra number information */
|
| 89 |
+
int int2; /* error column # or 0 if N/A (todo: rename field when we would brk ABI) */
|
| 90 |
+
void *ctxt; /* the parser context if available */
|
| 91 |
+
void *node; /* the node in the tree */
|
| 92 |
+
};
|
| 93 |
+
|
| 94 |
+
/**
|
| 95 |
+
* xmlParserError:
|
| 96 |
+
*
|
| 97 |
+
* This is an error that the XML (or HTML) parser can generate
|
| 98 |
+
*/
|
| 99 |
+
typedef enum {
|
| 100 |
+
XML_ERR_OK = 0,
|
| 101 |
+
XML_ERR_INTERNAL_ERROR, /* 1 */
|
| 102 |
+
XML_ERR_NO_MEMORY, /* 2 */
|
| 103 |
+
XML_ERR_DOCUMENT_START, /* 3 */
|
| 104 |
+
XML_ERR_DOCUMENT_EMPTY, /* 4 */
|
| 105 |
+
XML_ERR_DOCUMENT_END, /* 5 */
|
| 106 |
+
XML_ERR_INVALID_HEX_CHARREF, /* 6 */
|
| 107 |
+
XML_ERR_INVALID_DEC_CHARREF, /* 7 */
|
| 108 |
+
XML_ERR_INVALID_CHARREF, /* 8 */
|
| 109 |
+
XML_ERR_INVALID_CHAR, /* 9 */
|
| 110 |
+
XML_ERR_CHARREF_AT_EOF, /* 10 */
|
| 111 |
+
XML_ERR_CHARREF_IN_PROLOG, /* 11 */
|
| 112 |
+
XML_ERR_CHARREF_IN_EPILOG, /* 12 */
|
| 113 |
+
XML_ERR_CHARREF_IN_DTD, /* 13 */
|
| 114 |
+
XML_ERR_ENTITYREF_AT_EOF, /* 14 */
|
| 115 |
+
XML_ERR_ENTITYREF_IN_PROLOG, /* 15 */
|
| 116 |
+
XML_ERR_ENTITYREF_IN_EPILOG, /* 16 */
|
| 117 |
+
XML_ERR_ENTITYREF_IN_DTD, /* 17 */
|
| 118 |
+
XML_ERR_PEREF_AT_EOF, /* 18 */
|
| 119 |
+
XML_ERR_PEREF_IN_PROLOG, /* 19 */
|
| 120 |
+
XML_ERR_PEREF_IN_EPILOG, /* 20 */
|
| 121 |
+
XML_ERR_PEREF_IN_INT_SUBSET, /* 21 */
|
| 122 |
+
XML_ERR_ENTITYREF_NO_NAME, /* 22 */
|
| 123 |
+
XML_ERR_ENTITYREF_SEMICOL_MISSING, /* 23 */
|
| 124 |
+
XML_ERR_PEREF_NO_NAME, /* 24 */
|
| 125 |
+
XML_ERR_PEREF_SEMICOL_MISSING, /* 25 */
|
| 126 |
+
XML_ERR_UNDECLARED_ENTITY, /* 26 */
|
| 127 |
+
XML_WAR_UNDECLARED_ENTITY, /* 27 */
|
| 128 |
+
XML_ERR_UNPARSED_ENTITY, /* 28 */
|
| 129 |
+
XML_ERR_ENTITY_IS_EXTERNAL, /* 29 */
|
| 130 |
+
XML_ERR_ENTITY_IS_PARAMETER, /* 30 */
|
| 131 |
+
XML_ERR_UNKNOWN_ENCODING, /* 31 */
|
| 132 |
+
XML_ERR_UNSUPPORTED_ENCODING, /* 32 */
|
| 133 |
+
XML_ERR_STRING_NOT_STARTED, /* 33 */
|
| 134 |
+
XML_ERR_STRING_NOT_CLOSED, /* 34 */
|
| 135 |
+
XML_ERR_NS_DECL_ERROR, /* 35 */
|
| 136 |
+
XML_ERR_ENTITY_NOT_STARTED, /* 36 */
|
| 137 |
+
XML_ERR_ENTITY_NOT_FINISHED, /* 37 */
|
| 138 |
+
XML_ERR_LT_IN_ATTRIBUTE, /* 38 */
|
| 139 |
+
XML_ERR_ATTRIBUTE_NOT_STARTED, /* 39 */
|
| 140 |
+
XML_ERR_ATTRIBUTE_NOT_FINISHED, /* 40 */
|
| 141 |
+
XML_ERR_ATTRIBUTE_WITHOUT_VALUE, /* 41 */
|
| 142 |
+
XML_ERR_ATTRIBUTE_REDEFINED, /* 42 */
|
| 143 |
+
XML_ERR_LITERAL_NOT_STARTED, /* 43 */
|
| 144 |
+
XML_ERR_LITERAL_NOT_FINISHED, /* 44 */
|
| 145 |
+
XML_ERR_COMMENT_NOT_FINISHED, /* 45 */
|
| 146 |
+
XML_ERR_PI_NOT_STARTED, /* 46 */
|
| 147 |
+
XML_ERR_PI_NOT_FINISHED, /* 47 */
|
| 148 |
+
XML_ERR_NOTATION_NOT_STARTED, /* 48 */
|
| 149 |
+
XML_ERR_NOTATION_NOT_FINISHED, /* 49 */
|
| 150 |
+
XML_ERR_ATTLIST_NOT_STARTED, /* 50 */
|
| 151 |
+
XML_ERR_ATTLIST_NOT_FINISHED, /* 51 */
|
| 152 |
+
XML_ERR_MIXED_NOT_STARTED, /* 52 */
|
| 153 |
+
XML_ERR_MIXED_NOT_FINISHED, /* 53 */
|
| 154 |
+
XML_ERR_ELEMCONTENT_NOT_STARTED, /* 54 */
|
| 155 |
+
XML_ERR_ELEMCONTENT_NOT_FINISHED, /* 55 */
|
| 156 |
+
XML_ERR_XMLDECL_NOT_STARTED, /* 56 */
|
| 157 |
+
XML_ERR_XMLDECL_NOT_FINISHED, /* 57 */
|
| 158 |
+
XML_ERR_CONDSEC_NOT_STARTED, /* 58 */
|
| 159 |
+
XML_ERR_CONDSEC_NOT_FINISHED, /* 59 */
|
| 160 |
+
XML_ERR_EXT_SUBSET_NOT_FINISHED, /* 60 */
|
| 161 |
+
XML_ERR_DOCTYPE_NOT_FINISHED, /* 61 */
|
| 162 |
+
XML_ERR_MISPLACED_CDATA_END, /* 62 */
|
| 163 |
+
XML_ERR_CDATA_NOT_FINISHED, /* 63 */
|
| 164 |
+
XML_ERR_RESERVED_XML_NAME, /* 64 */
|
| 165 |
+
XML_ERR_SPACE_REQUIRED, /* 65 */
|
| 166 |
+
XML_ERR_SEPARATOR_REQUIRED, /* 66 */
|
| 167 |
+
XML_ERR_NMTOKEN_REQUIRED, /* 67 */
|
| 168 |
+
XML_ERR_NAME_REQUIRED, /* 68 */
|
| 169 |
+
XML_ERR_PCDATA_REQUIRED, /* 69 */
|
| 170 |
+
XML_ERR_URI_REQUIRED, /* 70 */
|
| 171 |
+
XML_ERR_PUBID_REQUIRED, /* 71 */
|
| 172 |
+
XML_ERR_LT_REQUIRED, /* 72 */
|
| 173 |
+
XML_ERR_GT_REQUIRED, /* 73 */
|
| 174 |
+
XML_ERR_LTSLASH_REQUIRED, /* 74 */
|
| 175 |
+
XML_ERR_EQUAL_REQUIRED, /* 75 */
|
| 176 |
+
XML_ERR_TAG_NAME_MISMATCH, /* 76 */
|
| 177 |
+
XML_ERR_TAG_NOT_FINISHED, /* 77 */
|
| 178 |
+
XML_ERR_STANDALONE_VALUE, /* 78 */
|
| 179 |
+
XML_ERR_ENCODING_NAME, /* 79 */
|
| 180 |
+
XML_ERR_HYPHEN_IN_COMMENT, /* 80 */
|
| 181 |
+
XML_ERR_INVALID_ENCODING, /* 81 */
|
| 182 |
+
XML_ERR_EXT_ENTITY_STANDALONE, /* 82 */
|
| 183 |
+
XML_ERR_CONDSEC_INVALID, /* 83 */
|
| 184 |
+
XML_ERR_VALUE_REQUIRED, /* 84 */
|
| 185 |
+
XML_ERR_NOT_WELL_BALANCED, /* 85 */
|
| 186 |
+
XML_ERR_EXTRA_CONTENT, /* 86 */
|
| 187 |
+
XML_ERR_ENTITY_CHAR_ERROR, /* 87 */
|
| 188 |
+
XML_ERR_ENTITY_PE_INTERNAL, /* 88 */
|
| 189 |
+
XML_ERR_ENTITY_LOOP, /* 89 */
|
| 190 |
+
XML_ERR_ENTITY_BOUNDARY, /* 90 */
|
| 191 |
+
XML_ERR_INVALID_URI, /* 91 */
|
| 192 |
+
XML_ERR_URI_FRAGMENT, /* 92 */
|
| 193 |
+
XML_WAR_CATALOG_PI, /* 93 */
|
| 194 |
+
XML_ERR_NO_DTD, /* 94 */
|
| 195 |
+
XML_ERR_CONDSEC_INVALID_KEYWORD, /* 95 */
|
| 196 |
+
XML_ERR_VERSION_MISSING, /* 96 */
|
| 197 |
+
XML_WAR_UNKNOWN_VERSION, /* 97 */
|
| 198 |
+
XML_WAR_LANG_VALUE, /* 98 */
|
| 199 |
+
XML_WAR_NS_URI, /* 99 */
|
| 200 |
+
XML_WAR_NS_URI_RELATIVE, /* 100 */
|
| 201 |
+
XML_ERR_MISSING_ENCODING, /* 101 */
|
| 202 |
+
XML_WAR_SPACE_VALUE, /* 102 */
|
| 203 |
+
XML_ERR_NOT_STANDALONE, /* 103 */
|
| 204 |
+
XML_ERR_ENTITY_PROCESSING, /* 104 */
|
| 205 |
+
XML_ERR_NOTATION_PROCESSING, /* 105 */
|
| 206 |
+
XML_WAR_NS_COLUMN, /* 106 */
|
| 207 |
+
XML_WAR_ENTITY_REDEFINED, /* 107 */
|
| 208 |
+
XML_ERR_UNKNOWN_VERSION, /* 108 */
|
| 209 |
+
XML_ERR_VERSION_MISMATCH, /* 109 */
|
| 210 |
+
XML_ERR_NAME_TOO_LONG, /* 110 */
|
| 211 |
+
XML_ERR_USER_STOP, /* 111 */
|
| 212 |
+
XML_ERR_COMMENT_ABRUPTLY_ENDED, /* 112 */
|
| 213 |
+
XML_NS_ERR_XML_NAMESPACE = 200,
|
| 214 |
+
XML_NS_ERR_UNDEFINED_NAMESPACE, /* 201 */
|
| 215 |
+
XML_NS_ERR_QNAME, /* 202 */
|
| 216 |
+
XML_NS_ERR_ATTRIBUTE_REDEFINED, /* 203 */
|
| 217 |
+
XML_NS_ERR_EMPTY, /* 204 */
|
| 218 |
+
XML_NS_ERR_COLON, /* 205 */
|
| 219 |
+
XML_DTD_ATTRIBUTE_DEFAULT = 500,
|
| 220 |
+
XML_DTD_ATTRIBUTE_REDEFINED, /* 501 */
|
| 221 |
+
XML_DTD_ATTRIBUTE_VALUE, /* 502 */
|
| 222 |
+
XML_DTD_CONTENT_ERROR, /* 503 */
|
| 223 |
+
XML_DTD_CONTENT_MODEL, /* 504 */
|
| 224 |
+
XML_DTD_CONTENT_NOT_DETERMINIST, /* 505 */
|
| 225 |
+
XML_DTD_DIFFERENT_PREFIX, /* 506 */
|
| 226 |
+
XML_DTD_ELEM_DEFAULT_NAMESPACE, /* 507 */
|
| 227 |
+
XML_DTD_ELEM_NAMESPACE, /* 508 */
|
| 228 |
+
XML_DTD_ELEM_REDEFINED, /* 509 */
|
| 229 |
+
XML_DTD_EMPTY_NOTATION, /* 510 */
|
| 230 |
+
XML_DTD_ENTITY_TYPE, /* 511 */
|
| 231 |
+
XML_DTD_ID_FIXED, /* 512 */
|
| 232 |
+
XML_DTD_ID_REDEFINED, /* 513 */
|
| 233 |
+
XML_DTD_ID_SUBSET, /* 514 */
|
| 234 |
+
XML_DTD_INVALID_CHILD, /* 515 */
|
| 235 |
+
XML_DTD_INVALID_DEFAULT, /* 516 */
|
| 236 |
+
XML_DTD_LOAD_ERROR, /* 517 */
|
| 237 |
+
XML_DTD_MISSING_ATTRIBUTE, /* 518 */
|
| 238 |
+
XML_DTD_MIXED_CORRUPT, /* 519 */
|
| 239 |
+
XML_DTD_MULTIPLE_ID, /* 520 */
|
| 240 |
+
XML_DTD_NO_DOC, /* 521 */
|
| 241 |
+
XML_DTD_NO_DTD, /* 522 */
|
| 242 |
+
XML_DTD_NO_ELEM_NAME, /* 523 */
|
| 243 |
+
XML_DTD_NO_PREFIX, /* 524 */
|
| 244 |
+
XML_DTD_NO_ROOT, /* 525 */
|
| 245 |
+
XML_DTD_NOTATION_REDEFINED, /* 526 */
|
| 246 |
+
XML_DTD_NOTATION_VALUE, /* 527 */
|
| 247 |
+
XML_DTD_NOT_EMPTY, /* 528 */
|
| 248 |
+
XML_DTD_NOT_PCDATA, /* 529 */
|
| 249 |
+
XML_DTD_NOT_STANDALONE, /* 530 */
|
| 250 |
+
XML_DTD_ROOT_NAME, /* 531 */
|
| 251 |
+
XML_DTD_STANDALONE_WHITE_SPACE, /* 532 */
|
| 252 |
+
XML_DTD_UNKNOWN_ATTRIBUTE, /* 533 */
|
| 253 |
+
XML_DTD_UNKNOWN_ELEM, /* 534 */
|
| 254 |
+
XML_DTD_UNKNOWN_ENTITY, /* 535 */
|
| 255 |
+
XML_DTD_UNKNOWN_ID, /* 536 */
|
| 256 |
+
XML_DTD_UNKNOWN_NOTATION, /* 537 */
|
| 257 |
+
XML_DTD_STANDALONE_DEFAULTED, /* 538 */
|
| 258 |
+
XML_DTD_XMLID_VALUE, /* 539 */
|
| 259 |
+
XML_DTD_XMLID_TYPE, /* 540 */
|
| 260 |
+
XML_DTD_DUP_TOKEN, /* 541 */
|
| 261 |
+
XML_HTML_STRUCURE_ERROR = 800,
|
| 262 |
+
XML_HTML_UNKNOWN_TAG, /* 801 */
|
| 263 |
+
XML_HTML_INCORRECTLY_OPENED_COMMENT, /* 802 */
|
| 264 |
+
XML_RNGP_ANYNAME_ATTR_ANCESTOR = 1000,
|
| 265 |
+
XML_RNGP_ATTR_CONFLICT, /* 1001 */
|
| 266 |
+
XML_RNGP_ATTRIBUTE_CHILDREN, /* 1002 */
|
| 267 |
+
XML_RNGP_ATTRIBUTE_CONTENT, /* 1003 */
|
| 268 |
+
XML_RNGP_ATTRIBUTE_EMPTY, /* 1004 */
|
| 269 |
+
XML_RNGP_ATTRIBUTE_NOOP, /* 1005 */
|
| 270 |
+
XML_RNGP_CHOICE_CONTENT, /* 1006 */
|
| 271 |
+
XML_RNGP_CHOICE_EMPTY, /* 1007 */
|
| 272 |
+
XML_RNGP_CREATE_FAILURE, /* 1008 */
|
| 273 |
+
XML_RNGP_DATA_CONTENT, /* 1009 */
|
| 274 |
+
XML_RNGP_DEF_CHOICE_AND_INTERLEAVE, /* 1010 */
|
| 275 |
+
XML_RNGP_DEFINE_CREATE_FAILED, /* 1011 */
|
| 276 |
+
XML_RNGP_DEFINE_EMPTY, /* 1012 */
|
| 277 |
+
XML_RNGP_DEFINE_MISSING, /* 1013 */
|
| 278 |
+
XML_RNGP_DEFINE_NAME_MISSING, /* 1014 */
|
| 279 |
+
XML_RNGP_ELEM_CONTENT_EMPTY, /* 1015 */
|
| 280 |
+
XML_RNGP_ELEM_CONTENT_ERROR, /* 1016 */
|
| 281 |
+
XML_RNGP_ELEMENT_EMPTY, /* 1017 */
|
| 282 |
+
XML_RNGP_ELEMENT_CONTENT, /* 1018 */
|
| 283 |
+
XML_RNGP_ELEMENT_NAME, /* 1019 */
|
| 284 |
+
XML_RNGP_ELEMENT_NO_CONTENT, /* 1020 */
|
| 285 |
+
XML_RNGP_ELEM_TEXT_CONFLICT, /* 1021 */
|
| 286 |
+
XML_RNGP_EMPTY, /* 1022 */
|
| 287 |
+
XML_RNGP_EMPTY_CONSTRUCT, /* 1023 */
|
| 288 |
+
XML_RNGP_EMPTY_CONTENT, /* 1024 */
|
| 289 |
+
XML_RNGP_EMPTY_NOT_EMPTY, /* 1025 */
|
| 290 |
+
XML_RNGP_ERROR_TYPE_LIB, /* 1026 */
|
| 291 |
+
XML_RNGP_EXCEPT_EMPTY, /* 1027 */
|
| 292 |
+
XML_RNGP_EXCEPT_MISSING, /* 1028 */
|
| 293 |
+
XML_RNGP_EXCEPT_MULTIPLE, /* 1029 */
|
| 294 |
+
XML_RNGP_EXCEPT_NO_CONTENT, /* 1030 */
|
| 295 |
+
XML_RNGP_EXTERNALREF_EMTPY, /* 1031 */
|
| 296 |
+
XML_RNGP_EXTERNAL_REF_FAILURE, /* 1032 */
|
| 297 |
+
XML_RNGP_EXTERNALREF_RECURSE, /* 1033 */
|
| 298 |
+
XML_RNGP_FORBIDDEN_ATTRIBUTE, /* 1034 */
|
| 299 |
+
XML_RNGP_FOREIGN_ELEMENT, /* 1035 */
|
| 300 |
+
XML_RNGP_GRAMMAR_CONTENT, /* 1036 */
|
| 301 |
+
XML_RNGP_GRAMMAR_EMPTY, /* 1037 */
|
| 302 |
+
XML_RNGP_GRAMMAR_MISSING, /* 1038 */
|
| 303 |
+
XML_RNGP_GRAMMAR_NO_START, /* 1039 */
|
| 304 |
+
XML_RNGP_GROUP_ATTR_CONFLICT, /* 1040 */
|
| 305 |
+
XML_RNGP_HREF_ERROR, /* 1041 */
|
| 306 |
+
XML_RNGP_INCLUDE_EMPTY, /* 1042 */
|
| 307 |
+
XML_RNGP_INCLUDE_FAILURE, /* 1043 */
|
| 308 |
+
XML_RNGP_INCLUDE_RECURSE, /* 1044 */
|
| 309 |
+
XML_RNGP_INTERLEAVE_ADD, /* 1045 */
|
| 310 |
+
XML_RNGP_INTERLEAVE_CREATE_FAILED, /* 1046 */
|
| 311 |
+
XML_RNGP_INTERLEAVE_EMPTY, /* 1047 */
|
| 312 |
+
XML_RNGP_INTERLEAVE_NO_CONTENT, /* 1048 */
|
| 313 |
+
XML_RNGP_INVALID_DEFINE_NAME, /* 1049 */
|
| 314 |
+
XML_RNGP_INVALID_URI, /* 1050 */
|
| 315 |
+
XML_RNGP_INVALID_VALUE, /* 1051 */
|
| 316 |
+
XML_RNGP_MISSING_HREF, /* 1052 */
|
| 317 |
+
XML_RNGP_NAME_MISSING, /* 1053 */
|
| 318 |
+
XML_RNGP_NEED_COMBINE, /* 1054 */
|
| 319 |
+
XML_RNGP_NOTALLOWED_NOT_EMPTY, /* 1055 */
|
| 320 |
+
XML_RNGP_NSNAME_ATTR_ANCESTOR, /* 1056 */
|
| 321 |
+
XML_RNGP_NSNAME_NO_NS, /* 1057 */
|
| 322 |
+
XML_RNGP_PARAM_FORBIDDEN, /* 1058 */
|
| 323 |
+
XML_RNGP_PARAM_NAME_MISSING, /* 1059 */
|
| 324 |
+
XML_RNGP_PARENTREF_CREATE_FAILED, /* 1060 */
|
| 325 |
+
XML_RNGP_PARENTREF_NAME_INVALID, /* 1061 */
|
| 326 |
+
XML_RNGP_PARENTREF_NO_NAME, /* 1062 */
|
| 327 |
+
XML_RNGP_PARENTREF_NO_PARENT, /* 1063 */
|
| 328 |
+
XML_RNGP_PARENTREF_NOT_EMPTY, /* 1064 */
|
| 329 |
+
XML_RNGP_PARSE_ERROR, /* 1065 */
|
| 330 |
+
XML_RNGP_PAT_ANYNAME_EXCEPT_ANYNAME, /* 1066 */
|
| 331 |
+
XML_RNGP_PAT_ATTR_ATTR, /* 1067 */
|
| 332 |
+
XML_RNGP_PAT_ATTR_ELEM, /* 1068 */
|
| 333 |
+
XML_RNGP_PAT_DATA_EXCEPT_ATTR, /* 1069 */
|
| 334 |
+
XML_RNGP_PAT_DATA_EXCEPT_ELEM, /* 1070 */
|
| 335 |
+
XML_RNGP_PAT_DATA_EXCEPT_EMPTY, /* 1071 */
|
| 336 |
+
XML_RNGP_PAT_DATA_EXCEPT_GROUP, /* 1072 */
|
| 337 |
+
XML_RNGP_PAT_DATA_EXCEPT_INTERLEAVE, /* 1073 */
|
| 338 |
+
XML_RNGP_PAT_DATA_EXCEPT_LIST, /* 1074 */
|
| 339 |
+
XML_RNGP_PAT_DATA_EXCEPT_ONEMORE, /* 1075 */
|
| 340 |
+
XML_RNGP_PAT_DATA_EXCEPT_REF, /* 1076 */
|
| 341 |
+
XML_RNGP_PAT_DATA_EXCEPT_TEXT, /* 1077 */
|
| 342 |
+
XML_RNGP_PAT_LIST_ATTR, /* 1078 */
|
| 343 |
+
XML_RNGP_PAT_LIST_ELEM, /* 1079 */
|
| 344 |
+
XML_RNGP_PAT_LIST_INTERLEAVE, /* 1080 */
|
| 345 |
+
XML_RNGP_PAT_LIST_LIST, /* 1081 */
|
| 346 |
+
XML_RNGP_PAT_LIST_REF, /* 1082 */
|
| 347 |
+
XML_RNGP_PAT_LIST_TEXT, /* 1083 */
|
| 348 |
+
XML_RNGP_PAT_NSNAME_EXCEPT_ANYNAME, /* 1084 */
|
| 349 |
+
XML_RNGP_PAT_NSNAME_EXCEPT_NSNAME, /* 1085 */
|
| 350 |
+
XML_RNGP_PAT_ONEMORE_GROUP_ATTR, /* 1086 */
|
| 351 |
+
XML_RNGP_PAT_ONEMORE_INTERLEAVE_ATTR, /* 1087 */
|
| 352 |
+
XML_RNGP_PAT_START_ATTR, /* 1088 */
|
| 353 |
+
XML_RNGP_PAT_START_DATA, /* 1089 */
|
| 354 |
+
XML_RNGP_PAT_START_EMPTY, /* 1090 */
|
| 355 |
+
XML_RNGP_PAT_START_GROUP, /* 1091 */
|
| 356 |
+
XML_RNGP_PAT_START_INTERLEAVE, /* 1092 */
|
| 357 |
+
XML_RNGP_PAT_START_LIST, /* 1093 */
|
| 358 |
+
XML_RNGP_PAT_START_ONEMORE, /* 1094 */
|
| 359 |
+
XML_RNGP_PAT_START_TEXT, /* 1095 */
|
| 360 |
+
XML_RNGP_PAT_START_VALUE, /* 1096 */
|
| 361 |
+
XML_RNGP_PREFIX_UNDEFINED, /* 1097 */
|
| 362 |
+
XML_RNGP_REF_CREATE_FAILED, /* 1098 */
|
| 363 |
+
XML_RNGP_REF_CYCLE, /* 1099 */
|
| 364 |
+
XML_RNGP_REF_NAME_INVALID, /* 1100 */
|
| 365 |
+
XML_RNGP_REF_NO_DEF, /* 1101 */
|
| 366 |
+
XML_RNGP_REF_NO_NAME, /* 1102 */
|
| 367 |
+
XML_RNGP_REF_NOT_EMPTY, /* 1103 */
|
| 368 |
+
XML_RNGP_START_CHOICE_AND_INTERLEAVE, /* 1104 */
|
| 369 |
+
XML_RNGP_START_CONTENT, /* 1105 */
|
| 370 |
+
XML_RNGP_START_EMPTY, /* 1106 */
|
| 371 |
+
XML_RNGP_START_MISSING, /* 1107 */
|
| 372 |
+
XML_RNGP_TEXT_EXPECTED, /* 1108 */
|
| 373 |
+
XML_RNGP_TEXT_HAS_CHILD, /* 1109 */
|
| 374 |
+
XML_RNGP_TYPE_MISSING, /* 1110 */
|
| 375 |
+
XML_RNGP_TYPE_NOT_FOUND, /* 1111 */
|
| 376 |
+
XML_RNGP_TYPE_VALUE, /* 1112 */
|
| 377 |
+
XML_RNGP_UNKNOWN_ATTRIBUTE, /* 1113 */
|
| 378 |
+
XML_RNGP_UNKNOWN_COMBINE, /* 1114 */
|
| 379 |
+
XML_RNGP_UNKNOWN_CONSTRUCT, /* 1115 */
|
| 380 |
+
XML_RNGP_UNKNOWN_TYPE_LIB, /* 1116 */
|
| 381 |
+
XML_RNGP_URI_FRAGMENT, /* 1117 */
|
| 382 |
+
XML_RNGP_URI_NOT_ABSOLUTE, /* 1118 */
|
| 383 |
+
XML_RNGP_VALUE_EMPTY, /* 1119 */
|
| 384 |
+
XML_RNGP_VALUE_NO_CONTENT, /* 1120 */
|
| 385 |
+
XML_RNGP_XMLNS_NAME, /* 1121 */
|
| 386 |
+
XML_RNGP_XML_NS, /* 1122 */
|
| 387 |
+
XML_XPATH_EXPRESSION_OK = 1200,
|
| 388 |
+
XML_XPATH_NUMBER_ERROR, /* 1201 */
|
| 389 |
+
XML_XPATH_UNFINISHED_LITERAL_ERROR, /* 1202 */
|
| 390 |
+
XML_XPATH_START_LITERAL_ERROR, /* 1203 */
|
| 391 |
+
XML_XPATH_VARIABLE_REF_ERROR, /* 1204 */
|
| 392 |
+
XML_XPATH_UNDEF_VARIABLE_ERROR, /* 1205 */
|
| 393 |
+
XML_XPATH_INVALID_PREDICATE_ERROR, /* 1206 */
|
| 394 |
+
XML_XPATH_EXPR_ERROR, /* 1207 */
|
| 395 |
+
XML_XPATH_UNCLOSED_ERROR, /* 1208 */
|
| 396 |
+
XML_XPATH_UNKNOWN_FUNC_ERROR, /* 1209 */
|
| 397 |
+
XML_XPATH_INVALID_OPERAND, /* 1210 */
|
| 398 |
+
XML_XPATH_INVALID_TYPE, /* 1211 */
|
| 399 |
+
XML_XPATH_INVALID_ARITY, /* 1212 */
|
| 400 |
+
XML_XPATH_INVALID_CTXT_SIZE, /* 1213 */
|
| 401 |
+
XML_XPATH_INVALID_CTXT_POSITION, /* 1214 */
|
| 402 |
+
XML_XPATH_MEMORY_ERROR, /* 1215 */
|
| 403 |
+
XML_XPTR_SYNTAX_ERROR, /* 1216 */
|
| 404 |
+
XML_XPTR_RESOURCE_ERROR, /* 1217 */
|
| 405 |
+
XML_XPTR_SUB_RESOURCE_ERROR, /* 1218 */
|
| 406 |
+
XML_XPATH_UNDEF_PREFIX_ERROR, /* 1219 */
|
| 407 |
+
XML_XPATH_ENCODING_ERROR, /* 1220 */
|
| 408 |
+
XML_XPATH_INVALID_CHAR_ERROR, /* 1221 */
|
| 409 |
+
XML_TREE_INVALID_HEX = 1300,
|
| 410 |
+
XML_TREE_INVALID_DEC, /* 1301 */
|
| 411 |
+
XML_TREE_UNTERMINATED_ENTITY, /* 1302 */
|
| 412 |
+
XML_TREE_NOT_UTF8, /* 1303 */
|
| 413 |
+
XML_SAVE_NOT_UTF8 = 1400,
|
| 414 |
+
XML_SAVE_CHAR_INVALID, /* 1401 */
|
| 415 |
+
XML_SAVE_NO_DOCTYPE, /* 1402 */
|
| 416 |
+
XML_SAVE_UNKNOWN_ENCODING, /* 1403 */
|
| 417 |
+
XML_REGEXP_COMPILE_ERROR = 1450,
|
| 418 |
+
XML_IO_UNKNOWN = 1500,
|
| 419 |
+
XML_IO_EACCES, /* 1501 */
|
| 420 |
+
XML_IO_EAGAIN, /* 1502 */
|
| 421 |
+
XML_IO_EBADF, /* 1503 */
|
| 422 |
+
XML_IO_EBADMSG, /* 1504 */
|
| 423 |
+
XML_IO_EBUSY, /* 1505 */
|
| 424 |
+
XML_IO_ECANCELED, /* 1506 */
|
| 425 |
+
XML_IO_ECHILD, /* 1507 */
|
| 426 |
+
XML_IO_EDEADLK, /* 1508 */
|
| 427 |
+
XML_IO_EDOM, /* 1509 */
|
| 428 |
+
XML_IO_EEXIST, /* 1510 */
|
| 429 |
+
XML_IO_EFAULT, /* 1511 */
|
| 430 |
+
XML_IO_EFBIG, /* 1512 */
|
| 431 |
+
XML_IO_EINPROGRESS, /* 1513 */
|
| 432 |
+
XML_IO_EINTR, /* 1514 */
|
| 433 |
+
XML_IO_EINVAL, /* 1515 */
|
| 434 |
+
XML_IO_EIO, /* 1516 */
|
| 435 |
+
XML_IO_EISDIR, /* 1517 */
|
| 436 |
+
XML_IO_EMFILE, /* 1518 */
|
| 437 |
+
XML_IO_EMLINK, /* 1519 */
|
| 438 |
+
XML_IO_EMSGSIZE, /* 1520 */
|
| 439 |
+
XML_IO_ENAMETOOLONG, /* 1521 */
|
| 440 |
+
XML_IO_ENFILE, /* 1522 */
|
| 441 |
+
XML_IO_ENODEV, /* 1523 */
|
| 442 |
+
XML_IO_ENOENT, /* 1524 */
|
| 443 |
+
XML_IO_ENOEXEC, /* 1525 */
|
| 444 |
+
XML_IO_ENOLCK, /* 1526 */
|
| 445 |
+
XML_IO_ENOMEM, /* 1527 */
|
| 446 |
+
XML_IO_ENOSPC, /* 1528 */
|
| 447 |
+
XML_IO_ENOSYS, /* 1529 */
|
| 448 |
+
XML_IO_ENOTDIR, /* 1530 */
|
| 449 |
+
XML_IO_ENOTEMPTY, /* 1531 */
|
| 450 |
+
XML_IO_ENOTSUP, /* 1532 */
|
| 451 |
+
XML_IO_ENOTTY, /* 1533 */
|
| 452 |
+
XML_IO_ENXIO, /* 1534 */
|
| 453 |
+
XML_IO_EPERM, /* 1535 */
|
| 454 |
+
XML_IO_EPIPE, /* 1536 */
|
| 455 |
+
XML_IO_ERANGE, /* 1537 */
|
| 456 |
+
XML_IO_EROFS, /* 1538 */
|
| 457 |
+
XML_IO_ESPIPE, /* 1539 */
|
| 458 |
+
XML_IO_ESRCH, /* 1540 */
|
| 459 |
+
XML_IO_ETIMEDOUT, /* 1541 */
|
| 460 |
+
XML_IO_EXDEV, /* 1542 */
|
| 461 |
+
XML_IO_NETWORK_ATTEMPT, /* 1543 */
|
| 462 |
+
XML_IO_ENCODER, /* 1544 */
|
| 463 |
+
XML_IO_FLUSH, /* 1545 */
|
| 464 |
+
XML_IO_WRITE, /* 1546 */
|
| 465 |
+
XML_IO_NO_INPUT, /* 1547 */
|
| 466 |
+
XML_IO_BUFFER_FULL, /* 1548 */
|
| 467 |
+
XML_IO_LOAD_ERROR, /* 1549 */
|
| 468 |
+
XML_IO_ENOTSOCK, /* 1550 */
|
| 469 |
+
XML_IO_EISCONN, /* 1551 */
|
| 470 |
+
XML_IO_ECONNREFUSED, /* 1552 */
|
| 471 |
+
XML_IO_ENETUNREACH, /* 1553 */
|
| 472 |
+
XML_IO_EADDRINUSE, /* 1554 */
|
| 473 |
+
XML_IO_EALREADY, /* 1555 */
|
| 474 |
+
XML_IO_EAFNOSUPPORT, /* 1556 */
|
| 475 |
+
XML_XINCLUDE_RECURSION=1600,
|
| 476 |
+
XML_XINCLUDE_PARSE_VALUE, /* 1601 */
|
| 477 |
+
XML_XINCLUDE_ENTITY_DEF_MISMATCH, /* 1602 */
|
| 478 |
+
XML_XINCLUDE_NO_HREF, /* 1603 */
|
| 479 |
+
XML_XINCLUDE_NO_FALLBACK, /* 1604 */
|
| 480 |
+
XML_XINCLUDE_HREF_URI, /* 1605 */
|
| 481 |
+
XML_XINCLUDE_TEXT_FRAGMENT, /* 1606 */
|
| 482 |
+
XML_XINCLUDE_TEXT_DOCUMENT, /* 1607 */
|
| 483 |
+
XML_XINCLUDE_INVALID_CHAR, /* 1608 */
|
| 484 |
+
XML_XINCLUDE_BUILD_FAILED, /* 1609 */
|
| 485 |
+
XML_XINCLUDE_UNKNOWN_ENCODING, /* 1610 */
|
| 486 |
+
XML_XINCLUDE_MULTIPLE_ROOT, /* 1611 */
|
| 487 |
+
XML_XINCLUDE_XPTR_FAILED, /* 1612 */
|
| 488 |
+
XML_XINCLUDE_XPTR_RESULT, /* 1613 */
|
| 489 |
+
XML_XINCLUDE_INCLUDE_IN_INCLUDE, /* 1614 */
|
| 490 |
+
XML_XINCLUDE_FALLBACKS_IN_INCLUDE, /* 1615 */
|
| 491 |
+
XML_XINCLUDE_FALLBACK_NOT_IN_INCLUDE, /* 1616 */
|
| 492 |
+
XML_XINCLUDE_DEPRECATED_NS, /* 1617 */
|
| 493 |
+
XML_XINCLUDE_FRAGMENT_ID, /* 1618 */
|
| 494 |
+
XML_CATALOG_MISSING_ATTR = 1650,
|
| 495 |
+
XML_CATALOG_ENTRY_BROKEN, /* 1651 */
|
| 496 |
+
XML_CATALOG_PREFER_VALUE, /* 1652 */
|
| 497 |
+
XML_CATALOG_NOT_CATALOG, /* 1653 */
|
| 498 |
+
XML_CATALOG_RECURSION, /* 1654 */
|
| 499 |
+
XML_SCHEMAP_PREFIX_UNDEFINED = 1700,
|
| 500 |
+
XML_SCHEMAP_ATTRFORMDEFAULT_VALUE, /* 1701 */
|
| 501 |
+
XML_SCHEMAP_ATTRGRP_NONAME_NOREF, /* 1702 */
|
| 502 |
+
XML_SCHEMAP_ATTR_NONAME_NOREF, /* 1703 */
|
| 503 |
+
XML_SCHEMAP_COMPLEXTYPE_NONAME_NOREF, /* 1704 */
|
| 504 |
+
XML_SCHEMAP_ELEMFORMDEFAULT_VALUE, /* 1705 */
|
| 505 |
+
XML_SCHEMAP_ELEM_NONAME_NOREF, /* 1706 */
|
| 506 |
+
XML_SCHEMAP_EXTENSION_NO_BASE, /* 1707 */
|
| 507 |
+
XML_SCHEMAP_FACET_NO_VALUE, /* 1708 */
|
| 508 |
+
XML_SCHEMAP_FAILED_BUILD_IMPORT, /* 1709 */
|
| 509 |
+
XML_SCHEMAP_GROUP_NONAME_NOREF, /* 1710 */
|
| 510 |
+
XML_SCHEMAP_IMPORT_NAMESPACE_NOT_URI, /* 1711 */
|
| 511 |
+
XML_SCHEMAP_IMPORT_REDEFINE_NSNAME, /* 1712 */
|
| 512 |
+
XML_SCHEMAP_IMPORT_SCHEMA_NOT_URI, /* 1713 */
|
| 513 |
+
XML_SCHEMAP_INVALID_BOOLEAN, /* 1714 */
|
| 514 |
+
XML_SCHEMAP_INVALID_ENUM, /* 1715 */
|
| 515 |
+
XML_SCHEMAP_INVALID_FACET, /* 1716 */
|
| 516 |
+
XML_SCHEMAP_INVALID_FACET_VALUE, /* 1717 */
|
| 517 |
+
XML_SCHEMAP_INVALID_MAXOCCURS, /* 1718 */
|
| 518 |
+
XML_SCHEMAP_INVALID_MINOCCURS, /* 1719 */
|
| 519 |
+
XML_SCHEMAP_INVALID_REF_AND_SUBTYPE, /* 1720 */
|
| 520 |
+
XML_SCHEMAP_INVALID_WHITE_SPACE, /* 1721 */
|
| 521 |
+
XML_SCHEMAP_NOATTR_NOREF, /* 1722 */
|
| 522 |
+
XML_SCHEMAP_NOTATION_NO_NAME, /* 1723 */
|
| 523 |
+
XML_SCHEMAP_NOTYPE_NOREF, /* 1724 */
|
| 524 |
+
XML_SCHEMAP_REF_AND_SUBTYPE, /* 1725 */
|
| 525 |
+
XML_SCHEMAP_RESTRICTION_NONAME_NOREF, /* 1726 */
|
| 526 |
+
XML_SCHEMAP_SIMPLETYPE_NONAME, /* 1727 */
|
| 527 |
+
XML_SCHEMAP_TYPE_AND_SUBTYPE, /* 1728 */
|
| 528 |
+
XML_SCHEMAP_UNKNOWN_ALL_CHILD, /* 1729 */
|
| 529 |
+
XML_SCHEMAP_UNKNOWN_ANYATTRIBUTE_CHILD, /* 1730 */
|
| 530 |
+
XML_SCHEMAP_UNKNOWN_ATTR_CHILD, /* 1731 */
|
| 531 |
+
XML_SCHEMAP_UNKNOWN_ATTRGRP_CHILD, /* 1732 */
|
| 532 |
+
XML_SCHEMAP_UNKNOWN_ATTRIBUTE_GROUP, /* 1733 */
|
| 533 |
+
XML_SCHEMAP_UNKNOWN_BASE_TYPE, /* 1734 */
|
| 534 |
+
XML_SCHEMAP_UNKNOWN_CHOICE_CHILD, /* 1735 */
|
| 535 |
+
XML_SCHEMAP_UNKNOWN_COMPLEXCONTENT_CHILD, /* 1736 */
|
| 536 |
+
XML_SCHEMAP_UNKNOWN_COMPLEXTYPE_CHILD, /* 1737 */
|
| 537 |
+
XML_SCHEMAP_UNKNOWN_ELEM_CHILD, /* 1738 */
|
| 538 |
+
XML_SCHEMAP_UNKNOWN_EXTENSION_CHILD, /* 1739 */
|
| 539 |
+
XML_SCHEMAP_UNKNOWN_FACET_CHILD, /* 1740 */
|
| 540 |
+
XML_SCHEMAP_UNKNOWN_FACET_TYPE, /* 1741 */
|
| 541 |
+
XML_SCHEMAP_UNKNOWN_GROUP_CHILD, /* 1742 */
|
| 542 |
+
XML_SCHEMAP_UNKNOWN_IMPORT_CHILD, /* 1743 */
|
| 543 |
+
XML_SCHEMAP_UNKNOWN_LIST_CHILD, /* 1744 */
|
| 544 |
+
XML_SCHEMAP_UNKNOWN_NOTATION_CHILD, /* 1745 */
|
| 545 |
+
XML_SCHEMAP_UNKNOWN_PROCESSCONTENT_CHILD, /* 1746 */
|
| 546 |
+
XML_SCHEMAP_UNKNOWN_REF, /* 1747 */
|
| 547 |
+
XML_SCHEMAP_UNKNOWN_RESTRICTION_CHILD, /* 1748 */
|
| 548 |
+
XML_SCHEMAP_UNKNOWN_SCHEMAS_CHILD, /* 1749 */
|
| 549 |
+
XML_SCHEMAP_UNKNOWN_SEQUENCE_CHILD, /* 1750 */
|
| 550 |
+
XML_SCHEMAP_UNKNOWN_SIMPLECONTENT_CHILD, /* 1751 */
|
| 551 |
+
XML_SCHEMAP_UNKNOWN_SIMPLETYPE_CHILD, /* 1752 */
|
| 552 |
+
XML_SCHEMAP_UNKNOWN_TYPE, /* 1753 */
|
| 553 |
+
XML_SCHEMAP_UNKNOWN_UNION_CHILD, /* 1754 */
|
| 554 |
+
XML_SCHEMAP_ELEM_DEFAULT_FIXED, /* 1755 */
|
| 555 |
+
XML_SCHEMAP_REGEXP_INVALID, /* 1756 */
|
| 556 |
+
XML_SCHEMAP_FAILED_LOAD, /* 1757 */
|
| 557 |
+
XML_SCHEMAP_NOTHING_TO_PARSE, /* 1758 */
|
| 558 |
+
XML_SCHEMAP_NOROOT, /* 1759 */
|
| 559 |
+
XML_SCHEMAP_REDEFINED_GROUP, /* 1760 */
|
| 560 |
+
XML_SCHEMAP_REDEFINED_TYPE, /* 1761 */
|
| 561 |
+
XML_SCHEMAP_REDEFINED_ELEMENT, /* 1762 */
|
| 562 |
+
XML_SCHEMAP_REDEFINED_ATTRGROUP, /* 1763 */
|
| 563 |
+
XML_SCHEMAP_REDEFINED_ATTR, /* 1764 */
|
| 564 |
+
XML_SCHEMAP_REDEFINED_NOTATION, /* 1765 */
|
| 565 |
+
XML_SCHEMAP_FAILED_PARSE, /* 1766 */
|
| 566 |
+
XML_SCHEMAP_UNKNOWN_PREFIX, /* 1767 */
|
| 567 |
+
XML_SCHEMAP_DEF_AND_PREFIX, /* 1768 */
|
| 568 |
+
XML_SCHEMAP_UNKNOWN_INCLUDE_CHILD, /* 1769 */
|
| 569 |
+
XML_SCHEMAP_INCLUDE_SCHEMA_NOT_URI, /* 1770 */
|
| 570 |
+
XML_SCHEMAP_INCLUDE_SCHEMA_NO_URI, /* 1771 */
|
| 571 |
+
XML_SCHEMAP_NOT_SCHEMA, /* 1772 */
|
| 572 |
+
XML_SCHEMAP_UNKNOWN_MEMBER_TYPE, /* 1773 */
|
| 573 |
+
XML_SCHEMAP_INVALID_ATTR_USE, /* 1774 */
|
| 574 |
+
XML_SCHEMAP_RECURSIVE, /* 1775 */
|
| 575 |
+
XML_SCHEMAP_SUPERNUMEROUS_LIST_ITEM_TYPE, /* 1776 */
|
| 576 |
+
XML_SCHEMAP_INVALID_ATTR_COMBINATION, /* 1777 */
|
| 577 |
+
XML_SCHEMAP_INVALID_ATTR_INLINE_COMBINATION, /* 1778 */
|
| 578 |
+
XML_SCHEMAP_MISSING_SIMPLETYPE_CHILD, /* 1779 */
|
| 579 |
+
XML_SCHEMAP_INVALID_ATTR_NAME, /* 1780 */
|
| 580 |
+
XML_SCHEMAP_REF_AND_CONTENT, /* 1781 */
|
| 581 |
+
XML_SCHEMAP_CT_PROPS_CORRECT_1, /* 1782 */
|
| 582 |
+
XML_SCHEMAP_CT_PROPS_CORRECT_2, /* 1783 */
|
| 583 |
+
XML_SCHEMAP_CT_PROPS_CORRECT_3, /* 1784 */
|
| 584 |
+
XML_SCHEMAP_CT_PROPS_CORRECT_4, /* 1785 */
|
| 585 |
+
XML_SCHEMAP_CT_PROPS_CORRECT_5, /* 1786 */
|
| 586 |
+
XML_SCHEMAP_DERIVATION_OK_RESTRICTION_1, /* 1787 */
|
| 587 |
+
XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_1, /* 1788 */
|
| 588 |
+
XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_2, /* 1789 */
|
| 589 |
+
XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_2, /* 1790 */
|
| 590 |
+
XML_SCHEMAP_DERIVATION_OK_RESTRICTION_3, /* 1791 */
|
| 591 |
+
XML_SCHEMAP_WILDCARD_INVALID_NS_MEMBER, /* 1792 */
|
| 592 |
+
XML_SCHEMAP_INTERSECTION_NOT_EXPRESSIBLE, /* 1793 */
|
| 593 |
+
XML_SCHEMAP_UNION_NOT_EXPRESSIBLE, /* 1794 */
|
| 594 |
+
XML_SCHEMAP_SRC_IMPORT_3_1, /* 1795 */
|
| 595 |
+
XML_SCHEMAP_SRC_IMPORT_3_2, /* 1796 */
|
| 596 |
+
XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_1, /* 1797 */
|
| 597 |
+
XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_2, /* 1798 */
|
| 598 |
+
XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_3, /* 1799 */
|
| 599 |
+
XML_SCHEMAP_COS_CT_EXTENDS_1_3, /* 1800 */
|
| 600 |
+
XML_SCHEMAV_NOROOT = 1801,
|
| 601 |
+
XML_SCHEMAV_UNDECLAREDELEM, /* 1802 */
|
| 602 |
+
XML_SCHEMAV_NOTTOPLEVEL, /* 1803 */
|
| 603 |
+
XML_SCHEMAV_MISSING, /* 1804 */
|
| 604 |
+
XML_SCHEMAV_WRONGELEM, /* 1805 */
|
| 605 |
+
XML_SCHEMAV_NOTYPE, /* 1806 */
|
| 606 |
+
XML_SCHEMAV_NOROLLBACK, /* 1807 */
|
| 607 |
+
XML_SCHEMAV_ISABSTRACT, /* 1808 */
|
| 608 |
+
XML_SCHEMAV_NOTEMPTY, /* 1809 */
|
| 609 |
+
XML_SCHEMAV_ELEMCONT, /* 1810 */
|
| 610 |
+
XML_SCHEMAV_HAVEDEFAULT, /* 1811 */
|
| 611 |
+
XML_SCHEMAV_NOTNILLABLE, /* 1812 */
|
| 612 |
+
XML_SCHEMAV_EXTRACONTENT, /* 1813 */
|
| 613 |
+
XML_SCHEMAV_INVALIDATTR, /* 1814 */
|
| 614 |
+
XML_SCHEMAV_INVALIDELEM, /* 1815 */
|
| 615 |
+
XML_SCHEMAV_NOTDETERMINIST, /* 1816 */
|
| 616 |
+
XML_SCHEMAV_CONSTRUCT, /* 1817 */
|
| 617 |
+
XML_SCHEMAV_INTERNAL, /* 1818 */
|
| 618 |
+
XML_SCHEMAV_NOTSIMPLE, /* 1819 */
|
| 619 |
+
XML_SCHEMAV_ATTRUNKNOWN, /* 1820 */
|
| 620 |
+
XML_SCHEMAV_ATTRINVALID, /* 1821 */
|
| 621 |
+
XML_SCHEMAV_VALUE, /* 1822 */
|
| 622 |
+
XML_SCHEMAV_FACET, /* 1823 */
|
| 623 |
+
XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1, /* 1824 */
|
| 624 |
+
XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2, /* 1825 */
|
| 625 |
+
XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_3, /* 1826 */
|
| 626 |
+
XML_SCHEMAV_CVC_TYPE_3_1_1, /* 1827 */
|
| 627 |
+
XML_SCHEMAV_CVC_TYPE_3_1_2, /* 1828 */
|
| 628 |
+
XML_SCHEMAV_CVC_FACET_VALID, /* 1829 */
|
| 629 |
+
XML_SCHEMAV_CVC_LENGTH_VALID, /* 1830 */
|
| 630 |
+
XML_SCHEMAV_CVC_MINLENGTH_VALID, /* 1831 */
|
| 631 |
+
XML_SCHEMAV_CVC_MAXLENGTH_VALID, /* 1832 */
|
| 632 |
+
XML_SCHEMAV_CVC_MININCLUSIVE_VALID, /* 1833 */
|
| 633 |
+
XML_SCHEMAV_CVC_MAXINCLUSIVE_VALID, /* 1834 */
|
| 634 |
+
XML_SCHEMAV_CVC_MINEXCLUSIVE_VALID, /* 1835 */
|
| 635 |
+
XML_SCHEMAV_CVC_MAXEXCLUSIVE_VALID, /* 1836 */
|
| 636 |
+
XML_SCHEMAV_CVC_TOTALDIGITS_VALID, /* 1837 */
|
| 637 |
+
XML_SCHEMAV_CVC_FRACTIONDIGITS_VALID, /* 1838 */
|
| 638 |
+
XML_SCHEMAV_CVC_PATTERN_VALID, /* 1839 */
|
| 639 |
+
XML_SCHEMAV_CVC_ENUMERATION_VALID, /* 1840 */
|
| 640 |
+
XML_SCHEMAV_CVC_COMPLEX_TYPE_2_1, /* 1841 */
|
| 641 |
+
XML_SCHEMAV_CVC_COMPLEX_TYPE_2_2, /* 1842 */
|
| 642 |
+
XML_SCHEMAV_CVC_COMPLEX_TYPE_2_3, /* 1843 */
|
| 643 |
+
XML_SCHEMAV_CVC_COMPLEX_TYPE_2_4, /* 1844 */
|
| 644 |
+
XML_SCHEMAV_CVC_ELT_1, /* 1845 */
|
| 645 |
+
XML_SCHEMAV_CVC_ELT_2, /* 1846 */
|
| 646 |
+
XML_SCHEMAV_CVC_ELT_3_1, /* 1847 */
|
| 647 |
+
XML_SCHEMAV_CVC_ELT_3_2_1, /* 1848 */
|
| 648 |
+
XML_SCHEMAV_CVC_ELT_3_2_2, /* 1849 */
|
| 649 |
+
XML_SCHEMAV_CVC_ELT_4_1, /* 1850 */
|
| 650 |
+
XML_SCHEMAV_CVC_ELT_4_2, /* 1851 */
|
| 651 |
+
XML_SCHEMAV_CVC_ELT_4_3, /* 1852 */
|
| 652 |
+
XML_SCHEMAV_CVC_ELT_5_1_1, /* 1853 */
|
| 653 |
+
XML_SCHEMAV_CVC_ELT_5_1_2, /* 1854 */
|
| 654 |
+
XML_SCHEMAV_CVC_ELT_5_2_1, /* 1855 */
|
| 655 |
+
XML_SCHEMAV_CVC_ELT_5_2_2_1, /* 1856 */
|
| 656 |
+
XML_SCHEMAV_CVC_ELT_5_2_2_2_1, /* 1857 */
|
| 657 |
+
XML_SCHEMAV_CVC_ELT_5_2_2_2_2, /* 1858 */
|
| 658 |
+
XML_SCHEMAV_CVC_ELT_6, /* 1859 */
|
| 659 |
+
XML_SCHEMAV_CVC_ELT_7, /* 1860 */
|
| 660 |
+
XML_SCHEMAV_CVC_ATTRIBUTE_1, /* 1861 */
|
| 661 |
+
XML_SCHEMAV_CVC_ATTRIBUTE_2, /* 1862 */
|
| 662 |
+
XML_SCHEMAV_CVC_ATTRIBUTE_3, /* 1863 */
|
| 663 |
+
XML_SCHEMAV_CVC_ATTRIBUTE_4, /* 1864 */
|
| 664 |
+
XML_SCHEMAV_CVC_COMPLEX_TYPE_3_1, /* 1865 */
|
| 665 |
+
XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_1, /* 1866 */
|
| 666 |
+
XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_2, /* 1867 */
|
| 667 |
+
XML_SCHEMAV_CVC_COMPLEX_TYPE_4, /* 1868 */
|
| 668 |
+
XML_SCHEMAV_CVC_COMPLEX_TYPE_5_1, /* 1869 */
|
| 669 |
+
XML_SCHEMAV_CVC_COMPLEX_TYPE_5_2, /* 1870 */
|
| 670 |
+
XML_SCHEMAV_ELEMENT_CONTENT, /* 1871 */
|
| 671 |
+
XML_SCHEMAV_DOCUMENT_ELEMENT_MISSING, /* 1872 */
|
| 672 |
+
XML_SCHEMAV_CVC_COMPLEX_TYPE_1, /* 1873 */
|
| 673 |
+
XML_SCHEMAV_CVC_AU, /* 1874 */
|
| 674 |
+
XML_SCHEMAV_CVC_TYPE_1, /* 1875 */
|
| 675 |
+
XML_SCHEMAV_CVC_TYPE_2, /* 1876 */
|
| 676 |
+
XML_SCHEMAV_CVC_IDC, /* 1877 */
|
| 677 |
+
XML_SCHEMAV_CVC_WILDCARD, /* 1878 */
|
| 678 |
+
XML_SCHEMAV_MISC, /* 1879 */
|
| 679 |
+
XML_XPTR_UNKNOWN_SCHEME = 1900,
|
| 680 |
+
XML_XPTR_CHILDSEQ_START, /* 1901 */
|
| 681 |
+
XML_XPTR_EVAL_FAILED, /* 1902 */
|
| 682 |
+
XML_XPTR_EXTRA_OBJECTS, /* 1903 */
|
| 683 |
+
XML_C14N_CREATE_CTXT = 1950,
|
| 684 |
+
XML_C14N_REQUIRES_UTF8, /* 1951 */
|
| 685 |
+
XML_C14N_CREATE_STACK, /* 1952 */
|
| 686 |
+
XML_C14N_INVALID_NODE, /* 1953 */
|
| 687 |
+
XML_C14N_UNKNOW_NODE, /* 1954 */
|
| 688 |
+
XML_C14N_RELATIVE_NAMESPACE, /* 1955 */
|
| 689 |
+
XML_FTP_PASV_ANSWER = 2000,
|
| 690 |
+
XML_FTP_EPSV_ANSWER, /* 2001 */
|
| 691 |
+
XML_FTP_ACCNT, /* 2002 */
|
| 692 |
+
XML_FTP_URL_SYNTAX, /* 2003 */
|
| 693 |
+
XML_HTTP_URL_SYNTAX = 2020,
|
| 694 |
+
XML_HTTP_USE_IP, /* 2021 */
|
| 695 |
+
XML_HTTP_UNKNOWN_HOST, /* 2022 */
|
| 696 |
+
XML_SCHEMAP_SRC_SIMPLE_TYPE_1 = 3000,
|
| 697 |
+
XML_SCHEMAP_SRC_SIMPLE_TYPE_2, /* 3001 */
|
| 698 |
+
XML_SCHEMAP_SRC_SIMPLE_TYPE_3, /* 3002 */
|
| 699 |
+
XML_SCHEMAP_SRC_SIMPLE_TYPE_4, /* 3003 */
|
| 700 |
+
XML_SCHEMAP_SRC_RESOLVE, /* 3004 */
|
| 701 |
+
XML_SCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPE, /* 3005 */
|
| 702 |
+
XML_SCHEMAP_SRC_LIST_ITEMTYPE_OR_SIMPLETYPE, /* 3006 */
|
| 703 |
+
XML_SCHEMAP_SRC_UNION_MEMBERTYPES_OR_SIMPLETYPES, /* 3007 */
|
| 704 |
+
XML_SCHEMAP_ST_PROPS_CORRECT_1, /* 3008 */
|
| 705 |
+
XML_SCHEMAP_ST_PROPS_CORRECT_2, /* 3009 */
|
| 706 |
+
XML_SCHEMAP_ST_PROPS_CORRECT_3, /* 3010 */
|
| 707 |
+
XML_SCHEMAP_COS_ST_RESTRICTS_1_1, /* 3011 */
|
| 708 |
+
XML_SCHEMAP_COS_ST_RESTRICTS_1_2, /* 3012 */
|
| 709 |
+
XML_SCHEMAP_COS_ST_RESTRICTS_1_3_1, /* 3013 */
|
| 710 |
+
XML_SCHEMAP_COS_ST_RESTRICTS_1_3_2, /* 3014 */
|
| 711 |
+
XML_SCHEMAP_COS_ST_RESTRICTS_2_1, /* 3015 */
|
| 712 |
+
XML_SCHEMAP_COS_ST_RESTRICTS_2_3_1_1, /* 3016 */
|
| 713 |
+
XML_SCHEMAP_COS_ST_RESTRICTS_2_3_1_2, /* 3017 */
|
| 714 |
+
XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_1, /* 3018 */
|
| 715 |
+
XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_2, /* 3019 */
|
| 716 |
+
XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_3, /* 3020 */
|
| 717 |
+
XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_4, /* 3021 */
|
| 718 |
+
XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_5, /* 3022 */
|
| 719 |
+
XML_SCHEMAP_COS_ST_RESTRICTS_3_1, /* 3023 */
|
| 720 |
+
XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1, /* 3024 */
|
| 721 |
+
XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1_2, /* 3025 */
|
| 722 |
+
XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_2, /* 3026 */
|
| 723 |
+
XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_1, /* 3027 */
|
| 724 |
+
XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_3, /* 3028 */
|
| 725 |
+
XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_4, /* 3029 */
|
| 726 |
+
XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_5, /* 3030 */
|
| 727 |
+
XML_SCHEMAP_COS_ST_DERIVED_OK_2_1, /* 3031 */
|
| 728 |
+
XML_SCHEMAP_COS_ST_DERIVED_OK_2_2, /* 3032 */
|
| 729 |
+
XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, /* 3033 */
|
| 730 |
+
XML_SCHEMAP_S4S_ELEM_MISSING, /* 3034 */
|
| 731 |
+
XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, /* 3035 */
|
| 732 |
+
XML_SCHEMAP_S4S_ATTR_MISSING, /* 3036 */
|
| 733 |
+
XML_SCHEMAP_S4S_ATTR_INVALID_VALUE, /* 3037 */
|
| 734 |
+
XML_SCHEMAP_SRC_ELEMENT_1, /* 3038 */
|
| 735 |
+
XML_SCHEMAP_SRC_ELEMENT_2_1, /* 3039 */
|
| 736 |
+
XML_SCHEMAP_SRC_ELEMENT_2_2, /* 3040 */
|
| 737 |
+
XML_SCHEMAP_SRC_ELEMENT_3, /* 3041 */
|
| 738 |
+
XML_SCHEMAP_P_PROPS_CORRECT_1, /* 3042 */
|
| 739 |
+
XML_SCHEMAP_P_PROPS_CORRECT_2_1, /* 3043 */
|
| 740 |
+
XML_SCHEMAP_P_PROPS_CORRECT_2_2, /* 3044 */
|
| 741 |
+
XML_SCHEMAP_E_PROPS_CORRECT_2, /* 3045 */
|
| 742 |
+
XML_SCHEMAP_E_PROPS_CORRECT_3, /* 3046 */
|
| 743 |
+
XML_SCHEMAP_E_PROPS_CORRECT_4, /* 3047 */
|
| 744 |
+
XML_SCHEMAP_E_PROPS_CORRECT_5, /* 3048 */
|
| 745 |
+
XML_SCHEMAP_E_PROPS_CORRECT_6, /* 3049 */
|
| 746 |
+
XML_SCHEMAP_SRC_INCLUDE, /* 3050 */
|
| 747 |
+
XML_SCHEMAP_SRC_ATTRIBUTE_1, /* 3051 */
|
| 748 |
+
XML_SCHEMAP_SRC_ATTRIBUTE_2, /* 3052 */
|
| 749 |
+
XML_SCHEMAP_SRC_ATTRIBUTE_3_1, /* 3053 */
|
| 750 |
+
XML_SCHEMAP_SRC_ATTRIBUTE_3_2, /* 3054 */
|
| 751 |
+
XML_SCHEMAP_SRC_ATTRIBUTE_4, /* 3055 */
|
| 752 |
+
XML_SCHEMAP_NO_XMLNS, /* 3056 */
|
| 753 |
+
XML_SCHEMAP_NO_XSI, /* 3057 */
|
| 754 |
+
XML_SCHEMAP_COS_VALID_DEFAULT_1, /* 3058 */
|
| 755 |
+
XML_SCHEMAP_COS_VALID_DEFAULT_2_1, /* 3059 */
|
| 756 |
+
XML_SCHEMAP_COS_VALID_DEFAULT_2_2_1, /* 3060 */
|
| 757 |
+
XML_SCHEMAP_COS_VALID_DEFAULT_2_2_2, /* 3061 */
|
| 758 |
+
XML_SCHEMAP_CVC_SIMPLE_TYPE, /* 3062 */
|
| 759 |
+
XML_SCHEMAP_COS_CT_EXTENDS_1_1, /* 3063 */
|
| 760 |
+
XML_SCHEMAP_SRC_IMPORT_1_1, /* 3064 */
|
| 761 |
+
XML_SCHEMAP_SRC_IMPORT_1_2, /* 3065 */
|
| 762 |
+
XML_SCHEMAP_SRC_IMPORT_2, /* 3066 */
|
| 763 |
+
XML_SCHEMAP_SRC_IMPORT_2_1, /* 3067 */
|
| 764 |
+
XML_SCHEMAP_SRC_IMPORT_2_2, /* 3068 */
|
| 765 |
+
XML_SCHEMAP_INTERNAL, /* 3069 non-W3C */
|
| 766 |
+
XML_SCHEMAP_NOT_DETERMINISTIC, /* 3070 non-W3C */
|
| 767 |
+
XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_1, /* 3071 */
|
| 768 |
+
XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_2, /* 3072 */
|
| 769 |
+
XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_3, /* 3073 */
|
| 770 |
+
XML_SCHEMAP_MG_PROPS_CORRECT_1, /* 3074 */
|
| 771 |
+
XML_SCHEMAP_MG_PROPS_CORRECT_2, /* 3075 */
|
| 772 |
+
XML_SCHEMAP_SRC_CT_1, /* 3076 */
|
| 773 |
+
XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3, /* 3077 */
|
| 774 |
+
XML_SCHEMAP_AU_PROPS_CORRECT_2, /* 3078 */
|
| 775 |
+
XML_SCHEMAP_A_PROPS_CORRECT_2, /* 3079 */
|
| 776 |
+
XML_SCHEMAP_C_PROPS_CORRECT, /* 3080 */
|
| 777 |
+
XML_SCHEMAP_SRC_REDEFINE, /* 3081 */
|
| 778 |
+
XML_SCHEMAP_SRC_IMPORT, /* 3082 */
|
| 779 |
+
XML_SCHEMAP_WARN_SKIP_SCHEMA, /* 3083 */
|
| 780 |
+
XML_SCHEMAP_WARN_UNLOCATED_SCHEMA, /* 3084 */
|
| 781 |
+
XML_SCHEMAP_WARN_ATTR_REDECL_PROH, /* 3085 */
|
| 782 |
+
XML_SCHEMAP_WARN_ATTR_POINTLESS_PROH, /* 3085 */
|
| 783 |
+
XML_SCHEMAP_AG_PROPS_CORRECT, /* 3086 */
|
| 784 |
+
XML_SCHEMAP_COS_CT_EXTENDS_1_2, /* 3087 */
|
| 785 |
+
XML_SCHEMAP_AU_PROPS_CORRECT, /* 3088 */
|
| 786 |
+
XML_SCHEMAP_A_PROPS_CORRECT_3, /* 3089 */
|
| 787 |
+
XML_SCHEMAP_COS_ALL_LIMITED, /* 3090 */
|
| 788 |
+
XML_SCHEMATRONV_ASSERT = 4000, /* 4000 */
|
| 789 |
+
XML_SCHEMATRONV_REPORT,
|
| 790 |
+
XML_MODULE_OPEN = 4900, /* 4900 */
|
| 791 |
+
XML_MODULE_CLOSE, /* 4901 */
|
| 792 |
+
XML_CHECK_FOUND_ELEMENT = 5000,
|
| 793 |
+
XML_CHECK_FOUND_ATTRIBUTE, /* 5001 */
|
| 794 |
+
XML_CHECK_FOUND_TEXT, /* 5002 */
|
| 795 |
+
XML_CHECK_FOUND_CDATA, /* 5003 */
|
| 796 |
+
XML_CHECK_FOUND_ENTITYREF, /* 5004 */
|
| 797 |
+
XML_CHECK_FOUND_ENTITY, /* 5005 */
|
| 798 |
+
XML_CHECK_FOUND_PI, /* 5006 */
|
| 799 |
+
XML_CHECK_FOUND_COMMENT, /* 5007 */
|
| 800 |
+
XML_CHECK_FOUND_DOCTYPE, /* 5008 */
|
| 801 |
+
XML_CHECK_FOUND_FRAGMENT, /* 5009 */
|
| 802 |
+
XML_CHECK_FOUND_NOTATION, /* 5010 */
|
| 803 |
+
XML_CHECK_UNKNOWN_NODE, /* 5011 */
|
| 804 |
+
XML_CHECK_ENTITY_TYPE, /* 5012 */
|
| 805 |
+
XML_CHECK_NO_PARENT, /* 5013 */
|
| 806 |
+
XML_CHECK_NO_DOC, /* 5014 */
|
| 807 |
+
XML_CHECK_NO_NAME, /* 5015 */
|
| 808 |
+
XML_CHECK_NO_ELEM, /* 5016 */
|
| 809 |
+
XML_CHECK_WRONG_DOC, /* 5017 */
|
| 810 |
+
XML_CHECK_NO_PREV, /* 5018 */
|
| 811 |
+
XML_CHECK_WRONG_PREV, /* 5019 */
|
| 812 |
+
XML_CHECK_NO_NEXT, /* 5020 */
|
| 813 |
+
XML_CHECK_WRONG_NEXT, /* 5021 */
|
| 814 |
+
XML_CHECK_NOT_DTD, /* 5022 */
|
| 815 |
+
XML_CHECK_NOT_ATTR, /* 5023 */
|
| 816 |
+
XML_CHECK_NOT_ATTR_DECL, /* 5024 */
|
| 817 |
+
XML_CHECK_NOT_ELEM_DECL, /* 5025 */
|
| 818 |
+
XML_CHECK_NOT_ENTITY_DECL, /* 5026 */
|
| 819 |
+
XML_CHECK_NOT_NS_DECL, /* 5027 */
|
| 820 |
+
XML_CHECK_NO_HREF, /* 5028 */
|
| 821 |
+
XML_CHECK_WRONG_PARENT,/* 5029 */
|
| 822 |
+
XML_CHECK_NS_SCOPE, /* 5030 */
|
| 823 |
+
XML_CHECK_NS_ANCESTOR, /* 5031 */
|
| 824 |
+
XML_CHECK_NOT_UTF8, /* 5032 */
|
| 825 |
+
XML_CHECK_NO_DICT, /* 5033 */
|
| 826 |
+
XML_CHECK_NOT_NCNAME, /* 5034 */
|
| 827 |
+
XML_CHECK_OUTSIDE_DICT, /* 5035 */
|
| 828 |
+
XML_CHECK_WRONG_NAME, /* 5036 */
|
| 829 |
+
XML_CHECK_NAME_NOT_NULL, /* 5037 */
|
| 830 |
+
XML_I18N_NO_NAME = 6000,
|
| 831 |
+
XML_I18N_NO_HANDLER, /* 6001 */
|
| 832 |
+
XML_I18N_EXCESS_HANDLER, /* 6002 */
|
| 833 |
+
XML_I18N_CONV_FAILED, /* 6003 */
|
| 834 |
+
XML_I18N_NO_OUTPUT, /* 6004 */
|
| 835 |
+
XML_BUF_OVERFLOW = 7000
|
| 836 |
+
} xmlParserErrors;
|
| 837 |
+
|
| 838 |
+
/**
|
| 839 |
+
* xmlGenericErrorFunc:
|
| 840 |
+
* @ctx: a parsing context
|
| 841 |
+
* @msg: the message
|
| 842 |
+
* @...: the extra arguments of the varargs to format the message
|
| 843 |
+
*
|
| 844 |
+
* Signature of the function to use when there is an error and
|
| 845 |
+
* no parsing or validity context available .
|
| 846 |
+
*/
|
| 847 |
+
typedef void (*xmlGenericErrorFunc) (void *ctx,
|
| 848 |
+
const char *msg,
|
| 849 |
+
...) LIBXML_ATTR_FORMAT(2,3);
|
| 850 |
+
/**
|
| 851 |
+
* xmlStructuredErrorFunc:
|
| 852 |
+
* @userData: user provided data for the error callback
|
| 853 |
+
* @error: the error being raised.
|
| 854 |
+
*
|
| 855 |
+
* Signature of the function to use when there is an error and
|
| 856 |
+
* the module handles the new error reporting mechanism.
|
| 857 |
+
*/
|
| 858 |
+
typedef void (*xmlStructuredErrorFunc) (void *userData, xmlErrorPtr error);
|
| 859 |
+
|
| 860 |
+
/*
|
| 861 |
+
* Use the following function to reset the two global variables
|
| 862 |
+
* xmlGenericError and xmlGenericErrorContext.
|
| 863 |
+
*/
|
| 864 |
+
XMLPUBFUN void
|
| 865 |
+
xmlSetGenericErrorFunc (void *ctx,
|
| 866 |
+
xmlGenericErrorFunc handler);
|
| 867 |
+
XML_DEPRECATED
|
| 868 |
+
XMLPUBFUN void
|
| 869 |
+
initGenericErrorDefaultFunc (xmlGenericErrorFunc *handler);
|
| 870 |
+
|
| 871 |
+
XMLPUBFUN void
|
| 872 |
+
xmlSetStructuredErrorFunc (void *ctx,
|
| 873 |
+
xmlStructuredErrorFunc handler);
|
| 874 |
+
/*
|
| 875 |
+
* Default message routines used by SAX and Valid context for error
|
| 876 |
+
* and warning reporting.
|
| 877 |
+
*/
|
| 878 |
+
XMLPUBFUN void
|
| 879 |
+
xmlParserError (void *ctx,
|
| 880 |
+
const char *msg,
|
| 881 |
+
...) LIBXML_ATTR_FORMAT(2,3);
|
| 882 |
+
XMLPUBFUN void
|
| 883 |
+
xmlParserWarning (void *ctx,
|
| 884 |
+
const char *msg,
|
| 885 |
+
...) LIBXML_ATTR_FORMAT(2,3);
|
| 886 |
+
XMLPUBFUN void
|
| 887 |
+
xmlParserValidityError (void *ctx,
|
| 888 |
+
const char *msg,
|
| 889 |
+
...) LIBXML_ATTR_FORMAT(2,3);
|
| 890 |
+
XMLPUBFUN void
|
| 891 |
+
xmlParserValidityWarning (void *ctx,
|
| 892 |
+
const char *msg,
|
| 893 |
+
...) LIBXML_ATTR_FORMAT(2,3);
|
| 894 |
+
XMLPUBFUN void
|
| 895 |
+
xmlParserPrintFileInfo (xmlParserInputPtr input);
|
| 896 |
+
XMLPUBFUN void
|
| 897 |
+
xmlParserPrintFileContext (xmlParserInputPtr input);
|
| 898 |
+
|
| 899 |
+
/*
|
| 900 |
+
* Extended error information routines
|
| 901 |
+
*/
|
| 902 |
+
XMLPUBFUN xmlErrorPtr
|
| 903 |
+
xmlGetLastError (void);
|
| 904 |
+
XMLPUBFUN void
|
| 905 |
+
xmlResetLastError (void);
|
| 906 |
+
XMLPUBFUN xmlErrorPtr
|
| 907 |
+
xmlCtxtGetLastError (void *ctx);
|
| 908 |
+
XMLPUBFUN void
|
| 909 |
+
xmlCtxtResetLastError (void *ctx);
|
| 910 |
+
XMLPUBFUN void
|
| 911 |
+
xmlResetError (xmlErrorPtr err);
|
| 912 |
+
XMLPUBFUN int
|
| 913 |
+
xmlCopyError (xmlErrorPtr from,
|
| 914 |
+
xmlErrorPtr to);
|
| 915 |
+
|
| 916 |
+
#ifdef __cplusplus
|
| 917 |
+
}
|
| 918 |
+
#endif
|
| 919 |
+
#endif /* __XML_ERROR_H__ */
|
pgsql/include/libxml/xmlexports.h
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: macros for marking symbols as exportable/importable.
|
| 3 |
+
* Description: macros for marking symbols as exportable/importable.
|
| 4 |
+
*
|
| 5 |
+
* Copy: See Copyright for the status of this software.
|
| 6 |
+
*/
|
| 7 |
+
|
| 8 |
+
#ifndef __XML_EXPORTS_H__
|
| 9 |
+
#define __XML_EXPORTS_H__
|
| 10 |
+
|
| 11 |
+
/** DOC_DISABLE */
|
| 12 |
+
#if defined(_WIN32) || defined(__CYGWIN__)
|
| 13 |
+
#ifdef LIBXML_STATIC
|
| 14 |
+
#define XMLPUBLIC
|
| 15 |
+
#elif defined(IN_LIBXML)
|
| 16 |
+
#define XMLPUBLIC __declspec(dllexport)
|
| 17 |
+
#else
|
| 18 |
+
#define XMLPUBLIC __declspec(dllimport)
|
| 19 |
+
#endif
|
| 20 |
+
#else /* not Windows */
|
| 21 |
+
#define XMLPUBLIC
|
| 22 |
+
#endif /* platform switch */
|
| 23 |
+
/** DOC_ENABLE */
|
| 24 |
+
|
| 25 |
+
/*
|
| 26 |
+
* XMLPUBFUN:
|
| 27 |
+
*
|
| 28 |
+
* Macro which declares an exportable function
|
| 29 |
+
*/
|
| 30 |
+
#define XMLPUBFUN XMLPUBLIC
|
| 31 |
+
|
| 32 |
+
/**
|
| 33 |
+
* XMLPUBVAR:
|
| 34 |
+
*
|
| 35 |
+
* Macro which declares an exportable variable
|
| 36 |
+
*/
|
| 37 |
+
#define XMLPUBVAR XMLPUBLIC extern
|
| 38 |
+
|
| 39 |
+
/** DOC_DISABLE */
|
| 40 |
+
/* Compatibility */
|
| 41 |
+
#define XMLCALL
|
| 42 |
+
#define XMLCDECL
|
| 43 |
+
#if !defined(LIBXML_DLL_IMPORT)
|
| 44 |
+
#define LIBXML_DLL_IMPORT XMLPUBVAR
|
| 45 |
+
#endif
|
| 46 |
+
/** DOC_ENABLE */
|
| 47 |
+
|
| 48 |
+
#endif /* __XML_EXPORTS_H__ */
|
| 49 |
+
|
| 50 |
+
|
pgsql/include/libxml/xmlmemory.h
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: interface for the memory allocator
|
| 3 |
+
* Description: provides interfaces for the memory allocator,
|
| 4 |
+
* including debugging capabilities.
|
| 5 |
+
*
|
| 6 |
+
* Copy: See Copyright for the status of this software.
|
| 7 |
+
*
|
| 8 |
+
* Author: Daniel Veillard
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
#ifndef __DEBUG_MEMORY_ALLOC__
|
| 13 |
+
#define __DEBUG_MEMORY_ALLOC__
|
| 14 |
+
|
| 15 |
+
#include <stdio.h>
|
| 16 |
+
#include <libxml/xmlversion.h>
|
| 17 |
+
|
| 18 |
+
/**
|
| 19 |
+
* DEBUG_MEMORY:
|
| 20 |
+
*
|
| 21 |
+
* DEBUG_MEMORY replaces the allocator with a collect and debug
|
| 22 |
+
* shell to the libc allocator.
|
| 23 |
+
* DEBUG_MEMORY should only be activated when debugging
|
| 24 |
+
* libxml i.e. if libxml has been configured with --with-debug-mem too.
|
| 25 |
+
*/
|
| 26 |
+
/* #define DEBUG_MEMORY_FREED */
|
| 27 |
+
/* #define DEBUG_MEMORY_LOCATION */
|
| 28 |
+
|
| 29 |
+
#ifdef DEBUG
|
| 30 |
+
#ifndef DEBUG_MEMORY
|
| 31 |
+
#define DEBUG_MEMORY
|
| 32 |
+
#endif
|
| 33 |
+
#endif
|
| 34 |
+
|
| 35 |
+
/**
|
| 36 |
+
* DEBUG_MEMORY_LOCATION:
|
| 37 |
+
*
|
| 38 |
+
* DEBUG_MEMORY_LOCATION should be activated only when debugging
|
| 39 |
+
* libxml i.e. if libxml has been configured with --with-debug-mem too.
|
| 40 |
+
*/
|
| 41 |
+
#ifdef DEBUG_MEMORY_LOCATION
|
| 42 |
+
#endif
|
| 43 |
+
|
| 44 |
+
#ifdef __cplusplus
|
| 45 |
+
extern "C" {
|
| 46 |
+
#endif
|
| 47 |
+
|
| 48 |
+
/*
|
| 49 |
+
* The XML memory wrapper support 4 basic overloadable functions.
|
| 50 |
+
*/
|
| 51 |
+
/**
|
| 52 |
+
* xmlFreeFunc:
|
| 53 |
+
* @mem: an already allocated block of memory
|
| 54 |
+
*
|
| 55 |
+
* Signature for a free() implementation.
|
| 56 |
+
*/
|
| 57 |
+
typedef void (*xmlFreeFunc)(void *mem);
|
| 58 |
+
/**
|
| 59 |
+
* xmlMallocFunc:
|
| 60 |
+
* @size: the size requested in bytes
|
| 61 |
+
*
|
| 62 |
+
* Signature for a malloc() implementation.
|
| 63 |
+
*
|
| 64 |
+
* Returns a pointer to the newly allocated block or NULL in case of error.
|
| 65 |
+
*/
|
| 66 |
+
typedef void *(LIBXML_ATTR_ALLOC_SIZE(1) *xmlMallocFunc)(size_t size);
|
| 67 |
+
|
| 68 |
+
/**
|
| 69 |
+
* xmlReallocFunc:
|
| 70 |
+
* @mem: an already allocated block of memory
|
| 71 |
+
* @size: the new size requested in bytes
|
| 72 |
+
*
|
| 73 |
+
* Signature for a realloc() implementation.
|
| 74 |
+
*
|
| 75 |
+
* Returns a pointer to the newly reallocated block or NULL in case of error.
|
| 76 |
+
*/
|
| 77 |
+
typedef void *(*xmlReallocFunc)(void *mem, size_t size);
|
| 78 |
+
|
| 79 |
+
/**
|
| 80 |
+
* xmlStrdupFunc:
|
| 81 |
+
* @str: a zero terminated string
|
| 82 |
+
*
|
| 83 |
+
* Signature for an strdup() implementation.
|
| 84 |
+
*
|
| 85 |
+
* Returns the copy of the string or NULL in case of error.
|
| 86 |
+
*/
|
| 87 |
+
typedef char *(*xmlStrdupFunc)(const char *str);
|
| 88 |
+
|
| 89 |
+
/*
|
| 90 |
+
* The 4 interfaces used for all memory handling within libxml.
|
| 91 |
+
LIBXML_DLL_IMPORT xmlFreeFunc xmlFree;
|
| 92 |
+
LIBXML_DLL_IMPORT xmlMallocFunc xmlMalloc;
|
| 93 |
+
LIBXML_DLL_IMPORT xmlMallocFunc xmlMallocAtomic;
|
| 94 |
+
LIBXML_DLL_IMPORT xmlReallocFunc xmlRealloc;
|
| 95 |
+
LIBXML_DLL_IMPORT xmlStrdupFunc xmlMemStrdup;
|
| 96 |
+
*/
|
| 97 |
+
|
| 98 |
+
/*
|
| 99 |
+
* The way to overload the existing functions.
|
| 100 |
+
* The xmlGc function have an extra entry for atomic block
|
| 101 |
+
* allocations useful for garbage collected memory allocators
|
| 102 |
+
*/
|
| 103 |
+
XMLPUBFUN int
|
| 104 |
+
xmlMemSetup (xmlFreeFunc freeFunc,
|
| 105 |
+
xmlMallocFunc mallocFunc,
|
| 106 |
+
xmlReallocFunc reallocFunc,
|
| 107 |
+
xmlStrdupFunc strdupFunc);
|
| 108 |
+
XMLPUBFUN int
|
| 109 |
+
xmlMemGet (xmlFreeFunc *freeFunc,
|
| 110 |
+
xmlMallocFunc *mallocFunc,
|
| 111 |
+
xmlReallocFunc *reallocFunc,
|
| 112 |
+
xmlStrdupFunc *strdupFunc);
|
| 113 |
+
XMLPUBFUN int
|
| 114 |
+
xmlGcMemSetup (xmlFreeFunc freeFunc,
|
| 115 |
+
xmlMallocFunc mallocFunc,
|
| 116 |
+
xmlMallocFunc mallocAtomicFunc,
|
| 117 |
+
xmlReallocFunc reallocFunc,
|
| 118 |
+
xmlStrdupFunc strdupFunc);
|
| 119 |
+
XMLPUBFUN int
|
| 120 |
+
xmlGcMemGet (xmlFreeFunc *freeFunc,
|
| 121 |
+
xmlMallocFunc *mallocFunc,
|
| 122 |
+
xmlMallocFunc *mallocAtomicFunc,
|
| 123 |
+
xmlReallocFunc *reallocFunc,
|
| 124 |
+
xmlStrdupFunc *strdupFunc);
|
| 125 |
+
|
| 126 |
+
/*
|
| 127 |
+
* Initialization of the memory layer.
|
| 128 |
+
*/
|
| 129 |
+
XML_DEPRECATED
|
| 130 |
+
XMLPUBFUN int
|
| 131 |
+
xmlInitMemory (void);
|
| 132 |
+
|
| 133 |
+
/*
|
| 134 |
+
* Cleanup of the memory layer.
|
| 135 |
+
*/
|
| 136 |
+
XML_DEPRECATED
|
| 137 |
+
XMLPUBFUN void
|
| 138 |
+
xmlCleanupMemory (void);
|
| 139 |
+
/*
|
| 140 |
+
* These are specific to the XML debug memory wrapper.
|
| 141 |
+
*/
|
| 142 |
+
XMLPUBFUN size_t
|
| 143 |
+
xmlMemSize (void *ptr);
|
| 144 |
+
XMLPUBFUN int
|
| 145 |
+
xmlMemUsed (void);
|
| 146 |
+
XMLPUBFUN int
|
| 147 |
+
xmlMemBlocks (void);
|
| 148 |
+
XMLPUBFUN void
|
| 149 |
+
xmlMemDisplay (FILE *fp);
|
| 150 |
+
XMLPUBFUN void
|
| 151 |
+
xmlMemDisplayLast(FILE *fp, long nbBytes);
|
| 152 |
+
XMLPUBFUN void
|
| 153 |
+
xmlMemShow (FILE *fp, int nr);
|
| 154 |
+
XMLPUBFUN void
|
| 155 |
+
xmlMemoryDump (void);
|
| 156 |
+
XMLPUBFUN void *
|
| 157 |
+
xmlMemMalloc (size_t size) LIBXML_ATTR_ALLOC_SIZE(1);
|
| 158 |
+
XMLPUBFUN void *
|
| 159 |
+
xmlMemRealloc (void *ptr,size_t size);
|
| 160 |
+
XMLPUBFUN void
|
| 161 |
+
xmlMemFree (void *ptr);
|
| 162 |
+
XMLPUBFUN char *
|
| 163 |
+
xmlMemoryStrdup (const char *str);
|
| 164 |
+
XMLPUBFUN void *
|
| 165 |
+
xmlMallocLoc (size_t size, const char *file, int line) LIBXML_ATTR_ALLOC_SIZE(1);
|
| 166 |
+
XMLPUBFUN void *
|
| 167 |
+
xmlReallocLoc (void *ptr, size_t size, const char *file, int line);
|
| 168 |
+
XMLPUBFUN void *
|
| 169 |
+
xmlMallocAtomicLoc (size_t size, const char *file, int line) LIBXML_ATTR_ALLOC_SIZE(1);
|
| 170 |
+
XMLPUBFUN char *
|
| 171 |
+
xmlMemStrdupLoc (const char *str, const char *file, int line);
|
| 172 |
+
|
| 173 |
+
|
| 174 |
+
#ifdef DEBUG_MEMORY_LOCATION
|
| 175 |
+
/**
|
| 176 |
+
* xmlMalloc:
|
| 177 |
+
* @size: number of bytes to allocate
|
| 178 |
+
*
|
| 179 |
+
* Wrapper for the malloc() function used in the XML library.
|
| 180 |
+
*
|
| 181 |
+
* Returns the pointer to the allocated area or NULL in case of error.
|
| 182 |
+
*/
|
| 183 |
+
#define xmlMalloc(size) xmlMallocLoc((size), __FILE__, __LINE__)
|
| 184 |
+
/**
|
| 185 |
+
* xmlMallocAtomic:
|
| 186 |
+
* @size: number of bytes to allocate
|
| 187 |
+
*
|
| 188 |
+
* Wrapper for the malloc() function used in the XML library for allocation
|
| 189 |
+
* of block not containing pointers to other areas.
|
| 190 |
+
*
|
| 191 |
+
* Returns the pointer to the allocated area or NULL in case of error.
|
| 192 |
+
*/
|
| 193 |
+
#define xmlMallocAtomic(size) xmlMallocAtomicLoc((size), __FILE__, __LINE__)
|
| 194 |
+
/**
|
| 195 |
+
* xmlRealloc:
|
| 196 |
+
* @ptr: pointer to the existing allocated area
|
| 197 |
+
* @size: number of bytes to allocate
|
| 198 |
+
*
|
| 199 |
+
* Wrapper for the realloc() function used in the XML library.
|
| 200 |
+
*
|
| 201 |
+
* Returns the pointer to the allocated area or NULL in case of error.
|
| 202 |
+
*/
|
| 203 |
+
#define xmlRealloc(ptr, size) xmlReallocLoc((ptr), (size), __FILE__, __LINE__)
|
| 204 |
+
/**
|
| 205 |
+
* xmlMemStrdup:
|
| 206 |
+
* @str: pointer to the existing string
|
| 207 |
+
*
|
| 208 |
+
* Wrapper for the strdup() function, xmlStrdup() is usually preferred.
|
| 209 |
+
*
|
| 210 |
+
* Returns the pointer to the allocated area or NULL in case of error.
|
| 211 |
+
*/
|
| 212 |
+
#define xmlMemStrdup(str) xmlMemStrdupLoc((str), __FILE__, __LINE__)
|
| 213 |
+
|
| 214 |
+
#endif /* DEBUG_MEMORY_LOCATION */
|
| 215 |
+
|
| 216 |
+
#ifdef __cplusplus
|
| 217 |
+
}
|
| 218 |
+
#endif /* __cplusplus */
|
| 219 |
+
|
| 220 |
+
#ifndef __XML_GLOBALS_H
|
| 221 |
+
#ifndef __XML_THREADS_H__
|
| 222 |
+
#include <libxml/threads.h>
|
| 223 |
+
#include <libxml/globals.h>
|
| 224 |
+
#endif
|
| 225 |
+
#endif
|
| 226 |
+
|
| 227 |
+
#endif /* __DEBUG_MEMORY_ALLOC__ */
|
| 228 |
+
|
pgsql/include/libxml/xmlmodule.h
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: dynamic module loading
|
| 3 |
+
* Description: basic API for dynamic module loading, used by
|
| 4 |
+
* libexslt added in 2.6.17
|
| 5 |
+
*
|
| 6 |
+
* Copy: See Copyright for the status of this software.
|
| 7 |
+
*
|
| 8 |
+
* Author: Joel W. Reed
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
#ifndef __XML_MODULE_H__
|
| 12 |
+
#define __XML_MODULE_H__
|
| 13 |
+
|
| 14 |
+
#include <libxml/xmlversion.h>
|
| 15 |
+
|
| 16 |
+
#ifdef LIBXML_MODULES_ENABLED
|
| 17 |
+
|
| 18 |
+
#ifdef __cplusplus
|
| 19 |
+
extern "C" {
|
| 20 |
+
#endif
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* xmlModulePtr:
|
| 24 |
+
*
|
| 25 |
+
* A handle to a dynamically loaded module
|
| 26 |
+
*/
|
| 27 |
+
typedef struct _xmlModule xmlModule;
|
| 28 |
+
typedef xmlModule *xmlModulePtr;
|
| 29 |
+
|
| 30 |
+
/**
|
| 31 |
+
* xmlModuleOption:
|
| 32 |
+
*
|
| 33 |
+
* enumeration of options that can be passed down to xmlModuleOpen()
|
| 34 |
+
*/
|
| 35 |
+
typedef enum {
|
| 36 |
+
XML_MODULE_LAZY = 1, /* lazy binding */
|
| 37 |
+
XML_MODULE_LOCAL= 2 /* local binding */
|
| 38 |
+
} xmlModuleOption;
|
| 39 |
+
|
| 40 |
+
XMLPUBFUN xmlModulePtr xmlModuleOpen (const char *filename,
|
| 41 |
+
int options);
|
| 42 |
+
|
| 43 |
+
XMLPUBFUN int xmlModuleSymbol (xmlModulePtr module,
|
| 44 |
+
const char* name,
|
| 45 |
+
void **result);
|
| 46 |
+
|
| 47 |
+
XMLPUBFUN int xmlModuleClose (xmlModulePtr module);
|
| 48 |
+
|
| 49 |
+
XMLPUBFUN int xmlModuleFree (xmlModulePtr module);
|
| 50 |
+
|
| 51 |
+
#ifdef __cplusplus
|
| 52 |
+
}
|
| 53 |
+
#endif
|
| 54 |
+
|
| 55 |
+
#endif /* LIBXML_MODULES_ENABLED */
|
| 56 |
+
|
| 57 |
+
#endif /*__XML_MODULE_H__ */
|
pgsql/include/libxml/xmlreader.h
ADDED
|
@@ -0,0 +1,428 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: the XMLReader implementation
|
| 3 |
+
* Description: API of the XML streaming API based on C# interfaces.
|
| 4 |
+
*
|
| 5 |
+
* Copy: See Copyright for the status of this software.
|
| 6 |
+
*
|
| 7 |
+
* Author: Daniel Veillard
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef __XML_XMLREADER_H__
|
| 11 |
+
#define __XML_XMLREADER_H__
|
| 12 |
+
|
| 13 |
+
#include <libxml/xmlversion.h>
|
| 14 |
+
#include <libxml/tree.h>
|
| 15 |
+
#include <libxml/xmlIO.h>
|
| 16 |
+
#ifdef LIBXML_SCHEMAS_ENABLED
|
| 17 |
+
#include <libxml/relaxng.h>
|
| 18 |
+
#include <libxml/xmlschemas.h>
|
| 19 |
+
#endif
|
| 20 |
+
|
| 21 |
+
#ifdef __cplusplus
|
| 22 |
+
extern "C" {
|
| 23 |
+
#endif
|
| 24 |
+
|
| 25 |
+
/**
|
| 26 |
+
* xmlParserSeverities:
|
| 27 |
+
*
|
| 28 |
+
* How severe an error callback is when the per-reader error callback API
|
| 29 |
+
* is used.
|
| 30 |
+
*/
|
| 31 |
+
typedef enum {
|
| 32 |
+
XML_PARSER_SEVERITY_VALIDITY_WARNING = 1,
|
| 33 |
+
XML_PARSER_SEVERITY_VALIDITY_ERROR = 2,
|
| 34 |
+
XML_PARSER_SEVERITY_WARNING = 3,
|
| 35 |
+
XML_PARSER_SEVERITY_ERROR = 4
|
| 36 |
+
} xmlParserSeverities;
|
| 37 |
+
|
| 38 |
+
#ifdef LIBXML_READER_ENABLED
|
| 39 |
+
|
| 40 |
+
/**
|
| 41 |
+
* xmlTextReaderMode:
|
| 42 |
+
*
|
| 43 |
+
* Internal state values for the reader.
|
| 44 |
+
*/
|
| 45 |
+
typedef enum {
|
| 46 |
+
XML_TEXTREADER_MODE_INITIAL = 0,
|
| 47 |
+
XML_TEXTREADER_MODE_INTERACTIVE = 1,
|
| 48 |
+
XML_TEXTREADER_MODE_ERROR = 2,
|
| 49 |
+
XML_TEXTREADER_MODE_EOF =3,
|
| 50 |
+
XML_TEXTREADER_MODE_CLOSED = 4,
|
| 51 |
+
XML_TEXTREADER_MODE_READING = 5
|
| 52 |
+
} xmlTextReaderMode;
|
| 53 |
+
|
| 54 |
+
/**
|
| 55 |
+
* xmlParserProperties:
|
| 56 |
+
*
|
| 57 |
+
* Some common options to use with xmlTextReaderSetParserProp, but it
|
| 58 |
+
* is better to use xmlParserOption and the xmlReaderNewxxx and
|
| 59 |
+
* xmlReaderForxxx APIs now.
|
| 60 |
+
*/
|
| 61 |
+
typedef enum {
|
| 62 |
+
XML_PARSER_LOADDTD = 1,
|
| 63 |
+
XML_PARSER_DEFAULTATTRS = 2,
|
| 64 |
+
XML_PARSER_VALIDATE = 3,
|
| 65 |
+
XML_PARSER_SUBST_ENTITIES = 4
|
| 66 |
+
} xmlParserProperties;
|
| 67 |
+
|
| 68 |
+
/**
|
| 69 |
+
* xmlReaderTypes:
|
| 70 |
+
*
|
| 71 |
+
* Predefined constants for the different types of nodes.
|
| 72 |
+
*/
|
| 73 |
+
typedef enum {
|
| 74 |
+
XML_READER_TYPE_NONE = 0,
|
| 75 |
+
XML_READER_TYPE_ELEMENT = 1,
|
| 76 |
+
XML_READER_TYPE_ATTRIBUTE = 2,
|
| 77 |
+
XML_READER_TYPE_TEXT = 3,
|
| 78 |
+
XML_READER_TYPE_CDATA = 4,
|
| 79 |
+
XML_READER_TYPE_ENTITY_REFERENCE = 5,
|
| 80 |
+
XML_READER_TYPE_ENTITY = 6,
|
| 81 |
+
XML_READER_TYPE_PROCESSING_INSTRUCTION = 7,
|
| 82 |
+
XML_READER_TYPE_COMMENT = 8,
|
| 83 |
+
XML_READER_TYPE_DOCUMENT = 9,
|
| 84 |
+
XML_READER_TYPE_DOCUMENT_TYPE = 10,
|
| 85 |
+
XML_READER_TYPE_DOCUMENT_FRAGMENT = 11,
|
| 86 |
+
XML_READER_TYPE_NOTATION = 12,
|
| 87 |
+
XML_READER_TYPE_WHITESPACE = 13,
|
| 88 |
+
XML_READER_TYPE_SIGNIFICANT_WHITESPACE = 14,
|
| 89 |
+
XML_READER_TYPE_END_ELEMENT = 15,
|
| 90 |
+
XML_READER_TYPE_END_ENTITY = 16,
|
| 91 |
+
XML_READER_TYPE_XML_DECLARATION = 17
|
| 92 |
+
} xmlReaderTypes;
|
| 93 |
+
|
| 94 |
+
/**
|
| 95 |
+
* xmlTextReader:
|
| 96 |
+
*
|
| 97 |
+
* Structure for an xmlReader context.
|
| 98 |
+
*/
|
| 99 |
+
typedef struct _xmlTextReader xmlTextReader;
|
| 100 |
+
|
| 101 |
+
/**
|
| 102 |
+
* xmlTextReaderPtr:
|
| 103 |
+
*
|
| 104 |
+
* Pointer to an xmlReader context.
|
| 105 |
+
*/
|
| 106 |
+
typedef xmlTextReader *xmlTextReaderPtr;
|
| 107 |
+
|
| 108 |
+
/*
|
| 109 |
+
* Constructors & Destructor
|
| 110 |
+
*/
|
| 111 |
+
XMLPUBFUN xmlTextReaderPtr
|
| 112 |
+
xmlNewTextReader (xmlParserInputBufferPtr input,
|
| 113 |
+
const char *URI);
|
| 114 |
+
XMLPUBFUN xmlTextReaderPtr
|
| 115 |
+
xmlNewTextReaderFilename(const char *URI);
|
| 116 |
+
|
| 117 |
+
XMLPUBFUN void
|
| 118 |
+
xmlFreeTextReader (xmlTextReaderPtr reader);
|
| 119 |
+
|
| 120 |
+
XMLPUBFUN int
|
| 121 |
+
xmlTextReaderSetup(xmlTextReaderPtr reader,
|
| 122 |
+
xmlParserInputBufferPtr input, const char *URL,
|
| 123 |
+
const char *encoding, int options);
|
| 124 |
+
|
| 125 |
+
/*
|
| 126 |
+
* Iterators
|
| 127 |
+
*/
|
| 128 |
+
XMLPUBFUN int
|
| 129 |
+
xmlTextReaderRead (xmlTextReaderPtr reader);
|
| 130 |
+
|
| 131 |
+
#ifdef LIBXML_WRITER_ENABLED
|
| 132 |
+
XMLPUBFUN xmlChar *
|
| 133 |
+
xmlTextReaderReadInnerXml(xmlTextReaderPtr reader);
|
| 134 |
+
|
| 135 |
+
XMLPUBFUN xmlChar *
|
| 136 |
+
xmlTextReaderReadOuterXml(xmlTextReaderPtr reader);
|
| 137 |
+
#endif
|
| 138 |
+
|
| 139 |
+
XMLPUBFUN xmlChar *
|
| 140 |
+
xmlTextReaderReadString (xmlTextReaderPtr reader);
|
| 141 |
+
XMLPUBFUN int
|
| 142 |
+
xmlTextReaderReadAttributeValue(xmlTextReaderPtr reader);
|
| 143 |
+
|
| 144 |
+
/*
|
| 145 |
+
* Attributes of the node
|
| 146 |
+
*/
|
| 147 |
+
XMLPUBFUN int
|
| 148 |
+
xmlTextReaderAttributeCount(xmlTextReaderPtr reader);
|
| 149 |
+
XMLPUBFUN int
|
| 150 |
+
xmlTextReaderDepth (xmlTextReaderPtr reader);
|
| 151 |
+
XMLPUBFUN int
|
| 152 |
+
xmlTextReaderHasAttributes(xmlTextReaderPtr reader);
|
| 153 |
+
XMLPUBFUN int
|
| 154 |
+
xmlTextReaderHasValue(xmlTextReaderPtr reader);
|
| 155 |
+
XMLPUBFUN int
|
| 156 |
+
xmlTextReaderIsDefault (xmlTextReaderPtr reader);
|
| 157 |
+
XMLPUBFUN int
|
| 158 |
+
xmlTextReaderIsEmptyElement(xmlTextReaderPtr reader);
|
| 159 |
+
XMLPUBFUN int
|
| 160 |
+
xmlTextReaderNodeType (xmlTextReaderPtr reader);
|
| 161 |
+
XMLPUBFUN int
|
| 162 |
+
xmlTextReaderQuoteChar (xmlTextReaderPtr reader);
|
| 163 |
+
XMLPUBFUN int
|
| 164 |
+
xmlTextReaderReadState (xmlTextReaderPtr reader);
|
| 165 |
+
XMLPUBFUN int
|
| 166 |
+
xmlTextReaderIsNamespaceDecl(xmlTextReaderPtr reader);
|
| 167 |
+
|
| 168 |
+
XMLPUBFUN const xmlChar *
|
| 169 |
+
xmlTextReaderConstBaseUri (xmlTextReaderPtr reader);
|
| 170 |
+
XMLPUBFUN const xmlChar *
|
| 171 |
+
xmlTextReaderConstLocalName (xmlTextReaderPtr reader);
|
| 172 |
+
XMLPUBFUN const xmlChar *
|
| 173 |
+
xmlTextReaderConstName (xmlTextReaderPtr reader);
|
| 174 |
+
XMLPUBFUN const xmlChar *
|
| 175 |
+
xmlTextReaderConstNamespaceUri(xmlTextReaderPtr reader);
|
| 176 |
+
XMLPUBFUN const xmlChar *
|
| 177 |
+
xmlTextReaderConstPrefix (xmlTextReaderPtr reader);
|
| 178 |
+
XMLPUBFUN const xmlChar *
|
| 179 |
+
xmlTextReaderConstXmlLang (xmlTextReaderPtr reader);
|
| 180 |
+
XMLPUBFUN const xmlChar *
|
| 181 |
+
xmlTextReaderConstString (xmlTextReaderPtr reader,
|
| 182 |
+
const xmlChar *str);
|
| 183 |
+
XMLPUBFUN const xmlChar *
|
| 184 |
+
xmlTextReaderConstValue (xmlTextReaderPtr reader);
|
| 185 |
+
|
| 186 |
+
/*
|
| 187 |
+
* use the Const version of the routine for
|
| 188 |
+
* better performance and simpler code
|
| 189 |
+
*/
|
| 190 |
+
XMLPUBFUN xmlChar *
|
| 191 |
+
xmlTextReaderBaseUri (xmlTextReaderPtr reader);
|
| 192 |
+
XMLPUBFUN xmlChar *
|
| 193 |
+
xmlTextReaderLocalName (xmlTextReaderPtr reader);
|
| 194 |
+
XMLPUBFUN xmlChar *
|
| 195 |
+
xmlTextReaderName (xmlTextReaderPtr reader);
|
| 196 |
+
XMLPUBFUN xmlChar *
|
| 197 |
+
xmlTextReaderNamespaceUri(xmlTextReaderPtr reader);
|
| 198 |
+
XMLPUBFUN xmlChar *
|
| 199 |
+
xmlTextReaderPrefix (xmlTextReaderPtr reader);
|
| 200 |
+
XMLPUBFUN xmlChar *
|
| 201 |
+
xmlTextReaderXmlLang (xmlTextReaderPtr reader);
|
| 202 |
+
XMLPUBFUN xmlChar *
|
| 203 |
+
xmlTextReaderValue (xmlTextReaderPtr reader);
|
| 204 |
+
|
| 205 |
+
/*
|
| 206 |
+
* Methods of the XmlTextReader
|
| 207 |
+
*/
|
| 208 |
+
XMLPUBFUN int
|
| 209 |
+
xmlTextReaderClose (xmlTextReaderPtr reader);
|
| 210 |
+
XMLPUBFUN xmlChar *
|
| 211 |
+
xmlTextReaderGetAttributeNo (xmlTextReaderPtr reader,
|
| 212 |
+
int no);
|
| 213 |
+
XMLPUBFUN xmlChar *
|
| 214 |
+
xmlTextReaderGetAttribute (xmlTextReaderPtr reader,
|
| 215 |
+
const xmlChar *name);
|
| 216 |
+
XMLPUBFUN xmlChar *
|
| 217 |
+
xmlTextReaderGetAttributeNs (xmlTextReaderPtr reader,
|
| 218 |
+
const xmlChar *localName,
|
| 219 |
+
const xmlChar *namespaceURI);
|
| 220 |
+
XMLPUBFUN xmlParserInputBufferPtr
|
| 221 |
+
xmlTextReaderGetRemainder (xmlTextReaderPtr reader);
|
| 222 |
+
XMLPUBFUN xmlChar *
|
| 223 |
+
xmlTextReaderLookupNamespace(xmlTextReaderPtr reader,
|
| 224 |
+
const xmlChar *prefix);
|
| 225 |
+
XMLPUBFUN int
|
| 226 |
+
xmlTextReaderMoveToAttributeNo(xmlTextReaderPtr reader,
|
| 227 |
+
int no);
|
| 228 |
+
XMLPUBFUN int
|
| 229 |
+
xmlTextReaderMoveToAttribute(xmlTextReaderPtr reader,
|
| 230 |
+
const xmlChar *name);
|
| 231 |
+
XMLPUBFUN int
|
| 232 |
+
xmlTextReaderMoveToAttributeNs(xmlTextReaderPtr reader,
|
| 233 |
+
const xmlChar *localName,
|
| 234 |
+
const xmlChar *namespaceURI);
|
| 235 |
+
XMLPUBFUN int
|
| 236 |
+
xmlTextReaderMoveToFirstAttribute(xmlTextReaderPtr reader);
|
| 237 |
+
XMLPUBFUN int
|
| 238 |
+
xmlTextReaderMoveToNextAttribute(xmlTextReaderPtr reader);
|
| 239 |
+
XMLPUBFUN int
|
| 240 |
+
xmlTextReaderMoveToElement (xmlTextReaderPtr reader);
|
| 241 |
+
XMLPUBFUN int
|
| 242 |
+
xmlTextReaderNormalization (xmlTextReaderPtr reader);
|
| 243 |
+
XMLPUBFUN const xmlChar *
|
| 244 |
+
xmlTextReaderConstEncoding (xmlTextReaderPtr reader);
|
| 245 |
+
|
| 246 |
+
/*
|
| 247 |
+
* Extensions
|
| 248 |
+
*/
|
| 249 |
+
XMLPUBFUN int
|
| 250 |
+
xmlTextReaderSetParserProp (xmlTextReaderPtr reader,
|
| 251 |
+
int prop,
|
| 252 |
+
int value);
|
| 253 |
+
XMLPUBFUN int
|
| 254 |
+
xmlTextReaderGetParserProp (xmlTextReaderPtr reader,
|
| 255 |
+
int prop);
|
| 256 |
+
XMLPUBFUN xmlNodePtr
|
| 257 |
+
xmlTextReaderCurrentNode (xmlTextReaderPtr reader);
|
| 258 |
+
|
| 259 |
+
XMLPUBFUN int
|
| 260 |
+
xmlTextReaderGetParserLineNumber(xmlTextReaderPtr reader);
|
| 261 |
+
|
| 262 |
+
XMLPUBFUN int
|
| 263 |
+
xmlTextReaderGetParserColumnNumber(xmlTextReaderPtr reader);
|
| 264 |
+
|
| 265 |
+
XMLPUBFUN xmlNodePtr
|
| 266 |
+
xmlTextReaderPreserve (xmlTextReaderPtr reader);
|
| 267 |
+
#ifdef LIBXML_PATTERN_ENABLED
|
| 268 |
+
XMLPUBFUN int
|
| 269 |
+
xmlTextReaderPreservePattern(xmlTextReaderPtr reader,
|
| 270 |
+
const xmlChar *pattern,
|
| 271 |
+
const xmlChar **namespaces);
|
| 272 |
+
#endif /* LIBXML_PATTERN_ENABLED */
|
| 273 |
+
XMLPUBFUN xmlDocPtr
|
| 274 |
+
xmlTextReaderCurrentDoc (xmlTextReaderPtr reader);
|
| 275 |
+
XMLPUBFUN xmlNodePtr
|
| 276 |
+
xmlTextReaderExpand (xmlTextReaderPtr reader);
|
| 277 |
+
XMLPUBFUN int
|
| 278 |
+
xmlTextReaderNext (xmlTextReaderPtr reader);
|
| 279 |
+
XMLPUBFUN int
|
| 280 |
+
xmlTextReaderNextSibling (xmlTextReaderPtr reader);
|
| 281 |
+
XMLPUBFUN int
|
| 282 |
+
xmlTextReaderIsValid (xmlTextReaderPtr reader);
|
| 283 |
+
#ifdef LIBXML_SCHEMAS_ENABLED
|
| 284 |
+
XMLPUBFUN int
|
| 285 |
+
xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader,
|
| 286 |
+
const char *rng);
|
| 287 |
+
XMLPUBFUN int
|
| 288 |
+
xmlTextReaderRelaxNGValidateCtxt(xmlTextReaderPtr reader,
|
| 289 |
+
xmlRelaxNGValidCtxtPtr ctxt,
|
| 290 |
+
int options);
|
| 291 |
+
|
| 292 |
+
XMLPUBFUN int
|
| 293 |
+
xmlTextReaderRelaxNGSetSchema(xmlTextReaderPtr reader,
|
| 294 |
+
xmlRelaxNGPtr schema);
|
| 295 |
+
XMLPUBFUN int
|
| 296 |
+
xmlTextReaderSchemaValidate (xmlTextReaderPtr reader,
|
| 297 |
+
const char *xsd);
|
| 298 |
+
XMLPUBFUN int
|
| 299 |
+
xmlTextReaderSchemaValidateCtxt(xmlTextReaderPtr reader,
|
| 300 |
+
xmlSchemaValidCtxtPtr ctxt,
|
| 301 |
+
int options);
|
| 302 |
+
XMLPUBFUN int
|
| 303 |
+
xmlTextReaderSetSchema (xmlTextReaderPtr reader,
|
| 304 |
+
xmlSchemaPtr schema);
|
| 305 |
+
#endif
|
| 306 |
+
XMLPUBFUN const xmlChar *
|
| 307 |
+
xmlTextReaderConstXmlVersion(xmlTextReaderPtr reader);
|
| 308 |
+
XMLPUBFUN int
|
| 309 |
+
xmlTextReaderStandalone (xmlTextReaderPtr reader);
|
| 310 |
+
|
| 311 |
+
|
| 312 |
+
/*
|
| 313 |
+
* Index lookup
|
| 314 |
+
*/
|
| 315 |
+
XMLPUBFUN long
|
| 316 |
+
xmlTextReaderByteConsumed (xmlTextReaderPtr reader);
|
| 317 |
+
|
| 318 |
+
/*
|
| 319 |
+
* New more complete APIs for simpler creation and reuse of readers
|
| 320 |
+
*/
|
| 321 |
+
XMLPUBFUN xmlTextReaderPtr
|
| 322 |
+
xmlReaderWalker (xmlDocPtr doc);
|
| 323 |
+
XMLPUBFUN xmlTextReaderPtr
|
| 324 |
+
xmlReaderForDoc (const xmlChar * cur,
|
| 325 |
+
const char *URL,
|
| 326 |
+
const char *encoding,
|
| 327 |
+
int options);
|
| 328 |
+
XMLPUBFUN xmlTextReaderPtr
|
| 329 |
+
xmlReaderForFile (const char *filename,
|
| 330 |
+
const char *encoding,
|
| 331 |
+
int options);
|
| 332 |
+
XMLPUBFUN xmlTextReaderPtr
|
| 333 |
+
xmlReaderForMemory (const char *buffer,
|
| 334 |
+
int size,
|
| 335 |
+
const char *URL,
|
| 336 |
+
const char *encoding,
|
| 337 |
+
int options);
|
| 338 |
+
XMLPUBFUN xmlTextReaderPtr
|
| 339 |
+
xmlReaderForFd (int fd,
|
| 340 |
+
const char *URL,
|
| 341 |
+
const char *encoding,
|
| 342 |
+
int options);
|
| 343 |
+
XMLPUBFUN xmlTextReaderPtr
|
| 344 |
+
xmlReaderForIO (xmlInputReadCallback ioread,
|
| 345 |
+
xmlInputCloseCallback ioclose,
|
| 346 |
+
void *ioctx,
|
| 347 |
+
const char *URL,
|
| 348 |
+
const char *encoding,
|
| 349 |
+
int options);
|
| 350 |
+
|
| 351 |
+
XMLPUBFUN int
|
| 352 |
+
xmlReaderNewWalker (xmlTextReaderPtr reader,
|
| 353 |
+
xmlDocPtr doc);
|
| 354 |
+
XMLPUBFUN int
|
| 355 |
+
xmlReaderNewDoc (xmlTextReaderPtr reader,
|
| 356 |
+
const xmlChar * cur,
|
| 357 |
+
const char *URL,
|
| 358 |
+
const char *encoding,
|
| 359 |
+
int options);
|
| 360 |
+
XMLPUBFUN int
|
| 361 |
+
xmlReaderNewFile (xmlTextReaderPtr reader,
|
| 362 |
+
const char *filename,
|
| 363 |
+
const char *encoding,
|
| 364 |
+
int options);
|
| 365 |
+
XMLPUBFUN int
|
| 366 |
+
xmlReaderNewMemory (xmlTextReaderPtr reader,
|
| 367 |
+
const char *buffer,
|
| 368 |
+
int size,
|
| 369 |
+
const char *URL,
|
| 370 |
+
const char *encoding,
|
| 371 |
+
int options);
|
| 372 |
+
XMLPUBFUN int
|
| 373 |
+
xmlReaderNewFd (xmlTextReaderPtr reader,
|
| 374 |
+
int fd,
|
| 375 |
+
const char *URL,
|
| 376 |
+
const char *encoding,
|
| 377 |
+
int options);
|
| 378 |
+
XMLPUBFUN int
|
| 379 |
+
xmlReaderNewIO (xmlTextReaderPtr reader,
|
| 380 |
+
xmlInputReadCallback ioread,
|
| 381 |
+
xmlInputCloseCallback ioclose,
|
| 382 |
+
void *ioctx,
|
| 383 |
+
const char *URL,
|
| 384 |
+
const char *encoding,
|
| 385 |
+
int options);
|
| 386 |
+
/*
|
| 387 |
+
* Error handling extensions
|
| 388 |
+
*/
|
| 389 |
+
typedef void * xmlTextReaderLocatorPtr;
|
| 390 |
+
|
| 391 |
+
/**
|
| 392 |
+
* xmlTextReaderErrorFunc:
|
| 393 |
+
* @arg: the user argument
|
| 394 |
+
* @msg: the message
|
| 395 |
+
* @severity: the severity of the error
|
| 396 |
+
* @locator: a locator indicating where the error occurred
|
| 397 |
+
*
|
| 398 |
+
* Signature of an error callback from a reader parser
|
| 399 |
+
*/
|
| 400 |
+
typedef void (*xmlTextReaderErrorFunc)(void *arg,
|
| 401 |
+
const char *msg,
|
| 402 |
+
xmlParserSeverities severity,
|
| 403 |
+
xmlTextReaderLocatorPtr locator);
|
| 404 |
+
XMLPUBFUN int
|
| 405 |
+
xmlTextReaderLocatorLineNumber(xmlTextReaderLocatorPtr locator);
|
| 406 |
+
XMLPUBFUN xmlChar *
|
| 407 |
+
xmlTextReaderLocatorBaseURI (xmlTextReaderLocatorPtr locator);
|
| 408 |
+
XMLPUBFUN void
|
| 409 |
+
xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader,
|
| 410 |
+
xmlTextReaderErrorFunc f,
|
| 411 |
+
void *arg);
|
| 412 |
+
XMLPUBFUN void
|
| 413 |
+
xmlTextReaderSetStructuredErrorHandler(xmlTextReaderPtr reader,
|
| 414 |
+
xmlStructuredErrorFunc f,
|
| 415 |
+
void *arg);
|
| 416 |
+
XMLPUBFUN void
|
| 417 |
+
xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader,
|
| 418 |
+
xmlTextReaderErrorFunc *f,
|
| 419 |
+
void **arg);
|
| 420 |
+
|
| 421 |
+
#endif /* LIBXML_READER_ENABLED */
|
| 422 |
+
|
| 423 |
+
#ifdef __cplusplus
|
| 424 |
+
}
|
| 425 |
+
#endif
|
| 426 |
+
|
| 427 |
+
#endif /* __XML_XMLREADER_H__ */
|
| 428 |
+
|
pgsql/include/libxml/xmlregexp.h
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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+
* Summary: regular expressions handling
|
| 3 |
+
* Description: basic API for libxml regular expressions handling used
|
| 4 |
+
* for XML Schemas and validation.
|
| 5 |
+
*
|
| 6 |
+
* Copy: See Copyright for the status of this software.
|
| 7 |
+
*
|
| 8 |
+
* Author: Daniel Veillard
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
#ifndef __XML_REGEXP_H__
|
| 12 |
+
#define __XML_REGEXP_H__
|
| 13 |
+
|
| 14 |
+
#include <libxml/xmlversion.h>
|
| 15 |
+
|
| 16 |
+
#ifdef LIBXML_REGEXP_ENABLED
|
| 17 |
+
|
| 18 |
+
#ifdef __cplusplus
|
| 19 |
+
extern "C" {
|
| 20 |
+
#endif
|
| 21 |
+
|
| 22 |
+
/**
|
| 23 |
+
* xmlRegexpPtr:
|
| 24 |
+
*
|
| 25 |
+
* A libxml regular expression, they can actually be far more complex
|
| 26 |
+
* thank the POSIX regex expressions.
|
| 27 |
+
*/
|
| 28 |
+
typedef struct _xmlRegexp xmlRegexp;
|
| 29 |
+
typedef xmlRegexp *xmlRegexpPtr;
|
| 30 |
+
|
| 31 |
+
/**
|
| 32 |
+
* xmlRegExecCtxtPtr:
|
| 33 |
+
*
|
| 34 |
+
* A libxml progressive regular expression evaluation context
|
| 35 |
+
*/
|
| 36 |
+
typedef struct _xmlRegExecCtxt xmlRegExecCtxt;
|
| 37 |
+
typedef xmlRegExecCtxt *xmlRegExecCtxtPtr;
|
| 38 |
+
|
| 39 |
+
#ifdef __cplusplus
|
| 40 |
+
}
|
| 41 |
+
#endif
|
| 42 |
+
#include <libxml/tree.h>
|
| 43 |
+
#include <libxml/dict.h>
|
| 44 |
+
#ifdef __cplusplus
|
| 45 |
+
extern "C" {
|
| 46 |
+
#endif
|
| 47 |
+
|
| 48 |
+
/*
|
| 49 |
+
* The POSIX like API
|
| 50 |
+
*/
|
| 51 |
+
XMLPUBFUN xmlRegexpPtr
|
| 52 |
+
xmlRegexpCompile (const xmlChar *regexp);
|
| 53 |
+
XMLPUBFUN void xmlRegFreeRegexp(xmlRegexpPtr regexp);
|
| 54 |
+
XMLPUBFUN int
|
| 55 |
+
xmlRegexpExec (xmlRegexpPtr comp,
|
| 56 |
+
const xmlChar *value);
|
| 57 |
+
XMLPUBFUN void
|
| 58 |
+
xmlRegexpPrint (FILE *output,
|
| 59 |
+
xmlRegexpPtr regexp);
|
| 60 |
+
XMLPUBFUN int
|
| 61 |
+
xmlRegexpIsDeterminist(xmlRegexpPtr comp);
|
| 62 |
+
|
| 63 |
+
/**
|
| 64 |
+
* xmlRegExecCallbacks:
|
| 65 |
+
* @exec: the regular expression context
|
| 66 |
+
* @token: the current token string
|
| 67 |
+
* @transdata: transition data
|
| 68 |
+
* @inputdata: input data
|
| 69 |
+
*
|
| 70 |
+
* Callback function when doing a transition in the automata
|
| 71 |
+
*/
|
| 72 |
+
typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec,
|
| 73 |
+
const xmlChar *token,
|
| 74 |
+
void *transdata,
|
| 75 |
+
void *inputdata);
|
| 76 |
+
|
| 77 |
+
/*
|
| 78 |
+
* The progressive API
|
| 79 |
+
*/
|
| 80 |
+
XMLPUBFUN xmlRegExecCtxtPtr
|
| 81 |
+
xmlRegNewExecCtxt (xmlRegexpPtr comp,
|
| 82 |
+
xmlRegExecCallbacks callback,
|
| 83 |
+
void *data);
|
| 84 |
+
XMLPUBFUN void
|
| 85 |
+
xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec);
|
| 86 |
+
XMLPUBFUN int
|
| 87 |
+
xmlRegExecPushString(xmlRegExecCtxtPtr exec,
|
| 88 |
+
const xmlChar *value,
|
| 89 |
+
void *data);
|
| 90 |
+
XMLPUBFUN int
|
| 91 |
+
xmlRegExecPushString2(xmlRegExecCtxtPtr exec,
|
| 92 |
+
const xmlChar *value,
|
| 93 |
+
const xmlChar *value2,
|
| 94 |
+
void *data);
|
| 95 |
+
|
| 96 |
+
XMLPUBFUN int
|
| 97 |
+
xmlRegExecNextValues(xmlRegExecCtxtPtr exec,
|
| 98 |
+
int *nbval,
|
| 99 |
+
int *nbneg,
|
| 100 |
+
xmlChar **values,
|
| 101 |
+
int *terminal);
|
| 102 |
+
XMLPUBFUN int
|
| 103 |
+
xmlRegExecErrInfo (xmlRegExecCtxtPtr exec,
|
| 104 |
+
const xmlChar **string,
|
| 105 |
+
int *nbval,
|
| 106 |
+
int *nbneg,
|
| 107 |
+
xmlChar **values,
|
| 108 |
+
int *terminal);
|
| 109 |
+
#ifdef LIBXML_EXPR_ENABLED
|
| 110 |
+
/*
|
| 111 |
+
* Formal regular expression handling
|
| 112 |
+
* Its goal is to do some formal work on content models
|
| 113 |
+
*/
|
| 114 |
+
|
| 115 |
+
/* expressions are used within a context */
|
| 116 |
+
typedef struct _xmlExpCtxt xmlExpCtxt;
|
| 117 |
+
typedef xmlExpCtxt *xmlExpCtxtPtr;
|
| 118 |
+
|
| 119 |
+
XMLPUBFUN void
|
| 120 |
+
xmlExpFreeCtxt (xmlExpCtxtPtr ctxt);
|
| 121 |
+
XMLPUBFUN xmlExpCtxtPtr
|
| 122 |
+
xmlExpNewCtxt (int maxNodes,
|
| 123 |
+
xmlDictPtr dict);
|
| 124 |
+
|
| 125 |
+
XMLPUBFUN int
|
| 126 |
+
xmlExpCtxtNbNodes(xmlExpCtxtPtr ctxt);
|
| 127 |
+
XMLPUBFUN int
|
| 128 |
+
xmlExpCtxtNbCons(xmlExpCtxtPtr ctxt);
|
| 129 |
+
|
| 130 |
+
/* Expressions are trees but the tree is opaque */
|
| 131 |
+
typedef struct _xmlExpNode xmlExpNode;
|
| 132 |
+
typedef xmlExpNode *xmlExpNodePtr;
|
| 133 |
+
|
| 134 |
+
typedef enum {
|
| 135 |
+
XML_EXP_EMPTY = 0,
|
| 136 |
+
XML_EXP_FORBID = 1,
|
| 137 |
+
XML_EXP_ATOM = 2,
|
| 138 |
+
XML_EXP_SEQ = 3,
|
| 139 |
+
XML_EXP_OR = 4,
|
| 140 |
+
XML_EXP_COUNT = 5
|
| 141 |
+
} xmlExpNodeType;
|
| 142 |
+
|
| 143 |
+
/*
|
| 144 |
+
* 2 core expressions shared by all for the empty language set
|
| 145 |
+
* and for the set with just the empty token
|
| 146 |
+
*/
|
| 147 |
+
XMLPUBVAR xmlExpNodePtr forbiddenExp;
|
| 148 |
+
XMLPUBVAR xmlExpNodePtr emptyExp;
|
| 149 |
+
|
| 150 |
+
/*
|
| 151 |
+
* Expressions are reference counted internally
|
| 152 |
+
*/
|
| 153 |
+
XMLPUBFUN void
|
| 154 |
+
xmlExpFree (xmlExpCtxtPtr ctxt,
|
| 155 |
+
xmlExpNodePtr expr);
|
| 156 |
+
XMLPUBFUN void
|
| 157 |
+
xmlExpRef (xmlExpNodePtr expr);
|
| 158 |
+
|
| 159 |
+
/*
|
| 160 |
+
* constructors can be either manual or from a string
|
| 161 |
+
*/
|
| 162 |
+
XMLPUBFUN xmlExpNodePtr
|
| 163 |
+
xmlExpParse (xmlExpCtxtPtr ctxt,
|
| 164 |
+
const char *expr);
|
| 165 |
+
XMLPUBFUN xmlExpNodePtr
|
| 166 |
+
xmlExpNewAtom (xmlExpCtxtPtr ctxt,
|
| 167 |
+
const xmlChar *name,
|
| 168 |
+
int len);
|
| 169 |
+
XMLPUBFUN xmlExpNodePtr
|
| 170 |
+
xmlExpNewOr (xmlExpCtxtPtr ctxt,
|
| 171 |
+
xmlExpNodePtr left,
|
| 172 |
+
xmlExpNodePtr right);
|
| 173 |
+
XMLPUBFUN xmlExpNodePtr
|
| 174 |
+
xmlExpNewSeq (xmlExpCtxtPtr ctxt,
|
| 175 |
+
xmlExpNodePtr left,
|
| 176 |
+
xmlExpNodePtr right);
|
| 177 |
+
XMLPUBFUN xmlExpNodePtr
|
| 178 |
+
xmlExpNewRange (xmlExpCtxtPtr ctxt,
|
| 179 |
+
xmlExpNodePtr subset,
|
| 180 |
+
int min,
|
| 181 |
+
int max);
|
| 182 |
+
/*
|
| 183 |
+
* The really interesting APIs
|
| 184 |
+
*/
|
| 185 |
+
XMLPUBFUN int
|
| 186 |
+
xmlExpIsNillable(xmlExpNodePtr expr);
|
| 187 |
+
XMLPUBFUN int
|
| 188 |
+
xmlExpMaxToken (xmlExpNodePtr expr);
|
| 189 |
+
XMLPUBFUN int
|
| 190 |
+
xmlExpGetLanguage(xmlExpCtxtPtr ctxt,
|
| 191 |
+
xmlExpNodePtr expr,
|
| 192 |
+
const xmlChar**langList,
|
| 193 |
+
int len);
|
| 194 |
+
XMLPUBFUN int
|
| 195 |
+
xmlExpGetStart (xmlExpCtxtPtr ctxt,
|
| 196 |
+
xmlExpNodePtr expr,
|
| 197 |
+
const xmlChar**tokList,
|
| 198 |
+
int len);
|
| 199 |
+
XMLPUBFUN xmlExpNodePtr
|
| 200 |
+
xmlExpStringDerive(xmlExpCtxtPtr ctxt,
|
| 201 |
+
xmlExpNodePtr expr,
|
| 202 |
+
const xmlChar *str,
|
| 203 |
+
int len);
|
| 204 |
+
XMLPUBFUN xmlExpNodePtr
|
| 205 |
+
xmlExpExpDerive (xmlExpCtxtPtr ctxt,
|
| 206 |
+
xmlExpNodePtr expr,
|
| 207 |
+
xmlExpNodePtr sub);
|
| 208 |
+
XMLPUBFUN int
|
| 209 |
+
xmlExpSubsume (xmlExpCtxtPtr ctxt,
|
| 210 |
+
xmlExpNodePtr expr,
|
| 211 |
+
xmlExpNodePtr sub);
|
| 212 |
+
XMLPUBFUN void
|
| 213 |
+
xmlExpDump (xmlBufferPtr buf,
|
| 214 |
+
xmlExpNodePtr expr);
|
| 215 |
+
#endif /* LIBXML_EXPR_ENABLED */
|
| 216 |
+
#ifdef __cplusplus
|
| 217 |
+
}
|
| 218 |
+
#endif
|
| 219 |
+
|
| 220 |
+
#endif /* LIBXML_REGEXP_ENABLED */
|
| 221 |
+
|
| 222 |
+
#endif /*__XML_REGEXP_H__ */
|
pgsql/include/libxml/xmlsave.h
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: the XML document serializer
|
| 3 |
+
* Description: API to save document or subtree of document
|
| 4 |
+
*
|
| 5 |
+
* Copy: See Copyright for the status of this software.
|
| 6 |
+
*
|
| 7 |
+
* Author: Daniel Veillard
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef __XML_XMLSAVE_H__
|
| 11 |
+
#define __XML_XMLSAVE_H__
|
| 12 |
+
|
| 13 |
+
#include <libxml/xmlversion.h>
|
| 14 |
+
#include <libxml/tree.h>
|
| 15 |
+
#include <libxml/encoding.h>
|
| 16 |
+
#include <libxml/xmlIO.h>
|
| 17 |
+
|
| 18 |
+
#ifdef LIBXML_OUTPUT_ENABLED
|
| 19 |
+
#ifdef __cplusplus
|
| 20 |
+
extern "C" {
|
| 21 |
+
#endif
|
| 22 |
+
|
| 23 |
+
/**
|
| 24 |
+
* xmlSaveOption:
|
| 25 |
+
*
|
| 26 |
+
* This is the set of XML save options that can be passed down
|
| 27 |
+
* to the xmlSaveToFd() and similar calls.
|
| 28 |
+
*/
|
| 29 |
+
typedef enum {
|
| 30 |
+
XML_SAVE_FORMAT = 1<<0, /* format save output */
|
| 31 |
+
XML_SAVE_NO_DECL = 1<<1, /* drop the xml declaration */
|
| 32 |
+
XML_SAVE_NO_EMPTY = 1<<2, /* no empty tags */
|
| 33 |
+
XML_SAVE_NO_XHTML = 1<<3, /* disable XHTML1 specific rules */
|
| 34 |
+
XML_SAVE_XHTML = 1<<4, /* force XHTML1 specific rules */
|
| 35 |
+
XML_SAVE_AS_XML = 1<<5, /* force XML serialization on HTML doc */
|
| 36 |
+
XML_SAVE_AS_HTML = 1<<6, /* force HTML serialization on XML doc */
|
| 37 |
+
XML_SAVE_WSNONSIG = 1<<7 /* format with non-significant whitespace */
|
| 38 |
+
} xmlSaveOption;
|
| 39 |
+
|
| 40 |
+
|
| 41 |
+
typedef struct _xmlSaveCtxt xmlSaveCtxt;
|
| 42 |
+
typedef xmlSaveCtxt *xmlSaveCtxtPtr;
|
| 43 |
+
|
| 44 |
+
XMLPUBFUN xmlSaveCtxtPtr
|
| 45 |
+
xmlSaveToFd (int fd,
|
| 46 |
+
const char *encoding,
|
| 47 |
+
int options);
|
| 48 |
+
XMLPUBFUN xmlSaveCtxtPtr
|
| 49 |
+
xmlSaveToFilename (const char *filename,
|
| 50 |
+
const char *encoding,
|
| 51 |
+
int options);
|
| 52 |
+
|
| 53 |
+
XMLPUBFUN xmlSaveCtxtPtr
|
| 54 |
+
xmlSaveToBuffer (xmlBufferPtr buffer,
|
| 55 |
+
const char *encoding,
|
| 56 |
+
int options);
|
| 57 |
+
|
| 58 |
+
XMLPUBFUN xmlSaveCtxtPtr
|
| 59 |
+
xmlSaveToIO (xmlOutputWriteCallback iowrite,
|
| 60 |
+
xmlOutputCloseCallback ioclose,
|
| 61 |
+
void *ioctx,
|
| 62 |
+
const char *encoding,
|
| 63 |
+
int options);
|
| 64 |
+
|
| 65 |
+
XMLPUBFUN long
|
| 66 |
+
xmlSaveDoc (xmlSaveCtxtPtr ctxt,
|
| 67 |
+
xmlDocPtr doc);
|
| 68 |
+
XMLPUBFUN long
|
| 69 |
+
xmlSaveTree (xmlSaveCtxtPtr ctxt,
|
| 70 |
+
xmlNodePtr node);
|
| 71 |
+
|
| 72 |
+
XMLPUBFUN int
|
| 73 |
+
xmlSaveFlush (xmlSaveCtxtPtr ctxt);
|
| 74 |
+
XMLPUBFUN int
|
| 75 |
+
xmlSaveClose (xmlSaveCtxtPtr ctxt);
|
| 76 |
+
XMLPUBFUN int
|
| 77 |
+
xmlSaveSetEscape (xmlSaveCtxtPtr ctxt,
|
| 78 |
+
xmlCharEncodingOutputFunc escape);
|
| 79 |
+
XMLPUBFUN int
|
| 80 |
+
xmlSaveSetAttrEscape (xmlSaveCtxtPtr ctxt,
|
| 81 |
+
xmlCharEncodingOutputFunc escape);
|
| 82 |
+
#ifdef __cplusplus
|
| 83 |
+
}
|
| 84 |
+
#endif
|
| 85 |
+
#endif /* LIBXML_OUTPUT_ENABLED */
|
| 86 |
+
#endif /* __XML_XMLSAVE_H__ */
|
| 87 |
+
|
| 88 |
+
|
pgsql/include/libxml/xmlschemas.h
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: incomplete XML Schemas structure implementation
|
| 3 |
+
* Description: interface to the XML Schemas handling and schema validity
|
| 4 |
+
* checking, it is incomplete right now.
|
| 5 |
+
*
|
| 6 |
+
* Copy: See Copyright for the status of this software.
|
| 7 |
+
*
|
| 8 |
+
* Author: Daniel Veillard
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
#ifndef __XML_SCHEMA_H__
|
| 13 |
+
#define __XML_SCHEMA_H__
|
| 14 |
+
|
| 15 |
+
#include <libxml/xmlversion.h>
|
| 16 |
+
|
| 17 |
+
#ifdef LIBXML_SCHEMAS_ENABLED
|
| 18 |
+
|
| 19 |
+
#include <libxml/tree.h>
|
| 20 |
+
|
| 21 |
+
#ifdef __cplusplus
|
| 22 |
+
extern "C" {
|
| 23 |
+
#endif
|
| 24 |
+
|
| 25 |
+
/**
|
| 26 |
+
* This error codes are obsolete; not used any more.
|
| 27 |
+
*/
|
| 28 |
+
typedef enum {
|
| 29 |
+
XML_SCHEMAS_ERR_OK = 0,
|
| 30 |
+
XML_SCHEMAS_ERR_NOROOT = 1,
|
| 31 |
+
XML_SCHEMAS_ERR_UNDECLAREDELEM,
|
| 32 |
+
XML_SCHEMAS_ERR_NOTTOPLEVEL,
|
| 33 |
+
XML_SCHEMAS_ERR_MISSING,
|
| 34 |
+
XML_SCHEMAS_ERR_WRONGELEM,
|
| 35 |
+
XML_SCHEMAS_ERR_NOTYPE,
|
| 36 |
+
XML_SCHEMAS_ERR_NOROLLBACK,
|
| 37 |
+
XML_SCHEMAS_ERR_ISABSTRACT,
|
| 38 |
+
XML_SCHEMAS_ERR_NOTEMPTY,
|
| 39 |
+
XML_SCHEMAS_ERR_ELEMCONT,
|
| 40 |
+
XML_SCHEMAS_ERR_HAVEDEFAULT,
|
| 41 |
+
XML_SCHEMAS_ERR_NOTNILLABLE,
|
| 42 |
+
XML_SCHEMAS_ERR_EXTRACONTENT,
|
| 43 |
+
XML_SCHEMAS_ERR_INVALIDATTR,
|
| 44 |
+
XML_SCHEMAS_ERR_INVALIDELEM,
|
| 45 |
+
XML_SCHEMAS_ERR_NOTDETERMINIST,
|
| 46 |
+
XML_SCHEMAS_ERR_CONSTRUCT,
|
| 47 |
+
XML_SCHEMAS_ERR_INTERNAL,
|
| 48 |
+
XML_SCHEMAS_ERR_NOTSIMPLE,
|
| 49 |
+
XML_SCHEMAS_ERR_ATTRUNKNOWN,
|
| 50 |
+
XML_SCHEMAS_ERR_ATTRINVALID,
|
| 51 |
+
XML_SCHEMAS_ERR_VALUE,
|
| 52 |
+
XML_SCHEMAS_ERR_FACET,
|
| 53 |
+
XML_SCHEMAS_ERR_,
|
| 54 |
+
XML_SCHEMAS_ERR_XXX
|
| 55 |
+
} xmlSchemaValidError;
|
| 56 |
+
|
| 57 |
+
/*
|
| 58 |
+
* ATTENTION: Change xmlSchemaSetValidOptions's check
|
| 59 |
+
* for invalid values, if adding to the validation
|
| 60 |
+
* options below.
|
| 61 |
+
*/
|
| 62 |
+
/**
|
| 63 |
+
* xmlSchemaValidOption:
|
| 64 |
+
*
|
| 65 |
+
* This is the set of XML Schema validation options.
|
| 66 |
+
*/
|
| 67 |
+
typedef enum {
|
| 68 |
+
XML_SCHEMA_VAL_VC_I_CREATE = 1<<0
|
| 69 |
+
/* Default/fixed: create an attribute node
|
| 70 |
+
* or an element's text node on the instance.
|
| 71 |
+
*/
|
| 72 |
+
} xmlSchemaValidOption;
|
| 73 |
+
|
| 74 |
+
/*
|
| 75 |
+
XML_SCHEMA_VAL_XSI_ASSEMBLE = 1<<1,
|
| 76 |
+
* assemble schemata using
|
| 77 |
+
* xsi:schemaLocation and
|
| 78 |
+
* xsi:noNamespaceSchemaLocation
|
| 79 |
+
*/
|
| 80 |
+
|
| 81 |
+
/**
|
| 82 |
+
* The schemas related types are kept internal
|
| 83 |
+
*/
|
| 84 |
+
typedef struct _xmlSchema xmlSchema;
|
| 85 |
+
typedef xmlSchema *xmlSchemaPtr;
|
| 86 |
+
|
| 87 |
+
/**
|
| 88 |
+
* xmlSchemaValidityErrorFunc:
|
| 89 |
+
* @ctx: the validation context
|
| 90 |
+
* @msg: the message
|
| 91 |
+
* @...: extra arguments
|
| 92 |
+
*
|
| 93 |
+
* Signature of an error callback from an XSD validation
|
| 94 |
+
*/
|
| 95 |
+
typedef void (*xmlSchemaValidityErrorFunc)
|
| 96 |
+
(void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
|
| 97 |
+
|
| 98 |
+
/**
|
| 99 |
+
* xmlSchemaValidityWarningFunc:
|
| 100 |
+
* @ctx: the validation context
|
| 101 |
+
* @msg: the message
|
| 102 |
+
* @...: extra arguments
|
| 103 |
+
*
|
| 104 |
+
* Signature of a warning callback from an XSD validation
|
| 105 |
+
*/
|
| 106 |
+
typedef void (*xmlSchemaValidityWarningFunc)
|
| 107 |
+
(void *ctx, const char *msg, ...) LIBXML_ATTR_FORMAT(2,3);
|
| 108 |
+
|
| 109 |
+
/**
|
| 110 |
+
* A schemas validation context
|
| 111 |
+
*/
|
| 112 |
+
typedef struct _xmlSchemaParserCtxt xmlSchemaParserCtxt;
|
| 113 |
+
typedef xmlSchemaParserCtxt *xmlSchemaParserCtxtPtr;
|
| 114 |
+
|
| 115 |
+
typedef struct _xmlSchemaValidCtxt xmlSchemaValidCtxt;
|
| 116 |
+
typedef xmlSchemaValidCtxt *xmlSchemaValidCtxtPtr;
|
| 117 |
+
|
| 118 |
+
/**
|
| 119 |
+
* xmlSchemaValidityLocatorFunc:
|
| 120 |
+
* @ctx: user provided context
|
| 121 |
+
* @file: returned file information
|
| 122 |
+
* @line: returned line information
|
| 123 |
+
*
|
| 124 |
+
* A schemas validation locator, a callback called by the validator.
|
| 125 |
+
* This is used when file or node information are not available
|
| 126 |
+
* to find out what file and line number are affected
|
| 127 |
+
*
|
| 128 |
+
* Returns: 0 in case of success and -1 in case of error
|
| 129 |
+
*/
|
| 130 |
+
|
| 131 |
+
typedef int (*xmlSchemaValidityLocatorFunc) (void *ctx,
|
| 132 |
+
const char **file, unsigned long *line);
|
| 133 |
+
|
| 134 |
+
/*
|
| 135 |
+
* Interfaces for parsing.
|
| 136 |
+
*/
|
| 137 |
+
XMLPUBFUN xmlSchemaParserCtxtPtr
|
| 138 |
+
xmlSchemaNewParserCtxt (const char *URL);
|
| 139 |
+
XMLPUBFUN xmlSchemaParserCtxtPtr
|
| 140 |
+
xmlSchemaNewMemParserCtxt (const char *buffer,
|
| 141 |
+
int size);
|
| 142 |
+
XMLPUBFUN xmlSchemaParserCtxtPtr
|
| 143 |
+
xmlSchemaNewDocParserCtxt (xmlDocPtr doc);
|
| 144 |
+
XMLPUBFUN void
|
| 145 |
+
xmlSchemaFreeParserCtxt (xmlSchemaParserCtxtPtr ctxt);
|
| 146 |
+
XMLPUBFUN void
|
| 147 |
+
xmlSchemaSetParserErrors (xmlSchemaParserCtxtPtr ctxt,
|
| 148 |
+
xmlSchemaValidityErrorFunc err,
|
| 149 |
+
xmlSchemaValidityWarningFunc warn,
|
| 150 |
+
void *ctx);
|
| 151 |
+
XMLPUBFUN void
|
| 152 |
+
xmlSchemaSetParserStructuredErrors(xmlSchemaParserCtxtPtr ctxt,
|
| 153 |
+
xmlStructuredErrorFunc serror,
|
| 154 |
+
void *ctx);
|
| 155 |
+
XMLPUBFUN int
|
| 156 |
+
xmlSchemaGetParserErrors(xmlSchemaParserCtxtPtr ctxt,
|
| 157 |
+
xmlSchemaValidityErrorFunc * err,
|
| 158 |
+
xmlSchemaValidityWarningFunc * warn,
|
| 159 |
+
void **ctx);
|
| 160 |
+
XMLPUBFUN int
|
| 161 |
+
xmlSchemaIsValid (xmlSchemaValidCtxtPtr ctxt);
|
| 162 |
+
|
| 163 |
+
XMLPUBFUN xmlSchemaPtr
|
| 164 |
+
xmlSchemaParse (xmlSchemaParserCtxtPtr ctxt);
|
| 165 |
+
XMLPUBFUN void
|
| 166 |
+
xmlSchemaFree (xmlSchemaPtr schema);
|
| 167 |
+
#ifdef LIBXML_OUTPUT_ENABLED
|
| 168 |
+
XMLPUBFUN void
|
| 169 |
+
xmlSchemaDump (FILE *output,
|
| 170 |
+
xmlSchemaPtr schema);
|
| 171 |
+
#endif /* LIBXML_OUTPUT_ENABLED */
|
| 172 |
+
/*
|
| 173 |
+
* Interfaces for validating
|
| 174 |
+
*/
|
| 175 |
+
XMLPUBFUN void
|
| 176 |
+
xmlSchemaSetValidErrors (xmlSchemaValidCtxtPtr ctxt,
|
| 177 |
+
xmlSchemaValidityErrorFunc err,
|
| 178 |
+
xmlSchemaValidityWarningFunc warn,
|
| 179 |
+
void *ctx);
|
| 180 |
+
XMLPUBFUN void
|
| 181 |
+
xmlSchemaSetValidStructuredErrors(xmlSchemaValidCtxtPtr ctxt,
|
| 182 |
+
xmlStructuredErrorFunc serror,
|
| 183 |
+
void *ctx);
|
| 184 |
+
XMLPUBFUN int
|
| 185 |
+
xmlSchemaGetValidErrors (xmlSchemaValidCtxtPtr ctxt,
|
| 186 |
+
xmlSchemaValidityErrorFunc *err,
|
| 187 |
+
xmlSchemaValidityWarningFunc *warn,
|
| 188 |
+
void **ctx);
|
| 189 |
+
XMLPUBFUN int
|
| 190 |
+
xmlSchemaSetValidOptions (xmlSchemaValidCtxtPtr ctxt,
|
| 191 |
+
int options);
|
| 192 |
+
XMLPUBFUN void
|
| 193 |
+
xmlSchemaValidateSetFilename(xmlSchemaValidCtxtPtr vctxt,
|
| 194 |
+
const char *filename);
|
| 195 |
+
XMLPUBFUN int
|
| 196 |
+
xmlSchemaValidCtxtGetOptions(xmlSchemaValidCtxtPtr ctxt);
|
| 197 |
+
|
| 198 |
+
XMLPUBFUN xmlSchemaValidCtxtPtr
|
| 199 |
+
xmlSchemaNewValidCtxt (xmlSchemaPtr schema);
|
| 200 |
+
XMLPUBFUN void
|
| 201 |
+
xmlSchemaFreeValidCtxt (xmlSchemaValidCtxtPtr ctxt);
|
| 202 |
+
XMLPUBFUN int
|
| 203 |
+
xmlSchemaValidateDoc (xmlSchemaValidCtxtPtr ctxt,
|
| 204 |
+
xmlDocPtr instance);
|
| 205 |
+
XMLPUBFUN int
|
| 206 |
+
xmlSchemaValidateOneElement (xmlSchemaValidCtxtPtr ctxt,
|
| 207 |
+
xmlNodePtr elem);
|
| 208 |
+
XMLPUBFUN int
|
| 209 |
+
xmlSchemaValidateStream (xmlSchemaValidCtxtPtr ctxt,
|
| 210 |
+
xmlParserInputBufferPtr input,
|
| 211 |
+
xmlCharEncoding enc,
|
| 212 |
+
xmlSAXHandlerPtr sax,
|
| 213 |
+
void *user_data);
|
| 214 |
+
XMLPUBFUN int
|
| 215 |
+
xmlSchemaValidateFile (xmlSchemaValidCtxtPtr ctxt,
|
| 216 |
+
const char * filename,
|
| 217 |
+
int options);
|
| 218 |
+
|
| 219 |
+
XMLPUBFUN xmlParserCtxtPtr
|
| 220 |
+
xmlSchemaValidCtxtGetParserCtxt(xmlSchemaValidCtxtPtr ctxt);
|
| 221 |
+
|
| 222 |
+
/*
|
| 223 |
+
* Interface to insert Schemas SAX validation in a SAX stream
|
| 224 |
+
*/
|
| 225 |
+
typedef struct _xmlSchemaSAXPlug xmlSchemaSAXPlugStruct;
|
| 226 |
+
typedef xmlSchemaSAXPlugStruct *xmlSchemaSAXPlugPtr;
|
| 227 |
+
|
| 228 |
+
XMLPUBFUN xmlSchemaSAXPlugPtr
|
| 229 |
+
xmlSchemaSAXPlug (xmlSchemaValidCtxtPtr ctxt,
|
| 230 |
+
xmlSAXHandlerPtr *sax,
|
| 231 |
+
void **user_data);
|
| 232 |
+
XMLPUBFUN int
|
| 233 |
+
xmlSchemaSAXUnplug (xmlSchemaSAXPlugPtr plug);
|
| 234 |
+
|
| 235 |
+
|
| 236 |
+
XMLPUBFUN void
|
| 237 |
+
xmlSchemaValidateSetLocator (xmlSchemaValidCtxtPtr vctxt,
|
| 238 |
+
xmlSchemaValidityLocatorFunc f,
|
| 239 |
+
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: implementation of XML Schema Datatypes
|
| 3 |
+
* Description: module providing the XML Schema Datatypes implementation
|
| 4 |
+
* both definition and validity checking
|
| 5 |
+
*
|
| 6 |
+
* Copy: See Copyright for the status of this software.
|
| 7 |
+
*
|
| 8 |
+
* Author: Daniel Veillard
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
#ifndef __XML_SCHEMA_TYPES_H__
|
| 13 |
+
#define __XML_SCHEMA_TYPES_H__
|
| 14 |
+
|
| 15 |
+
#include <libxml/xmlversion.h>
|
| 16 |
+
|
| 17 |
+
#ifdef LIBXML_SCHEMAS_ENABLED
|
| 18 |
+
|
| 19 |
+
#include <libxml/schemasInternals.h>
|
| 20 |
+
#include <libxml/xmlschemas.h>
|
| 21 |
+
|
| 22 |
+
#ifdef __cplusplus
|
| 23 |
+
extern "C" {
|
| 24 |
+
#endif
|
| 25 |
+
|
| 26 |
+
typedef enum {
|
| 27 |
+
XML_SCHEMA_WHITESPACE_UNKNOWN = 0,
|
| 28 |
+
XML_SCHEMA_WHITESPACE_PRESERVE = 1,
|
| 29 |
+
XML_SCHEMA_WHITESPACE_REPLACE = 2,
|
| 30 |
+
XML_SCHEMA_WHITESPACE_COLLAPSE = 3
|
| 31 |
+
} xmlSchemaWhitespaceValueType;
|
| 32 |
+
|
| 33 |
+
XMLPUBFUN int
|
| 34 |
+
xmlSchemaInitTypes (void);
|
| 35 |
+
XML_DEPRECATED
|
| 36 |
+
XMLPUBFUN void
|
| 37 |
+
xmlSchemaCleanupTypes (void);
|
| 38 |
+
XMLPUBFUN xmlSchemaTypePtr
|
| 39 |
+
xmlSchemaGetPredefinedType (const xmlChar *name,
|
| 40 |
+
const xmlChar *ns);
|
| 41 |
+
XMLPUBFUN int
|
| 42 |
+
xmlSchemaValidatePredefinedType (xmlSchemaTypePtr type,
|
| 43 |
+
const xmlChar *value,
|
| 44 |
+
xmlSchemaValPtr *val);
|
| 45 |
+
XMLPUBFUN int
|
| 46 |
+
xmlSchemaValPredefTypeNode (xmlSchemaTypePtr type,
|
| 47 |
+
const xmlChar *value,
|
| 48 |
+
xmlSchemaValPtr *val,
|
| 49 |
+
xmlNodePtr node);
|
| 50 |
+
XMLPUBFUN int
|
| 51 |
+
xmlSchemaValidateFacet (xmlSchemaTypePtr base,
|
| 52 |
+
xmlSchemaFacetPtr facet,
|
| 53 |
+
const xmlChar *value,
|
| 54 |
+
xmlSchemaValPtr val);
|
| 55 |
+
XMLPUBFUN int
|
| 56 |
+
xmlSchemaValidateFacetWhtsp (xmlSchemaFacetPtr facet,
|
| 57 |
+
xmlSchemaWhitespaceValueType fws,
|
| 58 |
+
xmlSchemaValType valType,
|
| 59 |
+
const xmlChar *value,
|
| 60 |
+
xmlSchemaValPtr val,
|
| 61 |
+
xmlSchemaWhitespaceValueType ws);
|
| 62 |
+
XMLPUBFUN void
|
| 63 |
+
xmlSchemaFreeValue (xmlSchemaValPtr val);
|
| 64 |
+
XMLPUBFUN xmlSchemaFacetPtr
|
| 65 |
+
xmlSchemaNewFacet (void);
|
| 66 |
+
XMLPUBFUN int
|
| 67 |
+
xmlSchemaCheckFacet (xmlSchemaFacetPtr facet,
|
| 68 |
+
xmlSchemaTypePtr typeDecl,
|
| 69 |
+
xmlSchemaParserCtxtPtr ctxt,
|
| 70 |
+
const xmlChar *name);
|
| 71 |
+
XMLPUBFUN void
|
| 72 |
+
xmlSchemaFreeFacet (xmlSchemaFacetPtr facet);
|
| 73 |
+
XMLPUBFUN int
|
| 74 |
+
xmlSchemaCompareValues (xmlSchemaValPtr x,
|
| 75 |
+
xmlSchemaValPtr y);
|
| 76 |
+
XMLPUBFUN xmlSchemaTypePtr
|
| 77 |
+
xmlSchemaGetBuiltInListSimpleTypeItemType (xmlSchemaTypePtr type);
|
| 78 |
+
XMLPUBFUN int
|
| 79 |
+
xmlSchemaValidateListSimpleTypeFacet (xmlSchemaFacetPtr facet,
|
| 80 |
+
const xmlChar *value,
|
| 81 |
+
unsigned long actualLen,
|
| 82 |
+
unsigned long *expectedLen);
|
| 83 |
+
XMLPUBFUN xmlSchemaTypePtr
|
| 84 |
+
xmlSchemaGetBuiltInType (xmlSchemaValType type);
|
| 85 |
+
XMLPUBFUN int
|
| 86 |
+
xmlSchemaIsBuiltInTypeFacet (xmlSchemaTypePtr type,
|
| 87 |
+
int facetType);
|
| 88 |
+
XMLPUBFUN xmlChar *
|
| 89 |
+
xmlSchemaCollapseString (const xmlChar *value);
|
| 90 |
+
XMLPUBFUN xmlChar *
|
| 91 |
+
xmlSchemaWhiteSpaceReplace (const xmlChar *value);
|
| 92 |
+
XMLPUBFUN unsigned long
|
| 93 |
+
xmlSchemaGetFacetValueAsULong (xmlSchemaFacetPtr facet);
|
| 94 |
+
XMLPUBFUN int
|
| 95 |
+
xmlSchemaValidateLengthFacet (xmlSchemaTypePtr type,
|
| 96 |
+
xmlSchemaFacetPtr facet,
|
| 97 |
+
const xmlChar *value,
|
| 98 |
+
xmlSchemaValPtr val,
|
| 99 |
+
unsigned long *length);
|
| 100 |
+
XMLPUBFUN int
|
| 101 |
+
xmlSchemaValidateLengthFacetWhtsp(xmlSchemaFacetPtr facet,
|
| 102 |
+
xmlSchemaValType valType,
|
| 103 |
+
const xmlChar *value,
|
| 104 |
+
xmlSchemaValPtr val,
|
| 105 |
+
unsigned long *length,
|
| 106 |
+
xmlSchemaWhitespaceValueType ws);
|
| 107 |
+
XMLPUBFUN int
|
| 108 |
+
xmlSchemaValPredefTypeNodeNoNorm(xmlSchemaTypePtr type,
|
| 109 |
+
const xmlChar *value,
|
| 110 |
+
xmlSchemaValPtr *val,
|
| 111 |
+
xmlNodePtr node);
|
| 112 |
+
XMLPUBFUN int
|
| 113 |
+
xmlSchemaGetCanonValue (xmlSchemaValPtr val,
|
| 114 |
+
const xmlChar **retValue);
|
| 115 |
+
XMLPUBFUN int
|
| 116 |
+
xmlSchemaGetCanonValueWhtsp (xmlSchemaValPtr val,
|
| 117 |
+
const xmlChar **retValue,
|
| 118 |
+
xmlSchemaWhitespaceValueType ws);
|
| 119 |
+
XMLPUBFUN int
|
| 120 |
+
xmlSchemaValueAppend (xmlSchemaValPtr prev,
|
| 121 |
+
xmlSchemaValPtr cur);
|
| 122 |
+
XMLPUBFUN xmlSchemaValPtr
|
| 123 |
+
xmlSchemaValueGetNext (xmlSchemaValPtr cur);
|
| 124 |
+
XMLPUBFUN const xmlChar *
|
| 125 |
+
xmlSchemaValueGetAsString (xmlSchemaValPtr val);
|
| 126 |
+
XMLPUBFUN int
|
| 127 |
+
xmlSchemaValueGetAsBoolean (xmlSchemaValPtr val);
|
| 128 |
+
XMLPUBFUN xmlSchemaValPtr
|
| 129 |
+
xmlSchemaNewStringValue (xmlSchemaValType type,
|
| 130 |
+
const xmlChar *value);
|
| 131 |
+
XMLPUBFUN xmlSchemaValPtr
|
| 132 |
+
xmlSchemaNewNOTATIONValue (const xmlChar *name,
|
| 133 |
+
const xmlChar *ns);
|
| 134 |
+
XMLPUBFUN xmlSchemaValPtr
|
| 135 |
+
xmlSchemaNewQNameValue (const xmlChar *namespaceName,
|
| 136 |
+
const xmlChar *localName);
|
| 137 |
+
XMLPUBFUN int
|
| 138 |
+
xmlSchemaCompareValuesWhtsp (xmlSchemaValPtr x,
|
| 139 |
+
xmlSchemaWhitespaceValueType xws,
|
| 140 |
+
xmlSchemaValPtr y,
|
| 141 |
+
xmlSchemaWhitespaceValueType yws);
|
| 142 |
+
XMLPUBFUN xmlSchemaValPtr
|
| 143 |
+
xmlSchemaCopyValue (xmlSchemaValPtr val);
|
| 144 |
+
XMLPUBFUN xmlSchemaValType
|
| 145 |
+
xmlSchemaGetValType (xmlSchemaValPtr val);
|
| 146 |
+
|
| 147 |
+
#ifdef __cplusplus
|
| 148 |
+
}
|
| 149 |
+
#endif
|
| 150 |
+
|
| 151 |
+
#endif /* LIBXML_SCHEMAS_ENABLED */
|
| 152 |
+
#endif /* __XML_SCHEMA_TYPES_H__ */
|
pgsql/include/libxml/xmlstring.h
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: set of routines to process strings
|
| 3 |
+
* Description: type and interfaces needed for the internal string handling
|
| 4 |
+
* of the library, especially UTF8 processing.
|
| 5 |
+
*
|
| 6 |
+
* Copy: See Copyright for the status of this software.
|
| 7 |
+
*
|
| 8 |
+
* Author: Daniel Veillard
|
| 9 |
+
*/
|
| 10 |
+
|
| 11 |
+
#ifndef __XML_STRING_H__
|
| 12 |
+
#define __XML_STRING_H__
|
| 13 |
+
|
| 14 |
+
#include <stdarg.h>
|
| 15 |
+
#include <libxml/xmlversion.h>
|
| 16 |
+
|
| 17 |
+
#ifdef __cplusplus
|
| 18 |
+
extern "C" {
|
| 19 |
+
#endif
|
| 20 |
+
|
| 21 |
+
/**
|
| 22 |
+
* xmlChar:
|
| 23 |
+
*
|
| 24 |
+
* This is a basic byte in an UTF-8 encoded string.
|
| 25 |
+
* It's unsigned allowing to pinpoint case where char * are assigned
|
| 26 |
+
* to xmlChar * (possibly making serialization back impossible).
|
| 27 |
+
*/
|
| 28 |
+
typedef unsigned char xmlChar;
|
| 29 |
+
|
| 30 |
+
/**
|
| 31 |
+
* BAD_CAST:
|
| 32 |
+
*
|
| 33 |
+
* Macro to cast a string to an xmlChar * when one know its safe.
|
| 34 |
+
*/
|
| 35 |
+
#define BAD_CAST (xmlChar *)
|
| 36 |
+
|
| 37 |
+
/*
|
| 38 |
+
* xmlChar handling
|
| 39 |
+
*/
|
| 40 |
+
XMLPUBFUN xmlChar *
|
| 41 |
+
xmlStrdup (const xmlChar *cur);
|
| 42 |
+
XMLPUBFUN xmlChar *
|
| 43 |
+
xmlStrndup (const xmlChar *cur,
|
| 44 |
+
int len);
|
| 45 |
+
XMLPUBFUN xmlChar *
|
| 46 |
+
xmlCharStrndup (const char *cur,
|
| 47 |
+
int len);
|
| 48 |
+
XMLPUBFUN xmlChar *
|
| 49 |
+
xmlCharStrdup (const char *cur);
|
| 50 |
+
XMLPUBFUN xmlChar *
|
| 51 |
+
xmlStrsub (const xmlChar *str,
|
| 52 |
+
int start,
|
| 53 |
+
int len);
|
| 54 |
+
XMLPUBFUN const xmlChar *
|
| 55 |
+
xmlStrchr (const xmlChar *str,
|
| 56 |
+
xmlChar val);
|
| 57 |
+
XMLPUBFUN const xmlChar *
|
| 58 |
+
xmlStrstr (const xmlChar *str,
|
| 59 |
+
const xmlChar *val);
|
| 60 |
+
XMLPUBFUN const xmlChar *
|
| 61 |
+
xmlStrcasestr (const xmlChar *str,
|
| 62 |
+
const xmlChar *val);
|
| 63 |
+
XMLPUBFUN int
|
| 64 |
+
xmlStrcmp (const xmlChar *str1,
|
| 65 |
+
const xmlChar *str2);
|
| 66 |
+
XMLPUBFUN int
|
| 67 |
+
xmlStrncmp (const xmlChar *str1,
|
| 68 |
+
const xmlChar *str2,
|
| 69 |
+
int len);
|
| 70 |
+
XMLPUBFUN int
|
| 71 |
+
xmlStrcasecmp (const xmlChar *str1,
|
| 72 |
+
const xmlChar *str2);
|
| 73 |
+
XMLPUBFUN int
|
| 74 |
+
xmlStrncasecmp (const xmlChar *str1,
|
| 75 |
+
const xmlChar *str2,
|
| 76 |
+
int len);
|
| 77 |
+
XMLPUBFUN int
|
| 78 |
+
xmlStrEqual (const xmlChar *str1,
|
| 79 |
+
const xmlChar *str2);
|
| 80 |
+
XMLPUBFUN int
|
| 81 |
+
xmlStrQEqual (const xmlChar *pref,
|
| 82 |
+
const xmlChar *name,
|
| 83 |
+
const xmlChar *str);
|
| 84 |
+
XMLPUBFUN int
|
| 85 |
+
xmlStrlen (const xmlChar *str);
|
| 86 |
+
XMLPUBFUN xmlChar *
|
| 87 |
+
xmlStrcat (xmlChar *cur,
|
| 88 |
+
const xmlChar *add);
|
| 89 |
+
XMLPUBFUN xmlChar *
|
| 90 |
+
xmlStrncat (xmlChar *cur,
|
| 91 |
+
const xmlChar *add,
|
| 92 |
+
int len);
|
| 93 |
+
XMLPUBFUN xmlChar *
|
| 94 |
+
xmlStrncatNew (const xmlChar *str1,
|
| 95 |
+
const xmlChar *str2,
|
| 96 |
+
int len);
|
| 97 |
+
XMLPUBFUN int
|
| 98 |
+
xmlStrPrintf (xmlChar *buf,
|
| 99 |
+
int len,
|
| 100 |
+
const char *msg,
|
| 101 |
+
...) LIBXML_ATTR_FORMAT(3,4);
|
| 102 |
+
XMLPUBFUN int
|
| 103 |
+
xmlStrVPrintf (xmlChar *buf,
|
| 104 |
+
int len,
|
| 105 |
+
const char *msg,
|
| 106 |
+
va_list ap) LIBXML_ATTR_FORMAT(3,0);
|
| 107 |
+
|
| 108 |
+
XMLPUBFUN int
|
| 109 |
+
xmlGetUTF8Char (const unsigned char *utf,
|
| 110 |
+
int *len);
|
| 111 |
+
XMLPUBFUN int
|
| 112 |
+
xmlCheckUTF8 (const unsigned char *utf);
|
| 113 |
+
XMLPUBFUN int
|
| 114 |
+
xmlUTF8Strsize (const xmlChar *utf,
|
| 115 |
+
int len);
|
| 116 |
+
XMLPUBFUN xmlChar *
|
| 117 |
+
xmlUTF8Strndup (const xmlChar *utf,
|
| 118 |
+
int len);
|
| 119 |
+
XMLPUBFUN const xmlChar *
|
| 120 |
+
xmlUTF8Strpos (const xmlChar *utf,
|
| 121 |
+
int pos);
|
| 122 |
+
XMLPUBFUN int
|
| 123 |
+
xmlUTF8Strloc (const xmlChar *utf,
|
| 124 |
+
const xmlChar *utfchar);
|
| 125 |
+
XMLPUBFUN xmlChar *
|
| 126 |
+
xmlUTF8Strsub (const xmlChar *utf,
|
| 127 |
+
int start,
|
| 128 |
+
int len);
|
| 129 |
+
XMLPUBFUN int
|
| 130 |
+
xmlUTF8Strlen (const xmlChar *utf);
|
| 131 |
+
XMLPUBFUN int
|
| 132 |
+
xmlUTF8Size (const xmlChar *utf);
|
| 133 |
+
XMLPUBFUN int
|
| 134 |
+
xmlUTF8Charcmp (const xmlChar *utf1,
|
| 135 |
+
const xmlChar *utf2);
|
| 136 |
+
|
| 137 |
+
#ifdef __cplusplus
|
| 138 |
+
}
|
| 139 |
+
#endif
|
| 140 |
+
#endif /* __XML_STRING_H__ */
|
pgsql/include/libxml/xmlunicode.h
ADDED
|
@@ -0,0 +1,202 @@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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: Unicode character APIs
|
| 3 |
+
* Description: API for the Unicode character APIs
|
| 4 |
+
*
|
| 5 |
+
* This file is automatically generated from the
|
| 6 |
+
* UCS description files of the Unicode Character Database
|
| 7 |
+
* http://www.unicode.org/Public/4.0-Update1/UCD-4.0.1.html
|
| 8 |
+
* using the genUnicode.py Python script.
|
| 9 |
+
*
|
| 10 |
+
* Generation date: Mon Mar 27 11:09:52 2006
|
| 11 |
+
* Sources: Blocks-4.0.1.txt UnicodeData-4.0.1.txt
|
| 12 |
+
* Author: Daniel Veillard
|
| 13 |
+
*/
|
| 14 |
+
|
| 15 |
+
#ifndef __XML_UNICODE_H__
|
| 16 |
+
#define __XML_UNICODE_H__
|
| 17 |
+
|
| 18 |
+
#include <libxml/xmlversion.h>
|
| 19 |
+
|
| 20 |
+
#ifdef LIBXML_UNICODE_ENABLED
|
| 21 |
+
|
| 22 |
+
#ifdef __cplusplus
|
| 23 |
+
extern "C" {
|
| 24 |
+
#endif
|
| 25 |
+
|
| 26 |
+
XMLPUBFUN int xmlUCSIsAegeanNumbers (int code);
|
| 27 |
+
XMLPUBFUN int xmlUCSIsAlphabeticPresentationForms (int code);
|
| 28 |
+
XMLPUBFUN int xmlUCSIsArabic (int code);
|
| 29 |
+
XMLPUBFUN int xmlUCSIsArabicPresentationFormsA (int code);
|
| 30 |
+
XMLPUBFUN int xmlUCSIsArabicPresentationFormsB (int code);
|
| 31 |
+
XMLPUBFUN int xmlUCSIsArmenian (int code);
|
| 32 |
+
XMLPUBFUN int xmlUCSIsArrows (int code);
|
| 33 |
+
XMLPUBFUN int xmlUCSIsBasicLatin (int code);
|
| 34 |
+
XMLPUBFUN int xmlUCSIsBengali (int code);
|
| 35 |
+
XMLPUBFUN int xmlUCSIsBlockElements (int code);
|
| 36 |
+
XMLPUBFUN int xmlUCSIsBopomofo (int code);
|
| 37 |
+
XMLPUBFUN int xmlUCSIsBopomofoExtended (int code);
|
| 38 |
+
XMLPUBFUN int xmlUCSIsBoxDrawing (int code);
|
| 39 |
+
XMLPUBFUN int xmlUCSIsBraillePatterns (int code);
|
| 40 |
+
XMLPUBFUN int xmlUCSIsBuhid (int code);
|
| 41 |
+
XMLPUBFUN int xmlUCSIsByzantineMusicalSymbols (int code);
|
| 42 |
+
XMLPUBFUN int xmlUCSIsCJKCompatibility (int code);
|
| 43 |
+
XMLPUBFUN int xmlUCSIsCJKCompatibilityForms (int code);
|
| 44 |
+
XMLPUBFUN int xmlUCSIsCJKCompatibilityIdeographs (int code);
|
| 45 |
+
XMLPUBFUN int xmlUCSIsCJKCompatibilityIdeographsSupplement (int code);
|
| 46 |
+
XMLPUBFUN int xmlUCSIsCJKRadicalsSupplement (int code);
|
| 47 |
+
XMLPUBFUN int xmlUCSIsCJKSymbolsandPunctuation (int code);
|
| 48 |
+
XMLPUBFUN int xmlUCSIsCJKUnifiedIdeographs (int code);
|
| 49 |
+
XMLPUBFUN int xmlUCSIsCJKUnifiedIdeographsExtensionA (int code);
|
| 50 |
+
XMLPUBFUN int xmlUCSIsCJKUnifiedIdeographsExtensionB (int code);
|
| 51 |
+
XMLPUBFUN int xmlUCSIsCherokee (int code);
|
| 52 |
+
XMLPUBFUN int xmlUCSIsCombiningDiacriticalMarks (int code);
|
| 53 |
+
XMLPUBFUN int xmlUCSIsCombiningDiacriticalMarksforSymbols (int code);
|
| 54 |
+
XMLPUBFUN int xmlUCSIsCombiningHalfMarks (int code);
|
| 55 |
+
XMLPUBFUN int xmlUCSIsCombiningMarksforSymbols (int code);
|
| 56 |
+
XMLPUBFUN int xmlUCSIsControlPictures (int code);
|
| 57 |
+
XMLPUBFUN int xmlUCSIsCurrencySymbols (int code);
|
| 58 |
+
XMLPUBFUN int xmlUCSIsCypriotSyllabary (int code);
|
| 59 |
+
XMLPUBFUN int xmlUCSIsCyrillic (int code);
|
| 60 |
+
XMLPUBFUN int xmlUCSIsCyrillicSupplement (int code);
|
| 61 |
+
XMLPUBFUN int xmlUCSIsDeseret (int code);
|
| 62 |
+
XMLPUBFUN int xmlUCSIsDevanagari (int code);
|
| 63 |
+
XMLPUBFUN int xmlUCSIsDingbats (int code);
|
| 64 |
+
XMLPUBFUN int xmlUCSIsEnclosedAlphanumerics (int code);
|
| 65 |
+
XMLPUBFUN int xmlUCSIsEnclosedCJKLettersandMonths (int code);
|
| 66 |
+
XMLPUBFUN int xmlUCSIsEthiopic (int code);
|
| 67 |
+
XMLPUBFUN int xmlUCSIsGeneralPunctuation (int code);
|
| 68 |
+
XMLPUBFUN int xmlUCSIsGeometricShapes (int code);
|
| 69 |
+
XMLPUBFUN int xmlUCSIsGeorgian (int code);
|
| 70 |
+
XMLPUBFUN int xmlUCSIsGothic (int code);
|
| 71 |
+
XMLPUBFUN int xmlUCSIsGreek (int code);
|
| 72 |
+
XMLPUBFUN int xmlUCSIsGreekExtended (int code);
|
| 73 |
+
XMLPUBFUN int xmlUCSIsGreekandCoptic (int code);
|
| 74 |
+
XMLPUBFUN int xmlUCSIsGujarati (int code);
|
| 75 |
+
XMLPUBFUN int xmlUCSIsGurmukhi (int code);
|
| 76 |
+
XMLPUBFUN int xmlUCSIsHalfwidthandFullwidthForms (int code);
|
| 77 |
+
XMLPUBFUN int xmlUCSIsHangulCompatibilityJamo (int code);
|
| 78 |
+
XMLPUBFUN int xmlUCSIsHangulJamo (int code);
|
| 79 |
+
XMLPUBFUN int xmlUCSIsHangulSyllables (int code);
|
| 80 |
+
XMLPUBFUN int xmlUCSIsHanunoo (int code);
|
| 81 |
+
XMLPUBFUN int xmlUCSIsHebrew (int code);
|
| 82 |
+
XMLPUBFUN int xmlUCSIsHighPrivateUseSurrogates (int code);
|
| 83 |
+
XMLPUBFUN int xmlUCSIsHighSurrogates (int code);
|
| 84 |
+
XMLPUBFUN int xmlUCSIsHiragana (int code);
|
| 85 |
+
XMLPUBFUN int xmlUCSIsIPAExtensions (int code);
|
| 86 |
+
XMLPUBFUN int xmlUCSIsIdeographicDescriptionCharacters (int code);
|
| 87 |
+
XMLPUBFUN int xmlUCSIsKanbun (int code);
|
| 88 |
+
XMLPUBFUN int xmlUCSIsKangxiRadicals (int code);
|
| 89 |
+
XMLPUBFUN int xmlUCSIsKannada (int code);
|
| 90 |
+
XMLPUBFUN int xmlUCSIsKatakana (int code);
|
| 91 |
+
XMLPUBFUN int xmlUCSIsKatakanaPhoneticExtensions (int code);
|
| 92 |
+
XMLPUBFUN int xmlUCSIsKhmer (int code);
|
| 93 |
+
XMLPUBFUN int xmlUCSIsKhmerSymbols (int code);
|
| 94 |
+
XMLPUBFUN int xmlUCSIsLao (int code);
|
| 95 |
+
XMLPUBFUN int xmlUCSIsLatin1Supplement (int code);
|
| 96 |
+
XMLPUBFUN int xmlUCSIsLatinExtendedA (int code);
|
| 97 |
+
XMLPUBFUN int xmlUCSIsLatinExtendedB (int code);
|
| 98 |
+
XMLPUBFUN int xmlUCSIsLatinExtendedAdditional (int code);
|
| 99 |
+
XMLPUBFUN int xmlUCSIsLetterlikeSymbols (int code);
|
| 100 |
+
XMLPUBFUN int xmlUCSIsLimbu (int code);
|
| 101 |
+
XMLPUBFUN int xmlUCSIsLinearBIdeograms (int code);
|
| 102 |
+
XMLPUBFUN int xmlUCSIsLinearBSyllabary (int code);
|
| 103 |
+
XMLPUBFUN int xmlUCSIsLowSurrogates (int code);
|
| 104 |
+
XMLPUBFUN int xmlUCSIsMalayalam (int code);
|
| 105 |
+
XMLPUBFUN int xmlUCSIsMathematicalAlphanumericSymbols (int code);
|
| 106 |
+
XMLPUBFUN int xmlUCSIsMathematicalOperators (int code);
|
| 107 |
+
XMLPUBFUN int xmlUCSIsMiscellaneousMathematicalSymbolsA (int code);
|
| 108 |
+
XMLPUBFUN int xmlUCSIsMiscellaneousMathematicalSymbolsB (int code);
|
| 109 |
+
XMLPUBFUN int xmlUCSIsMiscellaneousSymbols (int code);
|
| 110 |
+
XMLPUBFUN int xmlUCSIsMiscellaneousSymbolsandArrows (int code);
|
| 111 |
+
XMLPUBFUN int xmlUCSIsMiscellaneousTechnical (int code);
|
| 112 |
+
XMLPUBFUN int xmlUCSIsMongolian (int code);
|
| 113 |
+
XMLPUBFUN int xmlUCSIsMusicalSymbols (int code);
|
| 114 |
+
XMLPUBFUN int xmlUCSIsMyanmar (int code);
|
| 115 |
+
XMLPUBFUN int xmlUCSIsNumberForms (int code);
|
| 116 |
+
XMLPUBFUN int xmlUCSIsOgham (int code);
|
| 117 |
+
XMLPUBFUN int xmlUCSIsOldItalic (int code);
|
| 118 |
+
XMLPUBFUN int xmlUCSIsOpticalCharacterRecognition (int code);
|
| 119 |
+
XMLPUBFUN int xmlUCSIsOriya (int code);
|
| 120 |
+
XMLPUBFUN int xmlUCSIsOsmanya (int code);
|
| 121 |
+
XMLPUBFUN int xmlUCSIsPhoneticExtensions (int code);
|
| 122 |
+
XMLPUBFUN int xmlUCSIsPrivateUse (int code);
|
| 123 |
+
XMLPUBFUN int xmlUCSIsPrivateUseArea (int code);
|
| 124 |
+
XMLPUBFUN int xmlUCSIsRunic (int code);
|
| 125 |
+
XMLPUBFUN int xmlUCSIsShavian (int code);
|
| 126 |
+
XMLPUBFUN int xmlUCSIsSinhala (int code);
|
| 127 |
+
XMLPUBFUN int xmlUCSIsSmallFormVariants (int code);
|
| 128 |
+
XMLPUBFUN int xmlUCSIsSpacingModifierLetters (int code);
|
| 129 |
+
XMLPUBFUN int xmlUCSIsSpecials (int code);
|
| 130 |
+
XMLPUBFUN int xmlUCSIsSuperscriptsandSubscripts (int code);
|
| 131 |
+
XMLPUBFUN int xmlUCSIsSupplementalArrowsA (int code);
|
| 132 |
+
XMLPUBFUN int xmlUCSIsSupplementalArrowsB (int code);
|
| 133 |
+
XMLPUBFUN int xmlUCSIsSupplementalMathematicalOperators (int code);
|
| 134 |
+
XMLPUBFUN int xmlUCSIsSupplementaryPrivateUseAreaA (int code);
|
| 135 |
+
XMLPUBFUN int xmlUCSIsSupplementaryPrivateUseAreaB (int code);
|
| 136 |
+
XMLPUBFUN int xmlUCSIsSyriac (int code);
|
| 137 |
+
XMLPUBFUN int xmlUCSIsTagalog (int code);
|
| 138 |
+
XMLPUBFUN int xmlUCSIsTagbanwa (int code);
|
| 139 |
+
XMLPUBFUN int xmlUCSIsTags (int code);
|
| 140 |
+
XMLPUBFUN int xmlUCSIsTaiLe (int code);
|
| 141 |
+
XMLPUBFUN int xmlUCSIsTaiXuanJingSymbols (int code);
|
| 142 |
+
XMLPUBFUN int xmlUCSIsTamil (int code);
|
| 143 |
+
XMLPUBFUN int xmlUCSIsTelugu (int code);
|
| 144 |
+
XMLPUBFUN int xmlUCSIsThaana (int code);
|
| 145 |
+
XMLPUBFUN int xmlUCSIsThai (int code);
|
| 146 |
+
XMLPUBFUN int xmlUCSIsTibetan (int code);
|
| 147 |
+
XMLPUBFUN int xmlUCSIsUgaritic (int code);
|
| 148 |
+
XMLPUBFUN int xmlUCSIsUnifiedCanadianAboriginalSyllabics (int code);
|
| 149 |
+
XMLPUBFUN int xmlUCSIsVariationSelectors (int code);
|
| 150 |
+
XMLPUBFUN int xmlUCSIsVariationSelectorsSupplement (int code);
|
| 151 |
+
XMLPUBFUN int xmlUCSIsYiRadicals (int code);
|
| 152 |
+
XMLPUBFUN int xmlUCSIsYiSyllables (int code);
|
| 153 |
+
XMLPUBFUN int xmlUCSIsYijingHexagramSymbols (int code);
|
| 154 |
+
|
| 155 |
+
XMLPUBFUN int xmlUCSIsBlock (int code, const char *block);
|
| 156 |
+
|
| 157 |
+
XMLPUBFUN int xmlUCSIsCatC (int code);
|
| 158 |
+
XMLPUBFUN int xmlUCSIsCatCc (int code);
|
| 159 |
+
XMLPUBFUN int xmlUCSIsCatCf (int code);
|
| 160 |
+
XMLPUBFUN int xmlUCSIsCatCo (int code);
|
| 161 |
+
XMLPUBFUN int xmlUCSIsCatCs (int code);
|
| 162 |
+
XMLPUBFUN int xmlUCSIsCatL (int code);
|
| 163 |
+
XMLPUBFUN int xmlUCSIsCatLl (int code);
|
| 164 |
+
XMLPUBFUN int xmlUCSIsCatLm (int code);
|
| 165 |
+
XMLPUBFUN int xmlUCSIsCatLo (int code);
|
| 166 |
+
XMLPUBFUN int xmlUCSIsCatLt (int code);
|
| 167 |
+
XMLPUBFUN int xmlUCSIsCatLu (int code);
|
| 168 |
+
XMLPUBFUN int xmlUCSIsCatM (int code);
|
| 169 |
+
XMLPUBFUN int xmlUCSIsCatMc (int code);
|
| 170 |
+
XMLPUBFUN int xmlUCSIsCatMe (int code);
|
| 171 |
+
XMLPUBFUN int xmlUCSIsCatMn (int code);
|
| 172 |
+
XMLPUBFUN int xmlUCSIsCatN (int code);
|
| 173 |
+
XMLPUBFUN int xmlUCSIsCatNd (int code);
|
| 174 |
+
XMLPUBFUN int xmlUCSIsCatNl (int code);
|
| 175 |
+
XMLPUBFUN int xmlUCSIsCatNo (int code);
|
| 176 |
+
XMLPUBFUN int xmlUCSIsCatP (int code);
|
| 177 |
+
XMLPUBFUN int xmlUCSIsCatPc (int code);
|
| 178 |
+
XMLPUBFUN int xmlUCSIsCatPd (int code);
|
| 179 |
+
XMLPUBFUN int xmlUCSIsCatPe (int code);
|
| 180 |
+
XMLPUBFUN int xmlUCSIsCatPf (int code);
|
| 181 |
+
XMLPUBFUN int xmlUCSIsCatPi (int code);
|
| 182 |
+
XMLPUBFUN int xmlUCSIsCatPo (int code);
|
| 183 |
+
XMLPUBFUN int xmlUCSIsCatPs (int code);
|
| 184 |
+
XMLPUBFUN int xmlUCSIsCatS (int code);
|
| 185 |
+
XMLPUBFUN int xmlUCSIsCatSc (int code);
|
| 186 |
+
XMLPUBFUN int xmlUCSIsCatSk (int code);
|
| 187 |
+
XMLPUBFUN int xmlUCSIsCatSm (int code);
|
| 188 |
+
XMLPUBFUN int xmlUCSIsCatSo (int code);
|
| 189 |
+
XMLPUBFUN int xmlUCSIsCatZ (int code);
|
| 190 |
+
XMLPUBFUN int xmlUCSIsCatZl (int code);
|
| 191 |
+
XMLPUBFUN int xmlUCSIsCatZp (int code);
|
| 192 |
+
XMLPUBFUN int xmlUCSIsCatZs (int code);
|
| 193 |
+
|
| 194 |
+
XMLPUBFUN int xmlUCSIsCat (int code, const char *cat);
|
| 195 |
+
|
| 196 |
+
#ifdef __cplusplus
|
| 197 |
+
}
|
| 198 |
+
#endif
|
| 199 |
+
|
| 200 |
+
#endif /* LIBXML_UNICODE_ENABLED */
|
| 201 |
+
|
| 202 |
+
#endif /* __XML_UNICODE_H__ */
|
pgsql/include/libxml/xmlversion.h
ADDED
|
@@ -0,0 +1,526 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: compile-time version information
|
| 3 |
+
* Description: compile-time version information for the XML library
|
| 4 |
+
*
|
| 5 |
+
* Copy: See Copyright for the status of this software.
|
| 6 |
+
*
|
| 7 |
+
* Author: Daniel Veillard
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef __XML_VERSION_H__
|
| 11 |
+
#define __XML_VERSION_H__
|
| 12 |
+
|
| 13 |
+
#include <libxml/xmlexports.h>
|
| 14 |
+
|
| 15 |
+
#ifdef __cplusplus
|
| 16 |
+
extern "C" {
|
| 17 |
+
#endif
|
| 18 |
+
|
| 19 |
+
/*
|
| 20 |
+
* use those to be sure nothing nasty will happen if
|
| 21 |
+
* your library and includes mismatch
|
| 22 |
+
*/
|
| 23 |
+
#ifndef LIBXML2_COMPILING_MSCCDEF
|
| 24 |
+
XMLPUBFUN void xmlCheckVersion(int version);
|
| 25 |
+
#endif /* LIBXML2_COMPILING_MSCCDEF */
|
| 26 |
+
|
| 27 |
+
/**
|
| 28 |
+
* LIBXML_DOTTED_VERSION:
|
| 29 |
+
*
|
| 30 |
+
* the version string like "1.2.3"
|
| 31 |
+
*/
|
| 32 |
+
#define LIBXML_DOTTED_VERSION "2.11.7"
|
| 33 |
+
|
| 34 |
+
/**
|
| 35 |
+
* LIBXML_VERSION:
|
| 36 |
+
*
|
| 37 |
+
* the version number: 1.2.3 value is 10203
|
| 38 |
+
*/
|
| 39 |
+
#define LIBXML_VERSION 21107
|
| 40 |
+
|
| 41 |
+
/**
|
| 42 |
+
* LIBXML_VERSION_STRING:
|
| 43 |
+
*
|
| 44 |
+
* the version number string, 1.2.3 value is "10203"
|
| 45 |
+
*/
|
| 46 |
+
#define LIBXML_VERSION_STRING "21107"
|
| 47 |
+
|
| 48 |
+
/**
|
| 49 |
+
* LIBXML_VERSION_EXTRA:
|
| 50 |
+
*
|
| 51 |
+
* extra version information, used to show a git commit description
|
| 52 |
+
*/
|
| 53 |
+
#define LIBXML_VERSION_EXTRA ""
|
| 54 |
+
|
| 55 |
+
/**
|
| 56 |
+
* LIBXML_TEST_VERSION:
|
| 57 |
+
*
|
| 58 |
+
* Macro to check that the libxml version in use is compatible with
|
| 59 |
+
* the version the software has been compiled against
|
| 60 |
+
*/
|
| 61 |
+
#define LIBXML_TEST_VERSION xmlCheckVersion(21107);
|
| 62 |
+
|
| 63 |
+
#ifndef VMS
|
| 64 |
+
#if 0
|
| 65 |
+
/**
|
| 66 |
+
* WITH_TRIO:
|
| 67 |
+
*
|
| 68 |
+
* defined if the trio support need to be configured in
|
| 69 |
+
*/
|
| 70 |
+
#define WITH_TRIO
|
| 71 |
+
#else
|
| 72 |
+
/**
|
| 73 |
+
* WITHOUT_TRIO:
|
| 74 |
+
*
|
| 75 |
+
* defined if the trio support should not be configured in
|
| 76 |
+
*/
|
| 77 |
+
#define WITHOUT_TRIO
|
| 78 |
+
#endif
|
| 79 |
+
#else /* VMS */
|
| 80 |
+
/**
|
| 81 |
+
* WITH_TRIO:
|
| 82 |
+
*
|
| 83 |
+
* defined if the trio support need to be configured in
|
| 84 |
+
*/
|
| 85 |
+
#define WITH_TRIO 1
|
| 86 |
+
#endif /* VMS */
|
| 87 |
+
|
| 88 |
+
/**
|
| 89 |
+
* LIBXML_THREAD_ENABLED:
|
| 90 |
+
*
|
| 91 |
+
* Whether the thread support is configured in
|
| 92 |
+
*/
|
| 93 |
+
#if 1
|
| 94 |
+
#define LIBXML_THREAD_ENABLED
|
| 95 |
+
#endif
|
| 96 |
+
|
| 97 |
+
/**
|
| 98 |
+
* LIBXML_THREAD_ALLOC_ENABLED:
|
| 99 |
+
*
|
| 100 |
+
* Whether the allocation hooks are per-thread
|
| 101 |
+
*/
|
| 102 |
+
#if 0
|
| 103 |
+
#define LIBXML_THREAD_ALLOC_ENABLED
|
| 104 |
+
#endif
|
| 105 |
+
|
| 106 |
+
/**
|
| 107 |
+
* LIBXML_TREE_ENABLED:
|
| 108 |
+
*
|
| 109 |
+
* Whether the DOM like tree manipulation API support is configured in
|
| 110 |
+
*/
|
| 111 |
+
#if 1
|
| 112 |
+
#define LIBXML_TREE_ENABLED
|
| 113 |
+
#endif
|
| 114 |
+
|
| 115 |
+
/**
|
| 116 |
+
* LIBXML_OUTPUT_ENABLED:
|
| 117 |
+
*
|
| 118 |
+
* Whether the serialization/saving support is configured in
|
| 119 |
+
*/
|
| 120 |
+
#if 1
|
| 121 |
+
#define LIBXML_OUTPUT_ENABLED
|
| 122 |
+
#endif
|
| 123 |
+
|
| 124 |
+
/**
|
| 125 |
+
* LIBXML_PUSH_ENABLED:
|
| 126 |
+
*
|
| 127 |
+
* Whether the push parsing interfaces are configured in
|
| 128 |
+
*/
|
| 129 |
+
#if 1
|
| 130 |
+
#define LIBXML_PUSH_ENABLED
|
| 131 |
+
#endif
|
| 132 |
+
|
| 133 |
+
/**
|
| 134 |
+
* LIBXML_READER_ENABLED:
|
| 135 |
+
*
|
| 136 |
+
* Whether the xmlReader parsing interface is configured in
|
| 137 |
+
*/
|
| 138 |
+
#if 1
|
| 139 |
+
#define LIBXML_READER_ENABLED
|
| 140 |
+
#endif
|
| 141 |
+
|
| 142 |
+
/**
|
| 143 |
+
* LIBXML_PATTERN_ENABLED:
|
| 144 |
+
*
|
| 145 |
+
* Whether the xmlPattern node selection interface is configured in
|
| 146 |
+
*/
|
| 147 |
+
#if 1
|
| 148 |
+
#define LIBXML_PATTERN_ENABLED
|
| 149 |
+
#endif
|
| 150 |
+
|
| 151 |
+
/**
|
| 152 |
+
* LIBXML_WRITER_ENABLED:
|
| 153 |
+
*
|
| 154 |
+
* Whether the xmlWriter saving interface is configured in
|
| 155 |
+
*/
|
| 156 |
+
#if 1
|
| 157 |
+
#define LIBXML_WRITER_ENABLED
|
| 158 |
+
#endif
|
| 159 |
+
|
| 160 |
+
/**
|
| 161 |
+
* LIBXML_SAX1_ENABLED:
|
| 162 |
+
*
|
| 163 |
+
* Whether the older SAX1 interface is configured in
|
| 164 |
+
*/
|
| 165 |
+
#if 1
|
| 166 |
+
#define LIBXML_SAX1_ENABLED
|
| 167 |
+
#endif
|
| 168 |
+
|
| 169 |
+
/**
|
| 170 |
+
* LIBXML_FTP_ENABLED:
|
| 171 |
+
*
|
| 172 |
+
* Whether the FTP support is configured in
|
| 173 |
+
*/
|
| 174 |
+
#if 1
|
| 175 |
+
#define LIBXML_FTP_ENABLED
|
| 176 |
+
#endif
|
| 177 |
+
|
| 178 |
+
/**
|
| 179 |
+
* LIBXML_HTTP_ENABLED:
|
| 180 |
+
*
|
| 181 |
+
* Whether the HTTP support is configured in
|
| 182 |
+
*/
|
| 183 |
+
#if 1
|
| 184 |
+
#define LIBXML_HTTP_ENABLED
|
| 185 |
+
#endif
|
| 186 |
+
|
| 187 |
+
/**
|
| 188 |
+
* LIBXML_VALID_ENABLED:
|
| 189 |
+
*
|
| 190 |
+
* Whether the DTD validation support is configured in
|
| 191 |
+
*/
|
| 192 |
+
#if 1
|
| 193 |
+
#define LIBXML_VALID_ENABLED
|
| 194 |
+
#endif
|
| 195 |
+
|
| 196 |
+
/**
|
| 197 |
+
* LIBXML_HTML_ENABLED:
|
| 198 |
+
*
|
| 199 |
+
* Whether the HTML support is configured in
|
| 200 |
+
*/
|
| 201 |
+
#if 1
|
| 202 |
+
#define LIBXML_HTML_ENABLED
|
| 203 |
+
#endif
|
| 204 |
+
|
| 205 |
+
/**
|
| 206 |
+
* LIBXML_LEGACY_ENABLED:
|
| 207 |
+
*
|
| 208 |
+
* Whether the deprecated APIs are compiled in for compatibility
|
| 209 |
+
*/
|
| 210 |
+
#if 1
|
| 211 |
+
#define LIBXML_LEGACY_ENABLED
|
| 212 |
+
#endif
|
| 213 |
+
|
| 214 |
+
/**
|
| 215 |
+
* LIBXML_C14N_ENABLED:
|
| 216 |
+
*
|
| 217 |
+
* Whether the Canonicalization support is configured in
|
| 218 |
+
*/
|
| 219 |
+
#if 1
|
| 220 |
+
#define LIBXML_C14N_ENABLED
|
| 221 |
+
#endif
|
| 222 |
+
|
| 223 |
+
/**
|
| 224 |
+
* LIBXML_CATALOG_ENABLED:
|
| 225 |
+
*
|
| 226 |
+
* Whether the Catalog support is configured in
|
| 227 |
+
*/
|
| 228 |
+
#if 1
|
| 229 |
+
#define LIBXML_CATALOG_ENABLED
|
| 230 |
+
#endif
|
| 231 |
+
|
| 232 |
+
/**
|
| 233 |
+
* LIBXML_XPATH_ENABLED:
|
| 234 |
+
*
|
| 235 |
+
* Whether XPath is configured in
|
| 236 |
+
*/
|
| 237 |
+
#if 1
|
| 238 |
+
#define LIBXML_XPATH_ENABLED
|
| 239 |
+
#endif
|
| 240 |
+
|
| 241 |
+
/**
|
| 242 |
+
* LIBXML_XPTR_ENABLED:
|
| 243 |
+
*
|
| 244 |
+
* Whether XPointer is configured in
|
| 245 |
+
*/
|
| 246 |
+
#if 1
|
| 247 |
+
#define LIBXML_XPTR_ENABLED
|
| 248 |
+
#endif
|
| 249 |
+
|
| 250 |
+
/**
|
| 251 |
+
* LIBXML_XPTR_LOCS_ENABLED:
|
| 252 |
+
*
|
| 253 |
+
* Whether support for XPointer locations is configured in
|
| 254 |
+
*/
|
| 255 |
+
#if 0
|
| 256 |
+
#define LIBXML_XPTR_LOCS_ENABLED
|
| 257 |
+
#endif
|
| 258 |
+
|
| 259 |
+
/**
|
| 260 |
+
* LIBXML_XINCLUDE_ENABLED:
|
| 261 |
+
*
|
| 262 |
+
* Whether XInclude is configured in
|
| 263 |
+
*/
|
| 264 |
+
#if 1
|
| 265 |
+
#define LIBXML_XINCLUDE_ENABLED
|
| 266 |
+
#endif
|
| 267 |
+
|
| 268 |
+
/**
|
| 269 |
+
* LIBXML_ICONV_ENABLED:
|
| 270 |
+
*
|
| 271 |
+
* Whether iconv support is available
|
| 272 |
+
*/
|
| 273 |
+
#if 0
|
| 274 |
+
#define LIBXML_ICONV_ENABLED
|
| 275 |
+
#endif
|
| 276 |
+
|
| 277 |
+
/**
|
| 278 |
+
* LIBXML_ICU_ENABLED:
|
| 279 |
+
*
|
| 280 |
+
* Whether icu support is available
|
| 281 |
+
*/
|
| 282 |
+
#if 0
|
| 283 |
+
#define LIBXML_ICU_ENABLED
|
| 284 |
+
#endif
|
| 285 |
+
|
| 286 |
+
/**
|
| 287 |
+
* LIBXML_ISO8859X_ENABLED:
|
| 288 |
+
*
|
| 289 |
+
* Whether ISO-8859-* support is made available in case iconv is not
|
| 290 |
+
*/
|
| 291 |
+
#if 0
|
| 292 |
+
#define LIBXML_ISO8859X_ENABLED
|
| 293 |
+
#endif
|
| 294 |
+
|
| 295 |
+
/**
|
| 296 |
+
* LIBXML_DEBUG_ENABLED:
|
| 297 |
+
*
|
| 298 |
+
* Whether Debugging module is configured in
|
| 299 |
+
*/
|
| 300 |
+
#if 1
|
| 301 |
+
#define LIBXML_DEBUG_ENABLED
|
| 302 |
+
#endif
|
| 303 |
+
|
| 304 |
+
/**
|
| 305 |
+
* DEBUG_MEMORY_LOCATION:
|
| 306 |
+
*
|
| 307 |
+
* Whether the memory debugging is configured in
|
| 308 |
+
*/
|
| 309 |
+
#if 0
|
| 310 |
+
#define DEBUG_MEMORY_LOCATION
|
| 311 |
+
#endif
|
| 312 |
+
|
| 313 |
+
/**
|
| 314 |
+
* LIBXML_DEBUG_RUNTIME:
|
| 315 |
+
*
|
| 316 |
+
* Removed
|
| 317 |
+
*/
|
| 318 |
+
#if 0
|
| 319 |
+
#define LIBXML_DEBUG_RUNTIME
|
| 320 |
+
#endif
|
| 321 |
+
|
| 322 |
+
/**
|
| 323 |
+
* LIBXML_UNICODE_ENABLED:
|
| 324 |
+
*
|
| 325 |
+
* Whether the Unicode related interfaces are compiled in
|
| 326 |
+
*/
|
| 327 |
+
#if 1
|
| 328 |
+
#define LIBXML_UNICODE_ENABLED
|
| 329 |
+
#endif
|
| 330 |
+
|
| 331 |
+
/**
|
| 332 |
+
* LIBXML_REGEXP_ENABLED:
|
| 333 |
+
*
|
| 334 |
+
* Whether the regular expressions interfaces are compiled in
|
| 335 |
+
*/
|
| 336 |
+
#if 1
|
| 337 |
+
#define LIBXML_REGEXP_ENABLED
|
| 338 |
+
#endif
|
| 339 |
+
|
| 340 |
+
/**
|
| 341 |
+
* LIBXML_AUTOMATA_ENABLED:
|
| 342 |
+
*
|
| 343 |
+
* Whether the automata interfaces are compiled in
|
| 344 |
+
*/
|
| 345 |
+
#if 1
|
| 346 |
+
#define LIBXML_AUTOMATA_ENABLED
|
| 347 |
+
#endif
|
| 348 |
+
|
| 349 |
+
/**
|
| 350 |
+
* LIBXML_EXPR_ENABLED:
|
| 351 |
+
*
|
| 352 |
+
* Whether the formal expressions interfaces are compiled in
|
| 353 |
+
*
|
| 354 |
+
* This code is unused and disabled unconditionally for now.
|
| 355 |
+
*/
|
| 356 |
+
#if 0
|
| 357 |
+
#define LIBXML_EXPR_ENABLED
|
| 358 |
+
#endif
|
| 359 |
+
|
| 360 |
+
/**
|
| 361 |
+
* LIBXML_SCHEMAS_ENABLED:
|
| 362 |
+
*
|
| 363 |
+
* Whether the Schemas validation interfaces are compiled in
|
| 364 |
+
*/
|
| 365 |
+
#if 1
|
| 366 |
+
#define LIBXML_SCHEMAS_ENABLED
|
| 367 |
+
#endif
|
| 368 |
+
|
| 369 |
+
/**
|
| 370 |
+
* LIBXML_SCHEMATRON_ENABLED:
|
| 371 |
+
*
|
| 372 |
+
* Whether the Schematron validation interfaces are compiled in
|
| 373 |
+
*/
|
| 374 |
+
#if 1
|
| 375 |
+
#define LIBXML_SCHEMATRON_ENABLED
|
| 376 |
+
#endif
|
| 377 |
+
|
| 378 |
+
/**
|
| 379 |
+
* LIBXML_MODULES_ENABLED:
|
| 380 |
+
*
|
| 381 |
+
* Whether the module interfaces are compiled in
|
| 382 |
+
*/
|
| 383 |
+
#if 1
|
| 384 |
+
#define LIBXML_MODULES_ENABLED
|
| 385 |
+
/**
|
| 386 |
+
* LIBXML_MODULE_EXTENSION:
|
| 387 |
+
*
|
| 388 |
+
* the string suffix used by dynamic modules (usually shared libraries)
|
| 389 |
+
*/
|
| 390 |
+
#define LIBXML_MODULE_EXTENSION ".dll"
|
| 391 |
+
#endif
|
| 392 |
+
|
| 393 |
+
/**
|
| 394 |
+
* LIBXML_ZLIB_ENABLED:
|
| 395 |
+
*
|
| 396 |
+
* Whether the Zlib support is compiled in
|
| 397 |
+
*/
|
| 398 |
+
#if 0
|
| 399 |
+
#define LIBXML_ZLIB_ENABLED
|
| 400 |
+
#endif
|
| 401 |
+
|
| 402 |
+
/**
|
| 403 |
+
* LIBXML_LZMA_ENABLED:
|
| 404 |
+
*
|
| 405 |
+
* Whether the Lzma support is compiled in
|
| 406 |
+
*/
|
| 407 |
+
#if 0
|
| 408 |
+
#define LIBXML_LZMA_ENABLED
|
| 409 |
+
#endif
|
| 410 |
+
|
| 411 |
+
#ifdef __GNUC__
|
| 412 |
+
/** DOC_DISABLE */
|
| 413 |
+
|
| 414 |
+
#ifndef ATTRIBUTE_UNUSED
|
| 415 |
+
# if ((__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 7)))
|
| 416 |
+
# define ATTRIBUTE_UNUSED __attribute__((unused))
|
| 417 |
+
# else
|
| 418 |
+
# define ATTRIBUTE_UNUSED
|
| 419 |
+
# endif
|
| 420 |
+
#endif
|
| 421 |
+
|
| 422 |
+
#ifndef LIBXML_ATTR_ALLOC_SIZE
|
| 423 |
+
# if (!defined(__clang__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3))))
|
| 424 |
+
# define LIBXML_ATTR_ALLOC_SIZE(x) __attribute__((alloc_size(x)))
|
| 425 |
+
# else
|
| 426 |
+
# define LIBXML_ATTR_ALLOC_SIZE(x)
|
| 427 |
+
# endif
|
| 428 |
+
#else
|
| 429 |
+
# define LIBXML_ATTR_ALLOC_SIZE(x)
|
| 430 |
+
#endif
|
| 431 |
+
|
| 432 |
+
#ifndef LIBXML_ATTR_FORMAT
|
| 433 |
+
# if ((__GNUC__ > 3) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)))
|
| 434 |
+
# define LIBXML_ATTR_FORMAT(fmt,args) __attribute__((__format__(__printf__,fmt,args)))
|
| 435 |
+
# else
|
| 436 |
+
# define LIBXML_ATTR_FORMAT(fmt,args)
|
| 437 |
+
# endif
|
| 438 |
+
#else
|
| 439 |
+
# define LIBXML_ATTR_FORMAT(fmt,args)
|
| 440 |
+
#endif
|
| 441 |
+
|
| 442 |
+
#ifndef XML_DEPRECATED
|
| 443 |
+
# if defined (IN_LIBXML) || (__GNUC__ * 100 + __GNUC_MINOR__ < 301)
|
| 444 |
+
# define XML_DEPRECATED
|
| 445 |
+
/* Available since at least GCC 3.1 */
|
| 446 |
+
# else
|
| 447 |
+
# define XML_DEPRECATED __attribute__((deprecated))
|
| 448 |
+
# endif
|
| 449 |
+
#endif
|
| 450 |
+
|
| 451 |
+
#if defined(__clang__) || (__GNUC__ * 100 + __GNUC_MINOR__ >= 406)
|
| 452 |
+
#define XML_IGNORE_FPTR_CAST_WARNINGS \
|
| 453 |
+
_Pragma("GCC diagnostic push") \
|
| 454 |
+
_Pragma("GCC diagnostic ignored \"-Wpedantic\"") \
|
| 455 |
+
_Pragma("GCC diagnostic ignored \"-Wcast-function-type\"")
|
| 456 |
+
#define XML_POP_WARNINGS \
|
| 457 |
+
_Pragma("GCC diagnostic pop")
|
| 458 |
+
#else
|
| 459 |
+
#define XML_IGNORE_FPTR_CAST_WARNINGS
|
| 460 |
+
#define XML_POP_WARNINGS
|
| 461 |
+
#endif
|
| 462 |
+
|
| 463 |
+
/** DOC_ENABLE */
|
| 464 |
+
#else /* ! __GNUC__ */
|
| 465 |
+
/**
|
| 466 |
+
* ATTRIBUTE_UNUSED:
|
| 467 |
+
*
|
| 468 |
+
* Macro used to signal to GCC unused function parameters
|
| 469 |
+
*/
|
| 470 |
+
#define ATTRIBUTE_UNUSED
|
| 471 |
+
/**
|
| 472 |
+
* LIBXML_ATTR_ALLOC_SIZE:
|
| 473 |
+
*
|
| 474 |
+
* Macro used to indicate to GCC this is an allocator function
|
| 475 |
+
*/
|
| 476 |
+
#define LIBXML_ATTR_ALLOC_SIZE(x)
|
| 477 |
+
/**
|
| 478 |
+
* LIBXML_ATTR_FORMAT:
|
| 479 |
+
*
|
| 480 |
+
* Macro used to indicate to GCC the parameter are printf like
|
| 481 |
+
*/
|
| 482 |
+
#define LIBXML_ATTR_FORMAT(fmt,args)
|
| 483 |
+
/**
|
| 484 |
+
* XML_DEPRECATED:
|
| 485 |
+
*
|
| 486 |
+
* Macro used to indicate that a function, variable, type or struct member
|
| 487 |
+
* is deprecated.
|
| 488 |
+
*/
|
| 489 |
+
#ifndef XML_DEPRECATED
|
| 490 |
+
# if defined (IN_LIBXML) || !defined (_MSC_VER)
|
| 491 |
+
# define XML_DEPRECATED
|
| 492 |
+
/* Available since Visual Studio 2005 */
|
| 493 |
+
# elif defined (_MSC_VER) && (_MSC_VER >= 1400)
|
| 494 |
+
# define XML_DEPRECATED __declspec(deprecated)
|
| 495 |
+
# endif
|
| 496 |
+
#endif
|
| 497 |
+
/**
|
| 498 |
+
* LIBXML_IGNORE_FPTR_CAST_WARNINGS:
|
| 499 |
+
*
|
| 500 |
+
* Macro used to ignore pointer cast warnings that can't be worked around.
|
| 501 |
+
*/
|
| 502 |
+
#if defined (_MSC_VER) && (_MSC_VER >= 1400)
|
| 503 |
+
# define XML_IGNORE_FPTR_CAST_WARNINGS __pragma(warning(push))
|
| 504 |
+
#else
|
| 505 |
+
# define XML_IGNORE_FPTR_CAST_WARNINGS
|
| 506 |
+
#endif
|
| 507 |
+
/**
|
| 508 |
+
* XML_POP_WARNINGS:
|
| 509 |
+
*
|
| 510 |
+
* Macro used to restore warnings state.
|
| 511 |
+
*/
|
| 512 |
+
#ifndef XML_POP_WARNINGS
|
| 513 |
+
# if defined (_MSC_VER) && (_MSC_VER >= 1400)
|
| 514 |
+
# define XML_POP_WARNINGS __pragma(warning(pop))
|
| 515 |
+
# else
|
| 516 |
+
# define XML_POP_WARNINGS
|
| 517 |
+
# endif
|
| 518 |
+
#endif
|
| 519 |
+
#endif /* __GNUC__ */
|
| 520 |
+
|
| 521 |
+
#ifdef __cplusplus
|
| 522 |
+
}
|
| 523 |
+
#endif /* __cplusplus */
|
| 524 |
+
#endif
|
| 525 |
+
|
| 526 |
+
|
pgsql/include/libxml/xmlwriter.h
ADDED
|
@@ -0,0 +1,488 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/*
|
| 2 |
+
* Summary: text writing API for XML
|
| 3 |
+
* Description: text writing API for XML
|
| 4 |
+
*
|
| 5 |
+
* Copy: See Copyright for the status of this software.
|
| 6 |
+
*
|
| 7 |
+
* Author: Alfred Mickautsch <alfred@mickautsch.de>
|
| 8 |
+
*/
|
| 9 |
+
|
| 10 |
+
#ifndef __XML_XMLWRITER_H__
|
| 11 |
+
#define __XML_XMLWRITER_H__
|
| 12 |
+
|
| 13 |
+
#include <libxml/xmlversion.h>
|
| 14 |
+
|
| 15 |
+
#ifdef LIBXML_WRITER_ENABLED
|
| 16 |
+
|
| 17 |
+
#include <stdarg.h>
|
| 18 |
+
#include <libxml/xmlIO.h>
|
| 19 |
+
#include <libxml/list.h>
|
| 20 |
+
#include <libxml/xmlstring.h>
|
| 21 |
+
|
| 22 |
+
#ifdef __cplusplus
|
| 23 |
+
extern "C" {
|
| 24 |
+
#endif
|
| 25 |
+
|
| 26 |
+
typedef struct _xmlTextWriter xmlTextWriter;
|
| 27 |
+
typedef xmlTextWriter *xmlTextWriterPtr;
|
| 28 |
+
|
| 29 |
+
/*
|
| 30 |
+
* Constructors & Destructor
|
| 31 |
+
*/
|
| 32 |
+
XMLPUBFUN xmlTextWriterPtr
|
| 33 |
+
xmlNewTextWriter(xmlOutputBufferPtr out);
|
| 34 |
+
XMLPUBFUN xmlTextWriterPtr
|
| 35 |
+
xmlNewTextWriterFilename(const char *uri, int compression);
|
| 36 |
+
XMLPUBFUN xmlTextWriterPtr
|
| 37 |
+
xmlNewTextWriterMemory(xmlBufferPtr buf, int compression);
|
| 38 |
+
XMLPUBFUN xmlTextWriterPtr
|
| 39 |
+
xmlNewTextWriterPushParser(xmlParserCtxtPtr ctxt, int compression);
|
| 40 |
+
XMLPUBFUN xmlTextWriterPtr
|
| 41 |
+
xmlNewTextWriterDoc(xmlDocPtr * doc, int compression);
|
| 42 |
+
XMLPUBFUN xmlTextWriterPtr
|
| 43 |
+
xmlNewTextWriterTree(xmlDocPtr doc, xmlNodePtr node,
|
| 44 |
+
int compression);
|
| 45 |
+
XMLPUBFUN void xmlFreeTextWriter(xmlTextWriterPtr writer);
|
| 46 |
+
|
| 47 |
+
/*
|
| 48 |
+
* Functions
|
| 49 |
+
*/
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
/*
|
| 53 |
+
* Document
|
| 54 |
+
*/
|
| 55 |
+
XMLPUBFUN int
|
| 56 |
+
xmlTextWriterStartDocument(xmlTextWriterPtr writer,
|
| 57 |
+
const char *version,
|
| 58 |
+
const char *encoding,
|
| 59 |
+
const char *standalone);
|
| 60 |
+
XMLPUBFUN int xmlTextWriterEndDocument(xmlTextWriterPtr
|
| 61 |
+
writer);
|
| 62 |
+
|
| 63 |
+
/*
|
| 64 |
+
* Comments
|
| 65 |
+
*/
|
| 66 |
+
XMLPUBFUN int xmlTextWriterStartComment(xmlTextWriterPtr
|
| 67 |
+
writer);
|
| 68 |
+
XMLPUBFUN int xmlTextWriterEndComment(xmlTextWriterPtr writer);
|
| 69 |
+
XMLPUBFUN int
|
| 70 |
+
xmlTextWriterWriteFormatComment(xmlTextWriterPtr writer,
|
| 71 |
+
const char *format, ...)
|
| 72 |
+
LIBXML_ATTR_FORMAT(2,3);
|
| 73 |
+
XMLPUBFUN int
|
| 74 |
+
xmlTextWriterWriteVFormatComment(xmlTextWriterPtr writer,
|
| 75 |
+
const char *format,
|
| 76 |
+
va_list argptr)
|
| 77 |
+
LIBXML_ATTR_FORMAT(2,0);
|
| 78 |
+
XMLPUBFUN int xmlTextWriterWriteComment(xmlTextWriterPtr
|
| 79 |
+
writer,
|
| 80 |
+
const xmlChar *
|
| 81 |
+
content);
|
| 82 |
+
|
| 83 |
+
/*
|
| 84 |
+
* Elements
|
| 85 |
+
*/
|
| 86 |
+
XMLPUBFUN int
|
| 87 |
+
xmlTextWriterStartElement(xmlTextWriterPtr writer,
|
| 88 |
+
const xmlChar * name);
|
| 89 |
+
XMLPUBFUN int xmlTextWriterStartElementNS(xmlTextWriterPtr
|
| 90 |
+
writer,
|
| 91 |
+
const xmlChar *
|
| 92 |
+
prefix,
|
| 93 |
+
const xmlChar * name,
|
| 94 |
+
const xmlChar *
|
| 95 |
+
namespaceURI);
|
| 96 |
+
XMLPUBFUN int xmlTextWriterEndElement(xmlTextWriterPtr writer);
|
| 97 |
+
XMLPUBFUN int xmlTextWriterFullEndElement(xmlTextWriterPtr
|
| 98 |
+
writer);
|
| 99 |
+
|
| 100 |
+
/*
|
| 101 |
+
* Elements conveniency functions
|
| 102 |
+
*/
|
| 103 |
+
XMLPUBFUN int
|
| 104 |
+
xmlTextWriterWriteFormatElement(xmlTextWriterPtr writer,
|
| 105 |
+
const xmlChar * name,
|
| 106 |
+
const char *format, ...)
|
| 107 |
+
LIBXML_ATTR_FORMAT(3,4);
|
| 108 |
+
XMLPUBFUN int
|
| 109 |
+
xmlTextWriterWriteVFormatElement(xmlTextWriterPtr writer,
|
| 110 |
+
const xmlChar * name,
|
| 111 |
+
const char *format,
|
| 112 |
+
va_list argptr)
|
| 113 |
+
LIBXML_ATTR_FORMAT(3,0);
|
| 114 |
+
XMLPUBFUN int xmlTextWriterWriteElement(xmlTextWriterPtr
|
| 115 |
+
writer,
|
| 116 |
+
const xmlChar * name,
|
| 117 |
+
const xmlChar *
|
| 118 |
+
content);
|
| 119 |
+
XMLPUBFUN int
|
| 120 |
+
xmlTextWriterWriteFormatElementNS(xmlTextWriterPtr writer,
|
| 121 |
+
const xmlChar * prefix,
|
| 122 |
+
const xmlChar * name,
|
| 123 |
+
const xmlChar * namespaceURI,
|
| 124 |
+
const char *format, ...)
|
| 125 |
+
LIBXML_ATTR_FORMAT(5,6);
|
| 126 |
+
XMLPUBFUN int
|
| 127 |
+
xmlTextWriterWriteVFormatElementNS(xmlTextWriterPtr writer,
|
| 128 |
+
const xmlChar * prefix,
|
| 129 |
+
const xmlChar * name,
|
| 130 |
+
const xmlChar * namespaceURI,
|
| 131 |
+
const char *format,
|
| 132 |
+
va_list argptr)
|
| 133 |
+
LIBXML_ATTR_FORMAT(5,0);
|
| 134 |
+
XMLPUBFUN int xmlTextWriterWriteElementNS(xmlTextWriterPtr
|
| 135 |
+
writer,
|
| 136 |
+
const xmlChar *
|
| 137 |
+
prefix,
|
| 138 |
+
const xmlChar * name,
|
| 139 |
+
const xmlChar *
|
| 140 |
+
namespaceURI,
|
| 141 |
+
const xmlChar *
|
| 142 |
+
content);
|
| 143 |
+
|
| 144 |
+
/*
|
| 145 |
+
* Text
|
| 146 |
+
*/
|
| 147 |
+
XMLPUBFUN int
|
| 148 |
+
xmlTextWriterWriteFormatRaw(xmlTextWriterPtr writer,
|
| 149 |
+
const char *format, ...)
|
| 150 |
+
LIBXML_ATTR_FORMAT(2,3);
|
| 151 |
+
XMLPUBFUN int
|
| 152 |
+
xmlTextWriterWriteVFormatRaw(xmlTextWriterPtr writer,
|
| 153 |
+
const char *format, va_list argptr)
|
| 154 |
+
LIBXML_ATTR_FORMAT(2,0);
|
| 155 |
+
XMLPUBFUN int
|
| 156 |
+
xmlTextWriterWriteRawLen(xmlTextWriterPtr writer,
|
| 157 |
+
const xmlChar * content, int len);
|
| 158 |
+
XMLPUBFUN int
|
| 159 |
+
xmlTextWriterWriteRaw(xmlTextWriterPtr writer,
|
| 160 |
+
const xmlChar * content);
|
| 161 |
+
XMLPUBFUN int xmlTextWriterWriteFormatString(xmlTextWriterPtr
|
| 162 |
+
writer,
|
| 163 |
+
const char
|
| 164 |
+
*format, ...)
|
| 165 |
+
LIBXML_ATTR_FORMAT(2,3);
|
| 166 |
+
XMLPUBFUN int xmlTextWriterWriteVFormatString(xmlTextWriterPtr
|
| 167 |
+
writer,
|
| 168 |
+
const char
|
| 169 |
+
*format,
|
| 170 |
+
va_list argptr)
|
| 171 |
+
LIBXML_ATTR_FORMAT(2,0);
|
| 172 |
+
XMLPUBFUN int xmlTextWriterWriteString(xmlTextWriterPtr writer,
|
| 173 |
+
const xmlChar *
|
| 174 |
+
content);
|
| 175 |
+
XMLPUBFUN int xmlTextWriterWriteBase64(xmlTextWriterPtr writer,
|
| 176 |
+
const char *data,
|
| 177 |
+
int start, int len);
|
| 178 |
+
XMLPUBFUN int xmlTextWriterWriteBinHex(xmlTextWriterPtr writer,
|
| 179 |
+
const char *data,
|
| 180 |
+
int start, int len);
|
| 181 |
+
|
| 182 |
+
/*
|
| 183 |
+
* Attributes
|
| 184 |
+
*/
|
| 185 |
+
XMLPUBFUN int
|
| 186 |
+
xmlTextWriterStartAttribute(xmlTextWriterPtr writer,
|
| 187 |
+
const xmlChar * name);
|
| 188 |
+
XMLPUBFUN int xmlTextWriterStartAttributeNS(xmlTextWriterPtr
|
| 189 |
+
writer,
|
| 190 |
+
const xmlChar *
|
| 191 |
+
prefix,
|
| 192 |
+
const xmlChar *
|
| 193 |
+
name,
|
| 194 |
+
const xmlChar *
|
| 195 |
+
namespaceURI);
|
| 196 |
+
XMLPUBFUN int xmlTextWriterEndAttribute(xmlTextWriterPtr
|
| 197 |
+
writer);
|
| 198 |
+
|
| 199 |
+
/*
|
| 200 |
+
* Attributes conveniency functions
|
| 201 |
+
*/
|
| 202 |
+
XMLPUBFUN int
|
| 203 |
+
xmlTextWriterWriteFormatAttribute(xmlTextWriterPtr writer,
|
| 204 |
+
const xmlChar * name,
|
| 205 |
+
const char *format, ...)
|
| 206 |
+
LIBXML_ATTR_FORMAT(3,4);
|
| 207 |
+
XMLPUBFUN int
|
| 208 |
+
xmlTextWriterWriteVFormatAttribute(xmlTextWriterPtr writer,
|
| 209 |
+
const xmlChar * name,
|
| 210 |
+
const char *format,
|
| 211 |
+
va_list argptr)
|
| 212 |
+
LIBXML_ATTR_FORMAT(3,0);
|
| 213 |
+
XMLPUBFUN int xmlTextWriterWriteAttribute(xmlTextWriterPtr
|
| 214 |
+
writer,
|
| 215 |
+
const xmlChar * name,
|
| 216 |
+
const xmlChar *
|
| 217 |
+
content);
|
| 218 |
+
XMLPUBFUN int
|
| 219 |
+
xmlTextWriterWriteFormatAttributeNS(xmlTextWriterPtr writer,
|
| 220 |
+
const xmlChar * prefix,
|
| 221 |
+
const xmlChar * name,
|
| 222 |
+
const xmlChar * namespaceURI,
|
| 223 |
+
const char *format, ...)
|
| 224 |
+
LIBXML_ATTR_FORMAT(5,6);
|
| 225 |
+
XMLPUBFUN int
|
| 226 |
+
xmlTextWriterWriteVFormatAttributeNS(xmlTextWriterPtr writer,
|
| 227 |
+
const xmlChar * prefix,
|
| 228 |
+
const xmlChar * name,
|
| 229 |
+
const xmlChar * namespaceURI,
|
| 230 |
+
const char *format,
|
| 231 |
+
va_list argptr)
|
| 232 |
+
LIBXML_ATTR_FORMAT(5,0);
|
| 233 |
+
XMLPUBFUN int xmlTextWriterWriteAttributeNS(xmlTextWriterPtr
|
| 234 |
+
writer,
|
| 235 |
+
const xmlChar *
|
| 236 |
+
prefix,
|
| 237 |
+
const xmlChar *
|
| 238 |
+
name,
|
| 239 |
+
const xmlChar *
|
| 240 |
+
namespaceURI,
|
| 241 |
+
const xmlChar *
|
| 242 |
+
content);
|
| 243 |
+
|
| 244 |
+
/*
|
| 245 |
+
* PI's
|
| 246 |
+
*/
|
| 247 |
+
XMLPUBFUN int
|
| 248 |
+
xmlTextWriterStartPI(xmlTextWriterPtr writer,
|
| 249 |
+
const xmlChar * target);
|
| 250 |
+
XMLPUBFUN int xmlTextWriterEndPI(xmlTextWriterPtr writer);
|
| 251 |
+
|
| 252 |
+
/*
|
| 253 |
+
* PI conveniency functions
|
| 254 |
+
*/
|
| 255 |
+
XMLPUBFUN int
|
| 256 |
+
xmlTextWriterWriteFormatPI(xmlTextWriterPtr writer,
|
| 257 |
+
const xmlChar * target,
|
| 258 |
+
const char *format, ...)
|
| 259 |
+
LIBXML_ATTR_FORMAT(3,4);
|
| 260 |
+
XMLPUBFUN int
|
| 261 |
+
xmlTextWriterWriteVFormatPI(xmlTextWriterPtr writer,
|
| 262 |
+
const xmlChar * target,
|
| 263 |
+
const char *format, va_list argptr)
|
| 264 |
+
LIBXML_ATTR_FORMAT(3,0);
|
| 265 |
+
XMLPUBFUN int
|
| 266 |
+
xmlTextWriterWritePI(xmlTextWriterPtr writer,
|
| 267 |
+
const xmlChar * target,
|
| 268 |
+
const xmlChar * content);
|
| 269 |
+
|
| 270 |
+
/**
|
| 271 |
+
* xmlTextWriterWriteProcessingInstruction:
|
| 272 |
+
*
|
| 273 |
+
* This macro maps to xmlTextWriterWritePI
|
| 274 |
+
*/
|
| 275 |
+
#define xmlTextWriterWriteProcessingInstruction xmlTextWriterWritePI
|
| 276 |
+
|
| 277 |
+
/*
|
| 278 |
+
* CDATA
|
| 279 |
+
*/
|
| 280 |
+
XMLPUBFUN int xmlTextWriterStartCDATA(xmlTextWriterPtr writer);
|
| 281 |
+
XMLPUBFUN int xmlTextWriterEndCDATA(xmlTextWriterPtr writer);
|
| 282 |
+
|
| 283 |
+
/*
|
| 284 |
+
* CDATA conveniency functions
|
| 285 |
+
*/
|
| 286 |
+
XMLPUBFUN int
|
| 287 |
+
xmlTextWriterWriteFormatCDATA(xmlTextWriterPtr writer,
|
| 288 |
+
const char *format, ...)
|
| 289 |
+
LIBXML_ATTR_FORMAT(2,3);
|
| 290 |
+
XMLPUBFUN int
|
| 291 |
+
xmlTextWriterWriteVFormatCDATA(xmlTextWriterPtr writer,
|
| 292 |
+
const char *format, va_list argptr)
|
| 293 |
+
LIBXML_ATTR_FORMAT(2,0);
|
| 294 |
+
XMLPUBFUN int
|
| 295 |
+
xmlTextWriterWriteCDATA(xmlTextWriterPtr writer,
|
| 296 |
+
const xmlChar * content);
|
| 297 |
+
|
| 298 |
+
/*
|
| 299 |
+
* DTD
|
| 300 |
+
*/
|
| 301 |
+
XMLPUBFUN int
|
| 302 |
+
xmlTextWriterStartDTD(xmlTextWriterPtr writer,
|
| 303 |
+
const xmlChar * name,
|
| 304 |
+
const xmlChar * pubid,
|
| 305 |
+
const xmlChar * sysid);
|
| 306 |
+
XMLPUBFUN int xmlTextWriterEndDTD(xmlTextWriterPtr writer);
|
| 307 |
+
|
| 308 |
+
/*
|
| 309 |
+
* DTD conveniency functions
|
| 310 |
+
*/
|
| 311 |
+
XMLPUBFUN int
|
| 312 |
+
xmlTextWriterWriteFormatDTD(xmlTextWriterPtr writer,
|
| 313 |
+
const xmlChar * name,
|
| 314 |
+
const xmlChar * pubid,
|
| 315 |
+
const xmlChar * sysid,
|
| 316 |
+
const char *format, ...)
|
| 317 |
+
LIBXML_ATTR_FORMAT(5,6);
|
| 318 |
+
XMLPUBFUN int
|
| 319 |
+
xmlTextWriterWriteVFormatDTD(xmlTextWriterPtr writer,
|
| 320 |
+
const xmlChar * name,
|
| 321 |
+
const xmlChar * pubid,
|
| 322 |
+
const xmlChar * sysid,
|
| 323 |
+
const char *format, va_list argptr)
|
| 324 |
+
LIBXML_ATTR_FORMAT(5,0);
|
| 325 |
+
XMLPUBFUN int
|
| 326 |
+
xmlTextWriterWriteDTD(xmlTextWriterPtr writer,
|
| 327 |
+
const xmlChar * name,
|
| 328 |
+
const xmlChar * pubid,
|
| 329 |
+
const xmlChar * sysid,
|
| 330 |
+
const xmlChar * subset);
|
| 331 |
+
|
| 332 |
+
/**
|
| 333 |
+
* xmlTextWriterWriteDocType:
|
| 334 |
+
*
|
| 335 |
+
* this macro maps to xmlTextWriterWriteDTD
|
| 336 |
+
*/
|
| 337 |
+
#define xmlTextWriterWriteDocType xmlTextWriterWriteDTD
|
| 338 |
+
|
| 339 |
+
/*
|
| 340 |
+
* DTD element definition
|
| 341 |
+
*/
|
| 342 |
+
XMLPUBFUN int
|
| 343 |
+
xmlTextWriterStartDTDElement(xmlTextWriterPtr writer,
|
| 344 |
+
const xmlChar * name);
|
| 345 |
+
XMLPUBFUN int xmlTextWriterEndDTDElement(xmlTextWriterPtr
|
| 346 |
+
writer);
|
| 347 |
+
|
| 348 |
+
/*
|
| 349 |
+
* DTD element definition conveniency functions
|
| 350 |
+
*/
|
| 351 |
+
XMLPUBFUN int
|
| 352 |
+
xmlTextWriterWriteFormatDTDElement(xmlTextWriterPtr writer,
|
| 353 |
+
const xmlChar * name,
|
| 354 |
+
const char *format, ...)
|
| 355 |
+
LIBXML_ATTR_FORMAT(3,4);
|
| 356 |
+
XMLPUBFUN int
|
| 357 |
+
xmlTextWriterWriteVFormatDTDElement(xmlTextWriterPtr writer,
|
| 358 |
+
const xmlChar * name,
|
| 359 |
+
const char *format,
|
| 360 |
+
va_list argptr)
|
| 361 |
+
LIBXML_ATTR_FORMAT(3,0);
|
| 362 |
+
XMLPUBFUN int xmlTextWriterWriteDTDElement(xmlTextWriterPtr
|
| 363 |
+
writer,
|
| 364 |
+
const xmlChar *
|
| 365 |
+
name,
|
| 366 |
+
const xmlChar *
|
| 367 |
+
content);
|
| 368 |
+
|
| 369 |
+
/*
|
| 370 |
+
* DTD attribute list definition
|
| 371 |
+
*/
|
| 372 |
+
XMLPUBFUN int
|
| 373 |
+
xmlTextWriterStartDTDAttlist(xmlTextWriterPtr writer,
|
| 374 |
+
const xmlChar * name);
|
| 375 |
+
XMLPUBFUN int xmlTextWriterEndDTDAttlist(xmlTextWriterPtr
|
| 376 |
+
writer);
|
| 377 |
+
|
| 378 |
+
/*
|
| 379 |
+
* DTD attribute list definition conveniency functions
|
| 380 |
+
*/
|
| 381 |
+
XMLPUBFUN int
|
| 382 |
+
xmlTextWriterWriteFormatDTDAttlist(xmlTextWriterPtr writer,
|
| 383 |
+
const xmlChar * name,
|
| 384 |
+
const char *format, ...)
|
| 385 |
+
LIBXML_ATTR_FORMAT(3,4);
|
| 386 |
+
XMLPUBFUN int
|
| 387 |
+
xmlTextWriterWriteVFormatDTDAttlist(xmlTextWriterPtr writer,
|
| 388 |
+
const xmlChar * name,
|
| 389 |
+
const char *format,
|
| 390 |
+
va_list argptr)
|
| 391 |
+
LIBXML_ATTR_FORMAT(3,0);
|
| 392 |
+
XMLPUBFUN int xmlTextWriterWriteDTDAttlist(xmlTextWriterPtr
|
| 393 |
+
writer,
|
| 394 |
+
const xmlChar *
|
| 395 |
+
name,
|
| 396 |
+
const xmlChar *
|
| 397 |
+
content);
|
| 398 |
+
|
| 399 |
+
/*
|
| 400 |
+
* DTD entity definition
|
| 401 |
+
*/
|
| 402 |
+
XMLPUBFUN int
|
| 403 |
+
xmlTextWriterStartDTDEntity(xmlTextWriterPtr writer,
|
| 404 |
+
int pe, const xmlChar * name);
|
| 405 |
+
XMLPUBFUN int xmlTextWriterEndDTDEntity(xmlTextWriterPtr
|
| 406 |
+
writer);
|
| 407 |
+
|
| 408 |
+
/*
|
| 409 |
+
* DTD entity definition conveniency functions
|
| 410 |
+
*/
|
| 411 |
+
XMLPUBFUN int
|
| 412 |
+
xmlTextWriterWriteFormatDTDInternalEntity(xmlTextWriterPtr writer,
|
| 413 |
+
int pe,
|
| 414 |
+
const xmlChar * name,
|
| 415 |
+
const char *format, ...)
|
| 416 |
+
LIBXML_ATTR_FORMAT(4,5);
|
| 417 |
+
XMLPUBFUN int
|
| 418 |
+
xmlTextWriterWriteVFormatDTDInternalEntity(xmlTextWriterPtr writer,
|
| 419 |
+
int pe,
|
| 420 |
+
const xmlChar * name,
|
| 421 |
+
const char *format,
|
| 422 |
+
va_list argptr)
|
| 423 |
+
LIBXML_ATTR_FORMAT(4,0);
|
| 424 |
+
XMLPUBFUN int
|
| 425 |
+
xmlTextWriterWriteDTDInternalEntity(xmlTextWriterPtr writer,
|
| 426 |
+
int pe,
|
| 427 |
+
const xmlChar * name,
|
| 428 |
+
const xmlChar * content);
|
| 429 |
+
XMLPUBFUN int
|
| 430 |
+
xmlTextWriterWriteDTDExternalEntity(xmlTextWriterPtr writer,
|
| 431 |
+
int pe,
|
| 432 |
+
const xmlChar * name,
|
| 433 |
+
const xmlChar * pubid,
|
| 434 |
+
const xmlChar * sysid,
|
| 435 |
+
const xmlChar * ndataid);
|
| 436 |
+
XMLPUBFUN int
|
| 437 |
+
xmlTextWriterWriteDTDExternalEntityContents(xmlTextWriterPtr
|
| 438 |
+
writer,
|
| 439 |
+
const xmlChar * pubid,
|
| 440 |
+
const xmlChar * sysid,
|
| 441 |
+
const xmlChar *
|
| 442 |
+
ndataid);
|
| 443 |
+
XMLPUBFUN int xmlTextWriterWriteDTDEntity(xmlTextWriterPtr
|
| 444 |
+
writer, int pe,
|
| 445 |
+
const xmlChar * name,
|
| 446 |
+
const xmlChar *
|
| 447 |
+
pubid,
|
| 448 |
+
const xmlChar *
|
| 449 |
+
sysid,
|
| 450 |
+
const xmlChar *
|
| 451 |
+
ndataid,
|
| 452 |
+
const xmlChar *
|
| 453 |
+
content);
|
| 454 |
+
|
| 455 |
+
/*
|
| 456 |
+
* DTD notation definition
|
| 457 |
+
*/
|
| 458 |
+
XMLPUBFUN int
|
| 459 |
+
xmlTextWriterWriteDTDNotation(xmlTextWriterPtr writer,
|
| 460 |
+
const xmlChar * name,
|
| 461 |
+
const xmlChar * pubid,
|
| 462 |
+
const xmlChar * sysid);
|
| 463 |
+
|
| 464 |
+
/*
|
| 465 |
+
* Indentation
|
| 466 |
+
*/
|
| 467 |
+
XMLPUBFUN int
|
| 468 |
+
xmlTextWriterSetIndent(xmlTextWriterPtr writer, int indent);
|
| 469 |
+
XMLPUBFUN int
|
| 470 |
+
xmlTextWriterSetIndentString(xmlTextWriterPtr writer,
|
| 471 |
+
const xmlChar * str);
|
| 472 |
+
|
| 473 |
+
XMLPUBFUN int
|
| 474 |
+
xmlTextWriterSetQuoteChar(xmlTextWriterPtr writer, xmlChar quotechar);
|
| 475 |
+
|
| 476 |
+
|
| 477 |
+
/*
|
| 478 |
+
* misc
|
| 479 |
+
*/
|
| 480 |
+
XMLPUBFUN int xmlTextWriterFlush(xmlTextWriterPtr writer);
|
| 481 |
+
|
| 482 |
+
#ifdef __cplusplus
|
| 483 |
+
}
|
| 484 |
+
#endif
|
| 485 |
+
|
| 486 |
+
#endif /* LIBXML_WRITER_ENABLED */
|
| 487 |
+
|
| 488 |
+
#endif /* __XML_XMLWRITER_H__ */
|