aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksey Sanin <aleksey@src.gnome.org>2002-05-24 07:18:40 +0000
committerAleksey Sanin <aleksey@src.gnome.org>2002-05-24 07:18:40 +0000
commit23002568a6f407dfeb8ced515af28bdd6f74a4f1 (patch)
tree38ac4f3a48dbf5a17c3812ea3e54a6cd17a61064
parent49d5af8c0fd16d697f8774724be883def42d3fc5 (diff)
downloadandroid_external_libxml2-23002568a6f407dfeb8ced515af28bdd6f74a4f1.tar.gz
android_external_libxml2-23002568a6f407dfeb8ced515af28bdd6f74a4f1.tar.bz2
android_external_libxml2-23002568a6f407dfeb8ced515af28bdd6f74a4f1.zip
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)
-rw-r--r--global.data1
-rw-r--r--globals.c25
-rw-r--r--include/libxml/globals.h10
-rw-r--r--tree.c8
-rw-r--r--win32/dsp/libxml2.def.src2
-rw-r--r--win32/libxml2.def.src2
6 files changed, 41 insertions, 7 deletions
diff --git a/global.data b/global.data
index f7d5d00b..43d2fb5a 100644
--- a/global.data
+++ b/global.data
@@ -8,6 +8,7 @@ xmlGenericErrorFunc,xmlGenericError
void *,xmlGenericErrorContext
int,xmlGetWarningsDefaultValue
int,xmlIndentTreeOutput
+const char *,xmlTreeIndentString
int,xmlKeepBlanksDefaultValue
int,xmlLineNumbersDefaultValue
int,xmlLoadExtDtdDefaultValue
diff --git a/globals.c b/globals.c
index cce70fbf..ac99093a 100644
--- a/globals.c
+++ b/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 = 1;
+
+/**
+ * xmlTreeIndentString:
+ *
+ * The string used to do one-level indent. By default is equal to " " (two spaces)
*/
-int xmlIndentTreeOutput = 0;
+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) {
diff --git a/include/libxml/globals.h b/include/libxml/globals.h
index c6ac0a31..fc6c01e5 100644
--- a/include/libxml/globals.h
+++ b/include/libxml/globals.h
@@ -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 \
diff --git a/tree.c b/tree.c
index 29742562..eee620b5 100644
--- a/tree.c
+++ b/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)) {
diff --git a/win32/dsp/libxml2.def.src b/win32/dsp/libxml2.def.src
index 09d91db1..b0fdff14 100644
--- a/win32/dsp/libxml2.def.src
+++ b/win32/dsp/libxml2.def.src
@@ -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
diff --git a/win32/libxml2.def.src b/win32/libxml2.def.src
index 007444bf..f0cb31a3 100644
--- a/win32/libxml2.def.src
+++ b/win32/libxml2.def.src
@@ -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