mirror of
https://github.com/GNOME/libxml2.git
synced 2025-03-13 18:47:01 +08:00
changed default value for global parameter xmlIndentTreeOutput to 1 and
* global.data globals.c tree.c include/libxml/globals.h win32/libxml2.def.src win32/dsp/libxml2.def.src: changed default value for global parameter xmlIndentTreeOutput to 1 and introduced new global parameter xmlTreeIndentString (the string used to do one-level indent) with default value " " (as it was in tree.c)
This commit is contained in:
parent
49d5af8c0f
commit
23002568a6
@ -8,6 +8,7 @@ xmlGenericErrorFunc,xmlGenericError
|
||||
void *,xmlGenericErrorContext
|
||||
int,xmlGetWarningsDefaultValue
|
||||
int,xmlIndentTreeOutput
|
||||
const char *,xmlTreeIndentString
|
||||
int,xmlKeepBlanksDefaultValue
|
||||
int,xmlLineNumbersDefaultValue
|
||||
int,xmlLoadExtDtdDefaultValue
|
||||
|
25
globals.c
25
globals.c
@ -106,6 +106,7 @@ xmlStrdupFunc xmlMemStrdup = (xmlStrdupFunc) xmlStrdup;
|
||||
#undef xmlGenericErrorContext
|
||||
#undef xmlGetWarningsDefaultValue
|
||||
#undef xmlIndentTreeOutput
|
||||
#undef xmlTreeIndentString
|
||||
#undef xmlKeepBlanksDefaultValue
|
||||
#undef xmlLineNumbersDefaultValue
|
||||
#undef xmlLoadExtDtdDefaultValue
|
||||
@ -247,9 +248,17 @@ void *xmlGenericErrorContext = NULL;
|
||||
* xmlIndentTreeOutput:
|
||||
*
|
||||
* Global setting, asking the serializer to indent the output tree by default
|
||||
* Disabled by default
|
||||
* Enabled by default
|
||||
*/
|
||||
int xmlIndentTreeOutput = 0;
|
||||
int xmlIndentTreeOutput = 1;
|
||||
|
||||
/**
|
||||
* xmlTreeIndentString:
|
||||
*
|
||||
* The string used to do one-level indent. By default is equal to " " (two spaces)
|
||||
*/
|
||||
const char *xmlTreeIndentString = " ";
|
||||
|
||||
/**
|
||||
* xmlSaveNoEmptyTags:
|
||||
*
|
||||
@ -431,7 +440,8 @@ xmlInitializeGlobalState(xmlGlobalStatePtr gs)
|
||||
#endif
|
||||
gs->xmlGenericErrorContext = NULL;
|
||||
gs->xmlGetWarningsDefaultValue = 1;
|
||||
gs->xmlIndentTreeOutput = 0;
|
||||
gs->xmlIndentTreeOutput = 1;
|
||||
gs->xmlTreeIndentString = " ";
|
||||
gs->xmlKeepBlanksDefaultValue = 1;
|
||||
gs->xmlLineNumbersDefaultValue = 0;
|
||||
gs->xmlLoadExtDtdDefaultValue = 0;
|
||||
@ -561,6 +571,15 @@ __xmlIndentTreeOutput(void) {
|
||||
return (&xmlGetGlobalState()->xmlIndentTreeOutput);
|
||||
}
|
||||
|
||||
#undef xmlTreeIndentString
|
||||
const char * *
|
||||
__xmlTreeIndentString(void) {
|
||||
if (IS_MAIN_THREAD)
|
||||
return (&xmlTreeIndentString);
|
||||
else
|
||||
return (&xmlGetGlobalState()->xmlTreeIndentString);
|
||||
}
|
||||
|
||||
#undef xmlKeepBlanksDefaultValue
|
||||
int *
|
||||
__xmlKeepBlanksDefaultValue(void) {
|
||||
|
@ -40,6 +40,7 @@ extern "C" {
|
||||
#undef xmlGenericErrorContext
|
||||
#undef xmlGetWarningsDefaultValue
|
||||
#undef xmlIndentTreeOutput
|
||||
#undef xmlTreeIndentString
|
||||
#undef xmlKeepBlanksDefaultValue
|
||||
#undef xmlLineNumbersDefaultValue
|
||||
#undef xmlLoadExtDtdDefaultValue
|
||||
@ -87,6 +88,7 @@ struct _xmlGlobalState
|
||||
|
||||
int xmlSaveNoEmptyTags;
|
||||
int xmlIndentTreeOutput;
|
||||
const char *xmlTreeIndentString;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -255,6 +257,14 @@ extern int *__xmlIndentTreeOutput(void);
|
||||
LIBXML_DLL_IMPORT extern int xmlIndentTreeOutput;
|
||||
#endif
|
||||
|
||||
extern const char * *__xmlTreeIndentString(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define xmlTreeIndentString \
|
||||
(*(__xmlTreeIndentString()))
|
||||
#else
|
||||
LIBXML_DLL_IMPORT extern const char * xmlTreeIndentString;
|
||||
#endif
|
||||
|
||||
extern int *__xmlKeepBlanksDefaultValue(void);
|
||||
#ifdef LIBXML_THREAD_ENABLED
|
||||
#define xmlKeepBlanksDefaultValue \
|
||||
|
8
tree.c
8
tree.c
@ -6012,7 +6012,7 @@ xmlNodeListDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, int level,
|
||||
if ((format) && (xmlIndentTreeOutput) &&
|
||||
(cur->type == XML_ELEMENT_NODE))
|
||||
for (i = 0;i < level;i++)
|
||||
xmlBufferWriteChar(buf, " ");
|
||||
xmlBufferWriteChar(buf, xmlTreeIndentString);
|
||||
xmlNodeDump(buf, doc, cur, level, format);
|
||||
if (format) {
|
||||
xmlBufferWriteChar(buf, "\n");
|
||||
@ -6167,7 +6167,7 @@ xmlNodeDump(xmlBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur, int level,
|
||||
(level >= 0?level+1:-1), format);
|
||||
if ((xmlIndentTreeOutput) && (format))
|
||||
for (i = 0;i < level;i++)
|
||||
xmlBufferWriteChar(buf, " ");
|
||||
xmlBufferWriteChar(buf, xmlTreeIndentString);
|
||||
}
|
||||
xmlBufferWriteChar(buf, "</");
|
||||
if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
|
||||
@ -6399,7 +6399,7 @@ xmlNodeListDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
|
||||
if ((format) && (xmlIndentTreeOutput) &&
|
||||
(cur->type == XML_ELEMENT_NODE))
|
||||
for (i = 0;i < level;i++)
|
||||
xmlOutputBufferWriteString(buf, " ");
|
||||
xmlOutputBufferWriteString(buf, xmlTreeIndentString);
|
||||
xmlNodeDumpOutput(buf, doc, cur, level, format, encoding);
|
||||
if (format) {
|
||||
xmlOutputBufferWriteString(buf, "\n");
|
||||
@ -6563,7 +6563,7 @@ xmlNodeDumpOutput(xmlOutputBufferPtr buf, xmlDocPtr doc, xmlNodePtr cur,
|
||||
(level >= 0?level+1:-1), format, encoding);
|
||||
if ((xmlIndentTreeOutput) && (format))
|
||||
for (i = 0;i < level;i++)
|
||||
xmlOutputBufferWriteString(buf, " ");
|
||||
xmlOutputBufferWriteString(buf, xmlTreeIndentString);
|
||||
}
|
||||
xmlOutputBufferWriteString(buf, "</");
|
||||
if ((cur->ns != NULL) && (cur->ns->prefix != NULL)) {
|
||||
|
@ -240,6 +240,7 @@ EXPORTS
|
||||
__xmlGenericErrorContext
|
||||
__xmlGetWarningsDefaultValue
|
||||
__xmlIndentTreeOutput
|
||||
__xmlTreeIndentString
|
||||
__xmlKeepBlanksDefaultValue
|
||||
__xmlLineNumbersDefaultValue
|
||||
__xmlLoadExtDtdDefaultValue
|
||||
@ -265,6 +266,7 @@ EXPORTS
|
||||
xmlGenericErrorContext DATA
|
||||
xmlGetWarningsDefaultValue DATA
|
||||
xmlIndentTreeOutput DATA
|
||||
xmlTreeIndentString DATA
|
||||
xmlKeepBlanksDefaultValue DATA
|
||||
xmlLineNumbersDefaultValue DATA
|
||||
xmlLoadExtDtdDefaultValue DATA
|
||||
|
@ -240,6 +240,7 @@ xmlCleanupPredefinedEntities
|
||||
__xmlGenericErrorContext
|
||||
__xmlGetWarningsDefaultValue
|
||||
__xmlIndentTreeOutput
|
||||
__xmlTreeIndentString
|
||||
__xmlKeepBlanksDefaultValue
|
||||
__xmlLineNumbersDefaultValue
|
||||
__xmlLoadExtDtdDefaultValue
|
||||
@ -265,6 +266,7 @@ xmlCleanupPredefinedEntities
|
||||
xmlGenericErrorContext DATA
|
||||
xmlGetWarningsDefaultValue DATA
|
||||
xmlIndentTreeOutput DATA
|
||||
xmlTreeIndentString DATA
|
||||
xmlKeepBlanksDefaultValue DATA
|
||||
xmlLineNumbersDefaultValue DATA
|
||||
xmlLoadExtDtdDefaultValue DATA
|
||||
|
Loading…
x
Reference in New Issue
Block a user