mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-28 18:50:29 +00:00
(libxml) take out LIBXML_DEBUG_ENABLED
This commit is contained in:
parent
4285d9d128
commit
af19546d8d
@ -30,7 +30,6 @@ LIBXML_PATH := ../libxml2
|
||||
LOCAL_LIBXML_SRC_FILES = $(LIBXML_PATH)/c14n.c \
|
||||
$(LIBXML_PATH)/catalog.c \
|
||||
$(LIBXML_PATH)/chvalid.c \
|
||||
$(LIBXML_PATH)/debugXML.c \
|
||||
$(LIBXML_PATH)/dict.c \
|
||||
$(LIBXML_PATH)/DOCBparser.c \
|
||||
$(LIBXML_PATH)/encoding.c \
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -635,18 +635,6 @@ extern __typeof (xmlAutomataSetFinalState) xmlAutomataSetFinalState__internal_al
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_DEBUG_ENABLED)
|
||||
#ifdef bottom_debugXML
|
||||
#undef xmlBoolToText
|
||||
extern __typeof (xmlBoolToText) xmlBoolToText __attribute((alias("xmlBoolToText__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlBoolToText
|
||||
extern __typeof (xmlBoolToText) xmlBoolToText__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlBoolToText xmlBoolToText__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef bottom_tree
|
||||
#undef xmlBufferAdd
|
||||
extern __typeof (xmlBufferAdd) xmlBufferAdd __attribute((alias("xmlBufferAdd__internal_alias")));
|
||||
@ -1909,138 +1897,6 @@ extern __typeof (xmlDOMWrapRemoveNode) xmlDOMWrapRemoveNode__internal_alias __at
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_DEBUG_ENABLED)
|
||||
#ifdef bottom_debugXML
|
||||
#undef xmlDebugCheckDocument
|
||||
extern __typeof (xmlDebugCheckDocument) xmlDebugCheckDocument __attribute((alias("xmlDebugCheckDocument__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlDebugCheckDocument
|
||||
extern __typeof (xmlDebugCheckDocument) xmlDebugCheckDocument__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlDebugCheckDocument xmlDebugCheckDocument__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_DEBUG_ENABLED)
|
||||
#ifdef bottom_debugXML
|
||||
#undef xmlDebugDumpAttr
|
||||
extern __typeof (xmlDebugDumpAttr) xmlDebugDumpAttr __attribute((alias("xmlDebugDumpAttr__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlDebugDumpAttr
|
||||
extern __typeof (xmlDebugDumpAttr) xmlDebugDumpAttr__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlDebugDumpAttr xmlDebugDumpAttr__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_DEBUG_ENABLED)
|
||||
#ifdef bottom_debugXML
|
||||
#undef xmlDebugDumpAttrList
|
||||
extern __typeof (xmlDebugDumpAttrList) xmlDebugDumpAttrList __attribute((alias("xmlDebugDumpAttrList__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlDebugDumpAttrList
|
||||
extern __typeof (xmlDebugDumpAttrList) xmlDebugDumpAttrList__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlDebugDumpAttrList xmlDebugDumpAttrList__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_DEBUG_ENABLED)
|
||||
#ifdef bottom_debugXML
|
||||
#undef xmlDebugDumpDTD
|
||||
extern __typeof (xmlDebugDumpDTD) xmlDebugDumpDTD __attribute((alias("xmlDebugDumpDTD__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlDebugDumpDTD
|
||||
extern __typeof (xmlDebugDumpDTD) xmlDebugDumpDTD__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlDebugDumpDTD xmlDebugDumpDTD__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_DEBUG_ENABLED)
|
||||
#ifdef bottom_debugXML
|
||||
#undef xmlDebugDumpDocument
|
||||
extern __typeof (xmlDebugDumpDocument) xmlDebugDumpDocument __attribute((alias("xmlDebugDumpDocument__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlDebugDumpDocument
|
||||
extern __typeof (xmlDebugDumpDocument) xmlDebugDumpDocument__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlDebugDumpDocument xmlDebugDumpDocument__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_DEBUG_ENABLED)
|
||||
#ifdef bottom_debugXML
|
||||
#undef xmlDebugDumpDocumentHead
|
||||
extern __typeof (xmlDebugDumpDocumentHead) xmlDebugDumpDocumentHead __attribute((alias("xmlDebugDumpDocumentHead__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlDebugDumpDocumentHead
|
||||
extern __typeof (xmlDebugDumpDocumentHead) xmlDebugDumpDocumentHead__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlDebugDumpDocumentHead xmlDebugDumpDocumentHead__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_DEBUG_ENABLED)
|
||||
#ifdef bottom_debugXML
|
||||
#undef xmlDebugDumpEntities
|
||||
extern __typeof (xmlDebugDumpEntities) xmlDebugDumpEntities __attribute((alias("xmlDebugDumpEntities__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlDebugDumpEntities
|
||||
extern __typeof (xmlDebugDumpEntities) xmlDebugDumpEntities__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlDebugDumpEntities xmlDebugDumpEntities__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_DEBUG_ENABLED)
|
||||
#ifdef bottom_debugXML
|
||||
#undef xmlDebugDumpNode
|
||||
extern __typeof (xmlDebugDumpNode) xmlDebugDumpNode __attribute((alias("xmlDebugDumpNode__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlDebugDumpNode
|
||||
extern __typeof (xmlDebugDumpNode) xmlDebugDumpNode__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlDebugDumpNode xmlDebugDumpNode__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_DEBUG_ENABLED)
|
||||
#ifdef bottom_debugXML
|
||||
#undef xmlDebugDumpNodeList
|
||||
extern __typeof (xmlDebugDumpNodeList) xmlDebugDumpNodeList __attribute((alias("xmlDebugDumpNodeList__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlDebugDumpNodeList
|
||||
extern __typeof (xmlDebugDumpNodeList) xmlDebugDumpNodeList__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlDebugDumpNodeList xmlDebugDumpNodeList__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_DEBUG_ENABLED)
|
||||
#ifdef bottom_debugXML
|
||||
#undef xmlDebugDumpOneNode
|
||||
extern __typeof (xmlDebugDumpOneNode) xmlDebugDumpOneNode __attribute((alias("xmlDebugDumpOneNode__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlDebugDumpOneNode
|
||||
extern __typeof (xmlDebugDumpOneNode) xmlDebugDumpOneNode__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlDebugDumpOneNode xmlDebugDumpOneNode__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_DEBUG_ENABLED)
|
||||
#ifdef bottom_debugXML
|
||||
#undef xmlDebugDumpString
|
||||
extern __typeof (xmlDebugDumpString) xmlDebugDumpString __attribute((alias("xmlDebugDumpString__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlDebugDumpString
|
||||
extern __typeof (xmlDebugDumpString) xmlDebugDumpString__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlDebugDumpString xmlDebugDumpString__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_LEGACY_ENABLED)
|
||||
#ifdef bottom_legacy
|
||||
#undef xmlDecodeEntities
|
||||
@ -3327,7 +3183,7 @@ extern __typeof (xmlGetNoNsProp) xmlGetNoNsProp__internal_alias __attribute((vis
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
|
||||
#if defined(LIBXML_TREE_ENABLED)
|
||||
#ifdef bottom_tree
|
||||
#undef xmlGetNodePath
|
||||
extern __typeof (xmlGetNodePath) xmlGetNodePath __attribute((alias("xmlGetNodePath__internal_alias")));
|
||||
@ -4329,30 +4185,6 @@ extern __typeof (xmlLockLibrary) xmlLockLibrary__internal_alias __attribute((vis
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_DEBUG_ENABLED)
|
||||
#ifdef bottom_debugXML
|
||||
#undef xmlLsCountNode
|
||||
extern __typeof (xmlLsCountNode) xmlLsCountNode __attribute((alias("xmlLsCountNode__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlLsCountNode
|
||||
extern __typeof (xmlLsCountNode) xmlLsCountNode__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlLsCountNode xmlLsCountNode__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_DEBUG_ENABLED)
|
||||
#ifdef bottom_debugXML
|
||||
#undef xmlLsOneNode
|
||||
extern __typeof (xmlLsOneNode) xmlLsOneNode __attribute((alias("xmlLsOneNode__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlLsOneNode
|
||||
extern __typeof (xmlLsOneNode) xmlLsOneNode__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlLsOneNode xmlLsOneNode__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef bottom_xmlmemory
|
||||
#undef xmlMallocAtomicLoc
|
||||
extern __typeof (xmlMallocAtomicLoc) xmlMallocAtomicLoc __attribute((alias("xmlMallocAtomicLoc__internal_alias")));
|
||||
@ -9107,174 +8939,6 @@ extern __typeof (xmlSetupParserForBuffer) xmlSetupParserForBuffer__internal_alia
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
|
||||
#ifdef bottom_debugXML
|
||||
#undef xmlShell
|
||||
extern __typeof (xmlShell) xmlShell __attribute((alias("xmlShell__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlShell
|
||||
extern __typeof (xmlShell) xmlShell__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlShell xmlShell__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
|
||||
#ifdef bottom_debugXML
|
||||
#undef xmlShellBase
|
||||
extern __typeof (xmlShellBase) xmlShellBase __attribute((alias("xmlShellBase__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlShellBase
|
||||
extern __typeof (xmlShellBase) xmlShellBase__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlShellBase xmlShellBase__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
|
||||
#ifdef bottom_debugXML
|
||||
#undef xmlShellCat
|
||||
extern __typeof (xmlShellCat) xmlShellCat __attribute((alias("xmlShellCat__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlShellCat
|
||||
extern __typeof (xmlShellCat) xmlShellCat__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlShellCat xmlShellCat__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
|
||||
#ifdef bottom_debugXML
|
||||
#undef xmlShellDir
|
||||
extern __typeof (xmlShellDir) xmlShellDir __attribute((alias("xmlShellDir__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlShellDir
|
||||
extern __typeof (xmlShellDir) xmlShellDir__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlShellDir xmlShellDir__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
|
||||
#ifdef bottom_debugXML
|
||||
#undef xmlShellDu
|
||||
extern __typeof (xmlShellDu) xmlShellDu __attribute((alias("xmlShellDu__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlShellDu
|
||||
extern __typeof (xmlShellDu) xmlShellDu__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlShellDu xmlShellDu__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
|
||||
#ifdef bottom_debugXML
|
||||
#undef xmlShellList
|
||||
extern __typeof (xmlShellList) xmlShellList __attribute((alias("xmlShellList__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlShellList
|
||||
extern __typeof (xmlShellList) xmlShellList__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlShellList xmlShellList__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
|
||||
#ifdef bottom_debugXML
|
||||
#undef xmlShellLoad
|
||||
extern __typeof (xmlShellLoad) xmlShellLoad __attribute((alias("xmlShellLoad__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlShellLoad
|
||||
extern __typeof (xmlShellLoad) xmlShellLoad__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlShellLoad xmlShellLoad__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
|
||||
#ifdef bottom_debugXML
|
||||
#undef xmlShellPrintNode
|
||||
extern __typeof (xmlShellPrintNode) xmlShellPrintNode __attribute((alias("xmlShellPrintNode__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlShellPrintNode
|
||||
extern __typeof (xmlShellPrintNode) xmlShellPrintNode__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlShellPrintNode xmlShellPrintNode__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
|
||||
#ifdef bottom_debugXML
|
||||
#undef xmlShellPrintXPathError
|
||||
extern __typeof (xmlShellPrintXPathError) xmlShellPrintXPathError __attribute((alias("xmlShellPrintXPathError__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlShellPrintXPathError
|
||||
extern __typeof (xmlShellPrintXPathError) xmlShellPrintXPathError__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlShellPrintXPathError xmlShellPrintXPathError__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
|
||||
#ifdef bottom_debugXML
|
||||
#undef xmlShellPrintXPathResult
|
||||
extern __typeof (xmlShellPrintXPathResult) xmlShellPrintXPathResult __attribute((alias("xmlShellPrintXPathResult__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlShellPrintXPathResult
|
||||
extern __typeof (xmlShellPrintXPathResult) xmlShellPrintXPathResult__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlShellPrintXPathResult xmlShellPrintXPathResult__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED)
|
||||
#ifdef bottom_debugXML
|
||||
#undef xmlShellPwd
|
||||
extern __typeof (xmlShellPwd) xmlShellPwd __attribute((alias("xmlShellPwd__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlShellPwd
|
||||
extern __typeof (xmlShellPwd) xmlShellPwd__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlShellPwd xmlShellPwd__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
|
||||
#ifdef bottom_debugXML
|
||||
#undef xmlShellSave
|
||||
extern __typeof (xmlShellSave) xmlShellSave __attribute((alias("xmlShellSave__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlShellSave
|
||||
extern __typeof (xmlShellSave) xmlShellSave__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlShellSave xmlShellSave__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_VALID_ENABLED)
|
||||
#ifdef bottom_debugXML
|
||||
#undef xmlShellValidate
|
||||
extern __typeof (xmlShellValidate) xmlShellValidate __attribute((alias("xmlShellValidate__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlShellValidate
|
||||
extern __typeof (xmlShellValidate) xmlShellValidate__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlShellValidate xmlShellValidate__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_DEBUG_ENABLED) && defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_OUTPUT_ENABLED)
|
||||
#ifdef bottom_debugXML
|
||||
#undef xmlShellWrite
|
||||
extern __typeof (xmlShellWrite) xmlShellWrite __attribute((alias("xmlShellWrite__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlShellWrite
|
||||
extern __typeof (xmlShellWrite) xmlShellWrite__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlShellWrite xmlShellWrite__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef bottom_parser
|
||||
#undef xmlSkipBlankChars
|
||||
extern __typeof (xmlSkipBlankChars) xmlSkipBlankChars __attribute((alias("xmlSkipBlankChars__internal_alias")));
|
||||
@ -13893,7 +13557,7 @@ extern __typeof (xmlValidateElementDecl) xmlValidateElementDecl__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
|
||||
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
|
||||
#ifdef bottom_tree
|
||||
#undef xmlValidateNCName
|
||||
extern __typeof (xmlValidateNCName) xmlValidateNCName __attribute((alias("xmlValidateNCName__internal_alias")));
|
||||
@ -14577,30 +14241,6 @@ extern __typeof (xmlXPathCtxtCompile) xmlXPathCtxtCompile__internal_alias __attr
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
|
||||
#ifdef bottom_xpath
|
||||
#undef xmlXPathDebugDumpCompExpr
|
||||
extern __typeof (xmlXPathDebugDumpCompExpr) xmlXPathDebugDumpCompExpr __attribute((alias("xmlXPathDebugDumpCompExpr__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlXPathDebugDumpCompExpr
|
||||
extern __typeof (xmlXPathDebugDumpCompExpr) xmlXPathDebugDumpCompExpr__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlXPathDebugDumpCompExpr xmlXPathDebugDumpCompExpr__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_XPATH_ENABLED) && defined(LIBXML_DEBUG_ENABLED)
|
||||
#ifdef bottom_xpath
|
||||
#undef xmlXPathDebugDumpObject
|
||||
extern __typeof (xmlXPathDebugDumpObject) xmlXPathDebugDumpObject __attribute((alias("xmlXPathDebugDumpObject__internal_alias")));
|
||||
#else
|
||||
#ifndef xmlXPathDebugDumpObject
|
||||
extern __typeof (xmlXPathDebugDumpObject) xmlXPathDebugDumpObject__internal_alias __attribute((visibility("hidden")));
|
||||
#define xmlXPathDebugDumpObject xmlXPathDebugDumpObject__internal_alias
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(LIBXML_XPATH_ENABLED)
|
||||
#ifdef bottom_xpath
|
||||
#undef xmlXPathDifference
|
||||
|
@ -14,204 +14,4 @@
|
||||
#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__ */
|
||||
|
@ -616,7 +616,7 @@ struct _xmlDOMWrapCtxt {
|
||||
/*
|
||||
* Some helper functions
|
||||
*/
|
||||
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
|
||||
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
|
||||
XMLPUBFUN int XMLCALL
|
||||
xmlValidateNCName (const xmlChar *value,
|
||||
int space);
|
||||
@ -867,10 +867,10 @@ XMLPUBFUN xmlNodePtr XMLCALL
|
||||
*/
|
||||
XMLPUBFUN long XMLCALL
|
||||
xmlGetLineNo (xmlNodePtr node);
|
||||
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
|
||||
#if defined(LIBXML_TREE_ENABLED)
|
||||
XMLPUBFUN xmlChar * XMLCALL
|
||||
xmlGetNodePath (xmlNodePtr node);
|
||||
#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED) */
|
||||
#endif /* defined(LIBXML_TREE_ENABLED) */
|
||||
XMLPUBFUN xmlNodePtr XMLCALL
|
||||
xmlDocGetRootElement (xmlDocPtr doc);
|
||||
XMLPUBFUN xmlNodePtr XMLCALL
|
||||
|
@ -259,15 +259,6 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version);
|
||||
#define LIBXML_ISO8859X_ENABLED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LIBXML_DEBUG_ENABLED:
|
||||
*
|
||||
* Whether Debugging module is configured in
|
||||
*/
|
||||
#if 0
|
||||
#define LIBXML_DEBUG_ENABLED
|
||||
#endif
|
||||
|
||||
/**
|
||||
* DEBUG_MEMORY_LOCATION:
|
||||
*
|
||||
|
@ -356,16 +356,6 @@ 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.
|
||||
*/
|
||||
|
@ -923,11 +923,7 @@ xmlHasFeature(xmlFeature feature)
|
||||
return(0);
|
||||
#endif
|
||||
case XML_WITH_DEBUG:
|
||||
#ifdef LIBXML_DEBUG_ENABLED
|
||||
return(1);
|
||||
#else
|
||||
return(0);
|
||||
#endif
|
||||
case XML_WITH_DEBUG_MEM:
|
||||
#ifdef DEBUG_MEMORY_LOCATION
|
||||
return(1);
|
||||
|
@ -34,9 +34,6 @@
|
||||
#include <libxml/xmlerror.h>
|
||||
#include <libxml/parserInternals.h>
|
||||
#include <libxml/globals.h>
|
||||
#ifdef LIBXML_DEBUG_ENABLED
|
||||
#include <libxml/debugXML.h>
|
||||
#endif
|
||||
|
||||
int __xmlRegisterCallbacks = 0;
|
||||
|
||||
@ -346,7 +343,7 @@ xmlSplitQName3(const xmlChar *name, int *len) {
|
||||
|
||||
#define CUR_SCHAR(s, l) xmlStringCurrentChar(NULL, s, &l)
|
||||
|
||||
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_DEBUG_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
|
||||
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) || defined(LIBXML_SAX1_ENABLED) || defined(LIBXML_WRITER_ENABLED) || defined(LIBXML_DOCB_ENABLED)
|
||||
/**
|
||||
* xmlValidateNCName:
|
||||
* @value: the value to check
|
||||
@ -1196,11 +1193,6 @@ xmlFreeDoc(xmlDocPtr cur) {
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
#ifdef LIBXML_DEBUG_RUNTIME
|
||||
#ifdef LIBXML_DEBUG_ENABLED
|
||||
xmlDebugCheckDocument(stderr, cur);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (cur != NULL) dict = cur->dict;
|
||||
|
||||
@ -4527,7 +4519,7 @@ xmlGetLineNo(xmlNodePtr node)
|
||||
return result;
|
||||
}
|
||||
|
||||
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
|
||||
#if defined(LIBXML_TREE_ENABLED)
|
||||
/**
|
||||
* xmlGetNodePath:
|
||||
* @node: a node
|
||||
|
@ -31,9 +31,6 @@
|
||||
|
||||
/* #define DEBUG_XINCLUDE */
|
||||
#ifdef DEBUG_XINCLUDE
|
||||
#ifdef LIBXML_DEBUG_ENABLED
|
||||
#include <libxml/debugXML.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/************************************************************************
|
||||
|
@ -119,10 +119,6 @@ typedef enum {
|
||||
XMLLINT_ERR_MEM = 9, /* Out of memory error */
|
||||
XMLLINT_ERR_XPATH = 10 /* XPath evaluation error */
|
||||
} xmllintReturnCode;
|
||||
#ifdef LIBXML_DEBUG_ENABLED
|
||||
static int shell = 0;
|
||||
static int debugent = 0;
|
||||
#endif
|
||||
static int debug = 0;
|
||||
static int maxmem = 0;
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
@ -769,50 +765,6 @@ xmlHTMLValidityWarning(void *ctx, const char *msg, ...)
|
||||
* Shell Interface *
|
||||
* *
|
||||
************************************************************************/
|
||||
#ifdef LIBXML_DEBUG_ENABLED
|
||||
#ifdef LIBXML_XPATH_ENABLED
|
||||
/**
|
||||
* 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(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
|
||||
}
|
||||
#endif /* LIBXML_XPATH_ENABLED */
|
||||
#endif /* LIBXML_DEBUG_ENABLED */
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
@ -1758,7 +1710,7 @@ static void processNode(xmlTextReaderPtr reader) {
|
||||
match = xmlPatternMatch(patternc, xmlTextReaderCurrentNode(reader));
|
||||
|
||||
if (match) {
|
||||
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
|
||||
#if defined(LIBXML_TREE_ENABLED)
|
||||
path = xmlGetNodePath(xmlTextReaderCurrentNode(reader));
|
||||
printf("Node %s matches pattern %s\n", path, pattern);
|
||||
#else
|
||||
@ -1779,7 +1731,7 @@ static void processNode(xmlTextReaderPtr reader) {
|
||||
xmlFreeStreamCtxt(patstream);
|
||||
patstream = NULL;
|
||||
} else if (ret != match) {
|
||||
#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_DEBUG_ENABLED)
|
||||
#if defined(LIBXML_TREE_ENABLED)
|
||||
if (path == NULL) {
|
||||
path = xmlGetNodePath(
|
||||
xmlTextReaderCurrentNode(reader));
|
||||
@ -2363,18 +2315,6 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LIBXML_DEBUG_ENABLED
|
||||
#ifdef LIBXML_XPATH_ENABLED
|
||||
/*
|
||||
* shell interaction
|
||||
*/
|
||||
if (shell) {
|
||||
xmlXPathOrderDocElems(doc);
|
||||
xmlShell(doc, filename, xmlShellReadline, stdout);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
/*
|
||||
* test intermediate copy if needed.
|
||||
@ -2436,9 +2376,6 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
|
||||
/*
|
||||
* print it.
|
||||
*/
|
||||
#ifdef LIBXML_DEBUG_ENABLED
|
||||
if (!debug) {
|
||||
#endif
|
||||
if ((timing) && (!repeat)) {
|
||||
startTimer();
|
||||
}
|
||||
@ -2592,25 +2529,6 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
|
||||
if ((timing) && (!repeat)) {
|
||||
endTimer("Saving");
|
||||
}
|
||||
#ifdef LIBXML_DEBUG_ENABLED
|
||||
} else {
|
||||
FILE *out;
|
||||
if (output == NULL)
|
||||
out = stdout;
|
||||
else {
|
||||
out = fopen(output,"wb");
|
||||
}
|
||||
if (out != NULL) {
|
||||
xmlDebugDumpDocument(out, doc);
|
||||
|
||||
if (output != NULL)
|
||||
fclose(out);
|
||||
} else {
|
||||
fprintf(stderr, "failed to open %s\n", output);
|
||||
progresult = XMLLINT_ERR_OUT;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||
|
||||
@ -2797,13 +2715,6 @@ static void parseAndPrintFile(char *filename, xmlParserCtxtPtr rectxt) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LIBXML_DEBUG_ENABLED
|
||||
#if defined(LIBXML_VALID_ENABLED)
|
||||
if ((debugent) && (!html))
|
||||
xmlDebugDumpEntities(stderr, doc);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* free it.
|
||||
*/
|
||||
@ -2868,11 +2779,6 @@ static void usage(const char *name) {
|
||||
printf("\tParse the XML files\n");
|
||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||
printf("\t--version : display the version of the XML library used\n");
|
||||
#ifdef LIBXML_DEBUG_ENABLED
|
||||
printf("\t--debug : dump a debug tree of the in-memory document\n");
|
||||
printf("\t--shell : run a navigating shell\n");
|
||||
printf("\t--debugent : debug the entities defined in the document\n");
|
||||
#else
|
||||
#ifdef LIBXML_READER_ENABLED
|
||||
printf("\t--debug : dump the nodes content when using --stream\n");
|
||||
#endif /* LIBXML_READER_ENABLED */
|
||||
@ -3010,13 +2916,6 @@ main(int argc, char **argv) {
|
||||
if ((!strcmp(argv[i], "-debug")) || (!strcmp(argv[i], "--debug")))
|
||||
debug++;
|
||||
else
|
||||
#ifdef LIBXML_DEBUG_ENABLED
|
||||
if ((!strcmp(argv[i], "-shell")) ||
|
||||
(!strcmp(argv[i], "--shell"))) {
|
||||
shell++;
|
||||
noout = 1;
|
||||
} else
|
||||
#endif
|
||||
#ifdef LIBXML_TREE_ENABLED
|
||||
if ((!strcmp(argv[i], "-copy")) || (!strcmp(argv[i], "--copy")))
|
||||
copy++;
|
||||
@ -3173,13 +3072,6 @@ main(int argc, char **argv) {
|
||||
xmlPedanticParserDefault(1);
|
||||
options |= XML_PARSE_PEDANTIC;
|
||||
}
|
||||
#ifdef LIBXML_DEBUG_ENABLED
|
||||
else if ((!strcmp(argv[i], "-debugent")) ||
|
||||
(!strcmp(argv[i], "--debugent"))) {
|
||||
debugent++;
|
||||
xmlParserDebugEntities = 1;
|
||||
}
|
||||
#endif
|
||||
#ifdef LIBXML_C14N_ENABLED
|
||||
else if ((!strcmp(argv[i], "-c14n")) ||
|
||||
(!strcmp(argv[i], "--c14n"))) {
|
||||
|
@ -560,10 +560,6 @@ xmlTextReaderDebug(xmlTextReaderPtr reader) {
|
||||
if (reader->input->buffer == NULL) {
|
||||
fprintf(stderr, "buffer is NULL\n");
|
||||
} else {
|
||||
#ifdef LIBXML_DEBUG_ENABLED
|
||||
xmlDebugDumpString(stderr,
|
||||
&reader->input->buffer->content[reader->cur]);
|
||||
#endif
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
}
|
||||
|
@ -45,9 +45,6 @@
|
||||
#ifdef LIBXML_XPTR_ENABLED
|
||||
#include <libxml/xpointer.h>
|
||||
#endif
|
||||
#ifdef LIBXML_DEBUG_ENABLED
|
||||
#include <libxml/debugXML.h>
|
||||
#endif
|
||||
#include <libxml/xmlerror.h>
|
||||
#include <libxml/threads.h>
|
||||
#include <libxml/globals.h>
|
||||
@ -870,911 +867,6 @@ struct _xmlXPathContextCache {
|
||||
"Internal error at %s:%d\n", \
|
||||
__FILE__, __LINE__);
|
||||
|
||||
#ifdef LIBXML_DEBUG_ENABLED
|
||||
static void
|
||||
xmlXPathDebugDumpNode(FILE *output, xmlNodePtr cur, int depth) {
|
||||
int i;
|
||||
char shift[100];
|
||||
|
||||
for (i = 0;((i < depth) && (i < 25));i++)
|
||||
shift[2 * i] = shift[2 * i + 1] = ' ';
|
||||
shift[2 * i] = shift[2 * i + 1] = 0;
|
||||
if (cur == NULL) {
|
||||
fprintf(output, "%s", shift);
|
||||
fprintf(output, "Node is NULL !\n");
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if ((cur->type == XML_DOCUMENT_NODE) ||
|
||||
(cur->type == XML_HTML_DOCUMENT_NODE)) {
|
||||
fprintf(output, "%s", shift);
|
||||
fprintf(output, " /\n");
|
||||
} else if (cur->type == XML_ATTRIBUTE_NODE)
|
||||
xmlDebugDumpAttr(output, (xmlAttrPtr)cur, depth);
|
||||
else
|
||||
xmlDebugDumpOneNode(output, cur, depth);
|
||||
}
|
||||
static void
|
||||
xmlXPathDebugDumpNodeList(FILE *output, xmlNodePtr cur, int depth) {
|
||||
xmlNodePtr tmp;
|
||||
int i;
|
||||
char shift[100];
|
||||
|
||||
for (i = 0;((i < depth) && (i < 25));i++)
|
||||
shift[2 * i] = shift[2 * i + 1] = ' ';
|
||||
shift[2 * i] = shift[2 * i + 1] = 0;
|
||||
if (cur == NULL) {
|
||||
fprintf(output, "%s", shift);
|
||||
fprintf(output, "Node is NULL !\n");
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
while (cur != NULL) {
|
||||
tmp = cur;
|
||||
cur = cur->next;
|
||||
xmlDebugDumpOneNode(output, tmp, depth);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
xmlXPathDebugDumpNodeSet(FILE *output, xmlNodeSetPtr cur, int depth) {
|
||||
int i;
|
||||
char shift[100];
|
||||
|
||||
for (i = 0;((i < depth) && (i < 25));i++)
|
||||
shift[2 * i] = shift[2 * i + 1] = ' ';
|
||||
shift[2 * i] = shift[2 * i + 1] = 0;
|
||||
|
||||
if (cur == NULL) {
|
||||
fprintf(output, "%s", shift);
|
||||
fprintf(output, "NodeSet is NULL !\n");
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
if (cur != NULL) {
|
||||
fprintf(output, "Set contains %d nodes:\n", cur->nodeNr);
|
||||
for (i = 0;i < cur->nodeNr;i++) {
|
||||
fprintf(output, "%s", shift);
|
||||
fprintf(output, "%d", i + 1);
|
||||
xmlXPathDebugDumpNode(output, cur->nodeTab[i], depth + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
xmlXPathDebugDumpValueTree(FILE *output, xmlNodeSetPtr cur, int depth) {
|
||||
int i;
|
||||
char shift[100];
|
||||
|
||||
for (i = 0;((i < depth) && (i < 25));i++)
|
||||
shift[2 * i] = shift[2 * i + 1] = ' ';
|
||||
shift[2 * i] = shift[2 * i + 1] = 0;
|
||||
|
||||
if ((cur == NULL) || (cur->nodeNr == 0) || (cur->nodeTab[0] == NULL)) {
|
||||
fprintf(output, "%s", shift);
|
||||
fprintf(output, "Value Tree is NULL !\n");
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
fprintf(output, "%s", shift);
|
||||
fprintf(output, "%d", i + 1);
|
||||
xmlXPathDebugDumpNodeList(output, cur->nodeTab[0]->children, depth + 1);
|
||||
}
|
||||
#if defined(LIBXML_XPTR_ENABLED)
|
||||
static void
|
||||
xmlXPathDebugDumpLocationSet(FILE *output, xmlLocationSetPtr cur, int depth) {
|
||||
int i;
|
||||
char shift[100];
|
||||
|
||||
for (i = 0;((i < depth) && (i < 25));i++)
|
||||
shift[2 * i] = shift[2 * i + 1] = ' ';
|
||||
shift[2 * i] = shift[2 * i + 1] = 0;
|
||||
|
||||
if (cur == NULL) {
|
||||
fprintf(output, "%s", shift);
|
||||
fprintf(output, "LocationSet is NULL !\n");
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
for (i = 0;i < cur->locNr;i++) {
|
||||
fprintf(output, "%s", shift);
|
||||
fprintf(output, "%d : ", i + 1);
|
||||
xmlXPathDebugDumpObject(output, cur->locTab[i], depth + 1);
|
||||
}
|
||||
}
|
||||
#endif /* LIBXML_XPTR_ENABLED */
|
||||
|
||||
/**
|
||||
* xmlXPathDebugDumpObject:
|
||||
* @output: the FILE * to dump the output
|
||||
* @cur: the object to inspect
|
||||
* @depth: indentation level
|
||||
*
|
||||
* Dump the content of the object for debugging purposes
|
||||
*/
|
||||
void
|
||||
xmlXPathDebugDumpObject(FILE *output, xmlXPathObjectPtr cur, int depth) {
|
||||
int i;
|
||||
char shift[100];
|
||||
|
||||
if (output == NULL) return;
|
||||
|
||||
for (i = 0;((i < depth) && (i < 25));i++)
|
||||
shift[2 * i] = shift[2 * i + 1] = ' ';
|
||||
shift[2 * i] = shift[2 * i + 1] = 0;
|
||||
|
||||
|
||||
fprintf(output, "%s", shift);
|
||||
|
||||
if (cur == NULL) {
|
||||
fprintf(output, "Object is empty (NULL)\n");
|
||||
return;
|
||||
}
|
||||
switch(cur->type) {
|
||||
case XPATH_UNDEFINED:
|
||||
fprintf(output, "Object is uninitialized\n");
|
||||
break;
|
||||
case XPATH_NODESET:
|
||||
fprintf(output, "Object is a Node Set :\n");
|
||||
xmlXPathDebugDumpNodeSet(output, cur->nodesetval, depth);
|
||||
break;
|
||||
case XPATH_XSLT_TREE:
|
||||
fprintf(output, "Object is an XSLT value tree :\n");
|
||||
xmlXPathDebugDumpValueTree(output, cur->nodesetval, depth);
|
||||
break;
|
||||
case XPATH_BOOLEAN:
|
||||
fprintf(output, "Object is a Boolean : ");
|
||||
if (cur->boolval) fprintf(output, "true\n");
|
||||
else fprintf(output, "false\n");
|
||||
break;
|
||||
case XPATH_NUMBER:
|
||||
switch (xmlXPathIsInf(cur->floatval)) {
|
||||
case 1:
|
||||
fprintf(output, "Object is a number : Infinity\n");
|
||||
break;
|
||||
case -1:
|
||||
fprintf(output, "Object is a number : -Infinity\n");
|
||||
break;
|
||||
default:
|
||||
if (xmlXPathIsNaN(cur->floatval)) {
|
||||
fprintf(output, "Object is a number : NaN\n");
|
||||
} else if (cur->floatval == 0 && xmlXPathGetSign(cur->floatval) != 0) {
|
||||
fprintf(output, "Object is a number : 0\n");
|
||||
} else {
|
||||
fprintf(output, "Object is a number : %0g\n", cur->floatval);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case XPATH_STRING:
|
||||
fprintf(output, "Object is a string : ");
|
||||
xmlDebugDumpString(output, cur->stringval);
|
||||
fprintf(output, "\n");
|
||||
break;
|
||||
case XPATH_POINT:
|
||||
fprintf(output, "Object is a point : index %d in node", cur->index);
|
||||
xmlXPathDebugDumpNode(output, (xmlNodePtr) cur->user, depth + 1);
|
||||
fprintf(output, "\n");
|
||||
break;
|
||||
case XPATH_RANGE:
|
||||
if ((cur->user2 == NULL) ||
|
||||
((cur->user2 == cur->user) && (cur->index == cur->index2))) {
|
||||
fprintf(output, "Object is a collapsed range :\n");
|
||||
fprintf(output, "%s", shift);
|
||||
if (cur->index >= 0)
|
||||
fprintf(output, "index %d in ", cur->index);
|
||||
fprintf(output, "node\n");
|
||||
xmlXPathDebugDumpNode(output, (xmlNodePtr) cur->user,
|
||||
depth + 1);
|
||||
} else {
|
||||
fprintf(output, "Object is a range :\n");
|
||||
fprintf(output, "%s", shift);
|
||||
fprintf(output, "From ");
|
||||
if (cur->index >= 0)
|
||||
fprintf(output, "index %d in ", cur->index);
|
||||
fprintf(output, "node\n");
|
||||
xmlXPathDebugDumpNode(output, (xmlNodePtr) cur->user,
|
||||
depth + 1);
|
||||
fprintf(output, "%s", shift);
|
||||
fprintf(output, "To ");
|
||||
if (cur->index2 >= 0)
|
||||
fprintf(output, "index %d in ", cur->index2);
|
||||
fprintf(output, "node\n");
|
||||
xmlXPathDebugDumpNode(output, (xmlNodePtr) cur->user2,
|
||||
depth + 1);
|
||||
fprintf(output, "\n");
|
||||
}
|
||||
break;
|
||||
case XPATH_LOCATIONSET:
|
||||
#if defined(LIBXML_XPTR_ENABLED)
|
||||
fprintf(output, "Object is a Location Set:\n");
|
||||
xmlXPathDebugDumpLocationSet(output,
|
||||
(xmlLocationSetPtr) cur->user, depth);
|
||||
#endif
|
||||
break;
|
||||
case XPATH_USERS:
|
||||
fprintf(output, "Object is user defined\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
xmlXPathDebugDumpStepOp(FILE *output, xmlXPathCompExprPtr comp,
|
||||
xmlXPathStepOpPtr op, int depth) {
|
||||
int i;
|
||||
char shift[100];
|
||||
|
||||
for (i = 0;((i < depth) && (i < 25));i++)
|
||||
shift[2 * i] = shift[2 * i + 1] = ' ';
|
||||
shift[2 * i] = shift[2 * i + 1] = 0;
|
||||
|
||||
fprintf(output, "%s", shift);
|
||||
if (op == NULL) {
|
||||
fprintf(output, "Step is NULL\n");
|
||||
return;
|
||||
}
|
||||
switch (op->op) {
|
||||
case XPATH_OP_END:
|
||||
fprintf(output, "END"); break;
|
||||
case XPATH_OP_AND:
|
||||
fprintf(output, "AND"); break;
|
||||
case XPATH_OP_OR:
|
||||
fprintf(output, "OR"); break;
|
||||
case XPATH_OP_EQUAL:
|
||||
if (op->value)
|
||||
fprintf(output, "EQUAL =");
|
||||
else
|
||||
fprintf(output, "EQUAL !=");
|
||||
break;
|
||||
case XPATH_OP_CMP:
|
||||
if (op->value)
|
||||
fprintf(output, "CMP <");
|
||||
else
|
||||
fprintf(output, "CMP >");
|
||||
if (!op->value2)
|
||||
fprintf(output, "=");
|
||||
break;
|
||||
case XPATH_OP_PLUS:
|
||||
if (op->value == 0)
|
||||
fprintf(output, "PLUS -");
|
||||
else if (op->value == 1)
|
||||
fprintf(output, "PLUS +");
|
||||
else if (op->value == 2)
|
||||
fprintf(output, "PLUS unary -");
|
||||
else if (op->value == 3)
|
||||
fprintf(output, "PLUS unary - -");
|
||||
break;
|
||||
case XPATH_OP_MULT:
|
||||
if (op->value == 0)
|
||||
fprintf(output, "MULT *");
|
||||
else if (op->value == 1)
|
||||
fprintf(output, "MULT div");
|
||||
else
|
||||
fprintf(output, "MULT mod");
|
||||
break;
|
||||
case XPATH_OP_UNION:
|
||||
fprintf(output, "UNION"); break;
|
||||
case XPATH_OP_ROOT:
|
||||
fprintf(output, "ROOT"); break;
|
||||
case XPATH_OP_NODE:
|
||||
fprintf(output, "NODE"); break;
|
||||
case XPATH_OP_RESET:
|
||||
fprintf(output, "RESET"); break;
|
||||
case XPATH_OP_SORT:
|
||||
fprintf(output, "SORT"); break;
|
||||
case XPATH_OP_COLLECT: {
|
||||
xmlXPathAxisVal axis = (xmlXPathAxisVal)op->value;
|
||||
xmlXPathTestVal test = (xmlXPathTestVal)op->value2;
|
||||
xmlXPathTypeVal type = (xmlXPathTypeVal)op->value3;
|
||||
const xmlChar *prefix = op->value4;
|
||||
const xmlChar *name = op->value5;
|
||||
|
||||
fprintf(output, "COLLECT ");
|
||||
switch (axis) {
|
||||
case AXIS_ANCESTOR:
|
||||
fprintf(output, " 'ancestors' "); break;
|
||||
case AXIS_ANCESTOR_OR_SELF:
|
||||
fprintf(output, " 'ancestors-or-self' "); break;
|
||||
case AXIS_ATTRIBUTE:
|
||||
fprintf(output, " 'attributes' "); break;
|
||||
case AXIS_CHILD:
|
||||
fprintf(output, " 'child' "); break;
|
||||
case AXIS_DESCENDANT:
|
||||
fprintf(output, " 'descendant' "); break;
|
||||
case AXIS_DESCENDANT_OR_SELF:
|
||||
fprintf(output, " 'descendant-or-self' "); break;
|
||||
case AXIS_FOLLOWING:
|
||||
fprintf(output, " 'following' "); break;
|
||||
case AXIS_FOLLOWING_SIBLING:
|
||||
fprintf(output, " 'following-siblings' "); break;
|
||||
case AXIS_NAMESPACE:
|
||||
fprintf(output, " 'namespace' "); break;
|
||||
case AXIS_PARENT:
|
||||
fprintf(output, " 'parent' "); break;
|
||||
case AXIS_PRECEDING:
|
||||
fprintf(output, " 'preceding' "); break;
|
||||
case AXIS_PRECEDING_SIBLING:
|
||||
fprintf(output, " 'preceding-sibling' "); break;
|
||||
case AXIS_SELF:
|
||||
fprintf(output, " 'self' "); break;
|
||||
}
|
||||
switch (test) {
|
||||
case NODE_TEST_NONE:
|
||||
fprintf(output, "'none' "); break;
|
||||
case NODE_TEST_TYPE:
|
||||
fprintf(output, "'type' "); break;
|
||||
case NODE_TEST_PI:
|
||||
fprintf(output, "'PI' "); break;
|
||||
case NODE_TEST_ALL:
|
||||
fprintf(output, "'all' "); break;
|
||||
case NODE_TEST_NS:
|
||||
fprintf(output, "'namespace' "); break;
|
||||
case NODE_TEST_NAME:
|
||||
fprintf(output, "'name' "); break;
|
||||
}
|
||||
switch (type) {
|
||||
case NODE_TYPE_NODE:
|
||||
fprintf(output, "'node' "); break;
|
||||
case NODE_TYPE_COMMENT:
|
||||
fprintf(output, "'comment' "); break;
|
||||
case NODE_TYPE_TEXT:
|
||||
fprintf(output, "'text' "); break;
|
||||
case NODE_TYPE_PI:
|
||||
fprintf(output, "'PI' "); break;
|
||||
}
|
||||
if (prefix != NULL)
|
||||
fprintf(output, "%s:", prefix);
|
||||
if (name != NULL)
|
||||
fprintf(output, "%s", (const char *) name);
|
||||
break;
|
||||
|
||||
}
|
||||
case XPATH_OP_VALUE: {
|
||||
xmlXPathObjectPtr object = (xmlXPathObjectPtr) op->value4;
|
||||
|
||||
fprintf(output, "ELEM ");
|
||||
xmlXPathDebugDumpObject(output, object, 0);
|
||||
goto finish;
|
||||
}
|
||||
case XPATH_OP_VARIABLE: {
|
||||
const xmlChar *prefix = op->value5;
|
||||
const xmlChar *name = op->value4;
|
||||
|
||||
if (prefix != NULL)
|
||||
fprintf(output, "VARIABLE %s:%s", prefix, name);
|
||||
else
|
||||
fprintf(output, "VARIABLE %s", name);
|
||||
break;
|
||||
}
|
||||
case XPATH_OP_FUNCTION: {
|
||||
int nbargs = op->value;
|
||||
const xmlChar *prefix = op->value5;
|
||||
const xmlChar *name = op->value4;
|
||||
|
||||
if (prefix != NULL)
|
||||
fprintf(output, "FUNCTION %s:%s(%d args)",
|
||||
prefix, name, nbargs);
|
||||
else
|
||||
fprintf(output, "FUNCTION %s(%d args)", name, nbargs);
|
||||
break;
|
||||
}
|
||||
case XPATH_OP_ARG: fprintf(output, "ARG"); break;
|
||||
case XPATH_OP_PREDICATE: fprintf(output, "PREDICATE"); break;
|
||||
case XPATH_OP_FILTER: fprintf(output, "FILTER"); break;
|
||||
#ifdef LIBXML_XPTR_ENABLED
|
||||
case XPATH_OP_RANGETO: fprintf(output, "RANGETO"); break;
|
||||
#endif
|
||||
default:
|
||||
fprintf(output, "UNKNOWN %d\n", op->op); return;
|
||||
}
|
||||
fprintf(output, "\n");
|
||||
finish:
|
||||
if (op->ch1 >= 0)
|
||||
xmlXPathDebugDumpStepOp(output, comp, &comp->steps[op->ch1], depth + 1);
|
||||
if (op->ch2 >= 0)
|
||||
xmlXPathDebugDumpStepOp(output, comp, &comp->steps[op->ch2], depth + 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlXPathDebugDumpCompExpr:
|
||||
* @output: the FILE * for the output
|
||||
* @comp: the precompiled XPath expression
|
||||
* @depth: the indentation level.
|
||||
*
|
||||
* Dumps the tree of the compiled XPath expression.
|
||||
*/
|
||||
void
|
||||
xmlXPathDebugDumpCompExpr(FILE *output, xmlXPathCompExprPtr comp,
|
||||
int depth) {
|
||||
int i;
|
||||
char shift[100];
|
||||
|
||||
if ((output == NULL) || (comp == NULL)) return;
|
||||
|
||||
for (i = 0;((i < depth) && (i < 25));i++)
|
||||
shift[2 * i] = shift[2 * i + 1] = ' ';
|
||||
shift[2 * i] = shift[2 * i + 1] = 0;
|
||||
|
||||
fprintf(output, "%s", shift);
|
||||
|
||||
fprintf(output, "Compiled Expression : %d elements\n",
|
||||
comp->nbStep);
|
||||
i = comp->last;
|
||||
xmlXPathDebugDumpStepOp(output, comp, &comp->steps[i], depth + 1);
|
||||
}
|
||||
|
||||
#ifdef XP_DEBUG_OBJ_USAGE
|
||||
|
||||
/*
|
||||
* XPath object usage related debugging variables.
|
||||
*/
|
||||
static int xmlXPathDebugObjCounterUndefined = 0;
|
||||
static int xmlXPathDebugObjCounterNodeset = 0;
|
||||
static int xmlXPathDebugObjCounterBool = 0;
|
||||
static int xmlXPathDebugObjCounterNumber = 0;
|
||||
static int xmlXPathDebugObjCounterString = 0;
|
||||
static int xmlXPathDebugObjCounterPoint = 0;
|
||||
static int xmlXPathDebugObjCounterRange = 0;
|
||||
static int xmlXPathDebugObjCounterLocset = 0;
|
||||
static int xmlXPathDebugObjCounterUsers = 0;
|
||||
static int xmlXPathDebugObjCounterXSLTTree = 0;
|
||||
static int xmlXPathDebugObjCounterAll = 0;
|
||||
|
||||
static int xmlXPathDebugObjTotalUndefined = 0;
|
||||
static int xmlXPathDebugObjTotalNodeset = 0;
|
||||
static int xmlXPathDebugObjTotalBool = 0;
|
||||
static int xmlXPathDebugObjTotalNumber = 0;
|
||||
static int xmlXPathDebugObjTotalString = 0;
|
||||
static int xmlXPathDebugObjTotalPoint = 0;
|
||||
static int xmlXPathDebugObjTotalRange = 0;
|
||||
static int xmlXPathDebugObjTotalLocset = 0;
|
||||
static int xmlXPathDebugObjTotalUsers = 0;
|
||||
static int xmlXPathDebugObjTotalXSLTTree = 0;
|
||||
static int xmlXPathDebugObjTotalAll = 0;
|
||||
|
||||
static int xmlXPathDebugObjMaxUndefined = 0;
|
||||
static int xmlXPathDebugObjMaxNodeset = 0;
|
||||
static int xmlXPathDebugObjMaxBool = 0;
|
||||
static int xmlXPathDebugObjMaxNumber = 0;
|
||||
static int xmlXPathDebugObjMaxString = 0;
|
||||
static int xmlXPathDebugObjMaxPoint = 0;
|
||||
static int xmlXPathDebugObjMaxRange = 0;
|
||||
static int xmlXPathDebugObjMaxLocset = 0;
|
||||
static int xmlXPathDebugObjMaxUsers = 0;
|
||||
static int xmlXPathDebugObjMaxXSLTTree = 0;
|
||||
static int xmlXPathDebugObjMaxAll = 0;
|
||||
|
||||
/* REVISIT TODO: Make this static when committing */
|
||||
static void
|
||||
xmlXPathDebugObjUsageReset(xmlXPathContextPtr ctxt)
|
||||
{
|
||||
if (ctxt != NULL) {
|
||||
if (ctxt->cache != NULL) {
|
||||
xmlXPathContextCachePtr cache =
|
||||
(xmlXPathContextCachePtr) ctxt->cache;
|
||||
|
||||
cache->dbgCachedAll = 0;
|
||||
cache->dbgCachedNodeset = 0;
|
||||
cache->dbgCachedString = 0;
|
||||
cache->dbgCachedBool = 0;
|
||||
cache->dbgCachedNumber = 0;
|
||||
cache->dbgCachedPoint = 0;
|
||||
cache->dbgCachedRange = 0;
|
||||
cache->dbgCachedLocset = 0;
|
||||
cache->dbgCachedUsers = 0;
|
||||
cache->dbgCachedXSLTTree = 0;
|
||||
cache->dbgCachedUndefined = 0;
|
||||
|
||||
cache->dbgReusedAll = 0;
|
||||
cache->dbgReusedNodeset = 0;
|
||||
cache->dbgReusedString = 0;
|
||||
cache->dbgReusedBool = 0;
|
||||
cache->dbgReusedNumber = 0;
|
||||
cache->dbgReusedPoint = 0;
|
||||
cache->dbgReusedRange = 0;
|
||||
cache->dbgReusedLocset = 0;
|
||||
cache->dbgReusedUsers = 0;
|
||||
cache->dbgReusedXSLTTree = 0;
|
||||
cache->dbgReusedUndefined = 0;
|
||||
}
|
||||
}
|
||||
|
||||
xmlXPathDebugObjCounterUndefined = 0;
|
||||
xmlXPathDebugObjCounterNodeset = 0;
|
||||
xmlXPathDebugObjCounterBool = 0;
|
||||
xmlXPathDebugObjCounterNumber = 0;
|
||||
xmlXPathDebugObjCounterString = 0;
|
||||
xmlXPathDebugObjCounterPoint = 0;
|
||||
xmlXPathDebugObjCounterRange = 0;
|
||||
xmlXPathDebugObjCounterLocset = 0;
|
||||
xmlXPathDebugObjCounterUsers = 0;
|
||||
xmlXPathDebugObjCounterXSLTTree = 0;
|
||||
xmlXPathDebugObjCounterAll = 0;
|
||||
|
||||
xmlXPathDebugObjTotalUndefined = 0;
|
||||
xmlXPathDebugObjTotalNodeset = 0;
|
||||
xmlXPathDebugObjTotalBool = 0;
|
||||
xmlXPathDebugObjTotalNumber = 0;
|
||||
xmlXPathDebugObjTotalString = 0;
|
||||
xmlXPathDebugObjTotalPoint = 0;
|
||||
xmlXPathDebugObjTotalRange = 0;
|
||||
xmlXPathDebugObjTotalLocset = 0;
|
||||
xmlXPathDebugObjTotalUsers = 0;
|
||||
xmlXPathDebugObjTotalXSLTTree = 0;
|
||||
xmlXPathDebugObjTotalAll = 0;
|
||||
|
||||
xmlXPathDebugObjMaxUndefined = 0;
|
||||
xmlXPathDebugObjMaxNodeset = 0;
|
||||
xmlXPathDebugObjMaxBool = 0;
|
||||
xmlXPathDebugObjMaxNumber = 0;
|
||||
xmlXPathDebugObjMaxString = 0;
|
||||
xmlXPathDebugObjMaxPoint = 0;
|
||||
xmlXPathDebugObjMaxRange = 0;
|
||||
xmlXPathDebugObjMaxLocset = 0;
|
||||
xmlXPathDebugObjMaxUsers = 0;
|
||||
xmlXPathDebugObjMaxXSLTTree = 0;
|
||||
xmlXPathDebugObjMaxAll = 0;
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
xmlXPathDebugObjUsageRequested(xmlXPathContextPtr ctxt,
|
||||
xmlXPathObjectType objType)
|
||||
{
|
||||
int isCached = 0;
|
||||
|
||||
if (ctxt != NULL) {
|
||||
if (ctxt->cache != NULL) {
|
||||
xmlXPathContextCachePtr cache =
|
||||
(xmlXPathContextCachePtr) ctxt->cache;
|
||||
|
||||
isCached = 1;
|
||||
|
||||
cache->dbgReusedAll++;
|
||||
switch (objType) {
|
||||
case XPATH_UNDEFINED:
|
||||
cache->dbgReusedUndefined++;
|
||||
break;
|
||||
case XPATH_NODESET:
|
||||
cache->dbgReusedNodeset++;
|
||||
break;
|
||||
case XPATH_BOOLEAN:
|
||||
cache->dbgReusedBool++;
|
||||
break;
|
||||
case XPATH_NUMBER:
|
||||
cache->dbgReusedNumber++;
|
||||
break;
|
||||
case XPATH_STRING:
|
||||
cache->dbgReusedString++;
|
||||
break;
|
||||
case XPATH_POINT:
|
||||
cache->dbgReusedPoint++;
|
||||
break;
|
||||
case XPATH_RANGE:
|
||||
cache->dbgReusedRange++;
|
||||
break;
|
||||
case XPATH_LOCATIONSET:
|
||||
cache->dbgReusedLocset++;
|
||||
break;
|
||||
case XPATH_USERS:
|
||||
cache->dbgReusedUsers++;
|
||||
break;
|
||||
case XPATH_XSLT_TREE:
|
||||
cache->dbgReusedXSLTTree++;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
switch (objType) {
|
||||
case XPATH_UNDEFINED:
|
||||
if (! isCached)
|
||||
xmlXPathDebugObjTotalUndefined++;
|
||||
xmlXPathDebugObjCounterUndefined++;
|
||||
if (xmlXPathDebugObjCounterUndefined >
|
||||
xmlXPathDebugObjMaxUndefined)
|
||||
xmlXPathDebugObjMaxUndefined =
|
||||
xmlXPathDebugObjCounterUndefined;
|
||||
break;
|
||||
case XPATH_NODESET:
|
||||
if (! isCached)
|
||||
xmlXPathDebugObjTotalNodeset++;
|
||||
xmlXPathDebugObjCounterNodeset++;
|
||||
if (xmlXPathDebugObjCounterNodeset >
|
||||
xmlXPathDebugObjMaxNodeset)
|
||||
xmlXPathDebugObjMaxNodeset =
|
||||
xmlXPathDebugObjCounterNodeset;
|
||||
break;
|
||||
case XPATH_BOOLEAN:
|
||||
if (! isCached)
|
||||
xmlXPathDebugObjTotalBool++;
|
||||
xmlXPathDebugObjCounterBool++;
|
||||
if (xmlXPathDebugObjCounterBool >
|
||||
xmlXPathDebugObjMaxBool)
|
||||
xmlXPathDebugObjMaxBool =
|
||||
xmlXPathDebugObjCounterBool;
|
||||
break;
|
||||
case XPATH_NUMBER:
|
||||
if (! isCached)
|
||||
xmlXPathDebugObjTotalNumber++;
|
||||
xmlXPathDebugObjCounterNumber++;
|
||||
if (xmlXPathDebugObjCounterNumber >
|
||||
xmlXPathDebugObjMaxNumber)
|
||||
xmlXPathDebugObjMaxNumber =
|
||||
xmlXPathDebugObjCounterNumber;
|
||||
break;
|
||||
case XPATH_STRING:
|
||||
if (! isCached)
|
||||
xmlXPathDebugObjTotalString++;
|
||||
xmlXPathDebugObjCounterString++;
|
||||
if (xmlXPathDebugObjCounterString >
|
||||
xmlXPathDebugObjMaxString)
|
||||
xmlXPathDebugObjMaxString =
|
||||
xmlXPathDebugObjCounterString;
|
||||
break;
|
||||
case XPATH_POINT:
|
||||
if (! isCached)
|
||||
xmlXPathDebugObjTotalPoint++;
|
||||
xmlXPathDebugObjCounterPoint++;
|
||||
if (xmlXPathDebugObjCounterPoint >
|
||||
xmlXPathDebugObjMaxPoint)
|
||||
xmlXPathDebugObjMaxPoint =
|
||||
xmlXPathDebugObjCounterPoint;
|
||||
break;
|
||||
case XPATH_RANGE:
|
||||
if (! isCached)
|
||||
xmlXPathDebugObjTotalRange++;
|
||||
xmlXPathDebugObjCounterRange++;
|
||||
if (xmlXPathDebugObjCounterRange >
|
||||
xmlXPathDebugObjMaxRange)
|
||||
xmlXPathDebugObjMaxRange =
|
||||
xmlXPathDebugObjCounterRange;
|
||||
break;
|
||||
case XPATH_LOCATIONSET:
|
||||
if (! isCached)
|
||||
xmlXPathDebugObjTotalLocset++;
|
||||
xmlXPathDebugObjCounterLocset++;
|
||||
if (xmlXPathDebugObjCounterLocset >
|
||||
xmlXPathDebugObjMaxLocset)
|
||||
xmlXPathDebugObjMaxLocset =
|
||||
xmlXPathDebugObjCounterLocset;
|
||||
break;
|
||||
case XPATH_USERS:
|
||||
if (! isCached)
|
||||
xmlXPathDebugObjTotalUsers++;
|
||||
xmlXPathDebugObjCounterUsers++;
|
||||
if (xmlXPathDebugObjCounterUsers >
|
||||
xmlXPathDebugObjMaxUsers)
|
||||
xmlXPathDebugObjMaxUsers =
|
||||
xmlXPathDebugObjCounterUsers;
|
||||
break;
|
||||
case XPATH_XSLT_TREE:
|
||||
if (! isCached)
|
||||
xmlXPathDebugObjTotalXSLTTree++;
|
||||
xmlXPathDebugObjCounterXSLTTree++;
|
||||
if (xmlXPathDebugObjCounterXSLTTree >
|
||||
xmlXPathDebugObjMaxXSLTTree)
|
||||
xmlXPathDebugObjMaxXSLTTree =
|
||||
xmlXPathDebugObjCounterXSLTTree;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (! isCached)
|
||||
xmlXPathDebugObjTotalAll++;
|
||||
xmlXPathDebugObjCounterAll++;
|
||||
if (xmlXPathDebugObjCounterAll >
|
||||
xmlXPathDebugObjMaxAll)
|
||||
xmlXPathDebugObjMaxAll =
|
||||
xmlXPathDebugObjCounterAll;
|
||||
}
|
||||
|
||||
static void
|
||||
xmlXPathDebugObjUsageReleased(xmlXPathContextPtr ctxt,
|
||||
xmlXPathObjectType objType)
|
||||
{
|
||||
int isCached = 0;
|
||||
|
||||
if (ctxt != NULL) {
|
||||
if (ctxt->cache != NULL) {
|
||||
xmlXPathContextCachePtr cache =
|
||||
(xmlXPathContextCachePtr) ctxt->cache;
|
||||
|
||||
isCached = 1;
|
||||
|
||||
cache->dbgCachedAll++;
|
||||
switch (objType) {
|
||||
case XPATH_UNDEFINED:
|
||||
cache->dbgCachedUndefined++;
|
||||
break;
|
||||
case XPATH_NODESET:
|
||||
cache->dbgCachedNodeset++;
|
||||
break;
|
||||
case XPATH_BOOLEAN:
|
||||
cache->dbgCachedBool++;
|
||||
break;
|
||||
case XPATH_NUMBER:
|
||||
cache->dbgCachedNumber++;
|
||||
break;
|
||||
case XPATH_STRING:
|
||||
cache->dbgCachedString++;
|
||||
break;
|
||||
case XPATH_POINT:
|
||||
cache->dbgCachedPoint++;
|
||||
break;
|
||||
case XPATH_RANGE:
|
||||
cache->dbgCachedRange++;
|
||||
break;
|
||||
case XPATH_LOCATIONSET:
|
||||
cache->dbgCachedLocset++;
|
||||
break;
|
||||
case XPATH_USERS:
|
||||
cache->dbgCachedUsers++;
|
||||
break;
|
||||
case XPATH_XSLT_TREE:
|
||||
cache->dbgCachedXSLTTree++;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
switch (objType) {
|
||||
case XPATH_UNDEFINED:
|
||||
xmlXPathDebugObjCounterUndefined--;
|
||||
break;
|
||||
case XPATH_NODESET:
|
||||
xmlXPathDebugObjCounterNodeset--;
|
||||
break;
|
||||
case XPATH_BOOLEAN:
|
||||
xmlXPathDebugObjCounterBool--;
|
||||
break;
|
||||
case XPATH_NUMBER:
|
||||
xmlXPathDebugObjCounterNumber--;
|
||||
break;
|
||||
case XPATH_STRING:
|
||||
xmlXPathDebugObjCounterString--;
|
||||
break;
|
||||
case XPATH_POINT:
|
||||
xmlXPathDebugObjCounterPoint--;
|
||||
break;
|
||||
case XPATH_RANGE:
|
||||
xmlXPathDebugObjCounterRange--;
|
||||
break;
|
||||
case XPATH_LOCATIONSET:
|
||||
xmlXPathDebugObjCounterLocset--;
|
||||
break;
|
||||
case XPATH_USERS:
|
||||
xmlXPathDebugObjCounterUsers--;
|
||||
break;
|
||||
case XPATH_XSLT_TREE:
|
||||
xmlXPathDebugObjCounterXSLTTree--;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
xmlXPathDebugObjCounterAll--;
|
||||
}
|
||||
|
||||
/* REVISIT TODO: Make this static when committing */
|
||||
static void
|
||||
xmlXPathDebugObjUsageDisplay(xmlXPathContextPtr ctxt)
|
||||
{
|
||||
int reqAll, reqNodeset, reqString, reqBool, reqNumber,
|
||||
reqXSLTTree, reqUndefined;
|
||||
int caAll = 0, caNodeset = 0, caString = 0, caBool = 0,
|
||||
caNumber = 0, caXSLTTree = 0, caUndefined = 0;
|
||||
int reAll = 0, reNodeset = 0, reString = 0, reBool = 0,
|
||||
reNumber = 0, reXSLTTree = 0, reUndefined = 0;
|
||||
int leftObjs = xmlXPathDebugObjCounterAll;
|
||||
|
||||
reqAll = xmlXPathDebugObjTotalAll;
|
||||
reqNodeset = xmlXPathDebugObjTotalNodeset;
|
||||
reqString = xmlXPathDebugObjTotalString;
|
||||
reqBool = xmlXPathDebugObjTotalBool;
|
||||
reqNumber = xmlXPathDebugObjTotalNumber;
|
||||
reqXSLTTree = xmlXPathDebugObjTotalXSLTTree;
|
||||
reqUndefined = xmlXPathDebugObjTotalUndefined;
|
||||
|
||||
printf("# XPath object usage:\n");
|
||||
|
||||
if (ctxt != NULL) {
|
||||
if (ctxt->cache != NULL) {
|
||||
xmlXPathContextCachePtr cache =
|
||||
(xmlXPathContextCachePtr) ctxt->cache;
|
||||
|
||||
reAll = cache->dbgReusedAll;
|
||||
reqAll += reAll;
|
||||
reNodeset = cache->dbgReusedNodeset;
|
||||
reqNodeset += reNodeset;
|
||||
reString = cache->dbgReusedString;
|
||||
reqString += reString;
|
||||
reBool = cache->dbgReusedBool;
|
||||
reqBool += reBool;
|
||||
reNumber = cache->dbgReusedNumber;
|
||||
reqNumber += reNumber;
|
||||
reXSLTTree = cache->dbgReusedXSLTTree;
|
||||
reqXSLTTree += reXSLTTree;
|
||||
reUndefined = cache->dbgReusedUndefined;
|
||||
reqUndefined += reUndefined;
|
||||
|
||||
caAll = cache->dbgCachedAll;
|
||||
caBool = cache->dbgCachedBool;
|
||||
caNodeset = cache->dbgCachedNodeset;
|
||||
caString = cache->dbgCachedString;
|
||||
caNumber = cache->dbgCachedNumber;
|
||||
caXSLTTree = cache->dbgCachedXSLTTree;
|
||||
caUndefined = cache->dbgCachedUndefined;
|
||||
|
||||
if (cache->nodesetObjs)
|
||||
leftObjs -= cache->nodesetObjs->number;
|
||||
if (cache->stringObjs)
|
||||
leftObjs -= cache->stringObjs->number;
|
||||
if (cache->booleanObjs)
|
||||
leftObjs -= cache->booleanObjs->number;
|
||||
if (cache->numberObjs)
|
||||
leftObjs -= cache->numberObjs->number;
|
||||
if (cache->miscObjs)
|
||||
leftObjs -= cache->miscObjs->number;
|
||||
}
|
||||
}
|
||||
|
||||
printf("# all\n");
|
||||
printf("# total : %d\n", reqAll);
|
||||
printf("# left : %d\n", leftObjs);
|
||||
printf("# created: %d\n", xmlXPathDebugObjTotalAll);
|
||||
printf("# reused : %d\n", reAll);
|
||||
printf("# max : %d\n", xmlXPathDebugObjMaxAll);
|
||||
|
||||
printf("# node-sets\n");
|
||||
printf("# total : %d\n", reqNodeset);
|
||||
printf("# created: %d\n", xmlXPathDebugObjTotalNodeset);
|
||||
printf("# reused : %d\n", reNodeset);
|
||||
printf("# max : %d\n", xmlXPathDebugObjMaxNodeset);
|
||||
|
||||
printf("# strings\n");
|
||||
printf("# total : %d\n", reqString);
|
||||
printf("# created: %d\n", xmlXPathDebugObjTotalString);
|
||||
printf("# reused : %d\n", reString);
|
||||
printf("# max : %d\n", xmlXPathDebugObjMaxString);
|
||||
|
||||
printf("# booleans\n");
|
||||
printf("# total : %d\n", reqBool);
|
||||
printf("# created: %d\n", xmlXPathDebugObjTotalBool);
|
||||
printf("# reused : %d\n", reBool);
|
||||
printf("# max : %d\n", xmlXPathDebugObjMaxBool);
|
||||
|
||||
printf("# numbers\n");
|
||||
printf("# total : %d\n", reqNumber);
|
||||
printf("# created: %d\n", xmlXPathDebugObjTotalNumber);
|
||||
printf("# reused : %d\n", reNumber);
|
||||
printf("# max : %d\n", xmlXPathDebugObjMaxNumber);
|
||||
|
||||
printf("# XSLT result tree fragments\n");
|
||||
printf("# total : %d\n", reqXSLTTree);
|
||||
printf("# created: %d\n", xmlXPathDebugObjTotalXSLTTree);
|
||||
printf("# reused : %d\n", reXSLTTree);
|
||||
printf("# max : %d\n", xmlXPathDebugObjMaxXSLTTree);
|
||||
|
||||
printf("# undefined\n");
|
||||
printf("# total : %d\n", reqUndefined);
|
||||
printf("# created: %d\n", xmlXPathDebugObjTotalUndefined);
|
||||
printf("# reused : %d\n", reUndefined);
|
||||
printf("# max : %d\n", xmlXPathDebugObjMaxUndefined);
|
||||
|
||||
}
|
||||
|
||||
#endif /* XP_DEBUG_OBJ_USAGE */
|
||||
|
||||
#endif /* LIBXML_DEBUG_ENABLED */
|
||||
|
||||
/************************************************************************
|
||||
* *
|
||||
* XPath object caching *
|
||||
|
@ -40,13 +40,6 @@
|
||||
/* Add support of the xmlns() xpointer scheme to initialize the namespaces */
|
||||
#define XPTR_XMLNS_SCHEME
|
||||
|
||||
/* #define DEBUG_RANGES */
|
||||
#ifdef DEBUG_RANGES
|
||||
#ifdef LIBXML_DEBUG_ENABLED
|
||||
#include <libxml/debugXML.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define TODO \
|
||||
xmlGenericError(xmlGenericErrorContext, \
|
||||
"Unimplemented block at %s:%d\n", \
|
||||
@ -730,10 +723,6 @@ xmlXPtrLocationSetDel(xmlLocationSetPtr cur, xmlXPathObjectPtr val) {
|
||||
if (cur->locTab[i] == val) break;
|
||||
|
||||
if (i >= cur->locNr) {
|
||||
#ifdef DEBUG
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"xmlXPtrLocationSetDel: Range wasn't found in RangeList\n");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
cur->locNr--;
|
||||
@ -2479,13 +2468,6 @@ xmlXPtrMatchString(const xmlChar *string, xmlNodePtr start, int startindex,
|
||||
if (len >= pos + stringlen) {
|
||||
match = (!xmlStrncmp(&cur->content[pos], string, stringlen));
|
||||
if (match) {
|
||||
#ifdef DEBUG_RANGES
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"found range %d bytes at index %d of ->",
|
||||
stringlen, pos + 1);
|
||||
xmlDebugDumpString(stdout, cur->content);
|
||||
xmlGenericError(xmlGenericErrorContext, "\n");
|
||||
#endif
|
||||
*end = cur;
|
||||
*endindex = pos + stringlen;
|
||||
return(1);
|
||||
@ -2496,13 +2478,6 @@ xmlXPtrMatchString(const xmlChar *string, xmlNodePtr start, int startindex,
|
||||
int sub = len - pos;
|
||||
match = (!xmlStrncmp(&cur->content[pos], string, sub));
|
||||
if (match) {
|
||||
#ifdef DEBUG_RANGES
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"found subrange %d bytes at index %d of ->",
|
||||
sub, pos + 1);
|
||||
xmlDebugDumpString(stdout, cur->content);
|
||||
xmlGenericError(xmlGenericErrorContext, "\n");
|
||||
#endif
|
||||
string = &string[sub];
|
||||
stringlen -= sub;
|
||||
} else {
|
||||
@ -2563,13 +2538,6 @@ xmlXPtrSearchString(const xmlChar *string, xmlNodePtr *start, int *startindex,
|
||||
str = xmlStrchr(&cur->content[pos], first);
|
||||
if (str != NULL) {
|
||||
pos = (str - (xmlChar *)(cur->content));
|
||||
#ifdef DEBUG_RANGES
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"found '%c' at index %d of ->",
|
||||
first, pos + 1);
|
||||
xmlDebugDumpString(stdout, cur->content);
|
||||
xmlGenericError(xmlGenericErrorContext, "\n");
|
||||
#endif
|
||||
if (xmlXPtrMatchString(string, cur, pos + 1,
|
||||
end, endindex)) {
|
||||
*start = cur;
|
||||
@ -2586,13 +2554,6 @@ xmlXPtrSearchString(const xmlChar *string, xmlNodePtr *start, int *startindex,
|
||||
* character of the string-value and after the final
|
||||
* character.
|
||||
*/
|
||||
#ifdef DEBUG_RANGES
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"found '' at index %d of ->",
|
||||
pos + 1);
|
||||
xmlDebugDumpString(stdout, cur->content);
|
||||
xmlGenericError(xmlGenericErrorContext, "\n");
|
||||
#endif
|
||||
*start = cur;
|
||||
*startindex = pos + 1;
|
||||
*end = cur;
|
||||
@ -2825,25 +2786,12 @@ xmlXPtrStringRangeFunction(xmlXPathParserContextPtr ctxt, int nargs) {
|
||||
* the list of location set corresponding to that search
|
||||
*/
|
||||
for (i = 0;i < oldset->locNr;i++) {
|
||||
#ifdef DEBUG_RANGES
|
||||
xmlXPathDebugDumpObject(stdout, oldset->locTab[i], 0);
|
||||
#endif
|
||||
|
||||
xmlXPtrGetStartPoint(oldset->locTab[i], &start, &startindex);
|
||||
xmlXPtrGetEndPoint(oldset->locTab[i], &end, &endindex);
|
||||
xmlXPtrAdvanceChar(&start, &startindex, 0);
|
||||
xmlXPtrGetLastChar(&end, &endindex);
|
||||
|
||||
#ifdef DEBUG_RANGES
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"from index %d of ->", startindex);
|
||||
xmlDebugDumpString(stdout, start->content);
|
||||
xmlGenericError(xmlGenericErrorContext, "\n");
|
||||
xmlGenericError(xmlGenericErrorContext,
|
||||
"to index %d of ->", endindex);
|
||||
xmlDebugDumpString(stdout, end->content);
|
||||
xmlGenericError(xmlGenericErrorContext, "\n");
|
||||
#endif
|
||||
do {
|
||||
fend = end;
|
||||
fendindex = endindex;
|
||||
|
Loading…
Reference in New Issue
Block a user