Репозитории ALT
5.1: | 0.10.7-alt1 |
4.1: | 0.9.2-alt3.svn53synce |
4.0: | 0.9.2-alt1 |
Группа :: Система/Библиотеки
Пакет: wbxml2
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: wbxml-svn-r53-anonymous.patch
Скачать
Скачать
diff -Naur wbxml2-original/src/wbxml.h wbxml2-modified/src/wbxml.h
--- wbxml2-original/src/wbxml.h 2007-04-15 15:41:39.000000000 -0400
+++ wbxml2-modified/src/wbxml.h 2007-04-15 19:05:20.000000000 -0400
@@ -285,6 +285,7 @@
WBXMLVersion wbxml_version; /**< WBXML Version */
WB_BOOL keep_ignorable_ws; /**< Keep Ignorable Whitespaces (Default: FALSE) */
WB_BOOL use_strtbl; /**< Generate String Table (Default: TRUE) */
+ WB_BOOL produce_anonymous; /**< Produce an anonymous document (Default: FALSE) */
} WBXMLGenWBXMLParams;
diff -Naur wbxml2-original/src/wbxml_encoder.c wbxml2-modified/src/wbxml_encoder.c
--- wbxml2-original/src/wbxml_encoder.c 2007-04-15 15:41:39.000000000 -0400
+++ wbxml2-modified/src/wbxml_encoder.c 2007-04-15 19:05:20.000000000 -0400
@@ -158,6 +158,7 @@
WB_BOOL use_strtbl; /**< Do we use String Table when generating WBXML output ? (default: YES) */
#endif /* WBXML_ENCODER_USE_STRTBL */
WB_BOOL xml_encode_header; /**< Do we generate XML Header ? */
+ WB_BOOL produce_anonymous; /**< Do we produce anonymous documents? (default: NO) */
WBXMLVersion wbxml_version; /**< WBXML Version to use (when generating WBXML output) */
WBXMLCharsetMIBEnum output_charset; /**< Output charset encoding */
WB_BOOL flow_mode; /**< Is Flow Mode encoding activated ? */
@@ -411,6 +412,7 @@
encoder->cdata = NULL;
encoder->xml_encode_header = TRUE;
+ encoder->produce_anonymous = FALSE;
/* Default Version: WBXML 1.3 */
encoder->wbxml_version = WBXML_VERSION_13;
@@ -521,6 +523,15 @@
}
+WBXML_DECLARE(void) wbxml_encoder_set_produce_anonymous(WBXMLEncoder *encoder, WB_BOOL set_anonymous)
+{
+ if (encoder == NULL)
+ return;
+
+ encoder->produce_anonymous = set_anonymous;
+}
+
+
WBXML_DECLARE(void) wbxml_encoder_set_wbxml_version(WBXMLEncoder *encoder, WBXMLVersion version)
{
if (encoder == NULL)
@@ -1480,7 +1491,8 @@
/* Encode Public ID */
/* If WBXML Public Id is '0x01' (unknown), or we forced it, add the XML Public ID in the String Table */
- if (encoder->textual_publicid || (public_id == WBXML_PUBLIC_ID_UNKNOWN))
+ if ((encoder->textual_publicid || (public_id == WBXML_PUBLIC_ID_UNKNOWN)) &&
+ !encoder->produce_anonymous)
{
if (encoder->lang->publicID->xmlPublicID != NULL)
{
diff -Naur wbxml2-original/src/wbxml_encoder.h wbxml2-modified/src/wbxml_encoder.h
--- wbxml2-original/src/wbxml_encoder.h 2007-04-15 15:41:39.000000000 -0400
+++ wbxml2-modified/src/wbxml_encoder.h 2007-04-15 19:05:20.000000000 -0400
@@ -118,6 +118,13 @@
WBXML_DECLARE(void) wbxml_encoder_set_use_strtbl(WBXMLEncoder *encoder, WB_BOOL use_strtbl);
/**
+ * @brief Set if we want to produce anonymous WBXML documents [Default: FALSE]
+ * @param encoder [in] The WBXML encoder
+ * @param set_anonymous [in] TRUE to produce anonymous documents, FALSE otherwise
+ */
+WBXML_DECLARE(void) wbxml_encoder_set_produce_anonymous(WBXMLEncoder *encoder, WB_BOOL set_anonymous);
+
+/**
* @brief Set the WBXML Version of the output document, when generating WBXML [Default: 'WBXML_VERSION_TOKEN_13' (1.3)]
* @param encoder [in] The WBXML Encoder
* @param version [in] The WBXML Version
diff -Naur wbxml2-original/src/wbxml_tree.c wbxml2-modified/src/wbxml_tree.c
--- wbxml2-original/src/wbxml_tree.c 2007-04-15 15:41:39.000000000 -0400
+++ wbxml2-modified/src/wbxml_tree.c 2007-04-15 19:05:20.000000000 -0400
@@ -137,6 +137,9 @@
/* Use String Table */
wbxml_encoder_set_use_strtbl(wbxml_encoder, TRUE);
+
+ /* Don't produce an anonymous document by default */
+ wbxml_encoder_set_produce_anonymous(wbxml_encoder, FALSE);
}
else {
/* WBXML Version */
@@ -154,6 +157,10 @@
/* String Table */
wbxml_encoder_set_use_strtbl(wbxml_encoder, params->use_strtbl);
+ /* Produce an anonymous document? */
+ wbxml_encoder_set_produce_anonymous(wbxml_encoder,
+ params->produce_anonymous);
+
/** @todo Add parameter to call : wbxml_encoder_set_output_charset() */
}