mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
globals: Move remaining globals back to correct header files
This undoes a lot of damage.
This commit is contained in:
@ -14,18 +14,17 @@
|
|||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include <libxml/HTMLparser.h>
|
||||||
#include <libxml/xmlmemory.h>
|
#include <libxml/xmlmemory.h>
|
||||||
#include <libxml/tree.h>
|
#include <libxml/tree.h>
|
||||||
#include <libxml/parser.h>
|
#include <libxml/parser.h>
|
||||||
#include <libxml/parserInternals.h>
|
#include <libxml/parserInternals.h>
|
||||||
#include <libxml/xmlerror.h>
|
#include <libxml/xmlerror.h>
|
||||||
#include <libxml/HTMLparser.h>
|
|
||||||
#include <libxml/HTMLtree.h>
|
#include <libxml/HTMLtree.h>
|
||||||
#include <libxml/entities.h>
|
#include <libxml/entities.h>
|
||||||
#include <libxml/encoding.h>
|
#include <libxml/encoding.h>
|
||||||
#include <libxml/valid.h>
|
#include <libxml/valid.h>
|
||||||
#include <libxml/xmlIO.h>
|
#include <libxml/xmlIO.h>
|
||||||
#include <libxml/globals.h>
|
|
||||||
#include <libxml/uri.h>
|
#include <libxml/uri.h>
|
||||||
|
|
||||||
#include "private/buf.h"
|
#include "private/buf.h"
|
||||||
|
38
globals.c
38
globals.c
@ -19,7 +19,11 @@
|
|||||||
#include <libxml/globals.h>
|
#include <libxml/globals.h>
|
||||||
#include <libxml/xmlerror.h>
|
#include <libxml/xmlerror.h>
|
||||||
#include <libxml/xmlmemory.h>
|
#include <libxml/xmlmemory.h>
|
||||||
|
#include <libxml/xmlIO.h>
|
||||||
|
#include <libxml/HTMLparser.h>
|
||||||
|
#include <libxml/parser.h>
|
||||||
#include <libxml/threads.h>
|
#include <libxml/threads.h>
|
||||||
|
#include <libxml/tree.h>
|
||||||
#include <libxml/SAX.h>
|
#include <libxml/SAX.h>
|
||||||
#include <libxml/SAX2.h>
|
#include <libxml/SAX2.h>
|
||||||
|
|
||||||
@ -80,9 +84,13 @@ struct _xmlGlobalState {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define XML_OP XML_DECLARE_MEMBER
|
#define XML_OP XML_DECLARE_MEMBER
|
||||||
XML_GLOBALS
|
|
||||||
XML_GLOBALS_ALLOC
|
XML_GLOBALS_ALLOC
|
||||||
XML_GLOBALS_ERROR
|
XML_GLOBALS_ERROR
|
||||||
|
XML_GLOBALS_HTML
|
||||||
|
XML_GLOBALS_IO
|
||||||
|
XML_GLOBALS_PARSER
|
||||||
|
XML_GLOBALS_SAVE
|
||||||
|
XML_GLOBALS_TREE
|
||||||
#undef XML_OP
|
#undef XML_OP
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -389,6 +397,7 @@ void *xmlStructuredErrorContext = NULL;
|
|||||||
static void *xmlStructuredErrorContextThrDef = NULL;
|
static void *xmlStructuredErrorContextThrDef = NULL;
|
||||||
xmlError xmlLastError;
|
xmlError xmlLastError;
|
||||||
|
|
||||||
|
#ifdef LIBXML_OUTPUT_ENABLED
|
||||||
/*
|
/*
|
||||||
* output defaults
|
* output defaults
|
||||||
*/
|
*/
|
||||||
@ -419,6 +428,7 @@ static const char *xmlTreeIndentStringThrDef = " ";
|
|||||||
*/
|
*/
|
||||||
int xmlSaveNoEmptyTags = 0;
|
int xmlSaveNoEmptyTags = 0;
|
||||||
static int xmlSaveNoEmptyTagsThrDef = 0;
|
static int xmlSaveNoEmptyTagsThrDef = 0;
|
||||||
|
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||||
|
|
||||||
#ifdef LIBXML_SAX1_ENABLED
|
#ifdef LIBXML_SAX1_ENABLED
|
||||||
/**
|
/**
|
||||||
@ -980,6 +990,7 @@ int xmlThrDefGetWarningsDefaultValue(int v) {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef LIBXML_OUTPUT_ENABLED
|
||||||
int xmlThrDefIndentTreeOutput(int v) {
|
int xmlThrDefIndentTreeOutput(int v) {
|
||||||
int ret;
|
int ret;
|
||||||
xmlMutexLock(&xmlThrDefMutex);
|
xmlMutexLock(&xmlThrDefMutex);
|
||||||
@ -998,6 +1009,16 @@ const char * xmlThrDefTreeIndentString(const char * v) {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int xmlThrDefSaveNoEmptyTags(int v) {
|
||||||
|
int ret;
|
||||||
|
xmlMutexLock(&xmlThrDefMutex);
|
||||||
|
ret = xmlSaveNoEmptyTagsThrDef;
|
||||||
|
xmlSaveNoEmptyTagsThrDef = v;
|
||||||
|
xmlMutexUnlock(&xmlThrDefMutex);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
int xmlThrDefKeepBlanksDefaultValue(int v) {
|
int xmlThrDefKeepBlanksDefaultValue(int v) {
|
||||||
int ret;
|
int ret;
|
||||||
xmlMutexLock(&xmlThrDefMutex);
|
xmlMutexLock(&xmlThrDefMutex);
|
||||||
@ -1043,15 +1064,6 @@ int xmlThrDefPedanticParserDefaultValue(int v) {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int xmlThrDefSaveNoEmptyTags(int v) {
|
|
||||||
int ret;
|
|
||||||
xmlMutexLock(&xmlThrDefMutex);
|
|
||||||
ret = xmlSaveNoEmptyTagsThrDef;
|
|
||||||
xmlSaveNoEmptyTagsThrDef = v;
|
|
||||||
xmlMutexUnlock(&xmlThrDefMutex);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
int xmlThrDefSubstituteEntitiesDefaultValue(int v) {
|
int xmlThrDefSubstituteEntitiesDefaultValue(int v) {
|
||||||
int ret;
|
int ret;
|
||||||
xmlMutexLock(&xmlThrDefMutex);
|
xmlMutexLock(&xmlThrDefMutex);
|
||||||
@ -1138,9 +1150,13 @@ xmlThrDefOutputBufferCreateFilenameDefault(xmlOutputBufferCreateFilenameFunc fun
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define XML_OP XML_DEFINE_GLOBAL_WRAPPER
|
#define XML_OP XML_DEFINE_GLOBAL_WRAPPER
|
||||||
XML_GLOBALS
|
|
||||||
XML_GLOBALS_ALLOC
|
XML_GLOBALS_ALLOC
|
||||||
XML_GLOBALS_ERROR
|
XML_GLOBALS_ERROR
|
||||||
|
XML_GLOBALS_HTML
|
||||||
|
XML_GLOBALS_IO
|
||||||
|
XML_GLOBALS_PARSER
|
||||||
|
XML_GLOBALS_SAVE
|
||||||
|
XML_GLOBALS_TREE
|
||||||
#undef XML_OP
|
#undef XML_OP
|
||||||
|
|
||||||
/* For backward compatibility */
|
/* For backward compatibility */
|
||||||
|
@ -80,6 +80,17 @@ struct _htmlEntityDesc {
|
|||||||
const char *desc; /* the description */
|
const char *desc; /* the description */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define XML_GLOBALS_HTML \
|
||||||
|
XML_OP(htmlDefaultSAXHandler, xmlSAXHandlerV1, XML_DEPRECATED)
|
||||||
|
|
||||||
|
#define XML_OP XML_DECLARE_GLOBAL
|
||||||
|
XML_GLOBALS_HTML
|
||||||
|
#undef XML_OP
|
||||||
|
|
||||||
|
#if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION)
|
||||||
|
#define htmlDefaultSAXHandler XML_GLOBAL_MACRO(htmlDefaultSAXHandler)
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* There is only few public functions.
|
* There is only few public functions.
|
||||||
*/
|
*/
|
||||||
@ -316,5 +327,9 @@ XMLPUBFUN htmlStatus htmlNodeStatus(const htmlNodePtr, int) ;
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#else /* LIBXML_HTML_ENABLED */
|
||||||
|
|
||||||
|
#define XML_GLOBALS_HTML
|
||||||
|
|
||||||
#endif /* LIBXML_HTML_ENABLED */
|
#endif /* LIBXML_HTML_ENABLED */
|
||||||
#endif /* __HTML_PARSER_H__ */
|
#endif /* __HTML_PARSER_H__ */
|
||||||
|
@ -12,8 +12,11 @@
|
|||||||
#define __XML_GLOBALS_H
|
#define __XML_GLOBALS_H
|
||||||
|
|
||||||
#include <libxml/xmlversion.h>
|
#include <libxml/xmlversion.h>
|
||||||
|
#include <libxml/HTMLparser.h>
|
||||||
#include <libxml/parser.h>
|
#include <libxml/parser.h>
|
||||||
#include <libxml/xmlerror.h>
|
#include <libxml/xmlerror.h>
|
||||||
|
#include <libxml/xmlIO.h>
|
||||||
|
#include <libxml/xmlsave.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -83,86 +86,6 @@ xmlDllMain(void *hinstDLL, unsigned long fdwReason,
|
|||||||
#endif
|
#endif
|
||||||
/** DOC_ENABLE */
|
/** DOC_ENABLE */
|
||||||
|
|
||||||
/* Declare globals with macro magic */
|
|
||||||
|
|
||||||
#define XML_GLOBALS_CORE \
|
|
||||||
/* output options */ \
|
|
||||||
XML_OP(xmlIndentTreeOutput, int, XML_EMPTY) \
|
|
||||||
XML_OP(xmlTreeIndentString, const char *, XML_EMPTY) \
|
|
||||||
XML_OP(xmlSaveNoEmptyTags, int, XML_EMPTY) \
|
|
||||||
/* deprecated */ \
|
|
||||||
XML_OP(oldXMLWDcompatibility, int, XML_DEPRECATED) \
|
|
||||||
XML_OP(xmlBufferAllocScheme, xmlBufferAllocationScheme, XML_DEPRECATED) \
|
|
||||||
XML_OP(xmlDefaultBufferSize, int, XML_DEPRECATED) \
|
|
||||||
XML_OP(xmlDefaultSAXHandler, xmlSAXHandlerV1, XML_DEPRECATED) \
|
|
||||||
XML_OP(xmlDefaultSAXLocator, xmlSAXLocator, XML_DEPRECATED) \
|
|
||||||
XML_OP(xmlDoValidityCheckingDefaultValue, int, XML_DEPRECATED) \
|
|
||||||
XML_OP(xmlGetWarningsDefaultValue, int, XML_DEPRECATED) \
|
|
||||||
XML_OP(xmlKeepBlanksDefaultValue, int, XML_DEPRECATED) \
|
|
||||||
XML_OP(xmlLineNumbersDefaultValue, int, XML_DEPRECATED) \
|
|
||||||
XML_OP(xmlLoadExtDtdDefaultValue, int, XML_DEPRECATED) \
|
|
||||||
XML_OP(xmlParserDebugEntities, int, XML_DEPRECATED) \
|
|
||||||
XML_OP(xmlPedanticParserDefaultValue, int, XML_DEPRECATED) \
|
|
||||||
XML_OP(xmlSubstituteEntitiesDefaultValue, int, XML_DEPRECATED) \
|
|
||||||
XML_OP(xmlRegisterNodeDefaultValue, xmlRegisterNodeFunc, XML_DEPRECATED) \
|
|
||||||
XML_OP(xmlDeregisterNodeDefaultValue, xmlDeregisterNodeFunc, \
|
|
||||||
XML_DEPRECATED) \
|
|
||||||
XML_OP(xmlParserInputBufferCreateFilenameValue, \
|
|
||||||
xmlParserInputBufferCreateFilenameFunc, XML_DEPRECATED) \
|
|
||||||
XML_OP(xmlOutputBufferCreateFilenameValue, \
|
|
||||||
xmlOutputBufferCreateFilenameFunc, XML_DEPRECATED)
|
|
||||||
|
|
||||||
#ifdef LIBXML_HTML_ENABLED
|
|
||||||
#define XML_GLOBALS_HTML \
|
|
||||||
XML_OP(htmlDefaultSAXHandler, xmlSAXHandlerV1, XML_DEPRECATED)
|
|
||||||
#else
|
|
||||||
#define XML_GLOBALS_HTML
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define XML_GLOBALS \
|
|
||||||
XML_GLOBALS_CORE \
|
|
||||||
XML_GLOBALS_HTML
|
|
||||||
|
|
||||||
#define XML_OP XML_DECLARE_GLOBAL
|
|
||||||
XML_GLOBALS
|
|
||||||
#undef XML_OP
|
|
||||||
|
|
||||||
#if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION)
|
|
||||||
#define oldXMLWDcompatibility XML_GLOBAL_MACRO(oldXMLWDcompatibility)
|
|
||||||
#define xmlBufferAllocScheme XML_GLOBAL_MACRO(xmlBufferAllocScheme)
|
|
||||||
#define xmlDefaultBufferSize XML_GLOBAL_MACRO(xmlDefaultBufferSize)
|
|
||||||
#define xmlDefaultSAXHandler XML_GLOBAL_MACRO(xmlDefaultSAXHandler)
|
|
||||||
#define xmlDefaultSAXLocator XML_GLOBAL_MACRO(xmlDefaultSAXLocator)
|
|
||||||
#define xmlDoValidityCheckingDefaultValue \
|
|
||||||
XML_GLOBAL_MACRO(xmlDoValidityCheckingDefaultValue)
|
|
||||||
#define xmlGetWarningsDefaultValue \
|
|
||||||
XML_GLOBAL_MACRO(xmlGetWarningsDefaultValue)
|
|
||||||
#define xmlIndentTreeOutput XML_GLOBAL_MACRO(xmlIndentTreeOutput)
|
|
||||||
#define xmlTreeIndentString XML_GLOBAL_MACRO(xmlTreeIndentString)
|
|
||||||
#define xmlKeepBlanksDefaultValue XML_GLOBAL_MACRO(xmlKeepBlanksDefaultValue)
|
|
||||||
#define xmlLineNumbersDefaultValue \
|
|
||||||
XML_GLOBAL_MACRO(xmlLineNumbersDefaultValue)
|
|
||||||
#define xmlLoadExtDtdDefaultValue XML_GLOBAL_MACRO(xmlLoadExtDtdDefaultValue)
|
|
||||||
#define xmlParserDebugEntities XML_GLOBAL_MACRO(xmlParserDebugEntities)
|
|
||||||
#define xmlPedanticParserDefaultValue \
|
|
||||||
XML_GLOBAL_MACRO(xmlPedanticParserDefaultValue)
|
|
||||||
#define xmlSaveNoEmptyTags XML_GLOBAL_MACRO(xmlSaveNoEmptyTags)
|
|
||||||
#define xmlSubstituteEntitiesDefaultValue \
|
|
||||||
XML_GLOBAL_MACRO(xmlSubstituteEntitiesDefaultValue)
|
|
||||||
#define xmlRegisterNodeDefaultValue \
|
|
||||||
XML_GLOBAL_MACRO(xmlRegisterNodeDefaultValue)
|
|
||||||
#define xmlDeregisterNodeDefaultValue \
|
|
||||||
XML_GLOBAL_MACRO(xmlDeregisterNodeDefaultValue)
|
|
||||||
#define xmlParserInputBufferCreateFilenameValue \
|
|
||||||
XML_GLOBAL_MACRO(xmlParserInputBufferCreateFilenameValue)
|
|
||||||
#define xmlOutputBufferCreateFilenameValue \
|
|
||||||
XML_GLOBAL_MACRO(xmlOutputBufferCreateFilenameValue)
|
|
||||||
|
|
||||||
#ifdef LIBXML_HTML_ENABLED
|
|
||||||
#define htmlDefaultSAXHandler XML_GLOBAL_MACRO(htmlDefaultSAXHandler)
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -19,6 +19,8 @@
|
|||||||
#include <libxml/xmlerror.h>
|
#include <libxml/xmlerror.h>
|
||||||
#include <libxml/xmlstring.h>
|
#include <libxml/xmlstring.h>
|
||||||
#include <libxml/xmlmemory.h>
|
#include <libxml/xmlmemory.h>
|
||||||
|
#include <libxml/encoding.h>
|
||||||
|
#include <libxml/xmlIO.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -810,26 +812,48 @@ typedef xmlParserInputPtr (*xmlExternalEntityLoader) (const char *URL,
|
|||||||
* Variables
|
* Variables
|
||||||
*/
|
*/
|
||||||
|
|
||||||
XMLPUBVAR const char *const
|
XMLPUBVAR const char *const xmlParserVersion;
|
||||||
xmlParserVersion;
|
|
||||||
#ifdef LIBXML_THREAD_ENABLED
|
#ifdef LIBXML_THREAD_ENABLED
|
||||||
XMLPUBFUN const char *const *
|
/* backward compatibility */
|
||||||
__xmlParserVersion(void);
|
XMLPUBFUN const char *const *__xmlParserVersion(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#define XML_GLOBALS_PARSER \
|
||||||
}
|
XML_OP(oldXMLWDcompatibility, int, XML_DEPRECATED) \
|
||||||
|
XML_OP(xmlDefaultSAXHandler, xmlSAXHandlerV1, XML_DEPRECATED) \
|
||||||
|
XML_OP(xmlDefaultSAXLocator, xmlSAXLocator, XML_DEPRECATED) \
|
||||||
|
XML_OP(xmlDoValidityCheckingDefaultValue, int, XML_DEPRECATED) \
|
||||||
|
XML_OP(xmlGetWarningsDefaultValue, int, XML_DEPRECATED) \
|
||||||
|
XML_OP(xmlKeepBlanksDefaultValue, int, XML_DEPRECATED) \
|
||||||
|
XML_OP(xmlLineNumbersDefaultValue, int, XML_DEPRECATED) \
|
||||||
|
XML_OP(xmlLoadExtDtdDefaultValue, int, XML_DEPRECATED) \
|
||||||
|
XML_OP(xmlParserDebugEntities, int, XML_DEPRECATED) \
|
||||||
|
XML_OP(xmlPedanticParserDefaultValue, int, XML_DEPRECATED) \
|
||||||
|
XML_OP(xmlSubstituteEntitiesDefaultValue, int, XML_DEPRECATED)
|
||||||
|
|
||||||
|
#define XML_OP XML_DECLARE_GLOBAL
|
||||||
|
XML_GLOBALS_PARSER
|
||||||
|
#undef XML_OP
|
||||||
|
|
||||||
|
#if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION)
|
||||||
|
#define oldXMLWDcompatibility XML_GLOBAL_MACRO(oldXMLWDcompatibility)
|
||||||
|
#define xmlDefaultSAXHandler XML_GLOBAL_MACRO(xmlDefaultSAXHandler)
|
||||||
|
#define xmlDefaultSAXLocator XML_GLOBAL_MACRO(xmlDefaultSAXLocator)
|
||||||
|
#define xmlDoValidityCheckingDefaultValue \
|
||||||
|
XML_GLOBAL_MACRO(xmlDoValidityCheckingDefaultValue)
|
||||||
|
#define xmlGetWarningsDefaultValue \
|
||||||
|
XML_GLOBAL_MACRO(xmlGetWarningsDefaultValue)
|
||||||
|
#define xmlKeepBlanksDefaultValue XML_GLOBAL_MACRO(xmlKeepBlanksDefaultValue)
|
||||||
|
#define xmlLineNumbersDefaultValue \
|
||||||
|
XML_GLOBAL_MACRO(xmlLineNumbersDefaultValue)
|
||||||
|
#define xmlLoadExtDtdDefaultValue XML_GLOBAL_MACRO(xmlLoadExtDtdDefaultValue)
|
||||||
|
#define xmlParserDebugEntities XML_GLOBAL_MACRO(xmlParserDebugEntities)
|
||||||
|
#define xmlPedanticParserDefaultValue \
|
||||||
|
XML_GLOBAL_MACRO(xmlPedanticParserDefaultValue)
|
||||||
|
#define xmlSubstituteEntitiesDefaultValue \
|
||||||
|
XML_GLOBAL_MACRO(xmlSubstituteEntitiesDefaultValue)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <libxml/encoding.h>
|
|
||||||
#include <libxml/xmlIO.h>
|
|
||||||
#include <libxml/globals.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Init/Cleanup
|
* Init/Cleanup
|
||||||
*/
|
*/
|
||||||
|
@ -669,6 +669,26 @@ typedef void (*xmlDeregisterNodeFunc) (xmlNodePtr node);
|
|||||||
* Variables.
|
* Variables.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#define XML_GLOBALS_TREE \
|
||||||
|
XML_OP(xmlBufferAllocScheme, xmlBufferAllocationScheme, XML_DEPRECATED) \
|
||||||
|
XML_OP(xmlDefaultBufferSize, int, XML_DEPRECATED) \
|
||||||
|
XML_OP(xmlRegisterNodeDefaultValue, xmlRegisterNodeFunc, XML_DEPRECATED) \
|
||||||
|
XML_OP(xmlDeregisterNodeDefaultValue, xmlDeregisterNodeFunc, \
|
||||||
|
XML_DEPRECATED)
|
||||||
|
|
||||||
|
#define XML_OP XML_DECLARE_GLOBAL
|
||||||
|
XML_GLOBALS_TREE
|
||||||
|
#undef XML_OP
|
||||||
|
|
||||||
|
#if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION)
|
||||||
|
#define xmlBufferAllocScheme XML_GLOBAL_MACRO(xmlBufferAllocScheme)
|
||||||
|
#define xmlDefaultBufferSize XML_GLOBAL_MACRO(xmlDefaultBufferSize)
|
||||||
|
#define xmlRegisterNodeDefaultValue \
|
||||||
|
XML_GLOBAL_MACRO(xmlRegisterNodeDefaultValue)
|
||||||
|
#define xmlDeregisterNodeDefaultValue \
|
||||||
|
XML_GLOBAL_MACRO(xmlDeregisterNodeDefaultValue)
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Some helper functions
|
* Some helper functions
|
||||||
*/
|
*/
|
||||||
|
@ -171,6 +171,23 @@ struct _xmlOutputBuffer {
|
|||||||
};
|
};
|
||||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||||
|
|
||||||
|
#define XML_GLOBALS_IO \
|
||||||
|
XML_OP(xmlParserInputBufferCreateFilenameValue, \
|
||||||
|
xmlParserInputBufferCreateFilenameFunc, XML_DEPRECATED) \
|
||||||
|
XML_OP(xmlOutputBufferCreateFilenameValue, \
|
||||||
|
xmlOutputBufferCreateFilenameFunc, XML_DEPRECATED)
|
||||||
|
|
||||||
|
#define XML_OP XML_DECLARE_GLOBAL
|
||||||
|
XML_GLOBALS_IO
|
||||||
|
#undef XML_OP
|
||||||
|
|
||||||
|
#if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION)
|
||||||
|
#define xmlParserInputBufferCreateFilenameValue \
|
||||||
|
XML_GLOBAL_MACRO(xmlParserInputBufferCreateFilenameValue)
|
||||||
|
#define xmlOutputBufferCreateFilenameValue \
|
||||||
|
XML_GLOBAL_MACRO(xmlOutputBufferCreateFilenameValue)
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Interfaces for input
|
* Interfaces for input
|
||||||
*/
|
*/
|
||||||
|
@ -41,6 +41,21 @@ typedef enum {
|
|||||||
typedef struct _xmlSaveCtxt xmlSaveCtxt;
|
typedef struct _xmlSaveCtxt xmlSaveCtxt;
|
||||||
typedef xmlSaveCtxt *xmlSaveCtxtPtr;
|
typedef xmlSaveCtxt *xmlSaveCtxtPtr;
|
||||||
|
|
||||||
|
#define XML_GLOBALS_SAVE \
|
||||||
|
XML_OP(xmlIndentTreeOutput, int, XML_EMPTY) \
|
||||||
|
XML_OP(xmlTreeIndentString, const char *, XML_EMPTY) \
|
||||||
|
XML_OP(xmlSaveNoEmptyTags, int, XML_EMPTY)
|
||||||
|
|
||||||
|
#define XML_OP XML_DECLARE_GLOBAL
|
||||||
|
XML_GLOBALS_SAVE
|
||||||
|
#undef XML_OP
|
||||||
|
|
||||||
|
#if defined(LIBXML_THREAD_ENABLED) && !defined(XML_GLOBALS_NO_REDEFINITION)
|
||||||
|
#define xmlIndentTreeOutput XML_GLOBAL_MACRO(xmlIndentTreeOutput)
|
||||||
|
#define xmlTreeIndentString XML_GLOBAL_MACRO(xmlTreeIndentString)
|
||||||
|
#define xmlSaveNoEmptyTags XML_GLOBAL_MACRO(xmlSaveNoEmptyTags)
|
||||||
|
#endif
|
||||||
|
|
||||||
XMLPUBFUN xmlSaveCtxtPtr
|
XMLPUBFUN xmlSaveCtxtPtr
|
||||||
xmlSaveToFd (int fd,
|
xmlSaveToFd (int fd,
|
||||||
const char *encoding,
|
const char *encoding,
|
||||||
@ -82,6 +97,11 @@ XMLPUBFUN int
|
|||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#else /* LIBXML_OUTPUT_ENABLED */
|
||||||
|
|
||||||
|
#define XML_GLOBALS_SAVE
|
||||||
|
|
||||||
#endif /* LIBXML_OUTPUT_ENABLED */
|
#endif /* LIBXML_OUTPUT_ENABLED */
|
||||||
#endif /* __XML_XMLSAVE_H__ */
|
#endif /* __XML_XMLSAVE_H__ */
|
||||||
|
|
||||||
|
5
parser.c
5
parser.c
@ -51,10 +51,9 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <libxml/xmlmemory.h>
|
|
||||||
#include <libxml/globals.h>
|
|
||||||
#include <libxml/tree.h>
|
|
||||||
#include <libxml/parser.h>
|
#include <libxml/parser.h>
|
||||||
|
#include <libxml/xmlmemory.h>
|
||||||
|
#include <libxml/tree.h>
|
||||||
#include <libxml/parserInternals.h>
|
#include <libxml/parserInternals.h>
|
||||||
#include <libxml/valid.h>
|
#include <libxml/valid.h>
|
||||||
#include <libxml/entities.h>
|
#include <libxml/entities.h>
|
||||||
|
@ -2518,7 +2518,10 @@ xmlKeepBlanksDefault(int val) {
|
|||||||
int old = xmlKeepBlanksDefaultValue;
|
int old = xmlKeepBlanksDefaultValue;
|
||||||
|
|
||||||
xmlKeepBlanksDefaultValue = val;
|
xmlKeepBlanksDefaultValue = val;
|
||||||
if (!val) xmlIndentTreeOutput = 1;
|
#ifdef LIBXML_OUTPUT_ENABLED
|
||||||
|
if (!val)
|
||||||
|
xmlIndentTreeOutput = 1;
|
||||||
|
#endif
|
||||||
return(old);
|
return(old);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#include <libxml/c14n.h>
|
#include <libxml/c14n.h>
|
||||||
#include <libxml/xmlreader.h>
|
#include <libxml/xmlreader.h>
|
||||||
#include <libxml/xmlsave.h>
|
#include <libxml/xmlsave.h>
|
||||||
|
#include <libxml/globals.h>
|
||||||
#include "libxml_wrap.h"
|
#include "libxml_wrap.h"
|
||||||
#include "libxml2-py.h"
|
#include "libxml2-py.h"
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
#include <libxml/xmlregexp.h>
|
#include <libxml/xmlregexp.h>
|
||||||
#include <libxml/xmlautomata.h>
|
#include <libxml/xmlautomata.h>
|
||||||
#include <libxml/xmlreader.h>
|
#include <libxml/xmlreader.h>
|
||||||
|
#include <libxml/globals.h>
|
||||||
#ifdef LIBXML_SCHEMAS_ENABLED
|
#ifdef LIBXML_SCHEMAS_ENABLED
|
||||||
#include <libxml/relaxng.h>
|
#include <libxml/relaxng.h>
|
||||||
#include <libxml/xmlschemas.h>
|
#include <libxml/xmlschemas.h>
|
||||||
|
3
tree.c
3
tree.c
@ -28,15 +28,14 @@
|
|||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <libxml/xmlmemory.h>
|
|
||||||
#include <libxml/tree.h>
|
#include <libxml/tree.h>
|
||||||
|
#include <libxml/xmlmemory.h>
|
||||||
#include <libxml/parser.h>
|
#include <libxml/parser.h>
|
||||||
#include <libxml/uri.h>
|
#include <libxml/uri.h>
|
||||||
#include <libxml/entities.h>
|
#include <libxml/entities.h>
|
||||||
#include <libxml/valid.h>
|
#include <libxml/valid.h>
|
||||||
#include <libxml/xmlerror.h>
|
#include <libxml/xmlerror.h>
|
||||||
#include <libxml/parserInternals.h>
|
#include <libxml/parserInternals.h>
|
||||||
#include <libxml/globals.h>
|
|
||||||
#ifdef LIBXML_HTML_ENABLED
|
#ifdef LIBXML_HTML_ENABLED
|
||||||
#include <libxml/HTMLtree.h>
|
#include <libxml/HTMLtree.h>
|
||||||
#endif
|
#endif
|
||||||
|
3
xmlIO.c
3
xmlIO.c
@ -50,10 +50,10 @@
|
|||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <libxml/xmlIO.h>
|
||||||
#include <libxml/xmlmemory.h>
|
#include <libxml/xmlmemory.h>
|
||||||
#include <libxml/parser.h>
|
#include <libxml/parser.h>
|
||||||
#include <libxml/parserInternals.h>
|
#include <libxml/parserInternals.h>
|
||||||
#include <libxml/xmlIO.h>
|
|
||||||
#include <libxml/uri.h>
|
#include <libxml/uri.h>
|
||||||
#include <libxml/nanohttp.h>
|
#include <libxml/nanohttp.h>
|
||||||
#include <libxml/nanoftp.h>
|
#include <libxml/nanoftp.h>
|
||||||
@ -61,7 +61,6 @@
|
|||||||
#ifdef LIBXML_CATALOG_ENABLED
|
#ifdef LIBXML_CATALOG_ENABLED
|
||||||
#include <libxml/catalog.h>
|
#include <libxml/catalog.h>
|
||||||
#endif
|
#endif
|
||||||
#include <libxml/globals.h>
|
|
||||||
|
|
||||||
#include "private/buf.h"
|
#include "private/buf.h"
|
||||||
#include "private/enc.h"
|
#include "private/enc.h"
|
||||||
|
12
xmllint.c
12
xmllint.c
@ -3135,7 +3135,6 @@ main(int argc, char **argv) {
|
|||||||
int i, acount;
|
int i, acount;
|
||||||
int files = 0;
|
int files = 0;
|
||||||
int version = 0;
|
int version = 0;
|
||||||
const char* indent;
|
|
||||||
|
|
||||||
if (argc <= 1) {
|
if (argc <= 1) {
|
||||||
usage(stderr, argv[0]);
|
usage(stderr, argv[0]);
|
||||||
@ -3525,11 +3524,14 @@ main(int argc, char **argv) {
|
|||||||
xmlDeregisterNodeDefault(deregisterNode);
|
xmlDeregisterNodeDefault(deregisterNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
indent = getenv("XMLLINT_INDENT");
|
#ifdef LIBXML_OUTPUT_ENABLED
|
||||||
if(indent != NULL) {
|
{
|
||||||
xmlTreeIndentString = indent;
|
const char *indent = getenv("XMLLINT_INDENT");
|
||||||
|
if (indent != NULL) {
|
||||||
|
xmlTreeIndentString = indent;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
defaultEntityLoader = xmlGetExternalEntityLoader();
|
defaultEntityLoader = xmlGetExternalEntityLoader();
|
||||||
xmlSetExternalEntityLoader(xmllintExternalEntityLoader);
|
xmlSetExternalEntityLoader(xmllintExternalEntityLoader);
|
||||||
|
Reference in New Issue
Block a user