created Jamfile for COLLADA_COM & LibXML, added LibXML in it's own location under Extras
libxml doesn't compile with jam yet, C sourcecode versus C++?
This commit is contained in:
164
Demos/Jamfile
164
Demos/Jamfile
@@ -1,77 +1,87 @@
|
||||
SubDir TOP Demos ;
|
||||
|
||||
SubInclude TOP Demos OpenGL ;
|
||||
|
||||
if $(GLUT.AVAILABLE) = "yes"
|
||||
{
|
||||
# All demo apps have a lot in common, so use this rule to simply things
|
||||
rule BulletDemo
|
||||
{
|
||||
Application $(<) : $(>) : noinstall console nomanifest ;
|
||||
LinkWith $(<) : bullet bulletopenglsupport bulletphysicsinterfacecommon bulletccdphysics bulletmath ;
|
||||
CFlags $(<) :
|
||||
[ FIncludes $(TOP)/Demos/OpenGL ]
|
||||
[ FIncludes $(TOP)/Extras/PhysicsInterface/CcdPhysics ]
|
||||
[ FIncludes $(TOP)/Extras/PhysicsInterface/Common ]
|
||||
;
|
||||
MsvcIncDirs $(<) :
|
||||
"../../Demos/OpenGL"
|
||||
"../../Extras/PhysicsInterface/CcdPhysics"
|
||||
"../../Extras/PhysicsInterface/Common" ;
|
||||
}
|
||||
|
||||
#some demos need extra functionality, Collada / ConvexDecomposition etc.
|
||||
rule ExtraDemo
|
||||
{
|
||||
Application $(<) : $(>) : noinstall console nomanifest ;
|
||||
LinkWith $(<) : convexdecomposition bullet bulletopenglsupport bulletphysicsinterfacecommon bulletccdphysics bulletmath ;
|
||||
CFlags $(<) :
|
||||
[ FIncludes $(TOP)/Demos/OpenGL ]
|
||||
[ FIncludes $(TOP)/Extras/PhysicsInterface/CcdPhysics ]
|
||||
[ FIncludes $(TOP)/Extras/PhysicsInterface/Common ]
|
||||
[ FIncludes $(TOP)/Extras/ConvexDecomposition ]
|
||||
|
||||
;
|
||||
MsvcIncDirs $(<) :
|
||||
"../../Demos/OpenGL"
|
||||
"../../Extras/PhysicsInterface/CcdPhysics"
|
||||
"../../Extras/PhysicsInterface/Common"
|
||||
"../../Extras/ConvexDecomposition" ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
rule BulletDemo
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
rule BulletBasicDemo
|
||||
{
|
||||
Application $(<) : $(>) : noinstall console nomanifest ;
|
||||
LinkWith $(<) : bullet bulletphysicsinterfacecommon bulletccdphysics bulletmath ;
|
||||
CFlags $(<) :
|
||||
[ FIncludes $(TOP)/Extras/PhysicsInterface/CcdPhysics ]
|
||||
[ FIncludes $(TOP)/Extras/PhysicsInterface/Common ]
|
||||
;
|
||||
MsvcIncDirs $(<) :
|
||||
"../../Extras/PhysicsInterface/CcdPhysics"
|
||||
"../../Extras/PhysicsInterface/Common" ;
|
||||
}
|
||||
|
||||
SubInclude TOP Demos CcdPhysicsDemo ;
|
||||
SubInclude TOP Demos ConvexDecompositionDemo ;
|
||||
SubInclude TOP Demos ColladaDemo ;
|
||||
SubInclude TOP Demos BasicSample ;
|
||||
SubInclude TOP Demos CollisionDemo ;
|
||||
SubInclude TOP Demos CollisionInterfaceDemo ;
|
||||
SubInclude TOP Demos ConcaveDemo ;
|
||||
SubInclude TOP Demos ConstraintDemo ;
|
||||
SubInclude TOP Demos ContinuousConvexCollision ;
|
||||
SubInclude TOP Demos GjkConvexCastDemo ;
|
||||
SubInclude TOP Demos EPAPenDepthDemo ;
|
||||
SubInclude TOP Demos Raytracer ;
|
||||
SubInclude TOP Demos SimplexDemo ;
|
||||
SubDir TOP Demos ;
|
||||
|
||||
SubInclude TOP Demos OpenGL ;
|
||||
|
||||
if $(GLUT.AVAILABLE) = "yes"
|
||||
{
|
||||
# All demo apps have a lot in common, so use this rule to simply things
|
||||
rule BulletDemo
|
||||
{
|
||||
Application $(<) : $(>) : noinstall console nomanifest ;
|
||||
LinkWith $(<) : bullet bulletopenglsupport bulletphysicsinterfacecommon bulletccdphysics bulletmath ;
|
||||
CFlags $(<) :
|
||||
[ FIncludes $(TOP)/Demos/OpenGL ]
|
||||
[ FIncludes $(TOP)/Extras/PhysicsInterface/CcdPhysics ]
|
||||
[ FIncludes $(TOP)/Extras/PhysicsInterface/Common ]
|
||||
;
|
||||
MsvcIncDirs $(<) :
|
||||
"../../Demos/OpenGL"
|
||||
"../../Extras/PhysicsInterface/CcdPhysics"
|
||||
"../../Extras/PhysicsInterface/Common" ;
|
||||
}
|
||||
|
||||
#some demos need extra functionality, Collada / ConvexDecomposition etc.
|
||||
rule ExtraDemo
|
||||
{
|
||||
Application $(<) : $(>) : noinstall console nomanifest ;
|
||||
LinkWith $(<) : collada-dom libxml convexdecomposition bullet bulletopenglsupport bulletphysicsinterfacecommon bulletccdphysics bulletmath ;
|
||||
CFlags $(<) :
|
||||
[ FIncludes $(TOP)/Demos/OpenGL ]
|
||||
[ FIncludes $(TOP)/Extras/PhysicsInterface/CcdPhysics ]
|
||||
[ FIncludes $(TOP)/Extras/PhysicsInterface/Common ]
|
||||
[ FIncludes $(TOP)/Extras/ConvexDecomposition ]
|
||||
[ FIncludes $(TOP)/Extras/COLLADA_DOM/include ]
|
||||
[ FIncludes $(TOP)/Extras/COLLADA_DOM/include/1.4 ]
|
||||
[ FIncludes $(TOP)/Extras/LibXML ]
|
||||
[ FIncludes $(TOP)/Extras/LibXML/include ]
|
||||
|
||||
|
||||
|
||||
;
|
||||
MsvcIncDirs $(<) :
|
||||
"../../Demos/OpenGL"
|
||||
"../../Extras/PhysicsInterface/CcdPhysics"
|
||||
"../../Extras/PhysicsInterface/Common"
|
||||
"../../Extras/ConvexDecomposition"
|
||||
"../../Extras/COLLADA_DOM/include"
|
||||
"../../Extras/COLLADA_DOM/include/1.4"
|
||||
"../../Extras/LibXML"
|
||||
"../../Extras/LibXML/include" ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
rule BulletDemo
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
rule BulletBasicDemo
|
||||
{
|
||||
Application $(<) : $(>) : noinstall console nomanifest ;
|
||||
LinkWith $(<) : bullet bulletphysicsinterfacecommon bulletccdphysics bulletmath ;
|
||||
CFlags $(<) :
|
||||
[ FIncludes $(TOP)/Extras/PhysicsInterface/CcdPhysics ]
|
||||
[ FIncludes $(TOP)/Extras/PhysicsInterface/Common ]
|
||||
;
|
||||
MsvcIncDirs $(<) :
|
||||
"../../Extras/PhysicsInterface/CcdPhysics"
|
||||
"../../Extras/PhysicsInterface/Common" ;
|
||||
}
|
||||
|
||||
SubInclude TOP Demos CcdPhysicsDemo ;
|
||||
SubInclude TOP Demos ConvexDecompositionDemo ;
|
||||
SubInclude TOP Demos ColladaDemo ;
|
||||
SubInclude TOP Demos BasicSample ;
|
||||
SubInclude TOP Demos CollisionDemo ;
|
||||
SubInclude TOP Demos CollisionInterfaceDemo ;
|
||||
SubInclude TOP Demos ConcaveDemo ;
|
||||
SubInclude TOP Demos ConstraintDemo ;
|
||||
SubInclude TOP Demos ContinuousConvexCollision ;
|
||||
SubInclude TOP Demos GjkConvexCastDemo ;
|
||||
SubInclude TOP Demos EPAPenDepthDemo ;
|
||||
SubInclude TOP Demos Raytracer ;
|
||||
SubInclude TOP Demos SimplexDemo ;
|
||||
|
||||
28
Extras/COLLADA_DOM/Jamfile
Normal file
28
Extras/COLLADA_DOM/Jamfile
Normal file
@@ -0,0 +1,28 @@
|
||||
SubDir TOP Extras COLLADA_DOM ;
|
||||
|
||||
IncludeDir
|
||||
Extras/COLLADA_DOM/include
|
||||
Extras/COLLADA_DOM/include/1.4
|
||||
;
|
||||
|
||||
Library collada-dom :
|
||||
[ Wildcard src/dae : *.h *.cpp ]
|
||||
[ Wildcard src/1.4/dom : *.h *.cpp ]
|
||||
[ Wildcard src/modules/LIBXMLPlugin : *.h *.cpp ]
|
||||
[ Wildcard src/modules/stdErrPlugin : *.h *.cpp ]
|
||||
[ Wildcard src/modules/STLDatabase : *.h *.cpp ]
|
||||
|
||||
|
||||
;
|
||||
CFlags collada-dom :
|
||||
[ FIncludes $(TOP)/Extras/COLLADA_DOM ]
|
||||
[ FIncludes $(TOP)/Extras/COLLADA_DOM/include ]
|
||||
[ FIncludes $(TOP)/Extras/COLLADA_DOM/include/1.4 ]
|
||||
[ FIncludes $(TOP)/Extras/LibXML/include ]
|
||||
;
|
||||
|
||||
LibDepends collada-dom : ;
|
||||
|
||||
|
||||
InstallHeader [ Wildcard *.h ] : COLLADA_DOM ;
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
SubDir TOP Extras ;
|
||||
|
||||
SubInclude TOP Extras PhysicsInterface ;
|
||||
SubInclude TOP Extras ConvexDecomposition ;
|
||||
SubDir TOP Extras ;
|
||||
|
||||
SubInclude TOP Extras PhysicsInterface ;
|
||||
SubInclude TOP Extras ConvexDecomposition ;
|
||||
SubInclude TOP Extras COLLADA_DOM ;
|
||||
SubInclude TOP Extras LibXML ;
|
||||
|
||||
|
||||
27
Extras/LibXML/COPYING
Normal file
27
Extras/LibXML/COPYING
Normal file
@@ -0,0 +1,27 @@
|
||||
Except where otherwise noted in the source code (e.g. the files hash.c,
|
||||
list.c and the trio files, which are covered by a similar licence but
|
||||
with different Copyright notices) all the files are:
|
||||
|
||||
Copyright (C) 1998-2003 Daniel Veillard. All Rights Reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is fur-
|
||||
nished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
|
||||
NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
|
||||
NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of Daniel Veillard shall not
|
||||
be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
ings in this Software without prior written authorization from him.
|
||||
|
||||
2
Extras/LibXML/Compatibility.txt
Normal file
2
Extras/LibXML/Compatibility.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
[Guillaume Laforte/Feeling Software]
|
||||
Please note that this version of LibXML2 is meant to be used and compiled on Windows platforms only. For a version of LibXML2 specific to your platform, please check http://xmlsoft.org/.
|
||||
27
Extras/LibXML/Copyright
Normal file
27
Extras/LibXML/Copyright
Normal file
@@ -0,0 +1,27 @@
|
||||
Except where otherwise noted in the source code (e.g. the files hash.c,
|
||||
list.c and the trio files, which are covered by a similar licence but
|
||||
with different Copyright notices) all the files are:
|
||||
|
||||
Copyright (C) 1998-2003 Daniel Veillard. All Rights Reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is fur-
|
||||
nished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
|
||||
NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
DANIEL VEILLARD BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON-
|
||||
NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
Except as contained in this notice, the name of Daniel Veillard shall not
|
||||
be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
ings in this Software without prior written authorization from him.
|
||||
|
||||
305
Extras/LibXML/DOCBparser.c
Normal file
305
Extras/LibXML/DOCBparser.c
Normal file
@@ -0,0 +1,305 @@
|
||||
/*
|
||||
* DOCBparser.c : an attempt to parse SGML Docbook documents
|
||||
*
|
||||
* This is deprecated !!!
|
||||
* Code removed with release 2.6.0 it was broken.
|
||||
* The doc are expect to be migrated to XML DocBook
|
||||
*
|
||||
* See Copyright for the status of this software.
|
||||
*
|
||||
* daniel@veillard.com
|
||||
*/
|
||||
|
||||
#define IN_LIBXML
|
||||
#include "libxml.h"
|
||||
#ifdef LIBXML_DOCB_ENABLED
|
||||
|
||||
#include <libxml/xmlerror.h>
|
||||
#include <libxml/DOCBparser.h>
|
||||
|
||||
/**
|
||||
* docbEncodeEntities:
|
||||
* @out: a pointer to an array of bytes to store the result
|
||||
* @outlen: the length of @out
|
||||
* @in: a pointer to an array of UTF-8 chars
|
||||
* @inlen: the length of @in
|
||||
* @quoteChar: the quote character to escape (' or ") or zero.
|
||||
*
|
||||
* Take a block of UTF-8 chars in and try to convert it to an ASCII
|
||||
* plus SGML entities block of chars out.
|
||||
*
|
||||
* Returns 0 if success, -2 if the transcoding fails, or -1 otherwise
|
||||
* The value of @inlen after return is the number of octets consumed
|
||||
* as the return value is positive, else unpredictable.
|
||||
* The value of @outlen after return is the number of octets consumed.
|
||||
*/
|
||||
int
|
||||
docbEncodeEntities(unsigned char *out ATTRIBUTE_UNUSED,
|
||||
int *outlen ATTRIBUTE_UNUSED,
|
||||
const unsigned char *in ATTRIBUTE_UNUSED,
|
||||
int *inlen ATTRIBUTE_UNUSED,
|
||||
int quoteChar ATTRIBUTE_UNUSED)
|
||||
{
|
||||
static int deprecated = 0;
|
||||
|
||||
if (!deprecated) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"docbEncodeEntities() deprecated function reached\n");
|
||||
deprecated = 1;
|
||||
}
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/**
|
||||
* docbParseDocument:
|
||||
* @ctxt: an SGML parser context
|
||||
*
|
||||
* parse an SGML document (and build a tree if using the standard SAX
|
||||
* interface).
|
||||
*
|
||||
* Returns 0, -1 in case of error. the parser context is augmented
|
||||
* as a result of the parsing.
|
||||
*/
|
||||
|
||||
int
|
||||
docbParseDocument(docbParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
|
||||
{
|
||||
static int deprecated = 0;
|
||||
|
||||
if (!deprecated) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"docbParseDocument() deprecated function reached\n");
|
||||
deprecated = 1;
|
||||
}
|
||||
return (xmlParseDocument(ctxt));
|
||||
}
|
||||
|
||||
/**
|
||||
* docbFreeParserCtxt:
|
||||
* @ctxt: an SGML parser context
|
||||
*
|
||||
* Free all the memory used by a parser context. However the parsed
|
||||
* document in ctxt->myDoc is not freed.
|
||||
*/
|
||||
|
||||
void
|
||||
docbFreeParserCtxt(docbParserCtxtPtr ctxt ATTRIBUTE_UNUSED)
|
||||
{
|
||||
static int deprecated = 0;
|
||||
|
||||
if (!deprecated) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"docbFreeParserCtxt() deprecated function reached\n");
|
||||
deprecated = 1;
|
||||
}
|
||||
xmlFreeParserCtxt(ctxt);
|
||||
}
|
||||
|
||||
/**
|
||||
* docbParseChunk:
|
||||
* @ctxt: an XML parser context
|
||||
* @chunk: an char array
|
||||
* @size: the size in byte of the chunk
|
||||
* @terminate: last chunk indicator
|
||||
*
|
||||
* Parse a Chunk of memory
|
||||
*
|
||||
* Returns zero if no error, the xmlParserErrors otherwise.
|
||||
*/
|
||||
int
|
||||
docbParseChunk(docbParserCtxtPtr ctxt ATTRIBUTE_UNUSED,
|
||||
const char *chunk ATTRIBUTE_UNUSED,
|
||||
int size ATTRIBUTE_UNUSED,
|
||||
int terminate ATTRIBUTE_UNUSED)
|
||||
{
|
||||
static int deprecated = 0;
|
||||
|
||||
if (!deprecated) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"docbParseChunk() deprecated function reached\n");
|
||||
deprecated = 1;
|
||||
}
|
||||
|
||||
return (xmlParseChunk(ctxt, chunk, size, terminate));
|
||||
}
|
||||
|
||||
/**
|
||||
* docbCreatePushParserCtxt:
|
||||
* @sax: a SAX handler
|
||||
* @user_data: The user data returned on SAX callbacks
|
||||
* @chunk: a pointer to an array of chars
|
||||
* @size: number of chars in the array
|
||||
* @filename: an optional file name or URI
|
||||
* @enc: an optional encoding
|
||||
*
|
||||
* Create a parser context for using the DocBook SGML parser in push mode
|
||||
* To allow content encoding detection, @size should be >= 4
|
||||
* The value of @filename is used for fetching external entities
|
||||
* and error/warning reports.
|
||||
*
|
||||
* Returns the new parser context or NULL
|
||||
*/
|
||||
docbParserCtxtPtr
|
||||
docbCreatePushParserCtxt(docbSAXHandlerPtr sax ATTRIBUTE_UNUSED,
|
||||
void *user_data ATTRIBUTE_UNUSED,
|
||||
const char *chunk ATTRIBUTE_UNUSED,
|
||||
int size ATTRIBUTE_UNUSED,
|
||||
const char *filename ATTRIBUTE_UNUSED,
|
||||
xmlCharEncoding enc ATTRIBUTE_UNUSED)
|
||||
{
|
||||
static int deprecated = 0;
|
||||
|
||||
if (!deprecated) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"docbParseChunk() deprecated function reached\n");
|
||||
deprecated = 1;
|
||||
}
|
||||
|
||||
return(xmlCreatePushParserCtxt(sax, user_data, chunk, size, filename));
|
||||
}
|
||||
|
||||
/**
|
||||
* docbSAXParseDoc:
|
||||
* @cur: a pointer to an array of xmlChar
|
||||
* @encoding: a free form C string describing the SGML document encoding, or NULL
|
||||
* @sax: the SAX handler block
|
||||
* @userData: if using SAX, this pointer will be provided on callbacks.
|
||||
*
|
||||
* parse an SGML in-memory document and build a tree.
|
||||
* It use the given SAX function block to handle the parsing callback.
|
||||
* If sax is NULL, fallback to the default DOM tree building routines.
|
||||
*
|
||||
* Returns the resulting document tree
|
||||
*/
|
||||
|
||||
docbDocPtr
|
||||
docbSAXParseDoc(xmlChar * cur ATTRIBUTE_UNUSED,
|
||||
const char *encoding ATTRIBUTE_UNUSED,
|
||||
docbSAXHandlerPtr sax ATTRIBUTE_UNUSED,
|
||||
void *userData ATTRIBUTE_UNUSED)
|
||||
{
|
||||
static int deprecated = 0;
|
||||
|
||||
if (!deprecated) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"docbParseChunk() deprecated function reached\n");
|
||||
deprecated = 1;
|
||||
}
|
||||
|
||||
return (xmlSAXParseMemoryWithData(sax, (const char *)cur,
|
||||
xmlStrlen((const xmlChar *) cur), 0, userData));
|
||||
}
|
||||
|
||||
/**
|
||||
* docbParseDoc:
|
||||
* @cur: a pointer to an array of xmlChar
|
||||
* @encoding: a free form C string describing the SGML document encoding, or NULL
|
||||
*
|
||||
* parse an SGML in-memory document and build a tree.
|
||||
*
|
||||
* Returns the resulting document tree
|
||||
*/
|
||||
|
||||
docbDocPtr
|
||||
docbParseDoc(xmlChar * cur ATTRIBUTE_UNUSED,
|
||||
const char *encoding ATTRIBUTE_UNUSED)
|
||||
{
|
||||
static int deprecated = 0;
|
||||
|
||||
if (!deprecated) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"docbParseChunk() deprecated function reached\n");
|
||||
deprecated = 1;
|
||||
}
|
||||
|
||||
return (xmlParseDoc(cur));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* docbCreateFileParserCtxt:
|
||||
* @filename: the filename
|
||||
* @encoding: the SGML document encoding, or NULL
|
||||
*
|
||||
* Create a parser context for a file content.
|
||||
* Automatic support for ZLIB/Compress compressed document is provided
|
||||
* by default if found at compile-time.
|
||||
*
|
||||
* Returns the new parser context or NULL
|
||||
*/
|
||||
docbParserCtxtPtr
|
||||
docbCreateFileParserCtxt(const char *filename ATTRIBUTE_UNUSED,
|
||||
const char *encoding ATTRIBUTE_UNUSED)
|
||||
{
|
||||
static int deprecated = 0;
|
||||
|
||||
if (!deprecated) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"docbCreateFileParserCtxt() deprecated function reached\n");
|
||||
deprecated = 1;
|
||||
}
|
||||
|
||||
return (xmlCreateFileParserCtxt(filename));
|
||||
}
|
||||
|
||||
/**
|
||||
* docbSAXParseFile:
|
||||
* @filename: the filename
|
||||
* @encoding: a free form C string describing the SGML document encoding, or NULL
|
||||
* @sax: the SAX handler block
|
||||
* @userData: if using SAX, this pointer will be provided on callbacks.
|
||||
*
|
||||
* parse an SGML file and build a tree. Automatic support for ZLIB/Compress
|
||||
* compressed document is provided by default if found at compile-time.
|
||||
* It use the given SAX function block to handle the parsing callback.
|
||||
* If sax is NULL, fallback to the default DOM tree building routines.
|
||||
*
|
||||
* Returns the resulting document tree
|
||||
*/
|
||||
|
||||
docbDocPtr
|
||||
docbSAXParseFile(const char *filename ATTRIBUTE_UNUSED,
|
||||
const char *encoding ATTRIBUTE_UNUSED,
|
||||
docbSAXHandlerPtr sax ATTRIBUTE_UNUSED,
|
||||
void *userData ATTRIBUTE_UNUSED)
|
||||
{
|
||||
static int deprecated = 0;
|
||||
|
||||
if (!deprecated) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"docbSAXParseFile() deprecated function reached\n");
|
||||
deprecated = 1;
|
||||
}
|
||||
|
||||
return (xmlSAXParseFileWithData(sax, filename, 0, userData));
|
||||
}
|
||||
|
||||
/**
|
||||
* docbParseFile:
|
||||
* @filename: the filename
|
||||
* @encoding: a free form C string describing document encoding, or NULL
|
||||
*
|
||||
* parse a Docbook SGML file and build a tree. Automatic support for
|
||||
* ZLIB/Compress compressed document is provided by default if found
|
||||
* at compile-time.
|
||||
*
|
||||
* Returns the resulting document tree
|
||||
*/
|
||||
|
||||
docbDocPtr
|
||||
docbParseFile(const char *filename ATTRIBUTE_UNUSED,
|
||||
const char *encoding ATTRIBUTE_UNUSED)
|
||||
{
|
||||
static int deprecated = 0;
|
||||
|
||||
if (!deprecated) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"docbParseFile() deprecated function reached\n");
|
||||
deprecated = 1;
|
||||
}
|
||||
|
||||
return (xmlParseFile(filename));
|
||||
}
|
||||
#define bottom_DOCBparser
|
||||
#include "elfgcchack.h"
|
||||
#endif /* LIBXML_DOCB_ENABLED */
|
||||
6178
Extras/LibXML/HTMLparser.c
Normal file
6178
Extras/LibXML/HTMLparser.c
Normal file
File diff suppressed because it is too large
Load Diff
1193
Extras/LibXML/HTMLtree.c
Normal file
1193
Extras/LibXML/HTMLtree.c
Normal file
File diff suppressed because it is too large
Load Diff
16
Extras/LibXML/Jamfile
Normal file
16
Extras/LibXML/Jamfile
Normal file
@@ -0,0 +1,16 @@
|
||||
SubDir TOP Extras LibXML ;
|
||||
|
||||
IncludeDir Extras/LibXML/include ;
|
||||
|
||||
Library libxml : [ Wildcard *.h *.c ] ;
|
||||
|
||||
CFlags libxml :
|
||||
[ FIncludes $(TOP)/Extras/LibXML ]
|
||||
[ FIncludes $(TOP)/Extras/LibXML/include ]
|
||||
;
|
||||
|
||||
LibDepends libxml : ;
|
||||
|
||||
|
||||
InstallHeader [ Wildcard *.h ] : LibXML ;
|
||||
|
||||
30
Extras/LibXML/Makefile
Normal file
30
Extras/LibXML/Makefile
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/make
|
||||
|
||||
|
||||
LIBNAME = libxml2
|
||||
|
||||
prefix=..
|
||||
|
||||
INCPATH=$(prefix)/include
|
||||
LIBPATH=$(prefix)/lib
|
||||
|
||||
PPU_INCDIRS=-I$(INCPATH) -Iinclude
|
||||
PPU_OPTIMIZE_LV= -O3 -funroll-loops
|
||||
|
||||
PPU_LIB_TARGET=$(LIBNAME).a
|
||||
PPU_SRCS = SAX.c entities.c \
|
||||
encoding.c error.c \
|
||||
parserInternals.c parser.c tree.c \
|
||||
hash.c list.c xmlIO.c xmlmemory.c \
|
||||
uri.c valid.c xlink.c \
|
||||
HTMLparser.c HTMLtree.c debugXML.c \
|
||||
xinclude.c \
|
||||
nanohttp.c nanoftp.c DOCBparser.c \
|
||||
catalog.c globals.c threads.c \
|
||||
c14n.c xmlstring.c xmlregexp.c \
|
||||
xmlunicode.c xmlreader.c relaxng.c \
|
||||
dict.c SAX2.c xmlwriter.c \
|
||||
legacy.c chvalid.c pattern.c \
|
||||
xmlsave.c
|
||||
|
||||
|
||||
180
Extras/LibXML/SAX.c
Normal file
180
Extras/LibXML/SAX.c
Normal file
@@ -0,0 +1,180 @@
|
||||
/*
|
||||
* SAX.c : Old SAX v1 handlers to build a tree.
|
||||
* Deprecated except for compatibility
|
||||
*
|
||||
* See Copyright for the status of this software.
|
||||
*
|
||||
* Daniel Veillard <daniel@veillard.com>
|
||||
*/
|
||||
|
||||
|
||||
#define IN_LIBXML
|
||||
#include "libxml.h"
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <libxml/xmlmemory.h>
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/parserInternals.h>
|
||||
#include <libxml/valid.h>
|
||||
#include <libxml/entities.h>
|
||||
#include <libxml/xmlerror.h>
|
||||
#include <libxml/debugXML.h>
|
||||
#include <libxml/xmlIO.h>
|
||||
#include <libxml/SAX.h>
|
||||
#include <libxml/uri.h>
|
||||
#include <libxml/valid.h>
|
||||
#include <libxml/HTMLtree.h>
|
||||
#include <libxml/globals.h>
|
||||
#include <libxml/SAX2.h>
|
||||
|
||||
#ifdef LIBXML_LEGACY_ENABLED
|
||||
#ifdef LIBXML_SAX1_ENABLED
|
||||
/**
|
||||
* initxmlDefaultSAXHandler:
|
||||
* @hdlr: the SAX handler
|
||||
* @warning: flag if non-zero sets the handler warning procedure
|
||||
*
|
||||
* Initialize the default XML SAX version 1 handler
|
||||
* DEPRECATED: use xmlSAX2InitDefaultSAXHandler() for the new SAX2 blocks
|
||||
*/
|
||||
void
|
||||
initxmlDefaultSAXHandler(xmlSAXHandlerV1 *hdlr, int warning)
|
||||
{
|
||||
|
||||
if(hdlr->initialized == 1)
|
||||
return;
|
||||
|
||||
hdlr->internalSubset = xmlSAX2InternalSubset;
|
||||
hdlr->externalSubset = xmlSAX2ExternalSubset;
|
||||
hdlr->isStandalone = xmlSAX2IsStandalone;
|
||||
hdlr->hasInternalSubset = xmlSAX2HasInternalSubset;
|
||||
hdlr->hasExternalSubset = xmlSAX2HasExternalSubset;
|
||||
hdlr->resolveEntity = xmlSAX2ResolveEntity;
|
||||
hdlr->getEntity = xmlSAX2GetEntity;
|
||||
hdlr->getParameterEntity = xmlSAX2GetParameterEntity;
|
||||
hdlr->entityDecl = xmlSAX2EntityDecl;
|
||||
hdlr->attributeDecl = xmlSAX2AttributeDecl;
|
||||
hdlr->elementDecl = xmlSAX2ElementDecl;
|
||||
hdlr->notationDecl = xmlSAX2NotationDecl;
|
||||
hdlr->unparsedEntityDecl = xmlSAX2UnparsedEntityDecl;
|
||||
hdlr->setDocumentLocator = xmlSAX2SetDocumentLocator;
|
||||
hdlr->startDocument = xmlSAX2StartDocument;
|
||||
hdlr->endDocument = xmlSAX2EndDocument;
|
||||
hdlr->startElement = xmlSAX2StartElement;
|
||||
hdlr->endElement = xmlSAX2EndElement;
|
||||
hdlr->reference = xmlSAX2Reference;
|
||||
hdlr->characters = xmlSAX2Characters;
|
||||
hdlr->cdataBlock = xmlSAX2CDataBlock;
|
||||
hdlr->ignorableWhitespace = xmlSAX2Characters;
|
||||
hdlr->processingInstruction = xmlSAX2ProcessingInstruction;
|
||||
if (warning == 0)
|
||||
hdlr->warning = NULL;
|
||||
else
|
||||
hdlr->warning = xmlParserWarning;
|
||||
hdlr->error = xmlParserError;
|
||||
hdlr->fatalError = xmlParserError;
|
||||
|
||||
hdlr->initialized = 1;
|
||||
}
|
||||
|
||||
#ifdef LIBXML_HTML_ENABLED
|
||||
|
||||
/**
|
||||
* inithtmlDefaultSAXHandler:
|
||||
* @hdlr: the SAX handler
|
||||
*
|
||||
* Initialize the default HTML SAX version 1 handler
|
||||
* DEPRECATED: use xmlSAX2InitHtmlDefaultSAXHandler() for the new SAX2 blocks
|
||||
*/
|
||||
void
|
||||
inithtmlDefaultSAXHandler(xmlSAXHandlerV1 *hdlr)
|
||||
{
|
||||
if(hdlr->initialized == 1)
|
||||
return;
|
||||
|
||||
hdlr->internalSubset = xmlSAX2InternalSubset;
|
||||
hdlr->externalSubset = NULL;
|
||||
hdlr->isStandalone = NULL;
|
||||
hdlr->hasInternalSubset = NULL;
|
||||
hdlr->hasExternalSubset = NULL;
|
||||
hdlr->resolveEntity = NULL;
|
||||
hdlr->getEntity = xmlSAX2GetEntity;
|
||||
hdlr->getParameterEntity = NULL;
|
||||
hdlr->entityDecl = NULL;
|
||||
hdlr->attributeDecl = NULL;
|
||||
hdlr->elementDecl = NULL;
|
||||
hdlr->notationDecl = NULL;
|
||||
hdlr->unparsedEntityDecl = NULL;
|
||||
hdlr->setDocumentLocator = xmlSAX2SetDocumentLocator;
|
||||
hdlr->startDocument = xmlSAX2StartDocument;
|
||||
hdlr->endDocument = xmlSAX2EndDocument;
|
||||
hdlr->startElement = xmlSAX2StartElement;
|
||||
hdlr->endElement = xmlSAX2EndElement;
|
||||
hdlr->reference = NULL;
|
||||
hdlr->characters = xmlSAX2Characters;
|
||||
hdlr->cdataBlock = xmlSAX2CDataBlock;
|
||||
hdlr->ignorableWhitespace = xmlSAX2IgnorableWhitespace;
|
||||
hdlr->processingInstruction = xmlSAX2ProcessingInstruction;
|
||||
hdlr->comment = xmlSAX2Comment;
|
||||
hdlr->warning = xmlParserWarning;
|
||||
hdlr->error = xmlParserError;
|
||||
hdlr->fatalError = xmlParserError;
|
||||
|
||||
hdlr->initialized = 1;
|
||||
}
|
||||
|
||||
#endif /* LIBXML_HTML_ENABLED */
|
||||
|
||||
#ifdef LIBXML_DOCB_ENABLED
|
||||
/**
|
||||
* initdocbDefaultSAXHandler:
|
||||
* @hdlr: the SAX handler
|
||||
*
|
||||
* Initialize the default DocBook SAX version 1 handler
|
||||
* DEPRECATED: use xmlSAX2InitDocbDefaultSAXHandler() for the new SAX2 blocks
|
||||
*/
|
||||
void
|
||||
initdocbDefaultSAXHandler(xmlSAXHandlerV1 *hdlr)
|
||||
{
|
||||
if(hdlr->initialized == 1)
|
||||
return;
|
||||
|
||||
hdlr->internalSubset = xmlSAX2InternalSubset;
|
||||
hdlr->externalSubset = NULL;
|
||||
hdlr->isStandalone = xmlSAX2IsStandalone;
|
||||
hdlr->hasInternalSubset = xmlSAX2HasInternalSubset;
|
||||
hdlr->hasExternalSubset = xmlSAX2HasExternalSubset;
|
||||
hdlr->resolveEntity = xmlSAX2ResolveEntity;
|
||||
hdlr->getEntity = xmlSAX2GetEntity;
|
||||
hdlr->getParameterEntity = NULL;
|
||||
hdlr->entityDecl = xmlSAX2EntityDecl;
|
||||
hdlr->attributeDecl = NULL;
|
||||
hdlr->elementDecl = NULL;
|
||||
hdlr->notationDecl = NULL;
|
||||
hdlr->unparsedEntityDecl = NULL;
|
||||
hdlr->setDocumentLocator = xmlSAX2SetDocumentLocator;
|
||||
hdlr->startDocument = xmlSAX2StartDocument;
|
||||
hdlr->endDocument = xmlSAX2EndDocument;
|
||||
hdlr->startElement = xmlSAX2StartElement;
|
||||
hdlr->endElement = xmlSAX2EndElement;
|
||||
hdlr->reference = xmlSAX2Reference;
|
||||
hdlr->characters = xmlSAX2Characters;
|
||||
hdlr->cdataBlock = NULL;
|
||||
hdlr->ignorableWhitespace = xmlSAX2IgnorableWhitespace;
|
||||
hdlr->processingInstruction = NULL;
|
||||
hdlr->comment = xmlSAX2Comment;
|
||||
hdlr->warning = xmlParserWarning;
|
||||
hdlr->error = xmlParserError;
|
||||
hdlr->fatalError = xmlParserError;
|
||||
|
||||
hdlr->initialized = 1;
|
||||
}
|
||||
|
||||
#endif /* LIBXML_DOCB_ENABLED */
|
||||
|
||||
#endif /* LIBXML_SAX1_ENABLED */
|
||||
|
||||
#define bottom_SAX
|
||||
#include "elfgcchack.h"
|
||||
#endif /* LIBXML_LEGACY_ENABLED */
|
||||
2759
Extras/LibXML/SAX2.c
Normal file
2759
Extras/LibXML/SAX2.c
Normal file
File diff suppressed because it is too large
Load Diff
16
Extras/LibXML/acconfig.h
Normal file
16
Extras/LibXML/acconfig.h
Normal file
@@ -0,0 +1,16 @@
|
||||
#undef PACKAGE
|
||||
#undef VERSION
|
||||
#undef HAVE_LIBZ
|
||||
#undef HAVE_LIBM
|
||||
#undef HAVE_ISINF
|
||||
#undef HAVE_ISNAN
|
||||
#undef HAVE_LIBHISTORY
|
||||
#undef HAVE_LIBREADLINE
|
||||
#undef HAVE_LIBPTHREAD
|
||||
#undef HAVE_PTHREAD_H
|
||||
|
||||
/* Define if IPV6 support is there */
|
||||
#undef SUPPORT_IP6
|
||||
|
||||
/* Define if getaddrinfo is there */
|
||||
#undef HAVE_GETADDRINFO
|
||||
1928
Extras/LibXML/c14n.c
Normal file
1928
Extras/LibXML/c14n.c
Normal file
File diff suppressed because it is too large
Load Diff
3792
Extras/LibXML/catalog.c
Normal file
3792
Extras/LibXML/catalog.c
Normal file
File diff suppressed because it is too large
Load Diff
333
Extras/LibXML/chvalid.c
Normal file
333
Extras/LibXML/chvalid.c
Normal file
@@ -0,0 +1,333 @@
|
||||
/*
|
||||
* chvalid.c: this module implements the character range
|
||||
* validation APIs
|
||||
*
|
||||
* This file is automatically generated from the cvs source
|
||||
* definition files using the genChRanges.py Python script
|
||||
*
|
||||
* Generation date: Tue Nov 18 08:14:21 2003
|
||||
* Sources: chvalid.def
|
||||
* William Brack <wbrack@mmm.com.hk>
|
||||
*/
|
||||
|
||||
#define IN_LIBXML
|
||||
#include "libxml.h"
|
||||
#include <libxml/chvalid.h>
|
||||
|
||||
/*
|
||||
* The initial tables ({func_name}_tab) are used to validate whether a
|
||||
* single-byte character is within the specified group. Each table
|
||||
* contains 256 bytes, with each byte representing one of the 256
|
||||
* possible characters. If the table byte is set, the character is
|
||||
* allowed.
|
||||
*
|
||||
*/
|
||||
unsigned char xmlIsPubidChar_tab[256] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
|
||||
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01,
|
||||
0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
|
||||
0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00 };
|
||||
|
||||
static xmlChSRange xmlIsBaseChar_srng[] = { {0x100, 0x131}, {0x134, 0x13e},
|
||||
{0x141, 0x148}, {0x14a, 0x17e}, {0x180, 0x1c3}, {0x1cd, 0x1f0},
|
||||
{0x1f4, 0x1f5}, {0x1fa, 0x217}, {0x250, 0x2a8}, {0x2bb, 0x2c1},
|
||||
{0x386, 0x386}, {0x388, 0x38a}, {0x38c, 0x38c}, {0x38e, 0x3a1},
|
||||
{0x3a3, 0x3ce}, {0x3d0, 0x3d6}, {0x3da, 0x3da}, {0x3dc, 0x3dc},
|
||||
{0x3de, 0x3de}, {0x3e0, 0x3e0}, {0x3e2, 0x3f3}, {0x401, 0x40c},
|
||||
{0x40e, 0x44f}, {0x451, 0x45c}, {0x45e, 0x481}, {0x490, 0x4c4},
|
||||
{0x4c7, 0x4c8}, {0x4cb, 0x4cc}, {0x4d0, 0x4eb}, {0x4ee, 0x4f5},
|
||||
{0x4f8, 0x4f9}, {0x531, 0x556}, {0x559, 0x559}, {0x561, 0x586},
|
||||
{0x5d0, 0x5ea}, {0x5f0, 0x5f2}, {0x621, 0x63a}, {0x641, 0x64a},
|
||||
{0x671, 0x6b7}, {0x6ba, 0x6be}, {0x6c0, 0x6ce}, {0x6d0, 0x6d3},
|
||||
{0x6d5, 0x6d5}, {0x6e5, 0x6e6}, {0x905, 0x939}, {0x93d, 0x93d},
|
||||
{0x958, 0x961}, {0x985, 0x98c}, {0x98f, 0x990}, {0x993, 0x9a8},
|
||||
{0x9aa, 0x9b0}, {0x9b2, 0x9b2}, {0x9b6, 0x9b9}, {0x9dc, 0x9dd},
|
||||
{0x9df, 0x9e1}, {0x9f0, 0x9f1}, {0xa05, 0xa0a}, {0xa0f, 0xa10},
|
||||
{0xa13, 0xa28}, {0xa2a, 0xa30}, {0xa32, 0xa33}, {0xa35, 0xa36},
|
||||
{0xa38, 0xa39}, {0xa59, 0xa5c}, {0xa5e, 0xa5e}, {0xa72, 0xa74},
|
||||
{0xa85, 0xa8b}, {0xa8d, 0xa8d}, {0xa8f, 0xa91}, {0xa93, 0xaa8},
|
||||
{0xaaa, 0xab0}, {0xab2, 0xab3}, {0xab5, 0xab9}, {0xabd, 0xabd},
|
||||
{0xae0, 0xae0}, {0xb05, 0xb0c}, {0xb0f, 0xb10}, {0xb13, 0xb28},
|
||||
{0xb2a, 0xb30}, {0xb32, 0xb33}, {0xb36, 0xb39}, {0xb3d, 0xb3d},
|
||||
{0xb5c, 0xb5d}, {0xb5f, 0xb61}, {0xb85, 0xb8a}, {0xb8e, 0xb90},
|
||||
{0xb92, 0xb95}, {0xb99, 0xb9a}, {0xb9c, 0xb9c}, {0xb9e, 0xb9f},
|
||||
{0xba3, 0xba4}, {0xba8, 0xbaa}, {0xbae, 0xbb5}, {0xbb7, 0xbb9},
|
||||
{0xc05, 0xc0c}, {0xc0e, 0xc10}, {0xc12, 0xc28}, {0xc2a, 0xc33},
|
||||
{0xc35, 0xc39}, {0xc60, 0xc61}, {0xc85, 0xc8c}, {0xc8e, 0xc90},
|
||||
{0xc92, 0xca8}, {0xcaa, 0xcb3}, {0xcb5, 0xcb9}, {0xcde, 0xcde},
|
||||
{0xce0, 0xce1}, {0xd05, 0xd0c}, {0xd0e, 0xd10}, {0xd12, 0xd28},
|
||||
{0xd2a, 0xd39}, {0xd60, 0xd61}, {0xe01, 0xe2e}, {0xe30, 0xe30},
|
||||
{0xe32, 0xe33}, {0xe40, 0xe45}, {0xe81, 0xe82}, {0xe84, 0xe84},
|
||||
{0xe87, 0xe88}, {0xe8a, 0xe8a}, {0xe8d, 0xe8d}, {0xe94, 0xe97},
|
||||
{0xe99, 0xe9f}, {0xea1, 0xea3}, {0xea5, 0xea5}, {0xea7, 0xea7},
|
||||
{0xeaa, 0xeab}, {0xead, 0xeae}, {0xeb0, 0xeb0}, {0xeb2, 0xeb3},
|
||||
{0xebd, 0xebd}, {0xec0, 0xec4}, {0xf40, 0xf47}, {0xf49, 0xf69},
|
||||
{0x10a0, 0x10c5}, {0x10d0, 0x10f6}, {0x1100, 0x1100}, {0x1102, 0x1103},
|
||||
{0x1105, 0x1107}, {0x1109, 0x1109}, {0x110b, 0x110c}, {0x110e, 0x1112},
|
||||
{0x113c, 0x113c}, {0x113e, 0x113e}, {0x1140, 0x1140}, {0x114c, 0x114c},
|
||||
{0x114e, 0x114e}, {0x1150, 0x1150}, {0x1154, 0x1155}, {0x1159, 0x1159},
|
||||
{0x115f, 0x1161}, {0x1163, 0x1163}, {0x1165, 0x1165}, {0x1167, 0x1167},
|
||||
{0x1169, 0x1169}, {0x116d, 0x116e}, {0x1172, 0x1173}, {0x1175, 0x1175},
|
||||
{0x119e, 0x119e}, {0x11a8, 0x11a8}, {0x11ab, 0x11ab}, {0x11ae, 0x11af},
|
||||
{0x11b7, 0x11b8}, {0x11ba, 0x11ba}, {0x11bc, 0x11c2}, {0x11eb, 0x11eb},
|
||||
{0x11f0, 0x11f0}, {0x11f9, 0x11f9}, {0x1e00, 0x1e9b}, {0x1ea0, 0x1ef9},
|
||||
{0x1f00, 0x1f15}, {0x1f18, 0x1f1d}, {0x1f20, 0x1f45}, {0x1f48, 0x1f4d},
|
||||
{0x1f50, 0x1f57}, {0x1f59, 0x1f59}, {0x1f5b, 0x1f5b}, {0x1f5d, 0x1f5d},
|
||||
{0x1f5f, 0x1f7d}, {0x1f80, 0x1fb4}, {0x1fb6, 0x1fbc}, {0x1fbe, 0x1fbe},
|
||||
{0x1fc2, 0x1fc4}, {0x1fc6, 0x1fcc}, {0x1fd0, 0x1fd3}, {0x1fd6, 0x1fdb},
|
||||
{0x1fe0, 0x1fec}, {0x1ff2, 0x1ff4}, {0x1ff6, 0x1ffc}, {0x2126, 0x2126},
|
||||
{0x212a, 0x212b}, {0x212e, 0x212e}, {0x2180, 0x2182}, {0x3041, 0x3094},
|
||||
{0x30a1, 0x30fa}, {0x3105, 0x312c}, {0xac00, 0xd7a3}};
|
||||
xmlChRangeGroup xmlIsBaseCharGroup =
|
||||
{197, 0, xmlIsBaseChar_srng, (xmlChLRangePtr)0};
|
||||
|
||||
static xmlChSRange xmlIsChar_srng[] = { {0x100, 0xd7ff}, {0xe000, 0xfffd}};
|
||||
static xmlChLRange xmlIsChar_lrng[] = { {0x10000, 0x10ffff}};
|
||||
xmlChRangeGroup xmlIsCharGroup =
|
||||
{2, 1, xmlIsChar_srng, xmlIsChar_lrng};
|
||||
|
||||
static xmlChSRange xmlIsCombining_srng[] = { {0x300, 0x345},
|
||||
{0x360, 0x361}, {0x483, 0x486}, {0x591, 0x5a1}, {0x5a3, 0x5b9},
|
||||
{0x5bb, 0x5bd}, {0x5bf, 0x5bf}, {0x5c1, 0x5c2}, {0x5c4, 0x5c4},
|
||||
{0x64b, 0x652}, {0x670, 0x670}, {0x6d6, 0x6dc}, {0x6dd, 0x6df},
|
||||
{0x6e0, 0x6e4}, {0x6e7, 0x6e8}, {0x6ea, 0x6ed}, {0x901, 0x903},
|
||||
{0x93c, 0x93c}, {0x93e, 0x94c}, {0x94d, 0x94d}, {0x951, 0x954},
|
||||
{0x962, 0x963}, {0x981, 0x983}, {0x9bc, 0x9bc}, {0x9be, 0x9be},
|
||||
{0x9bf, 0x9bf}, {0x9c0, 0x9c4}, {0x9c7, 0x9c8}, {0x9cb, 0x9cd},
|
||||
{0x9d7, 0x9d7}, {0x9e2, 0x9e3}, {0xa02, 0xa02}, {0xa3c, 0xa3c},
|
||||
{0xa3e, 0xa3e}, {0xa3f, 0xa3f}, {0xa40, 0xa42}, {0xa47, 0xa48},
|
||||
{0xa4b, 0xa4d}, {0xa70, 0xa71}, {0xa81, 0xa83}, {0xabc, 0xabc},
|
||||
{0xabe, 0xac5}, {0xac7, 0xac9}, {0xacb, 0xacd}, {0xb01, 0xb03},
|
||||
{0xb3c, 0xb3c}, {0xb3e, 0xb43}, {0xb47, 0xb48}, {0xb4b, 0xb4d},
|
||||
{0xb56, 0xb57}, {0xb82, 0xb83}, {0xbbe, 0xbc2}, {0xbc6, 0xbc8},
|
||||
{0xbca, 0xbcd}, {0xbd7, 0xbd7}, {0xc01, 0xc03}, {0xc3e, 0xc44},
|
||||
{0xc46, 0xc48}, {0xc4a, 0xc4d}, {0xc55, 0xc56}, {0xc82, 0xc83},
|
||||
{0xcbe, 0xcc4}, {0xcc6, 0xcc8}, {0xcca, 0xccd}, {0xcd5, 0xcd6},
|
||||
{0xd02, 0xd03}, {0xd3e, 0xd43}, {0xd46, 0xd48}, {0xd4a, 0xd4d},
|
||||
{0xd57, 0xd57}, {0xe31, 0xe31}, {0xe34, 0xe3a}, {0xe47, 0xe4e},
|
||||
{0xeb1, 0xeb1}, {0xeb4, 0xeb9}, {0xebb, 0xebc}, {0xec8, 0xecd},
|
||||
{0xf18, 0xf19}, {0xf35, 0xf35}, {0xf37, 0xf37}, {0xf39, 0xf39},
|
||||
{0xf3e, 0xf3e}, {0xf3f, 0xf3f}, {0xf71, 0xf84}, {0xf86, 0xf8b},
|
||||
{0xf90, 0xf95}, {0xf97, 0xf97}, {0xf99, 0xfad}, {0xfb1, 0xfb7},
|
||||
{0xfb9, 0xfb9}, {0x20d0, 0x20dc}, {0x20e1, 0x20e1}, {0x302a, 0x302f},
|
||||
{0x3099, 0x3099}, {0x309a, 0x309a}};
|
||||
xmlChRangeGroup xmlIsCombiningGroup =
|
||||
{95, 0, xmlIsCombining_srng, (xmlChLRangePtr)0};
|
||||
|
||||
static xmlChSRange xmlIsDigit_srng[] = { {0x660, 0x669}, {0x6f0, 0x6f9},
|
||||
{0x966, 0x96f}, {0x9e6, 0x9ef}, {0xa66, 0xa6f}, {0xae6, 0xaef},
|
||||
{0xb66, 0xb6f}, {0xbe7, 0xbef}, {0xc66, 0xc6f}, {0xce6, 0xcef},
|
||||
{0xd66, 0xd6f}, {0xe50, 0xe59}, {0xed0, 0xed9}, {0xf20, 0xf29}};
|
||||
xmlChRangeGroup xmlIsDigitGroup =
|
||||
{14, 0, xmlIsDigit_srng, (xmlChLRangePtr)0};
|
||||
|
||||
static xmlChSRange xmlIsExtender_srng[] = { {0x2d0, 0x2d0}, {0x2d1, 0x2d1},
|
||||
{0x387, 0x387}, {0x640, 0x640}, {0xe46, 0xe46}, {0xec6, 0xec6},
|
||||
{0x3005, 0x3005}, {0x3031, 0x3035}, {0x309d, 0x309e}, {0x30fc, 0x30fe}};
|
||||
xmlChRangeGroup xmlIsExtenderGroup =
|
||||
{10, 0, xmlIsExtender_srng, (xmlChLRangePtr)0};
|
||||
|
||||
static xmlChSRange xmlIsIdeographic_srng[] = { {0x3007, 0x3007},
|
||||
{0x3021, 0x3029}, {0x4e00, 0x9fa5}};
|
||||
xmlChRangeGroup xmlIsIdeographicGroup =
|
||||
{3, 0, xmlIsIdeographic_srng, (xmlChLRangePtr)0};
|
||||
|
||||
|
||||
/**
|
||||
* xmlCharInRange:
|
||||
* @val: character to be validated
|
||||
* @rptr: pointer to range to be used to validate
|
||||
*
|
||||
* Does a binary search of the range table to determine if char
|
||||
* is valid
|
||||
*
|
||||
* Returns: true if character valid, false otherwise
|
||||
*/
|
||||
int
|
||||
xmlCharInRange (unsigned int val, const xmlChRangeGroupPtr rptr) {
|
||||
int low, high, mid;
|
||||
xmlChSRangePtr sptr;
|
||||
xmlChLRangePtr lptr;
|
||||
|
||||
if (rptr == NULL) return(0);
|
||||
if (val < 0x10000) { /* is val in 'short' or 'long' array? */
|
||||
if (rptr->nbShortRange == 0)
|
||||
return 0;
|
||||
low = 0;
|
||||
high = rptr->nbShortRange - 1;
|
||||
sptr = rptr->shortRange;
|
||||
while (low <= high) {
|
||||
mid = (low + high) / 2;
|
||||
if ((unsigned short) val < sptr[mid].low) {
|
||||
high = mid - 1;
|
||||
} else {
|
||||
if ((unsigned short) val > sptr[mid].high) {
|
||||
low = mid + 1;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (rptr->nbLongRange == 0) {
|
||||
return 0;
|
||||
}
|
||||
low = 0;
|
||||
high = rptr->nbLongRange - 1;
|
||||
lptr = rptr->longRange;
|
||||
while (low <= high) {
|
||||
mid = (low + high) / 2;
|
||||
if (val < lptr[mid].low) {
|
||||
high = mid - 1;
|
||||
} else {
|
||||
if (val > lptr[mid].high) {
|
||||
low = mid + 1;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* xmlIsBaseChar:
|
||||
* @ch: character to validate
|
||||
*
|
||||
* This function is DEPRECATED.
|
||||
* Use xmlIsBaseChar_ch or xmlIsBaseCharQ instead
|
||||
*
|
||||
* Returns true if argument valid, false otherwise
|
||||
*/
|
||||
int
|
||||
xmlIsBaseChar(unsigned int ch) {
|
||||
return(xmlIsBaseCharQ(ch));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* xmlIsBlank:
|
||||
* @ch: character to validate
|
||||
*
|
||||
* This function is DEPRECATED.
|
||||
* Use xmlIsBlank_ch or xmlIsBlankQ instead
|
||||
*
|
||||
* Returns true if argument valid, false otherwise
|
||||
*/
|
||||
int
|
||||
xmlIsBlank(unsigned int ch) {
|
||||
return(xmlIsBlankQ(ch));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* xmlIsChar:
|
||||
* @ch: character to validate
|
||||
*
|
||||
* This function is DEPRECATED.
|
||||
* Use xmlIsChar_ch or xmlIsCharQ instead
|
||||
*
|
||||
* Returns true if argument valid, false otherwise
|
||||
*/
|
||||
int
|
||||
xmlIsChar(unsigned int ch) {
|
||||
return(xmlIsCharQ(ch));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* xmlIsCombining:
|
||||
* @ch: character to validate
|
||||
*
|
||||
* This function is DEPRECATED.
|
||||
* Use xmlIsCombiningQ instead
|
||||
*
|
||||
* Returns true if argument valid, false otherwise
|
||||
*/
|
||||
int
|
||||
xmlIsCombining(unsigned int ch) {
|
||||
return(xmlIsCombiningQ(ch));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* xmlIsDigit:
|
||||
* @ch: character to validate
|
||||
*
|
||||
* This function is DEPRECATED.
|
||||
* Use xmlIsDigit_ch or xmlIsDigitQ instead
|
||||
*
|
||||
* Returns true if argument valid, false otherwise
|
||||
*/
|
||||
int
|
||||
xmlIsDigit(unsigned int ch) {
|
||||
return(xmlIsDigitQ(ch));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* xmlIsExtender:
|
||||
* @ch: character to validate
|
||||
*
|
||||
* This function is DEPRECATED.
|
||||
* Use xmlIsExtender_ch or xmlIsExtenderQ instead
|
||||
*
|
||||
* Returns true if argument valid, false otherwise
|
||||
*/
|
||||
int
|
||||
xmlIsExtender(unsigned int ch) {
|
||||
return(xmlIsExtenderQ(ch));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* xmlIsIdeographic:
|
||||
* @ch: character to validate
|
||||
*
|
||||
* This function is DEPRECATED.
|
||||
* Use xmlIsIdeographicQ instead
|
||||
*
|
||||
* Returns true if argument valid, false otherwise
|
||||
*/
|
||||
int
|
||||
xmlIsIdeographic(unsigned int ch) {
|
||||
return(xmlIsIdeographicQ(ch));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* xmlIsPubidChar:
|
||||
* @ch: character to validate
|
||||
*
|
||||
* This function is DEPRECATED.
|
||||
* Use xmlIsPubidChar_ch or xmlIsPubidCharQ instead
|
||||
*
|
||||
* Returns true if argument valid, false otherwise
|
||||
*/
|
||||
int
|
||||
xmlIsPubidChar(unsigned int ch) {
|
||||
return(xmlIsPubidCharQ(ch));
|
||||
}
|
||||
|
||||
#define bottom_chvalid
|
||||
#include "elfgcchack.h"
|
||||
286
Extras/LibXML/config-ps3.h
Normal file
286
Extras/LibXML/config-ps3.h
Normal file
@@ -0,0 +1,286 @@
|
||||
/* config.h. Generated by configure. */
|
||||
/* config.h.in. Generated from configure.in by autoheader. */
|
||||
#define PACKAGE "libxml2"
|
||||
#define VERSION "2.6.11"
|
||||
|
||||
/* [claforte] Disabled since we don't use it: #define HAVE_LIBZ */
|
||||
/* #undef HAVE_LIBM */
|
||||
/* #undef HAVE_ISINF */
|
||||
/* #undef HAVE_ISNAN */
|
||||
/* #undef HAVE_LIBHISTORY */
|
||||
/* #undef HAVE_LIBREADLINE */
|
||||
#define SOCKLEN_T unsigned int
|
||||
/* #undef HAVE_LIBPTHREAD */
|
||||
/* #undef HAVE_PTHREAD_H */
|
||||
|
||||
/* Define if IPV6 support is there */
|
||||
/* #undef SUPPORT_IP6 */
|
||||
|
||||
/* Define if getaddrinfo is there */
|
||||
/* #undef HAVE_GETADDRINFO */
|
||||
|
||||
/* Define to 1 if you have the <ansidecl.h> header file. */
|
||||
/* #undef HAVE_ANSIDECL_H */
|
||||
|
||||
/* Define to 1 if you have the <arpa/inet.h> header file. */
|
||||
/* #undef HAVE_ARPA_INET_H */
|
||||
|
||||
/* Define to 1 if you have the <arpa/nameser.h> header file. */
|
||||
/* #undef HAVE_ARPA_NAMESER_H */
|
||||
|
||||
/* Define to 1 if you have the `class' function. */
|
||||
/* #undef HAVE_CLASS */
|
||||
|
||||
/* Define to 1 if you have the <ctype.h> header file. */
|
||||
#define HAVE_CTYPE_H 1
|
||||
|
||||
/* Define to 1 if you have the <dirent.h> header file. */
|
||||
/* #undef HAVE_DIRENT_H */
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
/* #undef HAVE_DLFCN_H */
|
||||
|
||||
/* Define to 1 if you have the <errno.h> header file. */
|
||||
#define HAVE_ERRNO_H 1
|
||||
|
||||
/* Define to 1 if you have the <fcntl.h> header file. */
|
||||
//#define HAVE_FCNTL_H 1
|
||||
|
||||
/* Define to 1 if you have the `finite' function. */
|
||||
/* #undef HAVE_FINITE */
|
||||
|
||||
/* Define to 1 if you have the <float.h> header file. */
|
||||
#define HAVE_FLOAT_H 1
|
||||
|
||||
/* Define to 1 if you have the `fpclass' function. */
|
||||
/* #undef HAVE_FPCLASS */
|
||||
|
||||
/* Define to 1 if you have the `fprintf' function. */
|
||||
#define HAVE_FPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the `fp_class' function. */
|
||||
/* #undef HAVE_FP_CLASS */
|
||||
|
||||
/* Define to 1 if you have the <fp_class.h> header file. */
|
||||
/* #undef HAVE_FP_CLASS_H */
|
||||
|
||||
/* Define to 1 if you have the `ftime' function. */
|
||||
/* #undef HAVE_FTIME */
|
||||
|
||||
/* Define if getaddrinfo is there */
|
||||
/* #undef HAVE_GETADDRINFO */
|
||||
|
||||
/* Define to 1 if you have the `gettimeofday' function. */
|
||||
/* #undef HAVE_GETTIMEOFDAY */
|
||||
|
||||
/* Define to 1 if you have the <ieeefp.h> header file. */
|
||||
/* #undef HAVE_IEEEFP_H */
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#define HAVE_INTTYPES_H 1
|
||||
|
||||
/* Define if isinf is there */
|
||||
/* #undef HAVE_ISINF */
|
||||
|
||||
/* Define if isnan is there */
|
||||
/* #undef HAVE_ISNAN */
|
||||
|
||||
/* Define to 1 if you have the `isnand' function. */
|
||||
/* #undef HAVE_ISNAND */
|
||||
|
||||
/* Define if history library is there (-lhistory) */
|
||||
/* #undef HAVE_LIBHISTORY */
|
||||
|
||||
/* Define to 1 if you have the `inet' library (-linet). */
|
||||
/* #undef HAVE_LIBINET */
|
||||
|
||||
/* Define to 1 if you have the `nsl' library (-lnsl). */
|
||||
/* #undef HAVE_LIBNSL */
|
||||
|
||||
/* Define if pthread library is there (-lpthread) */
|
||||
/* #undef HAVE_LIBPTHREAD */
|
||||
|
||||
/* Define if readline library is there (-lreadline) */
|
||||
/* #undef HAVE_LIBREADLINE */
|
||||
|
||||
/* Define to 1 if you have the `socket' library (-lsocket). */
|
||||
/* #undef HAVE_LIBSOCKET */
|
||||
|
||||
/* Have compression library */
|
||||
#define HAVE_LIBZ
|
||||
|
||||
/* Define to 1 if you have the <limits.h> header file. */
|
||||
#define HAVE_LIMITS_H 1
|
||||
|
||||
/* Define to 1 if you have the `localtime' function. */
|
||||
#define HAVE_LOCALTIME 1
|
||||
|
||||
/* Define to 1 if you have the <malloc.h> header file. */
|
||||
/* #undef HAVE_MALLOC_H */
|
||||
|
||||
/* Define to 1 if you have the <math.h> header file. */
|
||||
#define HAVE_MATH_H 1
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#define HAVE_MEMORY_H 1
|
||||
|
||||
/* Define to 1 if you have the <nan.h> header file. */
|
||||
/* #undef HAVE_NAN_H */
|
||||
|
||||
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
|
||||
/* #undef HAVE_NDIR_H */
|
||||
|
||||
/* Define to 1 if you have the <netdb.h> header file. */
|
||||
/* #undef HAVE_NETDB_H */
|
||||
|
||||
/* Define to 1 if you have the <netinet/in.h> header file. */
|
||||
/* #undef HAVE_NETINET_IN_H */
|
||||
|
||||
/* Define to 1 if you have the `printf' function. */
|
||||
#define HAVE_PRINTF 1
|
||||
|
||||
/* Define if <pthread.h> is there */
|
||||
/* #undef HAVE_PTHREAD_H */
|
||||
|
||||
/* Define to 1 if you have the <resolv.h> header file. */
|
||||
/* #undef HAVE_RESOLV_H */
|
||||
|
||||
/* Define to 1 if you have the `signal' function. */
|
||||
/* #undef HAVE_SIGNAL */
|
||||
|
||||
/* Define to 1 if you have the <signal.h> header file. */
|
||||
#define HAVE_SIGNAL_H 1
|
||||
|
||||
/* Define to 1 if you have the `snprintf' function. */
|
||||
#define HAVE_SNPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the `sprintf' function. */
|
||||
#define HAVE_SPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the `sscanf' function. */
|
||||
#define HAVE_SSCANF 1
|
||||
|
||||
/* Define to 1 if you have the `stat' function. */
|
||||
/* #undef HAVE_STAT */
|
||||
|
||||
/* Define to 1 if you have the <stdarg.h> header file. */
|
||||
#define HAVE_STDARG_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#define HAVE_STDINT_H 1
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
/* #define HAVE_STDLIB_H 1 */
|
||||
|
||||
/* Define to 1 if you have the `strdup' function. */
|
||||
/* #undef HAVE_STRDUP */
|
||||
|
||||
/* Define to 1 if you have the `strerror' function. */
|
||||
#define HAVE_STRERROR 1
|
||||
|
||||
/* Define to 1 if you have the `strftime' function. */
|
||||
#define HAVE_STRFTIME 1
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#define HAVE_STRINGS_H 1
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#define HAVE_STRING_H 1
|
||||
|
||||
/* Define to 1 if you have the `strndup' function. */
|
||||
/* #undef HAVE_STRNDUP */
|
||||
|
||||
/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
|
||||
*/
|
||||
/* #undef HAVE_SYS_DIR_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/mman.h> header file. */
|
||||
/* #undef HAVE_SYS_MMAN_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
|
||||
*/
|
||||
/* #undef HAVE_SYS_NDIR_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/select.h> header file. */
|
||||
/* #undef HAVE_SYS_SELECT_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/socket.h> header file. */
|
||||
/* #undef HAVE_SYS_SOCKET_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
//#define HAVE_SYS_STAT_H 1
|
||||
|
||||
/* Define to 1 if you have the <sys/timeb.h> header file. */
|
||||
/* #undef HAVE_SYS_TIMEB_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/time.h> header file. */
|
||||
/* #undef HAVE_SYS_TIME_H */
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <time.h> header file. */
|
||||
#define HAVE_TIME_H 1
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#define HAVE_UNISTD_H 1
|
||||
|
||||
/* Define to 1 if you have the `vfprintf' function. */
|
||||
#define HAVE_VFPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the `vsnprintf' function. */
|
||||
#define HAVE_VSNPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the `vsprintf' function. */
|
||||
#define HAVE_VSPRINTF 1
|
||||
|
||||
/* Define to 1 if you have the <zlib.h> header file. */
|
||||
/* [claforte] Commented-out, since we don't need it: #define HAVE_ZLIB_H 1 */
|
||||
|
||||
/* Define to 1 if you have the `_stat' function. */
|
||||
/* #undef HAVE__STAT */
|
||||
|
||||
/* Name of package */
|
||||
#define PACKAGE "libxml2"
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#define PACKAGE_BUGREPORT ""
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#define PACKAGE_NAME ""
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#define PACKAGE_STRING ""
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#define PACKAGE_TARNAME ""
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#define PACKAGE_VERSION ""
|
||||
|
||||
/* Define to 1 if the C compiler supports function prototypes. */
|
||||
#define PROTOTYPES 1
|
||||
|
||||
/* Determine what socket length (socklen_t) data type is */
|
||||
#define SOCKLEN_T unsigned int
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
/* Support for IPv6 */
|
||||
/* #undef SUPPORT_IP6 */
|
||||
|
||||
/* Version number of package */
|
||||
#define VERSION "2.6.11"
|
||||
|
||||
/* Using the Win32 Socket implementation */
|
||||
/* #undef _WINSOCKAPI_ */
|
||||
|
||||
/* Define like PROTOTYPES; this can be used by system headers. */
|
||||
#define __PROTOTYPES 1
|
||||
|
||||
/* Win32 Std C name mangling work-around */
|
||||
/* #undef snprintf */
|
||||
|
||||
/* Win32 Std C name mangling work-around */
|
||||
/* #undef vsnprintf */
|
||||
113
Extras/LibXML/config.h
Normal file
113
Extras/LibXML/config.h
Normal file
@@ -0,0 +1,113 @@
|
||||
#ifndef __LIBXML_WIN32_CONFIG__
|
||||
#define __LIBXML_WIN32_CONFIG__
|
||||
|
||||
#define HAVE_CTYPE_H
|
||||
#define HAVE_STDARG_H
|
||||
#define HAVE_MALLOC_H
|
||||
#define HAVE_ERRNO_H
|
||||
|
||||
#ifdef _WIN32_WCE
|
||||
#undef HAVE_ERRNO_H
|
||||
#include <windows.h>
|
||||
#include "wincecompat.h"
|
||||
#elif defined(WIN32)
|
||||
#define HAVE_SYS_STAT_H
|
||||
#define HAVE__STAT
|
||||
#define HAVE_STAT
|
||||
#define HAVE_STDLIB_H
|
||||
#define HAVE_TIME_H
|
||||
#define HAVE_FCNTL_H
|
||||
#include <io.h>
|
||||
#include <direct.h>
|
||||
#endif
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
|
||||
#ifdef NEED_SOCKETS
|
||||
#include <wsockcompat.h>
|
||||
#endif
|
||||
|
||||
#define HAVE_ISINF
|
||||
#define HAVE_ISNAN
|
||||
#include <math.h>
|
||||
#ifdef WIN32
|
||||
#if defined(_MSC_VER) || defined(__BORLANDC__)
|
||||
/* MS C-runtime has functions which can be used in order to determine if
|
||||
a given floating-point variable contains NaN, (+-)INF. These are
|
||||
preferred, because floating-point technology is considered propriatary
|
||||
by MS and we can assume that their functions know more about their
|
||||
oddities than we do. */
|
||||
#include <float.h>
|
||||
/* Bjorn Reese figured a quite nice construct for isinf() using the _fpclass
|
||||
function. */
|
||||
#ifndef isinf
|
||||
#define isinf(d) ((_fpclass(d) == _FPCLASS_PINF) ? 1 \
|
||||
: ((_fpclass(d) == _FPCLASS_NINF) ? -1 : 0))
|
||||
#endif
|
||||
/* _isnan(x) returns nonzero if (x == NaN) and zero otherwise. */
|
||||
#ifndef isnan
|
||||
#define isnan(d) (_isnan(d))
|
||||
#endif
|
||||
#else /* _MSC_VER */
|
||||
#ifndef isinf
|
||||
static int isinf (double d) {
|
||||
int expon = 0;
|
||||
double val = frexp (d, &expon);
|
||||
if (expon == 1025) {
|
||||
if (val == 0.5) {
|
||||
return 1;
|
||||
} else if (val == -0.5) {
|
||||
return -1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifndef isnan
|
||||
static int isnan (double d) {
|
||||
int expon = 0;
|
||||
double val = frexp (d, &expon);
|
||||
if (expon == 1025) {
|
||||
if (val == 0.5) {
|
||||
return 0;
|
||||
} else if (val == -0.5) {
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif /* _MSC_VER */
|
||||
#endif // WIN32
|
||||
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
#define mkdir(p,m) _mkdir(p)
|
||||
#define snprintf _snprintf
|
||||
#define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a)
|
||||
#endif
|
||||
|
||||
/* Threading API to use should be specified here for compatibility reasons.
|
||||
This is however best specified on the compiler's command-line. */
|
||||
#if defined(LIBXML_THREAD_ENABLED)
|
||||
#if !defined(HAVE_PTHREAD_H) && !defined(HAVE_WIN32_THREADS)
|
||||
#define HAVE_WIN32_THREADS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Some third-party libraries far from our control assume the following
|
||||
is defined, which it is not if we don't include windows.h. */
|
||||
#if !defined(FALSE)
|
||||
#define FALSE 0
|
||||
#endif
|
||||
#if !defined(TRUE)
|
||||
#define TRUE (!(FALSE))
|
||||
#endif
|
||||
|
||||
#endif /* __LIBXML_WIN32_CONFIG__ */
|
||||
|
||||
3207
Extras/LibXML/debugXML.c
Normal file
3207
Extras/LibXML/debugXML.c
Normal file
File diff suppressed because it is too large
Load Diff
901
Extras/LibXML/dict.c
Normal file
901
Extras/LibXML/dict.c
Normal file
@@ -0,0 +1,901 @@
|
||||
/*
|
||||
* dict.c: dictionary of reusable strings, just used to avoid allocation
|
||||
* and freeing operations.
|
||||
*
|
||||
* Copyright (C) 2003 Daniel Veillard.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
|
||||
* CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
|
||||
*
|
||||
* Author: daniel@veillard.com
|
||||
*/
|
||||
|
||||
#define IN_LIBXML
|
||||
#include "libxml.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/dict.h>
|
||||
#include <libxml/xmlmemory.h>
|
||||
#include <libxml/xmlerror.h>
|
||||
#include <libxml/globals.h>
|
||||
|
||||
#define MAX_HASH_LEN 4
|
||||
#define MIN_DICT_SIZE 128
|
||||
#define MAX_DICT_HASH 8 * 2048
|
||||
|
||||
/* #define ALLOW_REMOVAL */
|
||||
/* #define DEBUG_GROW */
|
||||
|
||||
/*
|
||||
* An entry in the dictionnary
|
||||
*/
|
||||
typedef struct _xmlDictEntry xmlDictEntry;
|
||||
typedef xmlDictEntry *xmlDictEntryPtr;
|
||||
struct _xmlDictEntry {
|
||||
struct _xmlDictEntry *next;
|
||||
const xmlChar *name;
|
||||
intptr_t len;
|
||||
int valid;
|
||||
};
|
||||
|
||||
typedef struct _xmlDictStrings xmlDictStrings;
|
||||
typedef xmlDictStrings *xmlDictStringsPtr;
|
||||
struct _xmlDictStrings {
|
||||
xmlDictStringsPtr next;
|
||||
xmlChar *free;
|
||||
xmlChar *end;
|
||||
intptr_t size;
|
||||
intptr_t nbStrings;
|
||||
xmlChar array[1];
|
||||
};
|
||||
/*
|
||||
* The entire dictionnary
|
||||
*/
|
||||
struct _xmlDict {
|
||||
int ref_counter;
|
||||
xmlRMutexPtr mutex;
|
||||
|
||||
struct _xmlDictEntry *dict;
|
||||
int size;
|
||||
int nbElems;
|
||||
xmlDictStringsPtr strings;
|
||||
|
||||
struct _xmlDict *subdict;
|
||||
};
|
||||
|
||||
/*
|
||||
* A mutex for modifying the reference counter for shared
|
||||
* dictionaries.
|
||||
*/
|
||||
static xmlRMutexPtr xmlDictMutex = NULL;
|
||||
|
||||
/*
|
||||
* Whether the dictionary mutex was initialized.
|
||||
*/
|
||||
static int xmlDictInitialized = 0;
|
||||
|
||||
/**
|
||||
* xmlInitializeDict:
|
||||
*
|
||||
* Do the dictionary mutex initialization.
|
||||
* this function is not thread safe, initialization should
|
||||
* preferably be done once at startup
|
||||
*/
|
||||
static int xmlInitializeDict(void) {
|
||||
if (xmlDictInitialized)
|
||||
return(1);
|
||||
|
||||
if ((xmlDictMutex = xmlNewRMutex()) == NULL)
|
||||
return(0);
|
||||
|
||||
xmlDictInitialized = 1;
|
||||
return(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlDictCleanup:
|
||||
*
|
||||
* Free the dictionary mutex.
|
||||
*/
|
||||
void
|
||||
xmlDictCleanup(void) {
|
||||
if (!xmlDictInitialized)
|
||||
return;
|
||||
|
||||
xmlFreeRMutex(xmlDictMutex);
|
||||
|
||||
xmlDictInitialized = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* xmlDictAddString:
|
||||
* @dict: the dictionnary
|
||||
* @name: the name of the userdata
|
||||
* @len: the length of the name, if -1 it is recomputed
|
||||
*
|
||||
* Add the string to the array[s]
|
||||
*
|
||||
* Returns the pointer of the local string, or NULL in case of error.
|
||||
*/
|
||||
static const xmlChar *
|
||||
xmlDictAddString(xmlDictPtr dict, const xmlChar *name, intptr_t namelen) {
|
||||
xmlDictStringsPtr pool;
|
||||
const xmlChar *ret;
|
||||
intptr_t size = 0; /* + sizeof(_xmlDictStrings) == 1024 */
|
||||
|
||||
pool = dict->strings;
|
||||
while (pool != NULL) {
|
||||
if (pool->end - pool->free > namelen)
|
||||
goto found_pool;
|
||||
if (pool->size > size) size = pool->size;
|
||||
pool = pool->next;
|
||||
}
|
||||
/*
|
||||
* Not found, need to allocate
|
||||
*/
|
||||
if (pool == NULL) {
|
||||
if (size == 0) size = 1000;
|
||||
else size *= 4; /* exponential growth */
|
||||
if (size < 4 * namelen)
|
||||
size = 4 * namelen; /* just in case ! */
|
||||
pool = (xmlDictStringsPtr) xmlMalloc(sizeof(xmlDictStrings) + size);
|
||||
if (pool == NULL)
|
||||
return(NULL);
|
||||
pool->size = size;
|
||||
pool->nbStrings = 0;
|
||||
pool->free = &pool->array[0];
|
||||
pool->end = &pool->array[size];
|
||||
pool->next = dict->strings;
|
||||
dict->strings = pool;
|
||||
}
|
||||
found_pool:
|
||||
ret = pool->free;
|
||||
memcpy(pool->free, name, namelen);
|
||||
pool->free += namelen;
|
||||
*(pool->free++) = 0;
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/*
|
||||
* xmlDictAddQString:
|
||||
* @dict: the dictionnary
|
||||
* @prefix: the prefix of the userdata
|
||||
* @name: the name of the userdata
|
||||
* @len: the length of the name, if -1 it is recomputed
|
||||
*
|
||||
* Add the QName to the array[s]
|
||||
*
|
||||
* Returns the pointer of the local string, or NULL in case of error.
|
||||
*/
|
||||
static const xmlChar *
|
||||
xmlDictAddQString(xmlDictPtr dict, const xmlChar *prefix,
|
||||
const xmlChar *name, intptr_t namelen)
|
||||
{
|
||||
xmlDictStringsPtr pool;
|
||||
const xmlChar *ret;
|
||||
intptr_t size = 0; /* + sizeof(_xmlDictStrings) == 1024 */
|
||||
size_t plen;
|
||||
|
||||
if (prefix == NULL) return(xmlDictAddString(dict, name, namelen));
|
||||
plen = xmlStrlen(prefix);
|
||||
|
||||
pool = dict->strings;
|
||||
while (pool != NULL) {
|
||||
if (pool->end - pool->free > namelen)
|
||||
goto found_pool;
|
||||
if (pool->size > size) size = pool->size;
|
||||
pool = pool->next;
|
||||
}
|
||||
/*
|
||||
* Not found, need to allocate
|
||||
*/
|
||||
if (pool == NULL) {
|
||||
if (size == 0) size = 1000;
|
||||
else size *= 4; /* exponential growth */
|
||||
if (size < 4 * namelen)
|
||||
size = 4 * namelen; /* just in case ! */
|
||||
pool = (xmlDictStringsPtr) xmlMalloc(sizeof(xmlDictStrings) + size);
|
||||
if (pool == NULL)
|
||||
return(NULL);
|
||||
pool->size = size;
|
||||
pool->nbStrings = 0;
|
||||
pool->free = &pool->array[0];
|
||||
pool->end = &pool->array[size];
|
||||
pool->next = dict->strings;
|
||||
dict->strings = pool;
|
||||
}
|
||||
found_pool:
|
||||
ret = pool->free;
|
||||
memcpy(pool->free, prefix, plen);
|
||||
pool->free += plen;
|
||||
*(pool->free++) = ':';
|
||||
namelen -= plen + 1;
|
||||
memcpy(pool->free, name, namelen);
|
||||
pool->free += namelen;
|
||||
*(pool->free++) = 0;
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/*
|
||||
* xmlDictComputeKey:
|
||||
* Calculate the hash key
|
||||
*/
|
||||
static unsigned long
|
||||
xmlDictComputeKey(const xmlChar *name, intptr_t namelen) {
|
||||
unsigned long value = 0L;
|
||||
|
||||
if (name == NULL) return(0);
|
||||
value = *name;
|
||||
value <<= 5;
|
||||
if (namelen > 10) {
|
||||
value += name[namelen - 1];
|
||||
namelen = 10;
|
||||
}
|
||||
switch (namelen) {
|
||||
case 10: value += name[9];
|
||||
case 9: value += name[8];
|
||||
case 8: value += name[7];
|
||||
case 7: value += name[6];
|
||||
case 6: value += name[5];
|
||||
case 5: value += name[4];
|
||||
case 4: value += name[3];
|
||||
case 3: value += name[2];
|
||||
case 2: value += name[1];
|
||||
default: break;
|
||||
}
|
||||
return(value);
|
||||
}
|
||||
|
||||
/*
|
||||
* xmlDictComputeQKey:
|
||||
* Calculate the hash key
|
||||
*/
|
||||
static unsigned long
|
||||
xmlDictComputeQKey(const xmlChar *prefix, const xmlChar *name, intptr_t len)
|
||||
{
|
||||
unsigned long value = 0L;
|
||||
size_t plen;
|
||||
|
||||
if (prefix == NULL)
|
||||
return(xmlDictComputeKey(name, len));
|
||||
|
||||
plen = xmlStrlen(prefix);
|
||||
if (plen == 0)
|
||||
value += 30 * (unsigned long) ':';
|
||||
else
|
||||
value += 30 * (*prefix);
|
||||
|
||||
if (len > 10) {
|
||||
value += name[len - (plen + 1 + 1)];
|
||||
len = 10;
|
||||
if (plen > 10)
|
||||
plen = 10;
|
||||
}
|
||||
switch (plen) {
|
||||
case 10: value += prefix[9];
|
||||
case 9: value += prefix[8];
|
||||
case 8: value += prefix[7];
|
||||
case 7: value += prefix[6];
|
||||
case 6: value += prefix[5];
|
||||
case 5: value += prefix[4];
|
||||
case 4: value += prefix[3];
|
||||
case 3: value += prefix[2];
|
||||
case 2: value += prefix[1];
|
||||
case 1: value += prefix[0];
|
||||
default: break;
|
||||
}
|
||||
len -= plen;
|
||||
if (len > 0) {
|
||||
value += (unsigned long) ':';
|
||||
len--;
|
||||
}
|
||||
switch (len) {
|
||||
case 10: value += name[9];
|
||||
case 9: value += name[8];
|
||||
case 8: value += name[7];
|
||||
case 7: value += name[6];
|
||||
case 6: value += name[5];
|
||||
case 5: value += name[4];
|
||||
case 4: value += name[3];
|
||||
case 3: value += name[2];
|
||||
case 2: value += name[1];
|
||||
case 1: value += name[0];
|
||||
default: break;
|
||||
}
|
||||
return(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlDictCreate:
|
||||
*
|
||||
* Create a new dictionary
|
||||
*
|
||||
* Returns the newly created dictionnary, or NULL if an error occured.
|
||||
*/
|
||||
xmlDictPtr
|
||||
xmlDictCreate(void) {
|
||||
xmlDictPtr dict;
|
||||
|
||||
if (!xmlDictInitialized)
|
||||
if (!xmlInitializeDict())
|
||||
return(NULL);
|
||||
|
||||
dict = xmlMalloc(sizeof(xmlDict));
|
||||
if (dict) {
|
||||
dict->ref_counter = 1;
|
||||
|
||||
dict->size = MIN_DICT_SIZE;
|
||||
dict->nbElems = 0;
|
||||
dict->dict = xmlMalloc(MIN_DICT_SIZE * sizeof(xmlDictEntry));
|
||||
dict->strings = NULL;
|
||||
dict->subdict = NULL;
|
||||
if (dict->dict) {
|
||||
if ((dict->mutex = xmlNewRMutex()) != NULL) {
|
||||
memset(dict->dict, 0, MIN_DICT_SIZE * sizeof(xmlDictEntry));
|
||||
return(dict);
|
||||
}
|
||||
xmlFree(dict->dict);
|
||||
}
|
||||
xmlFree(dict);
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlDictCreateSub:
|
||||
* @sub: an existing dictionnary
|
||||
*
|
||||
* Create a new dictionary, inheriting strings from the read-only
|
||||
* dictionnary @sub. On lookup, strings are first searched in the
|
||||
* new dictionnary, then in @sub, and if not found are created in the
|
||||
* new dictionnary.
|
||||
*
|
||||
* Returns the newly created dictionnary, or NULL if an error occured.
|
||||
*/
|
||||
xmlDictPtr
|
||||
xmlDictCreateSub(xmlDictPtr sub) {
|
||||
xmlDictPtr dict = xmlDictCreate();
|
||||
|
||||
if ((dict != NULL) && (sub != NULL)) {
|
||||
dict->subdict = sub;
|
||||
xmlDictReference(dict->subdict);
|
||||
}
|
||||
return(dict);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlDictReference:
|
||||
* @dict: the dictionnary
|
||||
*
|
||||
* Increment the reference counter of a dictionary
|
||||
*
|
||||
* Returns 0 in case of success and -1 in case of error
|
||||
*/
|
||||
int
|
||||
xmlDictReference(xmlDictPtr dict) {
|
||||
if (!xmlDictInitialized)
|
||||
if (!xmlInitializeDict())
|
||||
return(-1);
|
||||
|
||||
if (dict == NULL) return -1;
|
||||
xmlRMutexLock(xmlDictMutex);
|
||||
dict->ref_counter++;
|
||||
xmlRMutexUnlock(xmlDictMutex);
|
||||
return(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlDictGrow:
|
||||
* @dict: the dictionnary
|
||||
* @size: the new size of the dictionnary
|
||||
*
|
||||
* resize the dictionnary
|
||||
*
|
||||
* Returns 0 in case of success, -1 in case of failure
|
||||
*/
|
||||
static int
|
||||
xmlDictGrow(xmlDictPtr dict, int size) {
|
||||
unsigned long key;
|
||||
int oldsize, i;
|
||||
xmlDictEntryPtr iter, next;
|
||||
struct _xmlDictEntry *olddict;
|
||||
#ifdef DEBUG_GROW
|
||||
unsigned long nbElem = 0;
|
||||
#endif
|
||||
|
||||
if (dict == NULL)
|
||||
return(-1);
|
||||
if (size < 8)
|
||||
return(-1);
|
||||
if (size > 8 * 2048)
|
||||
return(-1);
|
||||
|
||||
oldsize = dict->size;
|
||||
olddict = dict->dict;
|
||||
if (olddict == NULL)
|
||||
return(-1);
|
||||
|
||||
dict->dict = xmlMalloc(size * sizeof(xmlDictEntry));
|
||||
if (dict->dict == NULL) {
|
||||
dict->dict = olddict;
|
||||
return(-1);
|
||||
}
|
||||
memset(dict->dict, 0, size * sizeof(xmlDictEntry));
|
||||
dict->size = size;
|
||||
|
||||
/* If the two loops are merged, there would be situations where
|
||||
a new entry needs to allocated and data copied into it from
|
||||
the main dict. So instead, we run through the array twice, first
|
||||
copying all the elements in the main array (where we can't get
|
||||
conflicts) and then the rest, so we only free (and don't allocate)
|
||||
*/
|
||||
for (i = 0; i < oldsize; i++) {
|
||||
if (olddict[i].valid == 0)
|
||||
continue;
|
||||
key = xmlDictComputeKey(olddict[i].name, olddict[i].len) % dict->size;
|
||||
memcpy(&(dict->dict[key]), &(olddict[i]), sizeof(xmlDictEntry));
|
||||
dict->dict[key].next = NULL;
|
||||
#ifdef DEBUG_GROW
|
||||
nbElem++;
|
||||
#endif
|
||||
}
|
||||
|
||||
for (i = 0; i < oldsize; i++) {
|
||||
iter = olddict[i].next;
|
||||
while (iter) {
|
||||
next = iter->next;
|
||||
|
||||
/*
|
||||
* put back the entry in the new dict
|
||||
*/
|
||||
|
||||
key = xmlDictComputeKey(iter->name, iter->len) % dict->size;
|
||||
if (dict->dict[key].valid == 0) {
|
||||
memcpy(&(dict->dict[key]), iter, sizeof(xmlDictEntry));
|
||||
dict->dict[key].next = NULL;
|
||||
dict->dict[key].valid = 1;
|
||||
xmlFree(iter);
|
||||
} else {
|
||||
iter->next = dict->dict[key].next;
|
||||
dict->dict[key].next = iter;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_GROW
|
||||
nbElem++;
|
||||
#endif
|
||||
|
||||
iter = next;
|
||||
}
|
||||
}
|
||||
|
||||
xmlFree(olddict);
|
||||
|
||||
#ifdef DEBUG_GROW
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"xmlDictGrow : from %d to %d, %d elems\n", oldsize, size, nbElem);
|
||||
#endif
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlDictFree:
|
||||
* @dict: the dictionnary
|
||||
*
|
||||
* Free the hash @dict and its contents. The userdata is
|
||||
* deallocated with @f if provided.
|
||||
*/
|
||||
void
|
||||
xmlDictFree(xmlDictPtr dict) {
|
||||
int i;
|
||||
xmlDictEntryPtr iter;
|
||||
xmlDictEntryPtr next;
|
||||
int inside_dict = 0;
|
||||
xmlDictStringsPtr pool, nextp;
|
||||
|
||||
if (dict == NULL)
|
||||
return;
|
||||
|
||||
if (!xmlDictInitialized)
|
||||
if (!xmlInitializeDict())
|
||||
return;
|
||||
|
||||
/* decrement the counter, it may be shared by a parser and docs */
|
||||
xmlRMutexLock(xmlDictMutex);
|
||||
dict->ref_counter--;
|
||||
if (dict->ref_counter > 0) {
|
||||
xmlRMutexUnlock(xmlDictMutex);
|
||||
return;
|
||||
}
|
||||
|
||||
xmlRMutexUnlock(xmlDictMutex);
|
||||
|
||||
if (dict->subdict != NULL) {
|
||||
xmlDictFree(dict->subdict);
|
||||
}
|
||||
|
||||
if (dict->dict) {
|
||||
for(i = 0; ((i < dict->size) && (dict->nbElems > 0)); i++) {
|
||||
iter = &(dict->dict[i]);
|
||||
if (iter->valid == 0)
|
||||
continue;
|
||||
inside_dict = 1;
|
||||
while (iter) {
|
||||
next = iter->next;
|
||||
if (!inside_dict)
|
||||
xmlFree(iter);
|
||||
dict->nbElems--;
|
||||
inside_dict = 0;
|
||||
iter = next;
|
||||
}
|
||||
inside_dict = 0;
|
||||
}
|
||||
xmlFree(dict->dict);
|
||||
}
|
||||
pool = dict->strings;
|
||||
while (pool != NULL) {
|
||||
nextp = pool->next;
|
||||
xmlFree(pool);
|
||||
pool = nextp;
|
||||
}
|
||||
xmlFreeRMutex(dict->mutex);
|
||||
xmlFree(dict);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlDictLookup:
|
||||
* @dict: the dictionnary
|
||||
* @name: the name of the userdata
|
||||
* @len: the length of the name, if -1 it is recomputed
|
||||
*
|
||||
* Add the @name to the dictionnary @dict if not present.
|
||||
*
|
||||
* Returns the internal copy of the name or NULL in case of internal error
|
||||
*/
|
||||
const xmlChar *
|
||||
xmlDictLookup(xmlDictPtr dict, const xmlChar *name, intptr_t len) {
|
||||
unsigned long key, okey, nbi = 0;
|
||||
xmlDictEntryPtr entry;
|
||||
xmlDictEntryPtr insert;
|
||||
const xmlChar *ret;
|
||||
|
||||
if ((dict == NULL) || (name == NULL))
|
||||
return(NULL);
|
||||
|
||||
if (len < 0)
|
||||
len = xmlStrlen(name);
|
||||
|
||||
/*
|
||||
* Check for duplicate and insertion location.
|
||||
*/
|
||||
okey = xmlDictComputeKey(name, len);
|
||||
key = okey % dict->size;
|
||||
if (dict->dict[key].valid == 0) {
|
||||
insert = NULL;
|
||||
} else {
|
||||
for (insert = &(dict->dict[key]); insert->next != NULL;
|
||||
insert = insert->next) {
|
||||
#ifdef __GNUC__
|
||||
if (insert->len == len) {
|
||||
if (!memcmp(insert->name, name, len))
|
||||
return(insert->name);
|
||||
}
|
||||
#else
|
||||
if ((insert->len == len) &&
|
||||
(!xmlStrncmp(insert->name, name, len)))
|
||||
return(insert->name);
|
||||
#endif
|
||||
nbi++;
|
||||
}
|
||||
#ifdef __GNUC__
|
||||
if (insert->len == len) {
|
||||
if (!memcmp(insert->name, name, len))
|
||||
return(insert->name);
|
||||
}
|
||||
#else
|
||||
if ((insert->len == len) &&
|
||||
(!xmlStrncmp(insert->name, name, len)))
|
||||
return(insert->name);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (dict->subdict) {
|
||||
key = okey % dict->subdict->size;
|
||||
if (dict->subdict->dict[key].valid != 0) {
|
||||
xmlDictEntryPtr tmp;
|
||||
|
||||
for (tmp = &(dict->subdict->dict[key]); tmp->next != NULL;
|
||||
tmp = tmp->next) {
|
||||
#ifdef __GNUC__
|
||||
if (tmp->len == len) {
|
||||
if (!memcmp(tmp->name, name, len))
|
||||
return(tmp->name);
|
||||
}
|
||||
#else
|
||||
if ((tmp->len == len) &&
|
||||
(!xmlStrncmp(tmp->name, name, len)))
|
||||
return(tmp->name);
|
||||
#endif
|
||||
nbi++;
|
||||
}
|
||||
#ifdef __GNUC__
|
||||
if (tmp->len == len) {
|
||||
if (!memcmp(tmp->name, name, len))
|
||||
return(tmp->name);
|
||||
}
|
||||
#else
|
||||
if ((tmp->len == len) &&
|
||||
(!xmlStrncmp(tmp->name, name, len)))
|
||||
return(tmp->name);
|
||||
#endif
|
||||
}
|
||||
key = okey % dict->size;
|
||||
}
|
||||
|
||||
ret = xmlDictAddString(dict, name, len);
|
||||
if (ret == NULL)
|
||||
return(NULL);
|
||||
if (insert == NULL) {
|
||||
entry = &(dict->dict[key]);
|
||||
} else {
|
||||
entry = xmlMalloc(sizeof(xmlDictEntry));
|
||||
if (entry == NULL)
|
||||
return(NULL);
|
||||
}
|
||||
entry->name = ret;
|
||||
entry->len = len;
|
||||
entry->next = NULL;
|
||||
entry->valid = 1;
|
||||
|
||||
|
||||
if (insert != NULL)
|
||||
insert->next = entry;
|
||||
|
||||
dict->nbElems++;
|
||||
|
||||
if ((nbi > MAX_HASH_LEN) &&
|
||||
(dict->size <= ((MAX_DICT_HASH / 2) / MAX_HASH_LEN)))
|
||||
xmlDictGrow(dict, MAX_HASH_LEN * 2 * dict->size);
|
||||
/* Note that entry may have been freed at this point by xmlDictGrow */
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlDictExists:
|
||||
* @dict: the dictionnary
|
||||
* @name: the name of the userdata
|
||||
* @len: the length of the name, if -1 it is recomputed
|
||||
*
|
||||
* Check if the @name exists in the dictionnary @dict.
|
||||
*
|
||||
* Returns the internal copy of the name or NULL if not found.
|
||||
*/
|
||||
const xmlChar *
|
||||
xmlDictExists(xmlDictPtr dict, const xmlChar *name, intptr_t len) {
|
||||
unsigned long key, okey, nbi = 0;
|
||||
xmlDictEntryPtr insert;
|
||||
|
||||
if ((dict == NULL) || (name == NULL))
|
||||
return(NULL);
|
||||
|
||||
if (len < 0)
|
||||
len = xmlStrlen(name);
|
||||
|
||||
/*
|
||||
* Check for duplicate and insertion location.
|
||||
*/
|
||||
okey = xmlDictComputeKey(name, len);
|
||||
key = okey % dict->size;
|
||||
if (dict->dict[key].valid == 0) {
|
||||
insert = NULL;
|
||||
} else {
|
||||
for (insert = &(dict->dict[key]); insert->next != NULL;
|
||||
insert = insert->next) {
|
||||
#ifdef __GNUC__
|
||||
if (insert->len == len) {
|
||||
if (!memcmp(insert->name, name, len))
|
||||
return(insert->name);
|
||||
}
|
||||
#else
|
||||
if ((insert->len == len) &&
|
||||
(!xmlStrncmp(insert->name, name, len)))
|
||||
return(insert->name);
|
||||
#endif
|
||||
nbi++;
|
||||
}
|
||||
#ifdef __GNUC__
|
||||
if (insert->len == len) {
|
||||
if (!memcmp(insert->name, name, len))
|
||||
return(insert->name);
|
||||
}
|
||||
#else
|
||||
if ((insert->len == len) &&
|
||||
(!xmlStrncmp(insert->name, name, len)))
|
||||
return(insert->name);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (dict->subdict) {
|
||||
key = okey % dict->subdict->size;
|
||||
if (dict->subdict->dict[key].valid != 0) {
|
||||
xmlDictEntryPtr tmp;
|
||||
|
||||
for (tmp = &(dict->subdict->dict[key]); tmp->next != NULL;
|
||||
tmp = tmp->next) {
|
||||
#ifdef __GNUC__
|
||||
if (tmp->len == len) {
|
||||
if (!memcmp(tmp->name, name, len))
|
||||
return(tmp->name);
|
||||
}
|
||||
#else
|
||||
if ((tmp->len == len) &&
|
||||
(!xmlStrncmp(tmp->name, name, len)))
|
||||
return(tmp->name);
|
||||
#endif
|
||||
nbi++;
|
||||
}
|
||||
#ifdef __GNUC__
|
||||
if (tmp->len == len) {
|
||||
if (!memcmp(tmp->name, name, len))
|
||||
return(tmp->name);
|
||||
}
|
||||
#else
|
||||
if ((tmp->len == len) &&
|
||||
(!xmlStrncmp(tmp->name, name, len)))
|
||||
return(tmp->name);
|
||||
#endif
|
||||
}
|
||||
key = okey % dict->size;
|
||||
}
|
||||
|
||||
/* not found */
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlDictQLookup:
|
||||
* @dict: the dictionnary
|
||||
* @prefix: the prefix
|
||||
* @name: the name
|
||||
*
|
||||
* Add the QName @prefix:@name to the hash @dict if not present.
|
||||
*
|
||||
* Returns the internal copy of the QName or NULL in case of internal error
|
||||
*/
|
||||
const xmlChar *
|
||||
xmlDictQLookup(xmlDictPtr dict, const xmlChar *prefix, const xmlChar *name) {
|
||||
unsigned long okey, key, nbi = 0;
|
||||
xmlDictEntryPtr entry;
|
||||
xmlDictEntryPtr insert;
|
||||
const xmlChar *ret;
|
||||
intptr_t len;
|
||||
|
||||
if ((dict == NULL) || (name == NULL))
|
||||
return(NULL);
|
||||
|
||||
len = xmlStrlen(name);
|
||||
if (prefix != NULL)
|
||||
len += 1 + xmlStrlen(prefix);
|
||||
|
||||
/*
|
||||
* Check for duplicate and insertion location.
|
||||
*/
|
||||
okey = xmlDictComputeQKey(prefix, name, len);
|
||||
key = okey % dict->size;
|
||||
if (dict->dict[key].valid == 0) {
|
||||
insert = NULL;
|
||||
} else {
|
||||
for (insert = &(dict->dict[key]); insert->next != NULL;
|
||||
insert = insert->next) {
|
||||
if ((insert->len == len) &&
|
||||
(xmlStrQEqual(prefix, name, insert->name)))
|
||||
return(insert->name);
|
||||
nbi++;
|
||||
}
|
||||
if ((insert->len == len) &&
|
||||
(xmlStrQEqual(prefix, name, insert->name)))
|
||||
return(insert->name);
|
||||
}
|
||||
|
||||
if (dict->subdict) {
|
||||
key = okey % dict->subdict->size;
|
||||
if (dict->subdict->dict[key].valid != 0) {
|
||||
xmlDictEntryPtr tmp;
|
||||
for (tmp = &(dict->subdict->dict[key]); tmp->next != NULL;
|
||||
tmp = tmp->next) {
|
||||
if ((tmp->len == len) &&
|
||||
(xmlStrQEqual(prefix, name, tmp->name)))
|
||||
return(tmp->name);
|
||||
nbi++;
|
||||
}
|
||||
if ((tmp->len == len) &&
|
||||
(xmlStrQEqual(prefix, name, tmp->name)))
|
||||
return(tmp->name);
|
||||
}
|
||||
key = okey % dict->size;
|
||||
}
|
||||
|
||||
ret = xmlDictAddQString(dict, prefix, name, len);
|
||||
if (ret == NULL)
|
||||
return(NULL);
|
||||
if (insert == NULL) {
|
||||
entry = &(dict->dict[key]);
|
||||
} else {
|
||||
entry = xmlMalloc(sizeof(xmlDictEntry));
|
||||
if (entry == NULL)
|
||||
return(NULL);
|
||||
}
|
||||
entry->name = ret;
|
||||
entry->len = len;
|
||||
entry->next = NULL;
|
||||
entry->valid = 1;
|
||||
|
||||
if (insert != NULL)
|
||||
insert->next = entry;
|
||||
|
||||
dict->nbElems++;
|
||||
|
||||
if ((nbi > MAX_HASH_LEN) &&
|
||||
(dict->size <= ((MAX_DICT_HASH / 2) / MAX_HASH_LEN)))
|
||||
xmlDictGrow(dict, MAX_HASH_LEN * 2 * dict->size);
|
||||
/* Note that entry may have been freed at this point by xmlDictGrow */
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlDictOwns:
|
||||
* @dict: the dictionnary
|
||||
* @str: the string
|
||||
*
|
||||
* check if a string is owned by the disctionary
|
||||
*
|
||||
* Returns 1 if true, 0 if false and -1 in case of error
|
||||
* -1 in case of error
|
||||
*/
|
||||
int
|
||||
xmlDictOwns(xmlDictPtr dict, const xmlChar *str) {
|
||||
xmlDictStringsPtr pool;
|
||||
|
||||
if ((dict == NULL) || (str == NULL))
|
||||
return(-1);
|
||||
pool = dict->strings;
|
||||
while (pool != NULL) {
|
||||
if ((str >= &pool->array[0]) && (str <= pool->free))
|
||||
return(1);
|
||||
pool = pool->next;
|
||||
}
|
||||
if (dict->subdict)
|
||||
return(xmlDictOwns(dict->subdict, str));
|
||||
return(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlDictSize:
|
||||
* @dict: the dictionnary
|
||||
*
|
||||
* Query the number of elements installed in the hash @dict.
|
||||
*
|
||||
* Returns the number of elements in the dictionnary or
|
||||
* -1 in case of error
|
||||
*/
|
||||
int
|
||||
xmlDictSize(xmlDictPtr dict) {
|
||||
if (dict == NULL)
|
||||
return(-1);
|
||||
if (dict->subdict)
|
||||
return(dict->nbElems + dict->subdict->nbElems);
|
||||
return(dict->nbElems);
|
||||
}
|
||||
|
||||
|
||||
#define bottom_dict
|
||||
#include "elfgcchack.h"
|
||||
16723
Extras/LibXML/elfgcchack.h
Normal file
16723
Extras/LibXML/elfgcchack.h
Normal file
File diff suppressed because it is too large
Load Diff
3268
Extras/LibXML/encoding.c
Normal file
3268
Extras/LibXML/encoding.c
Normal file
File diff suppressed because it is too large
Load Diff
968
Extras/LibXML/entities.c
Normal file
968
Extras/LibXML/entities.c
Normal file
@@ -0,0 +1,968 @@
|
||||
/*
|
||||
* entities.c : implementation for the XML entities handling
|
||||
*
|
||||
* See Copyright for the status of this software.
|
||||
*
|
||||
* daniel@veillard.com
|
||||
*/
|
||||
|
||||
#define IN_LIBXML
|
||||
#include "libxml.h"
|
||||
|
||||
#include <string.h>
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#include <libxml/xmlmemory.h>
|
||||
#include <libxml/hash.h>
|
||||
#include <libxml/entities.h>
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/parserInternals.h>
|
||||
#include <libxml/xmlerror.h>
|
||||
#include <libxml/globals.h>
|
||||
#include <libxml/dict.h>
|
||||
|
||||
/*
|
||||
* The XML predefined entities.
|
||||
*/
|
||||
|
||||
static xmlEntity xmlEntityLt = {
|
||||
NULL, XML_ENTITY_DECL, BAD_CAST "lt",
|
||||
NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
BAD_CAST "<", BAD_CAST "<", 1,
|
||||
XML_INTERNAL_PREDEFINED_ENTITY,
|
||||
NULL, NULL, NULL, NULL, 0
|
||||
};
|
||||
static xmlEntity xmlEntityGt = {
|
||||
NULL, XML_ENTITY_DECL, BAD_CAST "gt",
|
||||
NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
BAD_CAST ">", BAD_CAST ">", 1,
|
||||
XML_INTERNAL_PREDEFINED_ENTITY,
|
||||
NULL, NULL, NULL, NULL, 0
|
||||
};
|
||||
static xmlEntity xmlEntityAmp = {
|
||||
NULL, XML_ENTITY_DECL, BAD_CAST "amp",
|
||||
NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
BAD_CAST "&", BAD_CAST "&", 1,
|
||||
XML_INTERNAL_PREDEFINED_ENTITY,
|
||||
NULL, NULL, NULL, NULL, 0
|
||||
};
|
||||
static xmlEntity xmlEntityQuot = {
|
||||
NULL, XML_ENTITY_DECL, BAD_CAST "quot",
|
||||
NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
BAD_CAST "\"", BAD_CAST "\"", 1,
|
||||
XML_INTERNAL_PREDEFINED_ENTITY,
|
||||
NULL, NULL, NULL, NULL, 0
|
||||
};
|
||||
static xmlEntity xmlEntityApos = {
|
||||
NULL, XML_ENTITY_DECL, BAD_CAST "apos",
|
||||
NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
BAD_CAST "'", BAD_CAST "'", 1,
|
||||
XML_INTERNAL_PREDEFINED_ENTITY,
|
||||
NULL, NULL, NULL, NULL, 0
|
||||
};
|
||||
|
||||
/**
|
||||
* xmlEntitiesErrMemory:
|
||||
* @extra: extra informations
|
||||
*
|
||||
* Handle an out of memory condition
|
||||
*/
|
||||
static void
|
||||
xmlEntitiesErrMemory(const char *extra)
|
||||
{
|
||||
__xmlSimpleError(XML_FROM_TREE, XML_ERR_NO_MEMORY, NULL, NULL, extra);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlEntitiesErr:
|
||||
* @code: the error code
|
||||
* @msg: the message
|
||||
*
|
||||
* Handle an out of memory condition
|
||||
*/
|
||||
static void
|
||||
xmlEntitiesErr(xmlParserErrors code, const char *msg)
|
||||
{
|
||||
__xmlSimpleError(XML_FROM_TREE, code, NULL, msg, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* xmlFreeEntity : clean-up an entity record.
|
||||
*/
|
||||
static void
|
||||
xmlFreeEntity(xmlEntityPtr entity)
|
||||
{
|
||||
xmlDictPtr dict = NULL;
|
||||
|
||||
if (entity == NULL)
|
||||
return;
|
||||
|
||||
if (entity->doc != NULL)
|
||||
dict = entity->doc->dict;
|
||||
|
||||
|
||||
if ((entity->children) && (entity->owner == 1) &&
|
||||
(entity == (xmlEntityPtr) entity->children->parent))
|
||||
xmlFreeNodeList(entity->children);
|
||||
if (dict != NULL) {
|
||||
if ((entity->name != NULL) && (!xmlDictOwns(dict, entity->name)))
|
||||
xmlFree((char *) entity->name);
|
||||
if ((entity->ExternalID != NULL) &&
|
||||
(!xmlDictOwns(dict, entity->ExternalID)))
|
||||
xmlFree((char *) entity->ExternalID);
|
||||
if ((entity->SystemID != NULL) &&
|
||||
(!xmlDictOwns(dict, entity->SystemID)))
|
||||
xmlFree((char *) entity->SystemID);
|
||||
if ((entity->URI != NULL) && (!xmlDictOwns(dict, entity->URI)))
|
||||
xmlFree((char *) entity->URI);
|
||||
if ((entity->content != NULL)
|
||||
&& (!xmlDictOwns(dict, entity->content)))
|
||||
xmlFree((char *) entity->content);
|
||||
if ((entity->orig != NULL) && (!xmlDictOwns(dict, entity->orig)))
|
||||
xmlFree((char *) entity->orig);
|
||||
} else {
|
||||
if (entity->name != NULL)
|
||||
xmlFree((char *) entity->name);
|
||||
if (entity->ExternalID != NULL)
|
||||
xmlFree((char *) entity->ExternalID);
|
||||
if (entity->SystemID != NULL)
|
||||
xmlFree((char *) entity->SystemID);
|
||||
if (entity->URI != NULL)
|
||||
xmlFree((char *) entity->URI);
|
||||
if (entity->content != NULL)
|
||||
xmlFree((char *) entity->content);
|
||||
if (entity->orig != NULL)
|
||||
xmlFree((char *) entity->orig);
|
||||
}
|
||||
xmlFree(entity);
|
||||
}
|
||||
|
||||
/*
|
||||
* xmlAddEntity : register a new entity for an entities table.
|
||||
*/
|
||||
static xmlEntityPtr
|
||||
xmlAddEntity(xmlDtdPtr dtd, const xmlChar *name, int type,
|
||||
const xmlChar *ExternalID, const xmlChar *SystemID,
|
||||
const xmlChar *content) {
|
||||
xmlDictPtr dict = NULL;
|
||||
xmlEntitiesTablePtr table = NULL;
|
||||
xmlEntityPtr ret;
|
||||
|
||||
if (name == NULL)
|
||||
return(NULL);
|
||||
if (dtd == NULL)
|
||||
return(NULL);
|
||||
if (dtd->doc != NULL)
|
||||
dict = dtd->doc->dict;
|
||||
|
||||
switch (type) {
|
||||
case XML_INTERNAL_GENERAL_ENTITY:
|
||||
case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
|
||||
case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
|
||||
if (dtd->entities == NULL)
|
||||
dtd->entities = xmlHashCreateDict(0, dict);
|
||||
table = dtd->entities;
|
||||
break;
|
||||
case XML_INTERNAL_PARAMETER_ENTITY:
|
||||
case XML_EXTERNAL_PARAMETER_ENTITY:
|
||||
if (dtd->pentities == NULL)
|
||||
dtd->pentities = xmlHashCreateDict(0, dict);
|
||||
table = dtd->pentities;
|
||||
break;
|
||||
case XML_INTERNAL_PREDEFINED_ENTITY:
|
||||
return(NULL);
|
||||
}
|
||||
if (table == NULL)
|
||||
return(NULL);
|
||||
ret = (xmlEntityPtr) xmlMalloc(sizeof(xmlEntity));
|
||||
if (ret == NULL) {
|
||||
xmlEntitiesErrMemory("xmlAddEntity:: malloc failed");
|
||||
return(NULL);
|
||||
}
|
||||
memset(ret, 0, sizeof(xmlEntity));
|
||||
ret->type = XML_ENTITY_DECL;
|
||||
|
||||
/*
|
||||
* fill the structure.
|
||||
*/
|
||||
ret->etype = (xmlEntityType) type;
|
||||
if (dict == NULL) {
|
||||
ret->name = xmlStrdup(name);
|
||||
if (ExternalID != NULL)
|
||||
ret->ExternalID = xmlStrdup(ExternalID);
|
||||
if (SystemID != NULL)
|
||||
ret->SystemID = xmlStrdup(SystemID);
|
||||
} else {
|
||||
ret->name = xmlDictLookup(dict, name, -1);
|
||||
if (ExternalID != NULL)
|
||||
ret->ExternalID = xmlDictLookup(dict, ExternalID, -1);
|
||||
if (SystemID != NULL)
|
||||
ret->SystemID = xmlDictLookup(dict, SystemID, -1);
|
||||
}
|
||||
if (content != NULL) {
|
||||
ret->length = xmlStrlen(content);
|
||||
if ((dict != NULL) && (ret->length < 5))
|
||||
ret->content = (xmlChar *)
|
||||
xmlDictLookup(dict, content, ret->length);
|
||||
else
|
||||
ret->content = xmlStrndup(content, ret->length);
|
||||
} else {
|
||||
ret->length = 0;
|
||||
ret->content = NULL;
|
||||
}
|
||||
ret->URI = NULL; /* to be computed by the layer knowing
|
||||
the defining entity */
|
||||
ret->orig = NULL;
|
||||
ret->owner = 0;
|
||||
ret->doc = dtd->doc;
|
||||
|
||||
if (xmlHashAddEntry(table, name, ret)) {
|
||||
/*
|
||||
* entity was already defined at another level.
|
||||
*/
|
||||
xmlFreeEntity(ret);
|
||||
return(NULL);
|
||||
}
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlGetPredefinedEntity:
|
||||
* @name: the entity name
|
||||
*
|
||||
* Check whether this name is an predefined entity.
|
||||
*
|
||||
* Returns NULL if not, otherwise the entity
|
||||
*/
|
||||
xmlEntityPtr
|
||||
xmlGetPredefinedEntity(const xmlChar *name) {
|
||||
if (name == NULL) return(NULL);
|
||||
switch (name[0]) {
|
||||
case 'l':
|
||||
if (xmlStrEqual(name, BAD_CAST "lt"))
|
||||
return(&xmlEntityLt);
|
||||
break;
|
||||
case 'g':
|
||||
if (xmlStrEqual(name, BAD_CAST "gt"))
|
||||
return(&xmlEntityGt);
|
||||
break;
|
||||
case 'a':
|
||||
if (xmlStrEqual(name, BAD_CAST "amp"))
|
||||
return(&xmlEntityAmp);
|
||||
if (xmlStrEqual(name, BAD_CAST "apos"))
|
||||
return(&xmlEntityApos);
|
||||
break;
|
||||
case 'q':
|
||||
if (xmlStrEqual(name, BAD_CAST "quot"))
|
||||
return(&xmlEntityQuot);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlAddDtdEntity:
|
||||
* @doc: the document
|
||||
* @name: the entity name
|
||||
* @type: the entity type XML_xxx_yyy_ENTITY
|
||||
* @ExternalID: the entity external ID if available
|
||||
* @SystemID: the entity system ID if available
|
||||
* @content: the entity content
|
||||
*
|
||||
* Register a new entity for this document DTD external subset.
|
||||
*
|
||||
* Returns a pointer to the entity or NULL in case of error
|
||||
*/
|
||||
xmlEntityPtr
|
||||
xmlAddDtdEntity(xmlDocPtr doc, const xmlChar *name, int type,
|
||||
const xmlChar *ExternalID, const xmlChar *SystemID,
|
||||
const xmlChar *content) {
|
||||
xmlEntityPtr ret;
|
||||
xmlDtdPtr dtd;
|
||||
|
||||
if (doc == NULL) {
|
||||
xmlEntitiesErr(XML_DTD_NO_DOC,
|
||||
"xmlAddDtdEntity: document is NULL");
|
||||
return(NULL);
|
||||
}
|
||||
if (doc->extSubset == NULL) {
|
||||
xmlEntitiesErr(XML_DTD_NO_DTD,
|
||||
"xmlAddDtdEntity: document without external subset");
|
||||
return(NULL);
|
||||
}
|
||||
dtd = doc->extSubset;
|
||||
ret = xmlAddEntity(dtd, name, type, ExternalID, SystemID, content);
|
||||
if (ret == NULL) return(NULL);
|
||||
|
||||
/*
|
||||
* Link it to the DTD
|
||||
*/
|
||||
ret->parent = dtd;
|
||||
ret->doc = dtd->doc;
|
||||
if (dtd->last == NULL) {
|
||||
dtd->children = dtd->last = (xmlNodePtr) ret;
|
||||
} else {
|
||||
dtd->last->next = (xmlNodePtr) ret;
|
||||
ret->prev = dtd->last;
|
||||
dtd->last = (xmlNodePtr) ret;
|
||||
}
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlAddDocEntity:
|
||||
* @doc: the document
|
||||
* @name: the entity name
|
||||
* @type: the entity type XML_xxx_yyy_ENTITY
|
||||
* @ExternalID: the entity external ID if available
|
||||
* @SystemID: the entity system ID if available
|
||||
* @content: the entity content
|
||||
*
|
||||
* Register a new entity for this document.
|
||||
*
|
||||
* Returns a pointer to the entity or NULL in case of error
|
||||
*/
|
||||
xmlEntityPtr
|
||||
xmlAddDocEntity(xmlDocPtr doc, const xmlChar *name, int type,
|
||||
const xmlChar *ExternalID, const xmlChar *SystemID,
|
||||
const xmlChar *content) {
|
||||
xmlEntityPtr ret;
|
||||
xmlDtdPtr dtd;
|
||||
|
||||
if (doc == NULL) {
|
||||
xmlEntitiesErr(XML_DTD_NO_DOC,
|
||||
"xmlAddDocEntity: document is NULL");
|
||||
return(NULL);
|
||||
}
|
||||
if (doc->intSubset == NULL) {
|
||||
xmlEntitiesErr(XML_DTD_NO_DTD,
|
||||
"xmlAddDocEntity: document without internal subset");
|
||||
return(NULL);
|
||||
}
|
||||
dtd = doc->intSubset;
|
||||
ret = xmlAddEntity(dtd, name, type, ExternalID, SystemID, content);
|
||||
if (ret == NULL) return(NULL);
|
||||
|
||||
/*
|
||||
* Link it to the DTD
|
||||
*/
|
||||
ret->parent = dtd;
|
||||
ret->doc = dtd->doc;
|
||||
if (dtd->last == NULL) {
|
||||
dtd->children = dtd->last = (xmlNodePtr) ret;
|
||||
} else {
|
||||
dtd->last->next = (xmlNodePtr) ret;
|
||||
ret->prev = dtd->last;
|
||||
dtd->last = (xmlNodePtr) ret;
|
||||
}
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlGetEntityFromTable:
|
||||
* @table: an entity table
|
||||
* @name: the entity name
|
||||
* @parameter: look for parameter entities
|
||||
*
|
||||
* Do an entity lookup in the table.
|
||||
* returns the corresponding parameter entity, if found.
|
||||
*
|
||||
* Returns A pointer to the entity structure or NULL if not found.
|
||||
*/
|
||||
static xmlEntityPtr
|
||||
xmlGetEntityFromTable(xmlEntitiesTablePtr table, const xmlChar *name) {
|
||||
return((xmlEntityPtr) xmlHashLookup(table, name));
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlGetParameterEntity:
|
||||
* @doc: the document referencing the entity
|
||||
* @name: the entity name
|
||||
*
|
||||
* Do an entity lookup in the internal and external subsets and
|
||||
* returns the corresponding parameter entity, if found.
|
||||
*
|
||||
* Returns A pointer to the entity structure or NULL if not found.
|
||||
*/
|
||||
xmlEntityPtr
|
||||
xmlGetParameterEntity(xmlDocPtr doc, const xmlChar *name) {
|
||||
xmlEntitiesTablePtr table;
|
||||
xmlEntityPtr ret;
|
||||
|
||||
if (doc == NULL)
|
||||
return(NULL);
|
||||
if ((doc->intSubset != NULL) && (doc->intSubset->pentities != NULL)) {
|
||||
table = (xmlEntitiesTablePtr) doc->intSubset->pentities;
|
||||
ret = xmlGetEntityFromTable(table, name);
|
||||
if (ret != NULL)
|
||||
return(ret);
|
||||
}
|
||||
if ((doc->extSubset != NULL) && (doc->extSubset->pentities != NULL)) {
|
||||
table = (xmlEntitiesTablePtr) doc->extSubset->pentities;
|
||||
return(xmlGetEntityFromTable(table, name));
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlGetDtdEntity:
|
||||
* @doc: the document referencing the entity
|
||||
* @name: the entity name
|
||||
*
|
||||
* Do an entity lookup in the DTD entity hash table and
|
||||
* returns the corresponding entity, if found.
|
||||
* Note: the first argument is the document node, not the DTD node.
|
||||
*
|
||||
* Returns A pointer to the entity structure or NULL if not found.
|
||||
*/
|
||||
xmlEntityPtr
|
||||
xmlGetDtdEntity(xmlDocPtr doc, const xmlChar *name) {
|
||||
xmlEntitiesTablePtr table;
|
||||
|
||||
if (doc == NULL)
|
||||
return(NULL);
|
||||
if ((doc->extSubset != NULL) && (doc->extSubset->entities != NULL)) {
|
||||
table = (xmlEntitiesTablePtr) doc->extSubset->entities;
|
||||
return(xmlGetEntityFromTable(table, name));
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlGetDocEntity:
|
||||
* @doc: the document referencing the entity
|
||||
* @name: the entity name
|
||||
*
|
||||
* Do an entity lookup in the document entity hash table and
|
||||
* returns the corresponding entity, otherwise a lookup is done
|
||||
* in the predefined entities too.
|
||||
*
|
||||
* Returns A pointer to the entity structure or NULL if not found.
|
||||
*/
|
||||
xmlEntityPtr
|
||||
xmlGetDocEntity(xmlDocPtr doc, const xmlChar *name) {
|
||||
xmlEntityPtr cur;
|
||||
xmlEntitiesTablePtr table;
|
||||
|
||||
if (doc != NULL) {
|
||||
if ((doc->intSubset != NULL) && (doc->intSubset->entities != NULL)) {
|
||||
table = (xmlEntitiesTablePtr) doc->intSubset->entities;
|
||||
cur = xmlGetEntityFromTable(table, name);
|
||||
if (cur != NULL)
|
||||
return(cur);
|
||||
}
|
||||
if (doc->standalone != 1) {
|
||||
if ((doc->extSubset != NULL) &&
|
||||
(doc->extSubset->entities != NULL)) {
|
||||
table = (xmlEntitiesTablePtr) doc->extSubset->entities;
|
||||
cur = xmlGetEntityFromTable(table, name);
|
||||
if (cur != NULL)
|
||||
return(cur);
|
||||
}
|
||||
}
|
||||
}
|
||||
return(xmlGetPredefinedEntity(name));
|
||||
}
|
||||
|
||||
/*
|
||||
* Macro used to grow the current buffer.
|
||||
*/
|
||||
#define growBufferReentrant() { \
|
||||
buffer_size *= 2; \
|
||||
buffer = (xmlChar *) \
|
||||
xmlRealloc(buffer, buffer_size * sizeof(xmlChar)); \
|
||||
if (buffer == NULL) { \
|
||||
xmlEntitiesErrMemory("xmlEncodeEntitiesReentrant: realloc failed");\
|
||||
return(NULL); \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* xmlEncodeEntitiesReentrant:
|
||||
* @doc: the document containing the string
|
||||
* @input: A string to convert to XML.
|
||||
*
|
||||
* Do a global encoding of a string, replacing the predefined entities
|
||||
* and non ASCII values with their entities and CharRef counterparts.
|
||||
* Contrary to xmlEncodeEntities, this routine is reentrant, and result
|
||||
* must be deallocated.
|
||||
*
|
||||
* Returns A newly allocated string with the substitution done.
|
||||
*/
|
||||
xmlChar *
|
||||
xmlEncodeEntitiesReentrant(xmlDocPtr doc, const xmlChar *input) {
|
||||
const xmlChar *cur = input;
|
||||
xmlChar *buffer = NULL;
|
||||
xmlChar *out = NULL;
|
||||
int buffer_size = 0;
|
||||
int html = 0;
|
||||
|
||||
if (input == NULL) return(NULL);
|
||||
if (doc != NULL)
|
||||
html = (doc->type == XML_HTML_DOCUMENT_NODE);
|
||||
|
||||
/*
|
||||
* allocate an translation buffer.
|
||||
*/
|
||||
buffer_size = 1000;
|
||||
buffer = (xmlChar *) xmlMalloc(buffer_size * sizeof(xmlChar));
|
||||
if (buffer == NULL) {
|
||||
xmlEntitiesErrMemory("xmlEncodeEntitiesReentrant: malloc failed");
|
||||
return(NULL);
|
||||
}
|
||||
out = buffer;
|
||||
|
||||
while (*cur != '\0') {
|
||||
if (out - buffer > buffer_size - 100) {
|
||||
intptr_t indx = out - buffer;
|
||||
|
||||
growBufferReentrant();
|
||||
out = &buffer[indx];
|
||||
}
|
||||
|
||||
/*
|
||||
* By default one have to encode at least '<', '>', '"' and '&' !
|
||||
*/
|
||||
if (*cur == '<') {
|
||||
*out++ = '&';
|
||||
*out++ = 'l';
|
||||
*out++ = 't';
|
||||
*out++ = ';';
|
||||
} else if (*cur == '>') {
|
||||
*out++ = '&';
|
||||
*out++ = 'g';
|
||||
*out++ = 't';
|
||||
*out++ = ';';
|
||||
} else if (*cur == '&') {
|
||||
*out++ = '&';
|
||||
*out++ = 'a';
|
||||
*out++ = 'm';
|
||||
*out++ = 'p';
|
||||
*out++ = ';';
|
||||
} else if (((*cur >= 0x20) && (*cur < 0x80)) ||
|
||||
(*cur == '\n') || (*cur == '\t') || ((html) && (*cur == '\r'))) {
|
||||
/*
|
||||
* default case, just copy !
|
||||
*/
|
||||
*out++ = *cur;
|
||||
} else if (*cur >= 0x80) {
|
||||
if (((doc != NULL) && (doc->encoding != NULL)) || (html)) {
|
||||
/*
|
||||
* Bj<42>rn Reese <br@sseusa.com> provided the patch
|
||||
xmlChar xc;
|
||||
xc = (*cur & 0x3F) << 6;
|
||||
if (cur[1] != 0) {
|
||||
xc += *(++cur) & 0x3F;
|
||||
*out++ = xc;
|
||||
} else
|
||||
*/
|
||||
*out++ = *cur;
|
||||
} else {
|
||||
/*
|
||||
* We assume we have UTF-8 input.
|
||||
*/
|
||||
char buf[11], *ptr;
|
||||
int val = 0, l = 1;
|
||||
|
||||
if (*cur < 0xC0) {
|
||||
xmlEntitiesErr(XML_CHECK_NOT_UTF8,
|
||||
"xmlEncodeEntitiesReentrant : input not UTF-8");
|
||||
if (doc != NULL)
|
||||
doc->encoding = xmlStrdup(BAD_CAST "ISO-8859-1");
|
||||
snprintf(buf, sizeof(buf), "&#%d;", *cur);
|
||||
buf[sizeof(buf) - 1] = 0;
|
||||
ptr = buf;
|
||||
while (*ptr != 0) *out++ = *ptr++;
|
||||
cur++;
|
||||
continue;
|
||||
} else if (*cur < 0xE0) {
|
||||
val = (cur[0]) & 0x1F;
|
||||
val <<= 6;
|
||||
val |= (cur[1]) & 0x3F;
|
||||
l = 2;
|
||||
} else if (*cur < 0xF0) {
|
||||
val = (cur[0]) & 0x0F;
|
||||
val <<= 6;
|
||||
val |= (cur[1]) & 0x3F;
|
||||
val <<= 6;
|
||||
val |= (cur[2]) & 0x3F;
|
||||
l = 3;
|
||||
} else if (*cur < 0xF8) {
|
||||
val = (cur[0]) & 0x07;
|
||||
val <<= 6;
|
||||
val |= (cur[1]) & 0x3F;
|
||||
val <<= 6;
|
||||
val |= (cur[2]) & 0x3F;
|
||||
val <<= 6;
|
||||
val |= (cur[3]) & 0x3F;
|
||||
l = 4;
|
||||
}
|
||||
if ((l == 1) || (!IS_CHAR(val))) {
|
||||
xmlEntitiesErr(XML_ERR_INVALID_CHAR,
|
||||
"xmlEncodeEntitiesReentrant : char out of range\n");
|
||||
if (doc != NULL)
|
||||
doc->encoding = xmlStrdup(BAD_CAST "ISO-8859-1");
|
||||
snprintf(buf, sizeof(buf), "&#%d;", *cur);
|
||||
buf[sizeof(buf) - 1] = 0;
|
||||
ptr = buf;
|
||||
while (*ptr != 0) *out++ = *ptr++;
|
||||
cur++;
|
||||
continue;
|
||||
}
|
||||
/*
|
||||
* We could do multiple things here. Just save as a char ref
|
||||
*/
|
||||
if (html)
|
||||
snprintf(buf, sizeof(buf), "&#%d;", val);
|
||||
else
|
||||
snprintf(buf, sizeof(buf), "&#x%X;", val);
|
||||
buf[sizeof(buf) - 1] = 0;
|
||||
ptr = buf;
|
||||
while (*ptr != 0) *out++ = *ptr++;
|
||||
cur += l;
|
||||
continue;
|
||||
}
|
||||
} else if (IS_BYTE_CHAR(*cur)) {
|
||||
char buf[11], *ptr;
|
||||
|
||||
snprintf(buf, sizeof(buf), "&#%d;", *cur);
|
||||
buf[sizeof(buf) - 1] = 0;
|
||||
ptr = buf;
|
||||
while (*ptr != 0) *out++ = *ptr++;
|
||||
}
|
||||
cur++;
|
||||
}
|
||||
*out++ = 0;
|
||||
return(buffer);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlEncodeSpecialChars:
|
||||
* @doc: the document containing the string
|
||||
* @input: A string to convert to XML.
|
||||
*
|
||||
* Do a global encoding of a string, replacing the predefined entities
|
||||
* this routine is reentrant, and result must be deallocated.
|
||||
*
|
||||
* Returns A newly allocated string with the substitution done.
|
||||
*/
|
||||
xmlChar *
|
||||
xmlEncodeSpecialChars(xmlDocPtr doc ATTRIBUTE_UNUSED, const xmlChar *input) {
|
||||
const xmlChar *cur = input;
|
||||
xmlChar *buffer = NULL;
|
||||
xmlChar *out = NULL;
|
||||
int buffer_size = 0;
|
||||
if (input == NULL) return(NULL);
|
||||
|
||||
/*
|
||||
* allocate an translation buffer.
|
||||
*/
|
||||
buffer_size = 1000;
|
||||
buffer = (xmlChar *) xmlMalloc(buffer_size * sizeof(xmlChar));
|
||||
if (buffer == NULL) {
|
||||
xmlEntitiesErrMemory("xmlEncodeSpecialChars: malloc failed");
|
||||
return(NULL);
|
||||
}
|
||||
out = buffer;
|
||||
|
||||
while (*cur != '\0') {
|
||||
if (out - buffer > buffer_size - 10) {
|
||||
intptr_t indx = out - buffer;
|
||||
|
||||
growBufferReentrant();
|
||||
out = &buffer[indx];
|
||||
}
|
||||
|
||||
/*
|
||||
* By default one have to encode at least '<', '>', '"' and '&' !
|
||||
*/
|
||||
if (*cur == '<') {
|
||||
*out++ = '&';
|
||||
*out++ = 'l';
|
||||
*out++ = 't';
|
||||
*out++ = ';';
|
||||
} else if (*cur == '>') {
|
||||
*out++ = '&';
|
||||
*out++ = 'g';
|
||||
*out++ = 't';
|
||||
*out++ = ';';
|
||||
} else if (*cur == '&') {
|
||||
*out++ = '&';
|
||||
*out++ = 'a';
|
||||
*out++ = 'm';
|
||||
*out++ = 'p';
|
||||
*out++ = ';';
|
||||
} else if (*cur == '"') {
|
||||
*out++ = '&';
|
||||
*out++ = 'q';
|
||||
*out++ = 'u';
|
||||
*out++ = 'o';
|
||||
*out++ = 't';
|
||||
*out++ = ';';
|
||||
} else if (*cur == '\r') {
|
||||
*out++ = '&';
|
||||
*out++ = '#';
|
||||
*out++ = '1';
|
||||
*out++ = '3';
|
||||
*out++ = ';';
|
||||
} else {
|
||||
/*
|
||||
* Works because on UTF-8, all extended sequences cannot
|
||||
* result in bytes in the ASCII range.
|
||||
*/
|
||||
*out++ = *cur;
|
||||
}
|
||||
cur++;
|
||||
}
|
||||
*out++ = 0;
|
||||
return(buffer);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlCreateEntitiesTable:
|
||||
*
|
||||
* create and initialize an empty entities hash table.
|
||||
* This really doesn't make sense and should be deprecated
|
||||
*
|
||||
* Returns the xmlEntitiesTablePtr just created or NULL in case of error.
|
||||
*/
|
||||
xmlEntitiesTablePtr
|
||||
xmlCreateEntitiesTable(void) {
|
||||
return((xmlEntitiesTablePtr) xmlHashCreate(0));
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlFreeEntityWrapper:
|
||||
* @entity: An entity
|
||||
* @name: its name
|
||||
*
|
||||
* Deallocate the memory used by an entities in the hash table.
|
||||
*/
|
||||
static void
|
||||
xmlFreeEntityWrapper(xmlEntityPtr entity,
|
||||
const xmlChar *name ATTRIBUTE_UNUSED) {
|
||||
if (entity != NULL)
|
||||
xmlFreeEntity(entity);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlFreeEntitiesTable:
|
||||
* @table: An entity table
|
||||
*
|
||||
* Deallocate the memory used by an entities hash table.
|
||||
*/
|
||||
void
|
||||
xmlFreeEntitiesTable(xmlEntitiesTablePtr table) {
|
||||
xmlHashFree(table, (xmlHashDeallocator) xmlFreeEntityWrapper);
|
||||
}
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/**
|
||||
* xmlCopyEntity:
|
||||
* @ent: An entity
|
||||
*
|
||||
* Build a copy of an entity
|
||||
*
|
||||
* Returns the new xmlEntitiesPtr or NULL in case of error.
|
||||
*/
|
||||
static xmlEntityPtr
|
||||
xmlCopyEntity(xmlEntityPtr ent) {
|
||||
xmlEntityPtr cur;
|
||||
|
||||
cur = (xmlEntityPtr) xmlMalloc(sizeof(xmlEntity));
|
||||
if (cur == NULL) {
|
||||
xmlEntitiesErrMemory("xmlCopyEntity:: malloc failed");
|
||||
return(NULL);
|
||||
}
|
||||
memset(cur, 0, sizeof(xmlEntity));
|
||||
cur->type = XML_ENTITY_DECL;
|
||||
|
||||
cur->etype = ent->etype;
|
||||
if (ent->name != NULL)
|
||||
cur->name = xmlStrdup(ent->name);
|
||||
if (ent->ExternalID != NULL)
|
||||
cur->ExternalID = xmlStrdup(ent->ExternalID);
|
||||
if (ent->SystemID != NULL)
|
||||
cur->SystemID = xmlStrdup(ent->SystemID);
|
||||
if (ent->content != NULL)
|
||||
cur->content = xmlStrdup(ent->content);
|
||||
if (ent->orig != NULL)
|
||||
cur->orig = xmlStrdup(ent->orig);
|
||||
if (ent->URI != NULL)
|
||||
cur->URI = xmlStrdup(ent->URI);
|
||||
return(cur);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlCopyEntitiesTable:
|
||||
* @table: An entity table
|
||||
*
|
||||
* Build a copy of an entity table.
|
||||
*
|
||||
* Returns the new xmlEntitiesTablePtr or NULL in case of error.
|
||||
*/
|
||||
xmlEntitiesTablePtr
|
||||
xmlCopyEntitiesTable(xmlEntitiesTablePtr table) {
|
||||
return(xmlHashCopy(table, (xmlHashCopier) xmlCopyEntity));
|
||||
}
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
#ifdef LIBXML_OUTPUT_ENABLED
|
||||
|
||||
/**
|
||||
* xmlDumpEntityContent:
|
||||
* @buf: An XML buffer.
|
||||
* @content: The entity content.
|
||||
*
|
||||
* This will dump the quoted string value, taking care of the special
|
||||
* treatment required by %
|
||||
*/
|
||||
static void
|
||||
xmlDumpEntityContent(xmlBufferPtr buf, const xmlChar *content) {
|
||||
if (buf->alloc == XML_BUFFER_ALLOC_IMMUTABLE) return;
|
||||
if (xmlStrchr(content, '%')) {
|
||||
const xmlChar * base, *cur;
|
||||
|
||||
xmlBufferCCat(buf, "\"");
|
||||
base = cur = content;
|
||||
while (*cur != 0) {
|
||||
if (*cur == '"') {
|
||||
if (base != cur)
|
||||
xmlBufferAdd(buf, base, cur - base);
|
||||
xmlBufferAdd(buf, BAD_CAST """, 6);
|
||||
cur++;
|
||||
base = cur;
|
||||
} else if (*cur == '%') {
|
||||
if (base != cur)
|
||||
xmlBufferAdd(buf, base, cur - base);
|
||||
xmlBufferAdd(buf, BAD_CAST "%", 6);
|
||||
cur++;
|
||||
base = cur;
|
||||
} else {
|
||||
cur++;
|
||||
}
|
||||
}
|
||||
if (base != cur)
|
||||
xmlBufferAdd(buf, base, cur - base);
|
||||
xmlBufferCCat(buf, "\"");
|
||||
} else {
|
||||
xmlBufferWriteQuotedString(buf, content);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlDumpEntityDecl:
|
||||
* @buf: An XML buffer.
|
||||
* @ent: An entity table
|
||||
*
|
||||
* This will dump the content of the entity table as an XML DTD definition
|
||||
*/
|
||||
void
|
||||
xmlDumpEntityDecl(xmlBufferPtr buf, xmlEntityPtr ent) {
|
||||
if ((buf == NULL) || (ent == NULL)) return;
|
||||
switch (ent->etype) {
|
||||
case XML_INTERNAL_GENERAL_ENTITY:
|
||||
xmlBufferWriteChar(buf, "<!ENTITY ");
|
||||
xmlBufferWriteCHAR(buf, ent->name);
|
||||
xmlBufferWriteChar(buf, " ");
|
||||
if (ent->orig != NULL)
|
||||
xmlBufferWriteQuotedString(buf, ent->orig);
|
||||
else
|
||||
xmlDumpEntityContent(buf, ent->content);
|
||||
xmlBufferWriteChar(buf, ">\n");
|
||||
break;
|
||||
case XML_EXTERNAL_GENERAL_PARSED_ENTITY:
|
||||
xmlBufferWriteChar(buf, "<!ENTITY ");
|
||||
xmlBufferWriteCHAR(buf, ent->name);
|
||||
if (ent->ExternalID != NULL) {
|
||||
xmlBufferWriteChar(buf, " PUBLIC ");
|
||||
xmlBufferWriteQuotedString(buf, ent->ExternalID);
|
||||
xmlBufferWriteChar(buf, " ");
|
||||
xmlBufferWriteQuotedString(buf, ent->SystemID);
|
||||
} else {
|
||||
xmlBufferWriteChar(buf, " SYSTEM ");
|
||||
xmlBufferWriteQuotedString(buf, ent->SystemID);
|
||||
}
|
||||
xmlBufferWriteChar(buf, ">\n");
|
||||
break;
|
||||
case XML_EXTERNAL_GENERAL_UNPARSED_ENTITY:
|
||||
xmlBufferWriteChar(buf, "<!ENTITY ");
|
||||
xmlBufferWriteCHAR(buf, ent->name);
|
||||
if (ent->ExternalID != NULL) {
|
||||
xmlBufferWriteChar(buf, " PUBLIC ");
|
||||
xmlBufferWriteQuotedString(buf, ent->ExternalID);
|
||||
xmlBufferWriteChar(buf, " ");
|
||||
xmlBufferWriteQuotedString(buf, ent->SystemID);
|
||||
} else {
|
||||
xmlBufferWriteChar(buf, " SYSTEM ");
|
||||
xmlBufferWriteQuotedString(buf, ent->SystemID);
|
||||
}
|
||||
if (ent->content != NULL) { /* Should be true ! */
|
||||
xmlBufferWriteChar(buf, " NDATA ");
|
||||
if (ent->orig != NULL)
|
||||
xmlBufferWriteCHAR(buf, ent->orig);
|
||||
else
|
||||
xmlBufferWriteCHAR(buf, ent->content);
|
||||
}
|
||||
xmlBufferWriteChar(buf, ">\n");
|
||||
break;
|
||||
case XML_INTERNAL_PARAMETER_ENTITY:
|
||||
xmlBufferWriteChar(buf, "<!ENTITY % ");
|
||||
xmlBufferWriteCHAR(buf, ent->name);
|
||||
xmlBufferWriteChar(buf, " ");
|
||||
if (ent->orig == NULL)
|
||||
xmlDumpEntityContent(buf, ent->content);
|
||||
else
|
||||
xmlBufferWriteQuotedString(buf, ent->orig);
|
||||
xmlBufferWriteChar(buf, ">\n");
|
||||
break;
|
||||
case XML_EXTERNAL_PARAMETER_ENTITY:
|
||||
xmlBufferWriteChar(buf, "<!ENTITY % ");
|
||||
xmlBufferWriteCHAR(buf, ent->name);
|
||||
if (ent->ExternalID != NULL) {
|
||||
xmlBufferWriteChar(buf, " PUBLIC ");
|
||||
xmlBufferWriteQuotedString(buf, ent->ExternalID);
|
||||
xmlBufferWriteChar(buf, " ");
|
||||
xmlBufferWriteQuotedString(buf, ent->SystemID);
|
||||
} else {
|
||||
xmlBufferWriteChar(buf, " SYSTEM ");
|
||||
xmlBufferWriteQuotedString(buf, ent->SystemID);
|
||||
}
|
||||
xmlBufferWriteChar(buf, ">\n");
|
||||
break;
|
||||
default:
|
||||
xmlEntitiesErr(XML_DTD_UNKNOWN_ENTITY,
|
||||
"xmlDumpEntitiesDecl: internal: unknown type entity type");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlDumpEntityDeclScan:
|
||||
* @ent: An entity table
|
||||
* @buf: An XML buffer.
|
||||
*
|
||||
* When using the hash table scan function, arguments need to be reversed
|
||||
*/
|
||||
static void
|
||||
xmlDumpEntityDeclScan(xmlEntityPtr ent, xmlBufferPtr buf) {
|
||||
xmlDumpEntityDecl(buf, ent);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlDumpEntitiesTable:
|
||||
* @buf: An XML buffer.
|
||||
* @table: An entity table
|
||||
*
|
||||
* This will dump the content of the entity table as an XML DTD definition
|
||||
*/
|
||||
void
|
||||
xmlDumpEntitiesTable(xmlBufferPtr buf, xmlEntitiesTablePtr table) {
|
||||
xmlHashScan(table, (xmlHashScanner)xmlDumpEntityDeclScan, buf);
|
||||
}
|
||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||
#define bottom_entities
|
||||
#include "elfgcchack.h"
|
||||
973
Extras/LibXML/error.c
Normal file
973
Extras/LibXML/error.c
Normal file
@@ -0,0 +1,973 @@
|
||||
/*
|
||||
* error.c: module displaying/handling XML parser errors
|
||||
*
|
||||
* See Copyright for the status of this software.
|
||||
*
|
||||
* Daniel Veillard <daniel@veillard.com>
|
||||
*/
|
||||
|
||||
#define IN_LIBXML
|
||||
#include "libxml.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/xmlerror.h>
|
||||
#include <libxml/xmlmemory.h>
|
||||
#include <libxml/globals.h>
|
||||
|
||||
void xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED,
|
||||
const char *msg,
|
||||
...);
|
||||
|
||||
#define XML_GET_VAR_STR(msg, str) { \
|
||||
int size; \
|
||||
int chars; \
|
||||
char *larger; \
|
||||
va_list ap; \
|
||||
\
|
||||
str = (char *) xmlMalloc(150); \
|
||||
if (str != NULL) { \
|
||||
\
|
||||
size = 150; \
|
||||
\
|
||||
while (1) { \
|
||||
va_start(ap, msg); \
|
||||
chars = vsnprintf(str, size, msg, ap); \
|
||||
va_end(ap); \
|
||||
if ((chars > -1) && (chars < size)) \
|
||||
break; \
|
||||
if (chars > -1) \
|
||||
size += chars + 1; \
|
||||
else \
|
||||
size += 100; \
|
||||
if ((larger = (char *) xmlRealloc(str, size)) == NULL) {\
|
||||
break; \
|
||||
} \
|
||||
str = larger; \
|
||||
}} \
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Handling of out of context errors *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
* xmlGenericErrorDefaultFunc:
|
||||
* @ctx: an error context
|
||||
* @msg: the message to display/transmit
|
||||
* @...: extra parameters for the message display
|
||||
*
|
||||
* Default handler for out of context error messages.
|
||||
*/
|
||||
void
|
||||
xmlGenericErrorDefaultFunc(void *ctx ATTRIBUTE_UNUSED, const char *msg, ...) {
|
||||
va_list args;
|
||||
|
||||
if (xmlGenericErrorContext == NULL)
|
||||
xmlGenericErrorContext = (void *) stderr;
|
||||
|
||||
va_start(args, msg);
|
||||
vfprintf((FILE *)xmlGenericErrorContext, msg, args);
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
/**
|
||||
* initGenericErrorDefaultFunc:
|
||||
* @handler: the handler
|
||||
*
|
||||
* Set or reset (if NULL) the default handler for generic errors
|
||||
* to the builtin error function.
|
||||
*/
|
||||
void
|
||||
initGenericErrorDefaultFunc(xmlGenericErrorFunc * handler)
|
||||
{
|
||||
if (handler == NULL)
|
||||
xmlGenericError = xmlGenericErrorDefaultFunc;
|
||||
else
|
||||
xmlGenericError = (*handler);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlSetGenericErrorFunc:
|
||||
* @ctx: the new error handling context
|
||||
* @handler: the new handler function
|
||||
*
|
||||
* Function to reset the handler and the error context for out of
|
||||
* context error messages.
|
||||
* This simply means that @handler will be called for subsequent
|
||||
* error messages while not parsing nor validating. And @ctx will
|
||||
* be passed as first argument to @handler
|
||||
* One can simply force messages to be emitted to another FILE * than
|
||||
* stderr by setting @ctx to this file handle and @handler to NULL.
|
||||
* For multi-threaded applications, this must be set separately for each thread.
|
||||
*/
|
||||
void
|
||||
xmlSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler) {
|
||||
xmlGenericErrorContext = ctx;
|
||||
if (handler != NULL)
|
||||
xmlGenericError = handler;
|
||||
else
|
||||
xmlGenericError = xmlGenericErrorDefaultFunc;
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlSetStructuredErrorFunc:
|
||||
* @ctx: the new error handling context
|
||||
* @handler: the new handler function
|
||||
*
|
||||
* Function to reset the handler and the error context for out of
|
||||
* context structured error messages.
|
||||
* This simply means that @handler will be called for subsequent
|
||||
* error messages while not parsing nor validating. And @ctx will
|
||||
* be passed as first argument to @handler
|
||||
* For multi-threaded applications, this must be set separately for each thread.
|
||||
*/
|
||||
void
|
||||
xmlSetStructuredErrorFunc(void *ctx, xmlStructuredErrorFunc handler) {
|
||||
xmlGenericErrorContext = ctx;
|
||||
xmlStructuredError = handler;
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Handling of parsing errors *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
* xmlParserPrintFileInfo:
|
||||
* @input: an xmlParserInputPtr input
|
||||
*
|
||||
* Displays the associated file and line informations for the current input
|
||||
*/
|
||||
|
||||
void
|
||||
xmlParserPrintFileInfo(xmlParserInputPtr input) {
|
||||
if (input != NULL) {
|
||||
if (input->filename)
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"%s:%d: ", input->filename,
|
||||
input->line);
|
||||
else
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"Entity: line %d: ", input->line);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlParserPrintFileContext:
|
||||
* @input: an xmlParserInputPtr input
|
||||
*
|
||||
* Displays current context within the input content for error tracking
|
||||
*/
|
||||
|
||||
static void
|
||||
xmlParserPrintFileContextInternal(xmlParserInputPtr input ,
|
||||
xmlGenericErrorFunc channel, void *data ) {
|
||||
const xmlChar *cur, *base;
|
||||
size_t n, col; /* GCC warns if signed, because compared with sizeof() */
|
||||
xmlChar content[81]; /* space for 80 chars + line terminator */
|
||||
xmlChar *ctnt;
|
||||
|
||||
if (input == NULL) return;
|
||||
cur = input->cur;
|
||||
base = input->base;
|
||||
/* skip backwards over any end-of-lines */
|
||||
while ((cur > base) && ((*(cur) == '\n') || (*(cur) == '\r'))) {
|
||||
cur--;
|
||||
}
|
||||
n = 0;
|
||||
/* search backwards for beginning-of-line (to max buff size) */
|
||||
while ((n++ < (sizeof(content)-1)) && (cur > base) &&
|
||||
(*(cur) != '\n') && (*(cur) != '\r'))
|
||||
cur--;
|
||||
if ((*(cur) == '\n') || (*(cur) == '\r')) cur++;
|
||||
/* calculate the error position in terms of the current position */
|
||||
col = input->cur - cur;
|
||||
/* search forward for end-of-line (to max buff size) */
|
||||
n = 0;
|
||||
ctnt = content;
|
||||
/* copy selected text to our buffer */
|
||||
while ((*cur != 0) && (*(cur) != '\n') &&
|
||||
(*(cur) != '\r') && (n < sizeof(content)-1)) {
|
||||
*ctnt++ = *cur++;
|
||||
n++;
|
||||
}
|
||||
*ctnt = 0;
|
||||
/* print out the selected text */
|
||||
channel(data ,"%s\n", content);
|
||||
/* create blank line with problem pointer */
|
||||
n = 0;
|
||||
ctnt = content;
|
||||
/* (leave buffer space for pointer + line terminator) */
|
||||
while ((n<col) && (n++ < sizeof(content)-2) && (*ctnt != 0)) {
|
||||
if (*(ctnt) != '\t')
|
||||
*(ctnt) = ' ';
|
||||
ctnt++;
|
||||
}
|
||||
*ctnt++ = '^';
|
||||
*ctnt = 0;
|
||||
channel(data ,"%s\n", content);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlParserPrintFileContext:
|
||||
* @input: an xmlParserInputPtr input
|
||||
*
|
||||
* Displays current context within the input content for error tracking
|
||||
*/
|
||||
void
|
||||
xmlParserPrintFileContext(xmlParserInputPtr input) {
|
||||
xmlParserPrintFileContextInternal(input, xmlGenericError,
|
||||
xmlGenericErrorContext);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlReportError:
|
||||
* @err: the error
|
||||
* @ctx: the parser context or NULL
|
||||
* @str: the formatted error message
|
||||
*
|
||||
* Report an erro with its context, replace the 4 old error/warning
|
||||
* routines.
|
||||
*/
|
||||
static void
|
||||
xmlReportError(xmlErrorPtr err, xmlParserCtxtPtr ctxt, const char *str,
|
||||
xmlGenericErrorFunc channel, void *data)
|
||||
{
|
||||
char *file = NULL;
|
||||
int line = 0;
|
||||
int code = -1;
|
||||
int domain;
|
||||
const xmlChar *name = NULL;
|
||||
xmlNodePtr node;
|
||||
xmlErrorLevel level;
|
||||
xmlParserInputPtr input = NULL;
|
||||
xmlParserInputPtr cur = NULL;
|
||||
|
||||
if (err == NULL)
|
||||
return;
|
||||
|
||||
if (channel == NULL) {
|
||||
channel = xmlGenericError;
|
||||
data = xmlGenericErrorContext;
|
||||
}
|
||||
file = err->file;
|
||||
line = err->line;
|
||||
code = err->code;
|
||||
domain = err->domain;
|
||||
level = err->level;
|
||||
node = err->node;
|
||||
|
||||
if (code == XML_ERR_OK)
|
||||
return;
|
||||
|
||||
if ((node != NULL) && (node->type == XML_ELEMENT_NODE))
|
||||
name = node->name;
|
||||
|
||||
/*
|
||||
* Maintain the compatibility with the legacy error handling
|
||||
*/
|
||||
if (ctxt != NULL) {
|
||||
input = ctxt->input;
|
||||
if ((input != NULL) && (input->filename == NULL) &&
|
||||
(ctxt->inputNr > 1)) {
|
||||
cur = input;
|
||||
input = ctxt->inputTab[ctxt->inputNr - 2];
|
||||
}
|
||||
if (input != NULL) {
|
||||
if (input->filename)
|
||||
channel(data, "%s:%d: ", input->filename, input->line);
|
||||
else if ((line != 0) && (domain == XML_FROM_PARSER))
|
||||
channel(data, "Entity: line %d: ", input->line);
|
||||
}
|
||||
} else {
|
||||
if (file != NULL)
|
||||
channel(data, "%s:%d: ", file, line);
|
||||
else if ((line != 0) && (domain == XML_FROM_PARSER))
|
||||
channel(data, "Entity: line %d: ", line);
|
||||
}
|
||||
if (name != NULL) {
|
||||
channel(data, "element %s: ", name);
|
||||
}
|
||||
if (code == XML_ERR_OK)
|
||||
return;
|
||||
switch (domain) {
|
||||
case XML_FROM_PARSER:
|
||||
channel(data, "parser ");
|
||||
break;
|
||||
case XML_FROM_NAMESPACE:
|
||||
channel(data, "namespace ");
|
||||
break;
|
||||
case XML_FROM_DTD:
|
||||
case XML_FROM_VALID:
|
||||
channel(data, "validity ");
|
||||
break;
|
||||
case XML_FROM_HTML:
|
||||
channel(data, "HTML parser ");
|
||||
break;
|
||||
case XML_FROM_MEMORY:
|
||||
channel(data, "memory ");
|
||||
break;
|
||||
case XML_FROM_OUTPUT:
|
||||
channel(data, "output ");
|
||||
break;
|
||||
case XML_FROM_IO:
|
||||
channel(data, "I/O ");
|
||||
break;
|
||||
case XML_FROM_XINCLUDE:
|
||||
channel(data, "XInclude ");
|
||||
break;
|
||||
case XML_FROM_XPATH:
|
||||
channel(data, "XPath ");
|
||||
break;
|
||||
case XML_FROM_XPOINTER:
|
||||
channel(data, "parser ");
|
||||
break;
|
||||
case XML_FROM_REGEXP:
|
||||
channel(data, "regexp ");
|
||||
break;
|
||||
case XML_FROM_MODULE:
|
||||
channel(data, "module ");
|
||||
break;
|
||||
case XML_FROM_SCHEMASV:
|
||||
channel(data, "Schemas validity ");
|
||||
break;
|
||||
case XML_FROM_SCHEMASP:
|
||||
channel(data, "Schemas parser ");
|
||||
break;
|
||||
case XML_FROM_RELAXNGP:
|
||||
channel(data, "Relax-NG parser ");
|
||||
break;
|
||||
case XML_FROM_RELAXNGV:
|
||||
channel(data, "Relax-NG validity ");
|
||||
break;
|
||||
case XML_FROM_CATALOG:
|
||||
channel(data, "Catalog ");
|
||||
break;
|
||||
case XML_FROM_C14N:
|
||||
channel(data, "C14N ");
|
||||
break;
|
||||
case XML_FROM_XSLT:
|
||||
channel(data, "XSLT ");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (code == XML_ERR_OK)
|
||||
return;
|
||||
switch (level) {
|
||||
case XML_ERR_NONE:
|
||||
channel(data, ": ");
|
||||
break;
|
||||
case XML_ERR_WARNING:
|
||||
channel(data, "warning : ");
|
||||
break;
|
||||
case XML_ERR_ERROR:
|
||||
channel(data, "error : ");
|
||||
break;
|
||||
case XML_ERR_FATAL:
|
||||
channel(data, "error : ");
|
||||
break;
|
||||
}
|
||||
if (code == XML_ERR_OK)
|
||||
return;
|
||||
if (str != NULL) {
|
||||
intptr_t len;
|
||||
len = xmlStrlen((const xmlChar *)str);
|
||||
if ((len > 0) && (str[len - 1] != '\n'))
|
||||
channel(data, "%s\n", str);
|
||||
else
|
||||
channel(data, "%s", str);
|
||||
} else {
|
||||
channel(data, "%s\n", "out of memory error");
|
||||
}
|
||||
if (code == XML_ERR_OK)
|
||||
return;
|
||||
|
||||
if (ctxt != NULL) {
|
||||
xmlParserPrintFileContextInternal(input, channel, data);
|
||||
if (cur != NULL) {
|
||||
if (cur->filename)
|
||||
channel(data, "%s:%d: \n", cur->filename, cur->line);
|
||||
else if ((line != 0) && (domain == XML_FROM_PARSER))
|
||||
channel(data, "Entity: line %d: \n", cur->line);
|
||||
xmlParserPrintFileContextInternal(cur, channel, data);
|
||||
}
|
||||
}
|
||||
if ((domain == XML_FROM_XPATH) && (err->str1 != NULL) &&
|
||||
(err->int1 < 100) &&
|
||||
(err->int1 < xmlStrlen((const xmlChar *)err->str1))) {
|
||||
xmlChar buf[150];
|
||||
int i;
|
||||
|
||||
channel(data, "%s\n", err->str1);
|
||||
for (i=0;i < err->int1;i++)
|
||||
buf[i] = ' ';
|
||||
buf[i++] = '^';
|
||||
buf[i] = 0;
|
||||
channel(data, "%s\n", buf);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* __xmlRaiseError:
|
||||
* @schannel: the structured callback channel
|
||||
* @channel: the old callback channel
|
||||
* @data: the callback data
|
||||
* @ctx: the parser context or NULL
|
||||
* @ctx: the parser context or NULL
|
||||
* @domain: the domain for the error
|
||||
* @code: the code for the error
|
||||
* @level: the xmlErrorLevel for the error
|
||||
* @file: the file source of the error (or NULL)
|
||||
* @line: the line of the error or 0 if N/A
|
||||
* @str1: extra string info
|
||||
* @str2: extra string info
|
||||
* @str3: extra string info
|
||||
* @int1: extra int info
|
||||
* @col: column number of the error or 0 if N/A
|
||||
* @msg: the message to display/transmit
|
||||
* @...: extra parameters for the message display
|
||||
*
|
||||
* Update the appropriate global or contextual error structure,
|
||||
* then forward the error message down the parser or generic
|
||||
* error callback handler
|
||||
*/
|
||||
void
|
||||
__xmlRaiseError(xmlStructuredErrorFunc schannel,
|
||||
xmlGenericErrorFunc channel, void *data, void *ctx,
|
||||
void *nod, int domain, int code, xmlErrorLevel level,
|
||||
const char *file, int line, const char *str1,
|
||||
const char *str2, const char *str3, int int1, intptr_t col,
|
||||
const char *msg, ...)
|
||||
{
|
||||
xmlParserCtxtPtr ctxt = NULL;
|
||||
xmlNodePtr node = (xmlNodePtr) nod;
|
||||
char *str = NULL;
|
||||
xmlParserInputPtr input = NULL;
|
||||
xmlErrorPtr to = &xmlLastError;
|
||||
xmlNodePtr baseptr = NULL;
|
||||
|
||||
if ((xmlGetWarningsDefaultValue == 0) && (level == XML_ERR_WARNING))
|
||||
return;
|
||||
if ((domain == XML_FROM_PARSER) || (domain == XML_FROM_HTML) ||
|
||||
(domain == XML_FROM_DTD) || (domain == XML_FROM_NAMESPACE) ||
|
||||
(domain == XML_FROM_IO) || (domain == XML_FROM_VALID)) {
|
||||
ctxt = (xmlParserCtxtPtr) ctx;
|
||||
if ((schannel == NULL) && (ctxt != NULL) && (ctxt->sax != NULL) &&
|
||||
(ctxt->sax->initialized == XML_SAX2_MAGIC))
|
||||
schannel = ctxt->sax->serror;
|
||||
}
|
||||
/*
|
||||
* Check if structured error handler set
|
||||
*/
|
||||
if (schannel == NULL) {
|
||||
schannel = xmlStructuredError;
|
||||
/*
|
||||
* if user has defined handler, change data ptr to user's choice
|
||||
*/
|
||||
if (schannel != NULL)
|
||||
data = xmlGenericErrorContext;
|
||||
}
|
||||
if ((domain == XML_FROM_VALID) &&
|
||||
((channel == xmlParserValidityError) ||
|
||||
(channel == xmlParserValidityWarning))) {
|
||||
ctxt = (xmlParserCtxtPtr) ctx;
|
||||
if ((schannel == NULL) && (ctxt != NULL) && (ctxt->sax != NULL) &&
|
||||
(ctxt->sax->initialized == XML_SAX2_MAGIC))
|
||||
schannel = ctxt->sax->serror;
|
||||
}
|
||||
if (code == XML_ERR_OK)
|
||||
return;
|
||||
/*
|
||||
* Formatting the message
|
||||
*/
|
||||
if (msg == NULL) {
|
||||
str = (char *) xmlStrdup(BAD_CAST "No error message provided");
|
||||
} else {
|
||||
XML_GET_VAR_STR(msg, str);
|
||||
}
|
||||
|
||||
/*
|
||||
* specific processing if a parser context is provided
|
||||
*/
|
||||
if (ctxt != NULL) {
|
||||
if (file == NULL) {
|
||||
input = ctxt->input;
|
||||
if ((input != NULL) && (input->filename == NULL) &&
|
||||
(ctxt->inputNr > 1)) {
|
||||
input = ctxt->inputTab[ctxt->inputNr - 2];
|
||||
}
|
||||
if (input != NULL) {
|
||||
file = input->filename;
|
||||
line = input->line;
|
||||
col = input->col;
|
||||
}
|
||||
}
|
||||
to = &ctxt->lastError;
|
||||
} else if ((node != NULL) && (file == NULL)) {
|
||||
int i;
|
||||
|
||||
if ((node->doc != NULL) && (node->doc->URL != NULL))
|
||||
baseptr = node;
|
||||
for (i = 0;
|
||||
((i < 10) && (node != NULL) && (node->type != XML_ELEMENT_NODE));
|
||||
i++)
|
||||
node = node->parent;
|
||||
if ((baseptr == NULL) && (node != NULL) &&
|
||||
(node->doc != NULL) && (node->doc->URL != NULL))
|
||||
baseptr = node;
|
||||
|
||||
if ((node != NULL) && (node->type == XML_ELEMENT_NODE))
|
||||
line = node->line;
|
||||
}
|
||||
|
||||
/*
|
||||
* Save the information about the error
|
||||
*/
|
||||
xmlResetError(to);
|
||||
to->domain = domain;
|
||||
to->code = code;
|
||||
to->message = str;
|
||||
to->level = level;
|
||||
if (file != NULL)
|
||||
to->file = (char *) xmlStrdup((const xmlChar *) file);
|
||||
else if (baseptr != NULL) {
|
||||
#ifdef LIBXML_XINCLUDE_ENABLED
|
||||
/*
|
||||
* We check if the error is within an XInclude section and,
|
||||
* if so, attempt to print out the href of the XInclude instead
|
||||
* of the usual "base" (doc->URL) for the node (bug 152623).
|
||||
*/
|
||||
xmlNodePtr prev = baseptr;
|
||||
int inclcount = 0;
|
||||
while (prev != NULL) {
|
||||
if (prev->prev == NULL)
|
||||
prev = prev->parent;
|
||||
else {
|
||||
prev = prev->prev;
|
||||
if (prev->type == XML_XINCLUDE_START) {
|
||||
if (--inclcount < 0)
|
||||
break;
|
||||
} else if (prev->type == XML_XINCLUDE_END)
|
||||
inclcount++;
|
||||
}
|
||||
}
|
||||
if (prev != NULL) {
|
||||
to->file = (char *) xmlGetProp(prev, BAD_CAST "href");
|
||||
} else
|
||||
#endif
|
||||
to->file = (char *) xmlStrdup(baseptr->doc->URL);
|
||||
file = to->file;
|
||||
}
|
||||
to->line = line;
|
||||
if (str1 != NULL)
|
||||
to->str1 = (char *) xmlStrdup((const xmlChar *) str1);
|
||||
if (str2 != NULL)
|
||||
to->str2 = (char *) xmlStrdup((const xmlChar *) str2);
|
||||
if (str3 != NULL)
|
||||
to->str3 = (char *) xmlStrdup((const xmlChar *) str3);
|
||||
to->int1 = int1;
|
||||
to->int2 = col;
|
||||
to->node = node;
|
||||
to->ctxt = ctx;
|
||||
|
||||
if (to != &xmlLastError)
|
||||
xmlCopyError(to,&xmlLastError);
|
||||
|
||||
/*
|
||||
* Find the callback channel if channel param is NULL
|
||||
*/
|
||||
if ((ctxt != NULL) && (channel == NULL) && (xmlStructuredError == NULL) && (ctxt->sax != NULL)) {
|
||||
if (level == XML_ERR_WARNING)
|
||||
channel = ctxt->sax->warning;
|
||||
else
|
||||
channel = ctxt->sax->error;
|
||||
data = ctxt->userData;
|
||||
} else if (channel == NULL) {
|
||||
if (xmlStructuredError != NULL)
|
||||
schannel = xmlStructuredError;
|
||||
else
|
||||
channel = xmlGenericError;
|
||||
data = xmlGenericErrorContext;
|
||||
}
|
||||
if (schannel != NULL) {
|
||||
schannel(data, to);
|
||||
return;
|
||||
}
|
||||
if (channel == NULL)
|
||||
return;
|
||||
|
||||
if ((channel == xmlParserError) ||
|
||||
(channel == xmlParserWarning) ||
|
||||
(channel == xmlParserValidityError) ||
|
||||
(channel == xmlParserValidityWarning))
|
||||
xmlReportError(to, ctxt, str, NULL, NULL);
|
||||
else if ((channel == (xmlGenericErrorFunc) fprintf) ||
|
||||
(channel == xmlGenericErrorDefaultFunc))
|
||||
xmlReportError(to, ctxt, str, channel, data);
|
||||
else
|
||||
channel(data, "%s", str);
|
||||
}
|
||||
|
||||
/**
|
||||
* __xmlSimpleError:
|
||||
* @domain: where the error comes from
|
||||
* @code: the error code
|
||||
* @node: the context node
|
||||
* @extra: extra informations
|
||||
*
|
||||
* Handle an out of memory condition
|
||||
*/
|
||||
void
|
||||
__xmlSimpleError(int domain, int code, xmlNodePtr node,
|
||||
const char *msg, const char *extra)
|
||||
{
|
||||
|
||||
if (code == XML_ERR_NO_MEMORY) {
|
||||
if (extra)
|
||||
__xmlRaiseError(NULL, NULL, NULL, NULL, node, domain,
|
||||
XML_ERR_NO_MEMORY, XML_ERR_FATAL, NULL, 0, extra,
|
||||
NULL, NULL, 0, 0,
|
||||
"Memory allocation failed : %s\n", extra);
|
||||
else
|
||||
__xmlRaiseError(NULL, NULL, NULL, NULL, node, domain,
|
||||
XML_ERR_NO_MEMORY, XML_ERR_FATAL, NULL, 0, NULL,
|
||||
NULL, NULL, 0, 0, "Memory allocation failed\n");
|
||||
} else {
|
||||
__xmlRaiseError(NULL, NULL, NULL, NULL, node, domain,
|
||||
code, XML_ERR_ERROR, NULL, 0, extra,
|
||||
NULL, NULL, 0, 0, msg, extra);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* xmlParserError:
|
||||
* @ctx: an XML parser context
|
||||
* @msg: the message to display/transmit
|
||||
* @...: extra parameters for the message display
|
||||
*
|
||||
* Display and format an error messages, gives file, line, position and
|
||||
* extra parameters.
|
||||
*/
|
||||
void
|
||||
xmlParserError(void *ctx, const char *msg, ...)
|
||||
{
|
||||
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
|
||||
xmlParserInputPtr input = NULL;
|
||||
xmlParserInputPtr cur = NULL;
|
||||
char * str;
|
||||
|
||||
if (ctxt != NULL) {
|
||||
input = ctxt->input;
|
||||
if ((input != NULL) && (input->filename == NULL) &&
|
||||
(ctxt->inputNr > 1)) {
|
||||
cur = input;
|
||||
input = ctxt->inputTab[ctxt->inputNr - 2];
|
||||
}
|
||||
xmlParserPrintFileInfo(input);
|
||||
}
|
||||
|
||||
xmlGenericError(xmlGenericErrorContext, "error: ");
|
||||
XML_GET_VAR_STR(msg, str);
|
||||
xmlGenericError(xmlGenericErrorContext, "%s", str);
|
||||
if (str != NULL)
|
||||
xmlFree(str);
|
||||
|
||||
if (ctxt != NULL) {
|
||||
xmlParserPrintFileContext(input);
|
||||
if (cur != NULL) {
|
||||
xmlParserPrintFileInfo(cur);
|
||||
xmlGenericError(xmlGenericErrorContext, "\n");
|
||||
xmlParserPrintFileContext(cur);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlParserWarning:
|
||||
* @ctx: an XML parser context
|
||||
* @msg: the message to display/transmit
|
||||
* @...: extra parameters for the message display
|
||||
*
|
||||
* Display and format a warning messages, gives file, line, position and
|
||||
* extra parameters.
|
||||
*/
|
||||
void
|
||||
xmlParserWarning(void *ctx, const char *msg, ...)
|
||||
{
|
||||
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
|
||||
xmlParserInputPtr input = NULL;
|
||||
xmlParserInputPtr cur = NULL;
|
||||
char * str;
|
||||
|
||||
if (ctxt != NULL) {
|
||||
input = ctxt->input;
|
||||
if ((input != NULL) && (input->filename == NULL) &&
|
||||
(ctxt->inputNr > 1)) {
|
||||
cur = input;
|
||||
input = ctxt->inputTab[ctxt->inputNr - 2];
|
||||
}
|
||||
xmlParserPrintFileInfo(input);
|
||||
}
|
||||
|
||||
xmlGenericError(xmlGenericErrorContext, "warning: ");
|
||||
XML_GET_VAR_STR(msg, str);
|
||||
xmlGenericError(xmlGenericErrorContext, "%s", str);
|
||||
if (str != NULL)
|
||||
xmlFree(str);
|
||||
|
||||
if (ctxt != NULL) {
|
||||
xmlParserPrintFileContext(input);
|
||||
if (cur != NULL) {
|
||||
xmlParserPrintFileInfo(cur);
|
||||
xmlGenericError(xmlGenericErrorContext, "\n");
|
||||
xmlParserPrintFileContext(cur);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Handling of validation errors *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
* xmlParserValidityError:
|
||||
* @ctx: an XML parser context
|
||||
* @msg: the message to display/transmit
|
||||
* @...: extra parameters for the message display
|
||||
*
|
||||
* Display and format an validity error messages, gives file,
|
||||
* line, position and extra parameters.
|
||||
*/
|
||||
void
|
||||
xmlParserValidityError(void *ctx, const char *msg, ...)
|
||||
{
|
||||
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
|
||||
xmlParserInputPtr input = NULL;
|
||||
char * str;
|
||||
intptr_t len = xmlStrlen((const xmlChar *) msg);
|
||||
static int had_info = 0;
|
||||
|
||||
if ((len > 1) && (msg[len - 2] != ':')) {
|
||||
if (ctxt != NULL) {
|
||||
input = ctxt->input;
|
||||
if ((input->filename == NULL) && (ctxt->inputNr > 1))
|
||||
input = ctxt->inputTab[ctxt->inputNr - 2];
|
||||
|
||||
if (had_info == 0) {
|
||||
xmlParserPrintFileInfo(input);
|
||||
}
|
||||
}
|
||||
xmlGenericError(xmlGenericErrorContext, "validity error: ");
|
||||
had_info = 0;
|
||||
} else {
|
||||
had_info = 1;
|
||||
}
|
||||
|
||||
XML_GET_VAR_STR(msg, str);
|
||||
xmlGenericError(xmlGenericErrorContext, "%s", str);
|
||||
if (str != NULL)
|
||||
xmlFree(str);
|
||||
|
||||
if ((ctxt != NULL) && (input != NULL)) {
|
||||
xmlParserPrintFileContext(input);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlParserValidityWarning:
|
||||
* @ctx: an XML parser context
|
||||
* @msg: the message to display/transmit
|
||||
* @...: extra parameters for the message display
|
||||
*
|
||||
* Display and format a validity warning messages, gives file, line,
|
||||
* position and extra parameters.
|
||||
*/
|
||||
void
|
||||
xmlParserValidityWarning(void *ctx, const char *msg, ...)
|
||||
{
|
||||
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
|
||||
xmlParserInputPtr input = NULL;
|
||||
char * str;
|
||||
intptr_t len = xmlStrlen((const xmlChar *) msg);
|
||||
|
||||
if ((ctxt != NULL) && (len != 0) && (msg[len - 1] != ':')) {
|
||||
input = ctxt->input;
|
||||
if ((input->filename == NULL) && (ctxt->inputNr > 1))
|
||||
input = ctxt->inputTab[ctxt->inputNr - 2];
|
||||
|
||||
xmlParserPrintFileInfo(input);
|
||||
}
|
||||
|
||||
xmlGenericError(xmlGenericErrorContext, "validity warning: ");
|
||||
XML_GET_VAR_STR(msg, str);
|
||||
xmlGenericError(xmlGenericErrorContext, "%s", str);
|
||||
if (str != NULL)
|
||||
xmlFree(str);
|
||||
|
||||
if (ctxt != NULL) {
|
||||
xmlParserPrintFileContext(input);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Extended Error Handling *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
* xmlGetLastError:
|
||||
*
|
||||
* Get the last global error registered. This is per thread if compiled
|
||||
* with thread support.
|
||||
*
|
||||
* Returns NULL if no error occured or a pointer to the error
|
||||
*/
|
||||
xmlErrorPtr
|
||||
xmlGetLastError(void)
|
||||
{
|
||||
if (xmlLastError.code == XML_ERR_OK)
|
||||
return (NULL);
|
||||
return (&xmlLastError);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlResetError:
|
||||
* @err: pointer to the error.
|
||||
*
|
||||
* Cleanup the error.
|
||||
*/
|
||||
void
|
||||
xmlResetError(xmlErrorPtr err)
|
||||
{
|
||||
if (err == NULL)
|
||||
return;
|
||||
if (err->code == XML_ERR_OK)
|
||||
return;
|
||||
if (err->message != NULL)
|
||||
xmlFree(err->message);
|
||||
if (err->file != NULL)
|
||||
xmlFree(err->file);
|
||||
if (err->str1 != NULL)
|
||||
xmlFree(err->str1);
|
||||
if (err->str2 != NULL)
|
||||
xmlFree(err->str2);
|
||||
if (err->str3 != NULL)
|
||||
xmlFree(err->str3);
|
||||
memset(err, 0, sizeof(xmlError));
|
||||
err->code = XML_ERR_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlResetLastError:
|
||||
*
|
||||
* Cleanup the last global error registered. For parsing error
|
||||
* this does not change the well-formedness result.
|
||||
*/
|
||||
void
|
||||
xmlResetLastError(void)
|
||||
{
|
||||
if (xmlLastError.code == XML_ERR_OK)
|
||||
return;
|
||||
xmlResetError(&xmlLastError);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlCtxtGetLastError:
|
||||
* @ctx: an XML parser context
|
||||
*
|
||||
* Get the last parsing error registered.
|
||||
*
|
||||
* Returns NULL if no error occured or a pointer to the error
|
||||
*/
|
||||
xmlErrorPtr
|
||||
xmlCtxtGetLastError(void *ctx)
|
||||
{
|
||||
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
|
||||
|
||||
if (ctxt == NULL)
|
||||
return (NULL);
|
||||
if (ctxt->lastError.code == XML_ERR_OK)
|
||||
return (NULL);
|
||||
return (&ctxt->lastError);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlCtxtResetLastError:
|
||||
* @ctx: an XML parser context
|
||||
*
|
||||
* Cleanup the last global error registered. For parsing error
|
||||
* this does not change the well-formedness result.
|
||||
*/
|
||||
void
|
||||
xmlCtxtResetLastError(void *ctx)
|
||||
{
|
||||
xmlParserCtxtPtr ctxt = (xmlParserCtxtPtr) ctx;
|
||||
|
||||
if (ctxt == NULL)
|
||||
return;
|
||||
if (ctxt->lastError.code == XML_ERR_OK)
|
||||
return;
|
||||
xmlResetError(&ctxt->lastError);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlCopyError:
|
||||
* @from: a source error
|
||||
* @to: a target error
|
||||
*
|
||||
* Save the original error to the new place.
|
||||
*
|
||||
* Returns 0 in case of success and -1 in case of error.
|
||||
*/
|
||||
int
|
||||
xmlCopyError(xmlErrorPtr from, xmlErrorPtr to) {
|
||||
char *message, *file, *str1, *str2, *str3;
|
||||
|
||||
if ((from == NULL) || (to == NULL))
|
||||
return(-1);
|
||||
|
||||
message = (char *) xmlStrdup((xmlChar *) from->message);
|
||||
file = (char *) xmlStrdup ((xmlChar *) from->file);
|
||||
str1 = (char *) xmlStrdup ((xmlChar *) from->str1);
|
||||
str2 = (char *) xmlStrdup ((xmlChar *) from->str2);
|
||||
str3 = (char *) xmlStrdup ((xmlChar *) from->str3);
|
||||
|
||||
if (to->message != NULL)
|
||||
xmlFree(to->message);
|
||||
if (to->file != NULL)
|
||||
xmlFree(to->file);
|
||||
if (to->str1 != NULL)
|
||||
xmlFree(to->str1);
|
||||
if (to->str2 != NULL)
|
||||
xmlFree(to->str2);
|
||||
if (to->str3 != NULL)
|
||||
xmlFree(to->str3);
|
||||
to->domain = from->domain;
|
||||
to->code = from->code;
|
||||
to->level = from->level;
|
||||
to->line = from->line;
|
||||
to->node = from->node;
|
||||
to->int1 = from->int1;
|
||||
to->int2 = from->int2;
|
||||
to->node = from->node;
|
||||
to->ctxt = from->ctxt;
|
||||
to->message = message;
|
||||
to->file = file;
|
||||
to->str1 = str1;
|
||||
to->str2 = str2;
|
||||
to->str3 = str3;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define bottom_error
|
||||
#include "elfgcchack.h"
|
||||
1094
Extras/LibXML/globals.c
Normal file
1094
Extras/LibXML/globals.c
Normal file
File diff suppressed because it is too large
Load Diff
1079
Extras/LibXML/hash.c
Normal file
1079
Extras/LibXML/hash.c
Normal file
File diff suppressed because it is too large
Load Diff
567
Extras/LibXML/include/Makefile.in
Normal file
567
Extras/LibXML/include/Makefile.in
Normal file
@@ -0,0 +1,567 @@
|
||||
# Makefile.in generated by automake 1.9.2 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
top_builddir = ..
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
INSTALL = @INSTALL@
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
subdir = include
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
|
||||
$(top_srcdir)/configure.in
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
SOURCES =
|
||||
DIST_SOURCES =
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
html-recursive info-recursive install-data-recursive \
|
||||
install-exec-recursive install-info-recursive \
|
||||
install-recursive installcheck-recursive installdirs-recursive \
|
||||
pdf-recursive ps-recursive uninstall-info-recursive \
|
||||
uninstall-recursive
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DIST_SUBDIRS = $(SUBDIRS)
|
||||
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
C14N_OBJ = @C14N_OBJ@
|
||||
CATALOG_OBJ = @CATALOG_OBJ@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
CYGWIN_EXTRA_LDFLAGS = @CYGWIN_EXTRA_LDFLAGS@
|
||||
CYGWIN_EXTRA_PYTHON_LIBADD = @CYGWIN_EXTRA_PYTHON_LIBADD@
|
||||
DEBUG_OBJ = @DEBUG_OBJ@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DOCB_OBJ = @DOCB_OBJ@
|
||||
ECHO = @ECHO@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
FTP_OBJ = @FTP_OBJ@
|
||||
HAVE_ISINF = @HAVE_ISINF@
|
||||
HAVE_ISNAN = @HAVE_ISNAN@
|
||||
HTML_DIR = @HTML_DIR@
|
||||
HTML_OBJ = @HTML_OBJ@
|
||||
HTTP_OBJ = @HTTP_OBJ@
|
||||
ICONV_LIBS = @ICONV_LIBS@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIBXML_MAJOR_VERSION = @LIBXML_MAJOR_VERSION@
|
||||
LIBXML_MICRO_VERSION = @LIBXML_MICRO_VERSION@
|
||||
LIBXML_MINOR_VERSION = @LIBXML_MINOR_VERSION@
|
||||
LIBXML_VERSION = @LIBXML_VERSION@
|
||||
LIBXML_VERSION_EXTRA = @LIBXML_VERSION_EXTRA@
|
||||
LIBXML_VERSION_INFO = @LIBXML_VERSION_INFO@
|
||||
LIBXML_VERSION_NUMBER = @LIBXML_VERSION_NUMBER@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MODULE_EXTENSION = @MODULE_EXTENSION@
|
||||
MODULE_PLATFORM_LIBS = @MODULE_PLATFORM_LIBS@
|
||||
MV = @MV@
|
||||
M_LIBS = @M_LIBS@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
PERL = @PERL@
|
||||
PYTHON = @PYTHON@
|
||||
PYTHON_INCLUDES = @PYTHON_INCLUDES@
|
||||
PYTHON_SITE_PACKAGES = @PYTHON_SITE_PACKAGES@
|
||||
PYTHON_SUBDIR = @PYTHON_SUBDIR@
|
||||
PYTHON_TESTS = @PYTHON_TESTS@
|
||||
PYTHON_VERSION = @PYTHON_VERSION@
|
||||
RANLIB = @RANLIB@
|
||||
RDL_LIBS = @RDL_LIBS@
|
||||
READER_TEST = @READER_TEST@
|
||||
RELDATE = @RELDATE@
|
||||
RM = @RM@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STATIC_BINARIES = @STATIC_BINARIES@
|
||||
STRIP = @STRIP@
|
||||
TAR = @TAR@
|
||||
TEST_C14N = @TEST_C14N@
|
||||
TEST_CATALOG = @TEST_CATALOG@
|
||||
TEST_DEBUG = @TEST_DEBUG@
|
||||
TEST_HTML = @TEST_HTML@
|
||||
TEST_MODULES = @TEST_MODULES@
|
||||
TEST_PATTERN = @TEST_PATTERN@
|
||||
TEST_PHTML = @TEST_PHTML@
|
||||
TEST_PUSH = @TEST_PUSH@
|
||||
TEST_REGEXPS = @TEST_REGEXPS@
|
||||
TEST_SAX = @TEST_SAX@
|
||||
TEST_SCHEMAS = @TEST_SCHEMAS@
|
||||
TEST_THREADS = @TEST_THREADS@
|
||||
TEST_VALID = @TEST_VALID@
|
||||
TEST_VTIME = @TEST_VTIME@
|
||||
TEST_XINCLUDE = @TEST_XINCLUDE@
|
||||
TEST_XPATH = @TEST_XPATH@
|
||||
TEST_XPTR = @TEST_XPTR@
|
||||
THREADS_W32 = @THREADS_W32@
|
||||
THREAD_CFLAGS = @THREAD_CFLAGS@
|
||||
THREAD_LIBS = @THREAD_LIBS@
|
||||
U = @U@
|
||||
VERSION = @VERSION@
|
||||
WIN32_EXTRA_LDFLAGS = @WIN32_EXTRA_LDFLAGS@
|
||||
WIN32_EXTRA_LIBADD = @WIN32_EXTRA_LIBADD@
|
||||
WITH_C14N = @WITH_C14N@
|
||||
WITH_CATALOG = @WITH_CATALOG@
|
||||
WITH_DEBUG = @WITH_DEBUG@
|
||||
WITH_DOCB = @WITH_DOCB@
|
||||
WITH_FTP = @WITH_FTP@
|
||||
WITH_HTML = @WITH_HTML@
|
||||
WITH_HTTP = @WITH_HTTP@
|
||||
WITH_ICONV = @WITH_ICONV@
|
||||
WITH_ISO8859X = @WITH_ISO8859X@
|
||||
WITH_LEGACY = @WITH_LEGACY@
|
||||
WITH_MEM_DEBUG = @WITH_MEM_DEBUG@
|
||||
WITH_MODULES = @WITH_MODULES@
|
||||
WITH_OUTPUT = @WITH_OUTPUT@
|
||||
WITH_PATTERN = @WITH_PATTERN@
|
||||
WITH_PUSH = @WITH_PUSH@
|
||||
WITH_PYTHON_FALSE = @WITH_PYTHON_FALSE@
|
||||
WITH_PYTHON_TRUE = @WITH_PYTHON_TRUE@
|
||||
WITH_READER = @WITH_READER@
|
||||
WITH_REGEXPS = @WITH_REGEXPS@
|
||||
WITH_RUN_DEBUG = @WITH_RUN_DEBUG@
|
||||
WITH_SAX1 = @WITH_SAX1@
|
||||
WITH_SCHEMAS = @WITH_SCHEMAS@
|
||||
WITH_THREADS = @WITH_THREADS@
|
||||
WITH_TREE = @WITH_TREE@
|
||||
WITH_TRIO = @WITH_TRIO@
|
||||
WITH_TRIO_SOURCES_FALSE = @WITH_TRIO_SOURCES_FALSE@
|
||||
WITH_TRIO_SOURCES_TRUE = @WITH_TRIO_SOURCES_TRUE@
|
||||
WITH_VALID = @WITH_VALID@
|
||||
WITH_WRITER = @WITH_WRITER@
|
||||
WITH_XINCLUDE = @WITH_XINCLUDE@
|
||||
WITH_XPATH = @WITH_XPATH@
|
||||
WITH_XPTR = @WITH_XPTR@
|
||||
XINCLUDE_OBJ = @XINCLUDE_OBJ@
|
||||
XMLLINT = @XMLLINT@
|
||||
XML_CFLAGS = @XML_CFLAGS@
|
||||
XML_INCLUDEDIR = @XML_INCLUDEDIR@
|
||||
XML_LIBDIR = @XML_LIBDIR@
|
||||
XML_LIBS = @XML_LIBS@
|
||||
XML_LIBTOOLLIBS = @XML_LIBTOOLLIBS@
|
||||
XPATH_OBJ = @XPATH_OBJ@
|
||||
XPTR_OBJ = @XPTR_OBJ@
|
||||
XSLTPROC = @XSLTPROC@
|
||||
Z_CFLAGS = @Z_CFLAGS@
|
||||
Z_LIBS = @Z_LIBS@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_AS = @ac_ct_AS@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DLLTOOL = @ac_ct_DLLTOOL@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
ac_ct_OBJDUMP = @ac_ct_OBJDUMP@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
datadir = @datadir@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
oldincludedir = @oldincludedir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
pythondir = @pythondir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target_alias = @target_alias@
|
||||
SUBDIRS = libxml
|
||||
EXTRA_DIST = win32config.h wsockcompat.h
|
||||
all: all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \
|
||||
cd $(top_srcdir) && \
|
||||
$(AUTOMAKE) --gnu include/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool
|
||||
uninstall-info-am:
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@set fnord $$MAKEFLAGS; amf=$$2; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
mostlyclean-recursive clean-recursive distclean-recursive \
|
||||
maintainer-clean-recursive:
|
||||
@set fnord $$MAKEFLAGS; amf=$$2; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$tags $$unique; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$tags $$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& cd $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) $$here
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
case $$file in \
|
||||
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
|
||||
esac; \
|
||||
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
|
||||
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
|
||||
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
|
||||
dir="/$$dir"; \
|
||||
$(mkdir_p) "$(distdir)$$dir"; \
|
||||
else \
|
||||
dir=''; \
|
||||
fi; \
|
||||
if test -d $$d/$$file; then \
|
||||
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
|
||||
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
|
||||
fi; \
|
||||
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d "$(distdir)/$$subdir" \
|
||||
|| $(mkdir_p) "$(distdir)/$$subdir" \
|
||||
|| exit 1; \
|
||||
distdir=`$(am__cd) $(distdir) && pwd`; \
|
||||
top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
|
||||
(cd $$subdir && \
|
||||
$(MAKE) $(AM_MAKEFLAGS) \
|
||||
top_distdir="$$top_distdir" \
|
||||
distdir="$$distdir/$$subdir" \
|
||||
distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-recursive
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-libtool \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-exec-am:
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-man:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-info-am
|
||||
|
||||
uninstall-info: uninstall-info-recursive
|
||||
|
||||
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
|
||||
clean clean-generic clean-libtool clean-recursive ctags \
|
||||
ctags-recursive distclean distclean-generic distclean-libtool \
|
||||
distclean-recursive distclean-tags distdir dvi dvi-am html \
|
||||
html-am info info-am install install-am install-data \
|
||||
install-data-am install-exec install-exec-am install-info \
|
||||
install-info-am install-man install-strip installcheck \
|
||||
installcheck-am installdirs installdirs-am maintainer-clean \
|
||||
maintainer-clean-generic maintainer-clean-recursive \
|
||||
mostlyclean mostlyclean-generic mostlyclean-libtool \
|
||||
mostlyclean-recursive pdf pdf-am ps ps-am tags tags-recursive \
|
||||
uninstall uninstall-am uninstall-info-am
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
||||
96
Extras/LibXML/include/libxml/DOCBparser.h
Normal file
96
Extras/LibXML/include/libxml/DOCBparser.h
Normal file
@@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Summary: old DocBook SGML parser
|
||||
* Description: interface for a DocBook SGML non-verifying parser
|
||||
* This code is DEPRECATED, and should not be used anymore.
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __DOCB_PARSER_H__
|
||||
#define __DOCB_PARSER_H__
|
||||
#include <libxml/xmlversion.h>
|
||||
|
||||
#ifdef LIBXML_DOCB_ENABLED
|
||||
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/parserInternals.h>
|
||||
|
||||
#ifndef IN_LIBXML
|
||||
#ifdef __GNUC__
|
||||
#warning "The DOCBparser module has been deprecated in libxml2-2.6.0"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Most of the back-end structures from XML and SGML are shared.
|
||||
*/
|
||||
typedef xmlParserCtxt docbParserCtxt;
|
||||
typedef xmlParserCtxtPtr docbParserCtxtPtr;
|
||||
typedef xmlSAXHandler docbSAXHandler;
|
||||
typedef xmlSAXHandlerPtr docbSAXHandlerPtr;
|
||||
typedef xmlParserInput docbParserInput;
|
||||
typedef xmlParserInputPtr docbParserInputPtr;
|
||||
typedef xmlDocPtr docbDocPtr;
|
||||
|
||||
/*
|
||||
* There is only few public functions.
|
||||
*/
|
||||
XMLPUBFUN int XMLCALL
|
||||
docbEncodeEntities(unsigned char *out,
|
||||
int *outlen,
|
||||
const unsigned char *in,
|
||||
int *inlen, int quoteChar);
|
||||
|
||||
XMLPUBFUN docbDocPtr XMLCALL
|
||||
docbSAXParseDoc (xmlChar *cur,
|
||||
const char *encoding,
|
||||
docbSAXHandlerPtr sax,
|
||||
void *userData);
|
||||
XMLPUBFUN docbDocPtr XMLCALL
|
||||
docbParseDoc (xmlChar *cur,
|
||||
const char *encoding);
|
||||
XMLPUBFUN docbDocPtr XMLCALL
|
||||
docbSAXParseFile (const char *filename,
|
||||
const char *encoding,
|
||||
docbSAXHandlerPtr sax,
|
||||
void *userData);
|
||||
XMLPUBFUN docbDocPtr XMLCALL
|
||||
docbParseFile (const char *filename,
|
||||
const char *encoding);
|
||||
|
||||
/**
|
||||
* Interfaces for the Push mode.
|
||||
*/
|
||||
XMLPUBFUN void XMLCALL
|
||||
docbFreeParserCtxt (docbParserCtxtPtr ctxt);
|
||||
XMLPUBFUN docbParserCtxtPtr XMLCALL
|
||||
docbCreatePushParserCtxt(docbSAXHandlerPtr sax,
|
||||
void *user_data,
|
||||
const char *chunk,
|
||||
int size,
|
||||
const char *filename,
|
||||
xmlCharEncoding enc);
|
||||
XMLPUBFUN int XMLCALL
|
||||
docbParseChunk (docbParserCtxtPtr ctxt,
|
||||
const char *chunk,
|
||||
int size,
|
||||
int terminate);
|
||||
XMLPUBFUN docbParserCtxtPtr XMLCALL
|
||||
docbCreateFileParserCtxt(const char *filename,
|
||||
const char *encoding);
|
||||
XMLPUBFUN int XMLCALL
|
||||
docbParseDocument (docbParserCtxtPtr ctxt);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LIBXML_DOCB_ENABLED */
|
||||
|
||||
#endif /* __DOCB_PARSER_H__ */
|
||||
298
Extras/LibXML/include/libxml/HTMLparser.h
Normal file
298
Extras/LibXML/include/libxml/HTMLparser.h
Normal file
@@ -0,0 +1,298 @@
|
||||
/*
|
||||
* Summary: interface for an HTML 4.0 non-verifying parser
|
||||
* Description: this module implements an HTML 4.0 non-verifying parser
|
||||
* with API compatible with the XML parser ones. It should
|
||||
* be able to parse "real world" HTML, even if severely
|
||||
* broken from a specification point of view.
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __HTML_PARSER_H__
|
||||
#define __HTML_PARSER_H__
|
||||
#include <libxml/xmlversion.h>
|
||||
#include <libxml/parser.h>
|
||||
|
||||
#ifdef LIBXML_HTML_ENABLED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Most of the back-end structures from XML and HTML are shared.
|
||||
*/
|
||||
typedef xmlParserCtxt htmlParserCtxt;
|
||||
typedef xmlParserCtxtPtr htmlParserCtxtPtr;
|
||||
typedef xmlParserNodeInfo htmlParserNodeInfo;
|
||||
typedef xmlSAXHandler htmlSAXHandler;
|
||||
typedef xmlSAXHandlerPtr htmlSAXHandlerPtr;
|
||||
typedef xmlParserInput htmlParserInput;
|
||||
typedef xmlParserInputPtr htmlParserInputPtr;
|
||||
typedef xmlDocPtr htmlDocPtr;
|
||||
typedef xmlNodePtr htmlNodePtr;
|
||||
|
||||
/*
|
||||
* Internal description of an HTML element, representing HTML 4.01
|
||||
* and XHTML 1.0 (which share the same structure).
|
||||
*/
|
||||
typedef struct _htmlElemDesc htmlElemDesc;
|
||||
typedef htmlElemDesc *htmlElemDescPtr;
|
||||
struct _htmlElemDesc {
|
||||
const char *name; /* The tag name */
|
||||
char startTag; /* Whether the start tag can be implied */
|
||||
char endTag; /* Whether the end tag can be implied */
|
||||
char saveEndTag; /* Whether the end tag should be saved */
|
||||
char empty; /* Is this an empty element ? */
|
||||
char depr; /* Is this a deprecated element ? */
|
||||
char dtd; /* 1: only in Loose DTD, 2: only Frameset one */
|
||||
char isinline; /* is this a block 0 or inline 1 element */
|
||||
const char *desc; /* the description */
|
||||
|
||||
/* NRK Jan.2003
|
||||
* New fields encapsulating HTML structure
|
||||
*
|
||||
* Bugs:
|
||||
* This is a very limited representation. It fails to tell us when
|
||||
* an element *requires* subelements (we only have whether they're
|
||||
* allowed or not), and it doesn't tell us where CDATA and PCDATA
|
||||
* are allowed. Some element relationships are not fully represented:
|
||||
* these are flagged with the word MODIFIER
|
||||
*/
|
||||
const char** subelts; /* allowed sub-elements of this element */
|
||||
const char* defaultsubelt; /* subelement for suggested auto-repair
|
||||
if necessary or NULL */
|
||||
const char** attrs_opt; /* Optional Attributes */
|
||||
const char** attrs_depr; /* Additional deprecated attributes */
|
||||
const char** attrs_req; /* Required attributes */
|
||||
};
|
||||
|
||||
/*
|
||||
* Internal description of an HTML entity.
|
||||
*/
|
||||
typedef struct _htmlEntityDesc htmlEntityDesc;
|
||||
typedef htmlEntityDesc *htmlEntityDescPtr;
|
||||
struct _htmlEntityDesc {
|
||||
unsigned int value; /* the UNICODE value for the character */
|
||||
const char *name; /* The entity name */
|
||||
const char *desc; /* the description */
|
||||
};
|
||||
|
||||
/*
|
||||
* There is only few public functions.
|
||||
*/
|
||||
XMLPUBFUN const htmlElemDesc * XMLCALL
|
||||
htmlTagLookup (const xmlChar *tag);
|
||||
XMLPUBFUN const htmlEntityDesc * XMLCALL
|
||||
htmlEntityLookup(const xmlChar *name);
|
||||
XMLPUBFUN const htmlEntityDesc * XMLCALL
|
||||
htmlEntityValueLookup(unsigned int value);
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
htmlIsAutoClosed(htmlDocPtr doc,
|
||||
htmlNodePtr elem);
|
||||
XMLPUBFUN int XMLCALL
|
||||
htmlAutoCloseTag(htmlDocPtr doc,
|
||||
const xmlChar *name,
|
||||
htmlNodePtr elem);
|
||||
XMLPUBFUN const htmlEntityDesc * XMLCALL
|
||||
htmlParseEntityRef(htmlParserCtxtPtr ctxt,
|
||||
const xmlChar **str);
|
||||
XMLPUBFUN int XMLCALL
|
||||
htmlParseCharRef(htmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL
|
||||
htmlParseElement(htmlParserCtxtPtr ctxt);
|
||||
|
||||
XMLPUBFUN htmlParserCtxtPtr XMLCALL
|
||||
htmlCreateMemoryParserCtxt(const char *buffer,
|
||||
int size);
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
htmlParseDocument(htmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN htmlDocPtr XMLCALL
|
||||
htmlSAXParseDoc (xmlChar *cur,
|
||||
const char *encoding,
|
||||
htmlSAXHandlerPtr sax,
|
||||
void *userData);
|
||||
XMLPUBFUN htmlDocPtr XMLCALL
|
||||
htmlParseDoc (xmlChar *cur,
|
||||
const char *encoding);
|
||||
XMLPUBFUN htmlDocPtr XMLCALL
|
||||
htmlSAXParseFile(const char *filename,
|
||||
const char *encoding,
|
||||
htmlSAXHandlerPtr sax,
|
||||
void *userData);
|
||||
XMLPUBFUN htmlDocPtr XMLCALL
|
||||
htmlParseFile (const char *filename,
|
||||
const char *encoding);
|
||||
XMLPUBFUN int XMLCALL
|
||||
UTF8ToHtml (unsigned char *out,
|
||||
int *outlen,
|
||||
const unsigned char *in,
|
||||
int *inlen);
|
||||
XMLPUBFUN int XMLCALL
|
||||
htmlEncodeEntities(unsigned char *out,
|
||||
int *outlen,
|
||||
const unsigned char *in,
|
||||
int *inlen, int quoteChar);
|
||||
XMLPUBFUN int XMLCALL
|
||||
htmlIsScriptAttribute(const xmlChar *name);
|
||||
XMLPUBFUN int XMLCALL
|
||||
htmlHandleOmittedElem(int val);
|
||||
|
||||
#ifdef LIBXML_PUSH_ENABLED
|
||||
/**
|
||||
* Interfaces for the Push mode.
|
||||
*/
|
||||
XMLPUBFUN htmlParserCtxtPtr XMLCALL
|
||||
htmlCreatePushParserCtxt(htmlSAXHandlerPtr sax,
|
||||
void *user_data,
|
||||
const char *chunk,
|
||||
int size,
|
||||
const char *filename,
|
||||
xmlCharEncoding enc);
|
||||
XMLPUBFUN int XMLCALL
|
||||
htmlParseChunk (htmlParserCtxtPtr ctxt,
|
||||
const char *chunk,
|
||||
int size,
|
||||
int terminate);
|
||||
#endif /* LIBXML_PUSH_ENABLED */
|
||||
|
||||
XMLPUBFUN void XMLCALL
|
||||
htmlFreeParserCtxt (htmlParserCtxtPtr ctxt);
|
||||
|
||||
/*
|
||||
* New set of simpler/more flexible APIs
|
||||
*/
|
||||
/**
|
||||
* xmlParserOption:
|
||||
*
|
||||
* This is the set of XML parser options that can be passed down
|
||||
* to the xmlReadDoc() and similar calls.
|
||||
*/
|
||||
typedef enum {
|
||||
HTML_PARSE_NOERROR = 1<<5, /* suppress error reports */
|
||||
HTML_PARSE_NOWARNING= 1<<6, /* suppress warning reports */
|
||||
HTML_PARSE_PEDANTIC = 1<<7, /* pedantic error reporting */
|
||||
HTML_PARSE_NOBLANKS = 1<<8, /* remove blank nodes */
|
||||
HTML_PARSE_NONET = 1<<11 /* Forbid network access */
|
||||
} htmlParserOption;
|
||||
|
||||
XMLPUBFUN void XMLCALL
|
||||
htmlCtxtReset (htmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN int XMLCALL
|
||||
htmlCtxtUseOptions (htmlParserCtxtPtr ctxt,
|
||||
int options);
|
||||
XMLPUBFUN htmlDocPtr XMLCALL
|
||||
htmlReadDoc (const xmlChar *cur,
|
||||
const char *URL,
|
||||
const char *encoding,
|
||||
int options);
|
||||
XMLPUBFUN htmlDocPtr XMLCALL
|
||||
htmlReadFile (const char *URL,
|
||||
const char *encoding,
|
||||
int options);
|
||||
XMLPUBFUN htmlDocPtr XMLCALL
|
||||
htmlReadMemory (const char *buffer,
|
||||
int size,
|
||||
const char *URL,
|
||||
const char *encoding,
|
||||
int options);
|
||||
XMLPUBFUN htmlDocPtr XMLCALL
|
||||
htmlReadFd (int fd,
|
||||
const char *URL,
|
||||
const char *encoding,
|
||||
int options);
|
||||
XMLPUBFUN htmlDocPtr XMLCALL
|
||||
htmlReadIO (xmlInputReadCallback ioread,
|
||||
xmlInputCloseCallback ioclose,
|
||||
void *ioctx,
|
||||
const char *URL,
|
||||
const char *encoding,
|
||||
int options);
|
||||
XMLPUBFUN htmlDocPtr XMLCALL
|
||||
htmlCtxtReadDoc (xmlParserCtxtPtr ctxt,
|
||||
const xmlChar *cur,
|
||||
const char *URL,
|
||||
const char *encoding,
|
||||
int options);
|
||||
XMLPUBFUN htmlDocPtr XMLCALL
|
||||
htmlCtxtReadFile (xmlParserCtxtPtr ctxt,
|
||||
const char *filename,
|
||||
const char *encoding,
|
||||
int options);
|
||||
XMLPUBFUN htmlDocPtr XMLCALL
|
||||
htmlCtxtReadMemory (xmlParserCtxtPtr ctxt,
|
||||
const char *buffer,
|
||||
int size,
|
||||
const char *URL,
|
||||
const char *encoding,
|
||||
int options);
|
||||
XMLPUBFUN htmlDocPtr XMLCALL
|
||||
htmlCtxtReadFd (xmlParserCtxtPtr ctxt,
|
||||
int fd,
|
||||
const char *URL,
|
||||
const char *encoding,
|
||||
int options);
|
||||
XMLPUBFUN htmlDocPtr XMLCALL
|
||||
htmlCtxtReadIO (xmlParserCtxtPtr ctxt,
|
||||
xmlInputReadCallback ioread,
|
||||
xmlInputCloseCallback ioclose,
|
||||
void *ioctx,
|
||||
const char *URL,
|
||||
const char *encoding,
|
||||
int options);
|
||||
|
||||
/* NRK/Jan2003: further knowledge of HTML structure
|
||||
*/
|
||||
typedef enum {
|
||||
HTML_NA = 0 , /* something we don't check at all */
|
||||
HTML_INVALID = 0x1 ,
|
||||
HTML_DEPRECATED = 0x2 ,
|
||||
HTML_VALID = 0x4 ,
|
||||
HTML_REQUIRED = 0xc /* VALID bit set so ( & HTML_VALID ) is TRUE */
|
||||
} htmlStatus ;
|
||||
|
||||
/* Using htmlElemDesc rather than name here, to emphasise the fact
|
||||
that otherwise there's a lookup overhead
|
||||
*/
|
||||
XMLPUBFUN htmlStatus XMLCALL htmlAttrAllowed(const htmlElemDesc*, const xmlChar*, int) ;
|
||||
XMLPUBFUN int XMLCALL htmlElementAllowedHere(const htmlElemDesc*, const xmlChar*) ;
|
||||
XMLPUBFUN htmlStatus XMLCALL htmlElementStatusHere(const htmlElemDesc*, const htmlElemDesc*) ;
|
||||
XMLPUBFUN htmlStatus XMLCALL htmlNodeStatus(const htmlNodePtr, int) ;
|
||||
/**
|
||||
* htmlDefaultSubelement:
|
||||
* @elt: HTML element
|
||||
*
|
||||
* Returns the default subelement for this element
|
||||
*/
|
||||
#define htmlDefaultSubelement(elt) elt->defaultsubelt
|
||||
/**
|
||||
* htmlElementAllowedHereDesc:
|
||||
* @parent: HTML parent element
|
||||
* @elt: HTML element
|
||||
*
|
||||
* Checks whether an HTML element description may be a
|
||||
* direct child of the specified element.
|
||||
*
|
||||
* Returns 1 if allowed; 0 otherwise.
|
||||
*/
|
||||
#define htmlElementAllowedHereDesc(parent,elt) \
|
||||
htmlElementAllowedHere((parent), (elt)->name)
|
||||
/**
|
||||
* htmlRequiredAttrs:
|
||||
* @elt: HTML element
|
||||
*
|
||||
* Returns the attributes required for the specified element.
|
||||
*/
|
||||
#define htmlRequiredAttrs(elt) (elt)->attrs_req
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LIBXML_HTML_ENABLED */
|
||||
#endif /* __HTML_PARSER_H__ */
|
||||
142
Extras/LibXML/include/libxml/HTMLtree.h
Normal file
142
Extras/LibXML/include/libxml/HTMLtree.h
Normal file
@@ -0,0 +1,142 @@
|
||||
/*
|
||||
* Summary: specific APIs to process HTML tree, especially serialization
|
||||
* Description: this module implements a few function needed to process
|
||||
* tree in an HTML specific way.
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __HTML_TREE_H__
|
||||
#define __HTML_TREE_H__
|
||||
|
||||
#include <stdio.h>
|
||||
#include <libxml/xmlversion.h>
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/HTMLparser.h>
|
||||
|
||||
#ifdef LIBXML_HTML_ENABLED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* HTML_TEXT_NODE:
|
||||
*
|
||||
* Macro. A text node in a HTML document is really implemented
|
||||
* the same way as a text node in an XML document.
|
||||
*/
|
||||
#define HTML_TEXT_NODE XML_TEXT_NODE
|
||||
/**
|
||||
* HTML_ENTITY_REF_NODE:
|
||||
*
|
||||
* Macro. An entity reference in a HTML document is really implemented
|
||||
* the same way as an entity reference in an XML document.
|
||||
*/
|
||||
#define HTML_ENTITY_REF_NODE XML_ENTITY_REF_NODE
|
||||
/**
|
||||
* HTML_COMMENT_NODE:
|
||||
*
|
||||
* Macro. A comment in a HTML document is really implemented
|
||||
* the same way as a comment in an XML document.
|
||||
*/
|
||||
#define HTML_COMMENT_NODE XML_COMMENT_NODE
|
||||
/**
|
||||
* HTML_PRESERVE_NODE:
|
||||
*
|
||||
* Macro. A preserved node in a HTML document is really implemented
|
||||
* the same way as a CDATA section in an XML document.
|
||||
*/
|
||||
#define HTML_PRESERVE_NODE XML_CDATA_SECTION_NODE
|
||||
/**
|
||||
* HTML_PI_NODE:
|
||||
*
|
||||
* Macro. A processing instruction in a HTML document is really implemented
|
||||
* the same way as a processing instruction in an XML document.
|
||||
*/
|
||||
#define HTML_PI_NODE XML_PI_NODE
|
||||
|
||||
XMLPUBFUN htmlDocPtr XMLCALL
|
||||
htmlNewDoc (const xmlChar *URI,
|
||||
const xmlChar *ExternalID);
|
||||
XMLPUBFUN htmlDocPtr XMLCALL
|
||||
htmlNewDocNoDtD (const xmlChar *URI,
|
||||
const xmlChar *ExternalID);
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
htmlGetMetaEncoding (htmlDocPtr doc);
|
||||
XMLPUBFUN int XMLCALL
|
||||
htmlSetMetaEncoding (htmlDocPtr doc,
|
||||
const xmlChar *encoding);
|
||||
#ifdef LIBXML_OUTPUT_ENABLED
|
||||
XMLPUBFUN void XMLCALL
|
||||
htmlDocDumpMemory (xmlDocPtr cur,
|
||||
xmlChar **mem,
|
||||
int *size);
|
||||
XMLPUBFUN int XMLCALL
|
||||
htmlDocDump (FILE *f,
|
||||
xmlDocPtr cur);
|
||||
XMLPUBFUN int XMLCALL
|
||||
htmlSaveFile (const char *filename,
|
||||
xmlDocPtr cur);
|
||||
XMLPUBFUN int XMLCALL
|
||||
htmlNodeDump (xmlBufferPtr buf,
|
||||
xmlDocPtr doc,
|
||||
xmlNodePtr cur);
|
||||
XMLPUBFUN void XMLCALL
|
||||
htmlNodeDumpFile (FILE *out,
|
||||
xmlDocPtr doc,
|
||||
xmlNodePtr cur);
|
||||
XMLPUBFUN int XMLCALL
|
||||
htmlNodeDumpFileFormat (FILE *out,
|
||||
xmlDocPtr doc,
|
||||
xmlNodePtr cur,
|
||||
const char *encoding,
|
||||
int format);
|
||||
XMLPUBFUN int XMLCALL
|
||||
htmlSaveFileEnc (const char *filename,
|
||||
xmlDocPtr cur,
|
||||
const char *encoding);
|
||||
XMLPUBFUN int XMLCALL
|
||||
htmlSaveFileFormat (const char *filename,
|
||||
xmlDocPtr cur,
|
||||
const char *encoding,
|
||||
int format);
|
||||
|
||||
XMLPUBFUN void XMLCALL
|
||||
htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf,
|
||||
xmlDocPtr doc,
|
||||
xmlNodePtr cur,
|
||||
const char *encoding,
|
||||
int format);
|
||||
XMLPUBFUN void XMLCALL
|
||||
htmlDocContentDumpOutput(xmlOutputBufferPtr buf,
|
||||
xmlDocPtr cur,
|
||||
const char *encoding);
|
||||
XMLPUBFUN void XMLCALL
|
||||
htmlDocContentDumpFormatOutput(xmlOutputBufferPtr buf,
|
||||
xmlDocPtr cur,
|
||||
const char *encoding,
|
||||
int format);
|
||||
XMLPUBFUN void XMLCALL
|
||||
htmlNodeDumpOutput (xmlOutputBufferPtr buf,
|
||||
xmlDocPtr doc,
|
||||
xmlNodePtr cur,
|
||||
const char *encoding);
|
||||
|
||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
htmlIsBooleanAttr (const xmlChar *name);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LIBXML_HTML_ENABLED */
|
||||
|
||||
#endif /* __HTML_TREE_H__ */
|
||||
|
||||
173
Extras/LibXML/include/libxml/SAX.h
Normal file
173
Extras/LibXML/include/libxml/SAX.h
Normal file
@@ -0,0 +1,173 @@
|
||||
/*
|
||||
* Summary: Old SAX version 1 handler, deprecated
|
||||
* Description: DEPRECATED set of SAX version 1 interfaces used to
|
||||
* build the DOM tree.
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __XML_SAX_H__
|
||||
#define __XML_SAX_H__
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <libxml/xmlversion.h>
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/xlink.h>
|
||||
|
||||
#ifdef LIBXML_LEGACY_ENABLED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
getPublicId (void *ctx);
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
getSystemId (void *ctx);
|
||||
XMLPUBFUN void XMLCALL
|
||||
setDocumentLocator (void *ctx,
|
||||
xmlSAXLocatorPtr loc);
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
getLineNumber (void *ctx);
|
||||
XMLPUBFUN int XMLCALL
|
||||
getColumnNumber (void *ctx);
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
isStandalone (void *ctx);
|
||||
XMLPUBFUN int XMLCALL
|
||||
hasInternalSubset (void *ctx);
|
||||
XMLPUBFUN int XMLCALL
|
||||
hasExternalSubset (void *ctx);
|
||||
|
||||
XMLPUBFUN void XMLCALL
|
||||
internalSubset (void *ctx,
|
||||
const xmlChar *name,
|
||||
const xmlChar *ExternalID,
|
||||
const xmlChar *SystemID);
|
||||
XMLPUBFUN void XMLCALL
|
||||
externalSubset (void *ctx,
|
||||
const xmlChar *name,
|
||||
const xmlChar *ExternalID,
|
||||
const xmlChar *SystemID);
|
||||
XMLPUBFUN xmlEntityPtr XMLCALL
|
||||
getEntity (void *ctx,
|
||||
const xmlChar *name);
|
||||
XMLPUBFUN xmlEntityPtr XMLCALL
|
||||
getParameterEntity (void *ctx,
|
||||
const xmlChar *name);
|
||||
XMLPUBFUN xmlParserInputPtr XMLCALL
|
||||
resolveEntity (void *ctx,
|
||||
const xmlChar *publicId,
|
||||
const xmlChar *systemId);
|
||||
|
||||
XMLPUBFUN void XMLCALL
|
||||
entityDecl (void *ctx,
|
||||
const xmlChar *name,
|
||||
int type,
|
||||
const xmlChar *publicId,
|
||||
const xmlChar *systemId,
|
||||
xmlChar *content);
|
||||
XMLPUBFUN void XMLCALL
|
||||
attributeDecl (void *ctx,
|
||||
const xmlChar *elem,
|
||||
const xmlChar *fullname,
|
||||
int type,
|
||||
int def,
|
||||
const xmlChar *defaultValue,
|
||||
xmlEnumerationPtr tree);
|
||||
XMLPUBFUN void XMLCALL
|
||||
elementDecl (void *ctx,
|
||||
const xmlChar *name,
|
||||
int type,
|
||||
xmlElementContentPtr content);
|
||||
XMLPUBFUN void XMLCALL
|
||||
notationDecl (void *ctx,
|
||||
const xmlChar *name,
|
||||
const xmlChar *publicId,
|
||||
const xmlChar *systemId);
|
||||
XMLPUBFUN void XMLCALL
|
||||
unparsedEntityDecl (void *ctx,
|
||||
const xmlChar *name,
|
||||
const xmlChar *publicId,
|
||||
const xmlChar *systemId,
|
||||
const xmlChar *notationName);
|
||||
|
||||
XMLPUBFUN void XMLCALL
|
||||
startDocument (void *ctx);
|
||||
XMLPUBFUN void XMLCALL
|
||||
endDocument (void *ctx);
|
||||
XMLPUBFUN void XMLCALL
|
||||
attribute (void *ctx,
|
||||
const xmlChar *fullname,
|
||||
const xmlChar *value);
|
||||
XMLPUBFUN void XMLCALL
|
||||
startElement (void *ctx,
|
||||
const xmlChar *fullname,
|
||||
const xmlChar **atts);
|
||||
XMLPUBFUN void XMLCALL
|
||||
endElement (void *ctx,
|
||||
const xmlChar *name);
|
||||
XMLPUBFUN void XMLCALL
|
||||
reference (void *ctx,
|
||||
const xmlChar *name);
|
||||
XMLPUBFUN void XMLCALL
|
||||
characters (void *ctx,
|
||||
const xmlChar *ch,
|
||||
int len);
|
||||
XMLPUBFUN void XMLCALL
|
||||
ignorableWhitespace (void *ctx,
|
||||
const xmlChar *ch,
|
||||
int len);
|
||||
XMLPUBFUN void XMLCALL
|
||||
processingInstruction (void *ctx,
|
||||
const xmlChar *target,
|
||||
const xmlChar *data);
|
||||
XMLPUBFUN void XMLCALL
|
||||
globalNamespace (void *ctx,
|
||||
const xmlChar *href,
|
||||
const xmlChar *prefix);
|
||||
XMLPUBFUN void XMLCALL
|
||||
setNamespace (void *ctx,
|
||||
const xmlChar *name);
|
||||
XMLPUBFUN xmlNsPtr XMLCALL
|
||||
getNamespace (void *ctx);
|
||||
XMLPUBFUN int XMLCALL
|
||||
checkNamespace (void *ctx,
|
||||
xmlChar *nameSpace);
|
||||
XMLPUBFUN void XMLCALL
|
||||
namespaceDecl (void *ctx,
|
||||
const xmlChar *href,
|
||||
const xmlChar *prefix);
|
||||
XMLPUBFUN void XMLCALL
|
||||
comment (void *ctx,
|
||||
const xmlChar *value);
|
||||
XMLPUBFUN void XMLCALL
|
||||
cdataBlock (void *ctx,
|
||||
const xmlChar *value,
|
||||
int len);
|
||||
|
||||
#ifdef LIBXML_SAX1_ENABLED
|
||||
XMLPUBFUN void XMLCALL
|
||||
initxmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr,
|
||||
int warning);
|
||||
#ifdef LIBXML_HTML_ENABLED
|
||||
XMLPUBFUN void XMLCALL
|
||||
inithtmlDefaultSAXHandler (xmlSAXHandlerV1 *hdlr);
|
||||
#endif
|
||||
#ifdef LIBXML_DOCB_ENABLED
|
||||
XMLPUBFUN void XMLCALL
|
||||
initdocbDefaultSAXHandler (xmlSAXHandlerV1 *hdlr);
|
||||
#endif
|
||||
#endif /* LIBXML_SAX1_ENABLED */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LIBXML_LEGACY_ENABLED */
|
||||
|
||||
#endif /* __XML_SAX_H__ */
|
||||
176
Extras/LibXML/include/libxml/SAX2.h
Normal file
176
Extras/LibXML/include/libxml/SAX2.h
Normal file
@@ -0,0 +1,176 @@
|
||||
/*
|
||||
* Summary: SAX2 parser interface used to build the DOM tree
|
||||
* Description: those are the default SAX2 interfaces used by
|
||||
* the library when building DOM tree.
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __XML_SAX2_H__
|
||||
#define __XML_SAX2_H__
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <libxml/xmlversion.h>
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/xlink.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
xmlSAX2GetPublicId (void *ctx);
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
xmlSAX2GetSystemId (void *ctx);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSAX2SetDocumentLocator (void *ctx,
|
||||
xmlSAXLocatorPtr loc);
|
||||
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlSAX2GetLineNumber (void *ctx);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlSAX2GetColumnNumber (void *ctx);
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSAX2IsStandalone (void *ctx);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSAX2HasInternalSubset (void *ctx);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSAX2HasExternalSubset (void *ctx);
|
||||
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSAX2InternalSubset (void *ctx,
|
||||
const xmlChar *name,
|
||||
const xmlChar *ExternalID,
|
||||
const xmlChar *SystemID);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSAX2ExternalSubset (void *ctx,
|
||||
const xmlChar *name,
|
||||
const xmlChar *ExternalID,
|
||||
const xmlChar *SystemID);
|
||||
XMLPUBFUN xmlEntityPtr XMLCALL
|
||||
xmlSAX2GetEntity (void *ctx,
|
||||
const xmlChar *name);
|
||||
XMLPUBFUN xmlEntityPtr XMLCALL
|
||||
xmlSAX2GetParameterEntity (void *ctx,
|
||||
const xmlChar *name);
|
||||
XMLPUBFUN xmlParserInputPtr XMLCALL
|
||||
xmlSAX2ResolveEntity (void *ctx,
|
||||
const xmlChar *publicId,
|
||||
const xmlChar *systemId);
|
||||
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSAX2EntityDecl (void *ctx,
|
||||
const xmlChar *name,
|
||||
int type,
|
||||
const xmlChar *publicId,
|
||||
const xmlChar *systemId,
|
||||
xmlChar *content);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSAX2AttributeDecl (void *ctx,
|
||||
const xmlChar *elem,
|
||||
const xmlChar *fullname,
|
||||
int type,
|
||||
int def,
|
||||
const xmlChar *defaultValue,
|
||||
xmlEnumerationPtr tree);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSAX2ElementDecl (void *ctx,
|
||||
const xmlChar *name,
|
||||
int type,
|
||||
xmlElementContentPtr content);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSAX2NotationDecl (void *ctx,
|
||||
const xmlChar *name,
|
||||
const xmlChar *publicId,
|
||||
const xmlChar *systemId);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSAX2UnparsedEntityDecl (void *ctx,
|
||||
const xmlChar *name,
|
||||
const xmlChar *publicId,
|
||||
const xmlChar *systemId,
|
||||
const xmlChar *notationName);
|
||||
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSAX2StartDocument (void *ctx);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSAX2EndDocument (void *ctx);
|
||||
#if defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_HTML_ENABLED)
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSAX2StartElement (void *ctx,
|
||||
const xmlChar *fullname,
|
||||
const xmlChar **atts);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSAX2EndElement (void *ctx,
|
||||
const xmlChar *name);
|
||||
#endif /* LIBXML_SAX1_ENABLED or LIBXML_HTML_ENABLED */
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSAX2StartElementNs (void *ctx,
|
||||
const xmlChar *localname,
|
||||
const xmlChar *prefix,
|
||||
const xmlChar *URI,
|
||||
int nb_namespaces,
|
||||
const xmlChar **namespaces,
|
||||
intptr_t nb_attributes,
|
||||
intptr_t nb_defaulted,
|
||||
const xmlChar **attributes);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSAX2EndElementNs (void *ctx,
|
||||
const xmlChar *localname,
|
||||
const xmlChar *prefix,
|
||||
const xmlChar *URI);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSAX2Reference (void *ctx,
|
||||
const xmlChar *name);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSAX2Characters (void *ctx,
|
||||
const xmlChar *ch,
|
||||
intptr_t len);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSAX2IgnorableWhitespace (void *ctx,
|
||||
const xmlChar *ch,
|
||||
intptr_t len);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSAX2ProcessingInstruction (void *ctx,
|
||||
const xmlChar *target,
|
||||
const xmlChar *data);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSAX2Comment (void *ctx,
|
||||
const xmlChar *value);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSAX2CDataBlock (void *ctx,
|
||||
const xmlChar *value,
|
||||
intptr_t len);
|
||||
|
||||
#ifdef LIBXML_SAX1_ENABLED
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSAXDefaultVersion (int version);
|
||||
#endif /* LIBXML_SAX1_ENABLED */
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSAXVersion (xmlSAXHandler *hdlr,
|
||||
int version);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSAX2InitDefaultSAXHandler (xmlSAXHandler *hdlr,
|
||||
int warning);
|
||||
#ifdef LIBXML_HTML_ENABLED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSAX2InitHtmlDefaultSAXHandler(xmlSAXHandler *hdlr);
|
||||
XMLPUBFUN void XMLCALL
|
||||
htmlDefaultSAXHandlerInit (void);
|
||||
#endif
|
||||
#ifdef LIBXML_DOCB_ENABLED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSAX2InitDocbDefaultSAXHandler(xmlSAXHandler *hdlr);
|
||||
XMLPUBFUN void XMLCALL
|
||||
docbDefaultSAXHandlerInit (void);
|
||||
#endif
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlDefaultSAXHandlerInit (void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __XML_SAX2_H__ */
|
||||
105
Extras/LibXML/include/libxml/c14n.h
Normal file
105
Extras/LibXML/include/libxml/c14n.h
Normal file
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Summary: Provide Canonical XML and Exclusive XML Canonicalization
|
||||
* Description: the c14n modules provides a
|
||||
*
|
||||
* "Canonical XML" implementation
|
||||
* http://www.w3.org/TR/xml-c14n
|
||||
*
|
||||
* and an
|
||||
*
|
||||
* "Exclusive XML Canonicalization" implementation
|
||||
* http://www.w3.org/TR/xml-exc-c14n
|
||||
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Aleksey Sanin <aleksey@aleksey.com>
|
||||
*/
|
||||
#ifndef __XML_C14N_H__
|
||||
#define __XML_C14N_H__
|
||||
#ifdef LIBXML_C14N_ENABLED
|
||||
#ifdef LIBXML_OUTPUT_ENABLED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/xpath.h>
|
||||
|
||||
/*
|
||||
* XML Canonicazation
|
||||
* http://www.w3.org/TR/xml-c14n
|
||||
*
|
||||
* Exclusive XML Canonicazation
|
||||
* http://www.w3.org/TR/xml-exc-c14n
|
||||
*
|
||||
* Canonical form of an XML document could be created if and only if
|
||||
* a) default attributes (if any) are added to all nodes
|
||||
* b) all character and parsed entity references are resolved
|
||||
* In order to achive this in libxml2 the document MUST be loaded with
|
||||
* following global setings:
|
||||
*
|
||||
* xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
|
||||
* xmlSubstituteEntitiesDefault(1);
|
||||
*
|
||||
* or corresponding parser context setting:
|
||||
* xmlParserCtxtPtr ctxt;
|
||||
*
|
||||
* ...
|
||||
* ctxt->loadsubset = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
|
||||
* ctxt->replaceEntities = 1;
|
||||
* ...
|
||||
*/
|
||||
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlC14NDocSaveTo (xmlDocPtr doc,
|
||||
xmlNodeSetPtr nodes,
|
||||
int exclusive,
|
||||
xmlChar **inclusive_ns_prefixes,
|
||||
int with_comments,
|
||||
xmlOutputBufferPtr buf);
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlC14NDocDumpMemory (xmlDocPtr doc,
|
||||
xmlNodeSetPtr nodes,
|
||||
int exclusive,
|
||||
xmlChar **inclusive_ns_prefixes,
|
||||
int with_comments,
|
||||
xmlChar **doc_txt_ptr);
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlC14NDocSave (xmlDocPtr doc,
|
||||
xmlNodeSetPtr nodes,
|
||||
int exclusive,
|
||||
xmlChar **inclusive_ns_prefixes,
|
||||
int with_comments,
|
||||
const char* filename,
|
||||
int compression);
|
||||
|
||||
|
||||
/**
|
||||
* This is the core C14N function
|
||||
*/
|
||||
typedef int (*xmlC14NIsVisibleCallback) (void* user_data,
|
||||
xmlNodePtr node,
|
||||
xmlNodePtr parent);
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlC14NExecute (xmlDocPtr doc,
|
||||
xmlC14NIsVisibleCallback is_visible_callback,
|
||||
void* user_data,
|
||||
int exclusive,
|
||||
xmlChar **inclusive_ns_prefixes,
|
||||
int with_comments,
|
||||
xmlOutputBufferPtr buf);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||
#endif /* LIBXML_C14N_ENABLED */
|
||||
#endif /* __XML_C14N_H__ */
|
||||
|
||||
182
Extras/LibXML/include/libxml/catalog.h
Normal file
182
Extras/LibXML/include/libxml/catalog.h
Normal file
@@ -0,0 +1,182 @@
|
||||
/**
|
||||
* Summary: interfaces to the Catalog handling system
|
||||
* Description: the catalog module implements the support for
|
||||
* XML Catalogs and SGML catalogs
|
||||
*
|
||||
* SGML Open Technical Resolution TR9401:1997.
|
||||
* http://www.jclark.com/sp/catalog.htm
|
||||
*
|
||||
* XML Catalogs Working Draft 06 August 2001
|
||||
* http://www.oasis-open.org/committees/entity/spec-2001-08-06.html
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __XML_CATALOG_H__
|
||||
#define __XML_CATALOG_H__
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
#include <libxml/xmlstring.h>
|
||||
#include <libxml/tree.h>
|
||||
|
||||
#ifdef LIBXML_CATALOG_ENABLED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* XML_CATALOGS_NAMESPACE:
|
||||
*
|
||||
* The namespace for the XML Catalogs elements.
|
||||
*/
|
||||
#define XML_CATALOGS_NAMESPACE \
|
||||
(const xmlChar *) "urn:oasis:names:tc:entity:xmlns:xml:catalog"
|
||||
/**
|
||||
* XML_CATALOG_PI:
|
||||
*
|
||||
* The specific XML Catalog Processing Instuction name.
|
||||
*/
|
||||
#define XML_CATALOG_PI \
|
||||
(const xmlChar *) "oasis-xml-catalog"
|
||||
|
||||
/*
|
||||
* The API is voluntarily limited to general cataloging.
|
||||
*/
|
||||
typedef enum {
|
||||
XML_CATA_PREFER_NONE = 0,
|
||||
XML_CATA_PREFER_PUBLIC = 1,
|
||||
XML_CATA_PREFER_SYSTEM
|
||||
} xmlCatalogPrefer;
|
||||
|
||||
typedef enum {
|
||||
XML_CATA_ALLOW_NONE = 0,
|
||||
XML_CATA_ALLOW_GLOBAL = 1,
|
||||
XML_CATA_ALLOW_DOCUMENT = 2,
|
||||
XML_CATA_ALLOW_ALL = 3
|
||||
} xmlCatalogAllow;
|
||||
|
||||
typedef struct _xmlCatalog xmlCatalog;
|
||||
typedef xmlCatalog *xmlCatalogPtr;
|
||||
|
||||
/*
|
||||
* Operations on a given catalog.
|
||||
*/
|
||||
XMLPUBFUN xmlCatalogPtr XMLCALL
|
||||
xmlNewCatalog (int sgml);
|
||||
XMLPUBFUN xmlCatalogPtr XMLCALL
|
||||
xmlLoadACatalog (const char *filename);
|
||||
XMLPUBFUN xmlCatalogPtr XMLCALL
|
||||
xmlLoadSGMLSuperCatalog (const char *filename);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlConvertSGMLCatalog (xmlCatalogPtr catal);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlACatalogAdd (xmlCatalogPtr catal,
|
||||
const xmlChar *type,
|
||||
const xmlChar *orig,
|
||||
const xmlChar *replace);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlACatalogRemove (xmlCatalogPtr catal,
|
||||
const xmlChar *value);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlACatalogResolve (xmlCatalogPtr catal,
|
||||
const xmlChar *pubID,
|
||||
const xmlChar *sysID);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlACatalogResolveSystem(xmlCatalogPtr catal,
|
||||
const xmlChar *sysID);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlACatalogResolvePublic(xmlCatalogPtr catal,
|
||||
const xmlChar *pubID);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlACatalogResolveURI (xmlCatalogPtr catal,
|
||||
const xmlChar *URI);
|
||||
#ifdef LIBXML_OUTPUT_ENABLED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlACatalogDump (xmlCatalogPtr catal,
|
||||
FILE *out);
|
||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlFreeCatalog (xmlCatalogPtr catal);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlCatalogIsEmpty (xmlCatalogPtr catal);
|
||||
|
||||
/*
|
||||
* Global operations.
|
||||
*/
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlInitializeCatalog (void);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlLoadCatalog (const char *filename);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlLoadCatalogs (const char *paths);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlCatalogCleanup (void);
|
||||
#ifdef LIBXML_OUTPUT_ENABLED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlCatalogDump (FILE *out);
|
||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlCatalogResolve (const xmlChar *pubID,
|
||||
const xmlChar *sysID);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlCatalogResolveSystem (const xmlChar *sysID);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlCatalogResolvePublic (const xmlChar *pubID);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlCatalogResolveURI (const xmlChar *URI);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlCatalogAdd (const xmlChar *type,
|
||||
const xmlChar *orig,
|
||||
const xmlChar *replace);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlCatalogRemove (const xmlChar *value);
|
||||
XMLPUBFUN xmlDocPtr XMLCALL
|
||||
xmlParseCatalogFile (const char *filename);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlCatalogConvert (void);
|
||||
|
||||
/*
|
||||
* Strictly minimal interfaces for per-document catalogs used
|
||||
* by the parser.
|
||||
*/
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlCatalogFreeLocal (void *catalogs);
|
||||
XMLPUBFUN void * XMLCALL
|
||||
xmlCatalogAddLocal (void *catalogs,
|
||||
const xmlChar *URL);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlCatalogLocalResolve (void *catalogs,
|
||||
const xmlChar *pubID,
|
||||
const xmlChar *sysID);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlCatalogLocalResolveURI(void *catalogs,
|
||||
const xmlChar *URI);
|
||||
/*
|
||||
* Preference settings.
|
||||
*/
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlCatalogSetDebug (int level);
|
||||
XMLPUBFUN xmlCatalogPrefer XMLCALL
|
||||
xmlCatalogSetDefaultPrefer(xmlCatalogPrefer prefer);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlCatalogSetDefaults (xmlCatalogAllow allow);
|
||||
XMLPUBFUN xmlCatalogAllow XMLCALL
|
||||
xmlCatalogGetDefaults (void);
|
||||
|
||||
|
||||
/* DEPRECATED interfaces */
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
xmlCatalogGetSystem (const xmlChar *sysID);
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
xmlCatalogGetPublic (const xmlChar *pubID);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* LIBXML_CATALOG_ENABLED */
|
||||
#endif /* __XML_CATALOG_H__ */
|
||||
230
Extras/LibXML/include/libxml/chvalid.h
Normal file
230
Extras/LibXML/include/libxml/chvalid.h
Normal file
@@ -0,0 +1,230 @@
|
||||
/*
|
||||
* Summary: Unicode character range checking
|
||||
* Description: this module exports interfaces for the character
|
||||
* range validation APIs
|
||||
*
|
||||
* This file is automatically generated from the cvs source
|
||||
* definition files using the genChRanges.py Python script
|
||||
*
|
||||
* Generation date: Tue Nov 18 08:14:21 2003
|
||||
* Sources: chvalid.def
|
||||
* Author: William Brack <wbrack@mmm.com.hk>
|
||||
*/
|
||||
|
||||
#ifndef __XML_CHVALID_H__
|
||||
#define __XML_CHVALID_H__
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
#include <libxml/xmlstring.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Define our typedefs and structures
|
||||
*
|
||||
*/
|
||||
typedef struct _xmlChSRange xmlChSRange;
|
||||
typedef xmlChSRange *xmlChSRangePtr;
|
||||
struct _xmlChSRange {
|
||||
unsigned short low;
|
||||
unsigned short high;
|
||||
};
|
||||
|
||||
typedef struct _xmlChLRange xmlChLRange;
|
||||
typedef xmlChLRange *xmlChLRangePtr;
|
||||
struct _xmlChLRange {
|
||||
unsigned int low;
|
||||
unsigned int high;
|
||||
};
|
||||
|
||||
typedef struct _xmlChRangeGroup xmlChRangeGroup;
|
||||
typedef xmlChRangeGroup *xmlChRangeGroupPtr;
|
||||
struct _xmlChRangeGroup {
|
||||
int nbShortRange;
|
||||
int nbLongRange;
|
||||
xmlChSRangePtr shortRange; /* points to an array of ranges */
|
||||
xmlChLRangePtr longRange;
|
||||
};
|
||||
|
||||
/**
|
||||
* Range checking routine
|
||||
*/
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlCharInRange(unsigned int val, const xmlChRangeGroupPtr group);
|
||||
|
||||
|
||||
/**
|
||||
* xmlIsBaseChar_ch:
|
||||
* @c: char to validate
|
||||
*
|
||||
* Automatically generated by genChRanges.py
|
||||
*/
|
||||
#define xmlIsBaseChar_ch(c) (((0x41 <= (c)) && ((c) <= 0x5a)) || \
|
||||
((0x61 <= (c)) && ((c) <= 0x7a)) || \
|
||||
((0xc0 <= (c)) && ((c) <= 0xd6)) || \
|
||||
((0xd8 <= (c)) && ((c) <= 0xf6)) || \
|
||||
(0xf8 <= (c)))
|
||||
|
||||
/**
|
||||
* xmlIsBaseCharQ:
|
||||
* @c: char to validate
|
||||
*
|
||||
* Automatically generated by genChRanges.py
|
||||
*/
|
||||
#define xmlIsBaseCharQ(c) (((c) < 0x100) ? \
|
||||
xmlIsBaseChar_ch((c)) : \
|
||||
xmlCharInRange((c), &xmlIsBaseCharGroup))
|
||||
|
||||
XMLPUBVAR xmlChRangeGroup xmlIsBaseCharGroup;
|
||||
|
||||
/**
|
||||
* xmlIsBlank_ch:
|
||||
* @c: char to validate
|
||||
*
|
||||
* Automatically generated by genChRanges.py
|
||||
*/
|
||||
#define xmlIsBlank_ch(c) (((c) == 0x20) || \
|
||||
((0x9 <= (c)) && ((c) <= 0xa)) || \
|
||||
((c) == 0xd))
|
||||
|
||||
/**
|
||||
* xmlIsBlankQ:
|
||||
* @c: char to validate
|
||||
*
|
||||
* Automatically generated by genChRanges.py
|
||||
*/
|
||||
#define xmlIsBlankQ(c) (((c) < 0x100) ? \
|
||||
xmlIsBlank_ch((c)) : 0)
|
||||
|
||||
|
||||
/**
|
||||
* xmlIsChar_ch:
|
||||
* @c: char to validate
|
||||
*
|
||||
* Automatically generated by genChRanges.py
|
||||
*/
|
||||
#define xmlIsChar_ch(c) (((0x9 <= (c)) && ((c) <= 0xa)) || \
|
||||
((c) == 0xd) || \
|
||||
(0x20 <= (c)))
|
||||
|
||||
/**
|
||||
* xmlIsCharQ:
|
||||
* @c: char to validate
|
||||
*
|
||||
* Automatically generated by genChRanges.py
|
||||
*/
|
||||
#define xmlIsCharQ(c) (((c) < 0x100) ? \
|
||||
xmlIsChar_ch((c)) :\
|
||||
(((0x100 <= (c)) && ((c) <= 0xd7ff)) || \
|
||||
((0xe000 <= (c)) && ((c) <= 0xfffd)) || \
|
||||
((0x10000 <= (c)) && ((c) <= 0x10ffff))))
|
||||
|
||||
XMLPUBVAR xmlChRangeGroup xmlIsCharGroup;
|
||||
|
||||
/**
|
||||
* xmlIsCombiningQ:
|
||||
* @c: char to validate
|
||||
*
|
||||
* Automatically generated by genChRanges.py
|
||||
*/
|
||||
#define xmlIsCombiningQ(c) (((c) < 0x100) ? \
|
||||
0 : \
|
||||
xmlCharInRange((c), &xmlIsCombiningGroup))
|
||||
|
||||
XMLPUBVAR xmlChRangeGroup xmlIsCombiningGroup;
|
||||
|
||||
/**
|
||||
* xmlIsDigit_ch:
|
||||
* @c: char to validate
|
||||
*
|
||||
* Automatically generated by genChRanges.py
|
||||
*/
|
||||
#define xmlIsDigit_ch(c) (((0x30 <= (c)) && ((c) <= 0x39)))
|
||||
|
||||
/**
|
||||
* xmlIsDigitQ:
|
||||
* @c: char to validate
|
||||
*
|
||||
* Automatically generated by genChRanges.py
|
||||
*/
|
||||
#define xmlIsDigitQ(c) (((c) < 0x100) ? \
|
||||
xmlIsDigit_ch((c)) : \
|
||||
xmlCharInRange((c), &xmlIsDigitGroup))
|
||||
|
||||
XMLPUBVAR xmlChRangeGroup xmlIsDigitGroup;
|
||||
|
||||
/**
|
||||
* xmlIsExtender_ch:
|
||||
* @c: char to validate
|
||||
*
|
||||
* Automatically generated by genChRanges.py
|
||||
*/
|
||||
#define xmlIsExtender_ch(c) (((c) == 0xb7))
|
||||
|
||||
/**
|
||||
* xmlIsExtenderQ:
|
||||
* @c: char to validate
|
||||
*
|
||||
* Automatically generated by genChRanges.py
|
||||
*/
|
||||
#define xmlIsExtenderQ(c) (((c) < 0x100) ? \
|
||||
xmlIsExtender_ch((c)) : \
|
||||
xmlCharInRange((c), &xmlIsExtenderGroup))
|
||||
|
||||
XMLPUBVAR xmlChRangeGroup xmlIsExtenderGroup;
|
||||
|
||||
/**
|
||||
* xmlIsIdeographicQ:
|
||||
* @c: char to validate
|
||||
*
|
||||
* Automatically generated by genChRanges.py
|
||||
*/
|
||||
#define xmlIsIdeographicQ(c) (((c) < 0x100) ? \
|
||||
0 :\
|
||||
(((0x4e00 <= (c)) && ((c) <= 0x9fa5)) || \
|
||||
((c) == 0x3007) || \
|
||||
((0x3021 <= (c)) && ((c) <= 0x3029))))
|
||||
|
||||
XMLPUBVAR xmlChRangeGroup xmlIsIdeographicGroup;
|
||||
XMLPUBVAR unsigned char xmlIsPubidChar_tab[256];
|
||||
|
||||
/**
|
||||
* xmlIsPubidChar_ch:
|
||||
* @c: char to validate
|
||||
*
|
||||
* Automatically generated by genChRanges.py
|
||||
*/
|
||||
#define xmlIsPubidChar_ch(c) (xmlIsPubidChar_tab[(c)])
|
||||
|
||||
/**
|
||||
* xmlIsPubidCharQ:
|
||||
* @c: char to validate
|
||||
*
|
||||
* Automatically generated by genChRanges.py
|
||||
*/
|
||||
#define xmlIsPubidCharQ(c) (((c) < 0x100) ? \
|
||||
xmlIsPubidChar_ch((c)) : 0)
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlIsBaseChar(unsigned int ch);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlIsBlank(unsigned int ch);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlIsChar(unsigned int ch);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlIsCombining(unsigned int ch);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlIsDigit(unsigned int ch);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlIsExtender(unsigned int ch);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlIsIdeographic(unsigned int ch);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlIsPubidChar(unsigned int ch);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __XML_CHVALID_H__ */
|
||||
217
Extras/LibXML/include/libxml/debugXML.h
Normal file
217
Extras/LibXML/include/libxml/debugXML.h
Normal file
@@ -0,0 +1,217 @@
|
||||
/*
|
||||
* Summary: Tree debugging APIs
|
||||
* Description: Interfaces to a set of routines used for debugging the tree
|
||||
* produced by the XML parser.
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __DEBUG_XML__
|
||||
#define __DEBUG_XML__
|
||||
#include <stdio.h>
|
||||
#include <libxml/xmlversion.h>
|
||||
#include <libxml/tree.h>
|
||||
|
||||
#ifdef LIBXML_DEBUG_ENABLED
|
||||
|
||||
#include <libxml/xpath.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The standard Dump routines.
|
||||
*/
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlDebugDumpString (FILE *output,
|
||||
const xmlChar *str);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlDebugDumpAttr (FILE *output,
|
||||
xmlAttrPtr attr,
|
||||
int depth);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlDebugDumpAttrList (FILE *output,
|
||||
xmlAttrPtr attr,
|
||||
int depth);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlDebugDumpOneNode (FILE *output,
|
||||
xmlNodePtr node,
|
||||
int depth);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlDebugDumpNode (FILE *output,
|
||||
xmlNodePtr node,
|
||||
int depth);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlDebugDumpNodeList (FILE *output,
|
||||
xmlNodePtr node,
|
||||
int depth);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlDebugDumpDocumentHead(FILE *output,
|
||||
xmlDocPtr doc);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlDebugDumpDocument (FILE *output,
|
||||
xmlDocPtr doc);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlDebugDumpDTD (FILE *output,
|
||||
xmlDtdPtr dtd);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlDebugDumpEntities (FILE *output,
|
||||
xmlDocPtr doc);
|
||||
|
||||
/****************************************************************
|
||||
* *
|
||||
* Checking routines *
|
||||
* *
|
||||
****************************************************************/
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlDebugCheckDocument (FILE * output,
|
||||
xmlDocPtr doc);
|
||||
|
||||
/****************************************************************
|
||||
* *
|
||||
* XML shell helpers *
|
||||
* *
|
||||
****************************************************************/
|
||||
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlLsOneNode (FILE *output, xmlNodePtr node);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlLsCountNode (xmlNodePtr node);
|
||||
|
||||
XMLPUBFUN const char * XMLCALL
|
||||
xmlBoolToText (int boolval);
|
||||
|
||||
/****************************************************************
|
||||
* *
|
||||
* The XML shell related structures and functions *
|
||||
* *
|
||||
****************************************************************/
|
||||
|
||||
#ifdef LIBXML_XPATH_ENABLED
|
||||
/**
|
||||
* xmlShellReadlineFunc:
|
||||
* @prompt: a string prompt
|
||||
*
|
||||
* This is a generic signature for the XML shell input function.
|
||||
*
|
||||
* Returns a string which will be freed by the Shell.
|
||||
*/
|
||||
typedef char * (* xmlShellReadlineFunc)(char *prompt);
|
||||
|
||||
/**
|
||||
* xmlShellCtxt:
|
||||
*
|
||||
* A debugging shell context.
|
||||
* TODO: add the defined function tables.
|
||||
*/
|
||||
typedef struct _xmlShellCtxt xmlShellCtxt;
|
||||
typedef xmlShellCtxt *xmlShellCtxtPtr;
|
||||
struct _xmlShellCtxt {
|
||||
char *filename;
|
||||
xmlDocPtr doc;
|
||||
xmlNodePtr node;
|
||||
xmlXPathContextPtr pctxt;
|
||||
int loaded;
|
||||
FILE *output;
|
||||
xmlShellReadlineFunc input;
|
||||
};
|
||||
|
||||
/**
|
||||
* xmlShellCmd:
|
||||
* @ctxt: a shell context
|
||||
* @arg: a string argument
|
||||
* @node: a first node
|
||||
* @node2: a second node
|
||||
*
|
||||
* This is a generic signature for the XML shell functions.
|
||||
*
|
||||
* Returns an int, negative returns indicating errors.
|
||||
*/
|
||||
typedef int (* xmlShellCmd) (xmlShellCtxtPtr ctxt,
|
||||
char *arg,
|
||||
xmlNodePtr node,
|
||||
xmlNodePtr node2);
|
||||
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlShellPrintXPathError (int errorType,
|
||||
const char *arg);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlShellPrintXPathResult(xmlXPathObjectPtr list);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlShellList (xmlShellCtxtPtr ctxt,
|
||||
char *arg,
|
||||
xmlNodePtr node,
|
||||
xmlNodePtr node2);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlShellBase (xmlShellCtxtPtr ctxt,
|
||||
char *arg,
|
||||
xmlNodePtr node,
|
||||
xmlNodePtr node2);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlShellDir (xmlShellCtxtPtr ctxt,
|
||||
char *arg,
|
||||
xmlNodePtr node,
|
||||
xmlNodePtr node2);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlShellLoad (xmlShellCtxtPtr ctxt,
|
||||
char *filename,
|
||||
xmlNodePtr node,
|
||||
xmlNodePtr node2);
|
||||
#ifdef LIBXML_OUTPUT_ENABLED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlShellPrintNode (xmlNodePtr node);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlShellCat (xmlShellCtxtPtr ctxt,
|
||||
char *arg,
|
||||
xmlNodePtr node,
|
||||
xmlNodePtr node2);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlShellWrite (xmlShellCtxtPtr ctxt,
|
||||
char *filename,
|
||||
xmlNodePtr node,
|
||||
xmlNodePtr node2);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlShellSave (xmlShellCtxtPtr ctxt,
|
||||
char *filename,
|
||||
xmlNodePtr node,
|
||||
xmlNodePtr node2);
|
||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||
#ifdef LIBXML_VALID_ENABLED
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlShellValidate (xmlShellCtxtPtr ctxt,
|
||||
char *dtd,
|
||||
xmlNodePtr node,
|
||||
xmlNodePtr node2);
|
||||
#endif /* LIBXML_VALID_ENABLED */
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlShellDu (xmlShellCtxtPtr ctxt,
|
||||
char *arg,
|
||||
xmlNodePtr tree,
|
||||
xmlNodePtr node2);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlShellPwd (xmlShellCtxtPtr ctxt,
|
||||
char *buffer,
|
||||
xmlNodePtr node,
|
||||
xmlNodePtr node2);
|
||||
|
||||
/*
|
||||
* The Shell interface.
|
||||
*/
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlShell (xmlDocPtr doc,
|
||||
char *filename,
|
||||
xmlShellReadlineFunc input,
|
||||
FILE *output);
|
||||
|
||||
#endif /* LIBXML_XPATH_ENABLED */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LIBXML_DEBUG_ENABLED */
|
||||
#endif /* __DEBUG_XML__ */
|
||||
69
Extras/LibXML/include/libxml/dict.h
Normal file
69
Extras/LibXML/include/libxml/dict.h
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* Summary: string dictionnary
|
||||
* Description: dictionary of reusable strings, just used to avoid allocation
|
||||
* and freeing operations.
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __XML_DICT_H__
|
||||
#define __XML_DICT_H__
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
#include <libxml/tree.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The dictionnary.
|
||||
*/
|
||||
typedef struct _xmlDict xmlDict;
|
||||
typedef xmlDict *xmlDictPtr;
|
||||
|
||||
/*
|
||||
* Constructor and destructor.
|
||||
*/
|
||||
XMLPUBFUN xmlDictPtr XMLCALL
|
||||
xmlDictCreate (void);
|
||||
XMLPUBFUN xmlDictPtr XMLCALL
|
||||
xmlDictCreateSub(xmlDictPtr sub);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlDictReference(xmlDictPtr dict);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlDictFree (xmlDictPtr dict);
|
||||
|
||||
/*
|
||||
* Lookup of entry in the dictionnary.
|
||||
*/
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
xmlDictLookup (xmlDictPtr dict,
|
||||
const xmlChar *name,
|
||||
intptr_t len);
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
xmlDictExists (xmlDictPtr dict,
|
||||
const xmlChar *name,
|
||||
intptr_t len);
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
xmlDictQLookup (xmlDictPtr dict,
|
||||
const xmlChar *prefix,
|
||||
const xmlChar *name);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlDictOwns (xmlDictPtr dict,
|
||||
const xmlChar *str);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlDictSize (xmlDictPtr dict);
|
||||
|
||||
/*
|
||||
* Cleanup function
|
||||
*/
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlDictCleanup (void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* ! __XML_DICT_H__ */
|
||||
226
Extras/LibXML/include/libxml/encoding.h
Normal file
226
Extras/LibXML/include/libxml/encoding.h
Normal file
@@ -0,0 +1,226 @@
|
||||
/*
|
||||
* Summary: interface for the encoding conversion functions
|
||||
* Description: interface for the encoding conversion functions needed for
|
||||
* XML basic encoding and iconv() support.
|
||||
*
|
||||
* Related specs are
|
||||
* rfc2044 (UTF-8 and UTF-16) F. Yergeau Alis Technologies
|
||||
* [ISO-10646] UTF-8 and UTF-16 in Annexes
|
||||
* [ISO-8859-1] ISO Latin-1 characters codes.
|
||||
* [UNICODE] The Unicode Consortium, "The Unicode Standard --
|
||||
* Worldwide Character Encoding -- Version 1.0", Addison-
|
||||
* Wesley, Volume 1, 1991, Volume 2, 1992. UTF-8 is
|
||||
* described in Unicode Technical Report #4.
|
||||
* [US-ASCII] Coded Character Set--7-bit American Standard Code for
|
||||
* Information Interchange, ANSI X3.4-1986.
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __XML_CHAR_ENCODING_H__
|
||||
#define __XML_CHAR_ENCODING_H__
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
|
||||
#ifdef LIBXML_ICONV_ENABLED
|
||||
#include <iconv.h>
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* xmlCharEncoding:
|
||||
*
|
||||
* Predefined values for some standard encodings.
|
||||
* Libxml does not do beforehand translation on UTF8 and ISOLatinX.
|
||||
* It also supports ASCII, ISO-8859-1, and UTF16 (LE and BE) by default.
|
||||
*
|
||||
* Anything else would have to be translated to UTF8 before being
|
||||
* given to the parser itself. The BOM for UTF16 and the encoding
|
||||
* declaration are looked at and a converter is looked for at that
|
||||
* point. If not found the parser stops here as asked by the XML REC. A
|
||||
* converter can be registered by the user using xmlRegisterCharEncodingHandler
|
||||
* but the current form doesn't allow stateful transcoding (a serious
|
||||
* problem agreed !). If iconv has been found it will be used
|
||||
* automatically and allow stateful transcoding, the simplest is then
|
||||
* to be sure to enable iconv and to provide iconv libs for the encoding
|
||||
* support needed.
|
||||
*
|
||||
* Note that the generic "UTF-16" is not a predefined value. Instead, only
|
||||
* the specific UTF-16LE and UTF-16BE are present.
|
||||
*/
|
||||
typedef enum {
|
||||
XML_CHAR_ENCODING_ERROR= -1, /* No char encoding detected */
|
||||
XML_CHAR_ENCODING_NONE= 0, /* No char encoding detected */
|
||||
XML_CHAR_ENCODING_UTF8= 1, /* UTF-8 */
|
||||
XML_CHAR_ENCODING_UTF16LE= 2, /* UTF-16 little endian */
|
||||
XML_CHAR_ENCODING_UTF16BE= 3, /* UTF-16 big endian */
|
||||
XML_CHAR_ENCODING_UCS4LE= 4, /* UCS-4 little endian */
|
||||
XML_CHAR_ENCODING_UCS4BE= 5, /* UCS-4 big endian */
|
||||
XML_CHAR_ENCODING_EBCDIC= 6, /* EBCDIC uh! */
|
||||
XML_CHAR_ENCODING_UCS4_2143=7, /* UCS-4 unusual ordering */
|
||||
XML_CHAR_ENCODING_UCS4_3412=8, /* UCS-4 unusual ordering */
|
||||
XML_CHAR_ENCODING_UCS2= 9, /* UCS-2 */
|
||||
XML_CHAR_ENCODING_8859_1= 10,/* ISO-8859-1 ISO Latin 1 */
|
||||
XML_CHAR_ENCODING_8859_2= 11,/* ISO-8859-2 ISO Latin 2 */
|
||||
XML_CHAR_ENCODING_8859_3= 12,/* ISO-8859-3 */
|
||||
XML_CHAR_ENCODING_8859_4= 13,/* ISO-8859-4 */
|
||||
XML_CHAR_ENCODING_8859_5= 14,/* ISO-8859-5 */
|
||||
XML_CHAR_ENCODING_8859_6= 15,/* ISO-8859-6 */
|
||||
XML_CHAR_ENCODING_8859_7= 16,/* ISO-8859-7 */
|
||||
XML_CHAR_ENCODING_8859_8= 17,/* ISO-8859-8 */
|
||||
XML_CHAR_ENCODING_8859_9= 18,/* ISO-8859-9 */
|
||||
XML_CHAR_ENCODING_2022_JP= 19,/* ISO-2022-JP */
|
||||
XML_CHAR_ENCODING_SHIFT_JIS=20,/* Shift_JIS */
|
||||
XML_CHAR_ENCODING_EUC_JP= 21,/* EUC-JP */
|
||||
XML_CHAR_ENCODING_ASCII= 22 /* pure ASCII */
|
||||
} xmlCharEncoding;
|
||||
|
||||
/**
|
||||
* xmlCharEncodingInputFunc:
|
||||
* @out: a pointer to an array of bytes to store the UTF-8 result
|
||||
* @outlen: the length of @out
|
||||
* @in: a pointer to an array of chars in the original encoding
|
||||
* @inlen: the length of @in
|
||||
*
|
||||
* Take a block of chars in the original encoding and try to convert
|
||||
* it to an UTF-8 block of chars out.
|
||||
*
|
||||
* Returns the number of bytes written, -1 if lack of space, or -2
|
||||
* if the transcoding failed.
|
||||
* The value of @inlen after return is the number of octets consumed
|
||||
* if the return value is positive, else unpredictiable.
|
||||
* The value of @outlen after return is the number of octets consumed.
|
||||
*/
|
||||
typedef intptr_t (* xmlCharEncodingInputFunc)(unsigned char *out, intptr_t* outlen,
|
||||
const unsigned char *in, intptr_t* inlen);
|
||||
|
||||
|
||||
/**
|
||||
* xmlCharEncodingOutputFunc:
|
||||
* @out: a pointer to an array of bytes to store the result
|
||||
* @outlen: the length of @out
|
||||
* @in: a pointer to an array of UTF-8 chars
|
||||
* @inlen: the length of @in
|
||||
*
|
||||
* Take a block of UTF-8 chars in and try to convert it to another
|
||||
* encoding.
|
||||
* Note: a first call designed to produce heading info is called with
|
||||
* in = NULL. If stateful this should also initialize the encoder state.
|
||||
*
|
||||
* Returns the number of bytes written, -1 if lack of space, or -2
|
||||
* if the transcoding failed.
|
||||
* The value of @inlen after return is the number of octets consumed
|
||||
* if the return value is positive, else unpredictiable.
|
||||
* The value of @outlen after return is the number of octets produced.
|
||||
*/
|
||||
typedef intptr_t (* xmlCharEncodingOutputFunc)(unsigned char *out, intptr_t* outlen,
|
||||
const unsigned char *in, intptr_t* inlen);
|
||||
|
||||
|
||||
/*
|
||||
* Block defining the handlers for non UTF-8 encodings.
|
||||
* If iconv is supported, there are two extra fields.
|
||||
*/
|
||||
|
||||
typedef struct _xmlCharEncodingHandler xmlCharEncodingHandler;
|
||||
typedef xmlCharEncodingHandler *xmlCharEncodingHandlerPtr;
|
||||
struct _xmlCharEncodingHandler {
|
||||
char *name;
|
||||
xmlCharEncodingInputFunc input;
|
||||
xmlCharEncodingOutputFunc output;
|
||||
#ifdef LIBXML_ICONV_ENABLED
|
||||
iconv_t iconv_in;
|
||||
iconv_t iconv_out;
|
||||
#endif /* LIBXML_ICONV_ENABLED */
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include <libxml/tree.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Interfaces for encoding handlers.
|
||||
*/
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlInitCharEncodingHandlers (void);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlCleanupCharEncodingHandlers (void);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlRegisterCharEncodingHandler (xmlCharEncodingHandlerPtr handler);
|
||||
XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL
|
||||
xmlGetCharEncodingHandler (xmlCharEncoding enc);
|
||||
XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL
|
||||
xmlFindCharEncodingHandler (const char *name);
|
||||
XMLPUBFUN xmlCharEncodingHandlerPtr XMLCALL
|
||||
xmlNewCharEncodingHandler (const char *name,
|
||||
xmlCharEncodingInputFunc input,
|
||||
xmlCharEncodingOutputFunc output);
|
||||
|
||||
/*
|
||||
* Interfaces for encoding names and aliases.
|
||||
*/
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlAddEncodingAlias (const char *name,
|
||||
const char *alias);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlDelEncodingAlias (const char *alias);
|
||||
XMLPUBFUN const char * XMLCALL
|
||||
xmlGetEncodingAlias (const char *alias);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlCleanupEncodingAliases (void);
|
||||
XMLPUBFUN xmlCharEncoding XMLCALL
|
||||
xmlParseCharEncoding (const char *name);
|
||||
XMLPUBFUN const char * XMLCALL
|
||||
xmlGetCharEncodingName (xmlCharEncoding enc);
|
||||
|
||||
/*
|
||||
* Interfaces directly used by the parsers.
|
||||
*/
|
||||
XMLPUBFUN xmlCharEncoding XMLCALL
|
||||
xmlDetectCharEncoding (const unsigned char *in,
|
||||
intptr_t len);
|
||||
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlCharEncOutFunc (xmlCharEncodingHandler *handler,
|
||||
xmlBufferPtr out,
|
||||
xmlBufferPtr in);
|
||||
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlCharEncInFunc (xmlCharEncodingHandler *handler,
|
||||
xmlBufferPtr out,
|
||||
xmlBufferPtr in);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlCharEncFirstLine (xmlCharEncodingHandler *handler,
|
||||
xmlBufferPtr out,
|
||||
xmlBufferPtr in);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlCharEncCloseFunc (xmlCharEncodingHandler *handler);
|
||||
|
||||
/*
|
||||
* Export a few useful functions
|
||||
*/
|
||||
#ifdef LIBXML_OUTPUT_ENABLED
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
UTF8Toisolat1 (unsigned char *out,
|
||||
intptr_t* outlen,
|
||||
const unsigned char *in,
|
||||
intptr_t* inlen);
|
||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
isolat1ToUTF8 (unsigned char *out,
|
||||
intptr_t* outlen,
|
||||
const unsigned char *in,
|
||||
intptr_t* inlen);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __XML_CHAR_ENCODING_H__ */
|
||||
139
Extras/LibXML/include/libxml/entities.h
Normal file
139
Extras/LibXML/include/libxml/entities.h
Normal file
@@ -0,0 +1,139 @@
|
||||
/*
|
||||
* Summary: interface for the XML entities handling
|
||||
* Description: this module provides some of the entity API needed
|
||||
* for the parser and applications.
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __XML_ENTITIES_H__
|
||||
#define __XML_ENTITIES_H__
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
#include <libxml/tree.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The different valid entity types.
|
||||
*/
|
||||
typedef enum {
|
||||
XML_INTERNAL_GENERAL_ENTITY = 1,
|
||||
XML_EXTERNAL_GENERAL_PARSED_ENTITY = 2,
|
||||
XML_EXTERNAL_GENERAL_UNPARSED_ENTITY = 3,
|
||||
XML_INTERNAL_PARAMETER_ENTITY = 4,
|
||||
XML_EXTERNAL_PARAMETER_ENTITY = 5,
|
||||
XML_INTERNAL_PREDEFINED_ENTITY = 6
|
||||
} xmlEntityType;
|
||||
|
||||
/*
|
||||
* An unit of storage for an entity, contains the string, the value
|
||||
* and the linkind data needed for the linking in the hash table.
|
||||
*/
|
||||
|
||||
struct _xmlEntity {
|
||||
void *_private; /* application data */
|
||||
xmlElementType type; /* XML_ENTITY_DECL, must be second ! */
|
||||
const xmlChar *name; /* Entity name */
|
||||
struct _xmlNode *children; /* First child link */
|
||||
struct _xmlNode *last; /* Last child link */
|
||||
struct _xmlDtd *parent; /* -> DTD */
|
||||
struct _xmlNode *next; /* next sibling link */
|
||||
struct _xmlNode *prev; /* previous sibling link */
|
||||
struct _xmlDoc *doc; /* the containing document */
|
||||
|
||||
xmlChar *orig; /* content without ref substitution */
|
||||
xmlChar *content; /* content or ndata if unparsed */
|
||||
intptr_t length; /* the content length */
|
||||
xmlEntityType etype; /* The entity type */
|
||||
const xmlChar *ExternalID; /* External identifier for PUBLIC */
|
||||
const xmlChar *SystemID; /* URI for a SYSTEM or PUBLIC Entity */
|
||||
|
||||
struct _xmlEntity *nexte; /* unused */
|
||||
const xmlChar *URI; /* the full URI as computed */
|
||||
int owner; /* does the entity own the childrens */
|
||||
};
|
||||
|
||||
/*
|
||||
* All entities are stored in an hash table.
|
||||
* There is 2 separate hash tables for global and parameter entities.
|
||||
*/
|
||||
|
||||
typedef struct _xmlHashTable xmlEntitiesTable;
|
||||
typedef xmlEntitiesTable *xmlEntitiesTablePtr;
|
||||
|
||||
/*
|
||||
* External functions:
|
||||
*/
|
||||
|
||||
#ifdef LIBXML_LEGACY_ENABLED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlInitializePredefinedEntities (void);
|
||||
#endif /* LIBXML_LEGACY_ENABLED */
|
||||
XMLPUBFUN xmlEntityPtr XMLCALL
|
||||
xmlAddDocEntity (xmlDocPtr doc,
|
||||
const xmlChar *name,
|
||||
int type,
|
||||
const xmlChar *ExternalID,
|
||||
const xmlChar *SystemID,
|
||||
const xmlChar *content);
|
||||
XMLPUBFUN xmlEntityPtr XMLCALL
|
||||
xmlAddDtdEntity (xmlDocPtr doc,
|
||||
const xmlChar *name,
|
||||
int type,
|
||||
const xmlChar *ExternalID,
|
||||
const xmlChar *SystemID,
|
||||
const xmlChar *content);
|
||||
XMLPUBFUN xmlEntityPtr XMLCALL
|
||||
xmlGetPredefinedEntity (const xmlChar *name);
|
||||
XMLPUBFUN xmlEntityPtr XMLCALL
|
||||
xmlGetDocEntity (xmlDocPtr doc,
|
||||
const xmlChar *name);
|
||||
XMLPUBFUN xmlEntityPtr XMLCALL
|
||||
xmlGetDtdEntity (xmlDocPtr doc,
|
||||
const xmlChar *name);
|
||||
XMLPUBFUN xmlEntityPtr XMLCALL
|
||||
xmlGetParameterEntity (xmlDocPtr doc,
|
||||
const xmlChar *name);
|
||||
#ifdef LIBXML_LEGACY_ENABLED
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
xmlEncodeEntities (xmlDocPtr doc,
|
||||
const xmlChar *input);
|
||||
#endif /* LIBXML_LEGACY_ENABLED */
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlEncodeEntitiesReentrant(xmlDocPtr doc,
|
||||
const xmlChar *input);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlEncodeSpecialChars (xmlDocPtr doc,
|
||||
const xmlChar *input);
|
||||
XMLPUBFUN xmlEntitiesTablePtr XMLCALL
|
||||
xmlCreateEntitiesTable (void);
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
XMLPUBFUN xmlEntitiesTablePtr XMLCALL
|
||||
xmlCopyEntitiesTable (xmlEntitiesTablePtr table);
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlFreeEntitiesTable (xmlEntitiesTablePtr table);
|
||||
#ifdef LIBXML_OUTPUT_ENABLED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlDumpEntitiesTable (xmlBufferPtr buf,
|
||||
xmlEntitiesTablePtr table);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlDumpEntityDecl (xmlBufferPtr buf,
|
||||
xmlEntityPtr ent);
|
||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||
#ifdef LIBXML_LEGACY_ENABLED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlCleanupPredefinedEntities(void);
|
||||
#endif /* LIBXML_LEGACY_ENABLED */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
# endif /* __XML_ENTITIES_H__ */
|
||||
455
Extras/LibXML/include/libxml/globals.h
Normal file
455
Extras/LibXML/include/libxml/globals.h
Normal file
@@ -0,0 +1,455 @@
|
||||
/*
|
||||
* Summary: interface for all global variables of the library
|
||||
* Description: all the global variables and thread handling for
|
||||
* those variables is handled by this module.
|
||||
*
|
||||
* The bottom of this file is automatically generated by build_glob.py
|
||||
* based on the description file global.data
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Gary Pennington <Gary.Pennington@uk.sun.com>, Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __XML_GLOBALS_H
|
||||
#define __XML_GLOBALS_H
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/xmlerror.h>
|
||||
#include <libxml/SAX.h>
|
||||
#include <libxml/SAX2.h>
|
||||
#include <libxml/xmlmemory.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
XMLPUBFUN void XMLCALL xmlInitGlobals(void);
|
||||
XMLPUBFUN void XMLCALL xmlCleanupGlobals(void);
|
||||
|
||||
typedef xmlParserInputBufferPtr (*xmlParserInputBufferCreateFilenameFunc) (const char *URI, xmlCharEncoding enc);
|
||||
typedef xmlOutputBufferPtr (*xmlOutputBufferCreateFilenameFunc) (const char *URI, xmlCharEncodingHandlerPtr encoder, int compression);
|
||||
XMLPUBFUN xmlParserInputBufferCreateFilenameFunc
|
||||
XMLCALL xmlParserInputBufferCreateFilenameDefault (xmlParserInputBufferCreateFilenameFunc func);
|
||||
XMLPUBFUN xmlOutputBufferCreateFilenameFunc
|
||||
XMLCALL xmlOutputBufferCreateFilenameDefault (xmlOutputBufferCreateFilenameFunc func);
|
||||
|
||||
/*
|
||||
* Externally global symbols which need to be protected for backwards
|
||||
* compatibility support.
|
||||
*/
|
||||
|
||||
#undef docbDefaultSAXHandler
|
||||
#undef htmlDefaultSAXHandler
|
||||
#undef oldXMLWDcompatibility
|
||||
#undef xmlBufferAllocScheme
|
||||
#undef xmlDefaultBufferSize
|
||||
#undef xmlDefaultSAXHandler
|
||||
#undef xmlDefaultSAXLocator
|
||||
#undef xmlDoValidityCheckingDefaultValue
|
||||
#undef xmlFree
|
||||
#undef xmlGenericError
|
||||
#undef xmlStructuredError
|
||||
#undef xmlGenericErrorContext
|
||||
#undef xmlGetWarningsDefaultValue
|
||||
#undef xmlIndentTreeOutput
|
||||
#undef xmlTreeIndentString
|
||||
#undef xmlKeepBlanksDefaultValue
|
||||
#undef xmlLineNumbersDefaultValue
|
||||
#undef xmlLoadExtDtdDefaultValue
|
||||
#undef xmlMalloc
|
||||
#undef xmlMallocAtomic
|
||||
#undef xmlMemStrdup
|
||||
#undef xmlParserDebugEntities
|
||||
#undef xmlParserVersion
|
||||
#undef xmlPedanticParserDefaultValue
|
||||
#undef xmlRealloc
|
||||
#undef xmlSaveNoEmptyTags
|
||||
#undef xmlSubstituteEntitiesDefaultValue
|
||||
#undef xmlRegisterNodeDefaultValue
|
||||
#undef xmlDeregisterNodeDefaultValue
|
||||
#undef xmlLastError
|
||||
#undef xmlParserInputBufferCreateFilenameValue
|
||||
#undef xmlOutputBufferCreateFilenameValue
|
||||
|
||||
typedef void (*xmlRegisterNodeFunc) (xmlNodePtr node);
|
||||
typedef void (*xmlDeregisterNodeFunc) (xmlNodePtr node);
|
||||
|
||||
typedef struct _xmlGlobalState xmlGlobalState;
|
||||
typedef xmlGlobalState *xmlGlobalStatePtr;
|
||||
struct _xmlGlobalState
|
||||
{
|
||||
const char *xmlParserVersion;
|
||||
|
||||
xmlSAXLocator xmlDefaultSAXLocator;
|
||||
xmlSAXHandlerV1 xmlDefaultSAXHandler;
|
||||
xmlSAXHandlerV1 docbDefaultSAXHandler;
|
||||
xmlSAXHandlerV1 htmlDefaultSAXHandler;
|
||||
|
||||
xmlFreeFunc xmlFree;
|
||||
xmlMallocFunc xmlMalloc;
|
||||
xmlStrdupFunc xmlMemStrdup;
|
||||
xmlReallocFunc xmlRealloc;
|
||||
|
||||
xmlGenericErrorFunc xmlGenericError;
|
||||
xmlStructuredErrorFunc xmlStructuredError;
|
||||
void *xmlGenericErrorContext;
|
||||
|
||||
int oldXMLWDcompatibility;
|
||||
|
||||
xmlBufferAllocationScheme xmlBufferAllocScheme;
|
||||
int xmlDefaultBufferSize;
|
||||
|
||||
int xmlSubstituteEntitiesDefaultValue;
|
||||
int xmlDoValidityCheckingDefaultValue;
|
||||
int xmlGetWarningsDefaultValue;
|
||||
int xmlKeepBlanksDefaultValue;
|
||||
int xmlLineNumbersDefaultValue;
|
||||
int xmlLoadExtDtdDefaultValue;
|
||||
int xmlParserDebugEntities;
|
||||
int xmlPedanticParserDefaultValue;
|
||||
|
||||
int xmlSaveNoEmptyTags;
|
||||
int xmlIndentTreeOutput;
|
||||
const char *xmlTreeIndentString;
|
||||
|
||||
xmlRegisterNodeFunc xmlRegisterNodeDefaultValue;
|
||||
xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue;
|
||||
|
||||
xmlMallocFunc xmlMallocAtomic;
|
||||
xmlError xmlLastError;
|
||||
|
||||
xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue;
|
||||
xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include <libxml/threads.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
XMLPUBFUN void XMLCALL xmlInitializeGlobalState(xmlGlobalStatePtr gs);
|
||||
|
||||
XMLPUBFUN void XMLCALL xmlThrDefSetGenericErrorFunc(void *ctx, xmlGenericErrorFunc handler);
|
||||
|
||||
XMLPUBFUN void XMLCALL xmlThrDefSetStructuredErrorFunc(void *ctx, xmlStructuredErrorFunc handler);
|
||||
|
||||
XMLPUBFUN xmlRegisterNodeFunc XMLCALL xmlRegisterNodeDefault(xmlRegisterNodeFunc func);
|
||||
XMLPUBFUN xmlRegisterNodeFunc XMLCALL xmlThrDefRegisterNodeDefault(xmlRegisterNodeFunc func);
|
||||
XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlDeregisterNodeDefault(xmlDeregisterNodeFunc func);
|
||||
XMLPUBFUN xmlDeregisterNodeFunc XMLCALL xmlThrDefDeregisterNodeDefault(xmlDeregisterNodeFunc func);
|
||||
|
||||
XMLPUBFUN xmlOutputBufferCreateFilenameFunc XMLCALL
|
||||
xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc func);
|
||||
XMLPUBFUN xmlParserInputBufferCreateFilenameFunc XMLCALL
|
||||
xmlThrDefParserInputBufferCreateFilenameDefault(xmlParserInputBufferCreateFilenameFunc func);
|
||||
|
||||
/** DOC_DISABLE */
|
||||
/*
|
||||
* In general the memory allocation entry points are not kept
|
||||
* thread specific but this can be overridden by LIBXML_THREAD_ALLOC_ENABLED
|
||||
* - xmlMalloc
|
||||
* - xmlMallocAtomic
|
||||
* - xmlRealloc
|
||||
* - xmlMemStrdup
|
||||
* - xmlFree
|
||||
*/
|
||||
|
||||
#ifdef LIBXML_THREAD_ALLOC_ENABLED
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
XMLPUBFUN xmlMallocFunc * XMLCALL __xmlMalloc(void);
|
||||
#define xmlMalloc \
|
||||
(*(__xmlMalloc()))
|
||||
#else
|
||||
XMLPUBVAR xmlMallocFunc xmlMalloc;
|
||||
#endif
|
||||
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
XMLPUBFUN xmlMallocFunc * XMLCALL __xmlMallocAtomic(void);
|
||||
#define xmlMallocAtomic \
|
||||
(*(__xmlMallocAtomic()))
|
||||
#else
|
||||
XMLPUBVAR xmlMallocFunc xmlMallocAtomic;
|
||||
#endif
|
||||
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
XMLPUBFUN xmlReallocFunc * XMLCALL __xmlRealloc(void);
|
||||
#define xmlRealloc \
|
||||
(*(__xmlRealloc()))
|
||||
#else
|
||||
XMLPUBVAR xmlReallocFunc xmlRealloc;
|
||||
#endif
|
||||
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
XMLPUBFUN xmlFreeFunc * XMLCALL __xmlFree(void);
|
||||
#define xmlFree \
|
||||
(*(__xmlFree()))
|
||||
#else
|
||||
XMLPUBVAR xmlFreeFunc xmlFree;
|
||||
#endif
|
||||
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
XMLPUBFUN xmlStrdupFunc * XMLCALL __xmlMemStrdup(void);
|
||||
#define xmlMemStrdup \
|
||||
(*(__xmlMemStrdup()))
|
||||
#else
|
||||
XMLPUBVAR xmlStrdupFunc xmlMemStrdup;
|
||||
#endif
|
||||
|
||||
#else /* !LIBXML_THREAD_ALLOC_ENABLED */
|
||||
XMLPUBVAR xmlMallocFunc xmlMalloc;
|
||||
XMLPUBVAR xmlMallocFunc xmlMallocAtomic;
|
||||
XMLPUBVAR xmlReallocFunc xmlRealloc;
|
||||
XMLPUBVAR xmlFreeFunc xmlFree;
|
||||
XMLPUBVAR xmlStrdupFunc xmlMemStrdup;
|
||||
#endif /* LIBXML_THREAD_ALLOC_ENABLED */
|
||||
|
||||
#ifdef LIBXML_DOCB_ENABLED
|
||||
XMLPUBFUN xmlSAXHandlerV1 * XMLCALL __docbDefaultSAXHandler(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define docbDefaultSAXHandler \
|
||||
(*(__docbDefaultSAXHandler()))
|
||||
#else
|
||||
XMLPUBVAR xmlSAXHandlerV1 docbDefaultSAXHandler;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef LIBXML_HTML_ENABLED
|
||||
XMLPUBFUN xmlSAXHandlerV1 * XMLCALL __htmlDefaultSAXHandler(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define htmlDefaultSAXHandler \
|
||||
(*(__htmlDefaultSAXHandler()))
|
||||
#else
|
||||
XMLPUBVAR xmlSAXHandlerV1 htmlDefaultSAXHandler;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
XMLPUBFUN xmlError * XMLCALL __xmlLastError(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define xmlLastError \
|
||||
(*(__xmlLastError()))
|
||||
#else
|
||||
XMLPUBVAR xmlError xmlLastError;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Everything starting from the line below is
|
||||
* Automatically generated by build_glob.py.
|
||||
* Do not modify the previous line.
|
||||
*/
|
||||
|
||||
|
||||
XMLPUBFUN int * XMLCALL __oldXMLWDcompatibility(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define oldXMLWDcompatibility \
|
||||
(*(__oldXMLWDcompatibility()))
|
||||
#else
|
||||
XMLPUBVAR int oldXMLWDcompatibility;
|
||||
#endif
|
||||
|
||||
XMLPUBFUN xmlBufferAllocationScheme * XMLCALL __xmlBufferAllocScheme(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define xmlBufferAllocScheme \
|
||||
(*(__xmlBufferAllocScheme()))
|
||||
#else
|
||||
XMLPUBVAR xmlBufferAllocationScheme xmlBufferAllocScheme;
|
||||
#endif
|
||||
XMLPUBFUN xmlBufferAllocationScheme XMLCALL xmlThrDefBufferAllocScheme(xmlBufferAllocationScheme v);
|
||||
|
||||
XMLPUBFUN int * XMLCALL __xmlDefaultBufferSize(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define xmlDefaultBufferSize \
|
||||
(*(__xmlDefaultBufferSize()))
|
||||
#else
|
||||
XMLPUBVAR int xmlDefaultBufferSize;
|
||||
#endif
|
||||
XMLPUBFUN int XMLCALL xmlThrDefDefaultBufferSize(int v);
|
||||
|
||||
XMLPUBFUN xmlSAXHandlerV1 * XMLCALL __xmlDefaultSAXHandler(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define xmlDefaultSAXHandler \
|
||||
(*(__xmlDefaultSAXHandler()))
|
||||
#else
|
||||
XMLPUBVAR xmlSAXHandlerV1 xmlDefaultSAXHandler;
|
||||
#endif
|
||||
|
||||
XMLPUBFUN xmlSAXLocator * XMLCALL __xmlDefaultSAXLocator(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define xmlDefaultSAXLocator \
|
||||
(*(__xmlDefaultSAXLocator()))
|
||||
#else
|
||||
XMLPUBVAR xmlSAXLocator xmlDefaultSAXLocator;
|
||||
#endif
|
||||
|
||||
XMLPUBFUN int * XMLCALL __xmlDoValidityCheckingDefaultValue(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define xmlDoValidityCheckingDefaultValue \
|
||||
(*(__xmlDoValidityCheckingDefaultValue()))
|
||||
#else
|
||||
XMLPUBVAR int xmlDoValidityCheckingDefaultValue;
|
||||
#endif
|
||||
XMLPUBFUN int XMLCALL xmlThrDefDoValidityCheckingDefaultValue(int v);
|
||||
|
||||
XMLPUBFUN xmlGenericErrorFunc * XMLCALL __xmlGenericError(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define xmlGenericError \
|
||||
(*(__xmlGenericError()))
|
||||
#else
|
||||
XMLPUBVAR xmlGenericErrorFunc xmlGenericError;
|
||||
#endif
|
||||
|
||||
XMLPUBFUN xmlStructuredErrorFunc * XMLCALL __xmlStructuredError(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define xmlStructuredError \
|
||||
(*(__xmlStructuredError()))
|
||||
#else
|
||||
XMLPUBVAR xmlStructuredErrorFunc xmlStructuredError;
|
||||
#endif
|
||||
|
||||
XMLPUBFUN void * * XMLCALL __xmlGenericErrorContext(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define xmlGenericErrorContext \
|
||||
(*(__xmlGenericErrorContext()))
|
||||
#else
|
||||
XMLPUBVAR void * xmlGenericErrorContext;
|
||||
#endif
|
||||
|
||||
XMLPUBFUN int * XMLCALL __xmlGetWarningsDefaultValue(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define xmlGetWarningsDefaultValue \
|
||||
(*(__xmlGetWarningsDefaultValue()))
|
||||
#else
|
||||
XMLPUBVAR int xmlGetWarningsDefaultValue;
|
||||
#endif
|
||||
XMLPUBFUN int XMLCALL xmlThrDefGetWarningsDefaultValue(int v);
|
||||
|
||||
XMLPUBFUN int * XMLCALL __xmlIndentTreeOutput(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define xmlIndentTreeOutput \
|
||||
(*(__xmlIndentTreeOutput()))
|
||||
#else
|
||||
XMLPUBVAR int xmlIndentTreeOutput;
|
||||
#endif
|
||||
XMLPUBFUN int XMLCALL xmlThrDefIndentTreeOutput(int v);
|
||||
|
||||
XMLPUBFUN const char * * XMLCALL __xmlTreeIndentString(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define xmlTreeIndentString \
|
||||
(*(__xmlTreeIndentString()))
|
||||
#else
|
||||
XMLPUBVAR const char * xmlTreeIndentString;
|
||||
#endif
|
||||
XMLPUBFUN const char * XMLCALL xmlThrDefTreeIndentString(const char * v);
|
||||
|
||||
XMLPUBFUN int * XMLCALL __xmlKeepBlanksDefaultValue(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define xmlKeepBlanksDefaultValue \
|
||||
(*(__xmlKeepBlanksDefaultValue()))
|
||||
#else
|
||||
XMLPUBVAR int xmlKeepBlanksDefaultValue;
|
||||
#endif
|
||||
XMLPUBFUN int XMLCALL xmlThrDefKeepBlanksDefaultValue(int v);
|
||||
|
||||
XMLPUBFUN int * XMLCALL __xmlLineNumbersDefaultValue(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define xmlLineNumbersDefaultValue \
|
||||
(*(__xmlLineNumbersDefaultValue()))
|
||||
#else
|
||||
XMLPUBVAR int xmlLineNumbersDefaultValue;
|
||||
#endif
|
||||
XMLPUBFUN int XMLCALL xmlThrDefLineNumbersDefaultValue(int v);
|
||||
|
||||
XMLPUBFUN int * XMLCALL __xmlLoadExtDtdDefaultValue(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define xmlLoadExtDtdDefaultValue \
|
||||
(*(__xmlLoadExtDtdDefaultValue()))
|
||||
#else
|
||||
XMLPUBVAR int xmlLoadExtDtdDefaultValue;
|
||||
#endif
|
||||
XMLPUBFUN int XMLCALL xmlThrDefLoadExtDtdDefaultValue(int v);
|
||||
|
||||
XMLPUBFUN int * XMLCALL __xmlParserDebugEntities(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define xmlParserDebugEntities \
|
||||
(*(__xmlParserDebugEntities()))
|
||||
#else
|
||||
XMLPUBVAR int xmlParserDebugEntities;
|
||||
#endif
|
||||
XMLPUBFUN int XMLCALL xmlThrDefParserDebugEntities(int v);
|
||||
|
||||
XMLPUBFUN const char * * XMLCALL __xmlParserVersion(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define xmlParserVersion \
|
||||
(*(__xmlParserVersion()))
|
||||
#else
|
||||
XMLPUBVAR const char * xmlParserVersion;
|
||||
#endif
|
||||
|
||||
XMLPUBFUN int * XMLCALL __xmlPedanticParserDefaultValue(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define xmlPedanticParserDefaultValue \
|
||||
(*(__xmlPedanticParserDefaultValue()))
|
||||
#else
|
||||
XMLPUBVAR int xmlPedanticParserDefaultValue;
|
||||
#endif
|
||||
XMLPUBFUN int XMLCALL xmlThrDefPedanticParserDefaultValue(int v);
|
||||
|
||||
XMLPUBFUN int * XMLCALL __xmlSaveNoEmptyTags(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define xmlSaveNoEmptyTags \
|
||||
(*(__xmlSaveNoEmptyTags()))
|
||||
#else
|
||||
XMLPUBVAR int xmlSaveNoEmptyTags;
|
||||
#endif
|
||||
XMLPUBFUN int XMLCALL xmlThrDefSaveNoEmptyTags(int v);
|
||||
|
||||
XMLPUBFUN int * XMLCALL __xmlSubstituteEntitiesDefaultValue(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define xmlSubstituteEntitiesDefaultValue \
|
||||
(*(__xmlSubstituteEntitiesDefaultValue()))
|
||||
#else
|
||||
XMLPUBVAR int xmlSubstituteEntitiesDefaultValue;
|
||||
#endif
|
||||
XMLPUBFUN int XMLCALL xmlThrDefSubstituteEntitiesDefaultValue(int v);
|
||||
|
||||
XMLPUBFUN xmlRegisterNodeFunc * XMLCALL __xmlRegisterNodeDefaultValue(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define xmlRegisterNodeDefaultValue \
|
||||
(*(__xmlRegisterNodeDefaultValue()))
|
||||
#else
|
||||
XMLPUBVAR xmlRegisterNodeFunc xmlRegisterNodeDefaultValue;
|
||||
#endif
|
||||
|
||||
XMLPUBFUN xmlDeregisterNodeFunc * XMLCALL __xmlDeregisterNodeDefaultValue(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define xmlDeregisterNodeDefaultValue \
|
||||
(*(__xmlDeregisterNodeDefaultValue()))
|
||||
#else
|
||||
XMLPUBVAR xmlDeregisterNodeFunc xmlDeregisterNodeDefaultValue;
|
||||
#endif
|
||||
|
||||
XMLPUBFUN xmlParserInputBufferCreateFilenameFunc * XMLCALL __xmlParserInputBufferCreateFilenameValue(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define xmlParserInputBufferCreateFilenameValue \
|
||||
(*(__xmlParserInputBufferCreateFilenameValue()))
|
||||
#else
|
||||
XMLPUBVAR xmlParserInputBufferCreateFilenameFunc xmlParserInputBufferCreateFilenameValue;
|
||||
#endif
|
||||
|
||||
XMLPUBFUN xmlOutputBufferCreateFilenameFunc * XMLCALL __xmlOutputBufferCreateFilenameValue(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define xmlOutputBufferCreateFilenameValue \
|
||||
(*(__xmlOutputBufferCreateFilenameValue()))
|
||||
#else
|
||||
XMLPUBVAR xmlOutputBufferCreateFilenameFunc xmlOutputBufferCreateFilenameValue;
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __XML_GLOBALS_H */
|
||||
233
Extras/LibXML/include/libxml/hash.h
Normal file
233
Extras/LibXML/include/libxml/hash.h
Normal file
@@ -0,0 +1,233 @@
|
||||
/*
|
||||
* Summary: Chained hash tables
|
||||
* Description: This module implements the hash table support used in
|
||||
* various places in the library.
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Bjorn Reese <bjorn.reese@systematic.dk>
|
||||
*/
|
||||
|
||||
#ifndef __XML_HASH_H__
|
||||
#define __XML_HASH_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The hash table.
|
||||
*/
|
||||
typedef struct _xmlHashTable xmlHashTable;
|
||||
typedef xmlHashTable *xmlHashTablePtr;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/dict.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Recent version of gcc produce a warning when a function pointer is assigned
|
||||
* to an object pointer, or vice versa. The following macro is a dirty hack
|
||||
* to allow suppression of the warning. If your architecture has function
|
||||
* pointers which are a different size than a void pointer, there may be some
|
||||
* serious trouble within the library.
|
||||
*/
|
||||
/**
|
||||
* XML_CAST_FPTR:
|
||||
* @fptr: pointer to a function
|
||||
*
|
||||
* Macro to do a casting from an object pointer to a
|
||||
* function pointer without encountering a warning from
|
||||
* gcc
|
||||
*
|
||||
* #define XML_CAST_FPTR(fptr) (*(void **)(&fptr))
|
||||
* This macro violated ISO C aliasing rules (gcc4 on s390 broke)
|
||||
* so it is disabled now
|
||||
*/
|
||||
|
||||
#define XML_CAST_FPTR(fptr) fptr
|
||||
|
||||
|
||||
/*
|
||||
* function types:
|
||||
*/
|
||||
/**
|
||||
* xmlHashDeallocator:
|
||||
* @payload: the data in the hash
|
||||
* @name: the name associated
|
||||
*
|
||||
* Callback to free data from a hash.
|
||||
*/
|
||||
typedef void (*xmlHashDeallocator)(void *payload, xmlChar *name);
|
||||
/**
|
||||
* xmlHashCopier:
|
||||
* @payload: the data in the hash
|
||||
* @name: the name associated
|
||||
*
|
||||
* Callback to copy data from a hash.
|
||||
*
|
||||
* Returns a copy of the data or NULL in case of error.
|
||||
*/
|
||||
typedef void *(*xmlHashCopier)(void *payload, xmlChar *name);
|
||||
/**
|
||||
* xmlHashScanner:
|
||||
* @payload: the data in the hash
|
||||
* @data: extra scannner data
|
||||
* @name: the name associated
|
||||
*
|
||||
* Callback when scanning data in a hash with the simple scanner.
|
||||
*/
|
||||
typedef void (*xmlHashScanner)(void *payload, void *data, xmlChar *name);
|
||||
/**
|
||||
* xmlHashScannerFull:
|
||||
* @payload: the data in the hash
|
||||
* @data: extra scannner data
|
||||
* @name: the name associated
|
||||
* @name2: the second name associated
|
||||
* @name3: the third name associated
|
||||
*
|
||||
* Callback when scanning data in a hash with the full scanner.
|
||||
*/
|
||||
typedef void (*xmlHashScannerFull)(void *payload, void *data,
|
||||
const xmlChar *name, const xmlChar *name2,
|
||||
const xmlChar *name3);
|
||||
|
||||
/*
|
||||
* Constructor and destructor.
|
||||
*/
|
||||
XMLPUBFUN xmlHashTablePtr XMLCALL
|
||||
xmlHashCreate (int size);
|
||||
XMLPUBFUN xmlHashTablePtr XMLCALL
|
||||
xmlHashCreateDict(int size,
|
||||
xmlDictPtr dict);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlHashFree (xmlHashTablePtr table,
|
||||
xmlHashDeallocator f);
|
||||
|
||||
/*
|
||||
* Add a new entry to the hash table.
|
||||
*/
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlHashAddEntry (xmlHashTablePtr table,
|
||||
const xmlChar *name,
|
||||
void *userdata);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlHashUpdateEntry(xmlHashTablePtr table,
|
||||
const xmlChar *name,
|
||||
void *userdata,
|
||||
xmlHashDeallocator f);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlHashAddEntry2(xmlHashTablePtr table,
|
||||
const xmlChar *name,
|
||||
const xmlChar *name2,
|
||||
void *userdata);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlHashUpdateEntry2(xmlHashTablePtr table,
|
||||
const xmlChar *name,
|
||||
const xmlChar *name2,
|
||||
void *userdata,
|
||||
xmlHashDeallocator f);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlHashAddEntry3(xmlHashTablePtr table,
|
||||
const xmlChar *name,
|
||||
const xmlChar *name2,
|
||||
const xmlChar *name3,
|
||||
void *userdata);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlHashUpdateEntry3(xmlHashTablePtr table,
|
||||
const xmlChar *name,
|
||||
const xmlChar *name2,
|
||||
const xmlChar *name3,
|
||||
void *userdata,
|
||||
xmlHashDeallocator f);
|
||||
|
||||
/*
|
||||
* Remove an entry from the hash table.
|
||||
*/
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlHashRemoveEntry(xmlHashTablePtr table, const xmlChar *name,
|
||||
xmlHashDeallocator f);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlHashRemoveEntry2(xmlHashTablePtr table, const xmlChar *name,
|
||||
const xmlChar *name2, xmlHashDeallocator f);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlHashRemoveEntry3(xmlHashTablePtr table, const xmlChar *name,
|
||||
const xmlChar *name2, const xmlChar *name3,
|
||||
xmlHashDeallocator f);
|
||||
|
||||
/*
|
||||
* Retrieve the userdata.
|
||||
*/
|
||||
XMLPUBFUN void * XMLCALL
|
||||
xmlHashLookup (xmlHashTablePtr table,
|
||||
const xmlChar *name);
|
||||
XMLPUBFUN void * XMLCALL
|
||||
xmlHashLookup2 (xmlHashTablePtr table,
|
||||
const xmlChar *name,
|
||||
const xmlChar *name2);
|
||||
XMLPUBFUN void * XMLCALL
|
||||
xmlHashLookup3 (xmlHashTablePtr table,
|
||||
const xmlChar *name,
|
||||
const xmlChar *name2,
|
||||
const xmlChar *name3);
|
||||
XMLPUBFUN void * XMLCALL
|
||||
xmlHashQLookup (xmlHashTablePtr table,
|
||||
const xmlChar *name,
|
||||
const xmlChar *prefix);
|
||||
XMLPUBFUN void * XMLCALL
|
||||
xmlHashQLookup2 (xmlHashTablePtr table,
|
||||
const xmlChar *name,
|
||||
const xmlChar *prefix,
|
||||
const xmlChar *name2,
|
||||
const xmlChar *prefix2);
|
||||
XMLPUBFUN void * XMLCALL
|
||||
xmlHashQLookup3 (xmlHashTablePtr table,
|
||||
const xmlChar *name,
|
||||
const xmlChar *prefix,
|
||||
const xmlChar *name2,
|
||||
const xmlChar *prefix2,
|
||||
const xmlChar *name3,
|
||||
const xmlChar *prefix3);
|
||||
|
||||
/*
|
||||
* Helpers.
|
||||
*/
|
||||
XMLPUBFUN xmlHashTablePtr XMLCALL
|
||||
xmlHashCopy (xmlHashTablePtr table,
|
||||
xmlHashCopier f);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlHashSize (xmlHashTablePtr table);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlHashScan (xmlHashTablePtr table,
|
||||
xmlHashScanner f,
|
||||
void *data);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlHashScan3 (xmlHashTablePtr table,
|
||||
const xmlChar *name,
|
||||
const xmlChar *name2,
|
||||
const xmlChar *name3,
|
||||
xmlHashScanner f,
|
||||
void *data);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlHashScanFull (xmlHashTablePtr table,
|
||||
xmlHashScannerFull f,
|
||||
void *data);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlHashScanFull3(xmlHashTablePtr table,
|
||||
const xmlChar *name,
|
||||
const xmlChar *name2,
|
||||
const xmlChar *name3,
|
||||
xmlHashScannerFull f,
|
||||
void *data);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* ! __XML_HASH_H__ */
|
||||
137
Extras/LibXML/include/libxml/list.h
Normal file
137
Extras/LibXML/include/libxml/list.h
Normal file
@@ -0,0 +1,137 @@
|
||||
/*
|
||||
* Summary: lists interfaces
|
||||
* Description: this module implement the list support used in
|
||||
* various place in the library.
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Gary Pennington <Gary.Pennington@uk.sun.com>
|
||||
*/
|
||||
|
||||
#ifndef __XML_LINK_INCLUDE__
|
||||
#define __XML_LINK_INCLUDE__
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct _xmlLink xmlLink;
|
||||
typedef xmlLink *xmlLinkPtr;
|
||||
|
||||
typedef struct _xmlList xmlList;
|
||||
typedef xmlList *xmlListPtr;
|
||||
|
||||
/**
|
||||
* xmlListDeallocator:
|
||||
* @lk: the data to deallocate
|
||||
*
|
||||
* Callback function used to free data from a list.
|
||||
*/
|
||||
typedef void (*xmlListDeallocator) (xmlLinkPtr lk);
|
||||
/**
|
||||
* xmlListDataCompare:
|
||||
* @data0: the first data
|
||||
* @data1: the second data
|
||||
*
|
||||
* Callback function used to compare 2 data.
|
||||
*
|
||||
* Returns 0 is equality, -1 or 1 otherwise depending on the ordering.
|
||||
*/
|
||||
typedef int (*xmlListDataCompare) (const void *data0, const void *data1);
|
||||
/**
|
||||
* xmlListWalker:
|
||||
* @data: the data found in the list
|
||||
* @user: extra user provided data to the walker
|
||||
*
|
||||
* Callback function used when walking a list with xmlListWalk().
|
||||
*
|
||||
* Returns 0 to stop walking the list, 1 otherwise.
|
||||
*/
|
||||
typedef int (*xmlListWalker) (const void *data, const void *user);
|
||||
|
||||
/* Creation/Deletion */
|
||||
XMLPUBFUN xmlListPtr XMLCALL
|
||||
xmlListCreate (xmlListDeallocator deallocator,
|
||||
xmlListDataCompare compare);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlListDelete (xmlListPtr l);
|
||||
|
||||
/* Basic Operators */
|
||||
XMLPUBFUN void * XMLCALL
|
||||
xmlListSearch (xmlListPtr l,
|
||||
void *data);
|
||||
XMLPUBFUN void * XMLCALL
|
||||
xmlListReverseSearch (xmlListPtr l,
|
||||
void *data);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlListInsert (xmlListPtr l,
|
||||
void *data) ;
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlListAppend (xmlListPtr l,
|
||||
void *data) ;
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlListRemoveFirst (xmlListPtr l,
|
||||
void *data);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlListRemoveLast (xmlListPtr l,
|
||||
void *data);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlListRemoveAll (xmlListPtr l,
|
||||
void *data);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlListClear (xmlListPtr l);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlListEmpty (xmlListPtr l);
|
||||
XMLPUBFUN xmlLinkPtr XMLCALL
|
||||
xmlListFront (xmlListPtr l);
|
||||
XMLPUBFUN xmlLinkPtr XMLCALL
|
||||
xmlListEnd (xmlListPtr l);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlListSize (xmlListPtr l);
|
||||
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlListPopFront (xmlListPtr l);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlListPopBack (xmlListPtr l);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlListPushFront (xmlListPtr l,
|
||||
void *data);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlListPushBack (xmlListPtr l,
|
||||
void *data);
|
||||
|
||||
/* Advanced Operators */
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlListReverse (xmlListPtr l);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlListSort (xmlListPtr l);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlListWalk (xmlListPtr l,
|
||||
xmlListWalker walker,
|
||||
const void *user);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlListReverseWalk (xmlListPtr l,
|
||||
xmlListWalker walker,
|
||||
const void *user);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlListMerge (xmlListPtr l1,
|
||||
xmlListPtr l2);
|
||||
XMLPUBFUN xmlListPtr XMLCALL
|
||||
xmlListDup (const xmlListPtr old);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlListCopy (xmlListPtr cur,
|
||||
const xmlListPtr old);
|
||||
/* Link operators */
|
||||
XMLPUBFUN void * XMLCALL
|
||||
xmlLinkGetData (xmlLinkPtr lk);
|
||||
|
||||
/* xmlListUnique() */
|
||||
/* xmlListSwap */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __XML_LINK_INCLUDE__ */
|
||||
143
Extras/LibXML/include/libxml/nanoftp.h
Normal file
143
Extras/LibXML/include/libxml/nanoftp.h
Normal file
@@ -0,0 +1,143 @@
|
||||
/*
|
||||
* Summary: minimal FTP implementation
|
||||
* Description: minimal FTP implementation allowing to fetch resources
|
||||
* like external subset.
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __NANO_FTP_H__
|
||||
#define __NANO_FTP_H__
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
|
||||
#ifdef LIBXML_FTP_ENABLED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* ftpListCallback:
|
||||
* @userData: user provided data for the callback
|
||||
* @filename: the file name (including "->" when links are shown)
|
||||
* @attrib: the attribute string
|
||||
* @owner: the owner string
|
||||
* @group: the group string
|
||||
* @size: the file size
|
||||
* @links: the link count
|
||||
* @year: the year
|
||||
* @month: the month
|
||||
* @day: the day
|
||||
* @hour: the hour
|
||||
* @minute: the minute
|
||||
*
|
||||
* A callback for the xmlNanoFTPList command.
|
||||
* Note that only one of year and day:minute are specified.
|
||||
*/
|
||||
typedef void (*ftpListCallback) (void *userData,
|
||||
const char *filename, const char *attrib,
|
||||
const char *owner, const char *group,
|
||||
unsigned long size, int links, int year,
|
||||
const char *month, int day, int hour,
|
||||
int minute);
|
||||
/**
|
||||
* ftpDataCallback:
|
||||
* @userData: the user provided context
|
||||
* @data: the data received
|
||||
* @len: its size in bytes
|
||||
*
|
||||
* A callback for the xmlNanoFTPGet command.
|
||||
*/
|
||||
typedef void (*ftpDataCallback) (void *userData,
|
||||
const char *data,
|
||||
int len);
|
||||
|
||||
/*
|
||||
* Init
|
||||
*/
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlNanoFTPInit (void);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlNanoFTPCleanup (void);
|
||||
|
||||
/*
|
||||
* Creating/freeing contexts.
|
||||
*/
|
||||
XMLPUBFUN void * XMLCALL
|
||||
xmlNanoFTPNewCtxt (const char *URL);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlNanoFTPFreeCtxt (void * ctx);
|
||||
XMLPUBFUN void * XMLCALL
|
||||
xmlNanoFTPConnectTo (const char *server,
|
||||
int port);
|
||||
/*
|
||||
* Opening/closing session connections.
|
||||
*/
|
||||
XMLPUBFUN void * XMLCALL
|
||||
xmlNanoFTPOpen (const char *URL);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlNanoFTPConnect (void *ctx);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlNanoFTPClose (void *ctx);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlNanoFTPQuit (void *ctx);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlNanoFTPScanProxy (const char *URL);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlNanoFTPProxy (const char *host,
|
||||
int port,
|
||||
const char *user,
|
||||
const char *passwd,
|
||||
int type);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlNanoFTPUpdateURL (void *ctx,
|
||||
const char *URL);
|
||||
|
||||
/*
|
||||
* Rather internal commands.
|
||||
*/
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlNanoFTPGetResponse (void *ctx);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlNanoFTPCheckResponse (void *ctx);
|
||||
|
||||
/*
|
||||
* CD/DIR/GET handlers.
|
||||
*/
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlNanoFTPCwd (void *ctx,
|
||||
const char *directory);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlNanoFTPDele (void *ctx,
|
||||
const char *file);
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlNanoFTPGetConnection (void *ctx);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlNanoFTPCloseConnection(void *ctx);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlNanoFTPList (void *ctx,
|
||||
ftpListCallback callback,
|
||||
void *userData,
|
||||
const char *filename);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlNanoFTPGetSocket (void *ctx,
|
||||
const char *filename);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlNanoFTPGet (void *ctx,
|
||||
ftpDataCallback callback,
|
||||
void *userData,
|
||||
const char *filename);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlNanoFTPRead (void *ctx,
|
||||
void *dest,
|
||||
int len);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* LIBXML_FTP_ENABLED */
|
||||
#endif /* __NANO_FTP_H__ */
|
||||
81
Extras/LibXML/include/libxml/nanohttp.h
Normal file
81
Extras/LibXML/include/libxml/nanohttp.h
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Summary: minimal HTTP implementation
|
||||
* Description: minimal HTTP implementation allowing to fetch resources
|
||||
* like external subset.
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __NANO_HTTP_H__
|
||||
#define __NANO_HTTP_H__
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
|
||||
#ifdef LIBXML_HTTP_ENABLED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlNanoHTTPInit (void);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlNanoHTTPCleanup (void);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlNanoHTTPScanProxy (const char *URL);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlNanoHTTPFetch (const char *URL,
|
||||
const char *filename,
|
||||
char **contentType);
|
||||
XMLPUBFUN void * XMLCALL
|
||||
xmlNanoHTTPMethod (const char *URL,
|
||||
const char *method,
|
||||
const char *input,
|
||||
char **contentType,
|
||||
const char *headers,
|
||||
int ilen);
|
||||
XMLPUBFUN void * XMLCALL
|
||||
xmlNanoHTTPMethodRedir (const char *URL,
|
||||
const char *method,
|
||||
const char *input,
|
||||
char **contentType,
|
||||
char **redir,
|
||||
const char *headers,
|
||||
int ilen);
|
||||
XMLPUBFUN void * XMLCALL
|
||||
xmlNanoHTTPOpen (const char *URL,
|
||||
char **contentType);
|
||||
XMLPUBFUN void * XMLCALL
|
||||
xmlNanoHTTPOpenRedir (const char *URL,
|
||||
char **contentType,
|
||||
char **redir);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlNanoHTTPReturnCode (void *ctx);
|
||||
XMLPUBFUN const char * XMLCALL
|
||||
xmlNanoHTTPAuthHeader (void *ctx);
|
||||
XMLPUBFUN const char * XMLCALL
|
||||
xmlNanoHTTPRedir (void *ctx);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlNanoHTTPContentLength( void * ctx );
|
||||
XMLPUBFUN const char * XMLCALL
|
||||
xmlNanoHTTPEncoding (void *ctx);
|
||||
XMLPUBFUN const char * XMLCALL
|
||||
xmlNanoHTTPMimeType (void *ctx);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlNanoHTTPRead (void *ctx,
|
||||
void *dest,
|
||||
int len);
|
||||
#ifdef LIBXML_OUTPUT_ENABLED
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlNanoHTTPSave (void *ctxt,
|
||||
const char *filename);
|
||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlNanoHTTPClose (void *ctx);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LIBXML_HTTP_ENABLED */
|
||||
#endif /* __NANO_HTTP_H__ */
|
||||
1171
Extras/LibXML/include/libxml/parser.h
Normal file
1171
Extras/LibXML/include/libxml/parser.h
Normal file
File diff suppressed because it is too large
Load Diff
602
Extras/LibXML/include/libxml/parserInternals.h
Normal file
602
Extras/LibXML/include/libxml/parserInternals.h
Normal file
@@ -0,0 +1,602 @@
|
||||
/*
|
||||
* Summary: internals routines exported by the parser.
|
||||
* Description: this module exports a number of internal parsing routines
|
||||
* they are not really all intended for applications but
|
||||
* can prove useful doing low level processing.
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __XML_PARSER_INTERNALS_H__
|
||||
#define __XML_PARSER_INTERNALS_H__
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/HTMLparser.h>
|
||||
#include <libxml/chvalid.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* xmlParserMaxDepth:
|
||||
*
|
||||
* arbitrary depth limit for the XML documents that we allow to
|
||||
* process. This is not a limitation of the parser but a safety
|
||||
* boundary feature.
|
||||
*/
|
||||
XMLPUBVAR unsigned int xmlParserMaxDepth;
|
||||
|
||||
/**
|
||||
* XML_MAX_NAMELEN:
|
||||
*
|
||||
* Identifiers can be longer, but this will be more costly
|
||||
* at runtime.
|
||||
*/
|
||||
#define XML_MAX_NAMELEN 100
|
||||
|
||||
/**
|
||||
* INPUT_CHUNK:
|
||||
*
|
||||
* The parser tries to always have that amount of input ready.
|
||||
* One of the point is providing context when reporting errors.
|
||||
*/
|
||||
#define INPUT_CHUNK 250
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* UNICODE version of the macros. *
|
||||
* *
|
||||
************************************************************************/
|
||||
/**
|
||||
* IS_BYTE_CHAR:
|
||||
* @c: an byte value (int)
|
||||
*
|
||||
* Macro to check the following production in the XML spec:
|
||||
*
|
||||
* [2] Char ::= #x9 | #xA | #xD | [#x20...]
|
||||
* any byte character in the accepted range
|
||||
*/
|
||||
#define IS_BYTE_CHAR(c) xmlIsChar_ch(c)
|
||||
|
||||
/**
|
||||
* IS_CHAR:
|
||||
* @c: an UNICODE value (int)
|
||||
*
|
||||
* Macro to check the following production in the XML spec:
|
||||
*
|
||||
* [2] Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD]
|
||||
* | [#x10000-#x10FFFF]
|
||||
* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF.
|
||||
*/
|
||||
#define IS_CHAR(c) xmlIsCharQ(c)
|
||||
|
||||
/**
|
||||
* IS_CHAR_CH:
|
||||
* @c: an xmlChar (usually an unsigned char)
|
||||
*
|
||||
* Behaves like IS_CHAR on single-byte value
|
||||
*/
|
||||
#define IS_CHAR_CH(c) xmlIsChar_ch(c)
|
||||
|
||||
/**
|
||||
* IS_BLANK:
|
||||
* @c: an UNICODE value (int)
|
||||
*
|
||||
* Macro to check the following production in the XML spec:
|
||||
*
|
||||
* [3] S ::= (#x20 | #x9 | #xD | #xA)+
|
||||
*/
|
||||
#define IS_BLANK(c) xmlIsBlankQ(c)
|
||||
|
||||
/**
|
||||
* IS_BLANK_CH:
|
||||
* @c: an xmlChar value (normally unsigned char)
|
||||
*
|
||||
* Behaviour same as IS_BLANK
|
||||
*/
|
||||
#define IS_BLANK_CH(c) xmlIsBlank_ch(c)
|
||||
|
||||
/**
|
||||
* IS_BASECHAR:
|
||||
* @c: an UNICODE value (int)
|
||||
*
|
||||
* Macro to check the following production in the XML spec:
|
||||
*
|
||||
* [85] BaseChar ::= ... long list see REC ...
|
||||
*/
|
||||
#define IS_BASECHAR(c) xmlIsBaseCharQ(c)
|
||||
|
||||
/**
|
||||
* IS_DIGIT:
|
||||
* @c: an UNICODE value (int)
|
||||
*
|
||||
* Macro to check the following production in the XML spec:
|
||||
*
|
||||
* [88] Digit ::= ... long list see REC ...
|
||||
*/
|
||||
#define IS_DIGIT(c) xmlIsDigitQ(c)
|
||||
|
||||
/**
|
||||
* IS_DIGIT_CH:
|
||||
* @c: an xmlChar value (usually an unsigned char)
|
||||
*
|
||||
* Behaves like IS_DIGIT but with a single byte argument
|
||||
*/
|
||||
#define IS_DIGIT_CH(c) xmlIsDigit_ch(c)
|
||||
|
||||
/**
|
||||
* IS_COMBINING:
|
||||
* @c: an UNICODE value (int)
|
||||
*
|
||||
* Macro to check the following production in the XML spec:
|
||||
*
|
||||
* [87] CombiningChar ::= ... long list see REC ...
|
||||
*/
|
||||
#define IS_COMBINING(c) xmlIsCombiningQ(c)
|
||||
|
||||
/**
|
||||
* IS_COMBINING_CH:
|
||||
* @c: an xmlChar (usually an unsigned char)
|
||||
*
|
||||
* Always false (all combining chars > 0xff)
|
||||
*/
|
||||
#define IS_COMBINING_CH(c) 0
|
||||
|
||||
/**
|
||||
* IS_EXTENDER:
|
||||
* @c: an UNICODE value (int)
|
||||
*
|
||||
* Macro to check the following production in the XML spec:
|
||||
*
|
||||
*
|
||||
* [89] Extender ::= #x00B7 | #x02D0 | #x02D1 | #x0387 | #x0640 |
|
||||
* #x0E46 | #x0EC6 | #x3005 | [#x3031-#x3035] |
|
||||
* [#x309D-#x309E] | [#x30FC-#x30FE]
|
||||
*/
|
||||
#define IS_EXTENDER(c) xmlIsExtenderQ(c)
|
||||
|
||||
/**
|
||||
* IS_EXTENDER_CH:
|
||||
* @c: an xmlChar value (usually an unsigned char)
|
||||
*
|
||||
* Behaves like IS_EXTENDER but with a single-byte argument
|
||||
*/
|
||||
#define IS_EXTENDER_CH(c) xmlIsExtender_ch(c)
|
||||
|
||||
/**
|
||||
* IS_IDEOGRAPHIC:
|
||||
* @c: an UNICODE value (int)
|
||||
*
|
||||
* Macro to check the following production in the XML spec:
|
||||
*
|
||||
*
|
||||
* [86] Ideographic ::= [#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029]
|
||||
*/
|
||||
#define IS_IDEOGRAPHIC(c) xmlIsIdeographicQ(c)
|
||||
|
||||
/**
|
||||
* IS_LETTER:
|
||||
* @c: an UNICODE value (int)
|
||||
*
|
||||
* Macro to check the following production in the XML spec:
|
||||
*
|
||||
*
|
||||
* [84] Letter ::= BaseChar | Ideographic
|
||||
*/
|
||||
#define IS_LETTER(c) (IS_BASECHAR(c) || IS_IDEOGRAPHIC(c))
|
||||
|
||||
/**
|
||||
* IS_LETTER_CH:
|
||||
* @c: an xmlChar value (normally unsigned char)
|
||||
*
|
||||
* Macro behaves like IS_LETTER, but only check base chars
|
||||
*
|
||||
*/
|
||||
#define IS_LETTER_CH(c) xmlIsBaseChar_ch(c)
|
||||
|
||||
/**
|
||||
* IS_ASCII_LETTER:
|
||||
* @c: an xmlChar value
|
||||
*
|
||||
* Macro to check [a-zA-Z]
|
||||
*
|
||||
*/
|
||||
#define IS_ASCII_LETTER(c) (((0x41 <= (c)) && ((c) <= 0x5a)) || \
|
||||
((0x61 <= (c)) && ((c) <= 0x7a)))
|
||||
|
||||
/**
|
||||
* IS_ASCII_DIGIT:
|
||||
* @c: an xmlChar value
|
||||
*
|
||||
* Macro to check [0-9]
|
||||
*
|
||||
*/
|
||||
#define IS_ASCII_DIGIT(c) ((0x30 <= (c)) && ((c) <= 0x39))
|
||||
|
||||
/**
|
||||
* IS_PUBIDCHAR:
|
||||
* @c: an UNICODE value (int)
|
||||
*
|
||||
* Macro to check the following production in the XML spec:
|
||||
*
|
||||
*
|
||||
* [13] PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%]
|
||||
*/
|
||||
#define IS_PUBIDCHAR(c) xmlIsPubidCharQ(c)
|
||||
|
||||
/**
|
||||
* IS_PUBIDCHAR_CH:
|
||||
* @c: an xmlChar value (normally unsigned char)
|
||||
*
|
||||
* Same as IS_PUBIDCHAR but for single-byte value
|
||||
*/
|
||||
#define IS_PUBIDCHAR_CH(c) xmlIsPubidChar_ch(c)
|
||||
|
||||
/**
|
||||
* SKIP_EOL:
|
||||
* @p: and UTF8 string pointer
|
||||
*
|
||||
* Skips the end of line chars.
|
||||
*/
|
||||
#define SKIP_EOL(p) \
|
||||
if (*(p) == 0x13) { p++ ; if (*(p) == 0x10) p++; } \
|
||||
if (*(p) == 0x10) { p++ ; if (*(p) == 0x13) p++; }
|
||||
|
||||
/**
|
||||
* MOVETO_ENDTAG:
|
||||
* @p: and UTF8 string pointer
|
||||
*
|
||||
* Skips to the next '>' char.
|
||||
*/
|
||||
#define MOVETO_ENDTAG(p) \
|
||||
while ((*p) && (*(p) != '>')) (p)++
|
||||
|
||||
/**
|
||||
* MOVETO_STARTTAG:
|
||||
* @p: and UTF8 string pointer
|
||||
*
|
||||
* Skips to the next '<' char.
|
||||
*/
|
||||
#define MOVETO_STARTTAG(p) \
|
||||
while ((*p) && (*(p) != '<')) (p)++
|
||||
|
||||
/**
|
||||
* Global variables used for predefined strings.
|
||||
*/
|
||||
XMLPUBVAR const xmlChar xmlStringText[];
|
||||
XMLPUBVAR const xmlChar xmlStringTextNoenc[];
|
||||
XMLPUBVAR const xmlChar xmlStringComment[];
|
||||
|
||||
/*
|
||||
* Function to finish the work of the macros where needed.
|
||||
*/
|
||||
XMLPUBFUN int XMLCALL xmlIsLetter (int c);
|
||||
|
||||
/**
|
||||
* Parser context.
|
||||
*/
|
||||
XMLPUBFUN xmlParserCtxtPtr XMLCALL
|
||||
xmlCreateFileParserCtxt (const char *filename);
|
||||
XMLPUBFUN xmlParserCtxtPtr XMLCALL
|
||||
xmlCreateURLParserCtxt (const char *filename,
|
||||
int options);
|
||||
XMLPUBFUN xmlParserCtxtPtr XMLCALL
|
||||
xmlCreateMemoryParserCtxt(const char *buffer,
|
||||
intptr_t size);
|
||||
XMLPUBFUN xmlParserCtxtPtr XMLCALL
|
||||
xmlCreateEntityParserCtxt(const xmlChar *URL,
|
||||
const xmlChar *ID,
|
||||
const xmlChar *base);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSwitchEncoding (xmlParserCtxtPtr ctxt,
|
||||
xmlCharEncoding enc);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSwitchToEncoding (xmlParserCtxtPtr ctxt,
|
||||
xmlCharEncodingHandlerPtr handler);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSwitchInputEncoding (xmlParserCtxtPtr ctxt,
|
||||
xmlParserInputPtr input,
|
||||
xmlCharEncodingHandlerPtr handler);
|
||||
|
||||
#ifdef IN_LIBXML
|
||||
/* internal error reporting */
|
||||
XMLPUBFUN void XMLCALL
|
||||
__xmlErrEncoding (xmlParserCtxtPtr ctxt,
|
||||
xmlParserErrors xmlerr,
|
||||
const char *msg,
|
||||
const xmlChar * str1,
|
||||
const xmlChar * str2);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Input Streams.
|
||||
*/
|
||||
XMLPUBFUN xmlParserInputPtr XMLCALL
|
||||
xmlNewStringInputStream (xmlParserCtxtPtr ctxt,
|
||||
const xmlChar *buffer);
|
||||
XMLPUBFUN xmlParserInputPtr XMLCALL
|
||||
xmlNewEntityInputStream (xmlParserCtxtPtr ctxt,
|
||||
xmlEntityPtr entity);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlPushInput (xmlParserCtxtPtr ctxt,
|
||||
xmlParserInputPtr input);
|
||||
XMLPUBFUN xmlChar XMLCALL
|
||||
xmlPopInput (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlFreeInputStream (xmlParserInputPtr input);
|
||||
XMLPUBFUN xmlParserInputPtr XMLCALL
|
||||
xmlNewInputFromFile (xmlParserCtxtPtr ctxt,
|
||||
const char *filename);
|
||||
XMLPUBFUN xmlParserInputPtr XMLCALL
|
||||
xmlNewInputStream (xmlParserCtxtPtr ctxt);
|
||||
|
||||
/**
|
||||
* Namespaces.
|
||||
*/
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlSplitQName (xmlParserCtxtPtr ctxt,
|
||||
const xmlChar *name,
|
||||
xmlChar **prefix);
|
||||
|
||||
/**
|
||||
* Generic production rules.
|
||||
*/
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
xmlParseName (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlParseNmtoken (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlParseEntityValue (xmlParserCtxtPtr ctxt,
|
||||
xmlChar **orig);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlParseAttValue (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlParseSystemLiteral (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlParsePubidLiteral (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlParseCharData (xmlParserCtxtPtr ctxt,
|
||||
int cdata);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlParseExternalID (xmlParserCtxtPtr ctxt,
|
||||
xmlChar **publicID,
|
||||
int strict);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlParseComment (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
xmlParsePITarget (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlParsePI (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlParseNotationDecl (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlParseEntityDecl (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlParseDefaultDecl (xmlParserCtxtPtr ctxt,
|
||||
xmlChar **value);
|
||||
XMLPUBFUN xmlEnumerationPtr XMLCALL
|
||||
xmlParseNotationType (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN xmlEnumerationPtr XMLCALL
|
||||
xmlParseEnumerationType (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlParseEnumeratedType (xmlParserCtxtPtr ctxt,
|
||||
xmlEnumerationPtr *tree);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlParseAttributeType (xmlParserCtxtPtr ctxt,
|
||||
xmlEnumerationPtr *tree);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlParseAttributeListDecl(xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN xmlElementContentPtr XMLCALL
|
||||
xmlParseElementMixedContentDecl
|
||||
(xmlParserCtxtPtr ctxt,
|
||||
int inputchk);
|
||||
XMLPUBFUN xmlElementContentPtr XMLCALL
|
||||
xmlParseElementChildrenContentDecl
|
||||
(xmlParserCtxtPtr ctxt,
|
||||
int inputchk);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlParseElementContentDecl(xmlParserCtxtPtr ctxt,
|
||||
const xmlChar *name,
|
||||
xmlElementContentPtr *result);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlParseElementDecl (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlParseMarkupDecl (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlParseCharRef (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN xmlEntityPtr XMLCALL
|
||||
xmlParseEntityRef (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlParseReference (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlParsePEReference (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlParseDocTypeDecl (xmlParserCtxtPtr ctxt);
|
||||
#ifdef LIBXML_SAX1_ENABLED
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
xmlParseAttribute (xmlParserCtxtPtr ctxt,
|
||||
xmlChar **value);
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
xmlParseStartTag (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlParseEndTag (xmlParserCtxtPtr ctxt);
|
||||
#endif /* LIBXML_SAX1_ENABLED */
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlParseCDSect (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlParseContent (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlParseElement (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlParseVersionNum (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlParseVersionInfo (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlParseEncName (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
xmlParseEncodingDecl (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlParseSDDecl (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlParseXMLDecl (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlParseTextDecl (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlParseMisc (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlParseExternalSubset (xmlParserCtxtPtr ctxt,
|
||||
const xmlChar *ExternalID,
|
||||
const xmlChar *SystemID);
|
||||
/**
|
||||
* XML_SUBSTITUTE_NONE:
|
||||
*
|
||||
* If no entities need to be substituted.
|
||||
*/
|
||||
#define XML_SUBSTITUTE_NONE 0
|
||||
/**
|
||||
* XML_SUBSTITUTE_REF:
|
||||
*
|
||||
* Whether general entities need to be substituted.
|
||||
*/
|
||||
#define XML_SUBSTITUTE_REF 1
|
||||
/**
|
||||
* XML_SUBSTITUTE_PEREF:
|
||||
*
|
||||
* Whether parameter entities need to be substituted.
|
||||
*/
|
||||
#define XML_SUBSTITUTE_PEREF 2
|
||||
/**
|
||||
* XML_SUBSTITUTE_BOTH:
|
||||
*
|
||||
* Both general and parameter entities need to be substituted.
|
||||
*/
|
||||
#define XML_SUBSTITUTE_BOTH 3
|
||||
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlStringDecodeEntities (xmlParserCtxtPtr ctxt,
|
||||
const xmlChar *str,
|
||||
int what,
|
||||
xmlChar end,
|
||||
xmlChar end2,
|
||||
xmlChar end3);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlStringLenDecodeEntities (xmlParserCtxtPtr ctxt,
|
||||
const xmlChar *str,
|
||||
intptr_t len,
|
||||
int what,
|
||||
xmlChar end,
|
||||
xmlChar end2,
|
||||
xmlChar end3);
|
||||
|
||||
/*
|
||||
* Generated by MACROS on top of parser.c c.f. PUSH_AND_POP.
|
||||
*/
|
||||
XMLPUBFUN int XMLCALL nodePush (xmlParserCtxtPtr ctxt,
|
||||
xmlNodePtr value);
|
||||
XMLPUBFUN xmlNodePtr XMLCALL nodePop (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN int XMLCALL inputPush (xmlParserCtxtPtr ctxt,
|
||||
xmlParserInputPtr value);
|
||||
XMLPUBFUN xmlParserInputPtr XMLCALL inputPop (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN const xmlChar * XMLCALL namePop (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN int XMLCALL namePush (xmlParserCtxtPtr ctxt,
|
||||
const xmlChar *value);
|
||||
|
||||
/*
|
||||
* other commodities shared between parser.c and parserInternals.
|
||||
*/
|
||||
XMLPUBFUN int XMLCALL xmlSkipBlankChars (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN int XMLCALL xmlStringCurrentChar (xmlParserCtxtPtr ctxt,
|
||||
const xmlChar *cur,
|
||||
int *len);
|
||||
XMLPUBFUN void XMLCALL xmlParserHandlePEReference(xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN int XMLCALL xmlCheckLanguageID (const xmlChar *lang);
|
||||
|
||||
/*
|
||||
* Really core function shared with HTML parser.
|
||||
*/
|
||||
XMLPUBFUN int XMLCALL xmlCurrentChar (xmlParserCtxtPtr ctxt,
|
||||
int *len);
|
||||
XMLPUBFUN intptr_t XMLCALL xmlCopyCharMultiByte (xmlChar *out,
|
||||
int val);
|
||||
XMLPUBFUN intptr_t XMLCALL xmlCopyChar (intptr_t len,
|
||||
xmlChar *out,
|
||||
int val);
|
||||
XMLPUBFUN void XMLCALL xmlNextChar (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL xmlParserInputShrink (xmlParserInputPtr in);
|
||||
|
||||
#ifdef LIBXML_HTML_ENABLED
|
||||
/*
|
||||
* Actually comes from the HTML parser but launched from the init stuff.
|
||||
*/
|
||||
XMLPUBFUN void XMLCALL htmlInitAutoClose (void);
|
||||
XMLPUBFUN htmlParserCtxtPtr XMLCALL htmlCreateFileParserCtxt(const char *filename,
|
||||
const char *encoding);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Specific function to keep track of entities references
|
||||
* and used by the XSLT debugger.
|
||||
*/
|
||||
#ifdef LIBXML_LEGACY_ENABLED
|
||||
/**
|
||||
* xmlEntityReferenceFunc:
|
||||
* @ent: the entity
|
||||
* @firstNode: the fist node in the chunk
|
||||
* @lastNode: the last nod in the chunk
|
||||
*
|
||||
* Callback function used when one needs to be able to track back the
|
||||
* provenance of a chunk of nodes inherited from an entity replacement.
|
||||
*/
|
||||
typedef void (*xmlEntityReferenceFunc) (xmlEntityPtr ent,
|
||||
xmlNodePtr firstNode,
|
||||
xmlNodePtr lastNode);
|
||||
|
||||
XMLPUBFUN void XMLCALL xmlSetEntityReferenceFunc (xmlEntityReferenceFunc func);
|
||||
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlParseQuotedString (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlParseNamespace (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlNamespaceParseNSDef (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlScanName (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlNamespaceParseNCName (xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL xmlParserHandleReference(xmlParserCtxtPtr ctxt);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlNamespaceParseQName (xmlParserCtxtPtr ctxt,
|
||||
xmlChar **prefix);
|
||||
/**
|
||||
* Entities
|
||||
*/
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlDecodeEntities (xmlParserCtxtPtr ctxt,
|
||||
int len,
|
||||
int what,
|
||||
xmlChar end,
|
||||
xmlChar end2,
|
||||
xmlChar end3);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlHandleEntity (xmlParserCtxtPtr ctxt,
|
||||
xmlEntityPtr entity);
|
||||
|
||||
#endif /* LIBXML_LEGACY_ENABLED */
|
||||
|
||||
#ifdef IN_LIBXML
|
||||
/*
|
||||
* internal only
|
||||
*/
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlErrMemory (xmlParserCtxtPtr ctxt,
|
||||
const char *extra);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __XML_PARSER_INTERNALS_H__ */
|
||||
77
Extras/LibXML/include/libxml/pattern.h
Normal file
77
Extras/LibXML/include/libxml/pattern.h
Normal file
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Summary: pattern expression handling
|
||||
* Description: allows to compile and test pattern expressions for nodes
|
||||
* either in a tree or based on a parser state.
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __XML_PATTERN_H__
|
||||
#define __XML_PATTERN_H__
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/dict.h>
|
||||
|
||||
#ifdef LIBXML_PATTERN_ENABLED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* xmlPattern:
|
||||
*
|
||||
* A compiled (XPath based) pattern to select nodes
|
||||
*/
|
||||
typedef struct _xmlPattern xmlPattern;
|
||||
typedef xmlPattern *xmlPatternPtr;
|
||||
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlFreePattern (xmlPatternPtr comp);
|
||||
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlFreePatternList (xmlPatternPtr comp);
|
||||
|
||||
XMLPUBFUN xmlPatternPtr XMLCALL
|
||||
xmlPatterncompile (const xmlChar *pattern,
|
||||
xmlDict *dict,
|
||||
int flags,
|
||||
const xmlChar **namespaces);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlPatternMatch (xmlPatternPtr comp,
|
||||
xmlNodePtr node);
|
||||
|
||||
/* streaming interfaces */
|
||||
typedef struct _xmlStreamCtxt xmlStreamCtxt;
|
||||
typedef xmlStreamCtxt *xmlStreamCtxtPtr;
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlPatternStreamable (xmlPatternPtr comp);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlPatternMaxDepth (xmlPatternPtr comp);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlPatternFromRoot (xmlPatternPtr comp);
|
||||
XMLPUBFUN xmlStreamCtxtPtr XMLCALL
|
||||
xmlPatternGetStreamCtxt (xmlPatternPtr comp);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlFreeStreamCtxt (xmlStreamCtxtPtr stream);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlStreamPush (xmlStreamCtxtPtr stream,
|
||||
const xmlChar *name,
|
||||
const xmlChar *ns);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlStreamPushAttr (xmlStreamCtxtPtr stream,
|
||||
const xmlChar *name,
|
||||
const xmlChar *ns);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlStreamPop (xmlStreamCtxtPtr stream);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LIBXML_PATTERN_ENABLED */
|
||||
|
||||
#endif /* __XML_PATTERN_H__ */
|
||||
188
Extras/LibXML/include/libxml/relaxng.h
Normal file
188
Extras/LibXML/include/libxml/relaxng.h
Normal file
@@ -0,0 +1,188 @@
|
||||
/*
|
||||
* Summary: implementation of the Relax-NG validation
|
||||
* Description: implementation of the Relax-NG validation
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __XML_RELAX_NG__
|
||||
#define __XML_RELAX_NG__
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
#include <libxml/hash.h>
|
||||
#include <libxml/xmlstring.h>
|
||||
|
||||
#ifdef LIBXML_SCHEMAS_ENABLED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct _xmlRelaxNG xmlRelaxNG;
|
||||
typedef xmlRelaxNG *xmlRelaxNGPtr;
|
||||
|
||||
|
||||
/**
|
||||
* A schemas validation context
|
||||
*/
|
||||
typedef void (*xmlRelaxNGValidityErrorFunc) (void *ctx, const char *msg, ...);
|
||||
typedef void (*xmlRelaxNGValidityWarningFunc) (void *ctx, const char *msg, ...);
|
||||
|
||||
typedef struct _xmlRelaxNGParserCtxt xmlRelaxNGParserCtxt;
|
||||
typedef xmlRelaxNGParserCtxt *xmlRelaxNGParserCtxtPtr;
|
||||
|
||||
typedef struct _xmlRelaxNGValidCtxt xmlRelaxNGValidCtxt;
|
||||
typedef xmlRelaxNGValidCtxt *xmlRelaxNGValidCtxtPtr;
|
||||
|
||||
/*
|
||||
* xmlRelaxNGValidErr:
|
||||
*
|
||||
* List of possible Relax NG validation errors
|
||||
*/
|
||||
typedef enum {
|
||||
XML_RELAXNG_OK = 0,
|
||||
XML_RELAXNG_ERR_MEMORY,
|
||||
XML_RELAXNG_ERR_TYPE,
|
||||
XML_RELAXNG_ERR_TYPEVAL,
|
||||
XML_RELAXNG_ERR_DUPID,
|
||||
XML_RELAXNG_ERR_TYPECMP,
|
||||
XML_RELAXNG_ERR_NOSTATE,
|
||||
XML_RELAXNG_ERR_NODEFINE,
|
||||
XML_RELAXNG_ERR_LISTEXTRA,
|
||||
XML_RELAXNG_ERR_LISTEMPTY,
|
||||
XML_RELAXNG_ERR_INTERNODATA,
|
||||
XML_RELAXNG_ERR_INTERSEQ,
|
||||
XML_RELAXNG_ERR_INTEREXTRA,
|
||||
XML_RELAXNG_ERR_ELEMNAME,
|
||||
XML_RELAXNG_ERR_ATTRNAME,
|
||||
XML_RELAXNG_ERR_ELEMNONS,
|
||||
XML_RELAXNG_ERR_ATTRNONS,
|
||||
XML_RELAXNG_ERR_ELEMWRONGNS,
|
||||
XML_RELAXNG_ERR_ATTRWRONGNS,
|
||||
XML_RELAXNG_ERR_ELEMEXTRANS,
|
||||
XML_RELAXNG_ERR_ATTREXTRANS,
|
||||
XML_RELAXNG_ERR_ELEMNOTEMPTY,
|
||||
XML_RELAXNG_ERR_NOELEM,
|
||||
XML_RELAXNG_ERR_NOTELEM,
|
||||
XML_RELAXNG_ERR_ATTRVALID,
|
||||
XML_RELAXNG_ERR_CONTENTVALID,
|
||||
XML_RELAXNG_ERR_EXTRACONTENT,
|
||||
XML_RELAXNG_ERR_INVALIDATTR,
|
||||
XML_RELAXNG_ERR_DATAELEM,
|
||||
XML_RELAXNG_ERR_VALELEM,
|
||||
XML_RELAXNG_ERR_LISTELEM,
|
||||
XML_RELAXNG_ERR_DATATYPE,
|
||||
XML_RELAXNG_ERR_VALUE,
|
||||
XML_RELAXNG_ERR_LIST,
|
||||
XML_RELAXNG_ERR_NOGRAMMAR,
|
||||
XML_RELAXNG_ERR_EXTRADATA,
|
||||
XML_RELAXNG_ERR_LACKDATA,
|
||||
XML_RELAXNG_ERR_INTERNAL,
|
||||
XML_RELAXNG_ERR_ELEMWRONG,
|
||||
XML_RELAXNG_ERR_TEXTWRONG
|
||||
} xmlRelaxNGValidErr;
|
||||
|
||||
/*
|
||||
* xmlRelaxNGParserFlags:
|
||||
*
|
||||
* List of possible Relax NG Parser flags
|
||||
*/
|
||||
typedef enum {
|
||||
XML_RELAXNGP_NONE = 0,
|
||||
XML_RELAXNGP_FREE_DOC = 1,
|
||||
XML_RELAXNGP_CRNG = 2
|
||||
} xmlRelaxNGParserFlag;
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlRelaxNGInitTypes (void);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlRelaxNGCleanupTypes (void);
|
||||
|
||||
/*
|
||||
* Interfaces for parsing.
|
||||
*/
|
||||
XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL
|
||||
xmlRelaxNGNewParserCtxt (const char *URL);
|
||||
XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL
|
||||
xmlRelaxNGNewMemParserCtxt (const char *buffer,
|
||||
int size);
|
||||
XMLPUBFUN xmlRelaxNGParserCtxtPtr XMLCALL
|
||||
xmlRelaxNGNewDocParserCtxt (xmlDocPtr doc);
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlRelaxParserSetFlag (xmlRelaxNGParserCtxtPtr ctxt,
|
||||
int flag);
|
||||
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlRelaxNGFreeParserCtxt (xmlRelaxNGParserCtxtPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlRelaxNGSetParserErrors(xmlRelaxNGParserCtxtPtr ctxt,
|
||||
xmlRelaxNGValidityErrorFunc err,
|
||||
xmlRelaxNGValidityWarningFunc warn,
|
||||
void *ctx);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlRelaxNGGetParserErrors(xmlRelaxNGParserCtxtPtr ctxt,
|
||||
xmlRelaxNGValidityErrorFunc *err,
|
||||
xmlRelaxNGValidityWarningFunc *warn,
|
||||
void **ctx);
|
||||
XMLPUBFUN xmlRelaxNGPtr XMLCALL
|
||||
xmlRelaxNGParse (xmlRelaxNGParserCtxtPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlRelaxNGFree (xmlRelaxNGPtr schema);
|
||||
#ifdef LIBXML_OUTPUT_ENABLED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlRelaxNGDump (FILE *output,
|
||||
xmlRelaxNGPtr schema);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlRelaxNGDumpTree (FILE * output,
|
||||
xmlRelaxNGPtr schema);
|
||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||
/*
|
||||
* Interfaces for validating
|
||||
*/
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlRelaxNGSetValidErrors(xmlRelaxNGValidCtxtPtr ctxt,
|
||||
xmlRelaxNGValidityErrorFunc err,
|
||||
xmlRelaxNGValidityWarningFunc warn,
|
||||
void *ctx);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlRelaxNGGetValidErrors(xmlRelaxNGValidCtxtPtr ctxt,
|
||||
xmlRelaxNGValidityErrorFunc *err,
|
||||
xmlRelaxNGValidityWarningFunc *warn,
|
||||
void **ctx);
|
||||
XMLPUBFUN xmlRelaxNGValidCtxtPtr XMLCALL
|
||||
xmlRelaxNGNewValidCtxt (xmlRelaxNGPtr schema);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlRelaxNGFreeValidCtxt (xmlRelaxNGValidCtxtPtr ctxt);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlRelaxNGValidateDoc (xmlRelaxNGValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc);
|
||||
/*
|
||||
* Interfaces for progressive validation when possible
|
||||
*/
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlRelaxNGValidatePushElement (xmlRelaxNGValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
xmlNodePtr elem);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlRelaxNGValidatePushCData (xmlRelaxNGValidCtxtPtr ctxt,
|
||||
const xmlChar *data,
|
||||
int len);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlRelaxNGValidatePopElement (xmlRelaxNGValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
xmlNodePtr elem);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlRelaxNGValidateFullElement (xmlRelaxNGValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
xmlNodePtr elem);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LIBXML_SCHEMAS_ENABLED */
|
||||
|
||||
#endif /* __XML_RELAX_NG__ */
|
||||
864
Extras/LibXML/include/libxml/schemasInternals.h
Normal file
864
Extras/LibXML/include/libxml/schemasInternals.h
Normal file
@@ -0,0 +1,864 @@
|
||||
/*
|
||||
* Summary: internal interfaces for XML Schemas
|
||||
* Description: internal interfaces for the XML Schemas handling
|
||||
* and schema validity checking
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __XML_SCHEMA_INTERNALS_H__
|
||||
#define __XML_SCHEMA_INTERNALS_H__
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
|
||||
#ifdef LIBXML_SCHEMAS_ENABLED
|
||||
|
||||
#include <libxml/xmlregexp.h>
|
||||
#include <libxml/hash.h>
|
||||
#include <libxml/dict.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
XML_SCHEMAS_UNKNOWN = 0,
|
||||
XML_SCHEMAS_STRING,
|
||||
XML_SCHEMAS_NORMSTRING,
|
||||
XML_SCHEMAS_DECIMAL,
|
||||
XML_SCHEMAS_TIME,
|
||||
XML_SCHEMAS_GDAY,
|
||||
XML_SCHEMAS_GMONTH,
|
||||
XML_SCHEMAS_GMONTHDAY,
|
||||
XML_SCHEMAS_GYEAR,
|
||||
XML_SCHEMAS_GYEARMONTH,
|
||||
XML_SCHEMAS_DATE,
|
||||
XML_SCHEMAS_DATETIME,
|
||||
XML_SCHEMAS_DURATION,
|
||||
XML_SCHEMAS_FLOAT,
|
||||
XML_SCHEMAS_DOUBLE,
|
||||
XML_SCHEMAS_BOOLEAN,
|
||||
XML_SCHEMAS_TOKEN,
|
||||
XML_SCHEMAS_LANGUAGE,
|
||||
XML_SCHEMAS_NMTOKEN,
|
||||
XML_SCHEMAS_NMTOKENS,
|
||||
XML_SCHEMAS_NAME,
|
||||
XML_SCHEMAS_QNAME,
|
||||
XML_SCHEMAS_NCNAME,
|
||||
XML_SCHEMAS_ID,
|
||||
XML_SCHEMAS_IDREF,
|
||||
XML_SCHEMAS_IDREFS,
|
||||
XML_SCHEMAS_ENTITY,
|
||||
XML_SCHEMAS_ENTITIES,
|
||||
XML_SCHEMAS_NOTATION,
|
||||
XML_SCHEMAS_ANYURI,
|
||||
XML_SCHEMAS_INTEGER,
|
||||
XML_SCHEMAS_NPINTEGER,
|
||||
XML_SCHEMAS_NINTEGER,
|
||||
XML_SCHEMAS_NNINTEGER,
|
||||
XML_SCHEMAS_PINTEGER,
|
||||
XML_SCHEMAS_INT,
|
||||
XML_SCHEMAS_UINT,
|
||||
XML_SCHEMAS_LONG,
|
||||
XML_SCHEMAS_ULONG,
|
||||
XML_SCHEMAS_SHORT,
|
||||
XML_SCHEMAS_USHORT,
|
||||
XML_SCHEMAS_BYTE,
|
||||
XML_SCHEMAS_UBYTE,
|
||||
XML_SCHEMAS_HEXBINARY,
|
||||
XML_SCHEMAS_BASE64BINARY,
|
||||
XML_SCHEMAS_ANYTYPE,
|
||||
XML_SCHEMAS_ANYSIMPLETYPE
|
||||
} xmlSchemaValType;
|
||||
|
||||
/*
|
||||
* XML Schemas defines multiple type of types.
|
||||
*/
|
||||
typedef enum {
|
||||
XML_SCHEMA_TYPE_BASIC = 1, /* A built-in datatype */
|
||||
XML_SCHEMA_TYPE_ANY,
|
||||
XML_SCHEMA_TYPE_FACET,
|
||||
XML_SCHEMA_TYPE_SIMPLE,
|
||||
XML_SCHEMA_TYPE_COMPLEX,
|
||||
XML_SCHEMA_TYPE_SEQUENCE,
|
||||
XML_SCHEMA_TYPE_CHOICE,
|
||||
XML_SCHEMA_TYPE_ALL,
|
||||
XML_SCHEMA_TYPE_SIMPLE_CONTENT,
|
||||
XML_SCHEMA_TYPE_COMPLEX_CONTENT,
|
||||
XML_SCHEMA_TYPE_UR,
|
||||
XML_SCHEMA_TYPE_RESTRICTION,
|
||||
XML_SCHEMA_TYPE_EXTENSION,
|
||||
XML_SCHEMA_TYPE_ELEMENT,
|
||||
XML_SCHEMA_TYPE_ATTRIBUTE,
|
||||
XML_SCHEMA_TYPE_ATTRIBUTEGROUP,
|
||||
XML_SCHEMA_TYPE_GROUP,
|
||||
XML_SCHEMA_TYPE_NOTATION,
|
||||
XML_SCHEMA_TYPE_LIST,
|
||||
XML_SCHEMA_TYPE_UNION,
|
||||
XML_SCHEMA_TYPE_ANY_ATTRIBUTE,
|
||||
XML_SCHEMA_TYPE_IDC_UNIQUE,
|
||||
XML_SCHEMA_TYPE_IDC_KEY,
|
||||
XML_SCHEMA_TYPE_IDC_KEYREF,
|
||||
XML_SCHEMA_TYPE_PARTICLE,
|
||||
XML_SCHEMA_FACET_MININCLUSIVE = 1000,
|
||||
XML_SCHEMA_FACET_MINEXCLUSIVE,
|
||||
XML_SCHEMA_FACET_MAXINCLUSIVE,
|
||||
XML_SCHEMA_FACET_MAXEXCLUSIVE,
|
||||
XML_SCHEMA_FACET_TOTALDIGITS,
|
||||
XML_SCHEMA_FACET_FRACTIONDIGITS,
|
||||
XML_SCHEMA_FACET_PATTERN,
|
||||
XML_SCHEMA_FACET_ENUMERATION,
|
||||
XML_SCHEMA_FACET_WHITESPACE,
|
||||
XML_SCHEMA_FACET_LENGTH,
|
||||
XML_SCHEMA_FACET_MAXLENGTH,
|
||||
XML_SCHEMA_FACET_MINLENGTH,
|
||||
XML_SCHEMA_EXTRA_QNAMEREF = 2000
|
||||
} xmlSchemaTypeType;
|
||||
|
||||
typedef enum {
|
||||
XML_SCHEMA_CONTENT_UNKNOWN = 0,
|
||||
XML_SCHEMA_CONTENT_EMPTY = 1,
|
||||
XML_SCHEMA_CONTENT_ELEMENTS,
|
||||
XML_SCHEMA_CONTENT_MIXED,
|
||||
XML_SCHEMA_CONTENT_SIMPLE,
|
||||
XML_SCHEMA_CONTENT_MIXED_OR_ELEMENTS, /* obsolete, not used */
|
||||
XML_SCHEMA_CONTENT_BASIC,
|
||||
XML_SCHEMA_CONTENT_ANY
|
||||
} xmlSchemaContentType;
|
||||
|
||||
typedef struct _xmlSchemaVal xmlSchemaVal;
|
||||
typedef xmlSchemaVal *xmlSchemaValPtr;
|
||||
|
||||
typedef struct _xmlSchemaType xmlSchemaType;
|
||||
typedef xmlSchemaType *xmlSchemaTypePtr;
|
||||
|
||||
typedef struct _xmlSchemaFacet xmlSchemaFacet;
|
||||
typedef xmlSchemaFacet *xmlSchemaFacetPtr;
|
||||
|
||||
/**
|
||||
* Annotation
|
||||
*/
|
||||
typedef struct _xmlSchemaAnnot xmlSchemaAnnot;
|
||||
typedef xmlSchemaAnnot *xmlSchemaAnnotPtr;
|
||||
struct _xmlSchemaAnnot {
|
||||
struct _xmlSchemaAnnot *next;
|
||||
xmlNodePtr content; /* the annotation */
|
||||
};
|
||||
|
||||
/**
|
||||
* XML_SCHEMAS_ANYATTR_SKIP:
|
||||
*
|
||||
* Skip unknown attribute from validation
|
||||
* Obsolete, not used anymore.
|
||||
*/
|
||||
#define XML_SCHEMAS_ANYATTR_SKIP 1
|
||||
/**
|
||||
* XML_SCHEMAS_ANYATTR_LAX:
|
||||
*
|
||||
* Ignore validation non definition on attributes
|
||||
* Obsolete, not used anymore.
|
||||
*/
|
||||
#define XML_SCHEMAS_ANYATTR_LAX 2
|
||||
/**
|
||||
* XML_SCHEMAS_ANYATTR_STRICT:
|
||||
*
|
||||
* Apply strict validation rules on attributes
|
||||
* Obsolete, not used anymore.
|
||||
*/
|
||||
#define XML_SCHEMAS_ANYATTR_STRICT 3
|
||||
/**
|
||||
* XML_SCHEMAS_ANY_SKIP:
|
||||
*
|
||||
* Skip unknown attribute from validation
|
||||
*/
|
||||
#define XML_SCHEMAS_ANY_SKIP 1
|
||||
/**
|
||||
* XML_SCHEMAS_ANY_LAX:
|
||||
*
|
||||
* Used by wildcards.
|
||||
* Validate if type found, don't worry if not found
|
||||
*/
|
||||
#define XML_SCHEMAS_ANY_LAX 2
|
||||
/**
|
||||
* XML_SCHEMAS_ANY_STRICT:
|
||||
*
|
||||
* Used by wildcards.
|
||||
* Apply strict validation rules
|
||||
*/
|
||||
#define XML_SCHEMAS_ANY_STRICT 3
|
||||
/**
|
||||
* XML_SCHEMAS_ATTR_USE_PROHIBITED:
|
||||
*
|
||||
* Used by wildcards.
|
||||
* The attribute is prohibited.
|
||||
*/
|
||||
#define XML_SCHEMAS_ATTR_USE_PROHIBITED 0
|
||||
/**
|
||||
* XML_SCHEMAS_ATTR_USE_REQUIRED:
|
||||
*
|
||||
* The attribute is required.
|
||||
*/
|
||||
#define XML_SCHEMAS_ATTR_USE_REQUIRED 1
|
||||
/**
|
||||
* XML_SCHEMAS_ATTR_USE_OPTIONAL:
|
||||
*
|
||||
* The attribute is optional.
|
||||
*/
|
||||
#define XML_SCHEMAS_ATTR_USE_OPTIONAL 2
|
||||
/**
|
||||
* XML_SCHEMAS_ATTR_GLOBAL:
|
||||
*
|
||||
* allow elements in no namespace
|
||||
*/
|
||||
#define XML_SCHEMAS_ATTR_GLOBAL 1 << 0
|
||||
/**
|
||||
* XML_SCHEMAS_ATTR_NSDEFAULT:
|
||||
*
|
||||
* allow elements in no namespace
|
||||
*/
|
||||
#define XML_SCHEMAS_ATTR_NSDEFAULT 1 << 7
|
||||
/**
|
||||
* XML_SCHEMAS_ATTR_INTERNAL_RESOLVED:
|
||||
*
|
||||
* this is set when the "type" and "ref" references
|
||||
* have been resolved.
|
||||
*/
|
||||
#define XML_SCHEMAS_ATTR_INTERNAL_RESOLVED 1 << 8
|
||||
/**
|
||||
* XML_SCHEMAS_ATTR_FIXED:
|
||||
*
|
||||
* the attribute has a fixed value
|
||||
*/
|
||||
#define XML_SCHEMAS_ATTR_FIXED 1 << 9
|
||||
|
||||
/**
|
||||
* xmlSchemaAttribute:
|
||||
* An attribute definition.
|
||||
*/
|
||||
|
||||
typedef struct _xmlSchemaAttribute xmlSchemaAttribute;
|
||||
typedef xmlSchemaAttribute *xmlSchemaAttributePtr;
|
||||
struct _xmlSchemaAttribute {
|
||||
xmlSchemaTypeType type; /* The kind of type */
|
||||
struct _xmlSchemaAttribute *next;/* the next attribute if in a group ... */
|
||||
const xmlChar *name; /* name of the declaration or empty if particle */
|
||||
const xmlChar *id;
|
||||
const xmlChar *ref; /* the local name of the attribute decl. if a particle */
|
||||
const xmlChar *refNs; /* the ns URI of the attribute decl. if a particle */
|
||||
const xmlChar *typeName; /* the local name of the type definition */
|
||||
const xmlChar *typeNs; /* the ns URI of the type definition */
|
||||
xmlSchemaAnnotPtr annot;
|
||||
|
||||
xmlSchemaTypePtr base; /* obsolete, not used */
|
||||
int occurs;
|
||||
const xmlChar *defValue;
|
||||
xmlSchemaTypePtr subtypes; /* the type definition */
|
||||
xmlNodePtr node;
|
||||
const xmlChar *targetNamespace;
|
||||
int flags;
|
||||
const xmlChar *refPrefix;
|
||||
xmlSchemaValPtr defVal;
|
||||
xmlSchemaAttributePtr refDecl;
|
||||
};
|
||||
|
||||
/**
|
||||
* xmlSchemaAttributeLink:
|
||||
* Used to build a list of attribute uses on complexType definitions.
|
||||
*/
|
||||
typedef struct _xmlSchemaAttributeLink xmlSchemaAttributeLink;
|
||||
typedef xmlSchemaAttributeLink *xmlSchemaAttributeLinkPtr;
|
||||
struct _xmlSchemaAttributeLink {
|
||||
struct _xmlSchemaAttributeLink *next;/* the next attribute link ... */
|
||||
struct _xmlSchemaAttribute *attr;/* the linked attribute */
|
||||
};
|
||||
|
||||
/**
|
||||
* XML_SCHEMAS_WILDCARD_COMPLETE:
|
||||
*
|
||||
* If the wildcard is complete.
|
||||
*/
|
||||
#define XML_SCHEMAS_WILDCARD_COMPLETE 1 << 0
|
||||
|
||||
/**
|
||||
* xmlSchemaCharValueLink:
|
||||
* Used to build a list of namespaces on wildcards.
|
||||
*/
|
||||
typedef struct _xmlSchemaWildcardNs xmlSchemaWildcardNs;
|
||||
typedef xmlSchemaWildcardNs *xmlSchemaWildcardNsPtr;
|
||||
struct _xmlSchemaWildcardNs {
|
||||
struct _xmlSchemaWildcardNs *next;/* the next constraint link ... */
|
||||
const xmlChar *value;/* the value */
|
||||
};
|
||||
|
||||
/**
|
||||
* xmlSchemaWildcard.
|
||||
* A wildcard.
|
||||
*/
|
||||
typedef struct _xmlSchemaWildcard xmlSchemaWildcard;
|
||||
typedef xmlSchemaWildcard *xmlSchemaWildcardPtr;
|
||||
struct _xmlSchemaWildcard {
|
||||
xmlSchemaTypeType type; /* The kind of type */
|
||||
const xmlChar *id;
|
||||
xmlSchemaAnnotPtr annot;
|
||||
xmlNodePtr node;
|
||||
int minOccurs;
|
||||
int maxOccurs;
|
||||
int processContents;
|
||||
int any; /* Indicates if the ns constraint is of ##any */
|
||||
xmlSchemaWildcardNsPtr nsSet; /* The list of allowed namespaces */
|
||||
xmlSchemaWildcardNsPtr negNsSet; /* The negated namespace */
|
||||
int flags;
|
||||
};
|
||||
|
||||
/**
|
||||
* XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED:
|
||||
*
|
||||
* The attribute wildcard has been already builded.
|
||||
*/
|
||||
#define XML_SCHEMAS_ATTRGROUP_WILDCARD_BUILDED 1 << 0
|
||||
/**
|
||||
* XML_SCHEMAS_ATTRGROUP_GLOBAL:
|
||||
*
|
||||
* The attribute wildcard has been already builded.
|
||||
*/
|
||||
#define XML_SCHEMAS_ATTRGROUP_GLOBAL 1 << 1
|
||||
/**
|
||||
* XML_SCHEMAS_ATTRGROUP_MARKED:
|
||||
*
|
||||
* Marks the attr group as marked; used for circular checks.
|
||||
*/
|
||||
#define XML_SCHEMAS_ATTRGROUP_MARKED 1 << 2
|
||||
|
||||
/**
|
||||
* An attribute group definition.
|
||||
*
|
||||
* xmlSchemaAttribute and xmlSchemaAttributeGroup start of structures
|
||||
* must be kept similar
|
||||
*/
|
||||
typedef struct _xmlSchemaAttributeGroup xmlSchemaAttributeGroup;
|
||||
typedef xmlSchemaAttributeGroup *xmlSchemaAttributeGroupPtr;
|
||||
struct _xmlSchemaAttributeGroup {
|
||||
xmlSchemaTypeType type; /* The kind of type */
|
||||
struct _xmlSchemaAttribute *next;/* the next attribute if in a group ... */
|
||||
const xmlChar *name;
|
||||
const xmlChar *id;
|
||||
const xmlChar *ref;
|
||||
const xmlChar *refNs;
|
||||
xmlSchemaAnnotPtr annot;
|
||||
|
||||
xmlSchemaAttributePtr attributes;
|
||||
xmlNodePtr node;
|
||||
int flags;
|
||||
xmlSchemaWildcardPtr attributeWildcard;
|
||||
const xmlChar *refPrefix;
|
||||
xmlSchemaAttributeGroupPtr refItem; /* The referenced attribute group */
|
||||
const xmlChar *targetNamespace;
|
||||
};
|
||||
|
||||
/**
|
||||
* xmlSchemaTypeLink:
|
||||
* Used to build a list of types (e.g. member types of
|
||||
* simpleType with variety "union").
|
||||
*/
|
||||
typedef struct _xmlSchemaTypeLink xmlSchemaTypeLink;
|
||||
typedef xmlSchemaTypeLink *xmlSchemaTypeLinkPtr;
|
||||
struct _xmlSchemaTypeLink {
|
||||
struct _xmlSchemaTypeLink *next;/* the next type link ... */
|
||||
xmlSchemaTypePtr type;/* the linked type*/
|
||||
};
|
||||
|
||||
/**
|
||||
* xmlSchemaFacetLink:
|
||||
* Used to build a list of facets.
|
||||
*/
|
||||
typedef struct _xmlSchemaFacetLink xmlSchemaFacetLink;
|
||||
typedef xmlSchemaFacetLink *xmlSchemaFacetLinkPtr;
|
||||
struct _xmlSchemaFacetLink {
|
||||
struct _xmlSchemaFacetLink *next;/* the next facet link ... */
|
||||
xmlSchemaFacetPtr facet;/* the linked facet */
|
||||
};
|
||||
|
||||
/**
|
||||
* XML_SCHEMAS_TYPE_MIXED:
|
||||
*
|
||||
* the element content type is mixed
|
||||
*/
|
||||
#define XML_SCHEMAS_TYPE_MIXED 1 << 0
|
||||
/**
|
||||
* XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION:
|
||||
*
|
||||
* the simple or complex type has a derivation method of "extension".
|
||||
*/
|
||||
#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_EXTENSION 1 << 1
|
||||
/**
|
||||
* XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION:
|
||||
*
|
||||
* the simple or complex type has a derivation method of "restriction".
|
||||
*/
|
||||
#define XML_SCHEMAS_TYPE_DERIVATION_METHOD_RESTRICTION 1 << 2
|
||||
/**
|
||||
* XML_SCHEMAS_TYPE_GLOBAL:
|
||||
*
|
||||
* the type is global
|
||||
*/
|
||||
#define XML_SCHEMAS_TYPE_GLOBAL 1 << 3
|
||||
/**
|
||||
* XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD:
|
||||
*
|
||||
* the complexType owns an attribute wildcard, i.e.
|
||||
* it can be freed by the complexType
|
||||
*/
|
||||
#define XML_SCHEMAS_TYPE_OWNED_ATTR_WILDCARD 1 << 4 /* Obsolete. */
|
||||
/**
|
||||
* XML_SCHEMAS_TYPE_VARIETY_ABSENT:
|
||||
*
|
||||
* the simpleType has a variety of "absent".
|
||||
*/
|
||||
#define XML_SCHEMAS_TYPE_VARIETY_ABSENT 1 << 5
|
||||
/**
|
||||
* XML_SCHEMAS_TYPE_VARIETY_LIST:
|
||||
*
|
||||
* the simpleType has a variety of "list".
|
||||
*/
|
||||
#define XML_SCHEMAS_TYPE_VARIETY_LIST 1 << 6
|
||||
/**
|
||||
* XML_SCHEMAS_TYPE_VARIETY_UNION:
|
||||
*
|
||||
* the simpleType has a variety of "union".
|
||||
*/
|
||||
#define XML_SCHEMAS_TYPE_VARIETY_UNION 1 << 7
|
||||
/**
|
||||
* XML_SCHEMAS_TYPE_VARIETY_ATOMIC:
|
||||
*
|
||||
* the simpleType has a variety of "union".
|
||||
*/
|
||||
#define XML_SCHEMAS_TYPE_VARIETY_ATOMIC 1 << 8
|
||||
/**
|
||||
* XML_SCHEMAS_TYPE_FINAL_EXTENSION:
|
||||
*
|
||||
* the complexType has a final of "extension".
|
||||
*/
|
||||
#define XML_SCHEMAS_TYPE_FINAL_EXTENSION 1 << 9
|
||||
/**
|
||||
* XML_SCHEMAS_TYPE_FINAL_RESTRICTION:
|
||||
*
|
||||
* the simpleType/complexType has a final of "restriction".
|
||||
*/
|
||||
#define XML_SCHEMAS_TYPE_FINAL_RESTRICTION 1 << 10
|
||||
/**
|
||||
* XML_SCHEMAS_TYPE_FINAL_LIST:
|
||||
*
|
||||
* the simpleType has a final of "list".
|
||||
*/
|
||||
#define XML_SCHEMAS_TYPE_FINAL_LIST 1 << 11
|
||||
/**
|
||||
* XML_SCHEMAS_TYPE_FINAL_UNION:
|
||||
*
|
||||
* the simpleType has a final of "union".
|
||||
*/
|
||||
#define XML_SCHEMAS_TYPE_FINAL_UNION 1 << 12
|
||||
/**
|
||||
* XML_SCHEMAS_TYPE_FINAL_DEFAULT:
|
||||
*
|
||||
* the simpleType has a final of "default".
|
||||
*/
|
||||
#define XML_SCHEMAS_TYPE_FINAL_DEFAULT 1 << 13
|
||||
/**
|
||||
* XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE:
|
||||
*
|
||||
* Marks the item as a builtin primitive.
|
||||
*/
|
||||
#define XML_SCHEMAS_TYPE_BUILTIN_PRIMITIVE 1 << 14
|
||||
/**
|
||||
* XML_SCHEMAS_TYPE_MARKED:
|
||||
*
|
||||
* Marks the item as marked; used for circular checks.
|
||||
*/
|
||||
#define XML_SCHEMAS_TYPE_MARKED 1 << 16
|
||||
/**
|
||||
* XML_SCHEMAS_TYPE_BLOCK_DEFAULT:
|
||||
*
|
||||
* the complexType did not specify 'block' so use the default of the
|
||||
* <schema> item.
|
||||
*/
|
||||
#define XML_SCHEMAS_TYPE_BLOCK_DEFAULT 1 << 17
|
||||
/**
|
||||
* XML_SCHEMAS_TYPE_BLOCK_EXTENSION:
|
||||
*
|
||||
* the complexType has a 'block' of "extension".
|
||||
*/
|
||||
#define XML_SCHEMAS_TYPE_BLOCK_EXTENSION 1 << 18
|
||||
/**
|
||||
* XML_SCHEMAS_TYPE_BLOCK_RESTRICTION:
|
||||
*
|
||||
* the complexType has a 'block' of "restriction".
|
||||
*/
|
||||
#define XML_SCHEMAS_TYPE_BLOCK_RESTRICTION 1 << 19
|
||||
/**
|
||||
* XML_SCHEMAS_TYPE_ABSTRACT:
|
||||
*
|
||||
* the simple/complexType is abstract.
|
||||
*/
|
||||
#define XML_SCHEMAS_TYPE_ABSTRACT 1 << 20
|
||||
/**
|
||||
* XML_SCHEMAS_TYPE_FACETSNEEDVALUE:
|
||||
*
|
||||
* indicates if the facets need a computed value
|
||||
*/
|
||||
#define XML_SCHEMAS_TYPE_FACETSNEEDVALUE 1 << 21
|
||||
/**
|
||||
* XML_SCHEMAS_TYPE_INTERNAL_RESOLVED:
|
||||
*
|
||||
* indicates that the type was typefixed
|
||||
*/
|
||||
#define XML_SCHEMAS_TYPE_INTERNAL_RESOLVED 1 << 22
|
||||
/**
|
||||
* XML_SCHEMAS_TYPE_INTERNAL_INVALID:
|
||||
*
|
||||
* indicates that the type is invalid
|
||||
*/
|
||||
#define XML_SCHEMAS_TYPE_INTERNAL_INVALID 1 << 23
|
||||
|
||||
|
||||
/**
|
||||
* _xmlSchemaType:
|
||||
*
|
||||
* Schemas type definition.
|
||||
*/
|
||||
struct _xmlSchemaType {
|
||||
xmlSchemaTypeType type; /* The kind of type */
|
||||
struct _xmlSchemaType *next;/* the next type if in a sequence ... */
|
||||
const xmlChar *name;
|
||||
const xmlChar *id;
|
||||
const xmlChar *ref;
|
||||
const xmlChar *refNs;
|
||||
xmlSchemaAnnotPtr annot;
|
||||
xmlSchemaTypePtr subtypes;
|
||||
xmlSchemaAttributePtr attributes;
|
||||
xmlNodePtr node;
|
||||
int minOccurs;
|
||||
int maxOccurs;
|
||||
|
||||
int flags;
|
||||
xmlSchemaContentType contentType;
|
||||
const xmlChar *base;
|
||||
const xmlChar *baseNs;
|
||||
xmlSchemaTypePtr baseType;
|
||||
xmlSchemaFacetPtr facets;
|
||||
struct _xmlSchemaType *redef;/* possible redefinitions for the type */
|
||||
int recurse;
|
||||
xmlSchemaAttributeLinkPtr attributeUses;
|
||||
xmlSchemaWildcardPtr attributeWildcard;
|
||||
int builtInType;
|
||||
xmlSchemaTypeLinkPtr memberTypes;
|
||||
xmlSchemaFacetLinkPtr facetSet;
|
||||
const xmlChar *refPrefix;
|
||||
xmlSchemaTypePtr contentTypeDef;
|
||||
xmlRegexpPtr contModel;
|
||||
const xmlChar *targetNamespace;
|
||||
};
|
||||
|
||||
/*
|
||||
* xmlSchemaElement:
|
||||
* An element definition.
|
||||
*
|
||||
* xmlSchemaType, xmlSchemaFacet and xmlSchemaElement start of
|
||||
* structures must be kept similar
|
||||
*/
|
||||
/**
|
||||
* XML_SCHEMAS_ELEM_NILLABLE:
|
||||
*
|
||||
* the element is nillable
|
||||
*/
|
||||
#define XML_SCHEMAS_ELEM_NILLABLE 1 << 0
|
||||
/**
|
||||
* XML_SCHEMAS_ELEM_GLOBAL:
|
||||
*
|
||||
* the element is global
|
||||
*/
|
||||
#define XML_SCHEMAS_ELEM_GLOBAL 1 << 1
|
||||
/**
|
||||
* XML_SCHEMAS_ELEM_DEFAULT:
|
||||
*
|
||||
* the element has a default value
|
||||
*/
|
||||
#define XML_SCHEMAS_ELEM_DEFAULT 1 << 2
|
||||
/**
|
||||
* XML_SCHEMAS_ELEM_FIXED:
|
||||
*
|
||||
* the element has a fixed value
|
||||
*/
|
||||
#define XML_SCHEMAS_ELEM_FIXED 1 << 3
|
||||
/**
|
||||
* XML_SCHEMAS_ELEM_ABSTRACT:
|
||||
*
|
||||
* the element is abstract
|
||||
*/
|
||||
#define XML_SCHEMAS_ELEM_ABSTRACT 1 << 4
|
||||
/**
|
||||
* XML_SCHEMAS_ELEM_TOPLEVEL:
|
||||
*
|
||||
* the element is top level
|
||||
* obsolete: use XML_SCHEMAS_ELEM_GLOBAL instead
|
||||
*/
|
||||
#define XML_SCHEMAS_ELEM_TOPLEVEL 1 << 5
|
||||
/**
|
||||
* XML_SCHEMAS_ELEM_REF:
|
||||
*
|
||||
* the element is a reference to a type
|
||||
*/
|
||||
#define XML_SCHEMAS_ELEM_REF 1 << 6
|
||||
/**
|
||||
* XML_SCHEMAS_ELEM_NSDEFAULT:
|
||||
*
|
||||
* allow elements in no namespace
|
||||
* Obsolete, not used anymore.
|
||||
*/
|
||||
#define XML_SCHEMAS_ELEM_NSDEFAULT 1 << 7
|
||||
/**
|
||||
* XML_SCHEMAS_ELEM_INTERNAL_RESOLVED:
|
||||
*
|
||||
* this is set when "type", "ref", "substitutionGroup"
|
||||
* references have been resolved.
|
||||
*/
|
||||
#define XML_SCHEMAS_ELEM_INTERNAL_RESOLVED 1 << 8
|
||||
/**
|
||||
* XML_SCHEMAS_ELEM_CIRCULAR:
|
||||
*
|
||||
* a helper flag for the search of circular references.
|
||||
*/
|
||||
#define XML_SCHEMAS_ELEM_CIRCULAR 1 << 9
|
||||
/**
|
||||
* XML_SCHEMAS_ELEM_BLOCK_ABSENT:
|
||||
*
|
||||
* the "block" attribute is absent
|
||||
*/
|
||||
#define XML_SCHEMAS_ELEM_BLOCK_ABSENT 1 << 10
|
||||
/**
|
||||
* XML_SCHEMAS_ELEM_BLOCK_EXTENSION:
|
||||
*
|
||||
* disallowed substitutions are absent
|
||||
*/
|
||||
#define XML_SCHEMAS_ELEM_BLOCK_EXTENSION 1 << 11
|
||||
/**
|
||||
* XML_SCHEMAS_ELEM_BLOCK_RESTRICTION:
|
||||
*
|
||||
* disallowed substitutions: "restriction"
|
||||
*/
|
||||
#define XML_SCHEMAS_ELEM_BLOCK_RESTRICTION 1 << 12
|
||||
/**
|
||||
* XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION:
|
||||
*
|
||||
* disallowed substitutions: "substituion"
|
||||
*/
|
||||
#define XML_SCHEMAS_ELEM_BLOCK_SUBSTITUTION 1 << 13
|
||||
/**
|
||||
* XML_SCHEMAS_ELEM_FINAL_ABSENT:
|
||||
*
|
||||
* substitution group exclusions are absent
|
||||
*/
|
||||
#define XML_SCHEMAS_ELEM_FINAL_ABSENT 1 << 14
|
||||
/**
|
||||
* XML_SCHEMAS_ELEM_FINAL_EXTENSION:
|
||||
*
|
||||
* substitution group exclusions: "extension"
|
||||
*/
|
||||
#define XML_SCHEMAS_ELEM_FINAL_EXTENSION 1 << 15
|
||||
/**
|
||||
* XML_SCHEMAS_ELEM_FINAL_RESTRICTION:
|
||||
*
|
||||
* substitution group exclusions: "restriction"
|
||||
*/
|
||||
#define XML_SCHEMAS_ELEM_FINAL_RESTRICTION 1 << 16
|
||||
|
||||
|
||||
typedef struct _xmlSchemaElement xmlSchemaElement;
|
||||
typedef xmlSchemaElement *xmlSchemaElementPtr;
|
||||
struct _xmlSchemaElement {
|
||||
xmlSchemaTypeType type; /* The kind of type */
|
||||
struct _xmlSchemaType *next;/* the next type if in a sequence ... */
|
||||
const xmlChar *name;
|
||||
const xmlChar *id;
|
||||
const xmlChar *ref; /* the local name of the element declaration if a particle */
|
||||
const xmlChar *refNs; /* the ns URI of the element declaration if a particle */
|
||||
xmlSchemaAnnotPtr annot;
|
||||
xmlSchemaTypePtr subtypes; /* the type definition */
|
||||
xmlSchemaAttributePtr attributes;
|
||||
xmlNodePtr node;
|
||||
int minOccurs;
|
||||
int maxOccurs;
|
||||
|
||||
int flags;
|
||||
const xmlChar *targetNamespace;
|
||||
const xmlChar *namedType;
|
||||
const xmlChar *namedTypeNs;
|
||||
const xmlChar *substGroup;
|
||||
const xmlChar *substGroupNs;
|
||||
const xmlChar *scope;
|
||||
const xmlChar *value;
|
||||
struct _xmlSchemaElement *refDecl; /* the element declaration if a particle */
|
||||
xmlRegexpPtr contModel;
|
||||
xmlSchemaContentType contentType;
|
||||
const xmlChar *refPrefix;
|
||||
xmlSchemaValPtr defVal;
|
||||
void *idcs;
|
||||
};
|
||||
|
||||
/*
|
||||
* XML_SCHEMAS_FACET_UNKNOWN:
|
||||
*
|
||||
* unknown facet handling
|
||||
*/
|
||||
#define XML_SCHEMAS_FACET_UNKNOWN 0
|
||||
/*
|
||||
* XML_SCHEMAS_FACET_PRESERVE:
|
||||
*
|
||||
* preserve the type of the facet
|
||||
*/
|
||||
#define XML_SCHEMAS_FACET_PRESERVE 1
|
||||
/*
|
||||
* XML_SCHEMAS_FACET_REPLACE:
|
||||
*
|
||||
* replace the type of the facet
|
||||
*/
|
||||
#define XML_SCHEMAS_FACET_REPLACE 2
|
||||
/*
|
||||
* XML_SCHEMAS_FACET_COLLAPSE:
|
||||
*
|
||||
* collapse the types of the facet
|
||||
*/
|
||||
#define XML_SCHEMAS_FACET_COLLAPSE 3
|
||||
/**
|
||||
* A facet definition.
|
||||
*/
|
||||
struct _xmlSchemaFacet {
|
||||
xmlSchemaTypeType type; /* The kind of type */
|
||||
struct _xmlSchemaFacet *next;/* the next type if in a sequence ... */
|
||||
const xmlChar *value;
|
||||
const xmlChar *id;
|
||||
xmlSchemaAnnotPtr annot;
|
||||
xmlNodePtr node;
|
||||
int fixed;
|
||||
int whitespace;
|
||||
xmlSchemaValPtr val;
|
||||
xmlRegexpPtr regexp;
|
||||
};
|
||||
|
||||
/**
|
||||
* A notation definition.
|
||||
*/
|
||||
typedef struct _xmlSchemaNotation xmlSchemaNotation;
|
||||
typedef xmlSchemaNotation *xmlSchemaNotationPtr;
|
||||
struct _xmlSchemaNotation {
|
||||
xmlSchemaTypeType type; /* The kind of type */
|
||||
const xmlChar *name;
|
||||
xmlSchemaAnnotPtr annot;
|
||||
const xmlChar *identifier;
|
||||
const xmlChar *targetNamespace;
|
||||
};
|
||||
|
||||
/**
|
||||
* XML_SCHEMAS_QUALIF_ELEM:
|
||||
*
|
||||
* the schema requires qualified elements
|
||||
*/
|
||||
#define XML_SCHEMAS_QUALIF_ELEM 1 << 0
|
||||
/**
|
||||
* XML_SCHEMAS_QUALIF_ATTR:
|
||||
*
|
||||
* the schema requires qualified attributes
|
||||
*/
|
||||
#define XML_SCHEMAS_QUALIF_ATTR 1 << 1
|
||||
/**
|
||||
* XML_SCHEMAS_FINAL_DEFAULT_EXTENSION:
|
||||
*
|
||||
* the schema has "extension" in the set of finalDefault.
|
||||
*/
|
||||
#define XML_SCHEMAS_FINAL_DEFAULT_EXTENSION 1 << 2
|
||||
/**
|
||||
* XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION:
|
||||
*
|
||||
* the schema has "restriction" in the set of finalDefault.
|
||||
*/
|
||||
#define XML_SCHEMAS_FINAL_DEFAULT_RESTRICTION 1 << 3
|
||||
/**
|
||||
* XML_SCHEMAS_FINAL_DEFAULT_LIST:
|
||||
*
|
||||
* the cshema has "list" in the set of finalDefault.
|
||||
*/
|
||||
#define XML_SCHEMAS_FINAL_DEFAULT_LIST 1 << 4
|
||||
/**
|
||||
* XML_SCHEMAS_FINAL_DEFAULT_UNION:
|
||||
*
|
||||
* the schema has "union" in the set of finalDefault.
|
||||
*/
|
||||
#define XML_SCHEMAS_FINAL_DEFAULT_UNION 1 << 5
|
||||
/**
|
||||
* XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION:
|
||||
*
|
||||
* the schema has "extension" in the set of blockDefault.
|
||||
*/
|
||||
#define XML_SCHEMAS_BLOCK_DEFAULT_EXTENSION 1 << 6
|
||||
/**
|
||||
* XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION:
|
||||
*
|
||||
* the schema has "restriction" in the set of blockDefault.
|
||||
*/
|
||||
#define XML_SCHEMAS_BLOCK_DEFAULT_RESTRICTION 1 << 7
|
||||
/**
|
||||
* XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION:
|
||||
*
|
||||
* the schema has "substitution" in the set of blockDefault.
|
||||
*/
|
||||
#define XML_SCHEMAS_BLOCK_DEFAULT_SUBSTITUTION 1 << 8
|
||||
/**
|
||||
* XML_SCHEMAS_INCLUDING_CONVERT_NS:
|
||||
*
|
||||
* the schema is currently including an other schema with
|
||||
* no target namespace.
|
||||
*/
|
||||
#define XML_SCHEMAS_INCLUDING_CONVERT_NS 1 << 9
|
||||
/**
|
||||
* _xmlSchema:
|
||||
*
|
||||
* A Schemas definition
|
||||
*/
|
||||
struct _xmlSchema {
|
||||
const xmlChar *name; /* schema name */
|
||||
const xmlChar *targetNamespace; /* the target namespace */
|
||||
const xmlChar *version;
|
||||
const xmlChar *id;
|
||||
xmlDocPtr doc;
|
||||
xmlSchemaAnnotPtr annot;
|
||||
int flags;
|
||||
|
||||
xmlHashTablePtr typeDecl;
|
||||
xmlHashTablePtr attrDecl;
|
||||
xmlHashTablePtr attrgrpDecl;
|
||||
xmlHashTablePtr elemDecl;
|
||||
xmlHashTablePtr notaDecl;
|
||||
|
||||
xmlHashTablePtr schemasImports;
|
||||
|
||||
void *_private; /* unused by the library for users or bindings */
|
||||
xmlHashTablePtr groupDecl;
|
||||
xmlDictPtr dict;
|
||||
void *includes; /* the includes, this is opaque for now */
|
||||
int preserve; /* whether to free the document */
|
||||
int counter; /* used to give ononymous components unique names */
|
||||
xmlHashTablePtr idcDef;
|
||||
void *volatiles; /* Misc. helper items (e.g. reference items) */
|
||||
};
|
||||
|
||||
XMLPUBFUN void XMLCALL xmlSchemaFreeType (xmlSchemaTypePtr type);
|
||||
XMLPUBFUN void XMLCALL xmlSchemaFreeWildcard(xmlSchemaWildcardPtr wildcard);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LIBXML_SCHEMAS_ENABLED */
|
||||
#endif /* __XML_SCHEMA_INTERNALS_H__ */
|
||||
81
Extras/LibXML/include/libxml/threads.h
Normal file
81
Extras/LibXML/include/libxml/threads.h
Normal file
@@ -0,0 +1,81 @@
|
||||
/**
|
||||
* Summary: interfaces for thread handling
|
||||
* Description: set of generic threading related routines
|
||||
* should work with pthreads, Windows native or TLS threads
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __XML_THREADS_H__
|
||||
#define __XML_THREADS_H__
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* xmlMutex are a simple mutual exception locks.
|
||||
*/
|
||||
typedef struct _xmlMutex xmlMutex;
|
||||
typedef xmlMutex *xmlMutexPtr;
|
||||
|
||||
/*
|
||||
* xmlRMutex are reentrant mutual exception locks.
|
||||
*/
|
||||
typedef struct _xmlRMutex xmlRMutex;
|
||||
typedef xmlRMutex *xmlRMutexPtr;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include <libxml/globals.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
XMLPUBFUN xmlMutexPtr XMLCALL
|
||||
xmlNewMutex (void);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlMutexLock (xmlMutexPtr tok);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlMutexUnlock (xmlMutexPtr tok);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlFreeMutex (xmlMutexPtr tok);
|
||||
|
||||
XMLPUBFUN xmlRMutexPtr XMLCALL
|
||||
xmlNewRMutex (void);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlRMutexLock (xmlRMutexPtr tok);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlRMutexUnlock (xmlRMutexPtr tok);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlFreeRMutex (xmlRMutexPtr tok);
|
||||
|
||||
/*
|
||||
* Library wide APIs.
|
||||
*/
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlInitThreads (void);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlLockLibrary (void);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlUnlockLibrary(void);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlGetThreadId (void);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlIsMainThread (void);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlCleanupThreads(void);
|
||||
XMLPUBFUN xmlGlobalStatePtr XMLCALL
|
||||
xmlGetGlobalState(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __XML_THREADS_H__ */
|
||||
1125
Extras/LibXML/include/libxml/tree.h
Normal file
1125
Extras/LibXML/include/libxml/tree.h
Normal file
File diff suppressed because it is too large
Load Diff
84
Extras/LibXML/include/libxml/uri.h
Normal file
84
Extras/LibXML/include/libxml/uri.h
Normal file
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* Summary: library of generic URI related routines
|
||||
* Description: library of generic URI related routines
|
||||
* Implements RFC 2396
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __XML_URI_H__
|
||||
#define __XML_URI_H__
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
#include <libxml/tree.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* xmlURI:
|
||||
*
|
||||
* A parsed URI reference. This is a struct containing the various fields
|
||||
* as described in RFC 2396 but separated for further processing.
|
||||
*/
|
||||
typedef struct _xmlURI xmlURI;
|
||||
typedef xmlURI *xmlURIPtr;
|
||||
struct _xmlURI {
|
||||
char *scheme; /* the URI scheme */
|
||||
char *opaque; /* opaque part */
|
||||
char *authority; /* the authority part */
|
||||
char *server; /* the server part */
|
||||
char *user; /* the user part */
|
||||
int port; /* the port number */
|
||||
char *path; /* the path string */
|
||||
char *query; /* the query string */
|
||||
char *fragment; /* the fragment identifier */
|
||||
int cleanup; /* parsing potentially unclean URI */
|
||||
};
|
||||
|
||||
/*
|
||||
* This function is in tree.h:
|
||||
* xmlChar * xmlNodeGetBase (xmlDocPtr doc,
|
||||
* xmlNodePtr cur);
|
||||
*/
|
||||
XMLPUBFUN xmlURIPtr XMLCALL
|
||||
xmlCreateURI (void);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlBuildURI (const xmlChar *URI,
|
||||
const xmlChar *base);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlBuildRelativeURI (const xmlChar *URI,
|
||||
const xmlChar *base);
|
||||
XMLPUBFUN xmlURIPtr XMLCALL
|
||||
xmlParseURI (const char *str);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlParseURIReference (xmlURIPtr uri,
|
||||
const char *str);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlSaveUri (xmlURIPtr uri);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlPrintURI (FILE *stream,
|
||||
xmlURIPtr uri);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlURIEscapeStr (const xmlChar *str,
|
||||
const xmlChar *list);
|
||||
XMLPUBFUN char * XMLCALL
|
||||
xmlURIUnescapeString (const char *str,
|
||||
intptr_t len,
|
||||
char *target);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlNormalizeURIPath (char *path);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlURIEscape (const xmlChar *str);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlFreeURI (xmlURIPtr uri);
|
||||
XMLPUBFUN xmlChar* XMLCALL
|
||||
xmlCanonicPath (const xmlChar *path);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __XML_URI_H__ */
|
||||
458
Extras/LibXML/include/libxml/valid.h
Normal file
458
Extras/LibXML/include/libxml/valid.h
Normal file
@@ -0,0 +1,458 @@
|
||||
/*
|
||||
* Summary: The DTD validation
|
||||
* Description: API for the DTD handling and the validity checking
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __XML_VALID_H__
|
||||
#define __XML_VALID_H__
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
#include <libxml/xmlerror.h>
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/list.h>
|
||||
#include <libxml/xmlautomata.h>
|
||||
#include <libxml/xmlregexp.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Validation state added for non-determinist content model.
|
||||
*/
|
||||
typedef struct _xmlValidState xmlValidState;
|
||||
typedef xmlValidState *xmlValidStatePtr;
|
||||
|
||||
/**
|
||||
* xmlValidityErrorFunc:
|
||||
* @ctx: usually an xmlValidCtxtPtr to a validity error context,
|
||||
* but comes from ctxt->userData (which normally contains such
|
||||
* a pointer); ctxt->userData can be changed by the user.
|
||||
* @msg: the string to format *printf like vararg
|
||||
* @...: remaining arguments to the format
|
||||
*
|
||||
* Callback called when a validity error is found. This is a message
|
||||
* oriented function similar to an *printf function.
|
||||
*/
|
||||
typedef void (*xmlValidityErrorFunc) (void *ctx,
|
||||
const char *msg,
|
||||
...);
|
||||
|
||||
/**
|
||||
* xmlValidityWarningFunc:
|
||||
* @ctx: usually an xmlValidCtxtPtr to a validity error context,
|
||||
* but comes from ctxt->userData (which normally contains such
|
||||
* a pointer); ctxt->userData can be changed by the user.
|
||||
* @msg: the string to format *printf like vararg
|
||||
* @...: remaining arguments to the format
|
||||
*
|
||||
* Callback called when a validity warning is found. This is a message
|
||||
* oriented function similar to an *printf function.
|
||||
*/
|
||||
typedef void (*xmlValidityWarningFunc) (void *ctx,
|
||||
const char *msg,
|
||||
...);
|
||||
|
||||
#ifdef IN_LIBXML
|
||||
/**
|
||||
* XML_CTXT_FINISH_DTD_0:
|
||||
*
|
||||
* Special value for finishDtd field when embedded in an xmlParserCtxt
|
||||
*/
|
||||
#define XML_CTXT_FINISH_DTD_0 0xabcd1234
|
||||
/**
|
||||
* XML_CTXT_FINISH_DTD_1:
|
||||
*
|
||||
* Special value for finishDtd field when embedded in an xmlParserCtxt
|
||||
*/
|
||||
#define XML_CTXT_FINISH_DTD_1 0xabcd1235
|
||||
#endif
|
||||
|
||||
/*
|
||||
* xmlValidCtxt:
|
||||
* An xmlValidCtxt is used for error reporting when validating.
|
||||
*/
|
||||
typedef struct _xmlValidCtxt xmlValidCtxt;
|
||||
typedef xmlValidCtxt *xmlValidCtxtPtr;
|
||||
struct _xmlValidCtxt {
|
||||
void *userData; /* user specific data block */
|
||||
xmlValidityErrorFunc error; /* the callback in case of errors */
|
||||
xmlValidityWarningFunc warning; /* the callback in case of warning */
|
||||
|
||||
/* Node analysis stack used when validating within entities */
|
||||
xmlNodePtr node; /* Current parsed Node */
|
||||
int nodeNr; /* Depth of the parsing stack */
|
||||
int nodeMax; /* Max depth of the parsing stack */
|
||||
xmlNodePtr *nodeTab; /* array of nodes */
|
||||
|
||||
unsigned int finishDtd; /* finished validating the Dtd ? */
|
||||
xmlDocPtr doc; /* the document */
|
||||
int valid; /* temporary validity check result */
|
||||
|
||||
/* state state used for non-determinist content validation */
|
||||
xmlValidState *vstate; /* current state */
|
||||
int vstateNr; /* Depth of the validation stack */
|
||||
int vstateMax; /* Max depth of the validation stack */
|
||||
xmlValidState *vstateTab; /* array of validation states */
|
||||
|
||||
#ifdef LIBXML_REGEXP_ENABLED
|
||||
xmlAutomataPtr am; /* the automata */
|
||||
xmlAutomataStatePtr state; /* used to build the automata */
|
||||
#else
|
||||
void *am;
|
||||
void *state;
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
* ALL notation declarations are stored in a table.
|
||||
* There is one table per DTD.
|
||||
*/
|
||||
|
||||
typedef struct _xmlHashTable xmlNotationTable;
|
||||
typedef xmlNotationTable *xmlNotationTablePtr;
|
||||
|
||||
/*
|
||||
* ALL element declarations are stored in a table.
|
||||
* There is one table per DTD.
|
||||
*/
|
||||
|
||||
typedef struct _xmlHashTable xmlElementTable;
|
||||
typedef xmlElementTable *xmlElementTablePtr;
|
||||
|
||||
/*
|
||||
* ALL attribute declarations are stored in a table.
|
||||
* There is one table per DTD.
|
||||
*/
|
||||
|
||||
typedef struct _xmlHashTable xmlAttributeTable;
|
||||
typedef xmlAttributeTable *xmlAttributeTablePtr;
|
||||
|
||||
/*
|
||||
* ALL IDs attributes are stored in a table.
|
||||
* There is one table per document.
|
||||
*/
|
||||
|
||||
typedef struct _xmlHashTable xmlIDTable;
|
||||
typedef xmlIDTable *xmlIDTablePtr;
|
||||
|
||||
/*
|
||||
* ALL Refs attributes are stored in a table.
|
||||
* There is one table per document.
|
||||
*/
|
||||
|
||||
typedef struct _xmlHashTable xmlRefTable;
|
||||
typedef xmlRefTable *xmlRefTablePtr;
|
||||
|
||||
/* Notation */
|
||||
XMLPUBFUN xmlNotationPtr XMLCALL
|
||||
xmlAddNotationDecl (xmlValidCtxtPtr ctxt,
|
||||
xmlDtdPtr dtd,
|
||||
const xmlChar *name,
|
||||
const xmlChar *PublicID,
|
||||
const xmlChar *SystemID);
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
XMLPUBFUN xmlNotationTablePtr XMLCALL
|
||||
xmlCopyNotationTable (xmlNotationTablePtr table);
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlFreeNotationTable (xmlNotationTablePtr table);
|
||||
#ifdef LIBXML_OUTPUT_ENABLED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlDumpNotationDecl (xmlBufferPtr buf,
|
||||
xmlNotationPtr nota);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlDumpNotationTable (xmlBufferPtr buf,
|
||||
xmlNotationTablePtr table);
|
||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||
|
||||
/* Element Content */
|
||||
/* the non Doc version are being deprecated */
|
||||
XMLPUBFUN xmlElementContentPtr XMLCALL
|
||||
xmlNewElementContent (const xmlChar *name,
|
||||
xmlElementContentType type);
|
||||
XMLPUBFUN xmlElementContentPtr XMLCALL
|
||||
xmlCopyElementContent (xmlElementContentPtr content);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlFreeElementContent (xmlElementContentPtr cur);
|
||||
/* the new versions with doc argument */
|
||||
XMLPUBFUN xmlElementContentPtr XMLCALL
|
||||
xmlNewDocElementContent (xmlDocPtr doc,
|
||||
const xmlChar *name,
|
||||
xmlElementContentType type);
|
||||
XMLPUBFUN xmlElementContentPtr XMLCALL
|
||||
xmlCopyDocElementContent(xmlDocPtr doc,
|
||||
xmlElementContentPtr content);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlFreeDocElementContent(xmlDocPtr doc,
|
||||
xmlElementContentPtr cur);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSnprintfElementContent(char *buf,
|
||||
size_t size,
|
||||
xmlElementContentPtr content,
|
||||
int glob);
|
||||
#ifdef LIBXML_OUTPUT_ENABLED
|
||||
/* DEPRECATED */
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSprintfElementContent(char *buf,
|
||||
xmlElementContentPtr content,
|
||||
int glob);
|
||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||
/* DEPRECATED */
|
||||
|
||||
/* Element */
|
||||
XMLPUBFUN xmlElementPtr XMLCALL
|
||||
xmlAddElementDecl (xmlValidCtxtPtr ctxt,
|
||||
xmlDtdPtr dtd,
|
||||
const xmlChar *name,
|
||||
xmlElementTypeVal type,
|
||||
xmlElementContentPtr content);
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
XMLPUBFUN xmlElementTablePtr XMLCALL
|
||||
xmlCopyElementTable (xmlElementTablePtr table);
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlFreeElementTable (xmlElementTablePtr table);
|
||||
#ifdef LIBXML_OUTPUT_ENABLED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlDumpElementTable (xmlBufferPtr buf,
|
||||
xmlElementTablePtr table);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlDumpElementDecl (xmlBufferPtr buf,
|
||||
xmlElementPtr elem);
|
||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||
|
||||
/* Enumeration */
|
||||
XMLPUBFUN xmlEnumerationPtr XMLCALL
|
||||
xmlCreateEnumeration (const xmlChar *name);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlFreeEnumeration (xmlEnumerationPtr cur);
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
XMLPUBFUN xmlEnumerationPtr XMLCALL
|
||||
xmlCopyEnumeration (xmlEnumerationPtr cur);
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
|
||||
/* Attribute */
|
||||
XMLPUBFUN xmlAttributePtr XMLCALL
|
||||
xmlAddAttributeDecl (xmlValidCtxtPtr ctxt,
|
||||
xmlDtdPtr dtd,
|
||||
const xmlChar *elem,
|
||||
const xmlChar *name,
|
||||
const xmlChar *ns,
|
||||
xmlAttributeType type,
|
||||
xmlAttributeDefault def,
|
||||
const xmlChar *defaultValue,
|
||||
xmlEnumerationPtr tree);
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
XMLPUBFUN xmlAttributeTablePtr XMLCALL
|
||||
xmlCopyAttributeTable (xmlAttributeTablePtr table);
|
||||
#endif /* LIBXML_TREE_ENABLED */
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlFreeAttributeTable (xmlAttributeTablePtr table);
|
||||
#ifdef LIBXML_OUTPUT_ENABLED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlDumpAttributeTable (xmlBufferPtr buf,
|
||||
xmlAttributeTablePtr table);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlDumpAttributeDecl (xmlBufferPtr buf,
|
||||
xmlAttributePtr attr);
|
||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||
|
||||
/* IDs */
|
||||
XMLPUBFUN xmlIDPtr XMLCALL
|
||||
xmlAddID (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
const xmlChar *value,
|
||||
xmlAttrPtr attr);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlFreeIDTable (xmlIDTablePtr table);
|
||||
XMLPUBFUN xmlAttrPtr XMLCALL
|
||||
xmlGetID (xmlDocPtr doc,
|
||||
const xmlChar *ID);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlIsID (xmlDocPtr doc,
|
||||
xmlNodePtr elem,
|
||||
xmlAttrPtr attr);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlRemoveID (xmlDocPtr doc,
|
||||
xmlAttrPtr attr);
|
||||
|
||||
/* IDREFs */
|
||||
XMLPUBFUN xmlRefPtr XMLCALL
|
||||
xmlAddRef (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
const xmlChar *value,
|
||||
xmlAttrPtr attr);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlFreeRefTable (xmlRefTablePtr table);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlIsRef (xmlDocPtr doc,
|
||||
xmlNodePtr elem,
|
||||
xmlAttrPtr attr);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlRemoveRef (xmlDocPtr doc,
|
||||
xmlAttrPtr attr);
|
||||
XMLPUBFUN xmlListPtr XMLCALL
|
||||
xmlGetRefs (xmlDocPtr doc,
|
||||
const xmlChar *ID);
|
||||
|
||||
/**
|
||||
* The public function calls related to validity checking.
|
||||
*/
|
||||
#ifdef LIBXML_VALID_ENABLED
|
||||
/* Allocate/Release Validation Contexts */
|
||||
XMLPUBFUN xmlValidCtxtPtr XMLCALL
|
||||
xmlNewValidCtxt(void);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlFreeValidCtxt(xmlValidCtxtPtr);
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlValidateRoot (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlValidateElementDecl (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
xmlElementPtr elem);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlValidNormalizeAttributeValue(xmlDocPtr doc,
|
||||
xmlNodePtr elem,
|
||||
const xmlChar *name,
|
||||
const xmlChar *value);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlValidCtxtNormalizeAttributeValue(xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
xmlNodePtr elem,
|
||||
const xmlChar *name,
|
||||
const xmlChar *value);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlValidateAttributeDecl(xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
xmlAttributePtr attr);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlValidateAttributeValue(xmlAttributeType type,
|
||||
const xmlChar *value);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlValidateNotationDecl (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
xmlNotationPtr nota);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlValidateDtd (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
xmlDtdPtr dtd);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlValidateDtdFinal (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlValidateDocument (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlValidateElement (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
xmlNodePtr elem);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlValidateOneElement (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
xmlNodePtr elem);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlValidateOneAttribute (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
xmlNodePtr elem,
|
||||
xmlAttrPtr attr,
|
||||
const xmlChar *value);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlValidateOneNamespace (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
xmlNodePtr elem,
|
||||
const xmlChar *prefix,
|
||||
xmlNsPtr ns,
|
||||
const xmlChar *value);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlValidateDocumentFinal(xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc);
|
||||
#endif /* LIBXML_VALID_ENABLED */
|
||||
|
||||
#if defined(LIBXML_VALID_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlValidateNotationUse (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
const xmlChar *notationName);
|
||||
#endif /* LIBXML_VALID_ENABLED or LIBXML_SCHEMAS_ENABLED */
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlIsMixedElement (xmlDocPtr doc,
|
||||
const xmlChar *name);
|
||||
XMLPUBFUN xmlAttributePtr XMLCALL
|
||||
xmlGetDtdAttrDesc (xmlDtdPtr dtd,
|
||||
const xmlChar *elem,
|
||||
const xmlChar *name);
|
||||
XMLPUBFUN xmlAttributePtr XMLCALL
|
||||
xmlGetDtdQAttrDesc (xmlDtdPtr dtd,
|
||||
const xmlChar *elem,
|
||||
const xmlChar *name,
|
||||
const xmlChar *prefix);
|
||||
XMLPUBFUN xmlNotationPtr XMLCALL
|
||||
xmlGetDtdNotationDesc (xmlDtdPtr dtd,
|
||||
const xmlChar *name);
|
||||
XMLPUBFUN xmlElementPtr XMLCALL
|
||||
xmlGetDtdQElementDesc (xmlDtdPtr dtd,
|
||||
const xmlChar *name,
|
||||
const xmlChar *prefix);
|
||||
XMLPUBFUN xmlElementPtr XMLCALL
|
||||
xmlGetDtdElementDesc (xmlDtdPtr dtd,
|
||||
const xmlChar *name);
|
||||
|
||||
#ifdef LIBXML_VALID_ENABLED
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlValidGetPotentialChildren(xmlElementContent *ctree,
|
||||
const xmlChar **list,
|
||||
int *len,
|
||||
int max);
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlValidGetValidElements(xmlNode *prev,
|
||||
xmlNode *next,
|
||||
const xmlChar **names,
|
||||
int max);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlValidateNameValue (const xmlChar *value);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlValidateNamesValue (const xmlChar *value);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlValidateNmtokenValue (const xmlChar *value);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlValidateNmtokensValue(const xmlChar *value);
|
||||
|
||||
#ifdef LIBXML_REGEXP_ENABLED
|
||||
/*
|
||||
* Validation based on the regexp support
|
||||
*/
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlValidBuildContentModel(xmlValidCtxtPtr ctxt,
|
||||
xmlElementPtr elem);
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlValidatePushElement (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
xmlNodePtr elem,
|
||||
const xmlChar *qname);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlValidatePushCData (xmlValidCtxtPtr ctxt,
|
||||
const xmlChar *data,
|
||||
int len);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlValidatePopElement (xmlValidCtxtPtr ctxt,
|
||||
xmlDocPtr doc,
|
||||
xmlNodePtr elem,
|
||||
const xmlChar *qname);
|
||||
#endif /* LIBXML_REGEXP_ENABLED */
|
||||
#endif /* LIBXML_VALID_ENABLED */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __XML_VALID_H__ */
|
||||
121
Extras/LibXML/include/libxml/xinclude.h
Normal file
121
Extras/LibXML/include/libxml/xinclude.h
Normal file
@@ -0,0 +1,121 @@
|
||||
/*
|
||||
* Summary: implementation of XInclude
|
||||
* Description: API to handle XInclude processing,
|
||||
* implements the
|
||||
* World Wide Web Consortium Last Call Working Draft 10 November 2003
|
||||
* http://www.w3.org/TR/2003/WD-xinclude-20031110
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __XML_XINCLUDE_H__
|
||||
#define __XML_XINCLUDE_H__
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
#include <libxml/tree.h>
|
||||
|
||||
#ifdef LIBXML_XINCLUDE_ENABLED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* XINCLUDE_NS:
|
||||
*
|
||||
* Macro defining the Xinclude namespace: http://www.w3.org/2003/XInclude
|
||||
*/
|
||||
#define XINCLUDE_NS (const xmlChar *) "http://www.w3.org/2003/XInclude"
|
||||
/**
|
||||
* XINCLUDE_OLD_NS:
|
||||
*
|
||||
* Macro defining the draft Xinclude namespace: http://www.w3.org/2001/XInclude
|
||||
*/
|
||||
#define XINCLUDE_OLD_NS (const xmlChar *) "http://www.w3.org/2001/XInclude"
|
||||
/**
|
||||
* XINCLUDE_NODE:
|
||||
*
|
||||
* Macro defining "include"
|
||||
*/
|
||||
#define XINCLUDE_NODE (const xmlChar *) "include"
|
||||
/**
|
||||
* XINCLUDE_FALLBACK:
|
||||
*
|
||||
* Macro defining "fallback"
|
||||
*/
|
||||
#define XINCLUDE_FALLBACK (const xmlChar *) "fallback"
|
||||
/**
|
||||
* XINCLUDE_HREF:
|
||||
*
|
||||
* Macro defining "href"
|
||||
*/
|
||||
#define XINCLUDE_HREF (const xmlChar *) "href"
|
||||
/**
|
||||
* XINCLUDE_PARSE:
|
||||
*
|
||||
* Macro defining "parse"
|
||||
*/
|
||||
#define XINCLUDE_PARSE (const xmlChar *) "parse"
|
||||
/**
|
||||
* XINCLUDE_PARSE_XML:
|
||||
*
|
||||
* Macro defining "xml"
|
||||
*/
|
||||
#define XINCLUDE_PARSE_XML (const xmlChar *) "xml"
|
||||
/**
|
||||
* XINCLUDE_PARSE_TEXT:
|
||||
*
|
||||
* Macro defining "text"
|
||||
*/
|
||||
#define XINCLUDE_PARSE_TEXT (const xmlChar *) "text"
|
||||
/**
|
||||
* XINCLUDE_PARSE_ENCODING:
|
||||
*
|
||||
* Macro defining "encoding"
|
||||
*/
|
||||
#define XINCLUDE_PARSE_ENCODING (const xmlChar *) "encoding"
|
||||
/**
|
||||
* XINCLUDE_PARSE_XPOINTER:
|
||||
*
|
||||
* Macro defining "xpointer"
|
||||
*/
|
||||
#define XINCLUDE_PARSE_XPOINTER (const xmlChar *) "xpointer"
|
||||
|
||||
typedef struct _xmlXIncludeCtxt xmlXIncludeCtxt;
|
||||
typedef xmlXIncludeCtxt *xmlXIncludeCtxtPtr;
|
||||
|
||||
/*
|
||||
* standalone processing
|
||||
*/
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlXIncludeProcess (xmlDocPtr doc);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlXIncludeProcessFlags (xmlDocPtr doc,
|
||||
int flags);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlXIncludeProcessTree (xmlNodePtr tree);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlXIncludeProcessTreeFlags(xmlNodePtr tree,
|
||||
int flags);
|
||||
/*
|
||||
* contextual processing
|
||||
*/
|
||||
XMLPUBFUN xmlXIncludeCtxtPtr XMLCALL
|
||||
xmlXIncludeNewContext (xmlDocPtr doc);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlXIncludeSetFlags (xmlXIncludeCtxtPtr ctxt,
|
||||
int flags);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXIncludeFreeContext (xmlXIncludeCtxtPtr ctxt);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlXIncludeProcessNode (xmlXIncludeCtxtPtr ctxt,
|
||||
xmlNodePtr tree);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LIBXML_XINCLUDE_ENABLED */
|
||||
|
||||
#endif /* __XML_XINCLUDE_H__ */
|
||||
189
Extras/LibXML/include/libxml/xlink.h
Normal file
189
Extras/LibXML/include/libxml/xlink.h
Normal file
@@ -0,0 +1,189 @@
|
||||
/*
|
||||
* Summary: unfinished XLink detection module
|
||||
* Description: unfinished XLink detection module
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __XML_XLINK_H__
|
||||
#define __XML_XLINK_H__
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
#include <libxml/tree.h>
|
||||
|
||||
#ifdef LIBXML_XPTR_ENABLED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Various defines for the various Link properties.
|
||||
*
|
||||
* NOTE: the link detection layer will try to resolve QName expansion
|
||||
* of namespaces. If "foo" is the prefix for "http://foo.com/"
|
||||
* then the link detection layer will expand role="foo:myrole"
|
||||
* to "http://foo.com/:myrole".
|
||||
* NOTE: the link detection layer will expand URI-Refences found on
|
||||
* href attributes by using the base mechanism if found.
|
||||
*/
|
||||
typedef xmlChar *xlinkHRef;
|
||||
typedef xmlChar *xlinkRole;
|
||||
typedef xmlChar *xlinkTitle;
|
||||
|
||||
typedef enum {
|
||||
XLINK_TYPE_NONE = 0,
|
||||
XLINK_TYPE_SIMPLE,
|
||||
XLINK_TYPE_EXTENDED,
|
||||
XLINK_TYPE_EXTENDED_SET
|
||||
} xlinkType;
|
||||
|
||||
typedef enum {
|
||||
XLINK_SHOW_NONE = 0,
|
||||
XLINK_SHOW_NEW,
|
||||
XLINK_SHOW_EMBED,
|
||||
XLINK_SHOW_REPLACE
|
||||
} xlinkShow;
|
||||
|
||||
typedef enum {
|
||||
XLINK_ACTUATE_NONE = 0,
|
||||
XLINK_ACTUATE_AUTO,
|
||||
XLINK_ACTUATE_ONREQUEST
|
||||
} xlinkActuate;
|
||||
|
||||
/**
|
||||
* xlinkNodeDetectFunc:
|
||||
* @ctx: user data pointer
|
||||
* @node: the node to check
|
||||
*
|
||||
* This is the prototype for the link detection routine.
|
||||
* It calls the default link detection callbacks upon link detection.
|
||||
*/
|
||||
typedef void (*xlinkNodeDetectFunc) (void *ctx, xmlNodePtr node);
|
||||
|
||||
/*
|
||||
* The link detection module interact with the upper layers using
|
||||
* a set of callback registered at parsing time.
|
||||
*/
|
||||
|
||||
/**
|
||||
* xlinkSimpleLinkFunk:
|
||||
* @ctx: user data pointer
|
||||
* @node: the node carrying the link
|
||||
* @href: the target of the link
|
||||
* @role: the role string
|
||||
* @title: the link title
|
||||
*
|
||||
* This is the prototype for a simple link detection callback.
|
||||
*/
|
||||
typedef void
|
||||
(*xlinkSimpleLinkFunk) (void *ctx,
|
||||
xmlNodePtr node,
|
||||
const xlinkHRef href,
|
||||
const xlinkRole role,
|
||||
const xlinkTitle title);
|
||||
|
||||
/**
|
||||
* xlinkExtendedLinkFunk:
|
||||
* @ctx: user data pointer
|
||||
* @node: the node carrying the link
|
||||
* @nbLocators: the number of locators detected on the link
|
||||
* @hrefs: pointer to the array of locator hrefs
|
||||
* @roles: pointer to the array of locator roles
|
||||
* @nbArcs: the number of arcs detected on the link
|
||||
* @from: pointer to the array of source roles found on the arcs
|
||||
* @to: pointer to the array of target roles found on the arcs
|
||||
* @show: array of values for the show attributes found on the arcs
|
||||
* @actuate: array of values for the actuate attributes found on the arcs
|
||||
* @nbTitles: the number of titles detected on the link
|
||||
* @title: array of titles detected on the link
|
||||
* @langs: array of xml:lang values for the titles
|
||||
*
|
||||
* This is the prototype for a extended link detection callback.
|
||||
*/
|
||||
typedef void
|
||||
(*xlinkExtendedLinkFunk)(void *ctx,
|
||||
xmlNodePtr node,
|
||||
int nbLocators,
|
||||
const xlinkHRef *hrefs,
|
||||
const xlinkRole *roles,
|
||||
int nbArcs,
|
||||
const xlinkRole *from,
|
||||
const xlinkRole *to,
|
||||
xlinkShow *show,
|
||||
xlinkActuate *actuate,
|
||||
int nbTitles,
|
||||
const xlinkTitle *titles,
|
||||
const xmlChar **langs);
|
||||
|
||||
/**
|
||||
* xlinkExtendedLinkSetFunk:
|
||||
* @ctx: user data pointer
|
||||
* @node: the node carrying the link
|
||||
* @nbLocators: the number of locators detected on the link
|
||||
* @hrefs: pointer to the array of locator hrefs
|
||||
* @roles: pointer to the array of locator roles
|
||||
* @nbTitles: the number of titles detected on the link
|
||||
* @title: array of titles detected on the link
|
||||
* @langs: array of xml:lang values for the titles
|
||||
*
|
||||
* This is the prototype for a extended link set detection callback.
|
||||
*/
|
||||
typedef void
|
||||
(*xlinkExtendedLinkSetFunk) (void *ctx,
|
||||
xmlNodePtr node,
|
||||
int nbLocators,
|
||||
const xlinkHRef *hrefs,
|
||||
const xlinkRole *roles,
|
||||
int nbTitles,
|
||||
const xlinkTitle *titles,
|
||||
const xmlChar **langs);
|
||||
|
||||
/**
|
||||
* This is the structure containing a set of Links detection callbacks.
|
||||
*
|
||||
* There is no default xlink callbacks, if one want to get link
|
||||
* recognition activated, those call backs must be provided before parsing.
|
||||
*/
|
||||
typedef struct _xlinkHandler xlinkHandler;
|
||||
typedef xlinkHandler *xlinkHandlerPtr;
|
||||
struct _xlinkHandler {
|
||||
xlinkSimpleLinkFunk simple;
|
||||
xlinkExtendedLinkFunk extended;
|
||||
xlinkExtendedLinkSetFunk set;
|
||||
};
|
||||
|
||||
/*
|
||||
* The default detection routine, can be overridden, they call the default
|
||||
* detection callbacks.
|
||||
*/
|
||||
|
||||
XMLPUBFUN xlinkNodeDetectFunc XMLCALL
|
||||
xlinkGetDefaultDetect (void);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xlinkSetDefaultDetect (xlinkNodeDetectFunc func);
|
||||
|
||||
/*
|
||||
* Routines to set/get the default handlers.
|
||||
*/
|
||||
XMLPUBFUN xlinkHandlerPtr XMLCALL
|
||||
xlinkGetDefaultHandler (void);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xlinkSetDefaultHandler (xlinkHandlerPtr handler);
|
||||
|
||||
/*
|
||||
* Link detection module itself.
|
||||
*/
|
||||
XMLPUBFUN xlinkType XMLCALL
|
||||
xlinkIsLink (xmlDocPtr doc,
|
||||
xmlNodePtr node);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LIBXML_XPTR_ENABLED */
|
||||
|
||||
#endif /* __XML_XLINK_H__ */
|
||||
356
Extras/LibXML/include/libxml/xmlIO.h
Normal file
356
Extras/LibXML/include/libxml/xmlIO.h
Normal file
@@ -0,0 +1,356 @@
|
||||
/*
|
||||
* Summary: interface for the I/O interfaces used by the parser
|
||||
* Description: interface for the I/O interfaces used by the parser
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __XML_IO_H__
|
||||
#define __XML_IO_H__
|
||||
|
||||
#include <stdio.h>
|
||||
#include <libxml/xmlversion.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Those are the functions and datatypes for the parser input
|
||||
* I/O structures.
|
||||
*/
|
||||
|
||||
/**
|
||||
* xmlInputMatchCallback:
|
||||
* @filename: the filename or URI
|
||||
*
|
||||
* Callback used in the I/O Input API to detect if the current handler
|
||||
* can provide input fonctionnalities for this resource.
|
||||
*
|
||||
* Returns 1 if yes and 0 if another Input module should be used
|
||||
*/
|
||||
typedef int (*xmlInputMatchCallback) (char const *filename);
|
||||
/**
|
||||
* xmlInputOpenCallback:
|
||||
* @filename: the filename or URI
|
||||
*
|
||||
* Callback used in the I/O Input API to open the resource
|
||||
*
|
||||
* Returns an Input context or NULL in case or error
|
||||
*/
|
||||
typedef void * (*xmlInputOpenCallback) (char const *filename);
|
||||
/**
|
||||
* xmlInputReadCallback:
|
||||
* @context: an Input context
|
||||
* @buffer: the buffer to store data read
|
||||
* @len: the length of the buffer in bytes
|
||||
*
|
||||
* Callback used in the I/O Input API to read the resource
|
||||
*
|
||||
* Returns the number of bytes read or -1 in case of error
|
||||
*/
|
||||
typedef intptr_t (*xmlInputReadCallback) (void * context, char * buffer, size_t len);
|
||||
/**
|
||||
* xmlInputCloseCallback:
|
||||
* @context: an Input context
|
||||
*
|
||||
* Callback used in the I/O Input API to close the resource
|
||||
*
|
||||
* Returns 0 or -1 in case of error
|
||||
*/
|
||||
typedef int (*xmlInputCloseCallback) (void * context);
|
||||
|
||||
#ifdef LIBXML_OUTPUT_ENABLED
|
||||
/*
|
||||
* Those are the functions and datatypes for the library output
|
||||
* I/O structures.
|
||||
*/
|
||||
|
||||
/**
|
||||
* xmlOutputMatchCallback:
|
||||
* @filename: the filename or URI
|
||||
*
|
||||
* Callback used in the I/O Output API to detect if the current handler
|
||||
* can provide output fonctionnalities for this resource.
|
||||
*
|
||||
* Returns 1 if yes and 0 if another Output module should be used
|
||||
*/
|
||||
typedef int (*xmlOutputMatchCallback) (char const *filename);
|
||||
/**
|
||||
* xmlOutputOpenCallback:
|
||||
* @filename: the filename or URI
|
||||
*
|
||||
* Callback used in the I/O Output API to open the resource
|
||||
*
|
||||
* Returns an Output context or NULL in case or error
|
||||
*/
|
||||
typedef void * (*xmlOutputOpenCallback) (char const *filename);
|
||||
/**
|
||||
* xmlOutputWriteCallback:
|
||||
* @context: an Output context
|
||||
* @buffer: the buffer of data to write
|
||||
* @len: the length of the buffer in bytes
|
||||
*
|
||||
* Callback used in the I/O Output API to write to the resource
|
||||
*
|
||||
* Returns the number of bytes written or -1 in case of error
|
||||
*/
|
||||
typedef intptr_t (*xmlOutputWriteCallback) (void * context, const char * buffer,
|
||||
size_t len);
|
||||
/**
|
||||
* xmlOutputCloseCallback:
|
||||
* @context: an Output context
|
||||
*
|
||||
* Callback used in the I/O Output API to close the resource
|
||||
*
|
||||
* Returns 0 or -1 in case of error
|
||||
*/
|
||||
typedef int (*xmlOutputCloseCallback) (void * context);
|
||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <libxml/globals.h>
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/encoding.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
struct _xmlParserInputBuffer {
|
||||
void* context;
|
||||
xmlInputReadCallback readcallback;
|
||||
xmlInputCloseCallback closecallback;
|
||||
|
||||
xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
|
||||
|
||||
xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 */
|
||||
xmlBufferPtr raw; /* if encoder != NULL buffer for raw input */
|
||||
int compressed; /* -1=unknown, 0=not compressed, 1=compressed */
|
||||
int error;
|
||||
size_t rawconsumed;/* amount consumed from raw */
|
||||
};
|
||||
|
||||
|
||||
#ifdef LIBXML_OUTPUT_ENABLED
|
||||
struct _xmlOutputBuffer {
|
||||
void* context;
|
||||
xmlOutputWriteCallback writecallback;
|
||||
xmlOutputCloseCallback closecallback;
|
||||
|
||||
xmlCharEncodingHandlerPtr encoder; /* I18N conversions to UTF-8 */
|
||||
|
||||
xmlBufferPtr buffer; /* Local buffer encoded in UTF-8 or ISOLatin */
|
||||
xmlBufferPtr conv; /* if encoder != NULL buffer for output */
|
||||
intptr_t written; /* total number of byte written */
|
||||
int error;
|
||||
};
|
||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||
|
||||
/*
|
||||
* Interfaces for input
|
||||
*/
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlCleanupInputCallbacks (void);
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlPopInputCallbacks (void);
|
||||
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlRegisterDefaultInputCallbacks (void);
|
||||
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
|
||||
xmlAllocParserInputBuffer (xmlCharEncoding enc);
|
||||
|
||||
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
|
||||
xmlParserInputBufferCreateFilename (const char *URI,
|
||||
xmlCharEncoding enc);
|
||||
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
|
||||
xmlParserInputBufferCreateFile (FILE *file,
|
||||
xmlCharEncoding enc);
|
||||
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
|
||||
xmlParserInputBufferCreateFd (int fd,
|
||||
xmlCharEncoding enc);
|
||||
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
|
||||
xmlParserInputBufferCreateMem (const char *mem, intptr_t size,
|
||||
xmlCharEncoding enc);
|
||||
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
|
||||
xmlParserInputBufferCreateStatic (const char *mem, intptr_t size,
|
||||
xmlCharEncoding enc);
|
||||
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
|
||||
xmlParserInputBufferCreateIO (xmlInputReadCallback ioread,
|
||||
xmlInputCloseCallback ioclose,
|
||||
void *ioctx,
|
||||
xmlCharEncoding enc);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlParserInputBufferRead (xmlParserInputBufferPtr in,
|
||||
intptr_t len);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlParserInputBufferGrow (xmlParserInputBufferPtr in,
|
||||
intptr_t len);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlParserInputBufferPush (xmlParserInputBufferPtr in,
|
||||
intptr_t len,
|
||||
const char *buf);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlFreeParserInputBuffer (xmlParserInputBufferPtr in);
|
||||
XMLPUBFUN char * XMLCALL
|
||||
xmlParserGetDirectory (const char *filename);
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlRegisterInputCallbacks (xmlInputMatchCallback matchFunc,
|
||||
xmlInputOpenCallback openFunc,
|
||||
xmlInputReadCallback readFunc,
|
||||
xmlInputCloseCallback closeFunc);
|
||||
|
||||
xmlParserInputBufferPtr
|
||||
__xmlParserInputBufferCreateFilename(const char *URI,
|
||||
xmlCharEncoding enc);
|
||||
|
||||
#ifdef LIBXML_OUTPUT_ENABLED
|
||||
/*
|
||||
* Interfaces for output
|
||||
*/
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlCleanupOutputCallbacks (void);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlRegisterDefaultOutputCallbacks(void);
|
||||
XMLPUBFUN xmlOutputBufferPtr XMLCALL
|
||||
xmlAllocOutputBuffer (xmlCharEncodingHandlerPtr encoder);
|
||||
|
||||
XMLPUBFUN xmlOutputBufferPtr XMLCALL
|
||||
xmlOutputBufferCreateFilename (const char *URI,
|
||||
xmlCharEncodingHandlerPtr encoder,
|
||||
int compression);
|
||||
|
||||
XMLPUBFUN xmlOutputBufferPtr XMLCALL
|
||||
xmlOutputBufferCreateFile (FILE *file,
|
||||
xmlCharEncodingHandlerPtr encoder);
|
||||
|
||||
XMLPUBFUN xmlOutputBufferPtr XMLCALL
|
||||
xmlOutputBufferCreateFd (int fd,
|
||||
xmlCharEncodingHandlerPtr encoder);
|
||||
|
||||
XMLPUBFUN xmlOutputBufferPtr XMLCALL
|
||||
xmlOutputBufferCreateIO (xmlOutputWriteCallback iowrite,
|
||||
xmlOutputCloseCallback ioclose,
|
||||
void *ioctx,
|
||||
xmlCharEncodingHandlerPtr encoder);
|
||||
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlOutputBufferWrite (xmlOutputBufferPtr out,
|
||||
intptr_t len,
|
||||
const char *buf);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlOutputBufferWriteString (xmlOutputBufferPtr out,
|
||||
const char *str);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlOutputBufferWriteEscape (xmlOutputBufferPtr out,
|
||||
const xmlChar *str,
|
||||
xmlCharEncodingOutputFunc escaping);
|
||||
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlOutputBufferFlush (xmlOutputBufferPtr out);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlOutputBufferClose (xmlOutputBufferPtr out);
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlRegisterOutputCallbacks (xmlOutputMatchCallback matchFunc,
|
||||
xmlOutputOpenCallback openFunc,
|
||||
xmlOutputWriteCallback writeFunc,
|
||||
xmlOutputCloseCallback closeFunc);
|
||||
|
||||
xmlOutputBufferPtr
|
||||
__xmlOutputBufferCreateFilename(const char *URI,
|
||||
xmlCharEncodingHandlerPtr encoder,
|
||||
int compression);
|
||||
|
||||
#ifdef LIBXML_HTTP_ENABLED
|
||||
/* This function only exists if HTTP support built into the library */
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlRegisterHTTPPostCallbacks (void );
|
||||
#endif /* LIBXML_HTTP_ENABLED */
|
||||
|
||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||
|
||||
XMLPUBFUN xmlParserInputPtr XMLCALL
|
||||
xmlCheckHTTPInput (xmlParserCtxtPtr ctxt,
|
||||
xmlParserInputPtr ret);
|
||||
|
||||
/*
|
||||
* A predefined entity loader disabling network accesses
|
||||
*/
|
||||
XMLPUBFUN xmlParserInputPtr XMLCALL
|
||||
xmlNoNetExternalEntityLoader (const char *URL,
|
||||
const char *ID,
|
||||
xmlParserCtxtPtr ctxt);
|
||||
|
||||
/*
|
||||
* xmlNormalizeWindowsPath is obsolete, don't use it.
|
||||
* Check xmlCanonicPath in uri.h for a better alternative.
|
||||
*/
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlNormalizeWindowsPath (const xmlChar *path);
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlCheckFilename (const char *path);
|
||||
/**
|
||||
* Default 'file://' protocol callbacks
|
||||
*/
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlFileMatch (const char *filename);
|
||||
XMLPUBFUN void * XMLCALL
|
||||
xmlFileOpen (const char *filename);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlFileRead (void * context,
|
||||
char * buffer,
|
||||
size_t len);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlFileClose (void * context);
|
||||
|
||||
/**
|
||||
* Default 'http://' protocol callbacks
|
||||
*/
|
||||
#ifdef LIBXML_HTTP_ENABLED
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlIOHTTPMatch (const char *filename);
|
||||
XMLPUBFUN void * XMLCALL
|
||||
xmlIOHTTPOpen (const char *filename);
|
||||
#ifdef LIBXML_OUTPUT_ENABLED
|
||||
XMLPUBFUN void * XMLCALL
|
||||
xmlIOHTTPOpenW (const char * post_uri,
|
||||
int compression );
|
||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlIOHTTPRead (void * context,
|
||||
char * buffer,
|
||||
int len);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlIOHTTPClose (void * context);
|
||||
#endif /* LIBXML_HTTP_ENABLED */
|
||||
|
||||
/**
|
||||
* Default 'ftp://' protocol callbacks
|
||||
*/
|
||||
#ifdef LIBXML_FTP_ENABLED
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlIOFTPMatch (const char *filename);
|
||||
XMLPUBFUN void * XMLCALL
|
||||
xmlIOFTPOpen (const char *filename);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlIOFTPRead (void * context,
|
||||
char * buffer,
|
||||
int len);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlIOFTPClose (void * context);
|
||||
#endif /* LIBXML_FTP_ENABLED */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __XML_IO_H__ */
|
||||
138
Extras/LibXML/include/libxml/xmlautomata.h
Normal file
138
Extras/LibXML/include/libxml/xmlautomata.h
Normal file
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* Summary: API to build regexp automata
|
||||
* Description: the API to build regexp automata
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __XML_AUTOMATA_H__
|
||||
#define __XML_AUTOMATA_H__
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
#include <libxml/tree.h>
|
||||
|
||||
#ifdef LIBXML_REGEXP_ENABLED
|
||||
#ifdef LIBXML_AUTOMATA_ENABLED
|
||||
#include <libxml/xmlregexp.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* xmlAutomataPtr:
|
||||
*
|
||||
* A libxml automata description, It can be compiled into a regexp
|
||||
*/
|
||||
typedef struct _xmlAutomata xmlAutomata;
|
||||
typedef xmlAutomata *xmlAutomataPtr;
|
||||
|
||||
/**
|
||||
* xmlAutomataStatePtr:
|
||||
*
|
||||
* A state int the automata description,
|
||||
*/
|
||||
typedef struct _xmlAutomataState xmlAutomataState;
|
||||
typedef xmlAutomataState *xmlAutomataStatePtr;
|
||||
|
||||
/*
|
||||
* Building API
|
||||
*/
|
||||
XMLPUBFUN xmlAutomataPtr XMLCALL
|
||||
xmlNewAutomata (void);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlFreeAutomata (xmlAutomataPtr am);
|
||||
|
||||
XMLPUBFUN xmlAutomataStatePtr XMLCALL
|
||||
xmlAutomataGetInitState (xmlAutomataPtr am);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlAutomataSetFinalState (xmlAutomataPtr am,
|
||||
xmlAutomataStatePtr state);
|
||||
XMLPUBFUN xmlAutomataStatePtr XMLCALL
|
||||
xmlAutomataNewState (xmlAutomataPtr am);
|
||||
XMLPUBFUN xmlAutomataStatePtr XMLCALL
|
||||
xmlAutomataNewTransition (xmlAutomataPtr am,
|
||||
xmlAutomataStatePtr from,
|
||||
xmlAutomataStatePtr to,
|
||||
const xmlChar *token,
|
||||
void *data);
|
||||
XMLPUBFUN xmlAutomataStatePtr XMLCALL
|
||||
xmlAutomataNewTransition2 (xmlAutomataPtr am,
|
||||
xmlAutomataStatePtr from,
|
||||
xmlAutomataStatePtr to,
|
||||
const xmlChar *token,
|
||||
const xmlChar *token2,
|
||||
void *data);
|
||||
XMLPUBFUN xmlAutomataStatePtr XMLCALL
|
||||
xmlAutomataNewCountTrans (xmlAutomataPtr am,
|
||||
xmlAutomataStatePtr from,
|
||||
xmlAutomataStatePtr to,
|
||||
const xmlChar *token,
|
||||
int min,
|
||||
int max,
|
||||
void *data);
|
||||
XMLPUBFUN xmlAutomataStatePtr XMLCALL
|
||||
xmlAutomataNewCountTrans2 (xmlAutomataPtr am,
|
||||
xmlAutomataStatePtr from,
|
||||
xmlAutomataStatePtr to,
|
||||
const xmlChar *token,
|
||||
const xmlChar *token2,
|
||||
int min,
|
||||
int max,
|
||||
void *data);
|
||||
XMLPUBFUN xmlAutomataStatePtr XMLCALL
|
||||
xmlAutomataNewOnceTrans (xmlAutomataPtr am,
|
||||
xmlAutomataStatePtr from,
|
||||
xmlAutomataStatePtr to,
|
||||
const xmlChar *token,
|
||||
int min,
|
||||
int max,
|
||||
void *data);
|
||||
XMLPUBFUN xmlAutomataStatePtr XMLCALL
|
||||
xmlAutomataNewOnceTrans2 (xmlAutomataPtr am,
|
||||
xmlAutomataStatePtr from,
|
||||
xmlAutomataStatePtr to,
|
||||
const xmlChar *token,
|
||||
const xmlChar *token2,
|
||||
int min,
|
||||
int max,
|
||||
void *data);
|
||||
XMLPUBFUN xmlAutomataStatePtr XMLCALL
|
||||
xmlAutomataNewAllTrans (xmlAutomataPtr am,
|
||||
xmlAutomataStatePtr from,
|
||||
xmlAutomataStatePtr to,
|
||||
int lax);
|
||||
XMLPUBFUN xmlAutomataStatePtr XMLCALL
|
||||
xmlAutomataNewEpsilon (xmlAutomataPtr am,
|
||||
xmlAutomataStatePtr from,
|
||||
xmlAutomataStatePtr to);
|
||||
XMLPUBFUN xmlAutomataStatePtr XMLCALL
|
||||
xmlAutomataNewCountedTrans (xmlAutomataPtr am,
|
||||
xmlAutomataStatePtr from,
|
||||
xmlAutomataStatePtr to,
|
||||
int counter);
|
||||
XMLPUBFUN xmlAutomataStatePtr XMLCALL
|
||||
xmlAutomataNewCounterTrans (xmlAutomataPtr am,
|
||||
xmlAutomataStatePtr from,
|
||||
xmlAutomataStatePtr to,
|
||||
int counter);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlAutomataNewCounter (xmlAutomataPtr am,
|
||||
int min,
|
||||
int max);
|
||||
|
||||
XMLPUBFUN xmlRegexpPtr XMLCALL
|
||||
xmlAutomataCompile (xmlAutomataPtr am);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlAutomataIsDeterminist (xmlAutomataPtr am);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LIBXML_AUTOMATA_ENABLED */
|
||||
#endif /* LIBXML_REGEXP_ENABLED */
|
||||
|
||||
#endif /* __XML_AUTOMATA_H__ */
|
||||
910
Extras/LibXML/include/libxml/xmlerror.h
Normal file
910
Extras/LibXML/include/libxml/xmlerror.h
Normal file
@@ -0,0 +1,910 @@
|
||||
/*
|
||||
* Summary: error handling
|
||||
* Description: the API used to report errors
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#include <libxml/parser.h>
|
||||
|
||||
#ifndef __XML_ERROR_H__
|
||||
#define __XML_ERROR_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* xmlErrorLevel:
|
||||
*
|
||||
* Indicates the level of an error
|
||||
*/
|
||||
typedef enum {
|
||||
XML_ERR_NONE = 0,
|
||||
XML_ERR_WARNING = 1, /* A simple warning */
|
||||
XML_ERR_ERROR = 2, /* A recoverable error */
|
||||
XML_ERR_FATAL = 3 /* A fatal error */
|
||||
} xmlErrorLevel;
|
||||
|
||||
/**
|
||||
* xmlErrorDomain:
|
||||
*
|
||||
* Indicates where an error may have come from
|
||||
*/
|
||||
typedef enum {
|
||||
XML_FROM_NONE = 0,
|
||||
XML_FROM_PARSER, /* The XML parser */
|
||||
XML_FROM_TREE, /* The tree module */
|
||||
XML_FROM_NAMESPACE, /* The XML Namespace module */
|
||||
XML_FROM_DTD, /* The XML DTD validation with parser context*/
|
||||
XML_FROM_HTML, /* The HTML parser */
|
||||
XML_FROM_MEMORY, /* The memory allocator */
|
||||
XML_FROM_OUTPUT, /* The serialization code */
|
||||
XML_FROM_IO, /* The Input/Output stack */
|
||||
XML_FROM_FTP, /* The FTP module */
|
||||
XML_FROM_HTTP, /* The HTTP module */
|
||||
XML_FROM_XINCLUDE, /* The XInclude processing */
|
||||
XML_FROM_XPATH, /* The XPath module */
|
||||
XML_FROM_XPOINTER, /* The XPointer module */
|
||||
XML_FROM_REGEXP, /* The regular expressions module */
|
||||
XML_FROM_DATATYPE, /* The W3C XML Schemas Datatype module */
|
||||
XML_FROM_SCHEMASP, /* The W3C XML Schemas parser module */
|
||||
XML_FROM_SCHEMASV, /* The W3C XML Schemas validation module */
|
||||
XML_FROM_RELAXNGP, /* The Relax-NG parser module */
|
||||
XML_FROM_RELAXNGV, /* The Relax-NG validator module */
|
||||
XML_FROM_CATALOG, /* The Catalog module */
|
||||
XML_FROM_C14N, /* The Canonicalization module */
|
||||
XML_FROM_XSLT, /* The XSLT engine from libxslt */
|
||||
XML_FROM_VALID, /* The XML DTD validation with valid context */
|
||||
XML_FROM_CHECK, /* The error checking module */
|
||||
XML_FROM_WRITER, /* The xmlwriter module */
|
||||
XML_FROM_MODULE /* The dynamically loaded module module*/
|
||||
} xmlErrorDomain;
|
||||
|
||||
/**
|
||||
* xmlError:
|
||||
*
|
||||
* An XML Error instance.
|
||||
*/
|
||||
|
||||
typedef struct _xmlError xmlError;
|
||||
typedef xmlError *xmlErrorPtr;
|
||||
struct _xmlError {
|
||||
int domain; /* What part of the library raised this error */
|
||||
int code; /* The error code, e.g. an xmlParserError */
|
||||
char *message;/* human-readable informative error message */
|
||||
xmlErrorLevel level;/* how consequent is the error */
|
||||
char *file; /* the filename */
|
||||
int line; /* the line number if available */
|
||||
char *str1; /* extra string information */
|
||||
char *str2; /* extra string information */
|
||||
char *str3; /* extra string information */
|
||||
int int1; /* extra number information */
|
||||
intptr_t int2; /* column number of the error or 0 if N/A (todo: rename this field when we would break ABI) */
|
||||
void *ctxt; /* the parser context if available */
|
||||
void *node; /* the node in the tree */
|
||||
};
|
||||
|
||||
/**
|
||||
* xmlParserError:
|
||||
*
|
||||
* This is an error that the XML (or HTML) parser can generate
|
||||
*/
|
||||
typedef enum {
|
||||
XML_ERR_OK = 0,
|
||||
XML_ERR_INTERNAL_ERROR, /* 1 */
|
||||
XML_ERR_NO_MEMORY, /* 2 */
|
||||
XML_ERR_DOCUMENT_START, /* 3 */
|
||||
XML_ERR_DOCUMENT_EMPTY, /* 4 */
|
||||
XML_ERR_DOCUMENT_END, /* 5 */
|
||||
XML_ERR_INVALID_HEX_CHARREF, /* 6 */
|
||||
XML_ERR_INVALID_DEC_CHARREF, /* 7 */
|
||||
XML_ERR_INVALID_CHARREF, /* 8 */
|
||||
XML_ERR_INVALID_CHAR, /* 9 */
|
||||
XML_ERR_CHARREF_AT_EOF, /* 10 */
|
||||
XML_ERR_CHARREF_IN_PROLOG, /* 11 */
|
||||
XML_ERR_CHARREF_IN_EPILOG, /* 12 */
|
||||
XML_ERR_CHARREF_IN_DTD, /* 13 */
|
||||
XML_ERR_ENTITYREF_AT_EOF, /* 14 */
|
||||
XML_ERR_ENTITYREF_IN_PROLOG, /* 15 */
|
||||
XML_ERR_ENTITYREF_IN_EPILOG, /* 16 */
|
||||
XML_ERR_ENTITYREF_IN_DTD, /* 17 */
|
||||
XML_ERR_PEREF_AT_EOF, /* 18 */
|
||||
XML_ERR_PEREF_IN_PROLOG, /* 19 */
|
||||
XML_ERR_PEREF_IN_EPILOG, /* 20 */
|
||||
XML_ERR_PEREF_IN_INT_SUBSET, /* 21 */
|
||||
XML_ERR_ENTITYREF_NO_NAME, /* 22 */
|
||||
XML_ERR_ENTITYREF_SEMICOL_MISSING, /* 23 */
|
||||
XML_ERR_PEREF_NO_NAME, /* 24 */
|
||||
XML_ERR_PEREF_SEMICOL_MISSING, /* 25 */
|
||||
XML_ERR_UNDECLARED_ENTITY, /* 26 */
|
||||
XML_WAR_UNDECLARED_ENTITY, /* 27 */
|
||||
XML_ERR_UNPARSED_ENTITY, /* 28 */
|
||||
XML_ERR_ENTITY_IS_EXTERNAL, /* 29 */
|
||||
XML_ERR_ENTITY_IS_PARAMETER, /* 30 */
|
||||
XML_ERR_UNKNOWN_ENCODING, /* 31 */
|
||||
XML_ERR_UNSUPPORTED_ENCODING, /* 32 */
|
||||
XML_ERR_STRING_NOT_STARTED, /* 33 */
|
||||
XML_ERR_STRING_NOT_CLOSED, /* 34 */
|
||||
XML_ERR_NS_DECL_ERROR, /* 35 */
|
||||
XML_ERR_ENTITY_NOT_STARTED, /* 36 */
|
||||
XML_ERR_ENTITY_NOT_FINISHED, /* 37 */
|
||||
XML_ERR_LT_IN_ATTRIBUTE, /* 38 */
|
||||
XML_ERR_ATTRIBUTE_NOT_STARTED, /* 39 */
|
||||
XML_ERR_ATTRIBUTE_NOT_FINISHED, /* 40 */
|
||||
XML_ERR_ATTRIBUTE_WITHOUT_VALUE, /* 41 */
|
||||
XML_ERR_ATTRIBUTE_REDEFINED, /* 42 */
|
||||
XML_ERR_LITERAL_NOT_STARTED, /* 43 */
|
||||
XML_ERR_LITERAL_NOT_FINISHED, /* 44 */
|
||||
XML_ERR_COMMENT_NOT_FINISHED, /* 45 */
|
||||
XML_ERR_PI_NOT_STARTED, /* 46 */
|
||||
XML_ERR_PI_NOT_FINISHED, /* 47 */
|
||||
XML_ERR_NOTATION_NOT_STARTED, /* 48 */
|
||||
XML_ERR_NOTATION_NOT_FINISHED, /* 49 */
|
||||
XML_ERR_ATTLIST_NOT_STARTED, /* 50 */
|
||||
XML_ERR_ATTLIST_NOT_FINISHED, /* 51 */
|
||||
XML_ERR_MIXED_NOT_STARTED, /* 52 */
|
||||
XML_ERR_MIXED_NOT_FINISHED, /* 53 */
|
||||
XML_ERR_ELEMCONTENT_NOT_STARTED, /* 54 */
|
||||
XML_ERR_ELEMCONTENT_NOT_FINISHED, /* 55 */
|
||||
XML_ERR_XMLDECL_NOT_STARTED, /* 56 */
|
||||
XML_ERR_XMLDECL_NOT_FINISHED, /* 57 */
|
||||
XML_ERR_CONDSEC_NOT_STARTED, /* 58 */
|
||||
XML_ERR_CONDSEC_NOT_FINISHED, /* 59 */
|
||||
XML_ERR_EXT_SUBSET_NOT_FINISHED, /* 60 */
|
||||
XML_ERR_DOCTYPE_NOT_FINISHED, /* 61 */
|
||||
XML_ERR_MISPLACED_CDATA_END, /* 62 */
|
||||
XML_ERR_CDATA_NOT_FINISHED, /* 63 */
|
||||
XML_ERR_RESERVED_XML_NAME, /* 64 */
|
||||
XML_ERR_SPACE_REQUIRED, /* 65 */
|
||||
XML_ERR_SEPARATOR_REQUIRED, /* 66 */
|
||||
XML_ERR_NMTOKEN_REQUIRED, /* 67 */
|
||||
XML_ERR_NAME_REQUIRED, /* 68 */
|
||||
XML_ERR_PCDATA_REQUIRED, /* 69 */
|
||||
XML_ERR_URI_REQUIRED, /* 70 */
|
||||
XML_ERR_PUBID_REQUIRED, /* 71 */
|
||||
XML_ERR_LT_REQUIRED, /* 72 */
|
||||
XML_ERR_GT_REQUIRED, /* 73 */
|
||||
XML_ERR_LTSLASH_REQUIRED, /* 74 */
|
||||
XML_ERR_EQUAL_REQUIRED, /* 75 */
|
||||
XML_ERR_TAG_NAME_MISMATCH, /* 76 */
|
||||
XML_ERR_TAG_NOT_FINISHED, /* 77 */
|
||||
XML_ERR_STANDALONE_VALUE, /* 78 */
|
||||
XML_ERR_ENCODING_NAME, /* 79 */
|
||||
XML_ERR_HYPHEN_IN_COMMENT, /* 80 */
|
||||
XML_ERR_INVALID_ENCODING, /* 81 */
|
||||
XML_ERR_EXT_ENTITY_STANDALONE, /* 82 */
|
||||
XML_ERR_CONDSEC_INVALID, /* 83 */
|
||||
XML_ERR_VALUE_REQUIRED, /* 84 */
|
||||
XML_ERR_NOT_WELL_BALANCED, /* 85 */
|
||||
XML_ERR_EXTRA_CONTENT, /* 86 */
|
||||
XML_ERR_ENTITY_CHAR_ERROR, /* 87 */
|
||||
XML_ERR_ENTITY_PE_INTERNAL, /* 88 */
|
||||
XML_ERR_ENTITY_LOOP, /* 89 */
|
||||
XML_ERR_ENTITY_BOUNDARY, /* 90 */
|
||||
XML_ERR_INVALID_URI, /* 91 */
|
||||
XML_ERR_URI_FRAGMENT, /* 92 */
|
||||
XML_WAR_CATALOG_PI, /* 93 */
|
||||
XML_ERR_NO_DTD, /* 94 */
|
||||
XML_ERR_CONDSEC_INVALID_KEYWORD, /* 95 */
|
||||
XML_ERR_VERSION_MISSING, /* 96 */
|
||||
XML_WAR_UNKNOWN_VERSION, /* 97 */
|
||||
XML_WAR_LANG_VALUE, /* 98 */
|
||||
XML_WAR_NS_URI, /* 99 */
|
||||
XML_WAR_NS_URI_RELATIVE, /* 100 */
|
||||
XML_ERR_MISSING_ENCODING, /* 101 */
|
||||
XML_NS_ERR_XML_NAMESPACE = 200,
|
||||
XML_NS_ERR_UNDEFINED_NAMESPACE, /* 201 */
|
||||
XML_NS_ERR_QNAME, /* 202 */
|
||||
XML_NS_ERR_ATTRIBUTE_REDEFINED, /* 203 */
|
||||
XML_DTD_ATTRIBUTE_DEFAULT = 500,
|
||||
XML_DTD_ATTRIBUTE_REDEFINED, /* 501 */
|
||||
XML_DTD_ATTRIBUTE_VALUE, /* 502 */
|
||||
XML_DTD_CONTENT_ERROR, /* 503 */
|
||||
XML_DTD_CONTENT_MODEL, /* 504 */
|
||||
XML_DTD_CONTENT_NOT_DETERMINIST, /* 505 */
|
||||
XML_DTD_DIFFERENT_PREFIX, /* 506 */
|
||||
XML_DTD_ELEM_DEFAULT_NAMESPACE, /* 507 */
|
||||
XML_DTD_ELEM_NAMESPACE, /* 508 */
|
||||
XML_DTD_ELEM_REDEFINED, /* 509 */
|
||||
XML_DTD_EMPTY_NOTATION, /* 510 */
|
||||
XML_DTD_ENTITY_TYPE, /* 511 */
|
||||
XML_DTD_ID_FIXED, /* 512 */
|
||||
XML_DTD_ID_REDEFINED, /* 513 */
|
||||
XML_DTD_ID_SUBSET, /* 514 */
|
||||
XML_DTD_INVALID_CHILD, /* 515 */
|
||||
XML_DTD_INVALID_DEFAULT, /* 516 */
|
||||
XML_DTD_LOAD_ERROR, /* 517 */
|
||||
XML_DTD_MISSING_ATTRIBUTE, /* 518 */
|
||||
XML_DTD_MIXED_CORRUPT, /* 519 */
|
||||
XML_DTD_MULTIPLE_ID, /* 520 */
|
||||
XML_DTD_NO_DOC, /* 521 */
|
||||
XML_DTD_NO_DTD, /* 522 */
|
||||
XML_DTD_NO_ELEM_NAME, /* 523 */
|
||||
XML_DTD_NO_PREFIX, /* 524 */
|
||||
XML_DTD_NO_ROOT, /* 525 */
|
||||
XML_DTD_NOTATION_REDEFINED, /* 526 */
|
||||
XML_DTD_NOTATION_VALUE, /* 527 */
|
||||
XML_DTD_NOT_EMPTY, /* 528 */
|
||||
XML_DTD_NOT_PCDATA, /* 529 */
|
||||
XML_DTD_NOT_STANDALONE, /* 530 */
|
||||
XML_DTD_ROOT_NAME, /* 531 */
|
||||
XML_DTD_STANDALONE_WHITE_SPACE, /* 532 */
|
||||
XML_DTD_UNKNOWN_ATTRIBUTE, /* 533 */
|
||||
XML_DTD_UNKNOWN_ELEM, /* 534 */
|
||||
XML_DTD_UNKNOWN_ENTITY, /* 535 */
|
||||
XML_DTD_UNKNOWN_ID, /* 536 */
|
||||
XML_DTD_UNKNOWN_NOTATION, /* 537 */
|
||||
XML_DTD_STANDALONE_DEFAULTED, /* 538 */
|
||||
XML_DTD_XMLID_VALUE, /* 539 */
|
||||
XML_DTD_XMLID_TYPE, /* 540 */
|
||||
XML_HTML_STRUCURE_ERROR = 800,
|
||||
XML_HTML_UNKNOWN_TAG, /* 801 */
|
||||
XML_RNGP_ANYNAME_ATTR_ANCESTOR = 1000,
|
||||
XML_RNGP_ATTR_CONFLICT, /* 1001 */
|
||||
XML_RNGP_ATTRIBUTE_CHILDREN, /* 1002 */
|
||||
XML_RNGP_ATTRIBUTE_CONTENT, /* 1003 */
|
||||
XML_RNGP_ATTRIBUTE_EMPTY, /* 1004 */
|
||||
XML_RNGP_ATTRIBUTE_NOOP, /* 1005 */
|
||||
XML_RNGP_CHOICE_CONTENT, /* 1006 */
|
||||
XML_RNGP_CHOICE_EMPTY, /* 1007 */
|
||||
XML_RNGP_CREATE_FAILURE, /* 1008 */
|
||||
XML_RNGP_DATA_CONTENT, /* 1009 */
|
||||
XML_RNGP_DEF_CHOICE_AND_INTERLEAVE, /* 1010 */
|
||||
XML_RNGP_DEFINE_CREATE_FAILED, /* 1011 */
|
||||
XML_RNGP_DEFINE_EMPTY, /* 1012 */
|
||||
XML_RNGP_DEFINE_MISSING, /* 1013 */
|
||||
XML_RNGP_DEFINE_NAME_MISSING, /* 1014 */
|
||||
XML_RNGP_ELEM_CONTENT_EMPTY, /* 1015 */
|
||||
XML_RNGP_ELEM_CONTENT_ERROR, /* 1016 */
|
||||
XML_RNGP_ELEMENT_EMPTY, /* 1017 */
|
||||
XML_RNGP_ELEMENT_CONTENT, /* 1018 */
|
||||
XML_RNGP_ELEMENT_NAME, /* 1019 */
|
||||
XML_RNGP_ELEMENT_NO_CONTENT, /* 1020 */
|
||||
XML_RNGP_ELEM_TEXT_CONFLICT, /* 1021 */
|
||||
XML_RNGP_EMPTY, /* 1022 */
|
||||
XML_RNGP_EMPTY_CONSTRUCT, /* 1023 */
|
||||
XML_RNGP_EMPTY_CONTENT, /* 1024 */
|
||||
XML_RNGP_EMPTY_NOT_EMPTY, /* 1025 */
|
||||
XML_RNGP_ERROR_TYPE_LIB, /* 1026 */
|
||||
XML_RNGP_EXCEPT_EMPTY, /* 1027 */
|
||||
XML_RNGP_EXCEPT_MISSING, /* 1028 */
|
||||
XML_RNGP_EXCEPT_MULTIPLE, /* 1029 */
|
||||
XML_RNGP_EXCEPT_NO_CONTENT, /* 1030 */
|
||||
XML_RNGP_EXTERNALREF_EMTPY, /* 1031 */
|
||||
XML_RNGP_EXTERNAL_REF_FAILURE, /* 1032 */
|
||||
XML_RNGP_EXTERNALREF_RECURSE, /* 1033 */
|
||||
XML_RNGP_FORBIDDEN_ATTRIBUTE, /* 1034 */
|
||||
XML_RNGP_FOREIGN_ELEMENT, /* 1035 */
|
||||
XML_RNGP_GRAMMAR_CONTENT, /* 1036 */
|
||||
XML_RNGP_GRAMMAR_EMPTY, /* 1037 */
|
||||
XML_RNGP_GRAMMAR_MISSING, /* 1038 */
|
||||
XML_RNGP_GRAMMAR_NO_START, /* 1039 */
|
||||
XML_RNGP_GROUP_ATTR_CONFLICT, /* 1040 */
|
||||
XML_RNGP_HREF_ERROR, /* 1041 */
|
||||
XML_RNGP_INCLUDE_EMPTY, /* 1042 */
|
||||
XML_RNGP_INCLUDE_FAILURE, /* 1043 */
|
||||
XML_RNGP_INCLUDE_RECURSE, /* 1044 */
|
||||
XML_RNGP_INTERLEAVE_ADD, /* 1045 */
|
||||
XML_RNGP_INTERLEAVE_CREATE_FAILED, /* 1046 */
|
||||
XML_RNGP_INTERLEAVE_EMPTY, /* 1047 */
|
||||
XML_RNGP_INTERLEAVE_NO_CONTENT, /* 1048 */
|
||||
XML_RNGP_INVALID_DEFINE_NAME, /* 1049 */
|
||||
XML_RNGP_INVALID_URI, /* 1050 */
|
||||
XML_RNGP_INVALID_VALUE, /* 1051 */
|
||||
XML_RNGP_MISSING_HREF, /* 1052 */
|
||||
XML_RNGP_NAME_MISSING, /* 1053 */
|
||||
XML_RNGP_NEED_COMBINE, /* 1054 */
|
||||
XML_RNGP_NOTALLOWED_NOT_EMPTY, /* 1055 */
|
||||
XML_RNGP_NSNAME_ATTR_ANCESTOR, /* 1056 */
|
||||
XML_RNGP_NSNAME_NO_NS, /* 1057 */
|
||||
XML_RNGP_PARAM_FORBIDDEN, /* 1058 */
|
||||
XML_RNGP_PARAM_NAME_MISSING, /* 1059 */
|
||||
XML_RNGP_PARENTREF_CREATE_FAILED, /* 1060 */
|
||||
XML_RNGP_PARENTREF_NAME_INVALID, /* 1061 */
|
||||
XML_RNGP_PARENTREF_NO_NAME, /* 1062 */
|
||||
XML_RNGP_PARENTREF_NO_PARENT, /* 1063 */
|
||||
XML_RNGP_PARENTREF_NOT_EMPTY, /* 1064 */
|
||||
XML_RNGP_PARSE_ERROR, /* 1065 */
|
||||
XML_RNGP_PAT_ANYNAME_EXCEPT_ANYNAME, /* 1066 */
|
||||
XML_RNGP_PAT_ATTR_ATTR, /* 1067 */
|
||||
XML_RNGP_PAT_ATTR_ELEM, /* 1068 */
|
||||
XML_RNGP_PAT_DATA_EXCEPT_ATTR, /* 1069 */
|
||||
XML_RNGP_PAT_DATA_EXCEPT_ELEM, /* 1070 */
|
||||
XML_RNGP_PAT_DATA_EXCEPT_EMPTY, /* 1071 */
|
||||
XML_RNGP_PAT_DATA_EXCEPT_GROUP, /* 1072 */
|
||||
XML_RNGP_PAT_DATA_EXCEPT_INTERLEAVE, /* 1073 */
|
||||
XML_RNGP_PAT_DATA_EXCEPT_LIST, /* 1074 */
|
||||
XML_RNGP_PAT_DATA_EXCEPT_ONEMORE, /* 1075 */
|
||||
XML_RNGP_PAT_DATA_EXCEPT_REF, /* 1076 */
|
||||
XML_RNGP_PAT_DATA_EXCEPT_TEXT, /* 1077 */
|
||||
XML_RNGP_PAT_LIST_ATTR, /* 1078 */
|
||||
XML_RNGP_PAT_LIST_ELEM, /* 1079 */
|
||||
XML_RNGP_PAT_LIST_INTERLEAVE, /* 1080 */
|
||||
XML_RNGP_PAT_LIST_LIST, /* 1081 */
|
||||
XML_RNGP_PAT_LIST_REF, /* 1082 */
|
||||
XML_RNGP_PAT_LIST_TEXT, /* 1083 */
|
||||
XML_RNGP_PAT_NSNAME_EXCEPT_ANYNAME, /* 1084 */
|
||||
XML_RNGP_PAT_NSNAME_EXCEPT_NSNAME, /* 1085 */
|
||||
XML_RNGP_PAT_ONEMORE_GROUP_ATTR, /* 1086 */
|
||||
XML_RNGP_PAT_ONEMORE_INTERLEAVE_ATTR, /* 1087 */
|
||||
XML_RNGP_PAT_START_ATTR, /* 1088 */
|
||||
XML_RNGP_PAT_START_DATA, /* 1089 */
|
||||
XML_RNGP_PAT_START_EMPTY, /* 1090 */
|
||||
XML_RNGP_PAT_START_GROUP, /* 1091 */
|
||||
XML_RNGP_PAT_START_INTERLEAVE, /* 1092 */
|
||||
XML_RNGP_PAT_START_LIST, /* 1093 */
|
||||
XML_RNGP_PAT_START_ONEMORE, /* 1094 */
|
||||
XML_RNGP_PAT_START_TEXT, /* 1095 */
|
||||
XML_RNGP_PAT_START_VALUE, /* 1096 */
|
||||
XML_RNGP_PREFIX_UNDEFINED, /* 1097 */
|
||||
XML_RNGP_REF_CREATE_FAILED, /* 1098 */
|
||||
XML_RNGP_REF_CYCLE, /* 1099 */
|
||||
XML_RNGP_REF_NAME_INVALID, /* 1100 */
|
||||
XML_RNGP_REF_NO_DEF, /* 1101 */
|
||||
XML_RNGP_REF_NO_NAME, /* 1102 */
|
||||
XML_RNGP_REF_NOT_EMPTY, /* 1103 */
|
||||
XML_RNGP_START_CHOICE_AND_INTERLEAVE, /* 1104 */
|
||||
XML_RNGP_START_CONTENT, /* 1105 */
|
||||
XML_RNGP_START_EMPTY, /* 1106 */
|
||||
XML_RNGP_START_MISSING, /* 1107 */
|
||||
XML_RNGP_TEXT_EXPECTED, /* 1108 */
|
||||
XML_RNGP_TEXT_HAS_CHILD, /* 1109 */
|
||||
XML_RNGP_TYPE_MISSING, /* 1110 */
|
||||
XML_RNGP_TYPE_NOT_FOUND, /* 1111 */
|
||||
XML_RNGP_TYPE_VALUE, /* 1112 */
|
||||
XML_RNGP_UNKNOWN_ATTRIBUTE, /* 1113 */
|
||||
XML_RNGP_UNKNOWN_COMBINE, /* 1114 */
|
||||
XML_RNGP_UNKNOWN_CONSTRUCT, /* 1115 */
|
||||
XML_RNGP_UNKNOWN_TYPE_LIB, /* 1116 */
|
||||
XML_RNGP_URI_FRAGMENT, /* 1117 */
|
||||
XML_RNGP_URI_NOT_ABSOLUTE, /* 1118 */
|
||||
XML_RNGP_VALUE_EMPTY, /* 1119 */
|
||||
XML_RNGP_VALUE_NO_CONTENT, /* 1120 */
|
||||
XML_RNGP_XMLNS_NAME, /* 1121 */
|
||||
XML_RNGP_XML_NS, /* 1122 */
|
||||
XML_XPATH_EXPRESSION_OK = 1200,
|
||||
XML_XPATH_NUMBER_ERROR, /* 1201 */
|
||||
XML_XPATH_UNFINISHED_LITERAL_ERROR, /* 1202 */
|
||||
XML_XPATH_START_LITERAL_ERROR, /* 1203 */
|
||||
XML_XPATH_VARIABLE_REF_ERROR, /* 1204 */
|
||||
XML_XPATH_UNDEF_VARIABLE_ERROR, /* 1205 */
|
||||
XML_XPATH_INVALID_PREDICATE_ERROR, /* 1206 */
|
||||
XML_XPATH_EXPR_ERROR, /* 1207 */
|
||||
XML_XPATH_UNCLOSED_ERROR, /* 1208 */
|
||||
XML_XPATH_UNKNOWN_FUNC_ERROR, /* 1209 */
|
||||
XML_XPATH_INVALID_OPERAND, /* 1210 */
|
||||
XML_XPATH_INVALID_TYPE, /* 1211 */
|
||||
XML_XPATH_INVALID_ARITY, /* 1212 */
|
||||
XML_XPATH_INVALID_CTXT_SIZE, /* 1213 */
|
||||
XML_XPATH_INVALID_CTXT_POSITION, /* 1214 */
|
||||
XML_XPATH_MEMORY_ERROR, /* 1215 */
|
||||
XML_XPTR_SYNTAX_ERROR, /* 1216 */
|
||||
XML_XPTR_RESOURCE_ERROR, /* 1217 */
|
||||
XML_XPTR_SUB_RESOURCE_ERROR, /* 1218 */
|
||||
XML_XPATH_UNDEF_PREFIX_ERROR, /* 1219 */
|
||||
XML_XPATH_ENCODING_ERROR, /* 1220 */
|
||||
XML_XPATH_INVALID_CHAR_ERROR, /* 1221 */
|
||||
XML_TREE_INVALID_HEX = 1300,
|
||||
XML_TREE_INVALID_DEC, /* 1301 */
|
||||
XML_TREE_UNTERMINATED_ENTITY, /* 1302 */
|
||||
XML_SAVE_NOT_UTF8 = 1400,
|
||||
XML_SAVE_CHAR_INVALID, /* 1401 */
|
||||
XML_SAVE_NO_DOCTYPE, /* 1402 */
|
||||
XML_SAVE_UNKNOWN_ENCODING, /* 1403 */
|
||||
XML_REGEXP_COMPILE_ERROR = 1450,
|
||||
XML_IO_UNKNOWN = 1500,
|
||||
XML_IO_EACCES, /* 1501 */
|
||||
XML_IO_EAGAIN, /* 1502 */
|
||||
XML_IO_EBADF, /* 1503 */
|
||||
XML_IO_EBADMSG, /* 1504 */
|
||||
XML_IO_EBUSY, /* 1505 */
|
||||
XML_IO_ECANCELED, /* 1506 */
|
||||
XML_IO_ECHILD, /* 1507 */
|
||||
XML_IO_EDEADLK, /* 1508 */
|
||||
XML_IO_EDOM, /* 1509 */
|
||||
XML_IO_EEXIST, /* 1510 */
|
||||
XML_IO_EFAULT, /* 1511 */
|
||||
XML_IO_EFBIG, /* 1512 */
|
||||
XML_IO_EINPROGRESS, /* 1513 */
|
||||
XML_IO_EINTR, /* 1514 */
|
||||
XML_IO_EINVAL, /* 1515 */
|
||||
XML_IO_EIO, /* 1516 */
|
||||
XML_IO_EISDIR, /* 1517 */
|
||||
XML_IO_EMFILE, /* 1518 */
|
||||
XML_IO_EMLINK, /* 1519 */
|
||||
XML_IO_EMSGSIZE, /* 1520 */
|
||||
XML_IO_ENAMETOOLONG, /* 1521 */
|
||||
XML_IO_ENFILE, /* 1522 */
|
||||
XML_IO_ENODEV, /* 1523 */
|
||||
XML_IO_ENOENT, /* 1524 */
|
||||
XML_IO_ENOEXEC, /* 1525 */
|
||||
XML_IO_ENOLCK, /* 1526 */
|
||||
XML_IO_ENOMEM, /* 1527 */
|
||||
XML_IO_ENOSPC, /* 1528 */
|
||||
XML_IO_ENOSYS, /* 1529 */
|
||||
XML_IO_ENOTDIR, /* 1530 */
|
||||
XML_IO_ENOTEMPTY, /* 1531 */
|
||||
XML_IO_ENOTSUP, /* 1532 */
|
||||
XML_IO_ENOTTY, /* 1533 */
|
||||
XML_IO_ENXIO, /* 1534 */
|
||||
XML_IO_EPERM, /* 1535 */
|
||||
XML_IO_EPIPE, /* 1536 */
|
||||
XML_IO_ERANGE, /* 1537 */
|
||||
XML_IO_EROFS, /* 1538 */
|
||||
XML_IO_ESPIPE, /* 1539 */
|
||||
XML_IO_ESRCH, /* 1540 */
|
||||
XML_IO_ETIMEDOUT, /* 1541 */
|
||||
XML_IO_EXDEV, /* 1542 */
|
||||
XML_IO_NETWORK_ATTEMPT, /* 1543 */
|
||||
XML_IO_ENCODER, /* 1544 */
|
||||
XML_IO_FLUSH, /* 1545 */
|
||||
XML_IO_WRITE, /* 1546 */
|
||||
XML_IO_NO_INPUT, /* 1547 */
|
||||
XML_IO_BUFFER_FULL, /* 1548 */
|
||||
XML_IO_LOAD_ERROR, /* 1549 */
|
||||
XML_IO_ENOTSOCK, /* 1550 */
|
||||
XML_IO_EISCONN, /* 1551 */
|
||||
XML_IO_ECONNREFUSED, /* 1552 */
|
||||
XML_IO_ENETUNREACH, /* 1553 */
|
||||
XML_IO_EADDRINUSE, /* 1554 */
|
||||
XML_IO_EALREADY, /* 1555 */
|
||||
XML_IO_EAFNOSUPPORT, /* 1556 */
|
||||
XML_XINCLUDE_RECURSION=1600,
|
||||
XML_XINCLUDE_PARSE_VALUE, /* 1601 */
|
||||
XML_XINCLUDE_ENTITY_DEF_MISMATCH, /* 1602 */
|
||||
XML_XINCLUDE_NO_HREF, /* 1603 */
|
||||
XML_XINCLUDE_NO_FALLBACK, /* 1604 */
|
||||
XML_XINCLUDE_HREF_URI, /* 1605 */
|
||||
XML_XINCLUDE_TEXT_FRAGMENT, /* 1606 */
|
||||
XML_XINCLUDE_TEXT_DOCUMENT, /* 1607 */
|
||||
XML_XINCLUDE_INVALID_CHAR, /* 1608 */
|
||||
XML_XINCLUDE_BUILD_FAILED, /* 1609 */
|
||||
XML_XINCLUDE_UNKNOWN_ENCODING, /* 1610 */
|
||||
XML_XINCLUDE_MULTIPLE_ROOT, /* 1611 */
|
||||
XML_XINCLUDE_XPTR_FAILED, /* 1612 */
|
||||
XML_XINCLUDE_XPTR_RESULT, /* 1613 */
|
||||
XML_XINCLUDE_INCLUDE_IN_INCLUDE, /* 1614 */
|
||||
XML_XINCLUDE_FALLBACKS_IN_INCLUDE, /* 1615 */
|
||||
XML_XINCLUDE_FALLBACK_NOT_IN_INCLUDE, /* 1616 */
|
||||
XML_XINCLUDE_DEPRECATED_NS, /* 1617 */
|
||||
XML_XINCLUDE_FRAGMENT_ID, /* 1618 */
|
||||
XML_CATALOG_MISSING_ATTR = 1650,
|
||||
XML_CATALOG_ENTRY_BROKEN, /* 1651 */
|
||||
XML_CATALOG_PREFER_VALUE, /* 1652 */
|
||||
XML_CATALOG_NOT_CATALOG, /* 1653 */
|
||||
XML_CATALOG_RECURSION, /* 1654 */
|
||||
XML_SCHEMAP_PREFIX_UNDEFINED = 1700,
|
||||
XML_SCHEMAP_ATTRFORMDEFAULT_VALUE, /* 1701 */
|
||||
XML_SCHEMAP_ATTRGRP_NONAME_NOREF, /* 1702 */
|
||||
XML_SCHEMAP_ATTR_NONAME_NOREF, /* 1703 */
|
||||
XML_SCHEMAP_COMPLEXTYPE_NONAME_NOREF, /* 1704 */
|
||||
XML_SCHEMAP_ELEMFORMDEFAULT_VALUE, /* 1705 */
|
||||
XML_SCHEMAP_ELEM_NONAME_NOREF, /* 1706 */
|
||||
XML_SCHEMAP_EXTENSION_NO_BASE, /* 1707 */
|
||||
XML_SCHEMAP_FACET_NO_VALUE, /* 1708 */
|
||||
XML_SCHEMAP_FAILED_BUILD_IMPORT, /* 1709 */
|
||||
XML_SCHEMAP_GROUP_NONAME_NOREF, /* 1710 */
|
||||
XML_SCHEMAP_IMPORT_NAMESPACE_NOT_URI, /* 1711 */
|
||||
XML_SCHEMAP_IMPORT_REDEFINE_NSNAME, /* 1712 */
|
||||
XML_SCHEMAP_IMPORT_SCHEMA_NOT_URI, /* 1713 */
|
||||
XML_SCHEMAP_INVALID_BOOLEAN, /* 1714 */
|
||||
XML_SCHEMAP_INVALID_ENUM, /* 1715 */
|
||||
XML_SCHEMAP_INVALID_FACET, /* 1716 */
|
||||
XML_SCHEMAP_INVALID_FACET_VALUE, /* 1717 */
|
||||
XML_SCHEMAP_INVALID_MAXOCCURS, /* 1718 */
|
||||
XML_SCHEMAP_INVALID_MINOCCURS, /* 1719 */
|
||||
XML_SCHEMAP_INVALID_REF_AND_SUBTYPE, /* 1720 */
|
||||
XML_SCHEMAP_INVALID_WHITE_SPACE, /* 1721 */
|
||||
XML_SCHEMAP_NOATTR_NOREF, /* 1722 */
|
||||
XML_SCHEMAP_NOTATION_NO_NAME, /* 1723 */
|
||||
XML_SCHEMAP_NOTYPE_NOREF, /* 1724 */
|
||||
XML_SCHEMAP_REF_AND_SUBTYPE, /* 1725 */
|
||||
XML_SCHEMAP_RESTRICTION_NONAME_NOREF, /* 1726 */
|
||||
XML_SCHEMAP_SIMPLETYPE_NONAME, /* 1727 */
|
||||
XML_SCHEMAP_TYPE_AND_SUBTYPE, /* 1728 */
|
||||
XML_SCHEMAP_UNKNOWN_ALL_CHILD, /* 1729 */
|
||||
XML_SCHEMAP_UNKNOWN_ANYATTRIBUTE_CHILD, /* 1730 */
|
||||
XML_SCHEMAP_UNKNOWN_ATTR_CHILD, /* 1731 */
|
||||
XML_SCHEMAP_UNKNOWN_ATTRGRP_CHILD, /* 1732 */
|
||||
XML_SCHEMAP_UNKNOWN_ATTRIBUTE_GROUP, /* 1733 */
|
||||
XML_SCHEMAP_UNKNOWN_BASE_TYPE, /* 1734 */
|
||||
XML_SCHEMAP_UNKNOWN_CHOICE_CHILD, /* 1735 */
|
||||
XML_SCHEMAP_UNKNOWN_COMPLEXCONTENT_CHILD, /* 1736 */
|
||||
XML_SCHEMAP_UNKNOWN_COMPLEXTYPE_CHILD, /* 1737 */
|
||||
XML_SCHEMAP_UNKNOWN_ELEM_CHILD, /* 1738 */
|
||||
XML_SCHEMAP_UNKNOWN_EXTENSION_CHILD, /* 1739 */
|
||||
XML_SCHEMAP_UNKNOWN_FACET_CHILD, /* 1740 */
|
||||
XML_SCHEMAP_UNKNOWN_FACET_TYPE, /* 1741 */
|
||||
XML_SCHEMAP_UNKNOWN_GROUP_CHILD, /* 1742 */
|
||||
XML_SCHEMAP_UNKNOWN_IMPORT_CHILD, /* 1743 */
|
||||
XML_SCHEMAP_UNKNOWN_LIST_CHILD, /* 1744 */
|
||||
XML_SCHEMAP_UNKNOWN_NOTATION_CHILD, /* 1745 */
|
||||
XML_SCHEMAP_UNKNOWN_PROCESSCONTENT_CHILD, /* 1746 */
|
||||
XML_SCHEMAP_UNKNOWN_REF, /* 1747 */
|
||||
XML_SCHEMAP_UNKNOWN_RESTRICTION_CHILD, /* 1748 */
|
||||
XML_SCHEMAP_UNKNOWN_SCHEMAS_CHILD, /* 1749 */
|
||||
XML_SCHEMAP_UNKNOWN_SEQUENCE_CHILD, /* 1750 */
|
||||
XML_SCHEMAP_UNKNOWN_SIMPLECONTENT_CHILD, /* 1751 */
|
||||
XML_SCHEMAP_UNKNOWN_SIMPLETYPE_CHILD, /* 1752 */
|
||||
XML_SCHEMAP_UNKNOWN_TYPE, /* 1753 */
|
||||
XML_SCHEMAP_UNKNOWN_UNION_CHILD, /* 1754 */
|
||||
XML_SCHEMAP_ELEM_DEFAULT_FIXED, /* 1755 */
|
||||
XML_SCHEMAP_REGEXP_INVALID, /* 1756 */
|
||||
XML_SCHEMAP_FAILED_LOAD, /* 1757 */
|
||||
XML_SCHEMAP_NOTHING_TO_PARSE, /* 1758 */
|
||||
XML_SCHEMAP_NOROOT, /* 1759 */
|
||||
XML_SCHEMAP_REDEFINED_GROUP, /* 1760 */
|
||||
XML_SCHEMAP_REDEFINED_TYPE, /* 1761 */
|
||||
XML_SCHEMAP_REDEFINED_ELEMENT, /* 1762 */
|
||||
XML_SCHEMAP_REDEFINED_ATTRGROUP, /* 1763 */
|
||||
XML_SCHEMAP_REDEFINED_ATTR, /* 1764 */
|
||||
XML_SCHEMAP_REDEFINED_NOTATION, /* 1765 */
|
||||
XML_SCHEMAP_FAILED_PARSE, /* 1766 */
|
||||
XML_SCHEMAP_UNKNOWN_PREFIX, /* 1767 */
|
||||
XML_SCHEMAP_DEF_AND_PREFIX, /* 1768 */
|
||||
XML_SCHEMAP_UNKNOWN_INCLUDE_CHILD, /* 1769 */
|
||||
XML_SCHEMAP_INCLUDE_SCHEMA_NOT_URI, /* 1770 */
|
||||
XML_SCHEMAP_INCLUDE_SCHEMA_NO_URI, /* 1771 */
|
||||
XML_SCHEMAP_NOT_SCHEMA, /* 1772 */
|
||||
XML_SCHEMAP_UNKNOWN_MEMBER_TYPE, /* 1773 */
|
||||
XML_SCHEMAP_INVALID_ATTR_USE, /* 1774 */
|
||||
XML_SCHEMAP_RECURSIVE, /* 1775 */
|
||||
XML_SCHEMAP_SUPERNUMEROUS_LIST_ITEM_TYPE, /* 1776 */
|
||||
XML_SCHEMAP_INVALID_ATTR_COMBINATION, /* 1777 */
|
||||
XML_SCHEMAP_INVALID_ATTR_INLINE_COMBINATION, /* 1778 */
|
||||
XML_SCHEMAP_MISSING_SIMPLETYPE_CHILD, /* 1779 */
|
||||
XML_SCHEMAP_INVALID_ATTR_NAME, /* 1780 */
|
||||
XML_SCHEMAP_REF_AND_CONTENT, /* 1781 */
|
||||
XML_SCHEMAP_CT_PROPS_CORRECT_1, /* 1782 */
|
||||
XML_SCHEMAP_CT_PROPS_CORRECT_2, /* 1783 */
|
||||
XML_SCHEMAP_CT_PROPS_CORRECT_3, /* 1784 */
|
||||
XML_SCHEMAP_CT_PROPS_CORRECT_4, /* 1785 */
|
||||
XML_SCHEMAP_CT_PROPS_CORRECT_5, /* 1786 */
|
||||
XML_SCHEMAP_DERIVATION_OK_RESTRICTION_1, /* 1787 */
|
||||
XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_1, /* 1788 */
|
||||
XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_2, /* 1789 */
|
||||
XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_2, /* 1790 */
|
||||
XML_SCHEMAP_DERIVATION_OK_RESTRICTION_3, /* 1791 */
|
||||
XML_SCHEMAP_WILDCARD_INVALID_NS_MEMBER, /* 1792 */
|
||||
XML_SCHEMAP_INTERSECTION_NOT_EXPRESSIBLE, /* 1793 */
|
||||
XML_SCHEMAP_UNION_NOT_EXPRESSIBLE, /* 1794 */
|
||||
XML_SCHEMAP_SRC_IMPORT_3_1, /* 1795 */
|
||||
XML_SCHEMAP_SRC_IMPORT_3_2, /* 1796 */
|
||||
XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_1, /* 1797 */
|
||||
XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_2, /* 1798 */
|
||||
XML_SCHEMAP_DERIVATION_OK_RESTRICTION_4_3, /* 1799 */
|
||||
XML_SCHEMAP_COS_CT_EXTENDS_1_3, /* 1800 */
|
||||
XML_SCHEMAV_NOROOT = 1801,
|
||||
XML_SCHEMAV_UNDECLAREDELEM, /* 1802 */
|
||||
XML_SCHEMAV_NOTTOPLEVEL, /* 1803 */
|
||||
XML_SCHEMAV_MISSING, /* 1804 */
|
||||
XML_SCHEMAV_WRONGELEM, /* 1805 */
|
||||
XML_SCHEMAV_NOTYPE, /* 1806 */
|
||||
XML_SCHEMAV_NOROLLBACK, /* 1807 */
|
||||
XML_SCHEMAV_ISABSTRACT, /* 1808 */
|
||||
XML_SCHEMAV_NOTEMPTY, /* 1809 */
|
||||
XML_SCHEMAV_ELEMCONT, /* 1810 */
|
||||
XML_SCHEMAV_HAVEDEFAULT, /* 1811 */
|
||||
XML_SCHEMAV_NOTNILLABLE, /* 1812 */
|
||||
XML_SCHEMAV_EXTRACONTENT, /* 1813 */
|
||||
XML_SCHEMAV_INVALIDATTR, /* 1814 */
|
||||
XML_SCHEMAV_INVALIDELEM, /* 1815 */
|
||||
XML_SCHEMAV_NOTDETERMINIST, /* 1816 */
|
||||
XML_SCHEMAV_CONSTRUCT, /* 1817 */
|
||||
XML_SCHEMAV_INTERNAL, /* 1818 */
|
||||
XML_SCHEMAV_NOTSIMPLE, /* 1819 */
|
||||
XML_SCHEMAV_ATTRUNKNOWN, /* 1820 */
|
||||
XML_SCHEMAV_ATTRINVALID, /* 1821 */
|
||||
XML_SCHEMAV_VALUE, /* 1822 */
|
||||
XML_SCHEMAV_FACET, /* 1823 */
|
||||
XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_1, /* 1824 */
|
||||
XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_2, /* 1825 */
|
||||
XML_SCHEMAV_CVC_DATATYPE_VALID_1_2_3, /* 1826 */
|
||||
XML_SCHEMAV_CVC_TYPE_3_1_1, /* 1827 */
|
||||
XML_SCHEMAV_CVC_TYPE_3_1_2, /* 1828 */
|
||||
XML_SCHEMAV_CVC_FACET_VALID, /* 1829 */
|
||||
XML_SCHEMAV_CVC_LENGTH_VALID, /* 1830 */
|
||||
XML_SCHEMAV_CVC_MINLENGTH_VALID, /* 1831 */
|
||||
XML_SCHEMAV_CVC_MAXLENGTH_VALID, /* 1832 */
|
||||
XML_SCHEMAV_CVC_MININCLUSIVE_VALID, /* 1833 */
|
||||
XML_SCHEMAV_CVC_MAXINCLUSIVE_VALID, /* 1834 */
|
||||
XML_SCHEMAV_CVC_MINEXCLUSIVE_VALID, /* 1835 */
|
||||
XML_SCHEMAV_CVC_MAXEXCLUSIVE_VALID, /* 1836 */
|
||||
XML_SCHEMAV_CVC_TOTALDIGITS_VALID, /* 1837 */
|
||||
XML_SCHEMAV_CVC_FRACTIONDIGITS_VALID, /* 1838 */
|
||||
XML_SCHEMAV_CVC_PATTERN_VALID, /* 1839 */
|
||||
XML_SCHEMAV_CVC_ENUMERATION_VALID, /* 1840 */
|
||||
XML_SCHEMAV_CVC_COMPLEX_TYPE_2_1, /* 1841 */
|
||||
XML_SCHEMAV_CVC_COMPLEX_TYPE_2_2, /* 1842 */
|
||||
XML_SCHEMAV_CVC_COMPLEX_TYPE_2_3, /* 1843 */
|
||||
XML_SCHEMAV_CVC_COMPLEX_TYPE_2_4, /* 1844 */
|
||||
XML_SCHEMAV_CVC_ELT_1, /* 1845 */
|
||||
XML_SCHEMAV_CVC_ELT_2, /* 1846 */
|
||||
XML_SCHEMAV_CVC_ELT_3_1, /* 1847 */
|
||||
XML_SCHEMAV_CVC_ELT_3_2_1, /* 1848 */
|
||||
XML_SCHEMAV_CVC_ELT_3_2_2, /* 1849 */
|
||||
XML_SCHEMAV_CVC_ELT_4_1, /* 1850 */
|
||||
XML_SCHEMAV_CVC_ELT_4_2, /* 1851 */
|
||||
XML_SCHEMAV_CVC_ELT_4_3, /* 1852 */
|
||||
XML_SCHEMAV_CVC_ELT_5_1_1, /* 1853 */
|
||||
XML_SCHEMAV_CVC_ELT_5_1_2, /* 1854 */
|
||||
XML_SCHEMAV_CVC_ELT_5_2_1, /* 1855 */
|
||||
XML_SCHEMAV_CVC_ELT_5_2_2_1, /* 1856 */
|
||||
XML_SCHEMAV_CVC_ELT_5_2_2_2_1, /* 1857 */
|
||||
XML_SCHEMAV_CVC_ELT_5_2_2_2_2, /* 1858 */
|
||||
XML_SCHEMAV_CVC_ELT_6, /* 1859 */
|
||||
XML_SCHEMAV_CVC_ELT_7, /* 1860 */
|
||||
XML_SCHEMAV_CVC_ATTRIBUTE_1, /* 1861 */
|
||||
XML_SCHEMAV_CVC_ATTRIBUTE_2, /* 1862 */
|
||||
XML_SCHEMAV_CVC_ATTRIBUTE_3, /* 1863 */
|
||||
XML_SCHEMAV_CVC_ATTRIBUTE_4, /* 1864 */
|
||||
XML_SCHEMAV_CVC_COMPLEX_TYPE_3_1, /* 1865 */
|
||||
XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_1, /* 1866 */
|
||||
XML_SCHEMAV_CVC_COMPLEX_TYPE_3_2_2, /* 1867 */
|
||||
XML_SCHEMAV_CVC_COMPLEX_TYPE_4, /* 1868 */
|
||||
XML_SCHEMAV_CVC_COMPLEX_TYPE_5_1, /* 1869 */
|
||||
XML_SCHEMAV_CVC_COMPLEX_TYPE_5_2, /* 1870 */
|
||||
XML_SCHEMAV_ELEMENT_CONTENT, /* 1871 */
|
||||
XML_SCHEMAV_DOCUMENT_ELEMENT_MISSING, /* 1872 */
|
||||
XML_SCHEMAV_CVC_COMPLEX_TYPE_1, /* 1873 */
|
||||
XML_SCHEMAV_CVC_AU, /* 1874 */
|
||||
XML_SCHEMAV_CVC_TYPE_1, /* 1875 */
|
||||
XML_SCHEMAV_CVC_TYPE_2, /* 1876 */
|
||||
XML_SCHEMAV_CVC_IDC, /* 1877 */
|
||||
XML_SCHEMAV_CVC_WILDCARD, /* 1878 */
|
||||
XML_XPTR_UNKNOWN_SCHEME = 1900,
|
||||
XML_XPTR_CHILDSEQ_START, /* 1901 */
|
||||
XML_XPTR_EVAL_FAILED, /* 1902 */
|
||||
XML_XPTR_EXTRA_OBJECTS, /* 1903 */
|
||||
XML_C14N_CREATE_CTXT = 1950,
|
||||
XML_C14N_REQUIRES_UTF8, /* 1951 */
|
||||
XML_C14N_CREATE_STACK, /* 1952 */
|
||||
XML_C14N_INVALID_NODE, /* 1953 */
|
||||
XML_C14N_UNKNOW_NODE, /* 1954 */
|
||||
XML_C14N_RELATIVE_NAMESPACE, /* 1955 */
|
||||
XML_FTP_PASV_ANSWER = 2000,
|
||||
XML_FTP_EPSV_ANSWER, /* 2001 */
|
||||
XML_FTP_ACCNT, /* 2002 */
|
||||
XML_FTP_URL_SYNTAX, /* 2003 */
|
||||
XML_HTTP_URL_SYNTAX = 2020,
|
||||
XML_HTTP_USE_IP, /* 2021 */
|
||||
XML_HTTP_UNKNOWN_HOST, /* 2022 */
|
||||
XML_SCHEMAP_SRC_SIMPLE_TYPE_1 = 3000,
|
||||
XML_SCHEMAP_SRC_SIMPLE_TYPE_2, /* 3001 */
|
||||
XML_SCHEMAP_SRC_SIMPLE_TYPE_3, /* 3002 */
|
||||
XML_SCHEMAP_SRC_SIMPLE_TYPE_4, /* 3003 */
|
||||
XML_SCHEMAP_SRC_RESOLVE, /* 3004 */
|
||||
XML_SCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPE, /* 3005 */
|
||||
XML_SCHEMAP_SRC_LIST_ITEMTYPE_OR_SIMPLETYPE, /* 3006 */
|
||||
XML_SCHEMAP_SRC_UNION_MEMBERTYPES_OR_SIMPLETYPES, /* 3007 */
|
||||
XML_SCHEMAP_ST_PROPS_CORRECT_1, /* 3008 */
|
||||
XML_SCHEMAP_ST_PROPS_CORRECT_2, /* 3009 */
|
||||
XML_SCHEMAP_ST_PROPS_CORRECT_3, /* 3010 */
|
||||
XML_SCHEMAP_COS_ST_RESTRICTS_1_1, /* 3011 */
|
||||
XML_SCHEMAP_COS_ST_RESTRICTS_1_2, /* 3012 */
|
||||
XML_SCHEMAP_COS_ST_RESTRICTS_1_3_1, /* 3013 */
|
||||
XML_SCHEMAP_COS_ST_RESTRICTS_1_3_2, /* 3014 */
|
||||
XML_SCHEMAP_COS_ST_RESTRICTS_2_1, /* 3015 */
|
||||
XML_SCHEMAP_COS_ST_RESTRICTS_2_3_1_1, /* 3016 */
|
||||
XML_SCHEMAP_COS_ST_RESTRICTS_2_3_1_2, /* 3017 */
|
||||
XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_1, /* 3018 */
|
||||
XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_2, /* 3019 */
|
||||
XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_3, /* 3020 */
|
||||
XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_4, /* 3021 */
|
||||
XML_SCHEMAP_COS_ST_RESTRICTS_2_3_2_5, /* 3022 */
|
||||
XML_SCHEMAP_COS_ST_RESTRICTS_3_1, /* 3023 */
|
||||
XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1, /* 3024 */
|
||||
XML_SCHEMAP_COS_ST_RESTRICTS_3_3_1_2, /* 3025 */
|
||||
XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_2, /* 3026 */
|
||||
XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_1, /* 3027 */
|
||||
XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_3, /* 3028 */
|
||||
XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_4, /* 3029 */
|
||||
XML_SCHEMAP_COS_ST_RESTRICTS_3_3_2_5, /* 3030 */
|
||||
XML_SCHEMAP_COS_ST_DERIVED_OK_2_1, /* 3031 */
|
||||
XML_SCHEMAP_COS_ST_DERIVED_OK_2_2, /* 3032 */
|
||||
XML_SCHEMAP_S4S_ELEM_NOT_ALLOWED, /* 3033 */
|
||||
XML_SCHEMAP_S4S_ELEM_MISSING, /* 3034 */
|
||||
XML_SCHEMAP_S4S_ATTR_NOT_ALLOWED, /* 3035 */
|
||||
XML_SCHEMAP_S4S_ATTR_MISSING, /* 3036 */
|
||||
XML_SCHEMAP_S4S_ATTR_INVALID_VALUE, /* 3037 */
|
||||
XML_SCHEMAP_SRC_ELEMENT_1, /* 3038 */
|
||||
XML_SCHEMAP_SRC_ELEMENT_2_1, /* 3039 */
|
||||
XML_SCHEMAP_SRC_ELEMENT_2_2, /* 3040 */
|
||||
XML_SCHEMAP_SRC_ELEMENT_3, /* 3041 */
|
||||
XML_SCHEMAP_P_PROPS_CORRECT_1, /* 3042 */
|
||||
XML_SCHEMAP_P_PROPS_CORRECT_2_1, /* 3043 */
|
||||
XML_SCHEMAP_P_PROPS_CORRECT_2_2, /* 3044 */
|
||||
XML_SCHEMAP_E_PROPS_CORRECT_2, /* 3045 */
|
||||
XML_SCHEMAP_E_PROPS_CORRECT_3, /* 3046 */
|
||||
XML_SCHEMAP_E_PROPS_CORRECT_4, /* 3047 */
|
||||
XML_SCHEMAP_E_PROPS_CORRECT_5, /* 3048 */
|
||||
XML_SCHEMAP_E_PROPS_CORRECT_6, /* 3049 */
|
||||
XML_SCHEMAP_SRC_INCLUDE, /* 3050 */
|
||||
XML_SCHEMAP_SRC_ATTRIBUTE_1, /* 3051 */
|
||||
XML_SCHEMAP_SRC_ATTRIBUTE_2, /* 3052 */
|
||||
XML_SCHEMAP_SRC_ATTRIBUTE_3_1, /* 3053 */
|
||||
XML_SCHEMAP_SRC_ATTRIBUTE_3_2, /* 3054 */
|
||||
XML_SCHEMAP_SRC_ATTRIBUTE_4, /* 3055 */
|
||||
XML_SCHEMAP_NO_XMLNS, /* 3056 */
|
||||
XML_SCHEMAP_NO_XSI, /* 3057 */
|
||||
XML_SCHEMAP_COS_VALID_DEFAULT_1, /* 3058 */
|
||||
XML_SCHEMAP_COS_VALID_DEFAULT_2_1, /* 3059 */
|
||||
XML_SCHEMAP_COS_VALID_DEFAULT_2_2_1, /* 3060 */
|
||||
XML_SCHEMAP_COS_VALID_DEFAULT_2_2_2, /* 3061 */
|
||||
XML_SCHEMAP_CVC_SIMPLE_TYPE, /* 3062 */
|
||||
XML_SCHEMAP_COS_CT_EXTENDS_1_1, /* 3063 */
|
||||
XML_SCHEMAP_SRC_IMPORT_1_1, /* 3064 */
|
||||
XML_SCHEMAP_SRC_IMPORT_1_2, /* 3065 */
|
||||
XML_SCHEMAP_SRC_IMPORT_2, /* 3066 */
|
||||
XML_SCHEMAP_SRC_IMPORT_2_1, /* 3067 */
|
||||
XML_SCHEMAP_SRC_IMPORT_2_2, /* 3068 */
|
||||
XML_SCHEMAP_INTERNAL, /* 3069 non-W3C */
|
||||
XML_SCHEMAP_NOT_DETERMINISTIC, /* 3070 non-W3C */
|
||||
XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_1, /* 3071 */
|
||||
XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_2, /* 3072 */
|
||||
XML_SCHEMAP_SRC_ATTRIBUTE_GROUP_3, /* 3073 */
|
||||
XML_SCHEMAP_MG_PROPS_CORRECT_1, /* 3074 */
|
||||
XML_SCHEMAP_MG_PROPS_CORRECT_2, /* 3075 */
|
||||
XML_SCHEMAP_SRC_CT_1, /* 3076 */
|
||||
XML_SCHEMAP_DERIVATION_OK_RESTRICTION_2_1_3, /* 3077 */
|
||||
XML_SCHEMAP_AU_PROPS_CORRECT_2, /* 3078 */
|
||||
XML_SCHEMAP_A_PROPS_CORRECT_2, /* 3079 */
|
||||
XML_MODULE_OPEN = 4900, /* 4900 */
|
||||
XML_MODULE_CLOSE, /* 4901 */
|
||||
XML_CHECK_FOUND_ELEMENT = 5000,
|
||||
XML_CHECK_FOUND_ATTRIBUTE, /* 5001 */
|
||||
XML_CHECK_FOUND_TEXT, /* 5002 */
|
||||
XML_CHECK_FOUND_CDATA, /* 5003 */
|
||||
XML_CHECK_FOUND_ENTITYREF, /* 5004 */
|
||||
XML_CHECK_FOUND_ENTITY, /* 5005 */
|
||||
XML_CHECK_FOUND_PI, /* 5006 */
|
||||
XML_CHECK_FOUND_COMMENT, /* 5007 */
|
||||
XML_CHECK_FOUND_DOCTYPE, /* 5008 */
|
||||
XML_CHECK_FOUND_FRAGMENT, /* 5009 */
|
||||
XML_CHECK_FOUND_NOTATION, /* 5010 */
|
||||
XML_CHECK_UNKNOWN_NODE, /* 5011 */
|
||||
XML_CHECK_ENTITY_TYPE, /* 5012 */
|
||||
XML_CHECK_NO_PARENT, /* 5013 */
|
||||
XML_CHECK_NO_DOC, /* 5014 */
|
||||
XML_CHECK_NO_NAME, /* 5015 */
|
||||
XML_CHECK_NO_ELEM, /* 5016 */
|
||||
XML_CHECK_WRONG_DOC, /* 5017 */
|
||||
XML_CHECK_NO_PREV, /* 5018 */
|
||||
XML_CHECK_WRONG_PREV, /* 5019 */
|
||||
XML_CHECK_NO_NEXT, /* 5020 */
|
||||
XML_CHECK_WRONG_NEXT, /* 5021 */
|
||||
XML_CHECK_NOT_DTD, /* 5022 */
|
||||
XML_CHECK_NOT_ATTR, /* 5023 */
|
||||
XML_CHECK_NOT_ATTR_DECL, /* 5024 */
|
||||
XML_CHECK_NOT_ELEM_DECL, /* 5025 */
|
||||
XML_CHECK_NOT_ENTITY_DECL, /* 5026 */
|
||||
XML_CHECK_NOT_NS_DECL, /* 5027 */
|
||||
XML_CHECK_NO_HREF, /* 5028 */
|
||||
XML_CHECK_WRONG_PARENT,/* 5029 */
|
||||
XML_CHECK_NS_SCOPE, /* 5030 */
|
||||
XML_CHECK_NS_ANCESTOR, /* 5031 */
|
||||
XML_CHECK_NOT_UTF8, /* 5032 */
|
||||
XML_CHECK_NO_DICT, /* 5033 */
|
||||
XML_CHECK_NOT_NCNAME, /* 5034 */
|
||||
XML_CHECK_OUTSIDE_DICT, /* 5035 */
|
||||
XML_CHECK_WRONG_NAME, /* 5036 */
|
||||
XML_CHECK_NAME_NOT_NULL /* 5037 */
|
||||
#if 0
|
||||
XML_CHECK_, /* 5033 */
|
||||
XML_CHECK_X /* 503 */
|
||||
#endif
|
||||
} xmlParserErrors;
|
||||
|
||||
/**
|
||||
* xmlGenericErrorFunc:
|
||||
* @ctx: a parsing context
|
||||
* @msg: the message
|
||||
* @...: the extra arguments of the varags to format the message
|
||||
*
|
||||
* Signature of the function to use when there is an error and
|
||||
* no parsing or validity context available .
|
||||
*/
|
||||
typedef void (*xmlGenericErrorFunc) (void *ctx,
|
||||
const char *msg,
|
||||
...);
|
||||
/**
|
||||
* xmlStructuredErrorFunc:
|
||||
* @userData: user provided data for the error callback
|
||||
* @error: the error being raised.
|
||||
*
|
||||
* Signature of the function to use when there is an error and
|
||||
* the module handles the new error reporting mechanism.
|
||||
*/
|
||||
typedef void (*xmlStructuredErrorFunc) (void *userData, xmlErrorPtr error);
|
||||
|
||||
/*
|
||||
* Use the following function to reset the two global variables
|
||||
* xmlGenericError and xmlGenericErrorContext.
|
||||
*/
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSetGenericErrorFunc (void *ctx,
|
||||
xmlGenericErrorFunc handler);
|
||||
XMLPUBFUN void XMLCALL
|
||||
initGenericErrorDefaultFunc (xmlGenericErrorFunc *handler);
|
||||
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSetStructuredErrorFunc (void *ctx,
|
||||
xmlStructuredErrorFunc handler);
|
||||
/*
|
||||
* Default message routines used by SAX and Valid context for error
|
||||
* and warning reporting.
|
||||
*/
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlParserError (void *ctx,
|
||||
const char *msg,
|
||||
...);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlParserWarning (void *ctx,
|
||||
const char *msg,
|
||||
...);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlParserValidityError (void *ctx,
|
||||
const char *msg,
|
||||
...);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlParserValidityWarning (void *ctx,
|
||||
const char *msg,
|
||||
...);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlParserPrintFileInfo (xmlParserInputPtr input);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlParserPrintFileContext (xmlParserInputPtr input);
|
||||
|
||||
/*
|
||||
* Extended error information routines
|
||||
*/
|
||||
XMLPUBFUN xmlErrorPtr XMLCALL
|
||||
xmlGetLastError (void);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlResetLastError (void);
|
||||
XMLPUBFUN xmlErrorPtr XMLCALL
|
||||
xmlCtxtGetLastError (void *ctx);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlCtxtResetLastError (void *ctx);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlResetError (xmlErrorPtr err);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlCopyError (xmlErrorPtr from,
|
||||
xmlErrorPtr to);
|
||||
|
||||
#ifdef IN_LIBXML
|
||||
/*
|
||||
* Internal callback reporting routine
|
||||
*/
|
||||
XMLPUBFUN void XMLCALL
|
||||
__xmlRaiseError (xmlStructuredErrorFunc schannel,
|
||||
xmlGenericErrorFunc channel,
|
||||
void *data,
|
||||
void *ctx,
|
||||
void *node,
|
||||
int domain,
|
||||
int code,
|
||||
xmlErrorLevel level,
|
||||
const char *file,
|
||||
int line,
|
||||
const char *str1,
|
||||
const char *str2,
|
||||
const char *str3,
|
||||
int int1,
|
||||
int col,
|
||||
const char *msg,
|
||||
...);
|
||||
XMLPUBFUN void XMLCALL
|
||||
__xmlSimpleError (int domain,
|
||||
int code,
|
||||
xmlNodePtr node,
|
||||
const char *msg,
|
||||
const char *extra);
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __XML_ERROR_H__ */
|
||||
138
Extras/LibXML/include/libxml/xmlexports.h
Normal file
138
Extras/LibXML/include/libxml/xmlexports.h
Normal file
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* Summary: macros for marking symbols as exportable/importable.
|
||||
* Description: macros for marking symbols as exportable/importable.
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Igor Zlatovic <igor@zlatkovic.com>
|
||||
*/
|
||||
|
||||
#ifndef __XML_EXPORTS_H__
|
||||
#define __XML_EXPORTS_H__
|
||||
|
||||
/**
|
||||
* XMLPUBFUN, XMLPUBVAR, XMLCALL
|
||||
*
|
||||
* Macros which declare an exportable function, an exportable variable and
|
||||
* the calling convention used for functions.
|
||||
*
|
||||
* Please use an extra block for every platform/compiler combination when
|
||||
* modifying this, rather than overlong #ifdef lines. This helps
|
||||
* readability as well as the fact that different compilers on the same
|
||||
* platform might need different definitions.
|
||||
*/
|
||||
|
||||
/**
|
||||
* XMLPUBFUN:
|
||||
*
|
||||
* Macros which declare an exportable function
|
||||
*/
|
||||
#define XMLPUBFUN
|
||||
/**
|
||||
* XMLPUBVAR:
|
||||
*
|
||||
* Macros which declare an exportable variable
|
||||
*/
|
||||
#define XMLPUBVAR extern
|
||||
/**
|
||||
* XMLCALL:
|
||||
*
|
||||
* Macros which declare the called convention for exported functions
|
||||
*/
|
||||
#define XMLCALL
|
||||
|
||||
/** DOC_DISABLE */
|
||||
|
||||
/* Windows platform with MS compiler */
|
||||
#if defined(_WIN32) && defined(_MSC_VER)
|
||||
#undef XMLPUBFUN
|
||||
#undef XMLPUBVAR
|
||||
#undef XMLCALL
|
||||
#if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
|
||||
#define XMLPUBFUN __declspec(dllexport)
|
||||
#define XMLPUBVAR __declspec(dllexport)
|
||||
#else
|
||||
#define XMLPUBFUN
|
||||
#if !defined(LIBXML_STATIC)
|
||||
#define XMLPUBVAR __declspec(dllimport) extern
|
||||
#else
|
||||
#define XMLPUBVAR extern
|
||||
#endif
|
||||
#endif
|
||||
#define XMLCALL __cdecl
|
||||
#if !defined _REENTRANT
|
||||
#define _REENTRANT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Windows platform with Borland compiler */
|
||||
#if defined(_WIN32) && defined(__BORLANDC__)
|
||||
#undef XMLPUBFUN
|
||||
#undef XMLPUBVAR
|
||||
#undef XMLCALL
|
||||
#if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
|
||||
#define XMLPUBFUN __declspec(dllexport)
|
||||
#define XMLPUBVAR __declspec(dllexport) extern
|
||||
#else
|
||||
#define XMLPUBFUN
|
||||
#if !defined(LIBXML_STATIC)
|
||||
#define XMLPUBVAR __declspec(dllimport) extern
|
||||
#else
|
||||
#define XMLPUBVAR extern
|
||||
#endif
|
||||
#endif
|
||||
#define XMLCALL __cdecl
|
||||
#if !defined _REENTRANT
|
||||
#define _REENTRANT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Windows platform with GNU compiler (Mingw) */
|
||||
#if defined(_WIN32) && defined(__MINGW32__)
|
||||
#undef XMLPUBFUN
|
||||
#undef XMLPUBVAR
|
||||
#undef XMLCALL
|
||||
#if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
|
||||
#define XMLPUBFUN __declspec(dllexport)
|
||||
#define XMLPUBVAR __declspec(dllexport)
|
||||
#else
|
||||
#define XMLPUBFUN
|
||||
#if !defined(LIBXML_STATIC)
|
||||
#define XMLPUBVAR __declspec(dllimport) extern
|
||||
#else
|
||||
#define XMLPUBVAR extern
|
||||
#endif
|
||||
#endif
|
||||
#define XMLCALL __cdecl
|
||||
#if !defined _REENTRANT
|
||||
#define _REENTRANT
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Cygwin platform, GNU compiler */
|
||||
#if defined(_WIN32) && defined(__CYGWIN__)
|
||||
#undef XMLPUBFUN
|
||||
#undef XMLPUBVAR
|
||||
#undef XMLCALL
|
||||
#if defined(IN_LIBXML) && !defined(LIBXML_STATIC)
|
||||
#define XMLPUBFUN __declspec(dllexport)
|
||||
#define XMLPUBVAR __declspec(dllexport)
|
||||
#else
|
||||
#define XMLPUBFUN
|
||||
#if !defined(LIBXML_STATIC)
|
||||
#define XMLPUBVAR __declspec(dllimport) extern
|
||||
#else
|
||||
#define XMLPUBVAR
|
||||
#endif
|
||||
#endif
|
||||
#define XMLCALL __cdecl
|
||||
#endif
|
||||
|
||||
/* Compatibility */
|
||||
#if !defined(LIBXML_DLL_IMPORT)
|
||||
#define LIBXML_DLL_IMPORT XMLPUBVAR
|
||||
#endif
|
||||
|
||||
#endif /* __XML_EXPORTS_H__ */
|
||||
|
||||
|
||||
223
Extras/LibXML/include/libxml/xmlmemory.h
Normal file
223
Extras/LibXML/include/libxml/xmlmemory.h
Normal file
@@ -0,0 +1,223 @@
|
||||
/*
|
||||
* Summary: interface for the memory allocator
|
||||
* Description: provides interfaces for the memory allocator,
|
||||
* including debugging capabilities.
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __DEBUG_MEMORY_ALLOC__
|
||||
#define __DEBUG_MEMORY_ALLOC__
|
||||
|
||||
#include <stdio.h>
|
||||
#include <libxml/xmlversion.h>
|
||||
|
||||
/**
|
||||
* DEBUG_MEMORY:
|
||||
*
|
||||
* DEBUG_MEMORY replaces the allocator with a collect and debug
|
||||
* shell to the libc allocator.
|
||||
* DEBUG_MEMORY should only be activated when debugging
|
||||
* libxml i.e. if libxml has been configured with --with-debug-mem too.
|
||||
*/
|
||||
/* #define DEBUG_MEMORY_FREED */
|
||||
/* #define DEBUG_MEMORY_LOCATION */
|
||||
|
||||
#ifdef DEBUG
|
||||
#ifndef DEBUG_MEMORY
|
||||
#define DEBUG_MEMORY
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* DEBUG_MEMORY_LOCATION:
|
||||
*
|
||||
* DEBUG_MEMORY_LOCATION should be activated only when debugging
|
||||
* libxml i.e. if libxml has been configured with --with-debug-mem too.
|
||||
*/
|
||||
#ifdef DEBUG_MEMORY_LOCATION
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The XML memory wrapper support 4 basic overloadable functions.
|
||||
*/
|
||||
/**
|
||||
* xmlFreeFunc:
|
||||
* @mem: an already allocated block of memory
|
||||
*
|
||||
* Signature for a free() implementation.
|
||||
*/
|
||||
typedef void (XMLCALL *xmlFreeFunc)(void *mem);
|
||||
/**
|
||||
* xmlMallocFunc:
|
||||
* @size: the size requested in bytes
|
||||
*
|
||||
* Signature for a malloc() implementation.
|
||||
*
|
||||
* Returns a pointer to the newly allocated block or NULL in case of error.
|
||||
*/
|
||||
typedef void *(XMLCALL *xmlMallocFunc)(size_t size);
|
||||
|
||||
/**
|
||||
* xmlReallocFunc:
|
||||
* @mem: an already allocated block of memory
|
||||
* @size: the new size requested in bytes
|
||||
*
|
||||
* Signature for a realloc() implementation.
|
||||
*
|
||||
* Returns a pointer to the newly reallocated block or NULL in case of error.
|
||||
*/
|
||||
typedef void *(XMLCALL *xmlReallocFunc)(void *mem, size_t size);
|
||||
|
||||
/**
|
||||
* xmlStrdupFunc:
|
||||
* @str: a zero terminated string
|
||||
*
|
||||
* Signature for an strdup() implementation.
|
||||
*
|
||||
* Returns the copy of the string or NULL in case of error.
|
||||
*/
|
||||
typedef char *(XMLCALL *xmlStrdupFunc)(const char *str);
|
||||
|
||||
/*
|
||||
* The 4 interfaces used for all memory handling within libxml.
|
||||
*/
|
||||
|
||||
LIBXML_DLL_IMPORT xmlFreeFunc xmlFree;
|
||||
LIBXML_DLL_IMPORT xmlMallocFunc xmlMalloc;
|
||||
LIBXML_DLL_IMPORT xmlMallocFunc xmlMallocAtomic;
|
||||
LIBXML_DLL_IMPORT xmlReallocFunc xmlRealloc;
|
||||
LIBXML_DLL_IMPORT xmlStrdupFunc xmlMemStrdup;
|
||||
|
||||
/*
|
||||
* The way to overload the existing functions.
|
||||
* The xmlGc function have an extra entry for atomic block
|
||||
* allocations useful for garbage collected memory allocators
|
||||
*/
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlMemSetup (xmlFreeFunc freeFunc,
|
||||
xmlMallocFunc mallocFunc,
|
||||
xmlReallocFunc reallocFunc,
|
||||
xmlStrdupFunc strdupFunc);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlMemGet (xmlFreeFunc *freeFunc,
|
||||
xmlMallocFunc *mallocFunc,
|
||||
xmlReallocFunc *reallocFunc,
|
||||
xmlStrdupFunc *strdupFunc);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlGcMemSetup (xmlFreeFunc freeFunc,
|
||||
xmlMallocFunc mallocFunc,
|
||||
xmlMallocFunc mallocAtomicFunc,
|
||||
xmlReallocFunc reallocFunc,
|
||||
xmlStrdupFunc strdupFunc);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlGcMemGet (xmlFreeFunc *freeFunc,
|
||||
xmlMallocFunc *mallocFunc,
|
||||
xmlMallocFunc *mallocAtomicFunc,
|
||||
xmlReallocFunc *reallocFunc,
|
||||
xmlStrdupFunc *strdupFunc);
|
||||
|
||||
/*
|
||||
* Initialization of the memory layer.
|
||||
*/
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlInitMemory (void);
|
||||
|
||||
/*
|
||||
* Cleanup of the memory layer.
|
||||
*/
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlCleanupMemory (void);
|
||||
/*
|
||||
* These are specific to the XML debug memory wrapper.
|
||||
*/
|
||||
XMLPUBFUN size_t XMLCALL
|
||||
xmlMemUsed (void);
|
||||
XMLPUBFUN size_t XMLCALL
|
||||
xmlMemBlocks (void);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlMemDisplay (FILE *fp);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlMemShow (FILE *fp, int nr);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlMemoryDump (void);
|
||||
XMLPUBFUN void * XMLCALL
|
||||
xmlMemMalloc (size_t size);
|
||||
XMLPUBFUN void * XMLCALL
|
||||
xmlMemRealloc (void *ptr,size_t size);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlMemFree (void *ptr);
|
||||
XMLPUBFUN char * XMLCALL
|
||||
xmlMemoryStrdup (const char *str);
|
||||
XMLPUBFUN void * XMLCALL
|
||||
xmlMallocLoc (size_t size, const char *file, int line);
|
||||
XMLPUBFUN void * XMLCALL
|
||||
xmlReallocLoc (void *ptr, size_t size, const char *file, int line);
|
||||
XMLPUBFUN void * XMLCALL
|
||||
xmlMallocAtomicLoc (size_t size, const char *file, int line);
|
||||
XMLPUBFUN char * XMLCALL
|
||||
xmlMemStrdupLoc (const char *str, const char *file, int line);
|
||||
|
||||
|
||||
#ifdef DEBUG_MEMORY_LOCATION
|
||||
/**
|
||||
* xmlMalloc:
|
||||
* @size: number of bytes to allocate
|
||||
*
|
||||
* Wrapper for the malloc() function used in the XML library.
|
||||
*
|
||||
* Returns the pointer to the allocated area or NULL in case of error.
|
||||
*/
|
||||
#define xmlMalloc(size) xmlMallocLoc((size), __FILE__, __LINE__)
|
||||
/**
|
||||
* xmlMallocAtomic:
|
||||
* @size: number of bytes to allocate
|
||||
*
|
||||
* Wrapper for the malloc() function used in the XML library for allocation
|
||||
* of block not containing pointers to other areas.
|
||||
*
|
||||
* Returns the pointer to the allocated area or NULL in case of error.
|
||||
*/
|
||||
#define xmlMallocAtomic(size) xmlMallocAtomicLoc((size), __FILE__, __LINE__)
|
||||
/**
|
||||
* xmlRealloc:
|
||||
* @ptr: pointer to the existing allocated area
|
||||
* @size: number of bytes to allocate
|
||||
*
|
||||
* Wrapper for the realloc() function used in the XML library.
|
||||
*
|
||||
* Returns the pointer to the allocated area or NULL in case of error.
|
||||
*/
|
||||
#define xmlRealloc(ptr, size) xmlReallocLoc((ptr), (size), __FILE__, __LINE__)
|
||||
/**
|
||||
* xmlMemStrdup:
|
||||
* @str: pointer to the existing string
|
||||
*
|
||||
* Wrapper for the strdup() function, xmlStrdup() is usually preferred.
|
||||
*
|
||||
* Returns the pointer to the allocated area or NULL in case of error.
|
||||
*/
|
||||
#define xmlMemStrdup(str) xmlMemStrdupLoc((str), __FILE__, __LINE__)
|
||||
|
||||
#endif /* DEBUG_MEMORY_LOCATION */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#ifndef __XML_GLOBALS_H
|
||||
#ifndef __XML_THREADS_H__
|
||||
#include <libxml/threads.h>
|
||||
#include <libxml/globals.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* __DEBUG_MEMORY_ALLOC__ */
|
||||
|
||||
57
Extras/LibXML/include/libxml/xmlmodule.h
Normal file
57
Extras/LibXML/include/libxml/xmlmodule.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Summary: dynamic module loading
|
||||
* Description: basic API for dynamic module loading, used by
|
||||
* libexslt added in 2.6.17
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Joel W. Reed
|
||||
*/
|
||||
|
||||
#ifndef __XML_MODULE_H__
|
||||
#define __XML_MODULE_H__
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
|
||||
#ifdef LIBXML_MODULES_ENABLED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* xmlModulePtr:
|
||||
*
|
||||
* A handle to a dynamically loaded module
|
||||
*/
|
||||
typedef struct _xmlModule xmlModule;
|
||||
typedef xmlModule *xmlModulePtr;
|
||||
|
||||
/**
|
||||
* xmlModuleOption:
|
||||
*
|
||||
* enumeration of options that can be passed down to xmlModuleOpen()
|
||||
*/
|
||||
typedef enum {
|
||||
XML_MODULE_LAZY = 1, /* lazy binding */
|
||||
XML_MODULE_LOCAL= 2 /* local binding */
|
||||
} xmlModuleOption;
|
||||
|
||||
XMLPUBFUN xmlModulePtr XMLCALL xmlModuleOpen (const char *filename,
|
||||
int options);
|
||||
|
||||
XMLPUBFUN int XMLCALL xmlModuleSymbol (xmlModulePtr module,
|
||||
const char* name,
|
||||
void **result);
|
||||
|
||||
XMLPUBFUN int XMLCALL xmlModuleClose (xmlModulePtr module);
|
||||
|
||||
XMLPUBFUN int XMLCALL xmlModuleFree (xmlModulePtr module);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LIBXML_MODULES_ENABLED */
|
||||
|
||||
#endif /*__XML_MODULE_H__ */
|
||||
392
Extras/LibXML/include/libxml/xmlreader.h
Normal file
392
Extras/LibXML/include/libxml/xmlreader.h
Normal file
@@ -0,0 +1,392 @@
|
||||
/*
|
||||
* Summary: the XMLReader implementation
|
||||
* Description: API of the XML streaming API based on C# interfaces.
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __XML_XMLREADER_H__
|
||||
#define __XML_XMLREADER_H__
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/xmlIO.h>
|
||||
#ifdef LIBXML_SCHEMAS_ENABLED
|
||||
#include <libxml/relaxng.h>
|
||||
#endif
|
||||
|
||||
#ifdef LIBXML_READER_ENABLED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* xmlTextReaderMode:
|
||||
*
|
||||
* Internal state values for the reader.
|
||||
*/
|
||||
typedef enum {
|
||||
XML_TEXTREADER_MODE_INITIAL = 0,
|
||||
XML_TEXTREADER_MODE_INTERACTIVE = 1,
|
||||
XML_TEXTREADER_MODE_ERROR = 2,
|
||||
XML_TEXTREADER_MODE_EOF =3,
|
||||
XML_TEXTREADER_MODE_CLOSED = 4,
|
||||
XML_TEXTREADER_MODE_READING = 5
|
||||
} xmlTextReaderMode;
|
||||
|
||||
/**
|
||||
* xmlParserProperties:
|
||||
*
|
||||
* Some common options to use with xmlTextReaderSetParserProp, but it
|
||||
* is better to use xmlParserOption and the xmlReaderNewxxx and
|
||||
* xmlReaderForxxx APIs now.
|
||||
*/
|
||||
typedef enum {
|
||||
XML_PARSER_LOADDTD = 1,
|
||||
XML_PARSER_DEFAULTATTRS = 2,
|
||||
XML_PARSER_VALIDATE = 3,
|
||||
XML_PARSER_SUBST_ENTITIES = 4
|
||||
} xmlParserProperties;
|
||||
|
||||
/**
|
||||
* xmlParserSeverities:
|
||||
*
|
||||
* How severe an error callback is when the per-reader error callback API
|
||||
* is used.
|
||||
*/
|
||||
typedef enum {
|
||||
XML_PARSER_SEVERITY_VALIDITY_WARNING = 1,
|
||||
XML_PARSER_SEVERITY_VALIDITY_ERROR = 2,
|
||||
XML_PARSER_SEVERITY_WARNING = 3,
|
||||
XML_PARSER_SEVERITY_ERROR = 4
|
||||
} xmlParserSeverities;
|
||||
|
||||
/**
|
||||
* xmlReaderTypes:
|
||||
*
|
||||
* Predefined constants for the different types of nodes.
|
||||
*/
|
||||
typedef enum {
|
||||
XML_READER_TYPE_NONE = 0,
|
||||
XML_READER_TYPE_ELEMENT = 1,
|
||||
XML_READER_TYPE_ATTRIBUTE = 2,
|
||||
XML_READER_TYPE_TEXT = 3,
|
||||
XML_READER_TYPE_CDATA = 4,
|
||||
XML_READER_TYPE_ENTITY_REFERENCE = 5,
|
||||
XML_READER_TYPE_ENTITY = 6,
|
||||
XML_READER_TYPE_PROCESSING_INSTRUCTION = 7,
|
||||
XML_READER_TYPE_COMMENT = 8,
|
||||
XML_READER_TYPE_DOCUMENT = 9,
|
||||
XML_READER_TYPE_DOCUMENT_TYPE = 10,
|
||||
XML_READER_TYPE_DOCUMENT_FRAGMENT = 11,
|
||||
XML_READER_TYPE_NOTATION = 12,
|
||||
XML_READER_TYPE_WHITESPACE = 13,
|
||||
XML_READER_TYPE_SIGNIFICANT_WHITESPACE = 14,
|
||||
XML_READER_TYPE_END_ELEMENT = 15,
|
||||
XML_READER_TYPE_END_ENTITY = 16,
|
||||
XML_READER_TYPE_XML_DECLARATION = 17
|
||||
} xmlReaderTypes;
|
||||
|
||||
/**
|
||||
* xmlTextReader:
|
||||
*
|
||||
* Structure for an xmlReader context.
|
||||
*/
|
||||
typedef struct _xmlTextReader xmlTextReader;
|
||||
|
||||
/**
|
||||
* xmlTextReaderPtr:
|
||||
*
|
||||
* Pointer to an xmlReader context.
|
||||
*/
|
||||
typedef xmlTextReader *xmlTextReaderPtr;
|
||||
|
||||
/*
|
||||
* Constructors & Destructor
|
||||
*/
|
||||
XMLPUBFUN xmlTextReaderPtr XMLCALL
|
||||
xmlNewTextReader (xmlParserInputBufferPtr input,
|
||||
const char *URI);
|
||||
XMLPUBFUN xmlTextReaderPtr XMLCALL
|
||||
xmlNewTextReaderFilename(const char *URI);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlFreeTextReader (xmlTextReaderPtr reader);
|
||||
|
||||
/*
|
||||
* Iterators
|
||||
*/
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderRead (xmlTextReaderPtr reader);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlTextReaderReadInnerXml (xmlTextReaderPtr reader);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlTextReaderReadOuterXml (xmlTextReaderPtr reader);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlTextReaderReadString (xmlTextReaderPtr reader);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderReadAttributeValue (xmlTextReaderPtr reader);
|
||||
|
||||
/*
|
||||
* Attributes of the node
|
||||
*/
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderAttributeCount(xmlTextReaderPtr reader);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderDepth (xmlTextReaderPtr reader);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderHasAttributes(xmlTextReaderPtr reader);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderHasValue(xmlTextReaderPtr reader);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderIsDefault (xmlTextReaderPtr reader);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderIsEmptyElement(xmlTextReaderPtr reader);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderNodeType (xmlTextReaderPtr reader);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderQuoteChar (xmlTextReaderPtr reader);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderReadState (xmlTextReaderPtr reader);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderIsNamespaceDecl(xmlTextReaderPtr reader);
|
||||
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
xmlTextReaderConstBaseUri (xmlTextReaderPtr reader);
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
xmlTextReaderConstLocalName (xmlTextReaderPtr reader);
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
xmlTextReaderConstName (xmlTextReaderPtr reader);
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
xmlTextReaderConstNamespaceUri(xmlTextReaderPtr reader);
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
xmlTextReaderConstPrefix (xmlTextReaderPtr reader);
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
xmlTextReaderConstXmlLang (xmlTextReaderPtr reader);
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
xmlTextReaderConstString (xmlTextReaderPtr reader,
|
||||
const xmlChar *str);
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
xmlTextReaderConstValue (xmlTextReaderPtr reader);
|
||||
|
||||
/*
|
||||
* use the Const version of the routine for
|
||||
* better performance and simpler code
|
||||
*/
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlTextReaderBaseUri (xmlTextReaderPtr reader);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlTextReaderLocalName (xmlTextReaderPtr reader);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlTextReaderName (xmlTextReaderPtr reader);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlTextReaderNamespaceUri(xmlTextReaderPtr reader);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlTextReaderPrefix (xmlTextReaderPtr reader);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlTextReaderXmlLang (xmlTextReaderPtr reader);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlTextReaderValue (xmlTextReaderPtr reader);
|
||||
|
||||
/*
|
||||
* Methods of the XmlTextReader
|
||||
*/
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderClose (xmlTextReaderPtr reader);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlTextReaderGetAttributeNo (xmlTextReaderPtr reader,
|
||||
int no);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlTextReaderGetAttribute (xmlTextReaderPtr reader,
|
||||
const xmlChar *name);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlTextReaderGetAttributeNs (xmlTextReaderPtr reader,
|
||||
const xmlChar *localName,
|
||||
const xmlChar *namespaceURI);
|
||||
XMLPUBFUN xmlParserInputBufferPtr XMLCALL
|
||||
xmlTextReaderGetRemainder (xmlTextReaderPtr reader);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlTextReaderLookupNamespace(xmlTextReaderPtr reader,
|
||||
const xmlChar *prefix);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderMoveToAttributeNo(xmlTextReaderPtr reader,
|
||||
int no);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderMoveToAttribute(xmlTextReaderPtr reader,
|
||||
const xmlChar *name);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderMoveToAttributeNs(xmlTextReaderPtr reader,
|
||||
const xmlChar *localName,
|
||||
const xmlChar *namespaceURI);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderMoveToFirstAttribute(xmlTextReaderPtr reader);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderMoveToNextAttribute(xmlTextReaderPtr reader);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderMoveToElement (xmlTextReaderPtr reader);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderNormalization (xmlTextReaderPtr reader);
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
xmlTextReaderConstEncoding (xmlTextReaderPtr reader);
|
||||
|
||||
/*
|
||||
* Extensions
|
||||
*/
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderSetParserProp (xmlTextReaderPtr reader,
|
||||
int prop,
|
||||
int value);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderGetParserProp (xmlTextReaderPtr reader,
|
||||
int prop);
|
||||
XMLPUBFUN xmlNodePtr XMLCALL
|
||||
xmlTextReaderCurrentNode (xmlTextReaderPtr reader);
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderGetParserLineNumber(xmlTextReaderPtr reader);
|
||||
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextReaderGetParserColumnNumber(xmlTextReaderPtr reader);
|
||||
|
||||
XMLPUBFUN xmlNodePtr XMLCALL
|
||||
xmlTextReaderPreserve (xmlTextReaderPtr reader);
|
||||
#ifdef LIBXML_PATTERN_ENABLED
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderPreservePattern(xmlTextReaderPtr reader,
|
||||
const xmlChar *pattern,
|
||||
const xmlChar **namespaces);
|
||||
#endif /* LIBXML_PATTERN_ENABLED */
|
||||
XMLPUBFUN xmlDocPtr XMLCALL
|
||||
xmlTextReaderCurrentDoc (xmlTextReaderPtr reader);
|
||||
XMLPUBFUN xmlNodePtr XMLCALL
|
||||
xmlTextReaderExpand (xmlTextReaderPtr reader);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderNext (xmlTextReaderPtr reader);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderNextSibling (xmlTextReaderPtr reader);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderIsValid (xmlTextReaderPtr reader);
|
||||
#ifdef LIBXML_SCHEMAS_ENABLED
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderRelaxNGValidate(xmlTextReaderPtr reader,
|
||||
const char *rng);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderRelaxNGSetSchema(xmlTextReaderPtr reader,
|
||||
xmlRelaxNGPtr schema);
|
||||
#endif
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
xmlTextReaderConstXmlVersion(xmlTextReaderPtr reader);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderStandalone (xmlTextReaderPtr reader);
|
||||
|
||||
|
||||
/*
|
||||
* Index lookup
|
||||
*/
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextReaderByteConsumed (xmlTextReaderPtr reader);
|
||||
|
||||
/*
|
||||
* New more complete APIs for simpler creation and reuse of readers
|
||||
*/
|
||||
XMLPUBFUN xmlTextReaderPtr XMLCALL
|
||||
xmlReaderWalker (xmlDocPtr doc);
|
||||
XMLPUBFUN xmlTextReaderPtr XMLCALL
|
||||
xmlReaderForDoc (const xmlChar * cur,
|
||||
const char *URL,
|
||||
const char *encoding,
|
||||
int options);
|
||||
XMLPUBFUN xmlTextReaderPtr XMLCALL
|
||||
xmlReaderForFile (const char *filename,
|
||||
const char *encoding,
|
||||
int options);
|
||||
XMLPUBFUN xmlTextReaderPtr XMLCALL
|
||||
xmlReaderForMemory (const char *buffer,
|
||||
intptr_t size,
|
||||
const char *URL,
|
||||
const char *encoding,
|
||||
int options);
|
||||
XMLPUBFUN xmlTextReaderPtr XMLCALL
|
||||
xmlReaderForFd (int fd,
|
||||
const char *URL,
|
||||
const char *encoding,
|
||||
int options);
|
||||
XMLPUBFUN xmlTextReaderPtr XMLCALL
|
||||
xmlReaderForIO (xmlInputReadCallback ioread,
|
||||
xmlInputCloseCallback ioclose,
|
||||
void *ioctx,
|
||||
const char *URL,
|
||||
const char *encoding,
|
||||
int options);
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlReaderNewWalker (xmlTextReaderPtr reader,
|
||||
xmlDocPtr doc);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlReaderNewDoc (xmlTextReaderPtr reader,
|
||||
const xmlChar * cur,
|
||||
const char *URL,
|
||||
const char *encoding,
|
||||
int options);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlReaderNewFile (xmlTextReaderPtr reader,
|
||||
const char *filename,
|
||||
const char *encoding,
|
||||
int options);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlReaderNewMemory (xmlTextReaderPtr reader,
|
||||
const char *buffer,
|
||||
intptr_t size,
|
||||
const char *URL,
|
||||
const char *encoding,
|
||||
int options);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlReaderNewFd (xmlTextReaderPtr reader,
|
||||
int fd,
|
||||
const char *URL,
|
||||
const char *encoding,
|
||||
int options);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlReaderNewIO (xmlTextReaderPtr reader,
|
||||
xmlInputReadCallback ioread,
|
||||
xmlInputCloseCallback ioclose,
|
||||
void *ioctx,
|
||||
const char *URL,
|
||||
const char *encoding,
|
||||
int options);
|
||||
/*
|
||||
* Error handling extensions
|
||||
*/
|
||||
typedef void * xmlTextReaderLocatorPtr;
|
||||
typedef void (XMLCALL *xmlTextReaderErrorFunc) (void *arg,
|
||||
const char *msg,
|
||||
xmlParserSeverities severity,
|
||||
xmlTextReaderLocatorPtr locator);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlTextReaderLocatorLineNumber(xmlTextReaderLocatorPtr locator);
|
||||
/*int xmlTextReaderLocatorLinePosition(xmlTextReaderLocatorPtr locator);*/
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlTextReaderLocatorBaseURI (xmlTextReaderLocatorPtr locator);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlTextReaderSetErrorHandler(xmlTextReaderPtr reader,
|
||||
xmlTextReaderErrorFunc f,
|
||||
void *arg);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlTextReaderSetStructuredErrorHandler(xmlTextReaderPtr reader,
|
||||
xmlStructuredErrorFunc f,
|
||||
void *arg);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlTextReaderGetErrorHandler(xmlTextReaderPtr reader,
|
||||
xmlTextReaderErrorFunc *f,
|
||||
void **arg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LIBXML_READER_ENABLED */
|
||||
|
||||
#endif /* __XML_XMLREADER_H__ */
|
||||
|
||||
108
Extras/LibXML/include/libxml/xmlregexp.h
Normal file
108
Extras/LibXML/include/libxml/xmlregexp.h
Normal file
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
* Summary: regular expressions handling
|
||||
* Description: basic API for libxml regular expressions handling used
|
||||
* for XML Schemas and validation.
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __XML_REGEXP_H__
|
||||
#define __XML_REGEXP_H__
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
|
||||
#ifdef LIBXML_REGEXP_ENABLED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* xmlRegexpPtr:
|
||||
*
|
||||
* A libxml regular expression, they can actually be far more complex
|
||||
* thank the POSIX regex expressions.
|
||||
*/
|
||||
typedef struct _xmlRegexp xmlRegexp;
|
||||
typedef xmlRegexp *xmlRegexpPtr;
|
||||
|
||||
/**
|
||||
* xmlRegExecCtxtPtr:
|
||||
*
|
||||
* A libxml progressive regular expression evaluation context
|
||||
*/
|
||||
typedef struct _xmlRegExecCtxt xmlRegExecCtxt;
|
||||
typedef xmlRegExecCtxt *xmlRegExecCtxtPtr;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#include <libxml/tree.h>
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The POSIX like API
|
||||
*/
|
||||
XMLPUBFUN xmlRegexpPtr XMLCALL
|
||||
xmlRegexpCompile (const xmlChar *regexp);
|
||||
XMLPUBFUN void XMLCALL xmlRegFreeRegexp(xmlRegexpPtr regexp);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlRegexpExec (xmlRegexpPtr comp,
|
||||
const xmlChar *value);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlRegexpPrint (FILE *output,
|
||||
xmlRegexpPtr regexp);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlRegexpIsDeterminist(xmlRegexpPtr comp);
|
||||
|
||||
/*
|
||||
* Callback function when doing a transition in the automata
|
||||
*/
|
||||
typedef void (*xmlRegExecCallbacks) (xmlRegExecCtxtPtr exec,
|
||||
const xmlChar *token,
|
||||
void *transdata,
|
||||
void *inputdata);
|
||||
|
||||
/*
|
||||
* The progressive API
|
||||
*/
|
||||
XMLPUBFUN xmlRegExecCtxtPtr XMLCALL
|
||||
xmlRegNewExecCtxt (xmlRegexpPtr comp,
|
||||
xmlRegExecCallbacks callback,
|
||||
void *data);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlRegFreeExecCtxt (xmlRegExecCtxtPtr exec);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlRegExecPushString(xmlRegExecCtxtPtr exec,
|
||||
const xmlChar *value,
|
||||
void *data);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlRegExecPushString2(xmlRegExecCtxtPtr exec,
|
||||
const xmlChar *value,
|
||||
const xmlChar *value2,
|
||||
void *data);
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlRegExecNextValues(xmlRegExecCtxtPtr exec,
|
||||
int *nbval,
|
||||
int *nbneg,
|
||||
xmlChar **values,
|
||||
int *terminal);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlRegExecErrInfo (xmlRegExecCtxtPtr exec,
|
||||
const xmlChar **string,
|
||||
int *nbval,
|
||||
int *nbneg,
|
||||
xmlChar **values,
|
||||
int *terminal);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LIBXML_REGEXP_ENABLED */
|
||||
|
||||
#endif /*__XML_REGEXP_H__ */
|
||||
83
Extras/LibXML/include/libxml/xmlsave.h
Normal file
83
Extras/LibXML/include/libxml/xmlsave.h
Normal file
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Summary: the XML document serializer
|
||||
* Description: API to save document or subtree of document
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __XML_XMLSAVE_H__
|
||||
#define __XML_XMLSAVE_H__
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/encoding.h>
|
||||
#include <libxml/xmlIO.h>
|
||||
|
||||
#ifdef LIBXML_OUTPUT_ENABLED
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* xmlSaveOption:
|
||||
*
|
||||
* This is the set of XML save options that can be passed down
|
||||
* to the xmlSaveToFd() and similar calls.
|
||||
*/
|
||||
typedef enum {
|
||||
XML_SAVE_FORMAT = 1<<0 /* format save output */
|
||||
} xmlSaveOption;
|
||||
|
||||
|
||||
typedef struct _xmlSaveCtxt xmlSaveCtxt;
|
||||
typedef xmlSaveCtxt *xmlSaveCtxtPtr;
|
||||
|
||||
XMLPUBFUN xmlSaveCtxtPtr XMLCALL
|
||||
xmlSaveToFd (int fd,
|
||||
const char *encoding,
|
||||
int options);
|
||||
XMLPUBFUN xmlSaveCtxtPtr XMLCALL
|
||||
xmlSaveToFilename (const char *filename,
|
||||
const char *encoding,
|
||||
int options);
|
||||
/******
|
||||
Not yet implemented.
|
||||
|
||||
XMLPUBFUN xmlSaveCtxtPtr XMLCALL
|
||||
xmlSaveToBuffer (xmlBufferPtr buffer,
|
||||
const char *encoding,
|
||||
int options);
|
||||
******/
|
||||
XMLPUBFUN xmlSaveCtxtPtr XMLCALL
|
||||
xmlSaveToIO (xmlOutputWriteCallback iowrite,
|
||||
xmlOutputCloseCallback ioclose,
|
||||
void *ioctx,
|
||||
const char *encoding,
|
||||
int options);
|
||||
|
||||
XMLPUBFUN long XMLCALL
|
||||
xmlSaveDoc (xmlSaveCtxtPtr ctxt,
|
||||
xmlDocPtr doc);
|
||||
XMLPUBFUN long XMLCALL
|
||||
xmlSaveTree (xmlSaveCtxtPtr ctxt,
|
||||
xmlNodePtr node);
|
||||
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlSaveFlush (xmlSaveCtxtPtr ctxt);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlSaveClose (xmlSaveCtxtPtr ctxt);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSaveSetEscape (xmlSaveCtxtPtr ctxt,
|
||||
xmlCharEncodingOutputFunc escape);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSaveSetAttrEscape (xmlSaveCtxtPtr ctxt,
|
||||
xmlCharEncodingOutputFunc escape);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||
#endif /* __XML_XMLSAVE_H__ */
|
||||
|
||||
|
||||
170
Extras/LibXML/include/libxml/xmlschemas.h
Normal file
170
Extras/LibXML/include/libxml/xmlschemas.h
Normal file
@@ -0,0 +1,170 @@
|
||||
/*
|
||||
* Summary: incomplete XML Schemas structure implementation
|
||||
* Description: interface to the XML Schemas handling and schema validity
|
||||
* checking, it is incomplete right now.
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __XML_SCHEMA_H__
|
||||
#define __XML_SCHEMA_H__
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
|
||||
#ifdef LIBXML_SCHEMAS_ENABLED
|
||||
|
||||
#include <libxml/tree.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* This error codes are obsolete; not used any more.
|
||||
*/
|
||||
typedef enum {
|
||||
XML_SCHEMAS_ERR_OK = 0,
|
||||
XML_SCHEMAS_ERR_NOROOT = 1,
|
||||
XML_SCHEMAS_ERR_UNDECLAREDELEM,
|
||||
XML_SCHEMAS_ERR_NOTTOPLEVEL,
|
||||
XML_SCHEMAS_ERR_MISSING,
|
||||
XML_SCHEMAS_ERR_WRONGELEM,
|
||||
XML_SCHEMAS_ERR_NOTYPE,
|
||||
XML_SCHEMAS_ERR_NOROLLBACK,
|
||||
XML_SCHEMAS_ERR_ISABSTRACT,
|
||||
XML_SCHEMAS_ERR_NOTEMPTY,
|
||||
XML_SCHEMAS_ERR_ELEMCONT,
|
||||
XML_SCHEMAS_ERR_HAVEDEFAULT,
|
||||
XML_SCHEMAS_ERR_NOTNILLABLE,
|
||||
XML_SCHEMAS_ERR_EXTRACONTENT,
|
||||
XML_SCHEMAS_ERR_INVALIDATTR,
|
||||
XML_SCHEMAS_ERR_INVALIDELEM,
|
||||
XML_SCHEMAS_ERR_NOTDETERMINIST,
|
||||
XML_SCHEMAS_ERR_CONSTRUCT,
|
||||
XML_SCHEMAS_ERR_INTERNAL,
|
||||
XML_SCHEMAS_ERR_NOTSIMPLE,
|
||||
XML_SCHEMAS_ERR_ATTRUNKNOWN,
|
||||
XML_SCHEMAS_ERR_ATTRINVALID,
|
||||
XML_SCHEMAS_ERR_VALUE,
|
||||
XML_SCHEMAS_ERR_FACET,
|
||||
XML_SCHEMAS_ERR_,
|
||||
XML_SCHEMAS_ERR_XXX
|
||||
} xmlSchemaValidError;
|
||||
|
||||
/*
|
||||
* ATTENTION: Change xmlSchemaSetValidOptions's check
|
||||
* for invalid values, if adding to the validation
|
||||
* options below.
|
||||
*/
|
||||
/**
|
||||
* xmlSchemaValidOption:
|
||||
*
|
||||
* This is the set of XML Schema validation options.
|
||||
*/
|
||||
typedef enum {
|
||||
XML_SCHEMA_VAL_VC_I_CREATE = 1<<0
|
||||
/* Default/fixed: create an attribute node
|
||||
* or an element's text node on the instance.
|
||||
*/
|
||||
} xmlSchemaValidOption;
|
||||
|
||||
/*
|
||||
XML_SCHEMA_VAL_XSI_ASSEMBLE = 1<<1,
|
||||
* assemble schemata using
|
||||
* xsi:schemaLocation and
|
||||
* xsi:noNamespaceSchemaLocation
|
||||
*/
|
||||
|
||||
/**
|
||||
* The schemas related types are kept internal
|
||||
*/
|
||||
typedef struct _xmlSchema xmlSchema;
|
||||
typedef xmlSchema *xmlSchemaPtr;
|
||||
|
||||
/**
|
||||
* A schemas validation context
|
||||
*/
|
||||
typedef void (*xmlSchemaValidityErrorFunc) (void *ctx, const char *msg, ...);
|
||||
typedef void (*xmlSchemaValidityWarningFunc) (void *ctx, const char *msg, ...);
|
||||
|
||||
typedef struct _xmlSchemaParserCtxt xmlSchemaParserCtxt;
|
||||
typedef xmlSchemaParserCtxt *xmlSchemaParserCtxtPtr;
|
||||
|
||||
typedef struct _xmlSchemaValidCtxt xmlSchemaValidCtxt;
|
||||
typedef xmlSchemaValidCtxt *xmlSchemaValidCtxtPtr;
|
||||
|
||||
/*
|
||||
* Interfaces for parsing.
|
||||
*/
|
||||
XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
|
||||
xmlSchemaNewParserCtxt (const char *URL);
|
||||
XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
|
||||
xmlSchemaNewMemParserCtxt (const char *buffer,
|
||||
int size);
|
||||
XMLPUBFUN xmlSchemaParserCtxtPtr XMLCALL
|
||||
xmlSchemaNewDocParserCtxt (xmlDocPtr doc);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSchemaFreeParserCtxt (xmlSchemaParserCtxtPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSchemaSetParserErrors (xmlSchemaParserCtxtPtr ctxt,
|
||||
xmlSchemaValidityErrorFunc err,
|
||||
xmlSchemaValidityWarningFunc warn,
|
||||
void *ctx);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSchemaGetParserErrors (xmlSchemaParserCtxtPtr ctxt,
|
||||
xmlSchemaValidityErrorFunc * err,
|
||||
xmlSchemaValidityWarningFunc * warn,
|
||||
void **ctx);
|
||||
XMLPUBFUN xmlSchemaPtr XMLCALL
|
||||
xmlSchemaParse (xmlSchemaParserCtxtPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSchemaFree (xmlSchemaPtr schema);
|
||||
#ifdef LIBXML_OUTPUT_ENABLED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSchemaDump (FILE *output,
|
||||
xmlSchemaPtr schema);
|
||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||
/*
|
||||
* Interfaces for validating
|
||||
*/
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSchemaSetValidErrors (xmlSchemaValidCtxtPtr ctxt,
|
||||
xmlSchemaValidityErrorFunc err,
|
||||
xmlSchemaValidityWarningFunc warn,
|
||||
void *ctx);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSchemaGetValidErrors (xmlSchemaValidCtxtPtr ctxt,
|
||||
xmlSchemaValidityErrorFunc *err,
|
||||
xmlSchemaValidityWarningFunc *warn,
|
||||
void **ctx);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSchemaSetValidOptions (xmlSchemaValidCtxtPtr ctxt,
|
||||
int options);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSchemaValidCtxtGetOptions(xmlSchemaValidCtxtPtr ctxt);
|
||||
|
||||
XMLPUBFUN xmlSchemaValidCtxtPtr XMLCALL
|
||||
xmlSchemaNewValidCtxt (xmlSchemaPtr schema);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSchemaFreeValidCtxt (xmlSchemaValidCtxtPtr ctxt);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSchemaValidateDoc (xmlSchemaValidCtxtPtr ctxt,
|
||||
xmlDocPtr instance);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSchemaValidateOneElement (xmlSchemaValidCtxtPtr ctxt,
|
||||
xmlNodePtr elem);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSchemaValidateStream (xmlSchemaValidCtxtPtr ctxt,
|
||||
xmlParserInputBufferPtr input,
|
||||
xmlCharEncoding enc,
|
||||
xmlSAXHandlerPtr sax,
|
||||
void *user_data);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LIBXML_SCHEMAS_ENABLED */
|
||||
#endif /* __XML_SCHEMA_H__ */
|
||||
136
Extras/LibXML/include/libxml/xmlschemastypes.h
Normal file
136
Extras/LibXML/include/libxml/xmlschemastypes.h
Normal file
@@ -0,0 +1,136 @@
|
||||
/*
|
||||
* Summary: implementation of XML Schema Datatypes
|
||||
* Description: module providing the XML Schema Datatypes implementation
|
||||
* both definition and validity checking
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __XML_SCHEMA_TYPES_H__
|
||||
#define __XML_SCHEMA_TYPES_H__
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
|
||||
#ifdef LIBXML_SCHEMAS_ENABLED
|
||||
|
||||
#include <libxml/schemasInternals.h>
|
||||
#include <libxml/xmlschemas.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
XML_SCHEMA_WHITESPACE_UNKNOWN = 0,
|
||||
XML_SCHEMA_WHITESPACE_PRESERVE = 1,
|
||||
XML_SCHEMA_WHITESPACE_REPLACE = 2,
|
||||
XML_SCHEMA_WHITESPACE_COLLAPSE = 3
|
||||
} xmlSchemaWhitespaceValueType;
|
||||
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSchemaInitTypes (void);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSchemaCleanupTypes (void);
|
||||
XMLPUBFUN xmlSchemaTypePtr XMLCALL
|
||||
xmlSchemaGetPredefinedType (const xmlChar *name,
|
||||
const xmlChar *ns);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSchemaValidatePredefinedType (xmlSchemaTypePtr type,
|
||||
const xmlChar *value,
|
||||
xmlSchemaValPtr *val);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSchemaValPredefTypeNode (xmlSchemaTypePtr type,
|
||||
const xmlChar *value,
|
||||
xmlSchemaValPtr *val,
|
||||
xmlNodePtr node);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSchemaValidateFacet (xmlSchemaTypePtr base,
|
||||
xmlSchemaFacetPtr facet,
|
||||
const xmlChar *value,
|
||||
xmlSchemaValPtr val);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSchemaValidateFacetWhtsp (xmlSchemaFacetPtr facet,
|
||||
xmlSchemaWhitespaceValueType fws,
|
||||
xmlSchemaValType valType,
|
||||
const xmlChar *value,
|
||||
xmlSchemaValPtr val,
|
||||
xmlSchemaWhitespaceValueType ws);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSchemaFreeValue (xmlSchemaValPtr val);
|
||||
XMLPUBFUN xmlSchemaFacetPtr XMLCALL
|
||||
xmlSchemaNewFacet (void);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSchemaCheckFacet (xmlSchemaFacetPtr facet,
|
||||
xmlSchemaTypePtr typeDecl,
|
||||
xmlSchemaParserCtxtPtr ctxt,
|
||||
const xmlChar *name);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlSchemaFreeFacet (xmlSchemaFacetPtr facet);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSchemaCompareValues (xmlSchemaValPtr x,
|
||||
xmlSchemaValPtr y);
|
||||
XMLPUBFUN xmlSchemaTypePtr XMLCALL
|
||||
xmlSchemaGetBuiltInListSimpleTypeItemType (xmlSchemaTypePtr type);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSchemaValidateListSimpleTypeFacet (xmlSchemaFacetPtr facet,
|
||||
const xmlChar *value,
|
||||
unsigned long actualLen,
|
||||
unsigned long *expectedLen);
|
||||
XMLPUBFUN xmlSchemaTypePtr XMLCALL
|
||||
xmlSchemaGetBuiltInType (xmlSchemaValType type);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSchemaIsBuiltInTypeFacet (xmlSchemaTypePtr type,
|
||||
int facetType);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlSchemaCollapseString (const xmlChar *value);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlSchemaWhiteSpaceReplace (const xmlChar *value);
|
||||
XMLPUBFUN unsigned long XMLCALL
|
||||
xmlSchemaGetFacetValueAsULong (xmlSchemaFacetPtr facet);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSchemaValidateLengthFacet (xmlSchemaTypePtr type,
|
||||
xmlSchemaFacetPtr facet,
|
||||
const xmlChar *value,
|
||||
xmlSchemaValPtr val,
|
||||
unsigned long *length);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSchemaValidateLengthFacetWhtsp(xmlSchemaFacetPtr facet,
|
||||
xmlSchemaValType valType,
|
||||
const xmlChar *value,
|
||||
xmlSchemaValPtr val,
|
||||
unsigned long *length,
|
||||
xmlSchemaWhitespaceValueType ws);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSchemaValPredefTypeNodeNoNorm(xmlSchemaTypePtr type,
|
||||
const xmlChar *value,
|
||||
xmlSchemaValPtr *val,
|
||||
xmlNodePtr node);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSchemaGetCanonValue (xmlSchemaValPtr val,
|
||||
const xmlChar **retValue);
|
||||
XMLPUBFUN xmlSchemaValPtr XMLCALL
|
||||
xmlSchemaNewStringValue (xmlSchemaValType type,
|
||||
const xmlChar *value);
|
||||
XMLPUBFUN xmlSchemaValPtr XMLCALL
|
||||
xmlSchemaNewNOTATIONValue (const xmlChar *name,
|
||||
const xmlChar *ns);
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlSchemaCompareValuesWhtsp (xmlSchemaValPtr x,
|
||||
xmlSchemaWhitespaceValueType xws,
|
||||
xmlSchemaValPtr y,
|
||||
xmlSchemaWhitespaceValueType yws);
|
||||
XMLPUBFUN xmlSchemaValPtr XMLCALL
|
||||
xmlSchemaCopyValue (xmlSchemaValPtr val);
|
||||
XMLPUBFUN xmlSchemaValType XMLCALL
|
||||
xmlSchemaGetValType (xmlSchemaValPtr val);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LIBXML_SCHEMAS_ENABLED */
|
||||
#endif /* __XML_SCHEMA_TYPES_H__ */
|
||||
141
Extras/LibXML/include/libxml/xmlstring.h
Normal file
141
Extras/LibXML/include/libxml/xmlstring.h
Normal file
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* Summary: set of routines to process strings
|
||||
* Description: type and interfaces needed for the internal string handling
|
||||
* of the library, especially UTF8 processing.
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __XML_STRING_H__
|
||||
#define __XML_STRING_H__
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <libxml/xmlversion.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* xmlChar:
|
||||
*
|
||||
* This is a basic byte in an UTF-8 encoded string.
|
||||
* It's unsigned allowing to pinpoint case where char * are assigned
|
||||
* to xmlChar * (possibly making serialization back impossible).
|
||||
*/
|
||||
|
||||
typedef unsigned char xmlChar;
|
||||
|
||||
/**
|
||||
* BAD_CAST:
|
||||
*
|
||||
* Macro to cast a string to an xmlChar * when one know its safe.
|
||||
*/
|
||||
#define BAD_CAST (xmlChar *)
|
||||
|
||||
/*
|
||||
* xmlChar handling
|
||||
*/
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlStrdup (const xmlChar *cur);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlStrndup (const xmlChar *cur,
|
||||
intptr_t len);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlCharStrndup (const char *cur,
|
||||
intptr_t len);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlCharStrdup (const char *cur);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlStrsub (const xmlChar *str,
|
||||
intptr_t start,
|
||||
intptr_t len);
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
xmlStrchr (const xmlChar *str,
|
||||
xmlChar val);
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
xmlStrstr (const xmlChar *str,
|
||||
const xmlChar *val);
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
xmlStrcasestr (const xmlChar *str,
|
||||
xmlChar *val);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlStrcmp (const xmlChar *str1,
|
||||
const xmlChar *str2);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlStrncmp (const xmlChar *str1,
|
||||
const xmlChar *str2,
|
||||
intptr_t len);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlStrcasecmp (const xmlChar *str1,
|
||||
const xmlChar *str2);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlStrncasecmp (const xmlChar *str1,
|
||||
const xmlChar *str2,
|
||||
intptr_t len);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlStrEqual (const xmlChar *str1,
|
||||
const xmlChar *str2);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlStrQEqual (const xmlChar *pref,
|
||||
const xmlChar *name,
|
||||
const xmlChar *str);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlStrlen (const xmlChar *str);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlStrcat (xmlChar *cur,
|
||||
const xmlChar *add);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlStrncat (xmlChar *cur,
|
||||
const xmlChar *add,
|
||||
intptr_t len);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlStrncatNew (const xmlChar *str1,
|
||||
const xmlChar *str2,
|
||||
intptr_t len);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlStrPrintf (xmlChar *buf,
|
||||
intptr_t len,
|
||||
const xmlChar *msg,
|
||||
...);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlStrVPrintf (xmlChar *buf,
|
||||
intptr_t len,
|
||||
const xmlChar *msg,
|
||||
va_list ap);
|
||||
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlGetUTF8Char (const unsigned char *utf,
|
||||
intptr_t *len);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlCheckUTF8 (const unsigned char *utf);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlUTF8Strsize (const xmlChar *utf,
|
||||
intptr_t len);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlUTF8Strndup (const xmlChar *utf,
|
||||
intptr_t len);
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
xmlUTF8Strpos (const xmlChar *utf,
|
||||
intptr_t pos);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlUTF8Strloc (const xmlChar *utf,
|
||||
const xmlChar *utfchar);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlUTF8Strsub (const xmlChar *utf,
|
||||
intptr_t start,
|
||||
intptr_t len);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlUTF8Strlen (const xmlChar *utf);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlUTF8Size (const xmlChar *utf);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlUTF8Charcmp (const xmlChar *utf1,
|
||||
const xmlChar *utf2);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* __XML_STRING_H__ */
|
||||
202
Extras/LibXML/include/libxml/xmlunicode.h
Normal file
202
Extras/LibXML/include/libxml/xmlunicode.h
Normal file
@@ -0,0 +1,202 @@
|
||||
/*
|
||||
* Summary: Unicode character APIs
|
||||
* Description: API for the Unicode character APIs
|
||||
*
|
||||
* This file is automatically generated from the
|
||||
* UCS description files of the Unicode Character Database
|
||||
* http://www.unicode.org/Public/4.0-Update1/UCD-4.0.1d5b.html
|
||||
* using the genUnicode.py Python script.
|
||||
*
|
||||
* Generation date: Mon Nov 10 22:35:10 2003
|
||||
* Sources: Blocks-4.0.1d1b.txt UnicodeData-4.0.1d1b.txt
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __XML_UNICODE_H__
|
||||
#define __XML_UNICODE_H__
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
|
||||
#ifdef LIBXML_UNICODE_ENABLED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsAegeanNumbers (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsAlphabeticPresentationForms (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsArabic (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsArabicPresentationFormsA (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsArabicPresentationFormsB (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsArmenian (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsArrows (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsBasicLatin (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsBengali (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsBlockElements (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsBopomofo (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsBopomofoExtended (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsBoxDrawing (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsBraillePatterns (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsBuhid (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsByzantineMusicalSymbols (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCJKCompatibility (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCJKCompatibilityForms (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCJKCompatibilityIdeographs (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCJKCompatibilityIdeographsSupplement (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCJKRadicalsSupplement (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCJKSymbolsandPunctuation (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCJKUnifiedIdeographs (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCJKUnifiedIdeographsExtensionA (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCJKUnifiedIdeographsExtensionB (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCherokee (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCombiningDiacriticalMarks (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCombiningDiacriticalMarksforSymbols (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCombiningHalfMarks (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCombiningMarksforSymbols (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsControlPictures (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCurrencySymbols (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCypriotSyllabary (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCyrillic (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCyrillicSupplement (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsDeseret (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsDevanagari (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsDingbats (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsEnclosedAlphanumerics (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsEnclosedCJKLettersandMonths (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsEthiopic (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsGeneralPunctuation (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsGeometricShapes (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsGeorgian (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsGothic (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsGreek (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsGreekExtended (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsGreekandCoptic (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsGujarati (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsGurmukhi (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsHalfwidthandFullwidthForms (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsHangulCompatibilityJamo (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsHangulJamo (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsHangulSyllables (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsHanunoo (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsHebrew (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsHighPrivateUseSurrogates (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsHighSurrogates (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsHiragana (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsIPAExtensions (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsIdeographicDescriptionCharacters (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsKanbun (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsKangxiRadicals (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsKannada (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsKatakana (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsKatakanaPhoneticExtensions (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsKhmer (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsKhmerSymbols (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsLao (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsLatin1Supplement (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsLatinExtendedA (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsLatinExtendedB (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsLatinExtendedAdditional (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsLetterlikeSymbols (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsLimbu (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsLinearBIdeograms (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsLinearBSyllabary (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsLowSurrogates (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsMalayalam (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsMathematicalAlphanumericSymbols (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsMathematicalOperators (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousMathematicalSymbolsA (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousMathematicalSymbolsB (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousSymbols (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousSymbolsandArrows (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsMiscellaneousTechnical (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsMongolian (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsMusicalSymbols (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsMyanmar (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsNumberForms (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsOgham (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsOldItalic (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsOpticalCharacterRecognition (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsOriya (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsOsmanya (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsPhoneticExtensions (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsPrivateUse (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsPrivateUseArea (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsRunic (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsShavian (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsSinhala (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsSmallFormVariants (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsSpacingModifierLetters (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsSpecials (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsSuperscriptsandSubscripts (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsSupplementalArrowsA (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsSupplementalArrowsB (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsSupplementalMathematicalOperators (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsSupplementaryPrivateUseAreaA (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsSupplementaryPrivateUseAreaB (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsSyriac (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsTagalog (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsTagbanwa (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsTags (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsTaiLe (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsTaiXuanJingSymbols (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsTamil (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsTelugu (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsThaana (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsThai (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsTibetan (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsUgaritic (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsUnifiedCanadianAboriginalSyllabics (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsVariationSelectors (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsVariationSelectorsSupplement (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsYiRadicals (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsYiSyllables (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsYijingHexagramSymbols (int code);
|
||||
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsBlock (int code, const char *block);
|
||||
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatC (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatCc (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatCf (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatCo (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatCs (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatL (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatLl (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatLm (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatLo (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatLt (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatLu (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatM (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatMc (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatMe (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatMn (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatN (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatNd (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatNl (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatNo (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatP (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatPc (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatPd (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatPe (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatPf (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatPi (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatPo (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatPs (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatS (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatSc (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatSk (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatSm (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatSo (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatZ (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatZl (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatZp (int code);
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCatZs (int code);
|
||||
|
||||
XMLPUBFUN int XMLCALL xmlUCSIsCat (int code, const char *cat);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LIBXML_UNICODE_ENABLED */
|
||||
|
||||
#endif /* __XML_UNICODE_H__ */
|
||||
373
Extras/LibXML/include/libxml/xmlversion.h
Normal file
373
Extras/LibXML/include/libxml/xmlversion.h
Normal file
@@ -0,0 +1,373 @@
|
||||
/*
|
||||
* Summary: compile-time version informations
|
||||
* Description: compile-time version informations for the XML library
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __XML_VERSION_H__
|
||||
#define __XML_VERSION_H__
|
||||
|
||||
#include <libxml/xmlexports.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* use those to be sure nothing nasty will happen if
|
||||
* your library and includes mismatch
|
||||
*/
|
||||
#ifndef LIBXML2_COMPILING_MSCCDEF
|
||||
XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
|
||||
#endif /* LIBXML2_COMPILING_MSCCDEF */
|
||||
|
||||
/**
|
||||
* LIBXML_DOTTED_VERSION:
|
||||
*
|
||||
* the version string like "1.2.3"
|
||||
*/
|
||||
#define LIBXML_DOTTED_VERSION "2.6.19"
|
||||
|
||||
/**
|
||||
* LIBXML_VERSION:
|
||||
*
|
||||
* the version number: 1.2.3 value is 1002003
|
||||
*/
|
||||
#define LIBXML_VERSION 20619
|
||||
|
||||
/**
|
||||
* LIBXML_VERSION_STRING:
|
||||
*
|
||||
* the version number string, 1.2.3 value is "1002003"
|
||||
*/
|
||||
#define LIBXML_VERSION_STRING "20619"
|
||||
|
||||
/**
|
||||
* LIBXML_VERSION_EXTRA:
|
||||
*
|
||||
* extra version information, used to show a CVS compilation
|
||||
*/
|
||||
#define LIBXML_VERSION_EXTRA ""
|
||||
|
||||
/**
|
||||
* LIBXML_TEST_VERSION:
|
||||
*
|
||||
* Macro to check that the libxml version in use is compatible with
|
||||
* the version the software has been compiled against
|
||||
*/
|
||||
#define LIBXML_TEST_VERSION xmlCheckVersion(20619);
|
||||
|
||||
#ifndef VMS
|
||||
#if 0
|
||||
/**
|
||||
* WITH_TRIO:
|
||||
*
|
||||
* defined if the trio support need to be configured in
|
||||
*/
|
||||
#define WITH_TRIO
|
||||
#else
|
||||
/**
|
||||
* WITHOUT_TRIO:
|
||||
*
|
||||
* defined if the trio support should not be configured in
|
||||
*/
|
||||
#define WITHOUT_TRIO
|
||||
#endif
|
||||
#else /* VMS */
|
||||
/**
|
||||
* WITH_TRIO:
|
||||
*
|
||||
* defined if the trio support need to be configured in
|
||||
*/
|
||||
#define WITH_TRIO 1
|
||||
#endif /* VMS */
|
||||
|
||||
/**
|
||||
* LIBXML_THREAD_ENABLED:
|
||||
*
|
||||
* Whether the thread support is configured in
|
||||
*/
|
||||
#if 0
|
||||
#if defined(_REENTRANT) || defined(__MT__) || (_POSIX_C_SOURCE - 0 >= 199506L)
|
||||
#define LIBXML_THREAD_ENABLED
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_TREE_ENABLED:
|
||||
*
|
||||
* Whether the DOM like tree manipulation API support is configured in
|
||||
*/
|
||||
#if 1
|
||||
#define LIBXML_TREE_ENABLED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_OUTPUT_ENABLED:
|
||||
*
|
||||
* Whether the serialization/saving support is configured in
|
||||
*/
|
||||
#if 1
|
||||
#define LIBXML_OUTPUT_ENABLED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_PUSH_ENABLED:
|
||||
*
|
||||
* Whether the push parsing interfaces are configured in
|
||||
*/
|
||||
#if 1
|
||||
#define LIBXML_PUSH_ENABLED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_READER_ENABLED:
|
||||
*
|
||||
* Whether the xmlReader parsing interface is configured in
|
||||
*/
|
||||
#if 1
|
||||
#define LIBXML_READER_ENABLED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_PATTERN_ENABLED:
|
||||
*
|
||||
* Whether the xmlPattern node selection interface is configured in
|
||||
*/
|
||||
#if 0
|
||||
#define LIBXML_PATTERN_ENABLED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_WRITER_ENABLED:
|
||||
*
|
||||
* Whether the xmlWriter saving interface is configured in
|
||||
*/
|
||||
#if 1
|
||||
#define LIBXML_WRITER_ENABLED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_SAX1_ENABLED:
|
||||
*
|
||||
* Whether the older SAX1 interface is configured in
|
||||
*/
|
||||
#if 1
|
||||
#define LIBXML_SAX1_ENABLED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_FTP_ENABLED:
|
||||
*
|
||||
* Whether the FTP support is configured in
|
||||
*/
|
||||
#if 0
|
||||
#define LIBXML_FTP_ENABLED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_HTTP_ENABLED:
|
||||
*
|
||||
* Whether the HTTP support is configured in
|
||||
*/
|
||||
#if 0
|
||||
#define LIBXML_HTTP_ENABLED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_VALID_ENABLED:
|
||||
*
|
||||
* Whether the DTD validation support is configured in
|
||||
*/
|
||||
#if 0
|
||||
#define LIBXML_VALID_ENABLED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_HTML_ENABLED:
|
||||
*
|
||||
* Whether the HTML support is configured in
|
||||
*/
|
||||
#if 0
|
||||
#define LIBXML_HTML_ENABLED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_LEGACY_ENABLED:
|
||||
*
|
||||
* Whether the deprecated APIs are compiled in for compatibility
|
||||
*/
|
||||
#if 0
|
||||
#define LIBXML_LEGACY_ENABLED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_C14N_ENABLED:
|
||||
*
|
||||
* Whether the Canonicalization support is configured in
|
||||
*/
|
||||
#if 0
|
||||
#define LIBXML_C14N_ENABLED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_CATALOG_ENABLED:
|
||||
*
|
||||
* Whether the Catalog support is configured in
|
||||
*/
|
||||
#if 0
|
||||
#define LIBXML_CATALOG_ENABLED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_DOCB_ENABLED:
|
||||
*
|
||||
* Whether the SGML Docbook support is configured in
|
||||
*/
|
||||
#if 0
|
||||
#define LIBXML_DOCB_ENABLED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_XPATH_ENABLED:
|
||||
*
|
||||
* Whether XPath is configured in
|
||||
*/
|
||||
#if 0
|
||||
#define LIBXML_XPATH_ENABLED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_XPTR_ENABLED:
|
||||
*
|
||||
* Whether XPointer is configured in
|
||||
*/
|
||||
#if 0
|
||||
#define LIBXML_XPTR_ENABLED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_XINCLUDE_ENABLED:
|
||||
*
|
||||
* Whether XInclude is configured in
|
||||
*/
|
||||
#if 0
|
||||
#define LIBXML_XINCLUDE_ENABLED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_ICONV_ENABLED:
|
||||
*
|
||||
* Whether iconv support is available
|
||||
*/
|
||||
#if 0
|
||||
#define LIBXML_ICONV_ENABLED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_ISO8859X_ENABLED:
|
||||
*
|
||||
* Whether ISO-8859-* support is made available in case iconv is not
|
||||
*/
|
||||
#if 0
|
||||
#define LIBXML_ISO8859X_ENABLED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_DEBUG_ENABLED:
|
||||
*
|
||||
* Whether Debugging module is configured in
|
||||
*/
|
||||
#if 0
|
||||
#define LIBXML_DEBUG_ENABLED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* DEBUG_MEMORY_LOCATION:
|
||||
*
|
||||
* Whether the memory debugging is configured in
|
||||
*/
|
||||
#if 0
|
||||
#define DEBUG_MEMORY_LOCATION
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_DEBUG_RUNTIME:
|
||||
*
|
||||
* Whether the runtime debugging is configured in
|
||||
*/
|
||||
#if 0
|
||||
#define LIBXML_DEBUG_RUNTIME
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_UNICODE_ENABLED:
|
||||
*
|
||||
* Whether the Unicode related interfaces are compiled in
|
||||
*/
|
||||
#if 1
|
||||
#define LIBXML_UNICODE_ENABLED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_REGEXP_ENABLED:
|
||||
*
|
||||
* Whether the regular expressions interfaces are compiled in
|
||||
*/
|
||||
#if 0
|
||||
#define LIBXML_REGEXP_ENABLED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_AUTOMATA_ENABLED:
|
||||
*
|
||||
* Whether the automata interfaces are compiled in
|
||||
*/
|
||||
#if 0
|
||||
#define LIBXML_AUTOMATA_ENABLED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_SCHEMAS_ENABLED:
|
||||
*
|
||||
* Whether the Schemas validation interfaces are compiled in
|
||||
*/
|
||||
#if 0
|
||||
#define LIBXML_SCHEMAS_ENABLED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_MODULES_ENABLED:
|
||||
*
|
||||
* Whether the module interfaces are compiled in
|
||||
*/
|
||||
#if 0
|
||||
#define LIBXML_MODULES_ENABLED
|
||||
#define LIBXML_MODULE_EXTENSION ".dll"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* ATTRIBUTE_UNUSED:
|
||||
*
|
||||
* Macro used to signal to GCC unused function parameters
|
||||
*/
|
||||
#ifdef __GNUC__
|
||||
#ifdef HAVE_ANSIDECL_H
|
||||
#include <ansidecl.h>
|
||||
#endif
|
||||
#ifndef ATTRIBUTE_UNUSED
|
||||
#define ATTRIBUTE_UNUSED __attribute__((unused))
|
||||
#endif
|
||||
#else
|
||||
#define ATTRIBUTE_UNUSED
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
#endif
|
||||
|
||||
|
||||
459
Extras/LibXML/include/libxml/xmlwriter.h
Normal file
459
Extras/LibXML/include/libxml/xmlwriter.h
Normal file
@@ -0,0 +1,459 @@
|
||||
|
||||
/*
|
||||
* Summary: text writing API for XML
|
||||
* Description: text writing API for XML
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Alfred Mickautsch <alfred@mickautsch.de>
|
||||
*/
|
||||
|
||||
#ifndef __XML_XMLWRITER_H__
|
||||
#define __XML_XMLWRITER_H__
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
|
||||
#ifdef LIBXML_WRITER_ENABLED
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <libxml/xmlIO.h>
|
||||
#include <libxml/list.h>
|
||||
#include <libxml/xmlstring.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct _xmlTextWriter xmlTextWriter;
|
||||
typedef xmlTextWriter *xmlTextWriterPtr;
|
||||
|
||||
/*
|
||||
* Constructors & Destructor
|
||||
*/
|
||||
XMLPUBFUN xmlTextWriterPtr XMLCALL
|
||||
xmlNewTextWriter(xmlOutputBufferPtr out);
|
||||
XMLPUBFUN xmlTextWriterPtr XMLCALL
|
||||
xmlNewTextWriterFilename(const char *uri, int compression);
|
||||
XMLPUBFUN xmlTextWriterPtr XMLCALL
|
||||
xmlNewTextWriterMemory(xmlBufferPtr buf, int compression);
|
||||
XMLPUBFUN xmlTextWriterPtr XMLCALL
|
||||
xmlNewTextWriterPushParser(xmlParserCtxtPtr ctxt, int compression);
|
||||
XMLPUBFUN xmlTextWriterPtr XMLCALL
|
||||
xmlNewTextWriterDoc(xmlDocPtr * doc, int compression);
|
||||
XMLPUBFUN xmlTextWriterPtr XMLCALL
|
||||
xmlNewTextWriterTree(xmlDocPtr doc, xmlNodePtr node,
|
||||
int compression);
|
||||
XMLPUBFUN void XMLCALL xmlFreeTextWriter(xmlTextWriterPtr writer);
|
||||
|
||||
/*
|
||||
* Functions
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Document
|
||||
*/
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterStartDocument(xmlTextWriterPtr writer,
|
||||
const char *version,
|
||||
const char *encoding,
|
||||
const char *standalone);
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterEndDocument(xmlTextWriterPtr
|
||||
writer);
|
||||
|
||||
/*
|
||||
* Comments
|
||||
*/
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterStartComment(xmlTextWriterPtr
|
||||
writer);
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterEndComment(xmlTextWriterPtr writer);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteFormatComment(xmlTextWriterPtr writer,
|
||||
const char *format, ...);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteVFormatComment(xmlTextWriterPtr writer,
|
||||
const char *format,
|
||||
va_list argptr);
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterWriteComment(xmlTextWriterPtr
|
||||
writer,
|
||||
const xmlChar *
|
||||
content);
|
||||
|
||||
/*
|
||||
* Elements
|
||||
*/
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterStartElement(xmlTextWriterPtr writer,
|
||||
const xmlChar * name);
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterStartElementNS(xmlTextWriterPtr
|
||||
writer,
|
||||
const xmlChar *
|
||||
prefix,
|
||||
const xmlChar * name,
|
||||
const xmlChar *
|
||||
namespaceURI);
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterEndElement(xmlTextWriterPtr writer);
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterFullEndElement(xmlTextWriterPtr
|
||||
writer);
|
||||
|
||||
/*
|
||||
* Elements conveniency functions
|
||||
*/
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteFormatElement(xmlTextWriterPtr writer,
|
||||
const xmlChar * name,
|
||||
const char *format, ...);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteVFormatElement(xmlTextWriterPtr writer,
|
||||
const xmlChar * name,
|
||||
const char *format,
|
||||
va_list argptr);
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterWriteElement(xmlTextWriterPtr
|
||||
writer,
|
||||
const xmlChar * name,
|
||||
const xmlChar *
|
||||
content);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteFormatElementNS(xmlTextWriterPtr writer,
|
||||
const xmlChar * prefix,
|
||||
const xmlChar * name,
|
||||
const xmlChar * namespaceURI,
|
||||
const char *format, ...);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteVFormatElementNS(xmlTextWriterPtr writer,
|
||||
const xmlChar * prefix,
|
||||
const xmlChar * name,
|
||||
const xmlChar * namespaceURI,
|
||||
const char *format,
|
||||
va_list argptr);
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterWriteElementNS(xmlTextWriterPtr
|
||||
writer,
|
||||
const xmlChar *
|
||||
prefix,
|
||||
const xmlChar * name,
|
||||
const xmlChar *
|
||||
namespaceURI,
|
||||
const xmlChar *
|
||||
content);
|
||||
|
||||
/*
|
||||
* Text
|
||||
*/
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteFormatRaw(xmlTextWriterPtr writer,
|
||||
const char *format, ...);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteVFormatRaw(xmlTextWriterPtr writer,
|
||||
const char *format, va_list argptr);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteRawLen(xmlTextWriterPtr writer,
|
||||
const xmlChar * content, intptr_t len);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteRaw(xmlTextWriterPtr writer,
|
||||
const xmlChar * content);
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterWriteFormatString(xmlTextWriterPtr
|
||||
writer,
|
||||
const char
|
||||
*format, ...);
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterWriteVFormatString(xmlTextWriterPtr
|
||||
writer,
|
||||
const char
|
||||
*format,
|
||||
va_list argptr);
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterWriteString(xmlTextWriterPtr writer,
|
||||
const xmlChar *
|
||||
content);
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterWriteBase64(xmlTextWriterPtr writer,
|
||||
const char *data,
|
||||
intptr_t start, intptr_t len);
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterWriteBinHex(xmlTextWriterPtr writer,
|
||||
const char *data,
|
||||
intptr_t start, intptr_t len);
|
||||
|
||||
/*
|
||||
* Attributes
|
||||
*/
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterStartAttribute(xmlTextWriterPtr writer,
|
||||
const xmlChar * name);
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterStartAttributeNS(xmlTextWriterPtr
|
||||
writer,
|
||||
const xmlChar *
|
||||
prefix,
|
||||
const xmlChar *
|
||||
name,
|
||||
const xmlChar *
|
||||
namespaceURI);
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterEndAttribute(xmlTextWriterPtr
|
||||
writer);
|
||||
|
||||
/*
|
||||
* Attributes conveniency functions
|
||||
*/
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteFormatAttribute(xmlTextWriterPtr writer,
|
||||
const xmlChar * name,
|
||||
const char *format, ...);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteVFormatAttribute(xmlTextWriterPtr writer,
|
||||
const xmlChar * name,
|
||||
const char *format,
|
||||
va_list argptr);
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterWriteAttribute(xmlTextWriterPtr
|
||||
writer,
|
||||
const xmlChar * name,
|
||||
const xmlChar *
|
||||
content);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteFormatAttributeNS(xmlTextWriterPtr writer,
|
||||
const xmlChar * prefix,
|
||||
const xmlChar * name,
|
||||
const xmlChar * namespaceURI,
|
||||
const char *format, ...);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteVFormatAttributeNS(xmlTextWriterPtr writer,
|
||||
const xmlChar * prefix,
|
||||
const xmlChar * name,
|
||||
const xmlChar * namespaceURI,
|
||||
const char *format,
|
||||
va_list argptr);
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterWriteAttributeNS(xmlTextWriterPtr
|
||||
writer,
|
||||
const xmlChar *
|
||||
prefix,
|
||||
const xmlChar *
|
||||
name,
|
||||
const xmlChar *
|
||||
namespaceURI,
|
||||
const xmlChar *
|
||||
content);
|
||||
|
||||
/*
|
||||
* PI's
|
||||
*/
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterStartPI(xmlTextWriterPtr writer,
|
||||
const xmlChar * target);
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterEndPI(xmlTextWriterPtr writer);
|
||||
|
||||
/*
|
||||
* PI conveniency functions
|
||||
*/
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteFormatPI(xmlTextWriterPtr writer,
|
||||
const xmlChar * target,
|
||||
const char *format, ...);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteVFormatPI(xmlTextWriterPtr writer,
|
||||
const xmlChar * target,
|
||||
const char *format, va_list argptr);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWritePI(xmlTextWriterPtr writer,
|
||||
const xmlChar * target,
|
||||
const xmlChar * content);
|
||||
|
||||
/**
|
||||
* xmlTextWriterWriteProcessingInstruction:
|
||||
*
|
||||
* This macro maps to xmlTextWriterWritePI
|
||||
*/
|
||||
#define xmlTextWriterWriteProcessingInstruction xmlTextWriterWritePI
|
||||
|
||||
/*
|
||||
* CDATA
|
||||
*/
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterStartCDATA(xmlTextWriterPtr writer);
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterEndCDATA(xmlTextWriterPtr writer);
|
||||
|
||||
/*
|
||||
* CDATA conveniency functions
|
||||
*/
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteFormatCDATA(xmlTextWriterPtr writer,
|
||||
const char *format, ...);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteVFormatCDATA(xmlTextWriterPtr writer,
|
||||
const char *format, va_list argptr);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteCDATA(xmlTextWriterPtr writer,
|
||||
const xmlChar * content);
|
||||
|
||||
/*
|
||||
* DTD
|
||||
*/
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterStartDTD(xmlTextWriterPtr writer,
|
||||
const xmlChar * name,
|
||||
const xmlChar * pubid,
|
||||
const xmlChar * sysid);
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterEndDTD(xmlTextWriterPtr writer);
|
||||
|
||||
/*
|
||||
* DTD conveniency functions
|
||||
*/
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteFormatDTD(xmlTextWriterPtr writer,
|
||||
const xmlChar * name,
|
||||
const xmlChar * pubid,
|
||||
const xmlChar * sysid,
|
||||
const char *format, ...);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteVFormatDTD(xmlTextWriterPtr writer,
|
||||
const xmlChar * name,
|
||||
const xmlChar * pubid,
|
||||
const xmlChar * sysid,
|
||||
const char *format, va_list argptr);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteDTD(xmlTextWriterPtr writer,
|
||||
const xmlChar * name,
|
||||
const xmlChar * pubid,
|
||||
const xmlChar * sysid,
|
||||
const xmlChar * subset);
|
||||
|
||||
/**
|
||||
* xmlTextWriterWriteDocType:
|
||||
*
|
||||
* this macro maps to xmlTextWriterWriteDTD
|
||||
*/
|
||||
#define xmlTextWriterWriteDocType xmlTextWriterWriteDTD
|
||||
|
||||
/*
|
||||
* DTD element definition
|
||||
*/
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterStartDTDElement(xmlTextWriterPtr writer,
|
||||
const xmlChar * name);
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterEndDTDElement(xmlTextWriterPtr
|
||||
writer);
|
||||
|
||||
/*
|
||||
* DTD element definition conveniency functions
|
||||
*/
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteFormatDTDElement(xmlTextWriterPtr writer,
|
||||
const xmlChar * name,
|
||||
const char *format, ...);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteVFormatDTDElement(xmlTextWriterPtr writer,
|
||||
const xmlChar * name,
|
||||
const char *format,
|
||||
va_list argptr);
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterWriteDTDElement(xmlTextWriterPtr
|
||||
writer,
|
||||
const xmlChar *
|
||||
name,
|
||||
const xmlChar *
|
||||
content);
|
||||
|
||||
/*
|
||||
* DTD attribute list definition
|
||||
*/
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterStartDTDAttlist(xmlTextWriterPtr writer,
|
||||
const xmlChar * name);
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterEndDTDAttlist(xmlTextWriterPtr
|
||||
writer);
|
||||
|
||||
/*
|
||||
* DTD attribute list definition conveniency functions
|
||||
*/
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteFormatDTDAttlist(xmlTextWriterPtr writer,
|
||||
const xmlChar * name,
|
||||
const char *format, ...);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteVFormatDTDAttlist(xmlTextWriterPtr writer,
|
||||
const xmlChar * name,
|
||||
const char *format,
|
||||
va_list argptr);
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterWriteDTDAttlist(xmlTextWriterPtr
|
||||
writer,
|
||||
const xmlChar *
|
||||
name,
|
||||
const xmlChar *
|
||||
content);
|
||||
|
||||
/*
|
||||
* DTD entity definition
|
||||
*/
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterStartDTDEntity(xmlTextWriterPtr writer,
|
||||
intptr_t pe, const xmlChar * name);
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterEndDTDEntity(xmlTextWriterPtr
|
||||
writer);
|
||||
|
||||
/*
|
||||
* DTD entity definition conveniency functions
|
||||
*/
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteFormatDTDInternalEntity(xmlTextWriterPtr writer,
|
||||
intptr_t pe,
|
||||
const xmlChar * name,
|
||||
const char *format, ...);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteVFormatDTDInternalEntity(xmlTextWriterPtr writer,
|
||||
intptr_t pe,
|
||||
const xmlChar * name,
|
||||
const char *format,
|
||||
va_list argptr);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteDTDInternalEntity(xmlTextWriterPtr writer,
|
||||
intptr_t pe,
|
||||
const xmlChar * name,
|
||||
const xmlChar * content);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteDTDExternalEntity(xmlTextWriterPtr writer,
|
||||
intptr_t pe,
|
||||
const xmlChar * name,
|
||||
const xmlChar * pubid,
|
||||
const xmlChar * sysid,
|
||||
const xmlChar * ndataid);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteDTDExternalEntityContents(xmlTextWriterPtr
|
||||
writer,
|
||||
const xmlChar * pubid,
|
||||
const xmlChar * sysid,
|
||||
const xmlChar *
|
||||
ndataid);
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterWriteDTDEntity(xmlTextWriterPtr
|
||||
writer, intptr_t pe,
|
||||
const xmlChar * name,
|
||||
const xmlChar *
|
||||
pubid,
|
||||
const xmlChar *
|
||||
sysid,
|
||||
const xmlChar *
|
||||
ndataid,
|
||||
const xmlChar *
|
||||
content);
|
||||
|
||||
/*
|
||||
* DTD notation definition
|
||||
*/
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterWriteDTDNotation(xmlTextWriterPtr writer,
|
||||
const xmlChar * name,
|
||||
const xmlChar * pubid,
|
||||
const xmlChar * sysid);
|
||||
|
||||
/*
|
||||
* Indentation
|
||||
*/
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterSetIndent(xmlTextWriterPtr writer, intptr_t indent);
|
||||
XMLPUBFUN intptr_t XMLCALL
|
||||
xmlTextWriterSetIndentString(xmlTextWriterPtr writer,
|
||||
const xmlChar * str);
|
||||
|
||||
/*
|
||||
* misc
|
||||
*/
|
||||
XMLPUBFUN intptr_t XMLCALL xmlTextWriterFlush(xmlTextWriterPtr writer);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LIBXML_WRITER_ENABLED */
|
||||
|
||||
#endif /* __XML_XMLWRITER_H__ */
|
||||
513
Extras/LibXML/include/libxml/xpath.h
Normal file
513
Extras/LibXML/include/libxml/xpath.h
Normal file
@@ -0,0 +1,513 @@
|
||||
/*
|
||||
* Summary: XML Path Language implementation
|
||||
* Description: API for the XML Path Language implementation
|
||||
*
|
||||
* XML Path Language implementation
|
||||
* XPath is a language for addressing parts of an XML document,
|
||||
* designed to be used by both XSLT and XPointer
|
||||
* http://www.w3.org/TR/xpath
|
||||
*
|
||||
* Implements
|
||||
* W3C Recommendation 16 November 1999
|
||||
* http://www.w3.org/TR/1999/REC-xpath-19991116
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __XML_XPATH_H__
|
||||
#define __XML_XPATH_H__
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
|
||||
#ifdef LIBXML_XPATH_ENABLED
|
||||
|
||||
#include <libxml/xmlerror.h>
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/hash.h>
|
||||
#endif /* LIBXML_XPATH_ENABLED */
|
||||
|
||||
#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#endif /* LIBXML_XPATH_ENABLED or LIBXML_SCHEMAS_ENABLED */
|
||||
|
||||
#ifdef LIBXML_XPATH_ENABLED
|
||||
typedef struct _xmlXPathContext xmlXPathContext;
|
||||
typedef xmlXPathContext *xmlXPathContextPtr;
|
||||
typedef struct _xmlXPathParserContext xmlXPathParserContext;
|
||||
typedef xmlXPathParserContext *xmlXPathParserContextPtr;
|
||||
|
||||
/**
|
||||
* The set of XPath error codes.
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
XPATH_EXPRESSION_OK = 0,
|
||||
XPATH_NUMBER_ERROR,
|
||||
XPATH_UNFINISHED_LITERAL_ERROR,
|
||||
XPATH_START_LITERAL_ERROR,
|
||||
XPATH_VARIABLE_REF_ERROR,
|
||||
XPATH_UNDEF_VARIABLE_ERROR,
|
||||
XPATH_INVALID_PREDICATE_ERROR,
|
||||
XPATH_EXPR_ERROR,
|
||||
XPATH_UNCLOSED_ERROR,
|
||||
XPATH_UNKNOWN_FUNC_ERROR,
|
||||
XPATH_INVALID_OPERAND,
|
||||
XPATH_INVALID_TYPE,
|
||||
XPATH_INVALID_ARITY,
|
||||
XPATH_INVALID_CTXT_SIZE,
|
||||
XPATH_INVALID_CTXT_POSITION,
|
||||
XPATH_MEMORY_ERROR,
|
||||
XPTR_SYNTAX_ERROR,
|
||||
XPTR_RESOURCE_ERROR,
|
||||
XPTR_SUB_RESOURCE_ERROR,
|
||||
XPATH_UNDEF_PREFIX_ERROR,
|
||||
XPATH_ENCODING_ERROR,
|
||||
XPATH_INVALID_CHAR_ERROR,
|
||||
XPATH_INVALID_CTXT
|
||||
} xmlXPathError;
|
||||
|
||||
/*
|
||||
* A node-set (an unordered collection of nodes without duplicates).
|
||||
*/
|
||||
typedef struct _xmlNodeSet xmlNodeSet;
|
||||
typedef xmlNodeSet *xmlNodeSetPtr;
|
||||
struct _xmlNodeSet {
|
||||
int nodeNr; /* number of nodes in the set */
|
||||
int nodeMax; /* size of the array as allocated */
|
||||
xmlNodePtr *nodeTab; /* array of nodes in no particular order */
|
||||
/* @@ with_ns to check wether namespace nodes should be looked at @@ */
|
||||
};
|
||||
|
||||
/*
|
||||
* An expression is evaluated to yield an object, which
|
||||
* has one of the following four basic types:
|
||||
* - node-set
|
||||
* - boolean
|
||||
* - number
|
||||
* - string
|
||||
*
|
||||
* @@ XPointer will add more types !
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
XPATH_UNDEFINED = 0,
|
||||
XPATH_NODESET = 1,
|
||||
XPATH_BOOLEAN = 2,
|
||||
XPATH_NUMBER = 3,
|
||||
XPATH_STRING = 4,
|
||||
XPATH_POINT = 5,
|
||||
XPATH_RANGE = 6,
|
||||
XPATH_LOCATIONSET = 7,
|
||||
XPATH_USERS = 8,
|
||||
XPATH_XSLT_TREE = 9 /* An XSLT value tree, non modifiable */
|
||||
} xmlXPathObjectType;
|
||||
|
||||
typedef struct _xmlXPathObject xmlXPathObject;
|
||||
typedef xmlXPathObject *xmlXPathObjectPtr;
|
||||
struct _xmlXPathObject {
|
||||
xmlXPathObjectType type;
|
||||
xmlNodeSetPtr nodesetval;
|
||||
int boolval;
|
||||
double floatval;
|
||||
xmlChar *stringval;
|
||||
void *user;
|
||||
int index;
|
||||
void *user2;
|
||||
int index2;
|
||||
};
|
||||
|
||||
/**
|
||||
* xmlXPathConvertFunc:
|
||||
* @obj: an XPath object
|
||||
* @type: the number of the target type
|
||||
*
|
||||
* A conversion function is associated to a type and used to cast
|
||||
* the new type to primitive values.
|
||||
*
|
||||
* Returns -1 in case of error, 0 otherwise
|
||||
*/
|
||||
typedef int (*xmlXPathConvertFunc) (xmlXPathObjectPtr obj, int type);
|
||||
|
||||
/*
|
||||
* Extra type: a name and a conversion function.
|
||||
*/
|
||||
|
||||
typedef struct _xmlXPathType xmlXPathType;
|
||||
typedef xmlXPathType *xmlXPathTypePtr;
|
||||
struct _xmlXPathType {
|
||||
const xmlChar *name; /* the type name */
|
||||
xmlXPathConvertFunc func; /* the conversion function */
|
||||
};
|
||||
|
||||
/*
|
||||
* Extra variable: a name and a value.
|
||||
*/
|
||||
|
||||
typedef struct _xmlXPathVariable xmlXPathVariable;
|
||||
typedef xmlXPathVariable *xmlXPathVariablePtr;
|
||||
struct _xmlXPathVariable {
|
||||
const xmlChar *name; /* the variable name */
|
||||
xmlXPathObjectPtr value; /* the value */
|
||||
};
|
||||
|
||||
/**
|
||||
* xmlXPathEvalFunc:
|
||||
* @ctxt: an XPath parser context
|
||||
* @nargs: the number of arguments passed to the function
|
||||
*
|
||||
* An XPath evaluation function, the parameters are on the XPath context stack.
|
||||
*/
|
||||
|
||||
typedef void (*xmlXPathEvalFunc)(xmlXPathParserContextPtr ctxt,
|
||||
int nargs);
|
||||
|
||||
/*
|
||||
* Extra function: a name and a evaluation function.
|
||||
*/
|
||||
|
||||
typedef struct _xmlXPathFunct xmlXPathFunct;
|
||||
typedef xmlXPathFunct *xmlXPathFuncPtr;
|
||||
struct _xmlXPathFunct {
|
||||
const xmlChar *name; /* the function name */
|
||||
xmlXPathEvalFunc func; /* the evaluation function */
|
||||
};
|
||||
|
||||
/**
|
||||
* xmlXPathAxisFunc:
|
||||
* @ctxt: the XPath interpreter context
|
||||
* @cur: the previous node being explored on that axis
|
||||
*
|
||||
* An axis traversal function. To traverse an axis, the engine calls
|
||||
* the first time with cur == NULL and repeat until the function returns
|
||||
* NULL indicating the end of the axis traversal.
|
||||
*
|
||||
* Returns the next node in that axis or NULL if at the end of the axis.
|
||||
*/
|
||||
|
||||
typedef xmlXPathObjectPtr (*xmlXPathAxisFunc) (xmlXPathParserContextPtr ctxt,
|
||||
xmlXPathObjectPtr cur);
|
||||
|
||||
/*
|
||||
* Extra axis: a name and an axis function.
|
||||
*/
|
||||
|
||||
typedef struct _xmlXPathAxis xmlXPathAxis;
|
||||
typedef xmlXPathAxis *xmlXPathAxisPtr;
|
||||
struct _xmlXPathAxis {
|
||||
const xmlChar *name; /* the axis name */
|
||||
xmlXPathAxisFunc func; /* the search function */
|
||||
};
|
||||
|
||||
/**
|
||||
* xmlXPathFunction:
|
||||
* @ctxt: the XPath interprestation context
|
||||
* @nargs: the number of arguments
|
||||
*
|
||||
* An XPath function.
|
||||
* The arguments (if any) are popped out from the context stack
|
||||
* and the result is pushed on the stack.
|
||||
*/
|
||||
|
||||
typedef void (*xmlXPathFunction) (xmlXPathParserContextPtr ctxt, int nargs);
|
||||
|
||||
/*
|
||||
* Function and Variable Lookup.
|
||||
*/
|
||||
|
||||
/**
|
||||
* xmlXPathVariableLookupFunc:
|
||||
* @ctxt: an XPath context
|
||||
* @name: name of the variable
|
||||
* @ns_uri: the namespace name hosting this variable
|
||||
*
|
||||
* Prototype for callbacks used to plug variable lookup in the XPath
|
||||
* engine.
|
||||
*
|
||||
* Returns the XPath object value or NULL if not found.
|
||||
*/
|
||||
typedef xmlXPathObjectPtr (*xmlXPathVariableLookupFunc) (void *ctxt,
|
||||
const xmlChar *name,
|
||||
const xmlChar *ns_uri);
|
||||
|
||||
/**
|
||||
* xmlXPathFuncLookupFunc:
|
||||
* @ctxt: an XPath context
|
||||
* @name: name of the function
|
||||
* @ns_uri: the namespace name hosting this function
|
||||
*
|
||||
* Prototype for callbacks used to plug function lookup in the XPath
|
||||
* engine.
|
||||
*
|
||||
* Returns the XPath function or NULL if not found.
|
||||
*/
|
||||
typedef xmlXPathFunction (*xmlXPathFuncLookupFunc) (void *ctxt,
|
||||
const xmlChar *name,
|
||||
const xmlChar *ns_uri);
|
||||
|
||||
/**
|
||||
* xmlXPathContext:
|
||||
*
|
||||
* Expression evaluation occurs with respect to a context.
|
||||
* he context consists of:
|
||||
* - a node (the context node)
|
||||
* - a node list (the context node list)
|
||||
* - a set of variable bindings
|
||||
* - a function library
|
||||
* - the set of namespace declarations in scope for the expression
|
||||
* Following the switch to hash tables, this need to be trimmed up at
|
||||
* the next binary incompatible release.
|
||||
*/
|
||||
|
||||
struct _xmlXPathContext {
|
||||
xmlDocPtr doc; /* The current document */
|
||||
xmlNodePtr node; /* The current node */
|
||||
|
||||
int nb_variables_unused; /* unused (hash table) */
|
||||
int max_variables_unused; /* unused (hash table) */
|
||||
xmlHashTablePtr varHash; /* Hash table of defined variables */
|
||||
|
||||
int nb_types; /* number of defined types */
|
||||
int max_types; /* max number of types */
|
||||
xmlXPathTypePtr types; /* Array of defined types */
|
||||
|
||||
int nb_funcs_unused; /* unused (hash table) */
|
||||
int max_funcs_unused; /* unused (hash table) */
|
||||
xmlHashTablePtr funcHash; /* Hash table of defined funcs */
|
||||
|
||||
int nb_axis; /* number of defined axis */
|
||||
int max_axis; /* max number of axis */
|
||||
xmlXPathAxisPtr axis; /* Array of defined axis */
|
||||
|
||||
/* the namespace nodes of the context node */
|
||||
xmlNsPtr *namespaces; /* Array of namespaces */
|
||||
int nsNr; /* number of namespace in scope */
|
||||
void *user; /* function to free */
|
||||
|
||||
/* extra variables */
|
||||
int contextSize; /* the context size */
|
||||
int proximityPosition; /* the proximity position */
|
||||
|
||||
/* extra stuff for XPointer */
|
||||
int xptr; /* it this an XPointer context */
|
||||
xmlNodePtr here; /* for here() */
|
||||
xmlNodePtr origin; /* for origin() */
|
||||
|
||||
/* the set of namespace declarations in scope for the expression */
|
||||
xmlHashTablePtr nsHash; /* The namespaces hash table */
|
||||
xmlXPathVariableLookupFunc varLookupFunc;/* variable lookup func */
|
||||
void *varLookupData; /* variable lookup data */
|
||||
|
||||
/* Possibility to link in an extra item */
|
||||
void *extra; /* needed for XSLT */
|
||||
|
||||
/* The function name and URI when calling a function */
|
||||
const xmlChar *function;
|
||||
const xmlChar *functionURI;
|
||||
|
||||
/* function lookup function and data */
|
||||
xmlXPathFuncLookupFunc funcLookupFunc;/* function lookup func */
|
||||
void *funcLookupData; /* function lookup data */
|
||||
|
||||
/* temporary namespace lists kept for walking the namespace axis */
|
||||
xmlNsPtr *tmpNsList; /* Array of namespaces */
|
||||
int tmpNsNr; /* number of namespace in scope */
|
||||
|
||||
/* error reporting mechanism */
|
||||
void *userData; /* user specific data block */
|
||||
xmlStructuredErrorFunc error; /* the callback in case of errors */
|
||||
xmlError lastError; /* the last error */
|
||||
xmlNodePtr debugNode; /* the source node XSLT */
|
||||
|
||||
/* dictionnary */
|
||||
xmlDictPtr dict; /* dictionnary if any */
|
||||
};
|
||||
|
||||
/*
|
||||
* The structure of a compiled expression form is not public.
|
||||
*/
|
||||
|
||||
typedef struct _xmlXPathCompExpr xmlXPathCompExpr;
|
||||
typedef xmlXPathCompExpr *xmlXPathCompExprPtr;
|
||||
|
||||
/**
|
||||
* xmlXPathParserContext:
|
||||
*
|
||||
* An XPath parser context. It contains pure parsing informations,
|
||||
* an xmlXPathContext, and the stack of objects.
|
||||
*/
|
||||
struct _xmlXPathParserContext {
|
||||
const xmlChar *cur; /* the current char being parsed */
|
||||
const xmlChar *base; /* the full expression */
|
||||
|
||||
int error; /* error code */
|
||||
|
||||
xmlXPathContextPtr context; /* the evaluation context */
|
||||
xmlXPathObjectPtr value; /* the current value */
|
||||
int valueNr; /* number of values stacked */
|
||||
int valueMax; /* max number of values stacked */
|
||||
xmlXPathObjectPtr *valueTab; /* stack of values */
|
||||
|
||||
xmlXPathCompExprPtr comp; /* the precompiled expression */
|
||||
int xptr; /* it this an XPointer expression */
|
||||
xmlNodePtr ancestor; /* used for walking preceding axis */
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Public API *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
* Objects and Nodesets handling
|
||||
*/
|
||||
|
||||
XMLPUBVAR double xmlXPathNAN;
|
||||
XMLPUBVAR double xmlXPathPINF;
|
||||
XMLPUBVAR double xmlXPathNINF;
|
||||
|
||||
/* These macros may later turn into functions */
|
||||
/**
|
||||
* xmlXPathNodeSetGetLength:
|
||||
* @ns: a node-set
|
||||
*
|
||||
* Implement a functionality similar to the DOM NodeList.length.
|
||||
*
|
||||
* Returns the number of nodes in the node-set.
|
||||
*/
|
||||
#define xmlXPathNodeSetGetLength(ns) ((ns) ? (ns)->nodeNr : 0)
|
||||
/**
|
||||
* xmlXPathNodeSetItem:
|
||||
* @ns: a node-set
|
||||
* @index: index of a node in the set
|
||||
*
|
||||
* Implements a functionality similar to the DOM NodeList.item().
|
||||
*
|
||||
* Returns the xmlNodePtr at the given @index in @ns or NULL if
|
||||
* @index is out of range (0 to length-1)
|
||||
*/
|
||||
#define xmlXPathNodeSetItem(ns, index) \
|
||||
((((ns) != NULL) && \
|
||||
((index) >= 0) && ((index) < (ns)->nodeNr)) ? \
|
||||
(ns)->nodeTab[(index)] \
|
||||
: NULL)
|
||||
/**
|
||||
* xmlXPathNodeSetIsEmpty:
|
||||
* @ns: a node-set
|
||||
*
|
||||
* Checks whether @ns is empty or not.
|
||||
*
|
||||
* Returns %TRUE if @ns is an empty node-set.
|
||||
*/
|
||||
#define xmlXPathNodeSetIsEmpty(ns) \
|
||||
(((ns) == NULL) || ((ns)->nodeNr == 0) || ((ns)->nodeTab == NULL))
|
||||
|
||||
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPathFreeObject (xmlXPathObjectPtr obj);
|
||||
XMLPUBFUN xmlNodeSetPtr XMLCALL
|
||||
xmlXPathNodeSetCreate (xmlNodePtr val);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPathFreeNodeSetList (xmlXPathObjectPtr obj);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPathFreeNodeSet (xmlNodeSetPtr obj);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPathObjectCopy (xmlXPathObjectPtr val);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlXPathCmpNodes (xmlNodePtr node1,
|
||||
xmlNodePtr node2);
|
||||
/**
|
||||
* Conversion functions to basic types.
|
||||
*/
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlXPathCastNumberToBoolean (double val);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlXPathCastStringToBoolean (const xmlChar * val);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlXPathCastNodeSetToBoolean(xmlNodeSetPtr ns);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlXPathCastToBoolean (xmlXPathObjectPtr val);
|
||||
|
||||
XMLPUBFUN double XMLCALL
|
||||
xmlXPathCastBooleanToNumber (int val);
|
||||
XMLPUBFUN double XMLCALL
|
||||
xmlXPathCastStringToNumber (const xmlChar * val);
|
||||
XMLPUBFUN double XMLCALL
|
||||
xmlXPathCastNodeToNumber (xmlNodePtr node);
|
||||
XMLPUBFUN double XMLCALL
|
||||
xmlXPathCastNodeSetToNumber (xmlNodeSetPtr ns);
|
||||
XMLPUBFUN double XMLCALL
|
||||
xmlXPathCastToNumber (xmlXPathObjectPtr val);
|
||||
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlXPathCastBooleanToString (int val);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlXPathCastNumberToString (double val);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlXPathCastNodeToString (xmlNodePtr node);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlXPathCastNodeSetToString (xmlNodeSetPtr ns);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlXPathCastToString (xmlXPathObjectPtr val);
|
||||
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPathConvertBoolean (xmlXPathObjectPtr val);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPathConvertNumber (xmlXPathObjectPtr val);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPathConvertString (xmlXPathObjectPtr val);
|
||||
|
||||
/**
|
||||
* Context handling.
|
||||
*/
|
||||
XMLPUBFUN xmlXPathContextPtr XMLCALL
|
||||
xmlXPathNewContext (xmlDocPtr doc);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPathFreeContext (xmlXPathContextPtr ctxt);
|
||||
|
||||
/**
|
||||
* Evaluation functions.
|
||||
*/
|
||||
XMLPUBFUN long XMLCALL
|
||||
xmlXPathOrderDocElems (xmlDocPtr doc);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPathEval (const xmlChar *str,
|
||||
xmlXPathContextPtr ctx);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPathEvalExpression (const xmlChar *str,
|
||||
xmlXPathContextPtr ctxt);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlXPathEvalPredicate (xmlXPathContextPtr ctxt,
|
||||
xmlXPathObjectPtr res);
|
||||
/**
|
||||
* Separate compilation/evaluation entry points.
|
||||
*/
|
||||
XMLPUBFUN xmlXPathCompExprPtr XMLCALL
|
||||
xmlXPathCompile (const xmlChar *str);
|
||||
XMLPUBFUN xmlXPathCompExprPtr XMLCALL
|
||||
xmlXPathCtxtCompile (xmlXPathContextPtr ctxt,
|
||||
const xmlChar *str);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPathCompiledEval (xmlXPathCompExprPtr comp,
|
||||
xmlXPathContextPtr ctx);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPathFreeCompExpr (xmlXPathCompExprPtr comp);
|
||||
#endif /* LIBXML_XPATH_ENABLED */
|
||||
#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPathInit (void);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlXPathIsNaN (double val);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlXPathIsInf (double val);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LIBXML_XPATH_ENABLED or LIBXML_SCHEMAS_ENABLED*/
|
||||
#endif /* ! __XML_XPATH_H__ */
|
||||
630
Extras/LibXML/include/libxml/xpathInternals.h
Normal file
630
Extras/LibXML/include/libxml/xpathInternals.h
Normal file
@@ -0,0 +1,630 @@
|
||||
/*
|
||||
* Summary: internal interfaces for XML Path Language implementation
|
||||
* Description: internal interfaces for XML Path Language implementation
|
||||
* used to build new modules on top of XPath like XPointer and
|
||||
* XSLT
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __XML_XPATH_INTERNALS_H__
|
||||
#define __XML_XPATH_INTERNALS_H__
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
#include <libxml/xpath.h>
|
||||
|
||||
#ifdef LIBXML_XPATH_ENABLED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Helpers *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/*
|
||||
* Many of these macros may later turn into functions. They
|
||||
* shouldn't be used in #ifdef's preprocessor instructions.
|
||||
*/
|
||||
/**
|
||||
* xmlXPathSetError:
|
||||
* @ctxt: an XPath parser context
|
||||
* @err: an xmlXPathError code
|
||||
*
|
||||
* Raises an error.
|
||||
*/
|
||||
#define xmlXPathSetError(ctxt, err) \
|
||||
{ xmlXPatherror((ctxt), __FILE__, __LINE__, (err)); \
|
||||
if ((ctxt) != NULL) (ctxt)->error = (err); }
|
||||
|
||||
/**
|
||||
* xmlXPathSetArityError:
|
||||
* @ctxt: an XPath parser context
|
||||
*
|
||||
* Raises an XPATH_INVALID_ARITY error.
|
||||
*/
|
||||
#define xmlXPathSetArityError(ctxt) \
|
||||
xmlXPathSetError((ctxt), XPATH_INVALID_ARITY)
|
||||
|
||||
/**
|
||||
* xmlXPathSetTypeError:
|
||||
* @ctxt: an XPath parser context
|
||||
*
|
||||
* Raises an XPATH_INVALID_TYPE error.
|
||||
*/
|
||||
#define xmlXPathSetTypeError(ctxt) \
|
||||
xmlXPathSetError((ctxt), XPATH_INVALID_TYPE)
|
||||
|
||||
/**
|
||||
* xmlXPathGetError:
|
||||
* @ctxt: an XPath parser context
|
||||
*
|
||||
* Get the error code of an XPath context.
|
||||
*
|
||||
* Returns the context error.
|
||||
*/
|
||||
#define xmlXPathGetError(ctxt) ((ctxt)->error)
|
||||
|
||||
/**
|
||||
* xmlXPathCheckError:
|
||||
* @ctxt: an XPath parser context
|
||||
*
|
||||
* Check if an XPath error was raised.
|
||||
*
|
||||
* Returns true if an error has been raised, false otherwise.
|
||||
*/
|
||||
#define xmlXPathCheckError(ctxt) ((ctxt)->error != XPATH_EXPRESSION_OK)
|
||||
|
||||
/**
|
||||
* xmlXPathGetDocument:
|
||||
* @ctxt: an XPath parser context
|
||||
*
|
||||
* Get the document of an XPath context.
|
||||
*
|
||||
* Returns the context document.
|
||||
*/
|
||||
#define xmlXPathGetDocument(ctxt) ((ctxt)->context->doc)
|
||||
|
||||
/**
|
||||
* xmlXPathGetContextNode:
|
||||
* @ctxt: an XPath parser context
|
||||
*
|
||||
* Get the context node of an XPath context.
|
||||
*
|
||||
* Returns the context node.
|
||||
*/
|
||||
#define xmlXPathGetContextNode(ctxt) ((ctxt)->context->node)
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlXPathPopBoolean (xmlXPathParserContextPtr ctxt);
|
||||
XMLPUBFUN double XMLCALL
|
||||
xmlXPathPopNumber (xmlXPathParserContextPtr ctxt);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlXPathPopString (xmlXPathParserContextPtr ctxt);
|
||||
XMLPUBFUN xmlNodeSetPtr XMLCALL
|
||||
xmlXPathPopNodeSet (xmlXPathParserContextPtr ctxt);
|
||||
XMLPUBFUN void * XMLCALL
|
||||
xmlXPathPopExternal (xmlXPathParserContextPtr ctxt);
|
||||
|
||||
/**
|
||||
* xmlXPathReturnBoolean:
|
||||
* @ctxt: an XPath parser context
|
||||
* @val: a boolean
|
||||
*
|
||||
* Pushes the boolean @val on the context stack.
|
||||
*/
|
||||
#define xmlXPathReturnBoolean(ctxt, val) \
|
||||
valuePush((ctxt), xmlXPathNewBoolean(val))
|
||||
|
||||
/**
|
||||
* xmlXPathReturnTrue:
|
||||
* @ctxt: an XPath parser context
|
||||
*
|
||||
* Pushes true on the context stack.
|
||||
*/
|
||||
#define xmlXPathReturnTrue(ctxt) xmlXPathReturnBoolean((ctxt), 1)
|
||||
|
||||
/**
|
||||
* xmlXPathReturnFalse:
|
||||
* @ctxt: an XPath parser context
|
||||
*
|
||||
* Pushes false on the context stack.
|
||||
*/
|
||||
#define xmlXPathReturnFalse(ctxt) xmlXPathReturnBoolean((ctxt), 0)
|
||||
|
||||
/**
|
||||
* xmlXPathReturnNumber:
|
||||
* @ctxt: an XPath parser context
|
||||
* @val: a double
|
||||
*
|
||||
* Pushes the double @val on the context stack.
|
||||
*/
|
||||
#define xmlXPathReturnNumber(ctxt, val) \
|
||||
valuePush((ctxt), xmlXPathNewFloat(val))
|
||||
|
||||
/**
|
||||
* xmlXPathReturnString:
|
||||
* @ctxt: an XPath parser context
|
||||
* @str: a string
|
||||
*
|
||||
* Pushes the string @str on the context stack.
|
||||
*/
|
||||
#define xmlXPathReturnString(ctxt, str) \
|
||||
valuePush((ctxt), xmlXPathWrapString(str))
|
||||
|
||||
/**
|
||||
* xmlXPathReturnEmptyString:
|
||||
* @ctxt: an XPath parser context
|
||||
*
|
||||
* Pushes an empty string on the stack.
|
||||
*/
|
||||
#define xmlXPathReturnEmptyString(ctxt) \
|
||||
valuePush((ctxt), xmlXPathNewCString(""))
|
||||
|
||||
/**
|
||||
* xmlXPathReturnNodeSet:
|
||||
* @ctxt: an XPath parser context
|
||||
* @ns: a node-set
|
||||
*
|
||||
* Pushes the node-set @ns on the context stack.
|
||||
*/
|
||||
#define xmlXPathReturnNodeSet(ctxt, ns) \
|
||||
valuePush((ctxt), xmlXPathWrapNodeSet(ns))
|
||||
|
||||
/**
|
||||
* xmlXPathReturnEmptyNodeSet:
|
||||
* @ctxt: an XPath parser context
|
||||
*
|
||||
* Pushes an empty node-set on the context stack.
|
||||
*/
|
||||
#define xmlXPathReturnEmptyNodeSet(ctxt) \
|
||||
valuePush((ctxt), xmlXPathNewNodeSet(NULL))
|
||||
|
||||
/**
|
||||
* xmlXPathReturnExternal:
|
||||
* @ctxt: an XPath parser context
|
||||
* @val: user data
|
||||
*
|
||||
* Pushes user data on the context stack.
|
||||
*/
|
||||
#define xmlXPathReturnExternal(ctxt, val) \
|
||||
valuePush((ctxt), xmlXPathWrapExternal(val))
|
||||
|
||||
/**
|
||||
* xmlXPathStackIsNodeSet:
|
||||
* @ctxt: an XPath parser context
|
||||
*
|
||||
* Check if the current value on the XPath stack is a node set or
|
||||
* an XSLT value tree.
|
||||
*
|
||||
* Returns true if the current object on the stack is a node-set.
|
||||
*/
|
||||
#define xmlXPathStackIsNodeSet(ctxt) \
|
||||
(((ctxt)->value != NULL) \
|
||||
&& (((ctxt)->value->type == XPATH_NODESET) \
|
||||
|| ((ctxt)->value->type == XPATH_XSLT_TREE)))
|
||||
|
||||
/**
|
||||
* xmlXPathStackIsExternal:
|
||||
* @ctxt: an XPath parser context
|
||||
*
|
||||
* Checks if the current value on the XPath stack is an external
|
||||
* object.
|
||||
*
|
||||
* Returns true if the current object on the stack is an external
|
||||
* object.
|
||||
*/
|
||||
#define xmlXPathStackIsExternal(ctxt) \
|
||||
((ctxt->value != NULL) && (ctxt->value->type == XPATH_USERS))
|
||||
|
||||
/**
|
||||
* xmlXPathEmptyNodeSet:
|
||||
* @ns: a node-set
|
||||
*
|
||||
* Empties a node-set.
|
||||
*/
|
||||
#define xmlXPathEmptyNodeSet(ns) \
|
||||
{ while ((ns)->nodeNr > 0) (ns)->nodeTab[(ns)->nodeNr--] = NULL; }
|
||||
|
||||
/**
|
||||
* CHECK_ERROR:
|
||||
*
|
||||
* Macro to return from the function if an XPath error was detected.
|
||||
*/
|
||||
#define CHECK_ERROR \
|
||||
if (ctxt->error != XPATH_EXPRESSION_OK) return
|
||||
|
||||
/**
|
||||
* CHECK_ERROR0:
|
||||
*
|
||||
* Macro to return 0 from the function if an XPath error was detected.
|
||||
*/
|
||||
#define CHECK_ERROR0 \
|
||||
if (ctxt->error != XPATH_EXPRESSION_OK) return(0)
|
||||
|
||||
/**
|
||||
* XP_ERROR:
|
||||
* @X: the error code
|
||||
*
|
||||
* Macro to raise an XPath error and return.
|
||||
*/
|
||||
#define XP_ERROR(X) \
|
||||
{ xmlXPathErr(ctxt, X); return; }
|
||||
|
||||
/**
|
||||
* XP_ERROR0:
|
||||
* @X: the error code
|
||||
*
|
||||
* Macro to raise an XPath error and return 0.
|
||||
*/
|
||||
#define XP_ERROR0(X) \
|
||||
{ xmlXPathErr(ctxt, X); return(0); }
|
||||
|
||||
/**
|
||||
* CHECK_TYPE:
|
||||
* @typeval: the XPath type
|
||||
*
|
||||
* Macro to check that the value on top of the XPath stack is of a given
|
||||
* type.
|
||||
*/
|
||||
#define CHECK_TYPE(typeval) \
|
||||
if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \
|
||||
XP_ERROR(XPATH_INVALID_TYPE)
|
||||
|
||||
/**
|
||||
* CHECK_TYPE0:
|
||||
* @typeval: the XPath type
|
||||
*
|
||||
* Macro to check that the value on top of the XPath stack is of a given
|
||||
* type. Return(0) in case of failure
|
||||
*/
|
||||
#define CHECK_TYPE0(typeval) \
|
||||
if ((ctxt->value == NULL) || (ctxt->value->type != typeval)) \
|
||||
XP_ERROR0(XPATH_INVALID_TYPE)
|
||||
|
||||
/**
|
||||
* CHECK_ARITY:
|
||||
* @x: the number of expected args
|
||||
*
|
||||
* Macro to check that the number of args passed to an XPath function matches.
|
||||
*/
|
||||
#define CHECK_ARITY(x) \
|
||||
if (ctxt == NULL) return; \
|
||||
if (nargs != (x)) \
|
||||
XP_ERROR(XPATH_INVALID_ARITY);
|
||||
|
||||
/**
|
||||
* CAST_TO_STRING:
|
||||
*
|
||||
* Macro to try to cast the value on the top of the XPath stack to a string.
|
||||
*/
|
||||
#define CAST_TO_STRING \
|
||||
if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_STRING)) \
|
||||
xmlXPathStringFunction(ctxt, 1);
|
||||
|
||||
/**
|
||||
* CAST_TO_NUMBER:
|
||||
*
|
||||
* Macro to try to cast the value on the top of the XPath stack to a number.
|
||||
*/
|
||||
#define CAST_TO_NUMBER \
|
||||
if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_NUMBER)) \
|
||||
xmlXPathNumberFunction(ctxt, 1);
|
||||
|
||||
/**
|
||||
* CAST_TO_BOOLEAN:
|
||||
*
|
||||
* Macro to try to cast the value on the top of the XPath stack to a boolean.
|
||||
*/
|
||||
#define CAST_TO_BOOLEAN \
|
||||
if ((ctxt->value != NULL) && (ctxt->value->type != XPATH_BOOLEAN)) \
|
||||
xmlXPathBooleanFunction(ctxt, 1);
|
||||
|
||||
/*
|
||||
* Variable Lookup forwarding.
|
||||
*/
|
||||
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPathRegisterVariableLookup (xmlXPathContextPtr ctxt,
|
||||
xmlXPathVariableLookupFunc f,
|
||||
void *data);
|
||||
|
||||
/*
|
||||
* Function Lookup forwarding.
|
||||
*/
|
||||
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPathRegisterFuncLookup (xmlXPathContextPtr ctxt,
|
||||
xmlXPathFuncLookupFunc f,
|
||||
void *funcCtxt);
|
||||
|
||||
/*
|
||||
* Error reporting.
|
||||
*/
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPatherror (xmlXPathParserContextPtr ctxt,
|
||||
const char *file,
|
||||
int line,
|
||||
int no);
|
||||
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPathErr (xmlXPathParserContextPtr ctxt,
|
||||
int error);
|
||||
|
||||
#ifdef LIBXML_DEBUG_ENABLED
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPathDebugDumpObject (FILE *output,
|
||||
xmlXPathObjectPtr cur,
|
||||
int depth);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPathDebugDumpCompExpr(FILE *output,
|
||||
xmlXPathCompExprPtr comp,
|
||||
int depth);
|
||||
#endif
|
||||
/**
|
||||
* NodeSet handling.
|
||||
*/
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlXPathNodeSetContains (xmlNodeSetPtr cur,
|
||||
xmlNodePtr val);
|
||||
XMLPUBFUN xmlNodeSetPtr XMLCALL
|
||||
xmlXPathDifference (xmlNodeSetPtr nodes1,
|
||||
xmlNodeSetPtr nodes2);
|
||||
XMLPUBFUN xmlNodeSetPtr XMLCALL
|
||||
xmlXPathIntersection (xmlNodeSetPtr nodes1,
|
||||
xmlNodeSetPtr nodes2);
|
||||
|
||||
XMLPUBFUN xmlNodeSetPtr XMLCALL
|
||||
xmlXPathDistinctSorted (xmlNodeSetPtr nodes);
|
||||
XMLPUBFUN xmlNodeSetPtr XMLCALL
|
||||
xmlXPathDistinct (xmlNodeSetPtr nodes);
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlXPathHasSameNodes (xmlNodeSetPtr nodes1,
|
||||
xmlNodeSetPtr nodes2);
|
||||
|
||||
XMLPUBFUN xmlNodeSetPtr XMLCALL
|
||||
xmlXPathNodeLeadingSorted (xmlNodeSetPtr nodes,
|
||||
xmlNodePtr node);
|
||||
XMLPUBFUN xmlNodeSetPtr XMLCALL
|
||||
xmlXPathLeadingSorted (xmlNodeSetPtr nodes1,
|
||||
xmlNodeSetPtr nodes2);
|
||||
XMLPUBFUN xmlNodeSetPtr XMLCALL
|
||||
xmlXPathNodeLeading (xmlNodeSetPtr nodes,
|
||||
xmlNodePtr node);
|
||||
XMLPUBFUN xmlNodeSetPtr XMLCALL
|
||||
xmlXPathLeading (xmlNodeSetPtr nodes1,
|
||||
xmlNodeSetPtr nodes2);
|
||||
|
||||
XMLPUBFUN xmlNodeSetPtr XMLCALL
|
||||
xmlXPathNodeTrailingSorted (xmlNodeSetPtr nodes,
|
||||
xmlNodePtr node);
|
||||
XMLPUBFUN xmlNodeSetPtr XMLCALL
|
||||
xmlXPathTrailingSorted (xmlNodeSetPtr nodes1,
|
||||
xmlNodeSetPtr nodes2);
|
||||
XMLPUBFUN xmlNodeSetPtr XMLCALL
|
||||
xmlXPathNodeTrailing (xmlNodeSetPtr nodes,
|
||||
xmlNodePtr node);
|
||||
XMLPUBFUN xmlNodeSetPtr XMLCALL
|
||||
xmlXPathTrailing (xmlNodeSetPtr nodes1,
|
||||
xmlNodeSetPtr nodes2);
|
||||
|
||||
|
||||
/**
|
||||
* Extending a context.
|
||||
*/
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlXPathRegisterNs (xmlXPathContextPtr ctxt,
|
||||
const xmlChar *prefix,
|
||||
const xmlChar *ns_uri);
|
||||
XMLPUBFUN const xmlChar * XMLCALL
|
||||
xmlXPathNsLookup (xmlXPathContextPtr ctxt,
|
||||
const xmlChar *prefix);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPathRegisteredNsCleanup (xmlXPathContextPtr ctxt);
|
||||
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlXPathRegisterFunc (xmlXPathContextPtr ctxt,
|
||||
const xmlChar *name,
|
||||
xmlXPathFunction f);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlXPathRegisterFuncNS (xmlXPathContextPtr ctxt,
|
||||
const xmlChar *name,
|
||||
const xmlChar *ns_uri,
|
||||
xmlXPathFunction f);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlXPathRegisterVariable (xmlXPathContextPtr ctxt,
|
||||
const xmlChar *name,
|
||||
xmlXPathObjectPtr value);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlXPathRegisterVariableNS (xmlXPathContextPtr ctxt,
|
||||
const xmlChar *name,
|
||||
const xmlChar *ns_uri,
|
||||
xmlXPathObjectPtr value);
|
||||
XMLPUBFUN xmlXPathFunction XMLCALL
|
||||
xmlXPathFunctionLookup (xmlXPathContextPtr ctxt,
|
||||
const xmlChar *name);
|
||||
XMLPUBFUN xmlXPathFunction XMLCALL
|
||||
xmlXPathFunctionLookupNS (xmlXPathContextPtr ctxt,
|
||||
const xmlChar *name,
|
||||
const xmlChar *ns_uri);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPathRegisteredFuncsCleanup (xmlXPathContextPtr ctxt);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPathVariableLookup (xmlXPathContextPtr ctxt,
|
||||
const xmlChar *name);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPathVariableLookupNS (xmlXPathContextPtr ctxt,
|
||||
const xmlChar *name,
|
||||
const xmlChar *ns_uri);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPathRegisteredVariablesCleanup(xmlXPathContextPtr ctxt);
|
||||
|
||||
/**
|
||||
* Utilities to extend XPath.
|
||||
*/
|
||||
XMLPUBFUN xmlXPathParserContextPtr XMLCALL
|
||||
xmlXPathNewParserContext (const xmlChar *str,
|
||||
xmlXPathContextPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPathFreeParserContext (xmlXPathParserContextPtr ctxt);
|
||||
|
||||
/* TODO: remap to xmlXPathValuePop and Push. */
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
valuePop (xmlXPathParserContextPtr ctxt);
|
||||
XMLPUBFUN int XMLCALL
|
||||
valuePush (xmlXPathParserContextPtr ctxt,
|
||||
xmlXPathObjectPtr value);
|
||||
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPathNewString (const xmlChar *val);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPathNewCString (const char *val);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPathWrapString (xmlChar *val);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPathWrapCString (char * val);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPathNewFloat (double val);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPathNewBoolean (int val);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPathNewNodeSet (xmlNodePtr val);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPathNewValueTree (xmlNodePtr val);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPathNodeSetAdd (xmlNodeSetPtr cur,
|
||||
xmlNodePtr val);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPathNodeSetAddUnique (xmlNodeSetPtr cur,
|
||||
xmlNodePtr val);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPathNodeSetAddNs (xmlNodeSetPtr cur,
|
||||
xmlNodePtr node,
|
||||
xmlNsPtr ns);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPathNodeSetSort (xmlNodeSetPtr set);
|
||||
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPathRoot (xmlXPathParserContextPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPathEvalExpr (xmlXPathParserContextPtr ctxt);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlXPathParseName (xmlXPathParserContextPtr ctxt);
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlXPathParseNCName (xmlXPathParserContextPtr ctxt);
|
||||
|
||||
/*
|
||||
* Existing functions.
|
||||
*/
|
||||
XMLPUBFUN double XMLCALL
|
||||
xmlXPathStringEvalNumber (const xmlChar *str);
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlXPathEvaluatePredicateResult (xmlXPathParserContextPtr ctxt,
|
||||
xmlXPathObjectPtr res);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPathRegisterAllFunctions (xmlXPathContextPtr ctxt);
|
||||
XMLPUBFUN xmlNodeSetPtr XMLCALL
|
||||
xmlXPathNodeSetMerge (xmlNodeSetPtr val1,
|
||||
xmlNodeSetPtr val2);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPathNodeSetDel (xmlNodeSetPtr cur,
|
||||
xmlNodePtr val);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPathNodeSetRemove (xmlNodeSetPtr cur,
|
||||
int val);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPathNewNodeSetList (xmlNodeSetPtr val);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPathWrapNodeSet (xmlNodeSetPtr val);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPathWrapExternal (void *val);
|
||||
|
||||
XMLPUBFUN int XMLCALL xmlXPathEqualValues(xmlXPathParserContextPtr ctxt);
|
||||
XMLPUBFUN int XMLCALL xmlXPathNotEqualValues(xmlXPathParserContextPtr ctxt);
|
||||
XMLPUBFUN int XMLCALL xmlXPathCompareValues(xmlXPathParserContextPtr ctxt, int inf, int strict);
|
||||
XMLPUBFUN void XMLCALL xmlXPathValueFlipSign(xmlXPathParserContextPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL xmlXPathAddValues(xmlXPathParserContextPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL xmlXPathSubValues(xmlXPathParserContextPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL xmlXPathMultValues(xmlXPathParserContextPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL xmlXPathDivValues(xmlXPathParserContextPtr ctxt);
|
||||
XMLPUBFUN void XMLCALL xmlXPathModValues(xmlXPathParserContextPtr ctxt);
|
||||
|
||||
XMLPUBFUN int XMLCALL xmlXPathIsNodeType(const xmlChar *name);
|
||||
|
||||
/*
|
||||
* Some of the axis navigation routines.
|
||||
*/
|
||||
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextSelf(xmlXPathParserContextPtr ctxt,
|
||||
xmlNodePtr cur);
|
||||
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextChild(xmlXPathParserContextPtr ctxt,
|
||||
xmlNodePtr cur);
|
||||
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextDescendant(xmlXPathParserContextPtr ctxt,
|
||||
xmlNodePtr cur);
|
||||
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextDescendantOrSelf(xmlXPathParserContextPtr ctxt,
|
||||
xmlNodePtr cur);
|
||||
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextParent(xmlXPathParserContextPtr ctxt,
|
||||
xmlNodePtr cur);
|
||||
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAncestorOrSelf(xmlXPathParserContextPtr ctxt,
|
||||
xmlNodePtr cur);
|
||||
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextFollowingSibling(xmlXPathParserContextPtr ctxt,
|
||||
xmlNodePtr cur);
|
||||
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextFollowing(xmlXPathParserContextPtr ctxt,
|
||||
xmlNodePtr cur);
|
||||
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextNamespace(xmlXPathParserContextPtr ctxt,
|
||||
xmlNodePtr cur);
|
||||
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAttribute(xmlXPathParserContextPtr ctxt,
|
||||
xmlNodePtr cur);
|
||||
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextPreceding(xmlXPathParserContextPtr ctxt,
|
||||
xmlNodePtr cur);
|
||||
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextAncestor(xmlXPathParserContextPtr ctxt,
|
||||
xmlNodePtr cur);
|
||||
XMLPUBFUN xmlNodePtr XMLCALL xmlXPathNextPrecedingSibling(xmlXPathParserContextPtr ctxt,
|
||||
xmlNodePtr cur);
|
||||
/*
|
||||
* The official core of XPath functions.
|
||||
*/
|
||||
XMLPUBFUN void XMLCALL xmlXPathLastFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
||||
XMLPUBFUN void XMLCALL xmlXPathPositionFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
||||
XMLPUBFUN void XMLCALL xmlXPathCountFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
||||
XMLPUBFUN void XMLCALL xmlXPathIdFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
||||
XMLPUBFUN void XMLCALL xmlXPathLocalNameFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
||||
XMLPUBFUN void XMLCALL xmlXPathNamespaceURIFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
||||
XMLPUBFUN void XMLCALL xmlXPathStringFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
||||
XMLPUBFUN void XMLCALL xmlXPathStringLengthFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
||||
XMLPUBFUN void XMLCALL xmlXPathConcatFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
||||
XMLPUBFUN void XMLCALL xmlXPathContainsFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
||||
XMLPUBFUN void XMLCALL xmlXPathStartsWithFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
||||
XMLPUBFUN void XMLCALL xmlXPathSubstringFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
||||
XMLPUBFUN void XMLCALL xmlXPathSubstringBeforeFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
||||
XMLPUBFUN void XMLCALL xmlXPathSubstringAfterFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
||||
XMLPUBFUN void XMLCALL xmlXPathNormalizeFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
||||
XMLPUBFUN void XMLCALL xmlXPathTranslateFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
||||
XMLPUBFUN void XMLCALL xmlXPathNotFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
||||
XMLPUBFUN void XMLCALL xmlXPathTrueFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
||||
XMLPUBFUN void XMLCALL xmlXPathFalseFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
||||
XMLPUBFUN void XMLCALL xmlXPathLangFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
||||
XMLPUBFUN void XMLCALL xmlXPathNumberFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
||||
XMLPUBFUN void XMLCALL xmlXPathSumFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
||||
XMLPUBFUN void XMLCALL xmlXPathFloorFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
||||
XMLPUBFUN void XMLCALL xmlXPathCeilingFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
||||
XMLPUBFUN void XMLCALL xmlXPathRoundFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
||||
XMLPUBFUN void XMLCALL xmlXPathBooleanFunction(xmlXPathParserContextPtr ctxt, int nargs);
|
||||
|
||||
/**
|
||||
* Really internal functions
|
||||
*/
|
||||
XMLPUBFUN void XMLCALL xmlXPathNodeSetFreeNs(xmlNsPtr ns);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LIBXML_XPATH_ENABLED */
|
||||
#endif /* ! __XML_XPATH_INTERNALS_H__ */
|
||||
114
Extras/LibXML/include/libxml/xpointer.h
Normal file
114
Extras/LibXML/include/libxml/xpointer.h
Normal file
@@ -0,0 +1,114 @@
|
||||
/*
|
||||
* Summary: API to handle XML Pointers
|
||||
* Description: API to handle XML Pointers
|
||||
* Base implementation was made accordingly to
|
||||
* W3C Candidate Recommendation 7 June 2000
|
||||
* http://www.w3.org/TR/2000/CR-xptr-20000607
|
||||
*
|
||||
* Added support for the element() scheme described in:
|
||||
* W3C Proposed Recommendation 13 November 2002
|
||||
* http://www.w3.org/TR/2002/PR-xptr-element-20021113/
|
||||
*
|
||||
* Copy: See Copyright for the status of this software.
|
||||
*
|
||||
* Author: Daniel Veillard
|
||||
*/
|
||||
|
||||
#ifndef __XML_XPTR_H__
|
||||
#define __XML_XPTR_H__
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
|
||||
#ifdef LIBXML_XPTR_ENABLED
|
||||
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/xpath.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* A Location Set
|
||||
*/
|
||||
typedef struct _xmlLocationSet xmlLocationSet;
|
||||
typedef xmlLocationSet *xmlLocationSetPtr;
|
||||
struct _xmlLocationSet {
|
||||
int locNr; /* number of locations in the set */
|
||||
int locMax; /* size of the array as allocated */
|
||||
xmlXPathObjectPtr *locTab;/* array of locations */
|
||||
};
|
||||
|
||||
/*
|
||||
* Handling of location sets.
|
||||
*/
|
||||
|
||||
XMLPUBFUN xmlLocationSetPtr XMLCALL
|
||||
xmlXPtrLocationSetCreate (xmlXPathObjectPtr val);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPtrFreeLocationSet (xmlLocationSetPtr obj);
|
||||
XMLPUBFUN xmlLocationSetPtr XMLCALL
|
||||
xmlXPtrLocationSetMerge (xmlLocationSetPtr val1,
|
||||
xmlLocationSetPtr val2);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPtrNewRange (xmlNodePtr start,
|
||||
int startindex,
|
||||
xmlNodePtr end,
|
||||
int endindex);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPtrNewRangePoints (xmlXPathObjectPtr start,
|
||||
xmlXPathObjectPtr end);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPtrNewRangeNodePoint (xmlNodePtr start,
|
||||
xmlXPathObjectPtr end);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPtrNewRangePointNode (xmlXPathObjectPtr start,
|
||||
xmlNodePtr end);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPtrNewRangeNodes (xmlNodePtr start,
|
||||
xmlNodePtr end);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPtrNewLocationSetNodes (xmlNodePtr start,
|
||||
xmlNodePtr end);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPtrNewLocationSetNodeSet(xmlNodeSetPtr set);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPtrNewRangeNodeObject (xmlNodePtr start,
|
||||
xmlXPathObjectPtr end);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPtrNewCollapsedRange (xmlNodePtr start);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPtrLocationSetAdd (xmlLocationSetPtr cur,
|
||||
xmlXPathObjectPtr val);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPtrWrapLocationSet (xmlLocationSetPtr val);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPtrLocationSetDel (xmlLocationSetPtr cur,
|
||||
xmlXPathObjectPtr val);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPtrLocationSetRemove (xmlLocationSetPtr cur,
|
||||
int val);
|
||||
|
||||
/*
|
||||
* Functions.
|
||||
*/
|
||||
XMLPUBFUN xmlXPathContextPtr XMLCALL
|
||||
xmlXPtrNewContext (xmlDocPtr doc,
|
||||
xmlNodePtr here,
|
||||
xmlNodePtr origin);
|
||||
XMLPUBFUN xmlXPathObjectPtr XMLCALL
|
||||
xmlXPtrEval (const xmlChar *str,
|
||||
xmlXPathContextPtr ctx);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPtrRangeToFunction (xmlXPathParserContextPtr ctxt,
|
||||
int nargs);
|
||||
XMLPUBFUN xmlNodePtr XMLCALL
|
||||
xmlXPtrBuildNodeList (xmlXPathObjectPtr obj);
|
||||
XMLPUBFUN void XMLCALL
|
||||
xmlXPtrEvalRangePredicate (xmlXPathParserContextPtr ctxt);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LIBXML_XPTR_ENABLED */
|
||||
#endif /* __XML_XPTR_H__ */
|
||||
111
Extras/LibXML/include/win32config.h
Normal file
111
Extras/LibXML/include/win32config.h
Normal file
@@ -0,0 +1,111 @@
|
||||
#ifndef __LIBXML_WIN32_CONFIG__
|
||||
#define __LIBXML_WIN32_CONFIG__
|
||||
|
||||
#define HAVE_CTYPE_H
|
||||
#define HAVE_STDARG_H
|
||||
#define HAVE_MALLOC_H
|
||||
#define HAVE_ERRNO_H
|
||||
|
||||
#ifdef _WIN32_WCE
|
||||
#undef HAVE_ERRNO_H
|
||||
#include <windows.h>
|
||||
#include "wincecompat.h"
|
||||
#else
|
||||
#define HAVE_SYS_STAT_H
|
||||
#define HAVE__STAT
|
||||
#define HAVE_STAT
|
||||
#define HAVE_STDLIB_H
|
||||
#define HAVE_TIME_H
|
||||
#define HAVE_FCNTL_H
|
||||
#include <io.h>
|
||||
#include <direct.h>
|
||||
#endif
|
||||
|
||||
#include <libxml/xmlversion.h>
|
||||
|
||||
#ifdef NEED_SOCKETS
|
||||
#include <wsockcompat.h>
|
||||
#endif
|
||||
|
||||
#define HAVE_ISINF
|
||||
#define HAVE_ISNAN
|
||||
#include <math.h>
|
||||
#if defined(_MSC_VER) || defined(__BORLANDC__)
|
||||
/* MS C-runtime has functions which can be used in order to determine if
|
||||
a given floating-point variable contains NaN, (+-)INF. These are
|
||||
preferred, because floating-point technology is considered propriatary
|
||||
by MS and we can assume that their functions know more about their
|
||||
oddities than we do. */
|
||||
#include <float.h>
|
||||
/* Bjorn Reese figured a quite nice construct for isinf() using the _fpclass
|
||||
function. */
|
||||
#ifndef isinf
|
||||
#define isinf(d) ((_fpclass(d) == _FPCLASS_PINF) ? 1 \
|
||||
: ((_fpclass(d) == _FPCLASS_NINF) ? -1 : 0))
|
||||
#endif
|
||||
/* _isnan(x) returns nonzero if (x == NaN) and zero otherwise. */
|
||||
#ifndef isnan
|
||||
#define isnan(d) (_isnan(d))
|
||||
#endif
|
||||
#else /* _MSC_VER */
|
||||
#ifndef isinf
|
||||
static int isinf (double d) {
|
||||
int expon = 0;
|
||||
double val = frexp (d, &expon);
|
||||
if (expon == 1025) {
|
||||
if (val == 0.5) {
|
||||
return 1;
|
||||
} else if (val == -0.5) {
|
||||
return -1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifndef isnan
|
||||
static int isnan (double d) {
|
||||
int expon = 0;
|
||||
double val = frexp (d, &expon);
|
||||
if (expon == 1025) {
|
||||
if (val == 0.5) {
|
||||
return 0;
|
||||
} else if (val == -0.5) {
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif /* _MSC_VER */
|
||||
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
#define mkdir(p,m) _mkdir(p)
|
||||
#define snprintf _snprintf
|
||||
#define vsnprintf(b,c,f,a) _vsnprintf(b,c,f,a)
|
||||
#endif
|
||||
|
||||
/* Threading API to use should be specified here for compatibility reasons.
|
||||
This is however best specified on the compiler's command-line. */
|
||||
#if defined(LIBXML_THREAD_ENABLED)
|
||||
#if !defined(HAVE_PTHREAD_H) && !defined(HAVE_WIN32_THREADS)
|
||||
#define HAVE_WIN32_THREADS
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Some third-party libraries far from our control assume the following
|
||||
is defined, which it is not if we don't include windows.h. */
|
||||
#if !defined(FALSE)
|
||||
#define FALSE 0
|
||||
#endif
|
||||
#if !defined(TRUE)
|
||||
#define TRUE (!(FALSE))
|
||||
#endif
|
||||
|
||||
#endif /* __LIBXML_WIN32_CONFIG__ */
|
||||
|
||||
63
Extras/LibXML/include/wsockcompat.h
Normal file
63
Extras/LibXML/include/wsockcompat.h
Normal file
@@ -0,0 +1,63 @@
|
||||
/* include/wsockcompat.h
|
||||
* Windows -> Berkeley Sockets compatibility things.
|
||||
*/
|
||||
|
||||
#if !defined __XML_WSOCKCOMPAT_H__
|
||||
#define __XML_WSOCKCOMPAT_H__
|
||||
|
||||
#ifdef _WIN32_WCE
|
||||
#include <winsock.h>
|
||||
#elif defined (WIN32)
|
||||
#undef HAVE_ERRNO_H
|
||||
#include <winsock2.h>
|
||||
#elif defined (LINUX)
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
#if !defined SOCKLEN_T
|
||||
#define SOCKLEN_T int
|
||||
#endif
|
||||
|
||||
#define EWOULDBLOCK WSAEWOULDBLOCK
|
||||
#define EINPROGRESS WSAEINPROGRESS
|
||||
#define EALREADY WSAEALREADY
|
||||
#define ENOTSOCK WSAENOTSOCK
|
||||
#define EDESTADDRREQ WSAEDESTADDRREQ
|
||||
#define EMSGSIZE WSAEMSGSIZE
|
||||
#define EPROTOTYPE WSAEPROTOTYPE
|
||||
#define ENOPROTOOPT WSAENOPROTOOPT
|
||||
#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
|
||||
#define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT
|
||||
#define EOPNOTSUPP WSAEOPNOTSUPP
|
||||
#define EPFNOSUPPORT WSAEPFNOSUPPORT
|
||||
#define EAFNOSUPPORT WSAEAFNOSUPPORT
|
||||
#define EADDRINUSE WSAEADDRINUSE
|
||||
#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
|
||||
#define ENETDOWN WSAENETDOWN
|
||||
#define ENETUNREACH WSAENETUNREACH
|
||||
#define ENETRESET WSAENETRESET
|
||||
#define ECONNABORTED WSAECONNABORTED
|
||||
#define ECONNRESET WSAECONNRESET
|
||||
#define ENOBUFS WSAENOBUFS
|
||||
#define EISCONN WSAEISCONN
|
||||
#define ENOTCONN WSAENOTCONN
|
||||
#define ESHUTDOWN WSAESHUTDOWN
|
||||
#define ETOOMANYREFS WSAETOOMANYREFS
|
||||
#define ETIMEDOUT WSAETIMEDOUT
|
||||
#define ECONNREFUSED WSAECONNREFUSED
|
||||
#define ELOOP WSAELOOP
|
||||
#define EHOSTDOWN WSAEHOSTDOWN
|
||||
#define EHOSTUNREACH WSAEHOSTUNREACH
|
||||
#define EPROCLIM WSAEPROCLIM
|
||||
#define EUSERS WSAEUSERS
|
||||
#define EDQUOT WSAEDQUOT
|
||||
#define ESTALE WSAESTALE
|
||||
#define EREMOTE WSAEREMOTE
|
||||
/* These cause conflicts with the codes from errno.h. Since they are
|
||||
not used in the relevant code (nanoftp, nanohttp), we can leave
|
||||
them disabled.
|
||||
#define ENAMETOOLONG WSAENAMETOOLONG
|
||||
#define ENOTEMPTY WSAENOTEMPTY
|
||||
*/
|
||||
|
||||
#endif /* __XML_WSOCKCOMPAT_H__ */
|
||||
1344
Extras/LibXML/legacy.c
Normal file
1344
Extras/LibXML/legacy.c
Normal file
File diff suppressed because it is too large
Load Diff
64
Extras/LibXML/libxml.h
Normal file
64
Extras/LibXML/libxml.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* libxml.h: internal header only used during the compilation of libxml
|
||||
*
|
||||
* See COPYRIGHT for the status of this software
|
||||
*
|
||||
* Author: breese@users.sourceforge.net
|
||||
*/
|
||||
|
||||
#ifndef __XML_LIBXML_H__
|
||||
#define __XML_LIBXML_H__
|
||||
|
||||
#ifndef NO_LARGEFILE_SOURCE
|
||||
#ifndef _LARGEFILE_SOURCE
|
||||
#define _LARGEFILE_SOURCE
|
||||
#endif
|
||||
#ifndef _FILE_OFFSET_BITS
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(macintosh)
|
||||
#include "config-mac.h"
|
||||
#else
|
||||
#include "config.h"
|
||||
#include <libxml/xmlversion.h>
|
||||
#endif
|
||||
|
||||
#ifndef WITH_TRIO
|
||||
#include <stdio.h>
|
||||
#else
|
||||
/**
|
||||
* TRIO_REPLACE_STDIO:
|
||||
*
|
||||
* This macro is defined if teh trio string formatting functions are to
|
||||
* be used instead of the default stdio ones.
|
||||
*/
|
||||
#define TRIO_REPLACE_STDIO
|
||||
#include "trio.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Internal variable indicating if a callback has been registered for
|
||||
* node creation/destruction. It avoids spending a lot of time in locking
|
||||
* function while checking if the callback exists.
|
||||
*/
|
||||
extern int __xmlRegisterCallbacks;
|
||||
/*
|
||||
* internal error reporting routines, shared but not partof the API.
|
||||
*/
|
||||
void __xmlIOErr(int domain, int code, const char *extra);
|
||||
void __xmlLoaderErr(void *ctx, const char *msg, const char *filename);
|
||||
|
||||
#ifdef IN_LIBXML
|
||||
#ifdef __GNUC__
|
||||
#ifdef PIC
|
||||
#ifdef linux
|
||||
#if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || (__GNUC__ > 3)
|
||||
#include "elfgcchack.h"
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif /* ! __XML_LIBXML_H__ */
|
||||
779
Extras/LibXML/list.c
Normal file
779
Extras/LibXML/list.c
Normal file
@@ -0,0 +1,779 @@
|
||||
/*
|
||||
* list.c: lists handling implementation
|
||||
*
|
||||
* Copyright (C) 2000 Gary Pennington and Daniel Veillard.
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
|
||||
* MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND
|
||||
* CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER.
|
||||
*
|
||||
* Author: Gary.Pennington@uk.sun.com
|
||||
*/
|
||||
|
||||
#define IN_LIBXML
|
||||
#include "libxml.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <libxml/xmlmemory.h>
|
||||
#include <libxml/list.h>
|
||||
#include <libxml/globals.h>
|
||||
|
||||
/*
|
||||
* Type definition are kept internal
|
||||
*/
|
||||
|
||||
struct _xmlLink
|
||||
{
|
||||
struct _xmlLink *next;
|
||||
struct _xmlLink *prev;
|
||||
void *data;
|
||||
};
|
||||
|
||||
struct _xmlList
|
||||
{
|
||||
xmlLinkPtr sentinel;
|
||||
void (*linkDeallocator)(xmlLinkPtr );
|
||||
int (*linkCompare)(const void *, const void*);
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Interfaces *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
* xmlLinkDeallocator:
|
||||
* @l: a list
|
||||
* @lk: a link
|
||||
*
|
||||
* Unlink and deallocate @lk from list @l
|
||||
*/
|
||||
static void
|
||||
xmlLinkDeallocator(xmlListPtr l, xmlLinkPtr lk)
|
||||
{
|
||||
(lk->prev)->next = lk->next;
|
||||
(lk->next)->prev = lk->prev;
|
||||
if(l->linkDeallocator)
|
||||
l->linkDeallocator(lk);
|
||||
xmlFree(lk);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlLinkCompare:
|
||||
* @data0: first data
|
||||
* @data1: second data
|
||||
*
|
||||
* Compares two arbitrary data
|
||||
*
|
||||
* Returns -1, 0 or 1 depending on whether data1 is greater equal or smaller
|
||||
* than data0
|
||||
*/
|
||||
static int
|
||||
xmlLinkCompare(const void *data0, const void *data1)
|
||||
{
|
||||
if (data0 < data1)
|
||||
return (-1);
|
||||
else if (data0 == data1)
|
||||
return (0);
|
||||
return (1);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListLowerSearch:
|
||||
* @l: a list
|
||||
* @data: a data
|
||||
*
|
||||
* Search data in the ordered list walking from the beginning
|
||||
*
|
||||
* Returns the link containing the data or NULL
|
||||
*/
|
||||
static xmlLinkPtr
|
||||
xmlListLowerSearch(xmlListPtr l, void *data)
|
||||
{
|
||||
xmlLinkPtr lk;
|
||||
|
||||
if (l == NULL)
|
||||
return(NULL);
|
||||
for(lk = l->sentinel->next;lk != l->sentinel && l->linkCompare(lk->data, data) <0 ;lk = lk->next);
|
||||
return lk;
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListHigherSearch:
|
||||
* @l: a list
|
||||
* @data: a data
|
||||
*
|
||||
* Search data in the ordered list walking backward from the end
|
||||
*
|
||||
* Returns the link containing the data or NULL
|
||||
*/
|
||||
static xmlLinkPtr
|
||||
xmlListHigherSearch(xmlListPtr l, void *data)
|
||||
{
|
||||
xmlLinkPtr lk;
|
||||
|
||||
if (l == NULL)
|
||||
return(NULL);
|
||||
for(lk = l->sentinel->prev;lk != l->sentinel && l->linkCompare(lk->data, data) >0 ;lk = lk->prev);
|
||||
return lk;
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListSearch:
|
||||
* @l: a list
|
||||
* @data: a data
|
||||
*
|
||||
* Search data in the list
|
||||
*
|
||||
* Returns the link containing the data or NULL
|
||||
*/
|
||||
static xmlLinkPtr
|
||||
xmlListLinkSearch(xmlListPtr l, void *data)
|
||||
{
|
||||
xmlLinkPtr lk;
|
||||
if (l == NULL)
|
||||
return(NULL);
|
||||
lk = xmlListLowerSearch(l, data);
|
||||
if (lk == l->sentinel)
|
||||
return NULL;
|
||||
else {
|
||||
if (l->linkCompare(lk->data, data) ==0)
|
||||
return lk;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListLinkReverseSearch:
|
||||
* @l: a list
|
||||
* @data: a data
|
||||
*
|
||||
* Search data in the list processing backward
|
||||
*
|
||||
* Returns the link containing the data or NULL
|
||||
*/
|
||||
static xmlLinkPtr
|
||||
xmlListLinkReverseSearch(xmlListPtr l, void *data)
|
||||
{
|
||||
xmlLinkPtr lk;
|
||||
if (l == NULL)
|
||||
return(NULL);
|
||||
lk = xmlListHigherSearch(l, data);
|
||||
if (lk == l->sentinel)
|
||||
return NULL;
|
||||
else {
|
||||
if (l->linkCompare(lk->data, data) ==0)
|
||||
return lk;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListCreate:
|
||||
* @deallocator: an optional deallocator function
|
||||
* @compare: an optional comparison function
|
||||
*
|
||||
* Create a new list
|
||||
*
|
||||
* Returns the new list or NULL in case of error
|
||||
*/
|
||||
xmlListPtr
|
||||
xmlListCreate(xmlListDeallocator deallocator, xmlListDataCompare compare)
|
||||
{
|
||||
xmlListPtr l;
|
||||
if (NULL == (l = (xmlListPtr )xmlMalloc( sizeof(xmlList)))) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"Cannot initialize memory for list");
|
||||
return (NULL);
|
||||
}
|
||||
/* Initialize the list to NULL */
|
||||
memset(l, 0, sizeof(xmlList));
|
||||
|
||||
/* Add the sentinel */
|
||||
if (NULL ==(l->sentinel = (xmlLinkPtr )xmlMalloc(sizeof(xmlLink)))) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"Cannot initialize memory for sentinel");
|
||||
xmlFree(l);
|
||||
return (NULL);
|
||||
}
|
||||
l->sentinel->next = l->sentinel;
|
||||
l->sentinel->prev = l->sentinel;
|
||||
l->sentinel->data = NULL;
|
||||
|
||||
/* If there is a link deallocator, use it */
|
||||
if (deallocator != NULL)
|
||||
l->linkDeallocator = deallocator;
|
||||
/* If there is a link comparator, use it */
|
||||
if (compare != NULL)
|
||||
l->linkCompare = compare;
|
||||
else /* Use our own */
|
||||
l->linkCompare = xmlLinkCompare;
|
||||
return l;
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListSearch:
|
||||
* @l: a list
|
||||
* @data: a search value
|
||||
*
|
||||
* Search the list for an existing value of @data
|
||||
*
|
||||
* Returns the value associated to @data or NULL in case of error
|
||||
*/
|
||||
void *
|
||||
xmlListSearch(xmlListPtr l, void *data)
|
||||
{
|
||||
xmlLinkPtr lk;
|
||||
if (l == NULL)
|
||||
return(NULL);
|
||||
lk = xmlListLinkSearch(l, data);
|
||||
if (lk)
|
||||
return (lk->data);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListReverseSearch:
|
||||
* @l: a list
|
||||
* @data: a search value
|
||||
*
|
||||
* Search the list in reverse order for an existing value of @data
|
||||
*
|
||||
* Returns the value associated to @data or NULL in case of error
|
||||
*/
|
||||
void *
|
||||
xmlListReverseSearch(xmlListPtr l, void *data)
|
||||
{
|
||||
xmlLinkPtr lk;
|
||||
if (l == NULL)
|
||||
return(NULL);
|
||||
lk = xmlListLinkReverseSearch(l, data);
|
||||
if (lk)
|
||||
return (lk->data);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListInsert:
|
||||
* @l: a list
|
||||
* @data: the data
|
||||
*
|
||||
* Insert data in the ordered list at the beginning for this value
|
||||
*
|
||||
* Returns 0 in case of success, 1 in case of failure
|
||||
*/
|
||||
int
|
||||
xmlListInsert(xmlListPtr l, void *data)
|
||||
{
|
||||
xmlLinkPtr lkPlace, lkNew;
|
||||
|
||||
if (l == NULL)
|
||||
return(1);
|
||||
lkPlace = xmlListLowerSearch(l, data);
|
||||
/* Add the new link */
|
||||
lkNew = (xmlLinkPtr) xmlMalloc(sizeof(xmlLink));
|
||||
if (lkNew == NULL) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"Cannot initialize memory for new link");
|
||||
return (1);
|
||||
}
|
||||
lkNew->data = data;
|
||||
lkPlace = lkPlace->prev;
|
||||
lkNew->next = lkPlace->next;
|
||||
(lkPlace->next)->prev = lkNew;
|
||||
lkPlace->next = lkNew;
|
||||
lkNew->prev = lkPlace;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListAppend:
|
||||
* @l: a list
|
||||
* @data: the data
|
||||
*
|
||||
* Insert data in the ordered list at the end for this value
|
||||
*
|
||||
* Returns 0 in case of success, 1 in case of failure
|
||||
*/
|
||||
int xmlListAppend(xmlListPtr l, void *data)
|
||||
{
|
||||
xmlLinkPtr lkPlace, lkNew;
|
||||
|
||||
if (l == NULL)
|
||||
return(1);
|
||||
lkPlace = xmlListHigherSearch(l, data);
|
||||
/* Add the new link */
|
||||
lkNew = (xmlLinkPtr) xmlMalloc(sizeof(xmlLink));
|
||||
if (lkNew == NULL) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"Cannot initialize memory for new link");
|
||||
return (0);
|
||||
}
|
||||
lkNew->data = data;
|
||||
lkNew->next = lkPlace->next;
|
||||
(lkPlace->next)->prev = lkNew;
|
||||
lkPlace->next = lkNew;
|
||||
lkNew->prev = lkPlace;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListDelete:
|
||||
* @l: a list
|
||||
*
|
||||
* Deletes the list and its associated data
|
||||
*/
|
||||
void xmlListDelete(xmlListPtr l)
|
||||
{
|
||||
if (l == NULL)
|
||||
return;
|
||||
|
||||
xmlListClear(l);
|
||||
xmlFree(l->sentinel);
|
||||
xmlFree(l);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListRemoveFirst:
|
||||
* @l: a list
|
||||
* @data: list data
|
||||
*
|
||||
* Remove the first instance associated to data in the list
|
||||
*
|
||||
* Returns 1 if a deallocation occured, or 0 if not found
|
||||
*/
|
||||
int
|
||||
xmlListRemoveFirst(xmlListPtr l, void *data)
|
||||
{
|
||||
xmlLinkPtr lk;
|
||||
|
||||
if (l == NULL)
|
||||
return(0);
|
||||
/*Find the first instance of this data */
|
||||
lk = xmlListLinkSearch(l, data);
|
||||
if (lk != NULL) {
|
||||
xmlLinkDeallocator(l, lk);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListRemoveLast:
|
||||
* @l: a list
|
||||
* @data: list data
|
||||
*
|
||||
* Remove the last instance associated to data in the list
|
||||
*
|
||||
* Returns 1 if a deallocation occured, or 0 if not found
|
||||
*/
|
||||
int
|
||||
xmlListRemoveLast(xmlListPtr l, void *data)
|
||||
{
|
||||
xmlLinkPtr lk;
|
||||
|
||||
if (l == NULL)
|
||||
return(0);
|
||||
/*Find the last instance of this data */
|
||||
lk = xmlListLinkReverseSearch(l, data);
|
||||
if (lk != NULL) {
|
||||
xmlLinkDeallocator(l, lk);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListRemoveAll:
|
||||
* @l: a list
|
||||
* @data: list data
|
||||
*
|
||||
* Remove the all instance associated to data in the list
|
||||
*
|
||||
* Returns the number of deallocation, or 0 if not found
|
||||
*/
|
||||
int
|
||||
xmlListRemoveAll(xmlListPtr l, void *data)
|
||||
{
|
||||
int count=0;
|
||||
|
||||
if (l == NULL)
|
||||
return(0);
|
||||
|
||||
while(xmlListRemoveFirst(l, data))
|
||||
count++;
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListClear:
|
||||
* @l: a list
|
||||
*
|
||||
* Remove the all data in the list
|
||||
*/
|
||||
void
|
||||
xmlListClear(xmlListPtr l)
|
||||
{
|
||||
xmlLinkPtr lk;
|
||||
|
||||
if (l == NULL)
|
||||
return;
|
||||
lk = l->sentinel->next;
|
||||
while(lk != l->sentinel) {
|
||||
xmlLinkPtr next = lk->next;
|
||||
|
||||
xmlLinkDeallocator(l, lk);
|
||||
lk = next;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListEmpty:
|
||||
* @l: a list
|
||||
*
|
||||
* Is the list empty ?
|
||||
*
|
||||
* Returns 1 if the list is empty, 0 if not empty and -1 in case of error
|
||||
*/
|
||||
int
|
||||
xmlListEmpty(xmlListPtr l)
|
||||
{
|
||||
if (l == NULL)
|
||||
return(-1);
|
||||
return (l->sentinel->next == l->sentinel);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListFront:
|
||||
* @l: a list
|
||||
*
|
||||
* Get the first element in the list
|
||||
*
|
||||
* Returns the first element in the list, or NULL
|
||||
*/
|
||||
xmlLinkPtr
|
||||
xmlListFront(xmlListPtr l)
|
||||
{
|
||||
if (l == NULL)
|
||||
return(NULL);
|
||||
return (l->sentinel->next);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListEnd:
|
||||
* @l: a list
|
||||
*
|
||||
* Get the last element in the list
|
||||
*
|
||||
* Returns the last element in the list, or NULL
|
||||
*/
|
||||
xmlLinkPtr
|
||||
xmlListEnd(xmlListPtr l)
|
||||
{
|
||||
if (l == NULL)
|
||||
return(NULL);
|
||||
return (l->sentinel->prev);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListSize:
|
||||
* @l: a list
|
||||
*
|
||||
* Get the number of elements in the list
|
||||
*
|
||||
* Returns the number of elements in the list or -1 in case of error
|
||||
*/
|
||||
int
|
||||
xmlListSize(xmlListPtr l)
|
||||
{
|
||||
xmlLinkPtr lk;
|
||||
int count=0;
|
||||
|
||||
if (l == NULL)
|
||||
return(-1);
|
||||
/* TODO: keep a counter in xmlList instead */
|
||||
for(lk = l->sentinel->next; lk != l->sentinel; lk = lk->next, count++);
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListPopFront:
|
||||
* @l: a list
|
||||
*
|
||||
* Removes the first element in the list
|
||||
*/
|
||||
void
|
||||
xmlListPopFront(xmlListPtr l)
|
||||
{
|
||||
if(!xmlListEmpty(l))
|
||||
xmlLinkDeallocator(l, l->sentinel->next);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListPopBack:
|
||||
* @l: a list
|
||||
*
|
||||
* Removes the last element in the list
|
||||
*/
|
||||
void
|
||||
xmlListPopBack(xmlListPtr l)
|
||||
{
|
||||
if(!xmlListEmpty(l))
|
||||
xmlLinkDeallocator(l, l->sentinel->prev);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListPushFront:
|
||||
* @l: a list
|
||||
* @data: new data
|
||||
*
|
||||
* add the new data at the beginning of the list
|
||||
*
|
||||
* Returns 1 if successful, 0 otherwise
|
||||
*/
|
||||
int
|
||||
xmlListPushFront(xmlListPtr l, void *data)
|
||||
{
|
||||
xmlLinkPtr lkPlace, lkNew;
|
||||
|
||||
if (l == NULL)
|
||||
return(0);
|
||||
lkPlace = l->sentinel;
|
||||
/* Add the new link */
|
||||
lkNew = (xmlLinkPtr) xmlMalloc(sizeof(xmlLink));
|
||||
if (lkNew == NULL) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"Cannot initialize memory for new link");
|
||||
return (0);
|
||||
}
|
||||
lkNew->data = data;
|
||||
lkNew->next = lkPlace->next;
|
||||
(lkPlace->next)->prev = lkNew;
|
||||
lkPlace->next = lkNew;
|
||||
lkNew->prev = lkPlace;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListPushBack:
|
||||
* @l: a list
|
||||
* @data: new data
|
||||
*
|
||||
* add the new data at the end of the list
|
||||
*
|
||||
* Returns 1 if successful, 0 otherwise
|
||||
*/
|
||||
int
|
||||
xmlListPushBack(xmlListPtr l, void *data)
|
||||
{
|
||||
xmlLinkPtr lkPlace, lkNew;
|
||||
|
||||
if (l == NULL)
|
||||
return(0);
|
||||
lkPlace = l->sentinel->prev;
|
||||
/* Add the new link */
|
||||
if (NULL ==(lkNew = (xmlLinkPtr )xmlMalloc(sizeof(xmlLink)))) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"Cannot initialize memory for new link");
|
||||
return (0);
|
||||
}
|
||||
lkNew->data = data;
|
||||
lkNew->next = lkPlace->next;
|
||||
(lkPlace->next)->prev = lkNew;
|
||||
lkPlace->next = lkNew;
|
||||
lkNew->prev = lkPlace;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlLinkGetData:
|
||||
* @lk: a link
|
||||
*
|
||||
* See Returns.
|
||||
*
|
||||
* Returns a pointer to the data referenced from this link
|
||||
*/
|
||||
void *
|
||||
xmlLinkGetData(xmlLinkPtr lk)
|
||||
{
|
||||
if (lk == NULL)
|
||||
return(NULL);
|
||||
return lk->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListReverse:
|
||||
* @l: a list
|
||||
*
|
||||
* Reverse the order of the elements in the list
|
||||
*/
|
||||
void
|
||||
xmlListReverse(xmlListPtr l)
|
||||
{
|
||||
xmlLinkPtr lk;
|
||||
xmlLinkPtr lkPrev;
|
||||
|
||||
if (l == NULL)
|
||||
return;
|
||||
lkPrev = l->sentinel;
|
||||
for (lk = l->sentinel->next; lk != l->sentinel; lk = lk->next) {
|
||||
lkPrev->next = lkPrev->prev;
|
||||
lkPrev->prev = lk;
|
||||
lkPrev = lk;
|
||||
}
|
||||
/* Fix up the last node */
|
||||
lkPrev->next = lkPrev->prev;
|
||||
lkPrev->prev = lk;
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListSort:
|
||||
* @l: a list
|
||||
*
|
||||
* Sort all the elements in the list
|
||||
*/
|
||||
void
|
||||
xmlListSort(xmlListPtr l)
|
||||
{
|
||||
xmlListPtr lTemp;
|
||||
|
||||
if (l == NULL)
|
||||
return;
|
||||
if(xmlListEmpty(l))
|
||||
return;
|
||||
|
||||
/* I think that the real answer is to implement quicksort, the
|
||||
* alternative is to implement some list copying procedure which
|
||||
* would be based on a list copy followed by a clear followed by
|
||||
* an insert. This is slow...
|
||||
*/
|
||||
|
||||
if (NULL ==(lTemp = xmlListDup(l)))
|
||||
return;
|
||||
xmlListClear(l);
|
||||
xmlListMerge(l, lTemp);
|
||||
xmlListDelete(lTemp);
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListWalk:
|
||||
* @l: a list
|
||||
* @walker: a processing function
|
||||
* @user: a user parameter passed to the walker function
|
||||
*
|
||||
* Walk all the element of the first from first to last and
|
||||
* apply the walker function to it
|
||||
*/
|
||||
void
|
||||
xmlListWalk(xmlListPtr l, xmlListWalker walker, const void *user) {
|
||||
xmlLinkPtr lk;
|
||||
|
||||
if ((l == NULL) || (walker == NULL))
|
||||
return;
|
||||
for(lk = l->sentinel->next; lk != l->sentinel; lk = lk->next) {
|
||||
if((walker(lk->data, user)) == 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListReverseWalk:
|
||||
* @l: a list
|
||||
* @walker: a processing function
|
||||
* @user: a user parameter passed to the walker function
|
||||
*
|
||||
* Walk all the element of the list in reverse order and
|
||||
* apply the walker function to it
|
||||
*/
|
||||
void
|
||||
xmlListReverseWalk(xmlListPtr l, xmlListWalker walker, const void *user) {
|
||||
xmlLinkPtr lk;
|
||||
|
||||
if ((l == NULL) || (walker == NULL))
|
||||
return;
|
||||
for(lk = l->sentinel->prev; lk != l->sentinel; lk = lk->prev) {
|
||||
if((walker(lk->data, user)) == 0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListMerge:
|
||||
* @l1: the original list
|
||||
* @l2: the new list
|
||||
*
|
||||
* include all the elements of the second list in the first one and
|
||||
* clear the second list
|
||||
*/
|
||||
void
|
||||
xmlListMerge(xmlListPtr l1, xmlListPtr l2)
|
||||
{
|
||||
xmlListCopy(l1, l2);
|
||||
xmlListClear(l2);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListDup:
|
||||
* @old: the list
|
||||
*
|
||||
* Duplicate the list
|
||||
*
|
||||
* Returns a new copy of the list or NULL in case of error
|
||||
*/
|
||||
xmlListPtr
|
||||
xmlListDup(const xmlListPtr old)
|
||||
{
|
||||
xmlListPtr cur;
|
||||
|
||||
if (old == NULL)
|
||||
return(NULL);
|
||||
/* Hmmm, how to best deal with allocation issues when copying
|
||||
* lists. If there is a de-allocator, should responsibility lie with
|
||||
* the new list or the old list. Surely not both. I'll arbitrarily
|
||||
* set it to be the old list for the time being whilst I work out
|
||||
* the answer
|
||||
*/
|
||||
if (NULL ==(cur = xmlListCreate(NULL, old->linkCompare)))
|
||||
return (NULL);
|
||||
if (0 != xmlListCopy(cur, old))
|
||||
return NULL;
|
||||
return cur;
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlListCopy:
|
||||
* @cur: the new list
|
||||
* @old: the old list
|
||||
*
|
||||
* Move all the element from the old list in the new list
|
||||
*
|
||||
* Returns 0 in case of success 1 in case of error
|
||||
*/
|
||||
int
|
||||
xmlListCopy(xmlListPtr cur, const xmlListPtr old)
|
||||
{
|
||||
/* Walk the old tree and insert the data into the new one */
|
||||
xmlLinkPtr lk;
|
||||
|
||||
if ((old == NULL) || (cur == NULL))
|
||||
return(1);
|
||||
for(lk = old->sentinel->next; lk != old->sentinel; lk = lk->next) {
|
||||
if (0 !=xmlListInsert(cur, lk->data)) {
|
||||
xmlListDelete(cur);
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
/* xmlListUnique() */
|
||||
/* xmlListSwap */
|
||||
#define bottom_list
|
||||
#include "elfgcchack.h"
|
||||
2108
Extras/LibXML/nanoftp.c
Normal file
2108
Extras/LibXML/nanoftp.c
Normal file
File diff suppressed because it is too large
Load Diff
1677
Extras/LibXML/nanohttp.c
Normal file
1677
Extras/LibXML/nanohttp.c
Normal file
File diff suppressed because it is too large
Load Diff
13094
Extras/LibXML/parser.c
Normal file
13094
Extras/LibXML/parser.c
Normal file
File diff suppressed because it is too large
Load Diff
2096
Extras/LibXML/parserInternals.c
Normal file
2096
Extras/LibXML/parserInternals.c
Normal file
File diff suppressed because it is too large
Load Diff
2080
Extras/LibXML/pattern.c
Normal file
2080
Extras/LibXML/pattern.c
Normal file
File diff suppressed because it is too large
Load Diff
10713
Extras/LibXML/relaxng.c
Normal file
10713
Extras/LibXML/relaxng.c
Normal file
File diff suppressed because it is too large
Load Diff
778
Extras/LibXML/threads.c
Normal file
778
Extras/LibXML/threads.c
Normal file
@@ -0,0 +1,778 @@
|
||||
/**
|
||||
* threads.c: set of generic threading related routines
|
||||
*
|
||||
* See Copyright for the status of this software.
|
||||
*
|
||||
* Gary Pennington <Gary.Pennington@uk.sun.com>
|
||||
* daniel@veillard.com
|
||||
*/
|
||||
|
||||
#define IN_LIBXML
|
||||
#include "libxml.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <libxml/threads.h>
|
||||
#include <libxml/globals.h>
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WIN32_THREADS
|
||||
#include <windows.h>
|
||||
#ifndef HAVE_COMPILER_TLS
|
||||
#include <process.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_BEOS_THREADS
|
||||
#include <OS.h>
|
||||
#include <TLS.h>
|
||||
#endif
|
||||
|
||||
#if defined(SOLARIS)
|
||||
#include <note.h>
|
||||
#endif
|
||||
|
||||
/* #define DEBUG_THREADS */
|
||||
|
||||
/*
|
||||
* TODO: this module still uses malloc/free and not xmlMalloc/xmlFree
|
||||
* to avoid some crazyness since xmlMalloc/xmlFree may actually
|
||||
* be hosted on allocated blocks needing them for the allocation ...
|
||||
*/
|
||||
|
||||
/*
|
||||
* xmlMutex are a simple mutual exception locks
|
||||
*/
|
||||
struct _xmlMutex {
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
pthread_mutex_t lock;
|
||||
#elif defined HAVE_WIN32_THREADS
|
||||
HANDLE mutex;
|
||||
#elif defined HAVE_BEOS_THREADS
|
||||
sem_id sem;
|
||||
thread_id tid;
|
||||
#else
|
||||
int empty;
|
||||
#endif
|
||||
};
|
||||
|
||||
/*
|
||||
* xmlRMutex are reentrant mutual exception locks
|
||||
*/
|
||||
struct _xmlRMutex {
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
pthread_mutex_t lock;
|
||||
unsigned int held;
|
||||
unsigned int waiters;
|
||||
pthread_t tid;
|
||||
pthread_cond_t cv;
|
||||
#elif defined HAVE_WIN32_THREADS
|
||||
CRITICAL_SECTION cs;
|
||||
unsigned int count;
|
||||
#elif defined HAVE_BEOS_THREADS
|
||||
xmlMutexPtr lock;
|
||||
thread_id tid;
|
||||
int32 count;
|
||||
#else
|
||||
int empty;
|
||||
#endif
|
||||
};
|
||||
/*
|
||||
* This module still has some internal static data.
|
||||
* - xmlLibraryLock a global lock
|
||||
* - globalkey used for per-thread data
|
||||
*/
|
||||
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
static pthread_key_t globalkey;
|
||||
static pthread_t mainthread;
|
||||
static pthread_once_t once_control = PTHREAD_ONCE_INIT;
|
||||
#elif defined HAVE_WIN32_THREADS
|
||||
#if defined(HAVE_COMPILER_TLS)
|
||||
static __declspec(thread) xmlGlobalState tlstate;
|
||||
static __declspec(thread) int tlstate_inited = 0;
|
||||
#else /* HAVE_COMPILER_TLS */
|
||||
static DWORD globalkey = TLS_OUT_OF_INDEXES;
|
||||
#endif /* HAVE_COMPILER_TLS */
|
||||
static DWORD mainthread;
|
||||
static struct
|
||||
{
|
||||
DWORD done;
|
||||
DWORD control;
|
||||
} run_once = { 0, 0 };
|
||||
/* endif HAVE_WIN32_THREADS */
|
||||
#elif defined HAVE_BEOS_THREADS
|
||||
int32 globalkey = 0;
|
||||
thread_id mainthread = 0;
|
||||
int32 run_once_init = 0;
|
||||
#endif
|
||||
|
||||
static xmlRMutexPtr xmlLibraryLock = NULL;
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
static void xmlOnceInit(void);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* xmlNewMutex:
|
||||
*
|
||||
* xmlNewMutex() is used to allocate a libxml2 token struct for use in
|
||||
* synchronizing access to data.
|
||||
*
|
||||
* Returns a new simple mutex pointer or NULL in case of error
|
||||
*/
|
||||
xmlMutexPtr
|
||||
xmlNewMutex(void)
|
||||
{
|
||||
xmlMutexPtr tok;
|
||||
|
||||
if ((tok = malloc(sizeof(xmlMutex))) == NULL)
|
||||
return (NULL);
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
pthread_mutex_init(&tok->lock, NULL);
|
||||
#elif defined HAVE_WIN32_THREADS
|
||||
tok->mutex = CreateMutex(NULL, FALSE, NULL);
|
||||
#elif defined HAVE_BEOS_THREADS
|
||||
if ((tok->sem = create_sem(1, "xmlMutex")) < B_OK) {
|
||||
free(tok);
|
||||
return NULL;
|
||||
}
|
||||
tok->tid = -1;
|
||||
#endif
|
||||
return (tok);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlFreeMutex:
|
||||
* @tok: the simple mutex
|
||||
*
|
||||
* xmlFreeMutex() is used to reclaim resources associated with a libxml2 token
|
||||
* struct.
|
||||
*/
|
||||
void
|
||||
xmlFreeMutex(xmlMutexPtr tok)
|
||||
{
|
||||
if (tok == NULL) return;
|
||||
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
pthread_mutex_destroy(&tok->lock);
|
||||
#elif defined HAVE_WIN32_THREADS
|
||||
CloseHandle(tok->mutex);
|
||||
#elif defined HAVE_BEOS_THREADS
|
||||
delete_sem(tok->sem);
|
||||
#endif
|
||||
free(tok);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlMutexLock:
|
||||
* @tok: the simple mutex
|
||||
*
|
||||
* xmlMutexLock() is used to lock a libxml2 token.
|
||||
*/
|
||||
void
|
||||
xmlMutexLock(xmlMutexPtr tok)
|
||||
{
|
||||
if (tok == NULL)
|
||||
return;
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
pthread_mutex_lock(&tok->lock);
|
||||
#elif defined HAVE_WIN32_THREADS
|
||||
WaitForSingleObject(tok->mutex, INFINITE);
|
||||
#elif defined HAVE_BEOS_THREADS
|
||||
if (acquire_sem(tok->sem) != B_NO_ERROR) {
|
||||
#ifdef DEBUG_THREADS
|
||||
xmlGenericError(xmlGenericErrorContext, "xmlMutexLock():BeOS:Couldn't aquire semaphore\n");
|
||||
exit();
|
||||
#endif
|
||||
}
|
||||
tok->tid = find_thread(NULL);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlMutexUnlock:
|
||||
* @tok: the simple mutex
|
||||
*
|
||||
* xmlMutexUnlock() is used to unlock a libxml2 token.
|
||||
*/
|
||||
void
|
||||
xmlMutexUnlock(xmlMutexPtr tok)
|
||||
{
|
||||
if (tok == NULL)
|
||||
return;
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
pthread_mutex_unlock(&tok->lock);
|
||||
#elif defined HAVE_WIN32_THREADS
|
||||
ReleaseMutex(tok->mutex);
|
||||
#elif defined HAVE_BEOS_THREADS
|
||||
if (tok->tid == find_thread(NULL)) {
|
||||
tok->tid = -1;
|
||||
release_sem(tok->sem);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlNewRMutex:
|
||||
*
|
||||
* xmlRNewMutex() is used to allocate a reentrant mutex for use in
|
||||
* synchronizing access to data. token_r is a re-entrant lock and thus useful
|
||||
* for synchronizing access to data structures that may be manipulated in a
|
||||
* recursive fashion.
|
||||
*
|
||||
* Returns the new reentrant mutex pointer or NULL in case of error
|
||||
*/
|
||||
xmlRMutexPtr
|
||||
xmlNewRMutex(void)
|
||||
{
|
||||
xmlRMutexPtr tok;
|
||||
|
||||
if ((tok = malloc(sizeof(xmlRMutex))) == NULL)
|
||||
return (NULL);
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
pthread_mutex_init(&tok->lock, NULL);
|
||||
tok->held = 0;
|
||||
tok->waiters = 0;
|
||||
pthread_cond_init(&tok->cv, NULL);
|
||||
#elif defined HAVE_WIN32_THREADS
|
||||
InitializeCriticalSection(&tok->cs);
|
||||
tok->count = 0;
|
||||
#elif defined HAVE_BEOS_THREADS
|
||||
if ((tok->lock = xmlNewMutex()) == NULL) {
|
||||
free(tok);
|
||||
return NULL;
|
||||
}
|
||||
tok->count = 0;
|
||||
#endif
|
||||
return (tok);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlFreeRMutex:
|
||||
* @tok: the reentrant mutex
|
||||
*
|
||||
* xmlRFreeMutex() is used to reclaim resources associated with a
|
||||
* reentrant mutex.
|
||||
*/
|
||||
void
|
||||
xmlFreeRMutex(xmlRMutexPtr tok ATTRIBUTE_UNUSED)
|
||||
{
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
pthread_mutex_destroy(&tok->lock);
|
||||
#elif defined HAVE_WIN32_THREADS
|
||||
DeleteCriticalSection(&tok->cs);
|
||||
#elif defined HAVE_BEOS_THREADS
|
||||
xmlFreeMutex(tok->lock);
|
||||
#endif
|
||||
free(tok);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlRMutexLock:
|
||||
* @tok: the reentrant mutex
|
||||
*
|
||||
* xmlRMutexLock() is used to lock a libxml2 token_r.
|
||||
*/
|
||||
void
|
||||
xmlRMutexLock(xmlRMutexPtr tok)
|
||||
{
|
||||
if (tok == NULL)
|
||||
return;
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
pthread_mutex_lock(&tok->lock);
|
||||
if (tok->held) {
|
||||
if (pthread_equal(tok->tid, pthread_self())) {
|
||||
tok->held++;
|
||||
pthread_mutex_unlock(&tok->lock);
|
||||
return;
|
||||
} else {
|
||||
tok->waiters++;
|
||||
while (tok->held)
|
||||
pthread_cond_wait(&tok->cv, &tok->lock);
|
||||
tok->waiters--;
|
||||
}
|
||||
}
|
||||
tok->tid = pthread_self();
|
||||
tok->held = 1;
|
||||
pthread_mutex_unlock(&tok->lock);
|
||||
#elif defined HAVE_WIN32_THREADS
|
||||
EnterCriticalSection(&tok->cs);
|
||||
++tok->count;
|
||||
#elif defined HAVE_BEOS_THREADS
|
||||
if (tok->lock->tid == find_thread(NULL)) {
|
||||
tok->count++;
|
||||
return;
|
||||
} else {
|
||||
xmlMutexLock(tok->lock);
|
||||
tok->count = 1;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlRMutexUnlock:
|
||||
* @tok: the reentrant mutex
|
||||
*
|
||||
* xmlRMutexUnlock() is used to unlock a libxml2 token_r.
|
||||
*/
|
||||
void
|
||||
xmlRMutexUnlock(xmlRMutexPtr tok ATTRIBUTE_UNUSED)
|
||||
{
|
||||
if (tok == NULL)
|
||||
return;
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
pthread_mutex_lock(&tok->lock);
|
||||
tok->held--;
|
||||
if (tok->held == 0) {
|
||||
if (tok->waiters)
|
||||
pthread_cond_signal(&tok->cv);
|
||||
tok->tid = 0;
|
||||
}
|
||||
pthread_mutex_unlock(&tok->lock);
|
||||
#elif defined HAVE_WIN32_THREADS
|
||||
if (!--tok->count)
|
||||
LeaveCriticalSection(&tok->cs);
|
||||
#elif defined HAVE_BEOS_THREADS
|
||||
if (tok->lock->tid == find_thread(NULL)) {
|
||||
tok->count--;
|
||||
if (tok->count == 0) {
|
||||
xmlMutexUnlock(tok->lock);
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Per thread global state handling *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#ifdef xmlLastError
|
||||
#undef xmlLastError
|
||||
#endif
|
||||
/**
|
||||
* xmlFreeGlobalState:
|
||||
* @state: a thread global state
|
||||
*
|
||||
* xmlFreeGlobalState() is called when a thread terminates with a non-NULL
|
||||
* global state. It is is used here to reclaim memory resources.
|
||||
*/
|
||||
static void
|
||||
xmlFreeGlobalState(void *state)
|
||||
{
|
||||
xmlGlobalState *gs = (xmlGlobalState *) state;
|
||||
|
||||
/* free any memory allocated in the thread's xmlLastError */
|
||||
xmlResetError(&(gs->xmlLastError));
|
||||
free(state);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlNewGlobalState:
|
||||
*
|
||||
* xmlNewGlobalState() allocates a global state. This structure is used to
|
||||
* hold all data for use by a thread when supporting backwards compatibility
|
||||
* of libxml2 to pre-thread-safe behaviour.
|
||||
*
|
||||
* Returns the newly allocated xmlGlobalStatePtr or NULL in case of error
|
||||
*/
|
||||
static xmlGlobalStatePtr
|
||||
xmlNewGlobalState(void)
|
||||
{
|
||||
xmlGlobalState *gs;
|
||||
|
||||
gs = malloc(sizeof(xmlGlobalState));
|
||||
if (gs == NULL)
|
||||
return(NULL);
|
||||
|
||||
memset(gs, 0, sizeof(xmlGlobalState));
|
||||
xmlInitializeGlobalState(gs);
|
||||
return (gs);
|
||||
}
|
||||
#endif /* LIBXML_THREAD_ENABLED */
|
||||
|
||||
|
||||
#ifdef HAVE_WIN32_THREADS
|
||||
#if !defined(HAVE_COMPILER_TLS)
|
||||
#if defined(LIBXML_STATIC) && !defined(LIBXML_STATIC_FOR_DLL)
|
||||
typedef struct _xmlGlobalStateCleanupHelperParams
|
||||
{
|
||||
HANDLE thread;
|
||||
void *memory;
|
||||
} xmlGlobalStateCleanupHelperParams;
|
||||
|
||||
static void xmlGlobalStateCleanupHelper (void *p)
|
||||
{
|
||||
xmlGlobalStateCleanupHelperParams *params = (xmlGlobalStateCleanupHelperParams *) p;
|
||||
WaitForSingleObject(params->thread, INFINITE);
|
||||
CloseHandle(params->thread);
|
||||
xmlFreeGlobalState(params->memory);
|
||||
free(params);
|
||||
_endthread();
|
||||
}
|
||||
#else /* LIBXML_STATIC && !LIBXML_STATIC_FOR_DLL */
|
||||
|
||||
typedef struct _xmlGlobalStateCleanupHelperParams
|
||||
{
|
||||
void *memory;
|
||||
struct _xmlGlobalStateCleanupHelperParams * prev;
|
||||
struct _xmlGlobalStateCleanupHelperParams * next;
|
||||
} xmlGlobalStateCleanupHelperParams;
|
||||
|
||||
static xmlGlobalStateCleanupHelperParams * cleanup_helpers_head = NULL;
|
||||
static CRITICAL_SECTION cleanup_helpers_cs;
|
||||
|
||||
#endif /* LIBXMLSTATIC && !LIBXML_STATIC_FOR_DLL */
|
||||
#endif /* HAVE_COMPILER_TLS */
|
||||
#endif /* HAVE_WIN32_THREADS */
|
||||
|
||||
#if defined HAVE_BEOS_THREADS
|
||||
/**
|
||||
* xmlGlobalStateCleanup:
|
||||
* @data: unused parameter
|
||||
*
|
||||
* Used for Beos only
|
||||
*/
|
||||
void xmlGlobalStateCleanup(void *data)
|
||||
{
|
||||
void *globalval = tls_get(globalkey);
|
||||
if (globalval != NULL)
|
||||
xmlFreeGlobalState(globalval);
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* xmlGetGlobalState:
|
||||
*
|
||||
* xmlGetGlobalState() is called to retrieve the global state for a thread.
|
||||
*
|
||||
* Returns the thread global state or NULL in case of error
|
||||
*/
|
||||
xmlGlobalStatePtr
|
||||
xmlGetGlobalState(void)
|
||||
{
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
xmlGlobalState *globalval;
|
||||
|
||||
pthread_once(&once_control, xmlOnceInit);
|
||||
|
||||
if ((globalval = (xmlGlobalState *)
|
||||
pthread_getspecific(globalkey)) == NULL) {
|
||||
xmlGlobalState *tsd = xmlNewGlobalState();
|
||||
|
||||
pthread_setspecific(globalkey, tsd);
|
||||
return (tsd);
|
||||
}
|
||||
return (globalval);
|
||||
#elif defined HAVE_WIN32_THREADS
|
||||
#if defined(HAVE_COMPILER_TLS)
|
||||
if (!tlstate_inited) {
|
||||
tlstate_inited = 1;
|
||||
xmlInitializeGlobalState(&tlstate);
|
||||
}
|
||||
return &tlstate;
|
||||
#else /* HAVE_COMPILER_TLS */
|
||||
xmlGlobalState *globalval;
|
||||
xmlGlobalStateCleanupHelperParams * p;
|
||||
|
||||
xmlOnceInit();
|
||||
#if defined(LIBXML_STATIC) && !defined(LIBXML_STATIC_FOR_DLL)
|
||||
globalval = (xmlGlobalState *)TlsGetValue(globalkey);
|
||||
#else
|
||||
p = (xmlGlobalStateCleanupHelperParams*)TlsGetValue(globalkey);
|
||||
globalval = (xmlGlobalState *)(p ? p->memory : NULL);
|
||||
#endif
|
||||
if (globalval == NULL) {
|
||||
xmlGlobalState *tsd = xmlNewGlobalState();
|
||||
p = (xmlGlobalStateCleanupHelperParams *) malloc(sizeof(xmlGlobalStateCleanupHelperParams));
|
||||
p->memory = tsd;
|
||||
#if defined(LIBXML_STATIC) && !defined(LIBXML_STATIC_FOR_DLL)
|
||||
DuplicateHandle(GetCurrentProcess(), GetCurrentThread(),
|
||||
GetCurrentProcess(), &p->thread, 0, TRUE, DUPLICATE_SAME_ACCESS);
|
||||
TlsSetValue(globalkey, tsd);
|
||||
_beginthread(xmlGlobalStateCleanupHelper, 0, p);
|
||||
#else
|
||||
EnterCriticalSection(&cleanup_helpers_cs);
|
||||
if (cleanup_helpers_head != NULL) {
|
||||
cleanup_helpers_head->prev = p;
|
||||
}
|
||||
p->next = cleanup_helpers_head;
|
||||
p->prev = NULL;
|
||||
cleanup_helpers_head = p;
|
||||
TlsSetValue(globalkey, p);
|
||||
LeaveCriticalSection(&cleanup_helpers_cs);
|
||||
#endif
|
||||
|
||||
return (tsd);
|
||||
}
|
||||
return (globalval);
|
||||
#endif /* HAVE_COMPILER_TLS */
|
||||
#elif defined HAVE_BEOS_THREADS
|
||||
xmlGlobalState *globalval;
|
||||
|
||||
xmlOnceInit();
|
||||
|
||||
if ((globalval = (xmlGlobalState *)
|
||||
tls_get(globalkey)) == NULL) {
|
||||
xmlGlobalState *tsd = xmlNewGlobalState();
|
||||
|
||||
tls_set(globalkey, tsd);
|
||||
on_exit_thread(xmlGlobalStateCleanup, NULL);
|
||||
return (tsd);
|
||||
}
|
||||
return (globalval);
|
||||
#else
|
||||
return(NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Library wide thread interfaces *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
* xmlGetThreadId:
|
||||
*
|
||||
* xmlGetThreadId() find the current thread ID number
|
||||
*
|
||||
* Returns the current thread ID number
|
||||
*/
|
||||
int
|
||||
xmlGetThreadId(void)
|
||||
{
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
return((int) pthread_self());
|
||||
#elif defined HAVE_WIN32_THREADS
|
||||
return GetCurrentThreadId();
|
||||
#elif defined HAVE_BEOS_THREADS
|
||||
return find_thread(NULL);
|
||||
#else
|
||||
return((int) 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlIsMainThread:
|
||||
*
|
||||
* xmlIsMainThread() check whether the current thread is the main thread.
|
||||
*
|
||||
* Returns 1 if the current thread is the main thread, 0 otherwise
|
||||
*/
|
||||
int
|
||||
xmlIsMainThread(void)
|
||||
{
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
pthread_once(&once_control, xmlOnceInit);
|
||||
#elif defined HAVE_WIN32_THREADS
|
||||
xmlOnceInit ();
|
||||
#elif defined HAVE_BEOS_THREADS
|
||||
xmlOnceInit();
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_THREADS
|
||||
xmlGenericError(xmlGenericErrorContext, "xmlIsMainThread()\n");
|
||||
#endif
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
return(mainthread == pthread_self());
|
||||
#elif defined HAVE_WIN32_THREADS
|
||||
return(mainthread == GetCurrentThreadId ());
|
||||
#elif defined HAVE_BEOS_THREADS
|
||||
return(mainthread == find_thread(NULL));
|
||||
#else
|
||||
return(1);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlLockLibrary:
|
||||
*
|
||||
* xmlLockLibrary() is used to take out a re-entrant lock on the libxml2
|
||||
* library.
|
||||
*/
|
||||
void
|
||||
xmlLockLibrary(void)
|
||||
{
|
||||
#ifdef DEBUG_THREADS
|
||||
xmlGenericError(xmlGenericErrorContext, "xmlLockLibrary()\n");
|
||||
#endif
|
||||
xmlRMutexLock(xmlLibraryLock);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlUnlockLibrary:
|
||||
*
|
||||
* xmlUnlockLibrary() is used to release a re-entrant lock on the libxml2
|
||||
* library.
|
||||
*/
|
||||
void
|
||||
xmlUnlockLibrary(void)
|
||||
{
|
||||
#ifdef DEBUG_THREADS
|
||||
xmlGenericError(xmlGenericErrorContext, "xmlUnlockLibrary()\n");
|
||||
#endif
|
||||
xmlRMutexUnlock(xmlLibraryLock);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlInitThreads:
|
||||
*
|
||||
* xmlInitThreads() is used to to initialize all the thread related
|
||||
* data of the libxml2 library.
|
||||
*/
|
||||
void
|
||||
xmlInitThreads(void)
|
||||
{
|
||||
#ifdef DEBUG_THREADS
|
||||
xmlGenericError(xmlGenericErrorContext, "xmlInitThreads()\n");
|
||||
#endif
|
||||
#if defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL))
|
||||
InitializeCriticalSection(&cleanup_helpers_cs);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlCleanupThreads:
|
||||
*
|
||||
* xmlCleanupThreads() is used to to cleanup all the thread related
|
||||
* data of the libxml2 library once processing has ended.
|
||||
*/
|
||||
void
|
||||
xmlCleanupThreads(void)
|
||||
{
|
||||
#ifdef DEBUG_THREADS
|
||||
xmlGenericError(xmlGenericErrorContext, "xmlCleanupThreads()\n");
|
||||
#endif
|
||||
#if defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL))
|
||||
if (globalkey != TLS_OUT_OF_INDEXES) {
|
||||
xmlGlobalStateCleanupHelperParams * p;
|
||||
EnterCriticalSection(&cleanup_helpers_cs);
|
||||
p = cleanup_helpers_head;
|
||||
while (p != NULL) {
|
||||
xmlGlobalStateCleanupHelperParams * temp = p;
|
||||
p = p->next;
|
||||
xmlFreeGlobalState(temp->memory);
|
||||
free(temp);
|
||||
}
|
||||
cleanup_helpers_head = 0;
|
||||
LeaveCriticalSection(&cleanup_helpers_cs);
|
||||
TlsFree(globalkey);
|
||||
globalkey = TLS_OUT_OF_INDEXES;
|
||||
}
|
||||
DeleteCriticalSection(&cleanup_helpers_cs);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
/**
|
||||
* xmlOnceInit
|
||||
*
|
||||
* xmlOnceInit() is used to initialize the value of mainthread for use
|
||||
* in other routines. This function should only be called using
|
||||
* pthread_once() in association with the once_control variable to ensure
|
||||
* that the function is only called once. See man pthread_once for more
|
||||
* details.
|
||||
*/
|
||||
static void
|
||||
xmlOnceInit(void) {
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
(void) pthread_key_create(&globalkey, xmlFreeGlobalState);
|
||||
mainthread = pthread_self();
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_WIN32_THREADS)
|
||||
if (!run_once.done) {
|
||||
if (InterlockedIncrement(&run_once.control) == 1)
|
||||
{
|
||||
#if !defined(HAVE_COMPILER_TLS)
|
||||
globalkey = TlsAlloc();
|
||||
#endif
|
||||
mainthread = GetCurrentThreadId();
|
||||
run_once.done = 1;
|
||||
}
|
||||
else {
|
||||
/* Another thread is working; give up our slice and
|
||||
* wait until they're done. */
|
||||
while (!run_once.done)
|
||||
Sleep(0);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_BEOS_THREADS
|
||||
if (atomic_add(&run_once_init, 1) == 0) {
|
||||
globalkey = tls_allocate();
|
||||
tls_set(globalkey, NULL);
|
||||
mainthread = find_thread(NULL);
|
||||
} else
|
||||
atomic_add(&run_once_init, -1);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* DllMain:
|
||||
* @hinstDLL: handle to DLL instance
|
||||
* @fdwReason: Reason code for entry
|
||||
* @lpvReserved: generic pointer (depends upon reason code)
|
||||
*
|
||||
* Entry point for Windows library. It is being used to free thread-specific
|
||||
* storage.
|
||||
*
|
||||
* Returns TRUE always
|
||||
*/
|
||||
#if defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL))
|
||||
#if defined(LIBXML_STATIC_FOR_DLL)
|
||||
BOOL WINAPI xmlDllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||
#else
|
||||
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
|
||||
#endif
|
||||
{
|
||||
switch(fdwReason) {
|
||||
case DLL_THREAD_DETACH:
|
||||
if (globalkey != TLS_OUT_OF_INDEXES) {
|
||||
xmlGlobalState *globalval = NULL;
|
||||
xmlGlobalStateCleanupHelperParams * p =
|
||||
(xmlGlobalStateCleanupHelperParams*)TlsGetValue(globalkey);
|
||||
globalval = (xmlGlobalState *)(p ? p->memory : NULL);
|
||||
if (globalval) {
|
||||
xmlFreeGlobalState(globalval);
|
||||
TlsSetValue(globalkey,NULL);
|
||||
}
|
||||
if (p)
|
||||
{
|
||||
EnterCriticalSection(&cleanup_helpers_cs);
|
||||
if (p == cleanup_helpers_head)
|
||||
cleanup_helpers_head = p->next;
|
||||
else
|
||||
p->prev->next = p->next;
|
||||
if (p->next != NULL)
|
||||
p->next->prev = p->prev;
|
||||
LeaveCriticalSection(&cleanup_helpers_cs);
|
||||
free(p);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
#define bottom_threads
|
||||
#include "elfgcchack.h"
|
||||
7123
Extras/LibXML/tree.c
Normal file
7123
Extras/LibXML/tree.c
Normal file
File diff suppressed because it is too large
Load Diff
2278
Extras/LibXML/uri.c
Normal file
2278
Extras/LibXML/uri.c
Normal file
File diff suppressed because it is too large
Load Diff
6934
Extras/LibXML/valid.c
Normal file
6934
Extras/LibXML/valid.c
Normal file
File diff suppressed because it is too large
Load Diff
2472
Extras/LibXML/xinclude.c
Normal file
2472
Extras/LibXML/xinclude.c
Normal file
File diff suppressed because it is too large
Load Diff
183
Extras/LibXML/xlink.c
Normal file
183
Extras/LibXML/xlink.c
Normal file
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
* xlink.c : implementation of the hyperlinks detection module
|
||||
* This version supports both XML XLinks and HTML simple links
|
||||
*
|
||||
* See Copyright for the status of this software.
|
||||
*
|
||||
* daniel@veillard.com
|
||||
*/
|
||||
|
||||
|
||||
#define IN_LIBXML
|
||||
#include "libxml.h"
|
||||
|
||||
#ifdef LIBXML_XPTR_ENABLED
|
||||
#include <string.h> /* for memset() only */
|
||||
#ifdef HAVE_CTYPE_H
|
||||
#include <ctype.h>
|
||||
#endif
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYS_STAT_H
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifdef HAVE_ZLIB_H
|
||||
#include <zlib.h>
|
||||
#endif
|
||||
|
||||
#include <libxml/xmlmemory.h>
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/valid.h>
|
||||
#include <libxml/xlink.h>
|
||||
#include <libxml/globals.h>
|
||||
|
||||
#define XLINK_NAMESPACE (BAD_CAST "http://www.w3.org/1999/xlink/namespace/")
|
||||
#define XHTML_NAMESPACE (BAD_CAST "http://www.w3.org/1999/xhtml/")
|
||||
|
||||
/****************************************************************
|
||||
* *
|
||||
* Default setting and related functions *
|
||||
* *
|
||||
****************************************************************/
|
||||
|
||||
static xlinkHandlerPtr xlinkDefaultHandler = NULL;
|
||||
static xlinkNodeDetectFunc xlinkDefaultDetect = NULL;
|
||||
|
||||
/**
|
||||
* xlinkGetDefaultHandler:
|
||||
*
|
||||
* Get the default xlink handler.
|
||||
*
|
||||
* Returns the current xlinkHandlerPtr value.
|
||||
*/
|
||||
xlinkHandlerPtr
|
||||
xlinkGetDefaultHandler(void) {
|
||||
return(xlinkDefaultHandler);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* xlinkSetDefaultHandler:
|
||||
* @handler: the new value for the xlink handler block
|
||||
*
|
||||
* Set the default xlink handlers
|
||||
*/
|
||||
void
|
||||
xlinkSetDefaultHandler(xlinkHandlerPtr handler) {
|
||||
xlinkDefaultHandler = handler;
|
||||
}
|
||||
|
||||
/**
|
||||
* xlinkGetDefaultDetect:
|
||||
*
|
||||
* Get the default xlink detection routine
|
||||
*
|
||||
* Returns the current function or NULL;
|
||||
*/
|
||||
xlinkNodeDetectFunc
|
||||
xlinkGetDefaultDetect (void) {
|
||||
return(xlinkDefaultDetect);
|
||||
}
|
||||
|
||||
/**
|
||||
* xlinkSetDefaultDetect:
|
||||
* @func: pointer to the new detection routine.
|
||||
*
|
||||
* Set the default xlink detection routine
|
||||
*/
|
||||
void
|
||||
xlinkSetDefaultDetect (xlinkNodeDetectFunc func) {
|
||||
xlinkDefaultDetect = func;
|
||||
}
|
||||
|
||||
/****************************************************************
|
||||
* *
|
||||
* The detection routines *
|
||||
* *
|
||||
****************************************************************/
|
||||
|
||||
|
||||
/**
|
||||
* xlinkIsLink:
|
||||
* @doc: the document containing the node
|
||||
* @node: the node pointer itself
|
||||
*
|
||||
* Check whether the given node carries the attributes needed
|
||||
* to be a link element (or is one of the linking elements issued
|
||||
* from the (X)HTML DtDs).
|
||||
* This routine don't try to do full checking of the link validity
|
||||
* but tries to detect and return the appropriate link type.
|
||||
*
|
||||
* Returns the xlinkType of the node (XLINK_TYPE_NONE if there is no
|
||||
* link detected.
|
||||
*/
|
||||
xlinkType
|
||||
xlinkIsLink (xmlDocPtr doc, xmlNodePtr node) {
|
||||
xmlChar *type = NULL, *role = NULL;
|
||||
xlinkType ret = XLINK_TYPE_NONE;
|
||||
|
||||
if (node == NULL) return(XLINK_TYPE_NONE);
|
||||
if (doc == NULL) doc = node->doc;
|
||||
if ((doc != NULL) && (doc->type == XML_HTML_DOCUMENT_NODE)) {
|
||||
/*
|
||||
* This is an HTML document.
|
||||
*/
|
||||
} else if ((node->ns != NULL) &&
|
||||
(xmlStrEqual(node->ns->href, XHTML_NAMESPACE))) {
|
||||
/*
|
||||
* !!!! We really need an IS_XHTML_ELEMENT function from HTMLtree.h @@@
|
||||
*/
|
||||
/*
|
||||
* This is an XHTML element within an XML document
|
||||
* Check whether it's one of the element able to carry links
|
||||
* and in that case if it holds the attributes.
|
||||
*/
|
||||
}
|
||||
|
||||
/*
|
||||
* We don't prevent a-priori having XML Linking constructs on
|
||||
* XHTML elements
|
||||
*/
|
||||
type = xmlGetNsProp(node, BAD_CAST"type", XLINK_NAMESPACE);
|
||||
if (type != NULL) {
|
||||
if (xmlStrEqual(type, BAD_CAST "simple")) {
|
||||
ret = XLINK_TYPE_SIMPLE;
|
||||
} if (xmlStrEqual(type, BAD_CAST "extended")) {
|
||||
role = xmlGetNsProp(node, BAD_CAST "role", XLINK_NAMESPACE);
|
||||
if (role != NULL) {
|
||||
xmlNsPtr xlink;
|
||||
xlink = xmlSearchNs(doc, node, XLINK_NAMESPACE);
|
||||
if (xlink == NULL) {
|
||||
/* Humm, fallback method */
|
||||
if (xmlStrEqual(role, BAD_CAST"xlink:external-linkset"))
|
||||
ret = XLINK_TYPE_EXTENDED_SET;
|
||||
} else {
|
||||
xmlChar buf[200];
|
||||
snprintf((char *) buf, sizeof(buf), "%s:external-linkset",
|
||||
(char *) xlink->prefix);
|
||||
buf[sizeof(buf) - 1] = 0;
|
||||
if (xmlStrEqual(role, buf))
|
||||
ret = XLINK_TYPE_EXTENDED_SET;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
ret = XLINK_TYPE_EXTENDED;
|
||||
}
|
||||
}
|
||||
|
||||
if (type != NULL) xmlFree(type);
|
||||
if (role != NULL) xmlFree(role);
|
||||
return(ret);
|
||||
}
|
||||
#endif /* LIBXML_XPTR_ENABLED */
|
||||
#define bottom_xlink
|
||||
#include "elfgcchack.h"
|
||||
3692
Extras/LibXML/xmlIO.c
Normal file
3692
Extras/LibXML/xmlIO.c
Normal file
File diff suppressed because it is too large
Load Diff
614
Extras/LibXML/xmlcatalog.c
Normal file
614
Extras/LibXML/xmlcatalog.c
Normal file
@@ -0,0 +1,614 @@
|
||||
/*
|
||||
* xmlcatalog.c : a small utility program to handle XML catalogs
|
||||
*
|
||||
* See Copyright for the status of this software.
|
||||
*
|
||||
* daniel@veillard.com
|
||||
*/
|
||||
|
||||
#include "libxml.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIBREADLINE
|
||||
#include <readline/readline.h>
|
||||
#ifdef HAVE_LIBHISTORY
|
||||
#include <readline/history.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <libxml/xmlmemory.h>
|
||||
#include <libxml/uri.h>
|
||||
#include <libxml/catalog.h>
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/globals.h>
|
||||
|
||||
#if defined(LIBXML_CATALOG_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
|
||||
static int shell = 0;
|
||||
static int sgml = 0;
|
||||
static int noout = 0;
|
||||
static int create = 0;
|
||||
static int add = 0;
|
||||
static int del = 0;
|
||||
static int convert = 0;
|
||||
static int no_super_update = 0;
|
||||
static int verbose = 0;
|
||||
static char *filename = NULL;
|
||||
|
||||
|
||||
#ifndef XML_SGML_DEFAULT_CATALOG
|
||||
#define XML_SGML_DEFAULT_CATALOG "/etc/sgml/catalog"
|
||||
#endif
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Shell Interface *
|
||||
* *
|
||||
************************************************************************/
|
||||
/**
|
||||
* xmlShellReadline:
|
||||
* @prompt: the prompt value
|
||||
*
|
||||
* Read a string
|
||||
*
|
||||
* Returns a pointer to it or NULL on EOF the caller is expected to
|
||||
* free the returned string.
|
||||
*/
|
||||
static char *
|
||||
xmlShellReadline(const char *prompt) {
|
||||
#ifdef HAVE_LIBREADLINE
|
||||
char *line_read;
|
||||
|
||||
/* Get a line from the user. */
|
||||
line_read = readline (prompt);
|
||||
|
||||
/* If the line has any text in it, save it on the history. */
|
||||
if (line_read && *line_read)
|
||||
add_history (line_read);
|
||||
|
||||
return (line_read);
|
||||
#else
|
||||
char line_read[501];
|
||||
char *ret;
|
||||
int len;
|
||||
|
||||
if (prompt != NULL)
|
||||
fprintf(stdout, "%s", prompt);
|
||||
if (!fgets(line_read, 500, stdin))
|
||||
return(NULL);
|
||||
line_read[500] = 0;
|
||||
len = strlen(line_read);
|
||||
ret = (char *) malloc(len + 1);
|
||||
if (ret != NULL) {
|
||||
memcpy (ret, line_read, len + 1);
|
||||
}
|
||||
return(ret);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void usershell(void) {
|
||||
char *cmdline = NULL, *cur;
|
||||
int nbargs;
|
||||
char command[100];
|
||||
char arg[400];
|
||||
char *argv[20];
|
||||
int i, ret;
|
||||
xmlChar *ans;
|
||||
|
||||
while (1) {
|
||||
cmdline = xmlShellReadline("> ");
|
||||
if (cmdline == NULL)
|
||||
return;
|
||||
|
||||
/*
|
||||
* Parse the command itself
|
||||
*/
|
||||
cur = cmdline;
|
||||
nbargs = 0;
|
||||
while ((*cur == ' ') || (*cur == '\t')) cur++;
|
||||
i = 0;
|
||||
while ((*cur != ' ') && (*cur != '\t') &&
|
||||
(*cur != '\n') && (*cur != '\r')) {
|
||||
if (*cur == 0)
|
||||
break;
|
||||
command[i++] = *cur++;
|
||||
}
|
||||
command[i] = 0;
|
||||
if (i == 0) continue;
|
||||
nbargs++;
|
||||
|
||||
/*
|
||||
* Parse the argument string
|
||||
*/
|
||||
memset(arg, 0, sizeof(arg));
|
||||
while ((*cur == ' ') || (*cur == '\t')) cur++;
|
||||
i = 0;
|
||||
while ((*cur != '\n') && (*cur != '\r') && (*cur != 0)) {
|
||||
if (*cur == 0)
|
||||
break;
|
||||
arg[i++] = *cur++;
|
||||
}
|
||||
arg[i] = 0;
|
||||
if (i != 0)
|
||||
nbargs++;
|
||||
|
||||
/*
|
||||
* Parse the arguments
|
||||
*/
|
||||
i = 0;
|
||||
nbargs = 0;
|
||||
cur = arg;
|
||||
memset(argv, 0, sizeof(argv));
|
||||
while (*cur != 0) {
|
||||
while ((*cur == ' ') || (*cur == '\t')) cur++;
|
||||
if (*cur == '\'') {
|
||||
cur++;
|
||||
argv[i] = cur;
|
||||
while ((*cur != 0) && (*cur != '\'')) cur++;
|
||||
if (*cur == '\'') {
|
||||
*cur = 0;
|
||||
nbargs++;
|
||||
i++;
|
||||
cur++;
|
||||
}
|
||||
} else if (*cur == '"') {
|
||||
cur++;
|
||||
argv[i] = cur;
|
||||
while ((*cur != 0) && (*cur != '"')) cur++;
|
||||
if (*cur == '"') {
|
||||
*cur = 0;
|
||||
nbargs++;
|
||||
i++;
|
||||
cur++;
|
||||
}
|
||||
} else {
|
||||
argv[i] = cur;
|
||||
while ((*cur != 0) && (*cur != ' ') && (*cur != '\t'))
|
||||
cur++;
|
||||
*cur = 0;
|
||||
nbargs++;
|
||||
i++;
|
||||
cur++;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* start interpreting the command
|
||||
*/
|
||||
if (!strcmp(command, "exit"))
|
||||
break;
|
||||
if (!strcmp(command, "quit"))
|
||||
break;
|
||||
if (!strcmp(command, "bye"))
|
||||
break;
|
||||
if (!strcmp(command, "public")) {
|
||||
if (nbargs != 1) {
|
||||
printf("public requires 1 arguments\n");
|
||||
} else {
|
||||
ans = xmlCatalogResolvePublic((const xmlChar *) argv[0]);
|
||||
if (ans == NULL) {
|
||||
printf("No entry for PUBLIC %s\n", argv[0]);
|
||||
} else {
|
||||
printf("%s\n", (char *) ans);
|
||||
xmlFree(ans);
|
||||
}
|
||||
}
|
||||
} else if (!strcmp(command, "system")) {
|
||||
if (nbargs != 1) {
|
||||
printf("system requires 1 arguments\n");
|
||||
} else {
|
||||
ans = xmlCatalogResolveSystem((const xmlChar *) argv[0]);
|
||||
if (ans == NULL) {
|
||||
printf("No entry for SYSTEM %s\n", argv[0]);
|
||||
} else {
|
||||
printf("%s\n", (char *) ans);
|
||||
xmlFree(ans);
|
||||
}
|
||||
}
|
||||
} else if (!strcmp(command, "add")) {
|
||||
if (sgml) {
|
||||
if ((nbargs != 3) && (nbargs != 2)) {
|
||||
printf("add requires 2 or 3 arguments\n");
|
||||
} else {
|
||||
if (argv[2] == NULL)
|
||||
ret = xmlCatalogAdd(BAD_CAST argv[0], NULL,
|
||||
BAD_CAST argv[1]);
|
||||
else
|
||||
ret = xmlCatalogAdd(BAD_CAST argv[0], BAD_CAST argv[1],
|
||||
BAD_CAST argv[2]);
|
||||
if (ret != 0)
|
||||
printf("add command failed\n");
|
||||
}
|
||||
} else {
|
||||
if ((nbargs != 3) && (nbargs != 2)) {
|
||||
printf("add requires 2 or 3 arguments\n");
|
||||
} else {
|
||||
if (argv[2] == NULL)
|
||||
ret = xmlCatalogAdd(BAD_CAST argv[0], NULL,
|
||||
BAD_CAST argv[1]);
|
||||
else
|
||||
ret = xmlCatalogAdd(BAD_CAST argv[0], BAD_CAST argv[1],
|
||||
BAD_CAST argv[2]);
|
||||
if (ret != 0)
|
||||
printf("add command failed\n");
|
||||
}
|
||||
}
|
||||
} else if (!strcmp(command, "del")) {
|
||||
if (nbargs != 1) {
|
||||
printf("del requires 1\n");
|
||||
} else {
|
||||
ret = xmlCatalogRemove(BAD_CAST argv[0]);
|
||||
if (ret <= 0)
|
||||
printf("del command failed\n");
|
||||
|
||||
}
|
||||
} else if (!strcmp(command, "resolve")) {
|
||||
if (nbargs != 2) {
|
||||
printf("resolve requires 2 arguments\n");
|
||||
} else {
|
||||
ans = xmlCatalogResolve(BAD_CAST argv[0],
|
||||
BAD_CAST argv[1]);
|
||||
if (ans == NULL) {
|
||||
printf("Resolver failed to find an answer\n");
|
||||
} else {
|
||||
printf("%s\n", (char *) ans);
|
||||
xmlFree(ans);
|
||||
}
|
||||
}
|
||||
} else if (!strcmp(command, "dump")) {
|
||||
if (nbargs != 0) {
|
||||
printf("dump has no arguments\n");
|
||||
} else {
|
||||
xmlCatalogDump(stdout);
|
||||
}
|
||||
} else if (!strcmp(command, "debug")) {
|
||||
if (nbargs != 0) {
|
||||
printf("debug has no arguments\n");
|
||||
} else {
|
||||
verbose++;
|
||||
xmlCatalogSetDebug(verbose);
|
||||
}
|
||||
} else if (!strcmp(command, "quiet")) {
|
||||
if (nbargs != 0) {
|
||||
printf("quiet has no arguments\n");
|
||||
} else {
|
||||
if (verbose > 0)
|
||||
verbose--;
|
||||
xmlCatalogSetDebug(verbose);
|
||||
}
|
||||
} else {
|
||||
if (strcmp(command, "help")) {
|
||||
printf("Unrecognized command %s\n", command);
|
||||
}
|
||||
printf("Commands available:\n");
|
||||
printf("\tpublic PublicID: make a PUBLIC identifier lookup\n");
|
||||
printf("\tsystem SystemID: make a SYSTEM identifier lookup\n");
|
||||
printf("\tresolve PublicID SystemID: do a full resolver lookup\n");
|
||||
printf("\tadd 'type' 'orig' 'replace' : add an entry\n");
|
||||
printf("\tdel 'values' : remove values\n");
|
||||
printf("\tdump: print the current catalog state\n");
|
||||
printf("\tdebug: increase the verbosity level\n");
|
||||
printf("\tquiet: decrease the verbosity level\n");
|
||||
printf("\texit: quit the shell\n");
|
||||
}
|
||||
free(cmdline); /* not xmlFree here ! */
|
||||
}
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Main *
|
||||
* *
|
||||
************************************************************************/
|
||||
static void usage(const char *name) {
|
||||
/* split into 2 printf's to avoid overly long string (gcc warning) */
|
||||
printf("\
|
||||
Usage : %s [options] catalogfile entities...\n\
|
||||
\tParse the catalog file and query it for the entities\n\
|
||||
\t--sgml : handle SGML Super catalogs for --add and --del\n\
|
||||
\t--shell : run a shell allowing interactive queries\n\
|
||||
\t--create : create a new catalog\n\
|
||||
\t--add 'type' 'orig' 'replace' : add an XML entry\n\
|
||||
\t--add 'entry' : add an SGML entry\n", name);
|
||||
printf("\
|
||||
\t--del 'values' : remove values\n\
|
||||
\t--noout: avoid dumping the result on stdout\n\
|
||||
\t used with --add or --del, it saves the catalog changes\n\
|
||||
\t and with --sgml it automatically updates the super catalog\n\
|
||||
\t--no-super-update: do not update the SGML super catalog\n\
|
||||
\t-v --verbose : provide debug informations\n");
|
||||
}
|
||||
int main(int argc, char **argv) {
|
||||
int i;
|
||||
int ret;
|
||||
int exit_value = 0;
|
||||
|
||||
|
||||
if (argc <= 1) {
|
||||
usage(argv[0]);
|
||||
return(1);
|
||||
}
|
||||
|
||||
LIBXML_TEST_VERSION
|
||||
for (i = 1; i < argc ; i++) {
|
||||
if (!strcmp(argv[i], "-"))
|
||||
break;
|
||||
|
||||
if (argv[i][0] != '-')
|
||||
break;
|
||||
if ((!strcmp(argv[i], "-verbose")) ||
|
||||
(!strcmp(argv[i], "-v")) ||
|
||||
(!strcmp(argv[i], "--verbose"))) {
|
||||
verbose++;
|
||||
xmlCatalogSetDebug(verbose);
|
||||
} else if ((!strcmp(argv[i], "-noout")) ||
|
||||
(!strcmp(argv[i], "--noout"))) {
|
||||
noout = 1;
|
||||
} else if ((!strcmp(argv[i], "-shell")) ||
|
||||
(!strcmp(argv[i], "--shell"))) {
|
||||
shell++;
|
||||
noout = 1;
|
||||
} else if ((!strcmp(argv[i], "-sgml")) ||
|
||||
(!strcmp(argv[i], "--sgml"))) {
|
||||
sgml++;
|
||||
} else if ((!strcmp(argv[i], "-create")) ||
|
||||
(!strcmp(argv[i], "--create"))) {
|
||||
create++;
|
||||
} else if ((!strcmp(argv[i], "-convert")) ||
|
||||
(!strcmp(argv[i], "--convert"))) {
|
||||
convert++;
|
||||
} else if ((!strcmp(argv[i], "-no-super-update")) ||
|
||||
(!strcmp(argv[i], "--no-super-update"))) {
|
||||
no_super_update++;
|
||||
} else if ((!strcmp(argv[i], "-add")) ||
|
||||
(!strcmp(argv[i], "--add"))) {
|
||||
if (sgml)
|
||||
i += 2;
|
||||
else
|
||||
i += 3;
|
||||
add++;
|
||||
} else if ((!strcmp(argv[i], "-del")) ||
|
||||
(!strcmp(argv[i], "--del"))) {
|
||||
i += 1;
|
||||
del++;
|
||||
} else {
|
||||
fprintf(stderr, "Unknown option %s\n", argv[i]);
|
||||
usage(argv[0]);
|
||||
return(1);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if ((!strcmp(argv[i], "-add")) ||
|
||||
(!strcmp(argv[i], "--add"))) {
|
||||
if (sgml)
|
||||
i += 2;
|
||||
else
|
||||
i += 3;
|
||||
continue;
|
||||
} else if ((!strcmp(argv[i], "-del")) ||
|
||||
(!strcmp(argv[i], "--del"))) {
|
||||
i += 1;
|
||||
|
||||
/* No catalog entry specified */
|
||||
if (i == argc || (sgml && i + 1 == argc)) {
|
||||
fprintf(stderr, "No catalog entry specified to remove from\n");
|
||||
usage (argv[0]);
|
||||
return(1);
|
||||
}
|
||||
|
||||
continue;
|
||||
} else if (argv[i][0] == '-')
|
||||
continue;
|
||||
filename = argv[i];
|
||||
ret = xmlLoadCatalog(argv[i]);
|
||||
if ((ret < 0) && (create)) {
|
||||
xmlCatalogAdd(BAD_CAST "catalog", BAD_CAST argv[i], NULL);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (convert)
|
||||
ret = xmlCatalogConvert();
|
||||
|
||||
if ((add) || (del)) {
|
||||
for (i = 1; i < argc ; i++) {
|
||||
if (!strcmp(argv[i], "-"))
|
||||
break;
|
||||
|
||||
if (argv[i][0] != '-')
|
||||
continue;
|
||||
if (strcmp(argv[i], "-add") && strcmp(argv[i], "--add") &&
|
||||
strcmp(argv[i], "-del") && strcmp(argv[i], "--del"))
|
||||
continue;
|
||||
|
||||
if (sgml) {
|
||||
/*
|
||||
* Maintenance of SGML catalogs.
|
||||
*/
|
||||
xmlCatalogPtr catal = NULL;
|
||||
xmlCatalogPtr super = NULL;
|
||||
|
||||
catal = xmlLoadSGMLSuperCatalog(argv[i + 1]);
|
||||
|
||||
if ((!strcmp(argv[i], "-add")) ||
|
||||
(!strcmp(argv[i], "--add"))) {
|
||||
if (catal == NULL)
|
||||
catal = xmlNewCatalog(1);
|
||||
xmlACatalogAdd(catal, BAD_CAST "CATALOG",
|
||||
BAD_CAST argv[i + 2], NULL);
|
||||
|
||||
if (!no_super_update) {
|
||||
super = xmlLoadSGMLSuperCatalog(XML_SGML_DEFAULT_CATALOG);
|
||||
if (super == NULL)
|
||||
super = xmlNewCatalog(1);
|
||||
|
||||
xmlACatalogAdd(super, BAD_CAST "CATALOG",
|
||||
BAD_CAST argv[i + 1], NULL);
|
||||
}
|
||||
} else {
|
||||
if (catal != NULL)
|
||||
ret = xmlACatalogRemove(catal, BAD_CAST argv[i + 2]);
|
||||
else
|
||||
ret = -1;
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Failed to remove entry from %s\n",
|
||||
argv[i + 1]);
|
||||
exit_value = 1;
|
||||
}
|
||||
if ((!no_super_update) && (noout) && (catal != NULL) &&
|
||||
(xmlCatalogIsEmpty(catal))) {
|
||||
super = xmlLoadSGMLSuperCatalog(
|
||||
XML_SGML_DEFAULT_CATALOG);
|
||||
if (super != NULL) {
|
||||
ret = xmlACatalogRemove(super,
|
||||
BAD_CAST argv[i + 1]);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr,
|
||||
"Failed to remove entry from %s\n",
|
||||
XML_SGML_DEFAULT_CATALOG);
|
||||
exit_value = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (noout) {
|
||||
FILE *out;
|
||||
|
||||
if (xmlCatalogIsEmpty(catal)) {
|
||||
remove(argv[i + 1]);
|
||||
} else {
|
||||
out = fopen(argv[i + 1], "w");
|
||||
if (out == NULL) {
|
||||
fprintf(stderr, "could not open %s for saving\n",
|
||||
argv[i + 1]);
|
||||
exit_value = 2;
|
||||
noout = 0;
|
||||
} else {
|
||||
xmlACatalogDump(catal, out);
|
||||
fclose(out);
|
||||
}
|
||||
}
|
||||
if (!no_super_update && super != NULL) {
|
||||
if (xmlCatalogIsEmpty(super)) {
|
||||
remove(XML_SGML_DEFAULT_CATALOG);
|
||||
} else {
|
||||
out = fopen(XML_SGML_DEFAULT_CATALOG, "w");
|
||||
if (out == NULL) {
|
||||
fprintf(stderr,
|
||||
"could not open %s for saving\n",
|
||||
XML_SGML_DEFAULT_CATALOG);
|
||||
exit_value = 2;
|
||||
noout = 0;
|
||||
} else {
|
||||
|
||||
xmlACatalogDump(super, out);
|
||||
fclose(out);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
xmlACatalogDump(catal, stdout);
|
||||
}
|
||||
i += 2;
|
||||
} else {
|
||||
if ((!strcmp(argv[i], "-add")) ||
|
||||
(!strcmp(argv[i], "--add"))) {
|
||||
if ((argv[i + 3] == NULL) || (argv[i + 3][0] == 0))
|
||||
ret = xmlCatalogAdd(BAD_CAST argv[i + 1], NULL,
|
||||
BAD_CAST argv[i + 2]);
|
||||
else
|
||||
ret = xmlCatalogAdd(BAD_CAST argv[i + 1],
|
||||
BAD_CAST argv[i + 2],
|
||||
BAD_CAST argv[i + 3]);
|
||||
if (ret != 0) {
|
||||
printf("add command failed\n");
|
||||
exit_value = 3;
|
||||
}
|
||||
i += 3;
|
||||
} else if ((!strcmp(argv[i], "-del")) ||
|
||||
(!strcmp(argv[i], "--del"))) {
|
||||
ret = xmlCatalogRemove(BAD_CAST argv[i + 1]);
|
||||
if (ret < 0) {
|
||||
fprintf(stderr, "Failed to remove entry %s\n",
|
||||
argv[i + 1]);
|
||||
exit_value = 1;
|
||||
}
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else if (shell) {
|
||||
usershell();
|
||||
} else {
|
||||
for (i++; i < argc; i++) {
|
||||
xmlURIPtr uri;
|
||||
xmlChar *ans;
|
||||
|
||||
uri = xmlParseURI(argv[i]);
|
||||
if (uri == NULL) {
|
||||
ans = xmlCatalogResolvePublic((const xmlChar *) argv[i]);
|
||||
if (ans == NULL) {
|
||||
printf("No entry for PUBLIC %s\n", argv[i]);
|
||||
exit_value = 4;
|
||||
} else {
|
||||
printf("%s\n", (char *) ans);
|
||||
xmlFree(ans);
|
||||
}
|
||||
} else {
|
||||
xmlFreeURI(uri);
|
||||
ans = xmlCatalogResolveSystem((const xmlChar *) argv[i]);
|
||||
if (ans == NULL) {
|
||||
printf("No entry for SYSTEM %s\n", argv[i]);
|
||||
ans = xmlCatalogResolveURI ((const xmlChar *) argv[i]);
|
||||
if (ans == NULL) {
|
||||
printf ("No entry for URI %s\n", argv[i]);
|
||||
exit_value = 4;
|
||||
} else {
|
||||
printf("%s\n", (char *) ans);
|
||||
xmlFree (ans);
|
||||
}
|
||||
} else {
|
||||
printf("%s\n", (char *) ans);
|
||||
xmlFree(ans);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((!sgml) && ((add) || (del) || (create) || (convert))) {
|
||||
if (noout && filename && *filename) {
|
||||
FILE *out;
|
||||
|
||||
out = fopen(filename, "w");
|
||||
if (out == NULL) {
|
||||
fprintf(stderr, "could not open %s for saving\n", filename);
|
||||
exit_value = 2;
|
||||
noout = 0;
|
||||
} else {
|
||||
xmlCatalogDump(out);
|
||||
}
|
||||
} else {
|
||||
xmlCatalogDump(stdout);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Cleanup and check for memory leaks
|
||||
*/
|
||||
xmlCleanupParser();
|
||||
xmlMemoryDump();
|
||||
return(exit_value);
|
||||
}
|
||||
#else
|
||||
int main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED) {
|
||||
fprintf(stderr, "libxml was not compiled with catalog and output support\n");
|
||||
return(1);
|
||||
}
|
||||
#endif
|
||||
1025
Extras/LibXML/xmlmemory.c
Normal file
1025
Extras/LibXML/xmlmemory.c
Normal file
File diff suppressed because it is too large
Load Diff
444
Extras/LibXML/xmlmodule.c
Normal file
444
Extras/LibXML/xmlmodule.c
Normal file
@@ -0,0 +1,444 @@
|
||||
/*
|
||||
* xmlmodule.c : basic API for dynamic module loading added 2.6.17
|
||||
*
|
||||
* See Copyright for the status of this software.
|
||||
*
|
||||
* joelwreed@comcast.net
|
||||
*
|
||||
* http://www.fortran-2000.com/ArnaudRecipes/sharedlib.html
|
||||
*/
|
||||
|
||||
#define IN_LIBXML
|
||||
#include "libxml.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <libxml/xmlmemory.h>
|
||||
#include <libxml/xmlerror.h>
|
||||
#include <libxml/xmlmodule.h>
|
||||
#include <libxml/globals.h>
|
||||
|
||||
#ifdef LIBXML_MODULES_ENABLED
|
||||
|
||||
struct _xmlModule {
|
||||
unsigned char *name;
|
||||
void *handle;
|
||||
};
|
||||
|
||||
static void *xmlModulePlatformOpen(const char *name);
|
||||
static int xmlModulePlatformClose(void *handle);
|
||||
static int xmlModulePlatformSymbol(void *handle, const char *name, void **result);
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* module memory error handler *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
* xmlModuleErrMemory:
|
||||
* @extra: extra information
|
||||
*
|
||||
* Handle an out of memory condition
|
||||
*/
|
||||
static void
|
||||
xmlModuleErrMemory(xmlModulePtr module, const char *extra)
|
||||
{
|
||||
const char *name = NULL;
|
||||
|
||||
if (module != NULL) {
|
||||
name = (const char *) module->name;
|
||||
}
|
||||
|
||||
__xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_MODULE,
|
||||
XML_ERR_NO_MEMORY, XML_ERR_FATAL, NULL, 0, extra,
|
||||
name, NULL, 0, 0,
|
||||
"Memory allocation failed : %s\n", extra);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlModuleOpen:
|
||||
* @name: the module name
|
||||
* @options: a set of xmlModuleOption
|
||||
*
|
||||
* Opens a module/shared library given its name or path
|
||||
* TODO: options are not yet implemented.
|
||||
*
|
||||
* Returns a handle for the module or NULL in case of error
|
||||
*/
|
||||
xmlModulePtr
|
||||
xmlModuleOpen(const char *name, int options ATTRIBUTE_UNUSED)
|
||||
{
|
||||
xmlModulePtr module;
|
||||
|
||||
module = (xmlModulePtr) xmlMalloc(sizeof(xmlModule));
|
||||
if (module == NULL) {
|
||||
xmlModuleErrMemory(NULL, "creating module");
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
memset(module, 0, sizeof(xmlModule));
|
||||
|
||||
module->handle = xmlModulePlatformOpen(name);
|
||||
|
||||
if (module->handle == NULL) {
|
||||
xmlFree(module);
|
||||
__xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_MODULE,
|
||||
XML_MODULE_OPEN, XML_ERR_FATAL, NULL, 0, 0,
|
||||
name, NULL, 0, 0, "failed to open %s\n", name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
module->name = xmlStrdup((const xmlChar *) name);
|
||||
return (module);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlModuleSymbol:
|
||||
* @module: the module
|
||||
* @name: the name of the symbol
|
||||
* @symbol: the resulting symbol address
|
||||
*
|
||||
* Lookup for a symbol address in the given module
|
||||
*
|
||||
* Returns 0 if the symbol was found, or -1 in case of error
|
||||
*/
|
||||
int
|
||||
xmlModuleSymbol(xmlModulePtr module, const char *name, void **symbol)
|
||||
{
|
||||
int rc = -1;
|
||||
|
||||
if ((NULL == module) || (symbol == NULL)) {
|
||||
__xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_MODULE,
|
||||
XML_MODULE_OPEN, XML_ERR_FATAL, NULL, 0, 0,
|
||||
NULL, NULL, 0, 0, "null parameter\n");
|
||||
return rc;
|
||||
}
|
||||
|
||||
rc = xmlModulePlatformSymbol(module->handle, name, symbol);
|
||||
|
||||
if (rc == -1) {
|
||||
__xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_MODULE,
|
||||
XML_MODULE_OPEN, XML_ERR_FATAL, NULL, 0, 0,
|
||||
name, NULL, 0, 0,
|
||||
"failed to find symbol: %s\n",
|
||||
(name == NULL ? "NULL" : name));
|
||||
return rc;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlModuleClose:
|
||||
* @module: the module handle
|
||||
*
|
||||
* The close operations unload the associated module and free the
|
||||
* data associated to the module.
|
||||
*
|
||||
* Returns 0 in case of success, -1 in case of argument error and -2
|
||||
* if the module could not be closed/unloaded.
|
||||
*/
|
||||
int
|
||||
xmlModuleClose(xmlModulePtr module)
|
||||
{
|
||||
int rc;
|
||||
|
||||
if (NULL == module) {
|
||||
__xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_MODULE,
|
||||
XML_MODULE_CLOSE, XML_ERR_FATAL, NULL, 0, 0,
|
||||
NULL, NULL, 0, 0, "null module pointer\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
rc = xmlModulePlatformClose(module->handle);
|
||||
|
||||
if (rc != 0) {
|
||||
__xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_MODULE,
|
||||
XML_MODULE_CLOSE, XML_ERR_FATAL, NULL, 0, 0,
|
||||
(const char *) module->name, NULL, 0, 0,
|
||||
"failed to close: %s\n", module->name);
|
||||
return -2;
|
||||
}
|
||||
|
||||
rc = xmlModuleFree(module);
|
||||
return (rc);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlModuleFree:
|
||||
* @module: the module handle
|
||||
*
|
||||
* The free operations free the data associated to the module
|
||||
* but does not unload the associated shared library which may still
|
||||
* be in use.
|
||||
*
|
||||
* Returns 0 in case of success, -1 in case of argument error
|
||||
*/
|
||||
int
|
||||
xmlModuleFree(xmlModulePtr module)
|
||||
{
|
||||
if (NULL == module) {
|
||||
__xmlRaiseError(NULL, NULL, NULL, NULL, NULL, XML_FROM_MODULE,
|
||||
XML_MODULE_CLOSE, XML_ERR_FATAL, NULL, 0, 0,
|
||||
NULL, NULL, 0, 0, "null module pointer\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
xmlFree(module->name);
|
||||
xmlFree(module);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
#ifdef HAVE_DLOPEN
|
||||
#ifdef HAVE_DLFCN_H
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
/**
|
||||
* xmlModulePlatformOpen:
|
||||
* @name: path to the module
|
||||
*
|
||||
* returns a handle on success, and zero on error.
|
||||
*/
|
||||
|
||||
static void *
|
||||
xmlModulePlatformOpen(const char *name)
|
||||
{
|
||||
return dlopen(name, RTLD_GLOBAL | RTLD_NOW);
|
||||
}
|
||||
|
||||
/*
|
||||
* xmlModulePlatformClose:
|
||||
* @handle: handle to the module
|
||||
*
|
||||
* returns 0 on success, and non-zero on error.
|
||||
*/
|
||||
|
||||
static int
|
||||
xmlModulePlatformClose(void *handle)
|
||||
{
|
||||
return dlclose(handle);
|
||||
}
|
||||
|
||||
/*
|
||||
* xmlModulePlatformSymbol:
|
||||
* http://www.opengroup.org/onlinepubs/009695399/functions/dlsym.html
|
||||
* returns 0 on success and the loaded symbol in result, and -1 on error.
|
||||
*/
|
||||
|
||||
static int
|
||||
xmlModulePlatformSymbol(void *handle, const char *name, void **symbol)
|
||||
{
|
||||
*symbol = dlsym(handle, name);
|
||||
if (dlerror() != NULL) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else /* ! HAVE_DLOPEN */
|
||||
|
||||
#ifdef HAVE_SHLLOAD /* HAVE_SHLLOAD */
|
||||
#ifdef HAVE_DL_H
|
||||
#include <dl.h>
|
||||
#endif
|
||||
/*
|
||||
* xmlModulePlatformOpen:
|
||||
* returns a handle on success, and zero on error.
|
||||
*/
|
||||
|
||||
static void *
|
||||
xmlModulePlatformOpen(const char *name)
|
||||
{
|
||||
return shl_load(name, BIND_IMMEDIATE, 0L);
|
||||
}
|
||||
|
||||
/*
|
||||
* xmlModulePlatformClose:
|
||||
* returns 0 on success, and non-zero on error.
|
||||
*/
|
||||
|
||||
static int
|
||||
xmlModulePlatformClose(void *handle)
|
||||
{
|
||||
return shl_unload(handle);
|
||||
}
|
||||
|
||||
/*
|
||||
* xmlModulePlatformSymbol:
|
||||
* http://docs.hp.com/en/B2355-90683/shl_load.3X.html
|
||||
* returns 0 on success and the loaded symbol in result, and -1 on error.
|
||||
*/
|
||||
|
||||
static int
|
||||
xmlModulePlatformSymbol(void *handle, const char *name, void **symbol)
|
||||
{
|
||||
int rc;
|
||||
|
||||
errno = 0;
|
||||
rc = shl_findsym(handle, name, TYPE_PROCEDURE, symbol);
|
||||
if ((-1 == rc) && (0 == errno)) {
|
||||
rc = shl_findsym(handle, name, TYPE_DATA, symbol);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
#endif /* HAVE_SHLLOAD */
|
||||
#endif /* ! HAVE_DLOPEN */
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
/*
|
||||
* xmlModulePlatformOpen:
|
||||
* returns a handle on success, and zero on error.
|
||||
*/
|
||||
|
||||
static void *
|
||||
xmlModulePlatformOpen(const char *name)
|
||||
{
|
||||
return LoadLibrary(name);
|
||||
}
|
||||
|
||||
/*
|
||||
* xmlModulePlatformClose:
|
||||
* returns 0 on success, and non-zero on error.
|
||||
*/
|
||||
|
||||
static int
|
||||
xmlModulePlatformClose(void *handle)
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = FreeLibrary(handle);
|
||||
return (0 == rc);
|
||||
}
|
||||
|
||||
/*
|
||||
* xmlModulePlatformSymbol:
|
||||
* http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/getprocaddress.asp
|
||||
* returns 0 on success and the loaded symbol in result, and -1 on error.
|
||||
*/
|
||||
|
||||
static int
|
||||
xmlModulePlatformSymbol(void *handle, const char *name, void **symbol)
|
||||
{
|
||||
*symbol = GetProcAddress(handle, name);
|
||||
return (NULL == *symbol) ? -1 : 0;
|
||||
}
|
||||
|
||||
#endif /* _WIN32 */
|
||||
|
||||
#ifdef HAVE_BEOS
|
||||
|
||||
#include <kernel/image.h>
|
||||
|
||||
/*
|
||||
* xmlModulePlatformOpen:
|
||||
* beos api info: http://www.beunited.org/bebook/The%20Kernel%20Kit/Images.html
|
||||
* returns a handle on success, and zero on error.
|
||||
*/
|
||||
|
||||
static void *
|
||||
xmlModulePlatformOpen(const char *name)
|
||||
{
|
||||
return (void *) load_add_on(name);
|
||||
}
|
||||
|
||||
/*
|
||||
* xmlModulePlatformClose:
|
||||
* beos api info: http://www.beunited.org/bebook/The%20Kernel%20Kit/Images.html
|
||||
* returns 0 on success, and non-zero on error.
|
||||
*/
|
||||
|
||||
static int
|
||||
xmlModulePlatformClose(void *handle)
|
||||
{
|
||||
status_t rc;
|
||||
|
||||
rc = unload_add_on((image_id) handle);
|
||||
|
||||
if (rc == B_OK)
|
||||
return 0;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* xmlModulePlatformSymbol:
|
||||
* beos api info: http://www.beunited.org/bebook/The%20Kernel%20Kit/Images.html
|
||||
* returns 0 on success and the loaded symbol in result, and -1 on error.
|
||||
*/
|
||||
|
||||
static int
|
||||
xmlModulePlatformSymbol(void *handle, const char *name, void **symbol)
|
||||
{
|
||||
status_t rc;
|
||||
|
||||
rc = get_image_symbol((image_id) handle, name, B_SYMBOL_TYPE_ANY, symbol);
|
||||
|
||||
return (rc == B_OK) ? 0 : -1;
|
||||
}
|
||||
|
||||
#endif /* HAVE_BEOS */
|
||||
|
||||
#ifdef HAVE_OS2
|
||||
|
||||
#include <os2.h>
|
||||
|
||||
/*
|
||||
* xmlModulePlatformOpen:
|
||||
* os2 api info: http://www.edm2.com/os2api/Dos/DosLoadModule.html
|
||||
* returns a handle on success, and zero on error.
|
||||
*/
|
||||
|
||||
static void *
|
||||
xmlModulePlatformOpen(const char *name)
|
||||
{
|
||||
char errbuf[256];
|
||||
void *handle;
|
||||
int rc;
|
||||
|
||||
rc = DosLoadModule(errbuf, sizeof(errbuf) - 1, name, &handle);
|
||||
|
||||
if (rc)
|
||||
return 0;
|
||||
else
|
||||
return (handle);
|
||||
}
|
||||
|
||||
/*
|
||||
* xmlModulePlatformClose:
|
||||
* os2 api info: http://www.edm2.com/os2api/Dos/DosFreeModule.html
|
||||
* returns 0 on success, and non-zero on error.
|
||||
*/
|
||||
|
||||
static int
|
||||
xmlModulePlatformClose(void *handle)
|
||||
{
|
||||
return DosFreeModule(handle);
|
||||
}
|
||||
|
||||
/*
|
||||
* xmlModulePlatformSymbol:
|
||||
* os2 api info: http://www.edm2.com/os2api/Dos/DosQueryProcAddr.html
|
||||
* returns 0 on success and the loaded symbol in result, and -1 on error.
|
||||
*/
|
||||
|
||||
static int
|
||||
xmlModulePlatformSymbol(void *handle, const char *name, void **symbol)
|
||||
{
|
||||
int rc;
|
||||
|
||||
rc = DosQueryProcAddr(handle, 0, name, symbol);
|
||||
|
||||
return (rc == NO_ERROR) ? 0 : -1;
|
||||
}
|
||||
|
||||
#endif /* HAVE_OS2 */
|
||||
|
||||
#define bottom_xmlmodule
|
||||
#include "elfgcchack.h"
|
||||
#endif /* LIBXML_MODULES_ENABLED */
|
||||
5130
Extras/LibXML/xmlreader.c
Normal file
5130
Extras/LibXML/xmlreader.c
Normal file
File diff suppressed because it is too large
Load Diff
5186
Extras/LibXML/xmlregexp.c
Normal file
5186
Extras/LibXML/xmlregexp.c
Normal file
File diff suppressed because it is too large
Load Diff
2233
Extras/LibXML/xmlsave.c
Normal file
2233
Extras/LibXML/xmlsave.c
Normal file
File diff suppressed because it is too large
Load Diff
975
Extras/LibXML/xmlstring.c
Normal file
975
Extras/LibXML/xmlstring.c
Normal file
@@ -0,0 +1,975 @@
|
||||
/*
|
||||
* string.c : an XML string utilities module
|
||||
*
|
||||
* This module provides various utility functions for manipulating
|
||||
* the xmlChar* type. All functions named xmlStr* have been moved here
|
||||
* from the parser.c file (their original home).
|
||||
*
|
||||
* See Copyright for the status of this software.
|
||||
*
|
||||
* UTF8 string routines from:
|
||||
* William Brack <wbrack@mmm.com.hk>
|
||||
*
|
||||
* daniel@veillard.com
|
||||
*/
|
||||
|
||||
#define IN_LIBXML
|
||||
#include "libxml.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <libxml/xmlmemory.h>
|
||||
#include <libxml/parserInternals.h>
|
||||
#include <libxml/xmlstring.h>
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Commodity functions to handle xmlChars *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
/**
|
||||
* xmlStrndup:
|
||||
* @cur: the input xmlChar *
|
||||
* @len: the len of @cur
|
||||
*
|
||||
* a strndup for array of xmlChar's
|
||||
*
|
||||
* Returns a new xmlChar * or NULL
|
||||
*/
|
||||
xmlChar *
|
||||
xmlStrndup(const xmlChar *cur, intptr_t len) {
|
||||
xmlChar *ret;
|
||||
|
||||
if ((cur == NULL) || (len < 0)) return(NULL);
|
||||
ret = (xmlChar *) xmlMallocAtomic((len + 1) * sizeof(xmlChar));
|
||||
if (ret == NULL) {
|
||||
xmlErrMemory(NULL, NULL);
|
||||
return(NULL);
|
||||
}
|
||||
memcpy(ret, cur, len * sizeof(xmlChar));
|
||||
ret[len] = 0;
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlStrdup:
|
||||
* @cur: the input xmlChar *
|
||||
*
|
||||
* a strdup for array of xmlChar's. Since they are supposed to be
|
||||
* encoded in UTF-8 or an encoding with 8bit based chars, we assume
|
||||
* a termination mark of '0'.
|
||||
*
|
||||
* Returns a new xmlChar * or NULL
|
||||
*/
|
||||
xmlChar *
|
||||
xmlStrdup(const xmlChar *cur) {
|
||||
const xmlChar *p = cur;
|
||||
|
||||
if (cur == NULL) return(NULL);
|
||||
while (*p != 0) p++; /* non input consuming */
|
||||
return(xmlStrndup(cur, p - cur));
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlCharStrndup:
|
||||
* @cur: the input char *
|
||||
* @len: the len of @cur
|
||||
*
|
||||
* a strndup for char's to xmlChar's
|
||||
*
|
||||
* Returns a new xmlChar * or NULL
|
||||
*/
|
||||
|
||||
xmlChar *
|
||||
xmlCharStrndup(const char *cur, intptr_t len) {
|
||||
intptr_t i;
|
||||
xmlChar *ret;
|
||||
|
||||
if ((cur == NULL) || (len < 0)) return(NULL);
|
||||
ret = (xmlChar *) xmlMallocAtomic((len + 1) * sizeof(xmlChar));
|
||||
if (ret == NULL) {
|
||||
xmlErrMemory(NULL, NULL);
|
||||
return(NULL);
|
||||
}
|
||||
for (i = 0;i < len;i++) {
|
||||
ret[i] = (xmlChar) cur[i];
|
||||
if (ret[i] == 0) return(ret);
|
||||
}
|
||||
ret[len] = 0;
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlCharStrdup:
|
||||
* @cur: the input char *
|
||||
*
|
||||
* a strdup for char's to xmlChar's
|
||||
*
|
||||
* Returns a new xmlChar * or NULL
|
||||
*/
|
||||
|
||||
xmlChar *
|
||||
xmlCharStrdup(const char *cur) {
|
||||
const char *p = cur;
|
||||
|
||||
if (cur == NULL) return(NULL);
|
||||
while (*p != '\0') p++; /* non input consuming */
|
||||
return(xmlCharStrndup(cur, p - cur));
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlStrcmp:
|
||||
* @str1: the first xmlChar *
|
||||
* @str2: the second xmlChar *
|
||||
*
|
||||
* a strcmp for xmlChar's
|
||||
*
|
||||
* Returns the integer result of the comparison
|
||||
*/
|
||||
|
||||
intptr_t
|
||||
xmlStrcmp(const xmlChar *str1, const xmlChar *str2) {
|
||||
register intptr_t tmp;
|
||||
|
||||
if (str1 == str2) return(0);
|
||||
if (str1 == NULL) return(-1);
|
||||
if (str2 == NULL) return(1);
|
||||
do {
|
||||
tmp = *str1++ - *str2;
|
||||
if (tmp != 0) return(tmp);
|
||||
} while (*str2++ != 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlStrEqual:
|
||||
* @str1: the first xmlChar *
|
||||
* @str2: the second xmlChar *
|
||||
*
|
||||
* Check if both string are equal of have same content
|
||||
* Should be a bit more readable and faster than xmlStrEqual()
|
||||
*
|
||||
* Returns 1 if they are equal, 0 if they are different
|
||||
*/
|
||||
|
||||
intptr_t
|
||||
xmlStrEqual(const xmlChar *str1, const xmlChar *str2) {
|
||||
if (str1 == str2) return(1);
|
||||
if (str1 == NULL) return(0);
|
||||
if (str2 == NULL) return(0);
|
||||
do {
|
||||
if (*str1++ != *str2) return(0);
|
||||
} while (*str2++);
|
||||
return(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlStrQEqual:
|
||||
* @pref: the prefix of the QName
|
||||
* @name: the localname of the QName
|
||||
* @str: the second xmlChar *
|
||||
*
|
||||
* Check if a QName is Equal to a given string
|
||||
*
|
||||
* Returns 1 if they are equal, 0 if they are different
|
||||
*/
|
||||
|
||||
intptr_t
|
||||
xmlStrQEqual(const xmlChar *pref, const xmlChar *name, const xmlChar *str) {
|
||||
if (pref == NULL) return(xmlStrEqual(name, str));
|
||||
if (name == NULL) return(0);
|
||||
if (str == NULL) return(0);
|
||||
|
||||
do {
|
||||
if (*pref++ != *str) return(0);
|
||||
} while ((*str++) && (*pref));
|
||||
if (*str++ != ':') return(0);
|
||||
do {
|
||||
if (*name++ != *str) return(0);
|
||||
} while (*str++);
|
||||
return(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlStrncmp:
|
||||
* @str1: the first xmlChar *
|
||||
* @str2: the second xmlChar *
|
||||
* @len: the max comparison length
|
||||
*
|
||||
* a strncmp for xmlChar's
|
||||
*
|
||||
* Returns the integer result of the comparison
|
||||
*/
|
||||
|
||||
intptr_t
|
||||
xmlStrncmp(const xmlChar *str1, const xmlChar *str2, intptr_t len) {
|
||||
register intptr_t tmp;
|
||||
|
||||
if (len <= 0) return(0);
|
||||
if (str1 == str2) return(0);
|
||||
if (str1 == NULL) return(-1);
|
||||
if (str2 == NULL) return(1);
|
||||
#ifdef __GNUC__
|
||||
tmp = strncmp((const char *)str1, (const char *)str2, len);
|
||||
return tmp;
|
||||
#else
|
||||
do {
|
||||
tmp = *str1++ - *str2;
|
||||
if (tmp != 0 || --len == 0) return(tmp);
|
||||
} while (*str2++ != 0);
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static const xmlChar casemap[256] = {
|
||||
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
|
||||
0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,
|
||||
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,
|
||||
0x18,0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,
|
||||
0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,
|
||||
0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,
|
||||
0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,
|
||||
0x38,0x39,0x3A,0x3B,0x3C,0x3D,0x3E,0x3F,
|
||||
0x40,0x61,0x62,0x63,0x64,0x65,0x66,0x67,
|
||||
0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
|
||||
0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,
|
||||
0x78,0x79,0x7A,0x7B,0x5C,0x5D,0x5E,0x5F,
|
||||
0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,
|
||||
0x68,0x69,0x6A,0x6B,0x6C,0x6D,0x6E,0x6F,
|
||||
0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,
|
||||
0x78,0x79,0x7A,0x7B,0x7C,0x7D,0x7E,0x7F,
|
||||
0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,
|
||||
0x88,0x89,0x8A,0x8B,0x8C,0x8D,0x8E,0x8F,
|
||||
0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97,
|
||||
0x98,0x99,0x9A,0x9B,0x9C,0x9D,0x9E,0x9F,
|
||||
0xA0,0xA1,0xA2,0xA3,0xA4,0xA5,0xA6,0xA7,
|
||||
0xA8,0xA9,0xAA,0xAB,0xAC,0xAD,0xAE,0xAF,
|
||||
0xB0,0xB1,0xB2,0xB3,0xB4,0xB5,0xB6,0xB7,
|
||||
0xB8,0xB9,0xBA,0xBB,0xBC,0xBD,0xBE,0xBF,
|
||||
0xC0,0xC1,0xC2,0xC3,0xC4,0xC5,0xC6,0xC7,
|
||||
0xC8,0xC9,0xCA,0xCB,0xCC,0xCD,0xCE,0xCF,
|
||||
0xD0,0xD1,0xD2,0xD3,0xD4,0xD5,0xD6,0xD7,
|
||||
0xD8,0xD9,0xDA,0xDB,0xDC,0xDD,0xDE,0xDF,
|
||||
0xE0,0xE1,0xE2,0xE3,0xE4,0xE5,0xE6,0xE7,
|
||||
0xE8,0xE9,0xEA,0xEB,0xEC,0xED,0xEE,0xEF,
|
||||
0xF0,0xF1,0xF2,0xF3,0xF4,0xF5,0xF6,0xF7,
|
||||
0xF8,0xF9,0xFA,0xFB,0xFC,0xFD,0xFE,0xFF
|
||||
};
|
||||
|
||||
/**
|
||||
* xmlStrcasecmp:
|
||||
* @str1: the first xmlChar *
|
||||
* @str2: the second xmlChar *
|
||||
*
|
||||
* a strcasecmp for xmlChar's
|
||||
*
|
||||
* Returns the integer result of the comparison
|
||||
*/
|
||||
|
||||
intptr_t
|
||||
xmlStrcasecmp(const xmlChar *str1, const xmlChar *str2) {
|
||||
register intptr_t tmp;
|
||||
|
||||
if (str1 == str2) return(0);
|
||||
if (str1 == NULL) return(-1);
|
||||
if (str2 == NULL) return(1);
|
||||
do {
|
||||
tmp = casemap[*str1++] - casemap[*str2];
|
||||
if (tmp != 0) return(tmp);
|
||||
} while (*str2++ != 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlStrncasecmp:
|
||||
* @str1: the first xmlChar *
|
||||
* @str2: the second xmlChar *
|
||||
* @len: the max comparison length
|
||||
*
|
||||
* a strncasecmp for xmlChar's
|
||||
*
|
||||
* Returns the integer result of the comparison
|
||||
*/
|
||||
|
||||
intptr_t
|
||||
xmlStrncasecmp(const xmlChar *str1, const xmlChar *str2, intptr_t len) {
|
||||
register intptr_t tmp;
|
||||
|
||||
if (len <= 0) return(0);
|
||||
if (str1 == str2) return(0);
|
||||
if (str1 == NULL) return(-1);
|
||||
if (str2 == NULL) return(1);
|
||||
do {
|
||||
tmp = casemap[*str1++] - casemap[*str2];
|
||||
if (tmp != 0 || --len == 0) return(tmp);
|
||||
} while (*str2++ != 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlStrchr:
|
||||
* @str: the xmlChar * array
|
||||
* @val: the xmlChar to search
|
||||
*
|
||||
* a strchr for xmlChar's
|
||||
*
|
||||
* Returns the xmlChar * for the first occurrence or NULL.
|
||||
*/
|
||||
|
||||
const xmlChar *
|
||||
xmlStrchr(const xmlChar *str, xmlChar val) {
|
||||
if (str == NULL) return(NULL);
|
||||
while (*str != 0) { /* non input consuming */
|
||||
if (*str == val) return((xmlChar *) str);
|
||||
str++;
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlStrstr:
|
||||
* @str: the xmlChar * array (haystack)
|
||||
* @val: the xmlChar to search (needle)
|
||||
*
|
||||
* a strstr for xmlChar's
|
||||
*
|
||||
* Returns the xmlChar * for the first occurrence or NULL.
|
||||
*/
|
||||
|
||||
const xmlChar *
|
||||
xmlStrstr(const xmlChar *str, const xmlChar *val) {
|
||||
intptr_t n;
|
||||
|
||||
if (str == NULL) return(NULL);
|
||||
if (val == NULL) return(NULL);
|
||||
n = xmlStrlen(val);
|
||||
|
||||
if (n == 0) return(str);
|
||||
while (*str != 0) { /* non input consuming */
|
||||
if (*str == *val) {
|
||||
if (!xmlStrncmp(str, val, n)) return((const xmlChar *) str);
|
||||
}
|
||||
str++;
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlStrcasestr:
|
||||
* @str: the xmlChar * array (haystack)
|
||||
* @val: the xmlChar to search (needle)
|
||||
*
|
||||
* a case-ignoring strstr for xmlChar's
|
||||
*
|
||||
* Returns the xmlChar * for the first occurrence or NULL.
|
||||
*/
|
||||
|
||||
const xmlChar *
|
||||
xmlStrcasestr(const xmlChar *str, xmlChar *val) {
|
||||
intptr_t n;
|
||||
|
||||
if (str == NULL) return(NULL);
|
||||
if (val == NULL) return(NULL);
|
||||
n = xmlStrlen(val);
|
||||
|
||||
if (n == 0) return(str);
|
||||
while (*str != 0) { /* non input consuming */
|
||||
if (casemap[*str] == casemap[*val])
|
||||
if (!xmlStrncasecmp(str, val, n)) return(str);
|
||||
str++;
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlStrsub:
|
||||
* @str: the xmlChar * array (haystack)
|
||||
* @start: the index of the first char (zero based)
|
||||
* @len: the length of the substring
|
||||
*
|
||||
* Extract a substring of a given string
|
||||
*
|
||||
* Returns the xmlChar * for the first occurrence or NULL.
|
||||
*/
|
||||
|
||||
xmlChar *
|
||||
xmlStrsub(const xmlChar *str, intptr_t start, intptr_t len) {
|
||||
intptr_t i;
|
||||
|
||||
if (str == NULL) return(NULL);
|
||||
if (start < 0) return(NULL);
|
||||
if (len < 0) return(NULL);
|
||||
|
||||
for (i = 0;i < start;i++) {
|
||||
if (*str == 0) return(NULL);
|
||||
str++;
|
||||
}
|
||||
if (*str == 0) return(NULL);
|
||||
return(xmlStrndup(str, len));
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlStrlen:
|
||||
* @str: the xmlChar * array
|
||||
*
|
||||
* length of a xmlChar's string
|
||||
*
|
||||
* Returns the number of xmlChar contained in the ARRAY.
|
||||
*/
|
||||
|
||||
intptr_t
|
||||
xmlStrlen(const xmlChar *str) {
|
||||
intptr_t len = 0;
|
||||
|
||||
if (str == NULL) return(0);
|
||||
while (*str != 0) { /* non input consuming */
|
||||
str++;
|
||||
len++;
|
||||
}
|
||||
return(len);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlStrncat:
|
||||
* @cur: the original xmlChar * array
|
||||
* @add: the xmlChar * array added
|
||||
* @len: the length of @add
|
||||
*
|
||||
* a strncat for array of xmlChar's, it will extend @cur with the len
|
||||
* first bytes of @add.
|
||||
*
|
||||
* Returns a new xmlChar *, the original @cur is reallocated if needed
|
||||
* and should not be freed
|
||||
*/
|
||||
|
||||
xmlChar *
|
||||
xmlStrncat(xmlChar *cur, const xmlChar *add, intptr_t len) {
|
||||
intptr_t size;
|
||||
xmlChar *ret;
|
||||
|
||||
if ((add == NULL) || (len == 0))
|
||||
return(cur);
|
||||
if (cur == NULL)
|
||||
return(xmlStrndup(add, len));
|
||||
|
||||
size = xmlStrlen(cur);
|
||||
ret = (xmlChar *) xmlRealloc(cur, (size + len + 1) * sizeof(xmlChar));
|
||||
if (ret == NULL) {
|
||||
xmlErrMemory(NULL, NULL);
|
||||
return(cur);
|
||||
}
|
||||
memcpy(&ret[size], add, len * sizeof(xmlChar));
|
||||
ret[size + len] = 0;
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlStrncatNew:
|
||||
* @str1: first xmlChar string
|
||||
* @str2: second xmlChar string
|
||||
* @len: the len of @str2
|
||||
*
|
||||
* same as xmlStrncat, but creates a new string. The original
|
||||
* two strings are not freed.
|
||||
*
|
||||
* Returns a new xmlChar * or NULL
|
||||
*/
|
||||
xmlChar *
|
||||
xmlStrncatNew(const xmlChar *str1, const xmlChar *str2, intptr_t len) {
|
||||
intptr_t size;
|
||||
xmlChar *ret;
|
||||
|
||||
if (len < 0)
|
||||
len = xmlStrlen(str2);
|
||||
if ((str2 == NULL) || (len == 0))
|
||||
return(xmlStrdup(str1));
|
||||
if (str1 == NULL)
|
||||
return(xmlStrndup(str2, len));
|
||||
|
||||
size = xmlStrlen(str1);
|
||||
ret = (xmlChar *) xmlMalloc((size + len + 1) * sizeof(xmlChar));
|
||||
if (ret == NULL) {
|
||||
xmlErrMemory(NULL, NULL);
|
||||
return(xmlStrndup(str1, size));
|
||||
}
|
||||
memcpy(ret, str1, size * sizeof(xmlChar));
|
||||
memcpy(&ret[size], str2, len * sizeof(xmlChar));
|
||||
ret[size + len] = 0;
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlStrcat:
|
||||
* @cur: the original xmlChar * array
|
||||
* @add: the xmlChar * array added
|
||||
*
|
||||
* a strcat for array of xmlChar's. Since they are supposed to be
|
||||
* encoded in UTF-8 or an encoding with 8bit based chars, we assume
|
||||
* a termination mark of '0'.
|
||||
*
|
||||
* Returns a new xmlChar * containing the concatenated string.
|
||||
*/
|
||||
xmlChar *
|
||||
xmlStrcat(xmlChar *cur, const xmlChar *add) {
|
||||
const xmlChar *p = add;
|
||||
|
||||
if (add == NULL) return(cur);
|
||||
if (cur == NULL)
|
||||
return(xmlStrdup(add));
|
||||
|
||||
while (*p != 0) p++; /* non input consuming */
|
||||
return(xmlStrncat(cur, add, p - add));
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlStrPrintf:
|
||||
* @buf: the result buffer.
|
||||
* @len: the result buffer length.
|
||||
* @msg: the message with printf formatting.
|
||||
* @...: extra parameters for the message.
|
||||
*
|
||||
* Formats @msg and places result into @buf.
|
||||
*
|
||||
* Returns the number of characters written to @buf or -1 if an error occurs.
|
||||
*/
|
||||
intptr_t
|
||||
xmlStrPrintf(xmlChar *buf, intptr_t len, const xmlChar *msg, ...) {
|
||||
va_list args;
|
||||
intptr_t ret;
|
||||
|
||||
if((buf == NULL) || (msg == NULL)) {
|
||||
return(-1);
|
||||
}
|
||||
|
||||
va_start(args, msg);
|
||||
ret = vsnprintf((char *) buf, len, (const char *) msg, args);
|
||||
va_end(args);
|
||||
buf[len - 1] = 0; /* be safe ! */
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlStrVPrintf:
|
||||
* @buf: the result buffer.
|
||||
* @len: the result buffer length.
|
||||
* @msg: the message with printf formatting.
|
||||
* @ap: extra parameters for the message.
|
||||
*
|
||||
* Formats @msg and places result into @buf.
|
||||
*
|
||||
* Returns the number of characters written to @buf or -1 if an error occurs.
|
||||
*/
|
||||
intptr_t
|
||||
xmlStrVPrintf(xmlChar *buf, intptr_t len, const xmlChar *msg, va_list ap) {
|
||||
intptr_t ret;
|
||||
|
||||
if((buf == NULL) || (msg == NULL)) {
|
||||
return(-1);
|
||||
}
|
||||
|
||||
ret = vsnprintf((char *) buf, len, (const char *) msg, ap);
|
||||
buf[len - 1] = 0; /* be safe ! */
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* Generic UTF8 handling routines *
|
||||
* *
|
||||
* From rfc2044: encoding of the Unicode values on UTF-8: *
|
||||
* *
|
||||
* UCS-4 range (hex.) UTF-8 octet sequence (binary) *
|
||||
* 0000 0000-0000 007F 0xxxxxxx *
|
||||
* 0000 0080-0000 07FF 110xxxxx 10xxxxxx *
|
||||
* 0000 0800-0000 FFFF 1110xxxx 10xxxxxx 10xxxxxx *
|
||||
* *
|
||||
* I hope we won't use values > 0xFFFF anytime soon ! *
|
||||
* *
|
||||
************************************************************************/
|
||||
|
||||
|
||||
/**
|
||||
* xmlUTF8Size:
|
||||
* @utf: pointer to the UTF8 character
|
||||
*
|
||||
* calculates the internal size of a UTF8 character
|
||||
*
|
||||
* returns the numbers of bytes in the character, -1 on format error
|
||||
*/
|
||||
intptr_t
|
||||
xmlUTF8Size(const xmlChar *utf) {
|
||||
xmlChar mask;
|
||||
intptr_t len;
|
||||
|
||||
if (utf == NULL)
|
||||
return -1;
|
||||
if (*utf < 0x80)
|
||||
return 1;
|
||||
/* check valid UTF8 character */
|
||||
if (!(*utf & 0x40))
|
||||
return -1;
|
||||
/* determine number of bytes in char */
|
||||
len = 2;
|
||||
for (mask=0x20; mask != 0; mask>>=1) {
|
||||
if (!(*utf & mask))
|
||||
return len;
|
||||
len++;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlUTF8Charcmp:
|
||||
* @utf1: pointer to first UTF8 char
|
||||
* @utf2: pointer to second UTF8 char
|
||||
*
|
||||
* compares the two UCS4 values
|
||||
*
|
||||
* returns result of the compare as with xmlStrncmp
|
||||
*/
|
||||
intptr_t
|
||||
xmlUTF8Charcmp(const xmlChar *utf1, const xmlChar *utf2) {
|
||||
|
||||
if (utf1 == NULL ) {
|
||||
if (utf2 == NULL)
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
return xmlStrncmp(utf1, utf2, xmlUTF8Size(utf1));
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlUTF8Strlen:
|
||||
* @utf: a sequence of UTF-8 encoded bytes
|
||||
*
|
||||
* compute the length of an UTF8 string, it doesn't do a full UTF8
|
||||
* checking of the content of the string.
|
||||
*
|
||||
* Returns the number of characters in the string or -1 in case of error
|
||||
*/
|
||||
intptr_t
|
||||
xmlUTF8Strlen(const xmlChar *utf) {
|
||||
intptr_t ret = 0;
|
||||
|
||||
if (utf == NULL)
|
||||
return(-1);
|
||||
|
||||
while (*utf != 0) {
|
||||
if (utf[0] & 0x80) {
|
||||
if ((utf[1] & 0xc0) != 0x80)
|
||||
return(-1);
|
||||
if ((utf[0] & 0xe0) == 0xe0) {
|
||||
if ((utf[2] & 0xc0) != 0x80)
|
||||
return(-1);
|
||||
if ((utf[0] & 0xf0) == 0xf0) {
|
||||
if ((utf[0] & 0xf8) != 0xf0 || (utf[3] & 0xc0) != 0x80)
|
||||
return(-1);
|
||||
utf += 4;
|
||||
} else {
|
||||
utf += 3;
|
||||
}
|
||||
} else {
|
||||
utf += 2;
|
||||
}
|
||||
} else {
|
||||
utf++;
|
||||
}
|
||||
ret++;
|
||||
}
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlGetUTF8Char:
|
||||
* @utf: a sequence of UTF-8 encoded bytes
|
||||
* @len: a pointer to the minimum number of bytes present in
|
||||
* the sequence. This is used to assure the next character
|
||||
* is completely contained within the sequence.
|
||||
*
|
||||
* Read the first UTF8 character from @utf
|
||||
*
|
||||
* Returns the char value or -1 in case of error, and sets *len to
|
||||
* the actual number of bytes consumed (0 in case of error)
|
||||
*/
|
||||
intptr_t
|
||||
xmlGetUTF8Char(const unsigned char* utf, intptr_t* len) {
|
||||
size_t c;
|
||||
|
||||
if (utf == NULL || len == NULL || *len < 1) goto error;
|
||||
|
||||
c = utf[0];
|
||||
if (c & 0x80) {
|
||||
if (*len < 2)
|
||||
goto error;
|
||||
if ((utf[1] & 0xc0) != 0x80)
|
||||
goto error;
|
||||
if ((c & 0xe0) == 0xe0) {
|
||||
if (*len < 3)
|
||||
goto error;
|
||||
if ((utf[2] & 0xc0) != 0x80)
|
||||
goto error;
|
||||
if ((c & 0xf0) == 0xf0) {
|
||||
if (*len < 4)
|
||||
goto error;
|
||||
if ((c & 0xf8) != 0xf0 || (utf[3] & 0xc0) != 0x80)
|
||||
goto error;
|
||||
*len = 4;
|
||||
/* 4-byte code */
|
||||
c = (utf[0] & 0x7) << 18;
|
||||
c |= (utf[1] & 0x3f) << 12;
|
||||
c |= (utf[2] & 0x3f) << 6;
|
||||
c |= utf[3] & 0x3f;
|
||||
} else {
|
||||
/* 3-byte code */
|
||||
*len = 3;
|
||||
c = (utf[0] & 0xf) << 12;
|
||||
c |= (utf[1] & 0x3f) << 6;
|
||||
c |= utf[2] & 0x3f;
|
||||
}
|
||||
} else {
|
||||
/* 2-byte code */
|
||||
*len = 2;
|
||||
c = (utf[0] & 0x1f) << 6;
|
||||
c |= utf[1] & 0x3f;
|
||||
}
|
||||
} else {
|
||||
/* 1-byte code */
|
||||
*len = 1;
|
||||
}
|
||||
return(c);
|
||||
|
||||
error:
|
||||
if (len != NULL)
|
||||
*len = 0;
|
||||
return(-1);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlCheckUTF8:
|
||||
* @utf: Pointer to putative UTF-8 encoded string.
|
||||
*
|
||||
* Checks @utf for being valid UTF-8. @utf is assumed to be
|
||||
* null-terminated. This function is not super-strict, as it will
|
||||
* allow longer UTF-8 sequences than necessary. Note that Java is
|
||||
* capable of producing these sequences if provoked. Also note, this
|
||||
* routine checks for the 4-byte maximum size, but does not check for
|
||||
* 0x10ffff maximum value.
|
||||
*
|
||||
* Return value: true if @utf is valid.
|
||||
**/
|
||||
intptr_t
|
||||
xmlCheckUTF8(const unsigned char *utf)
|
||||
{
|
||||
intptr_t ix;
|
||||
unsigned char c;
|
||||
|
||||
if (utf == NULL)
|
||||
return(0);
|
||||
/*
|
||||
* utf is a string of 1, 2, 3 or 4 bytes. The valid strings
|
||||
* are as follows (in "bit format"):
|
||||
* 0xxxxxxx valid 1-byte
|
||||
* 110xxxxx 10xxxxxx valid 2-byte
|
||||
* 1110xxxx 10xxxxxx 10xxxxxx valid 3-byte
|
||||
* 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx valid 4-byte
|
||||
*/
|
||||
for (ix = 0; (c = utf[ix]);) { /* string is 0-terminated */
|
||||
if ((c & 0x80) == 0x00) { /* 1-byte code, starts with 10 */
|
||||
ix++;
|
||||
} else if ((c & 0xe0) == 0xc0) {/* 2-byte code, starts with 110 */
|
||||
if ((utf[ix+1] & 0xc0 ) != 0x80)
|
||||
return 0;
|
||||
ix += 2;
|
||||
} else if ((c & 0xf0) == 0xe0) {/* 3-byte code, starts with 1110 */
|
||||
if (((utf[ix+1] & 0xc0) != 0x80) ||
|
||||
((utf[ix+2] & 0xc0) != 0x80))
|
||||
return 0;
|
||||
ix += 3;
|
||||
} else if ((c & 0xf8) == 0xf0) {/* 4-byte code, starts with 11110 */
|
||||
if (((utf[ix+1] & 0xc0) != 0x80) ||
|
||||
((utf[ix+2] & 0xc0) != 0x80) ||
|
||||
((utf[ix+3] & 0xc0) != 0x80))
|
||||
return 0;
|
||||
ix += 4;
|
||||
} else /* unknown encoding */
|
||||
return 0;
|
||||
}
|
||||
return(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlUTF8Strsize:
|
||||
* @utf: a sequence of UTF-8 encoded bytes
|
||||
* @len: the number of characters in the array
|
||||
*
|
||||
* storage size of an UTF8 string
|
||||
* the behaviour is not garanteed if the input string is not UTF-8
|
||||
*
|
||||
* Returns the storage size of
|
||||
* the first 'len' characters of ARRAY
|
||||
*/
|
||||
|
||||
intptr_t
|
||||
xmlUTF8Strsize(const xmlChar *utf, intptr_t len) {
|
||||
const xmlChar *ptr=utf;
|
||||
xmlChar ch;
|
||||
|
||||
if (utf == NULL)
|
||||
return(0);
|
||||
|
||||
if (len <= 0)
|
||||
return(0);
|
||||
|
||||
while ( len-- > 0) {
|
||||
if ( !*ptr )
|
||||
break;
|
||||
if ( (ch = *ptr++) & 0x80)
|
||||
while ((ch<<=1) & 0x80 ) {
|
||||
ptr++;
|
||||
if (*ptr == 0) break;
|
||||
}
|
||||
}
|
||||
return (ptr - utf);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* xmlUTF8Strndup:
|
||||
* @utf: the input UTF8 *
|
||||
* @len: the len of @utf (in chars)
|
||||
*
|
||||
* a strndup for array of UTF8's
|
||||
*
|
||||
* Returns a new UTF8 * or NULL
|
||||
*/
|
||||
xmlChar *
|
||||
xmlUTF8Strndup(const xmlChar *utf, intptr_t len) {
|
||||
xmlChar *ret;
|
||||
intptr_t i;
|
||||
|
||||
if ((utf == NULL) || (len < 0)) return(NULL);
|
||||
i = xmlUTF8Strsize(utf, len);
|
||||
ret = (xmlChar *) xmlMallocAtomic((i + 1) * sizeof(xmlChar));
|
||||
if (ret == NULL) {
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"malloc of %ld byte failed\n",
|
||||
(len + 1) * (long)sizeof(xmlChar));
|
||||
return(NULL);
|
||||
}
|
||||
memcpy(ret, utf, i * sizeof(xmlChar));
|
||||
ret[i] = 0;
|
||||
return(ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlUTF8Strpos:
|
||||
* @utf: the input UTF8 *
|
||||
* @pos: the position of the desired UTF8 char (in chars)
|
||||
*
|
||||
* a function to provide the equivalent of fetching a
|
||||
* character from a string array
|
||||
*
|
||||
* Returns a pointer to the UTF8 character or NULL
|
||||
*/
|
||||
const xmlChar *
|
||||
xmlUTF8Strpos(const xmlChar *utf, intptr_t pos) {
|
||||
xmlChar ch;
|
||||
|
||||
if (utf == NULL) return(NULL);
|
||||
if (pos < 0)
|
||||
return(NULL);
|
||||
while (pos--) {
|
||||
if ((ch=*utf++) == 0) return(NULL);
|
||||
if ( ch & 0x80 ) {
|
||||
/* if not simple ascii, verify proper format */
|
||||
if ( (ch & 0xc0) != 0xc0 )
|
||||
return(NULL);
|
||||
/* then skip over remaining bytes for this char */
|
||||
while ( (ch <<= 1) & 0x80 )
|
||||
if ( (*utf++ & 0xc0) != 0x80 )
|
||||
return(NULL);
|
||||
}
|
||||
}
|
||||
return((xmlChar *)utf);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlUTF8Strloc:
|
||||
* @utf: the input UTF8 *
|
||||
* @utfchar: the UTF8 character to be found
|
||||
*
|
||||
* a function to provide the relative location of a UTF8 char
|
||||
*
|
||||
* Returns the relative character position of the desired char
|
||||
* or -1 if not found
|
||||
*/
|
||||
intptr_t
|
||||
xmlUTF8Strloc(const xmlChar *utf, const xmlChar *utfchar) {
|
||||
intptr_t i, size;
|
||||
xmlChar ch;
|
||||
|
||||
if (utf==NULL || utfchar==NULL) return -1;
|
||||
size = xmlUTF8Strsize(utfchar, 1);
|
||||
for(i=0; (ch=*utf) != 0; i++) {
|
||||
if (xmlStrncmp(utf, utfchar, size)==0)
|
||||
return(i);
|
||||
utf++;
|
||||
if ( ch & 0x80 ) {
|
||||
/* if not simple ascii, verify proper format */
|
||||
if ( (ch & 0xc0) != 0xc0 )
|
||||
return(-1);
|
||||
/* then skip over remaining bytes for this char */
|
||||
while ( (ch <<= 1) & 0x80 )
|
||||
if ( (*utf++ & 0xc0) != 0x80 )
|
||||
return(-1);
|
||||
}
|
||||
}
|
||||
|
||||
return(-1);
|
||||
}
|
||||
/**
|
||||
* xmlUTF8Strsub:
|
||||
* @utf: a sequence of UTF-8 encoded bytes
|
||||
* @start: relative pos of first char
|
||||
* @len: total number to copy
|
||||
*
|
||||
* Create a substring from a given UTF-8 string
|
||||
* Note: positions are given in units of UTF-8 chars
|
||||
*
|
||||
* Returns a pointer to a newly created string
|
||||
* or NULL if any problem
|
||||
*/
|
||||
|
||||
xmlChar *
|
||||
xmlUTF8Strsub(const xmlChar *utf, intptr_t start, intptr_t len) {
|
||||
intptr_t i;
|
||||
xmlChar ch;
|
||||
|
||||
if (utf == NULL) return(NULL);
|
||||
if (start < 0) return(NULL);
|
||||
if (len < 0) return(NULL);
|
||||
|
||||
/*
|
||||
* Skip over any leading chars
|
||||
*/
|
||||
for (i = 0;i < start;i++) {
|
||||
if ((ch=*utf++) == 0) return(NULL);
|
||||
if ( ch & 0x80 ) {
|
||||
/* if not simple ascii, verify proper format */
|
||||
if ( (ch & 0xc0) != 0xc0 )
|
||||
return(NULL);
|
||||
/* then skip over remaining bytes for this char */
|
||||
while ( (ch <<= 1) & 0x80 )
|
||||
if ( (*utf++ & 0xc0) != 0x80 )
|
||||
return(NULL);
|
||||
}
|
||||
}
|
||||
|
||||
return(xmlUTF8Strndup(utf, len));
|
||||
}
|
||||
|
||||
#define bottom_xmlstring
|
||||
#include "elfgcchack.h"
|
||||
3176
Extras/LibXML/xmlunicode.c
Normal file
3176
Extras/LibXML/xmlunicode.c
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user