--- wbxml2-0.9.2.orig/debian/libwbxml2-utils.dirs +++ wbxml2-0.9.2/debian/libwbxml2-utils.dirs @@ -0,0 +1 @@ +usr/bin --- wbxml2-0.9.2.orig/debian/libwbxml2-0.dirs +++ wbxml2-0.9.2/debian/libwbxml2-0.dirs @@ -0,0 +1 @@ +usr/lib --- wbxml2-0.9.2.orig/debian/control +++ wbxml2-0.9.2/debian/control @@ -0,0 +1,62 @@ +Source: wbxml2 +Priority: optional +Section: libs +Maintainer: Michael Banck +Homepage: http://libwbxml.aymerick.com/ +Build-Depends: debhelper (>= 5.0.0), libexpat1-dev | libexpat-dev, libpopt-dev, zlib1g-dev | libz-dev, automake1.9, libtool, cdbs +Standards-Version: 3.8.0 + +Package: libwbxml2-dev +Section: libdevel +Architecture: any +Depends: libwbxml2-0 (= ${binary:Version}), zlib1g-dev | libz-dev, libexpat1-dev | libexpat-dev, libpopt-dev +Description: WBXML library development file + The WBXML Library (aka libwbxml) contains a library and its associated + tools to Parse, Encode and Handle WBXML documents. The WBXML format + is a binary representation of XML, defined by the Wap Forum, and used + to reduce bandwidth in mobile communications. + . + Install this package if you wish to develop your own programs using + WBXML. + +Package: libwbxml2-0-dbg +Section: libdevel +Priority: extra +Architecture: any +Depends: libwbxml2-0 (= ${binary:Version}) +Recommends: libwbxml2-dev +Description: WBXML library development file + The WBXML Library (aka libwbxml) contains a library and its associated + tools to Parse, Encode and Handle WBXML documents. The WBXML format + is a binary representation of XML, defined by the Wap Forum, and used + to reduce bandwidth in mobile communications. + . + Install this package if you wish to debug wbxml2 using applications. + +Package: libwbxml2-0 +Section: libs +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Conflicts: libwbxml2 +Replaces: libwbxml2 +Description: WBXML parsing and encoding library + The WBXML Library (aka libwbxml) contains a library and its associated + tools to Parse, Encode and Handle WBXML documents. The WBXML format + is a binary representation of XML, defined by the Wap Forum, and used + to reduce bandwidth in mobile communications. + . + This package contains the dynamic library needed by applications + using libwbxml2. + +Package: libwbxml2-utils +Section: text +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Binary XML utilities + The WBXML Library (aka libwbxml) contains a library and its associated + tools to Parse, Encode and Handle WBXML documents. The WBXML format + is a binary representation of XML, defined by the Wap Forum, and used + to reduce bandwidth in mobile communications. + . + This package contains wbxml2xml and xml2wbxml utils to convert xml + files to wbxml and back. --- wbxml2-0.9.2.orig/debian/compat +++ wbxml2-0.9.2/debian/compat @@ -0,0 +1 @@ +5 --- wbxml2-0.9.2.orig/debian/dirs +++ wbxml2-0.9.2/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +usr/sbin --- wbxml2-0.9.2.orig/debian/rules +++ wbxml2-0.9.2/debian/rules @@ -0,0 +1,20 @@ +#!/usr/bin/make -f + +# Acording to cdbs manual, I shouldn't do this + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/class/autotools.mk +include /usr/share/cdbs/1/rules/simple-patchsys.mk + +DEB_DH_MAKESHLIBS_ARGS_libwbxml2-0 := -V"libwbxml2-0 (>= 0.9.2-2)" + +# actually we would want pre-configure, but it didn't work.. + +post-patches:: + chmod a+x ./bootstrap + ./bootstrap + +clean:: + rm -f config.guess config.sub ltmain.sh aclocal.m4 config.h.in mkinstalldirs install-sh missing depcomp Makefile.in configure + rm -f tools/Makefile.in src/Makefile.in + --- wbxml2-0.9.2.orig/debian/docs +++ wbxml2-0.9.2/debian/docs @@ -0,0 +1,4 @@ +NEWS +README +TODO +References --- wbxml2-0.9.2.orig/debian/libwbxml2-dev.install +++ wbxml2-0.9.2/debian/libwbxml2-dev.install @@ -0,0 +1,5 @@ +debian/tmp/usr/include/* +debian/tmp/usr/lib/lib*.a +debian/tmp/usr/lib/lib*.so +debian/tmp/usr/lib/pkgconfig/* +debian/tmp/usr/lib/*.la --- wbxml2-0.9.2.orig/debian/libwbxml2-0.install +++ wbxml2-0.9.2/debian/libwbxml2-0.install @@ -0,0 +1 @@ +debian/tmp/usr/lib/lib*.so.* --- wbxml2-0.9.2.orig/debian/libwbxml2-utils.install +++ wbxml2-0.9.2/debian/libwbxml2-utils.install @@ -0,0 +1 @@ +debian/tmp/usr/bin/* --- wbxml2-0.9.2.orig/debian/changelog +++ wbxml2-0.9.2/debian/changelog @@ -0,0 +1,115 @@ +wbxml2 (0.9.2-7) unstable; urgency=high + + * Urgency `high' due to RC bug fix. + * debian/patches/09-devinf-doctype.patch: New patch, no longer hardcodes the + Syncml version in the device information document, by Michael Bell; + closes: #506740. + * debian/patches/10-fix-wbxml-public-ids.patch: New patch, swaps the + WBXML_PUBLIC_ID_SYNCML_METINF12 and WBXML_PUBLIC_ID_SYNCML_DEVINF12 + values to be in line with the OMNA standard; closes: #507689. + + -- Michael Banck Thu, 04 Dec 2008 13:42:44 +0100 + +wbxml2 (0.9.2-6) unstable; urgency=low + + * debian/patches/bug_310622_message_5.mbox: File removed. + * debian/patches/current_attr_null.patch: Renamed to ... + * debian/patches/06-no-install-docs.patch: ... this. + * debian/patches/no-install-docs.patch: Renamed to ... + * debian/patches/07-current_attr_null.patch: ... this. + * debian/patches/08-maxsize-translation-table.patch: New patch, renames + Size tag to MaxSize for DS 1.2, by Michael Bell; closes: #497709. + + -- Michael Banck Thu, 04 Sep 2008 00:23:28 +0200 + +wbxml2 (0.9.2-5) unstable; urgency=low + + * New maintainer. + + debian/control (Maintainer): Set to myself. + * debian/control (Standards-Version): Bumped to 3.8.0. + * debian/control (libwbxml2-utils/Description): Make the short + description a bit more readable; closes: #493436. + * debian/patches/05-syncml-fixes.patch: New patch, fixes a couple of + issues with SyncML, by Michael Bell; closes: #487217. + + -- Michael Banck Wed, 06 Aug 2008 18:00:34 +0200 + +wbxml2 (0.9.2-4) unstable; urgency=low + + * Fix segault in wbxml_encoder.c, closes: #310621 + - Thanks Stijn van Drongelen + * Add Sax like entity parsing, closes: #461618 + * The above changes library behaviour, bump version dependency + - Thanks Stijn van Drongelen + * Fix version in .pc ile, closes: #422645 + - Thanks Jonny Lamb + * From synce project, Thanks Jonny Lamb + - Miscallaneus build fixes and anonymous document support + - Namespaces support + * Update to match policy 3.7.3 + - Source-Version -> binary:Version + - Add Homepage: + * move -dev and -dbg to libdevel and -dbg priority extra + + -- Riku Voipio Mon, 28 Jan 2008 23:29:44 +0200 + +wbxml2 (0.9.2-3) unstable; urgency=low + + * Add Conflicts/Replaces: agains old library. Closes: #390300 + + -- Riku Voipio Fri, 6 Oct 2006 08:01:47 +0300 + +wbxml2 (0.9.2-2) unstable; urgency=low + + * Rename library package to libwbxml2-0 due to ABI change + * renaming closes Closes: 364213, 384306, 385359, #387559 + * Add -dbg package while we are at it + + -- Riku Voipio Sat, 16 Sep 2006 11:44:02 +0300 + +wbxml2 (0.9.2-1) unstable; urgency=low + + * New upstream version Closes: #381987, #381985 + * Library now LGPL + * Most patches merged in by upstream + * Build-Depend on automake-1.9, closes: #376567 + - thanks James Westby + + -- Riku Voipio Tue, 8 Aug 2006 22:54:09 +0300 + +wbxml2 (0.9.0dfsg-1) unstable; urgency=low + + * The 'Finally got tired waiting upstream to release update' Release + * Rework package, use cdbs + * Repackage upstream tarball to get rid of strange permissions and + and CVS dirs + * Fix DRM REL keyvalue, closes: #341493 (thanks Jeremy Laine) + * Fix error message in wbxml2xml, closes: #310622 (thanks Ian Eure) + * Include complete patch opensync needs to sync on some cellphones, + Closes: #361850, #363600 + * fix FSF address + * Check against latest policy and updated + * bumb shlibs + + -- Riku Voipio Sun, 14 May 2006 20:49:42 +0300 + +wbxml2 (0.9.0-3) unstable; urgency=low + + * Apply patch to support Nokia syncml messages (Closes: #289173) + thanks Filip Raemdonck + + -- Riku Voipio Sat, 22 Jan 2005 10:03:29 +0000 + +wbxml2 (0.9.0-2) unstable; urgency=low + + * First real upload + * reference to common-licenses + + -- Riku Voipio Mon, 12 Jul 2004 18:11:03 +0000 + +wbxml2 (0.9.0-1) unstable; urgency=low + + * Initial Release. + + -- Riku Voipio Wed, 23 Jun 2004 20:15:53 +0300 + --- wbxml2-0.9.2.orig/debian/copyright +++ wbxml2-0.9.2/debian/copyright @@ -0,0 +1,31 @@ +This package was debianized by Riku Voipio on +Wed, 23 Jun 2004 20:15:53 +0300. + +It was downloaded from http://libwbxml.aymerick.com/index.php + +Upstream Author: Aymerick Jehanne + +For the Full copy of LGPL, see /usr/share/common-licenses + + * libwbxml, the WBXML Library. + * Copyright (C) 2002-2005 Aymerick Jehanne + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * LGPL v2.1: http://www.gnu.org/copyleft/lesser.txt + * + * Contact: libwbxml@aymerick.com + * Home: http://libwbxml.aymerick.com + --- wbxml2-0.9.2.orig/debian/libwbxml2-dev.dirs +++ wbxml2-0.9.2/debian/libwbxml2-dev.dirs @@ -0,0 +1,2 @@ +usr/lib +usr/include --- wbxml2-0.9.2.orig/debian/patches/06-no-install-docs.patch +++ wbxml2-0.9.2/debian/patches/06-no-install-docs.patch @@ -0,0 +1,14 @@ +diff -urP wbxml2-0.9.2/Makefile.am wbxml2-0.9.2.x/Makefile.am +--- wbxml2-0.9.2/Makefile.am 2006-07-11 14:47:43.000000000 +0300 ++++ wbxml2-0.9.2.x/Makefile.am 2006-08-08 22:26:18.000000000 +0300 +@@ -24,10 +24,6 @@ + TODO\ + doxygen.h + +-install-data-local: +- $(mkinstalldirs) $(DESTDIR)$(wbxmldocdir)/manual +- cp -Rp doc/* $(DESTDIR)$(wbxmldocdir)/manual +- + dist-bz2: distdir + sed -e "s/tar.gz/tar.bz2/g" $(distdir)/wbxml2.spec > $(distdir)/wbxml2.spec.aux + mv $(distdir)/wbxml2.spec.aux $(distdir)/wbxml2.spec --- wbxml2-0.9.2.orig/debian/patches/04_saxlike_entity_parsing.patch +++ wbxml2-0.9.2/debian/patches/04_saxlike_entity_parsing.patch @@ -0,0 +1,90 @@ +diff --git a/src/wbxml_parser.c b/src/wbxml_parser.c +index c022e00..bea2062 100644 +--- a/src/wbxml_parser.c ++++ b/src/wbxml_parser.c +@@ -43,6 +43,7 @@ + */ + + #include "wbxml.h" ++#include + + + /* Memory management related defines */ +@@ -56,10 +57,6 @@ + /** For unknown Tag Name or Attribute Name (in Best Effort Mode) */ + #define WBXML_PARSER_UNKNOWN_STRING ((WB_UTINY *)"unknown") + +-/** If you want to modify this define, change the 'entcode' variable length in parse_entity() too please */ +-#define WBXML_PARSER_MAX_ENTITY_CODE 999999 +- +- + /** + * @brief The WBXML Application Token types + */ +@@ -1661,7 +1658,6 @@ static WBXMLError parse_extension(WBXMLParser *parser, WBXMLTokenType code_space + */ + static WBXMLError parse_entity(WBXMLParser *parser, WBXMLBuffer **result) + { +- WB_TINY entity[10]; + WB_ULONG code = 0; + WBXMLError ret = WBXML_OK; + +@@ -1674,23 +1670,44 @@ static WBXMLError parse_entity(WBXMLParser *parser, WBXMLBuffer **result) + return ret; + } + +- /* Build Entity */ +- if ( code > WBXML_PARSER_MAX_ENTITY_CODE ) { +- return WBXML_ERROR_ENTITY_CODE_OVERFLOW; +- } +- +- /** +- * WARNING: If you change the entity variable length (10 chars), change too +- * 'WBXML_PARSER_MAX_ENTITY_CODE' defined in this file ! ++ /* ++ * Convert the UCS-4 code to a UTF-8 encoded string. + */ +- sprintf(entity, "&#%u;", code); + +- /* Create result buffer */ +- if ( (*result = wbxml_buffer_create_from_cstr(entity)) == NULL ) { +- return WBXML_ERROR_NOT_ENOUGH_MEMORY; ++ assert(code < 0x80000000); ++ ++ if (code < 0x80) ++ { ++ /* For codes under 0x80, we don't need any fancy formatting. */ ++ WB_TINY entity[2] = {(WB_TINY)code, 0}; ++ ++ /* Create result buffer */ ++ if ( (*result = wbxml_buffer_create_from_cstr(entity)) == NULL ) { ++ return WBXML_ERROR_NOT_ENOUGH_MEMORY; ++ } ++ ++ return WBXML_OK; ++ } ++ else ++ { ++ WB_TINY masks[5] = {0xFC, 0xF8, 0xF0, 0xE0, 0xC0}; ++ WB_TINY entity[7] = {0, 0, 0, 0, 0, 0, 0}; ++ ++ int index = 5; ++ while (code >= 0x40) ++ { ++ entity[index] = 0x80 | (code & 0x3F); ++ code >>= 6; index--; ++ } ++ entity[index] = masks[index] | code; ++ ++ /* Create result buffer */ ++ if ( (*result = wbxml_buffer_create_from_cstr(entity + index)) == NULL ) { ++ return WBXML_ERROR_NOT_ENOUGH_MEMORY; ++ } ++ ++ return WBXML_OK; + } +- +- return WBXML_OK; + } + + --- wbxml2-0.9.2.orig/debian/patches/05-syncml-fixes.patch +++ wbxml2-0.9.2/debian/patches/05-syncml-fixes.patch @@ -0,0 +1,124 @@ +diff -ru wbxml2-0.9.2-original/src/wbxml_encoder.c wbxml2-0.9.2/src/wbxml_encoder.c +--- wbxml2-0.9.2-original/src/wbxml_encoder.c 2006-07-11 13:47:45.000000000 +0200 ++++ wbxml2-0.9.2/src/wbxml_encoder.c 2008-06-20 11:24:17.000000000 +0200 +@@ -1936,7 +1936,8 @@ + #if defined( WBXML_SUPPORT_SYNCML ) + /* If this is a SyncML document ? */ + if ((encoder->lang->langID == WBXML_LANG_SYNCML_SYNCML10) || +- (encoder->lang->langID == WBXML_LANG_SYNCML_SYNCML11)) ++ (encoder->lang->langID == WBXML_LANG_SYNCML_SYNCML11) || ++ (encoder->lang->langID == WBXML_LANG_SYNCML_SYNCML12)) + { + /** @todo We must check too if we are in a */ + +@@ -4019,7 +4020,8 @@ + #if defined( WBXML_SUPPORT_SYNCML ) + /* Change text in from "application/vnd.syncml-devinf+wbxml" to "application/vnd.syncml-devinf+xml" */ + if (((encoder->lang->langID == WBXML_LANG_SYNCML_SYNCML10) || +- (encoder->lang->langID == WBXML_LANG_SYNCML_SYNCML11)) && ++ (encoder->lang->langID == WBXML_LANG_SYNCML_SYNCML11) || ++ (encoder->lang->langID == WBXML_LANG_SYNCML_SYNCML12)) && + (encoder->current_tag != NULL) && + (encoder->current_tag->wbxmlCodePage == 0x01 ) && + (encoder->current_tag->wbxmlToken == 0x13 ) && +diff -ru wbxml2-0.9.2-original/src/wbxml_tables.c wbxml2-0.9.2/src/wbxml_tables.c +--- wbxml2-0.9.2-original/src/wbxml_tables.c 2006-07-11 13:47:45.000000000 +0200 ++++ wbxml2-0.9.2/src/wbxml_tables.c 2008-06-20 11:28:18.000000000 +0200 +@@ -1601,21 +1601,21 @@ + #if defined( WBXML_SUPPORT_SYNCML ) + + const WBXMLNameSpaceEntry sv_syncml_syncml10_ns_table[] = { +- { "syncml:SYNCML1.0", 0x00 }, /**< Code Page 0: SYNCML1.0 */ ++ { "SYNCML:SYNCML1.0", 0x00 }, /**< Code Page 0: SYNCML1.0 */ + { "syncml:metinf", 0x01 }, /**< Code Page 1: metinf */ + { NULL, 0x00 } + }; + + + const WBXMLNameSpaceEntry sv_syncml_syncml11_ns_table[] = { +- { "syncml:SYNCML1.1", 0x00 }, /**< Code Page 0: SYNCML1.1 */ ++ { "SYNCML:SYNCML1.1", 0x00 }, /**< Code Page 0: SYNCML1.1 */ + { "syncml:metinf", 0x01 }, /**< Code Page 1: metinf */ + { NULL, 0x00 } + }; + + + const WBXMLNameSpaceEntry sv_syncml_syncml12_ns_table[] = { +- { "syncml:SYNCML1.2", 0x00 }, /**< Code Page 0: SYNCML1.2 */ ++ { "SYNCML:SYNCML1.2", 0x00 }, /**< Code Page 0: SYNCML1.2 */ + { "syncml:metinf", 0x01 }, /**< Code Page 1: metinf */ + { NULL, 0x00 } + }; +diff -ru wbxml2-0.9.2-original/src/wbxml_tree.c wbxml2-0.9.2/src/wbxml_tree.c +--- wbxml2-0.9.2-original/src/wbxml_tree.c 2006-07-11 13:47:45.000000000 +0200 ++++ wbxml2-0.9.2/src/wbxml_tree.c 2008-06-20 11:33:54.000000000 +0200 +@@ -244,7 +244,10 @@ + } + else { + if ((ret = wbxml_tree_clb_ctx.error) != WBXML_OK) ++ { ++ WBXML_ERROR((WBXML_CONV, "xml2wbxml conversion failed - context error %i", ret)); + wbxml_tree_destroy(wbxml_tree_clb_ctx.tree); ++ } + else + *tree = wbxml_tree_clb_ctx.tree; + } +@@ -798,11 +801,20 @@ + { + /* Check value */ + if ((tmp_node->children != NULL) && (tmp_node->children->type == WBXML_TREE_TEXT_NODE)) { ++ /* This function is used by wbxml and xml callbacks. ++ * So content types must be handled for both situations. ++ */ ++ + /* application/vnd.syncml-devinf+wbxml */ + if (wbxml_buffer_compare_cstr(tmp_node->children->content, "application/vnd.syncml-devinf+wbxml") == 0) { + return WBXML_SYNCML_DATA_TYPE_WBXML; + } + ++ /* application/vnd.syncml-devinf+xml */ ++ if (wbxml_buffer_compare_cstr(tmp_node->children->content, "application/vnd.syncml-devinf+xml") == 0) { ++ return WBXML_SYNCML_DATA_TYPE_NORMAL; ++ } ++ + /* text/clear */ + if (wbxml_buffer_compare_cstr(tmp_node->children->content, "text/clear") == 0) { + return WBXML_SYNCML_DATA_TYPE_CLEAR; +diff -ru wbxml2-0.9.2-original/src/wbxml_tree_clb_xml.c wbxml2-0.9.2/src/wbxml_tree_clb_xml.c +--- wbxml2-0.9.2-original/src/wbxml_tree_clb_xml.c 2006-07-11 13:47:46.000000000 +0200 ++++ wbxml2-0.9.2/src/wbxml_tree_clb_xml.c 2008-06-20 11:39:27.000000000 +0200 +@@ -142,7 +142,7 @@ + #if defined( WBXML_SUPPORT_SYNCML ) + + /* If this is an embedded (not root) "DevInf" document, skip it */ +- if ((WBXML_STRCMP(localName, "DevInf") == 0) && ++ if ((WBXML_STRCMP(localName, "syncml:devinf:DevInf") == 0) && + (tree_ctx->current != NULL)) + { + tree_ctx->skip_start = XML_GetCurrentByteIndex(tree_ctx->xml_parser); +@@ -192,7 +192,7 @@ + /* End of skipped node */ + + #if defined( WBXML_SUPPORT_SYNCML ) +- if (WBXML_STRCMP(localName, "DevInf") == 0) { ++ if (WBXML_STRCMP(localName, "syncml:devinf:DevInf") == 0) { + /* Get embedded DevInf Document */ + devinf_doc = wbxml_buffer_create(tree_ctx->input_buff + tree_ctx->skip_start, + XML_GetCurrentByteIndex(tree_ctx->xml_parser) - tree_ctx->skip_start, +@@ -210,6 +210,16 @@ + return; + } + ++ /* Add doctype to give the XML parser a chance ++ * SyncML 1.2 is downward compatible to older versions. ++ */ ++ if (!wbxml_buffer_insert_cstr(devinf_doc, "\n", 0)) ++ { ++ tree_ctx->error = WBXML_ERROR_NOT_ENOUGH_MEMORY; ++ wbxml_buffer_destroy(devinf_doc); ++ return; ++ } ++ + WBXML_DEBUG((WBXML_PARSER, "\t DevInf Doc : '%s'", wbxml_buffer_get_cstr(devinf_doc))); + + /* Parse 'DevInf' Document */ --- wbxml2-0.9.2.orig/debian/patches/08-maxsize-translation-table.patch +++ wbxml2-0.9.2/debian/patches/08-maxsize-translation-table.patch @@ -0,0 +1,17 @@ +#libwbxml2-0: Size changed to MaxSize in OMA DS 1.2 DevInf +# +#The normale Size tag was changed to MaxSize in OMA DS 1.2 Device +#Information. The number in the stringtable does not changed. So +#the order looks a little bit "funny". + +--- src/wbxml_tables.c.orig 2008-09-01 15:05:22.000000000 +0200 ++++ src/wbxml_tables.c 2008-09-01 15:05:58.000000000 +0200 +@@ -1891,7 +1891,7 @@ + { "Rx", 0x00, 0x19 }, + { "Rx-Pref", 0x00, 0x1a }, + { "SharedMem", 0x00, 0x1b }, +- { "Size", 0x00, 0x1c }, ++ { "MaxSize", 0x00, 0x1c }, + { "SourceRef", 0x00, 0x1d }, + { "SwV", 0x00, 0x1e }, + { "SyncCap", 0x00, 0x1f }, --- wbxml2-0.9.2.orig/debian/patches/01-anonymous-support-and-misc-fixes.patch +++ wbxml2-0.9.2/debian/patches/01-anonymous-support-and-misc-fixes.patch @@ -0,0 +1,304 @@ +diff -Nru wbxml2-0.9.2.orig/bootstrap wbxml2-0.9.2/bootstrap +--- wbxml2-0.9.2.orig/bootstrap 2008-01-10 19:03:28.000000000 +0000 ++++ wbxml2-0.9.2/bootstrap 2008-01-10 19:03:44.000000000 +0000 +@@ -1,8 +1,2 @@ +-#! /bin/sh +-libtoolize +-aclocal +-autoheader +-# automake --foreign --add-missing --copy +-automake --add-missing +-autoconf +-./configure --prefix=/usr ++#!/bin/sh ++autoreconf -i +diff -Nru wbxml2-0.9.2.orig/configure.in wbxml2-0.9.2/configure.in +--- wbxml2-0.9.2.orig/configure.in 2008-01-10 19:03:28.000000000 +0000 ++++ wbxml2-0.9.2/configure.in 2008-01-10 19:03:44.000000000 +0000 +@@ -1,11 +1,11 @@ + dnl Process this file with autoconf to produce a configure script. + AC_INIT(doxygen.h) +-AM_INIT_AUTOMAKE(wbxml2, 0.9.0) ++AM_INIT_AUTOMAKE(wbxml2, 0.9.2) + AM_CONFIG_HEADER(config.h) + + + dnl Define common variables +-VERSION="0.9.0" ++VERSION="0.9.2" + AC_SUBST(VERSION) + RELEASE="1" + AC_SUBST(RELEASE) +diff -Nru wbxml2-0.9.2.orig/libwbxml2.pc.in wbxml2-0.9.2/libwbxml2.pc.in +--- wbxml2-0.9.2.orig/libwbxml2.pc.in 2008-01-10 19:03:28.000000000 +0000 ++++ wbxml2-0.9.2/libwbxml2.pc.in 2008-01-10 19:03:44.000000000 +0000 +@@ -8,4 +8,4 @@ + Version: @VERSION@ + Requires: libxml-2.0 >= 2.6 + Libs: -L${libdir} -lwbxml2 +-Cflags: -I${includedir} ++Cflags: -I${includedir} -DHAVE_EXPAT -D_REENTRANT -DWBXML_ENCODER_USE_STRTBL -DWBXML_SUPPORT_WML -DWBXML_SUPPORT_WTA -DWBXML_SUPPORT_SI -DWBXML_SUPPORT_SL -DWBXML_SUPPORT_CO -DWBXML_SUPPORT_PROV -DWBXML_SUPPORT_EMN -DWBXML_SUPPORT_DRMREL -DWBXML_SUPPORT_OTA_SETTINGS -DWBXML_SUPPORT_SYNCML -DWBXML_SUPPORT_WV -DWBXML_SUPPORT_AIRSYNC +--- wbxml2-0.9.2.orig/src/Makefile.am 2008-01-10 19:03:28.000000000 +0000 ++++ wbxml2-0.9.2/src/Makefile.am 2008-01-10 19:03:44.000000000 +0000 +@@ -3,7 +3,7 @@ + INCLUDES =\ + -I. -I/usr/include + +-CFLAGS =\ ++AM_CFLAGS =\ + -DHAVE_CONFIG_H\ + -DHAVE_EXPAT\ + -D_REENTRANT\ +@@ -20,9 +20,7 @@ + -DWBXML_SUPPORT_SYNCML\ + -DWBXML_SUPPORT_WV\ + -DWBXML_SUPPORT_AIRSYNC\ +- -Wall -Wimplicit -Wreturn-type -Wunused -Wswitch -Wcomment -Wuninitialized -Wparentheses -Wpointer-arith -Wmissing-prototypes\ +- -O3\ +- -g ++ -Wall -g + + lib_LTLIBRARIES = libwbxml2.la + +diff -Nru wbxml2-0.9.2.orig/src/wbxml_encoder.c wbxml2-0.9.2/src/wbxml_encoder.c +--- wbxml2-0.9.2.orig/src/wbxml_encoder.c 2008-01-10 19:03:28.000000000 +0000 ++++ wbxml2-0.9.2/src/wbxml_encoder.c 2008-01-10 19:03:44.000000000 +0000 +@@ -153,6 +153,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 ? */ +@@ -400,6 +401,7 @@ + encoder->cdata = NULL; + + encoder->xml_encode_header = TRUE; ++ encoder->produce_anonymous = FALSE; + + /* Default Version: WBXML 1.3 */ + encoder->wbxml_version = WBXML_VERSION_13; +@@ -509,6 +511,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) +@@ -1464,7 +1475,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) + { +@@ -1601,7 +1613,7 @@ + } + else { + /* Search tag in Tags Table */ +- if ((tag = wbxml_tables_get_tag_from_xml(encoder->lang, wbxml_tag_get_xml_name(node->name))) != NULL) ++ if ((tag = wbxml_tables_get_tag_from_xml(encoder->lang, encoder->tagCodePage, wbxml_tag_get_xml_name(node->name))) != NULL) + { + token = tag->wbxmlToken; + page = tag->wbxmlCodePage; +@@ -2897,7 +2909,7 @@ + /* Date and time can be encoded as OPAQUE data or as a string as specified in [ISO8601]. For now we + * keep the string... but if someone wants to code the Date and time encoding function :-) + */ +- /* return wbxml_encode_wv_datetime(encoder, buffer); */ ++ return wbxml_encode_wv_datetime(encoder, buffer); + break; + case WBXML_WV_DATA_TYPE_BINARY: + /** @todo Binary Encoding !! */ +diff -Nru wbxml2-0.9.2.orig/src/wbxml_encoder.h wbxml2-0.9.2/src/wbxml_encoder.h +--- wbxml2-0.9.2.orig/src/wbxml_encoder.h 2008-01-10 19:03:28.000000000 +0000 ++++ wbxml2-0.9.2/src/wbxml_encoder.h 2008-01-10 19:03:44.000000000 +0000 +@@ -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 -Nru wbxml2-0.9.2.orig/src/wbxml.h wbxml2-0.9.2/src/wbxml.h +--- wbxml2-0.9.2.orig/src/wbxml.h 2008-01-10 19:03:28.000000000 +0000 ++++ wbxml2-0.9.2/src/wbxml.h 2008-01-10 19:03:44.000000000 +0000 +@@ -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 -Nru wbxml2-0.9.2.orig/src/wbxml_tables.c wbxml2-0.9.2/src/wbxml_tables.c +--- wbxml2-0.9.2.orig/src/wbxml_tables.c 2008-01-10 19:03:28.000000000 +0000 ++++ wbxml2-0.9.2/src/wbxml_tables.c 2008-01-10 19:03:44.000000000 +0000 +@@ -2992,17 +2992,40 @@ + + + WBXML_DECLARE(const WBXMLTagEntry *) wbxml_tables_get_tag_from_xml(const WBXMLLangEntry *lang_table, ++ const int cur_code_page, + const WB_UTINY *xml_name) + { +- WB_ULONG i = 0; ++ WB_ULONG i; ++ WB_BOOL found_current = FALSE; + + if ((lang_table == NULL) || (lang_table->tagTable == NULL) || (xml_name == NULL)) + return NULL; + +- while (lang_table->tagTable[i].xmlName != NULL) { +- if (WBXML_STRCMP(lang_table->tagTable[i].xmlName, xml_name) == 0) +- return &(lang_table->tagTable[i]); +- i++; ++ /* First off, try to find it in the current code page, if provided */ ++ for (i = 0; cur_code_page >= 0 && lang_table->tagTable[i].xmlName != NULL; i++) { ++ const WBXMLTagEntry *entry = &lang_table->tagTable[i]; ++ ++ if (entry->wbxmlCodePage == cur_code_page) { ++ found_current = TRUE; ++ ++ if (WBXML_STRCMP(entry->xmlName, xml_name) == 0) ++ return entry; ++ } else { ++ if (found_current) ++ break; ++ } ++ } ++ ++ /* Then try all others */ ++ for (i = 0; lang_table->tagTable[i].xmlName != NULL; i++) { ++ const WBXMLTagEntry *entry = &lang_table->tagTable[i]; ++ ++ /* We've already searched the current code page */ ++ if (cur_code_page >= 0 && entry->wbxmlCodePage == cur_code_page) ++ continue; ++ ++ if (WBXML_STRCMP(entry->xmlName, xml_name) == 0) ++ return entry; + } + + return NULL; +diff -Nru wbxml2-0.9.2.orig/src/wbxml_tables.h wbxml2-0.9.2/src/wbxml_tables.h +--- wbxml2-0.9.2.orig/src/wbxml_tables.h 2008-01-10 19:03:28.000000000 +0000 ++++ wbxml2-0.9.2/src/wbxml_tables.h 2008-01-10 19:03:44.000000000 +0000 +@@ -255,10 +255,12 @@ + /** + * @brief Search for a Tag Entry in Language Table, given the XML Name of the Tag + * @param lang_table The Language Table to search in ++ * @param cur_code_page The current code page so that it can be searched first, or -1 to start from the first one. + * @param xml_name The XML Name of the Tag to search + * @return The Tag Entry of this XML Name in Language Table, or NULL if not found + */ + WBXML_DECLARE(const WBXMLTagEntry *) wbxml_tables_get_tag_from_xml(const WBXMLLangEntry *lang_table, ++ const int cur_code_page, + const WB_UTINY *xml_name); + + /** +diff -Nru wbxml2-0.9.2.orig/src/wbxml_tree.c wbxml2-0.9.2/src/wbxml_tree.c +--- wbxml2-0.9.2.orig/src/wbxml_tree.c 2008-01-10 19:03:28.000000000 +0000 ++++ wbxml2-0.9.2/src/wbxml_tree.c 2008-01-10 19:03:44.000000000 +0000 +@@ -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() */ + } + +@@ -455,7 +462,7 @@ + WBXMLTag *tag = NULL; + + /* Search for XML Tag Name in Table */ +- if ((tag_entry = wbxml_tables_get_tag_from_xml(lang_table, name)) != NULL) { ++ if ((tag_entry = wbxml_tables_get_tag_from_xml(lang_table, -1, name)) != NULL) { + /* Found : token tag */ + tag = wbxml_tag_create_token(tag_entry); + } +@@ -921,6 +928,7 @@ + result->lang = wbxml_tables_get_table(lang); + result->root = NULL; + result->orig_charset = orig_charset; ++ result->cur_code_page = 0; + + return result; + } +@@ -1085,7 +1093,9 @@ + WBXMLTag *tag = NULL; + + /* Search for XML Tag Name in Table */ +- if ((tag_entry = wbxml_tables_get_tag_from_xml(tree->lang, (const WB_UTINY *) name)) != NULL) { ++ if ((tag_entry = wbxml_tables_get_tag_from_xml(tree->lang, tree->cur_code_page, (const WB_UTINY *) name)) != NULL) { ++ tree->cur_code_page = tag_entry->wbxmlCodePage; ++ + /* Found : token tag */ + tag = wbxml_tag_create_token(tag_entry); + } +diff -Nru wbxml2-0.9.2.orig/src/wbxml_tree.h wbxml2-0.9.2/src/wbxml_tree.h +--- wbxml2-0.9.2.orig/src/wbxml_tree.h 2008-01-10 19:03:28.000000000 +0000 ++++ wbxml2-0.9.2/src/wbxml_tree.h 2008-01-10 19:03:44.000000000 +0000 +@@ -97,6 +97,7 @@ + const WBXMLLangEntry *lang; /**< Language Table */ + WBXMLTreeNode *root; /**< Root Element */ + WBXMLCharsetMIBEnum orig_charset; /**< Charset encoding of original document */ ++ WB_UTINY cur_code_page;/**< Last seen code page */ + } WBXMLTree; + + +diff -Nru wbxml2-0.9.2.orig/tools/Makefile.am wbxml2-0.9.2/tools/Makefile.am +--- wbxml2-0.9.2.orig/tools/Makefile.am 2008-01-10 19:03:28.000000000 +0000 ++++ wbxml2-0.9.2/tools/Makefile.am 2008-01-10 19:03:44.000000000 +0000 +@@ -3,7 +3,7 @@ + INCLUDES =\ + -I. -I../src -I/usr/include + +-CFLAGS =\ ++AM_CFLAGS =\ + -DHAVE_CONFIG_H\ + -DHAVE_EXPAT\ + -D_REENTRANT\ +@@ -20,9 +20,7 @@ + -DWBXML_SUPPORT_SYNCML\ + -DWBXML_SUPPORT_WV\ + -DWBXML_SUPPORT_AIRSYNC\ +- -Wall -Wimplicit -Wreturn-type -Wunused -Wswitch -Wcomment -Wuninitialized -Wparentheses -Wpointer-arith -Wmissing-prototypes\ +- -O3\ +- -g ++ -Wall -g + + bin_PROGRAMS = wbxml2xml xml2wbxml + --- wbxml2-0.9.2.orig/debian/patches/07-current_attr_null.patch +++ wbxml2-0.9.2/debian/patches/07-current_attr_null.patch @@ -0,0 +1,22 @@ +--- wbxml2-0.9.2/src/wbxml_encoder.orig.c 2008-01-20 01:25:46.000000000 +0100 ++++ wbxml2-0.9.2/src/wbxml_encoder.c 2008-01-20 01:26:25.000000000 +0100 +@@ -1875,6 +1875,9 @@ + #if defined( WBXML_SUPPORT_SI ) + case WBXML_LANG_SI10: + /* SI 1.0: Encode date for 'created' and 'si-expires' attributes */ ++ if (encoder->current_attr == NULL) ++ break; ++ + if ((encoder->current_attr->wbxmlCodePage == 0x00) && + ((encoder->current_attr->wbxmlToken == 0x0a) || (encoder->current_attr->wbxmlToken == 0x10))) + { +@@ -1886,6 +1889,9 @@ + #if defined( WBXML_SUPPORT_EMN ) + case WBXML_LANG_EMN10: + /* EMN 1.0: Encode date for 'timestamp' attribute */ ++ if (encoder->current_attr == NULL) ++ break; ++ + if ((encoder->current_attr->wbxmlCodePage == 0x00) && (encoder->current_attr->wbxmlToken == 0x05)) + { + return wbxml_encode_datetime(encoder, buffer); --- wbxml2-0.9.2.orig/debian/patches/09-devinf-doctype.patch +++ wbxml2-0.9.2/debian/patches/09-devinf-doctype.patch @@ -0,0 +1,53 @@ +--- src/wbxml_tree_clb_xml.c.orig 2008-11-18 13:19:11.000000000 +0100 ++++ src/wbxml_tree_clb_xml.c 2008-11-18 14:07:58.000000000 +0100 +@@ -210,15 +210,41 @@ + return; + } + +- /* Add doctype to give the XML parser a chance +- * SyncML 1.2 is downward compatible to older versions. +- */ +- if (!wbxml_buffer_insert_cstr(devinf_doc, "\n", 0)) +- { +- tree_ctx->error = WBXML_ERROR_NOT_ENOUGH_MEMORY; +- wbxml_buffer_destroy(devinf_doc); +- return; +- } ++ /* Add doctype to give the XML parser a chance */ ++ const WBXMLLangEntry *lang; ++ switch(tree_ctx->tree->lang->langID) ++ { ++ case WBXML_LANG_SYNCML_SYNCML10: ++ lang = wbxml_tables_get_table(WBXML_LANG_SYNCML_DEVINF10); ++ break; ++ case WBXML_LANG_SYNCML_SYNCML11: ++ lang = wbxml_tables_get_table(WBXML_LANG_SYNCML_DEVINF11); ++ break; ++ case WBXML_LANG_SYNCML_SYNCML12: ++ lang = wbxml_tables_get_table(WBXML_LANG_SYNCML_DEVINF12); ++ break; ++ default: ++ tree_ctx->error = WBXML_ERROR_UNKNOWN_XML_LANGUAGE; ++ return; ++ } ++ WBXMLBuffer *buffer = wbxml_buffer_create(NULL, 0, 0); ++ if (!buffer) { ++ tree_ctx->error = WBXML_ERROR_NOT_ENOUGH_MEMORY; ++ return; ++ } ++ /* DOCTYPE in reverse order */ ++ if (!wbxml_buffer_insert_cstr(devinf_doc, "\">\n", 0) || /* > */ ++ !wbxml_buffer_insert_cstr(devinf_doc, lang->publicID->xmlDTD, 0) || /* DTD */ ++ !wbxml_buffer_insert_cstr(devinf_doc, "\" \"", 0) || /* DTD */ ++ !wbxml_buffer_insert_cstr(devinf_doc, lang->publicID->xmlPublicID, 0) || /* Public ID */ ++ !wbxml_buffer_insert_cstr(devinf_doc, " PUBLIC \"", 0) || /* PUBLIC " */ ++ !wbxml_buffer_insert_cstr(devinf_doc, lang->publicID->xmlRootElt, 0) || /* Root Element */ ++ !wbxml_buffer_insert_cstr(devinf_doc, "error = WBXML_ERROR_ENCODER_APPEND_DATA; ++ wbxml_buffer_destroy(devinf_doc); ++ return; ++ } + + WBXML_DEBUG((WBXML_PARSER, "\t DevInf Doc : '%s'", wbxml_buffer_get_cstr(devinf_doc))); + --- wbxml2-0.9.2.orig/debian/patches/02-namespaces.patch +++ wbxml2-0.9.2/debian/patches/02-namespaces.patch @@ -0,0 +1,164 @@ +diff -Nru wbxml2-0.9.2.patched/src/wbxml_tables.c wbxml2-0.9.2/src/wbxml_tables.c +--- wbxml2-0.9.2.patched/src/wbxml_tables.c 2008-01-10 19:05:45.000000000 +0000 ++++ wbxml2-0.9.2/src/wbxml_tables.c 2008-01-10 19:04:55.000000000 +0000 +@@ -2806,6 +2806,46 @@ + { NULL, 0x00, 0x00 } + }; + ++/* NOTE: ++ * These namespace names differ from the Microsoft-assigned namespaces. The ++ * reason for the difference is that the Microsoft-assigned names are not ++ * valid URI's and hence produce warning messages when processed by some ++ * libraries. The mapping is as follows: ++ * ++ * Microsoft Ours ++ * --------- ---- ++ * AirSync: http://synce.org/formats/airsync_wm5/airsync ++ * POOMCONTACTS: http://synce.org/formats/airsync_wm5/contacts ++ * POOMMAIL: http://synce.org/formats/airsync_wm5/mail ++ * AirNotify: http://synce.org/formats/airsync_wm5/airnotify ++ * POOMCAL: http://synce.org/formats/airsync_wm5/calendar ++ * Move: http://synce.org/formats/airsync_wm5/move ++ * GetItemEstimate: http://synce.org/formats/airsync_wm5/getitemestimate ++ * FolderHierarchy: http://synce.org/formats/airsync_wm5/folderhierarchy ++ * MeetingResponse: http://synce.org/formats/airsync_wm5/meetingresponse ++ * POOMTASKS: http://synce.org/formats/airsync_wm5/tasks ++ * ResolveRecipients: http://synce.org/formats/airsync_wm5/resolverecipients ++ * ValidateCert: http://synce.org/formats/airsync_wm5/validatecert ++ * POOMCONTACTS2: http://synce.org/formats/airsync_wm5/contacts2 ++ * ++ */ ++const WBXMLNameSpaceEntry sv_airsync_ns_table[] = { ++ { "http://synce.org/formats/airsync_wm5/airsync", 0x00 }, /**< Code Page 0 */ ++ { "http://synce.org/formats/airsync_wm5/contacts", 0x01 }, /**< Code Page 1 */ ++ { "http://synce.org/formats/airsync_wm5/mail", 0x02 }, /**< Code Page 2 */ ++ { "http://synce.org/formats/airsync_wm5/airnotify", 0x03 }, /**< Code Page 3 */ ++ { "http://synce.org/formats/airsync_wm5/calendar", 0x04 }, /**< Code Page 4 */ ++ { "http://synce.org/formats/airsync_wm5/move", 0x05 }, /**< Code Page 5 */ ++ { "http://synce.org/formats/airsync_wm5/getitemestimate", 0x06 }, /**< Code Page 6 */ ++ { "http://synce.org/formats/airsync_wm5/folderhierarchy", 0x07 }, /**< Code Page 7 */ ++ { "http://synce.org/formats/airsync_wm5/meetingresponse", 0x08 }, /**< Code Page 8 */ ++ { "http://synce.org/formats/airsync_wm5/tasks", 0x09 }, /**< Code Page 9 */ ++ { "http://synce.org/formats/airsync_wm5/resolverecipients", 0x0a }, /**< Code Page 10 */ ++ { "http://synce.org/formats/airsync_wm5/validatecert", 0x0b }, /**< Code Page 11 */ ++ { "http://synce.org/formats/airsync_wm5/contacts2", 0x0c }, /**< Code Page 12 */ ++ { NULL, 0x00 } ++}; ++ + #endif /* WBXML_SUPPORT_AIRSYNC */ + + +@@ -2885,7 +2925,7 @@ + #endif /* WBXML_SUPPORT_WV */ + + #if defined( WBXML_SUPPORT_AIRSYNC ) +- { WBXML_LANG_AIRSYNC, &sv_airsync_public_id, sv_airsync_tag_table, NULL, NULL, NULL, NULL }, ++ { WBXML_LANG_AIRSYNC, &sv_airsync_public_id, sv_airsync_tag_table, sv_airsync_ns_table, NULL, NULL, NULL }, + #endif /* WBXML_SUPPORT_AIRSYNC */ + + { WBXML_LANG_UNKNOWN, NULL, NULL, NULL, NULL, NULL, NULL } +@@ -3169,3 +3209,21 @@ + + return NULL; + } ++ ++WBXML_DECLARE(WB_UTINY) wbxml_tables_get_code_page(const WBXMLNameSpaceEntry *ns_table, const WB_TINY* xmlns) ++{ ++ WB_ULONG i = 0; ++ ++ if (ns_table == NULL) ++ return NULL; ++ ++ while (ns_table[i].xmlNameSpace != NULL) ++ { ++ if (strcmp(ns_table[i].xmlNameSpace, xmlns) == 0) ++ return ns_table[i].wbxmlCodePage; ++ ++ i++; ++ } ++ ++ return NULL; ++} +diff -Nru wbxml2-0.9.2.patched/src/wbxml_tables.h wbxml2-0.9.2/src/wbxml_tables.h +--- wbxml2-0.9.2.patched/src/wbxml_tables.h 2008-01-10 19:05:45.000000000 +0000 ++++ wbxml2-0.9.2/src/wbxml_tables.h 2008-01-10 19:04:55.000000000 +0000 +@@ -310,6 +310,9 @@ + WBXML_DECLARE(const WB_TINY *) wbxml_tables_get_xmlns(const WBXMLNameSpaceEntry *ns_table, + WB_UTINY code_page); + ++WBXML_DECLARE(WB_UTINY) wbxml_tables_get_code_page(const WBXMLNameSpaceEntry *ns_table, ++ const WB_TINY* xmlns); ++ + /** @} */ + + #ifdef __cplusplus +diff -Nru wbxml2-0.9.2.patched/src/wbxml_tree.c wbxml2-0.9.2/src/wbxml_tree.c +--- wbxml2-0.9.2.patched/src/wbxml_tree.c 2008-01-10 19:05:45.000000000 +0000 ++++ wbxml2-0.9.2/src/wbxml_tree.c 2008-01-10 19:04:55.000000000 +0000 +@@ -34,6 +34,7 @@ + + #include "wbxml.h" + ++#define WBXML_NAMESPACE_SEPARATOR ':' + + /*************************************************** + * Public Functions +@@ -201,9 +202,9 @@ + *tree = NULL; + + /* Create Expat XML Parser */ +- if ((xml_parser = XML_ParserCreate(NULL)) == NULL) ++ if ((xml_parser = XML_ParserCreateNS(NULL, WBXML_NAMESPACE_SEPARATOR)) == NULL) + return WBXML_ERROR_NOT_ENOUGH_MEMORY; +- ++ + /* Init context */ + wbxml_tree_clb_ctx.current = NULL; + wbxml_tree_clb_ctx.error = WBXML_OK; +@@ -1091,9 +1092,32 @@ + const WBXMLTagEntry *tag_entry = NULL; + WBXMLTreeNode *node = NULL; + WBXMLTag *tag = NULL; +- ++ WB_UTINY *sep = NULL; ++ const WB_UTINY *namespace_name = NULL; ++ const WB_UTINY *element_name = NULL; ++ ++ /* Separate the namespace from the element name */ ++ sep = (WB_UTINY *)strrchr((const WB_TINY *) name, WBXML_NAMESPACE_SEPARATOR); ++ if (sep != NULL) { ++ /* Temporarily split the string by changing the separater to a null-terminator */ ++ *sep = '\0'; ++ ++ namespace_name = name; ++ element_name = sep+1; ++ } ++ else { ++ /* No namespace, so just set it to an empty string (specifically, the null-terminator at the end of the elemet name */ ++ namespace_name = name + strlen((const WB_TINY *) name); ++ element_name = name; ++ } ++ ++ WBXML_DEBUG((WBXML_CONV, "Parsed element name: Namespace='%s', Element='%s'", namespace_name, element_name)); ++ ++ /* Update the current code page to match the one specified by the namespace */ ++ tree->cur_code_page = wbxml_tables_get_code_page(tree->lang->nsTable, (const WB_TINY *) namespace_name); ++ + /* Search for XML Tag Name in Table */ +- if ((tag_entry = wbxml_tables_get_tag_from_xml(tree->lang, tree->cur_code_page, (const WB_UTINY *) name)) != NULL) { ++ if ((tag_entry = wbxml_tables_get_tag_from_xml(tree->lang, tree->cur_code_page, element_name)) != NULL) { + tree->cur_code_page = tag_entry->wbxmlCodePage; + + /* Found : token tag */ +@@ -1104,6 +1128,11 @@ + tag = wbxml_tag_create_literal(name); + } + ++ if (sep != NULL) { ++ /* We are done with the element and namespace names, so put the separator character back */ ++ *sep = WBXML_NAMESPACE_SEPARATOR; ++ } ++ + if (tag == NULL) + return NULL; + --- wbxml2-0.9.2.orig/debian/patches/10-fix-wbxml-public-ids.patch +++ wbxml2-0.9.2/debian/patches/10-fix-wbxml-public-ids.patch @@ -0,0 +1,22 @@ +--- wbxml2-0.9.2/src/wbxml_tables.h 2008-12-03 17:52:59.000000000 +0100 ++++ wbxml2-0.10.0~rc2/src/wbxml_tables.h 2008-12-03 14:48:34.000000000 +0100 +@@ -99,17 +99,14 @@ + #define WBXML_PUBLIC_ID_SYNCML_DEVINF11 0x0FD4 + #define WBXML_PUBLIC_ID_SYNCML_METINF11 WBXML_PUBLIC_ID_UNKNOWN /* No WBXML PublicID defined for SyncML Meta Info */ + +-/** @todo Nokia phones use this PublicID */ +-/* #define WBXML_PUBLIC_ID_SYNCML_SYNCML11_NOKIA 0x9F53 */ +- + #define XML_PUBLIC_ID_SYNCML_SYNCML11 "-//SYNCML//DTD SyncML 1.1//EN" + #define XML_PUBLIC_ID_SYNCML_DEVINF11 "-//SYNCML//DTD DevInf 1.1//EN" + #define XML_PUBLIC_ID_SYNCML_METINF11 "-//SYNCML//DTD MetInf 1.1//EN" + + /* SyncML 1.2 */ + #define WBXML_PUBLIC_ID_SYNCML_SYNCML12 0x1201 +-#define WBXML_PUBLIC_ID_SYNCML_DEVINF12 0x1202 +-#define WBXML_PUBLIC_ID_SYNCML_METINF12 0x1203 ++#define WBXML_PUBLIC_ID_SYNCML_METINF12 0x1202 ++#define WBXML_PUBLIC_ID_SYNCML_DEVINF12 0x1203 + + #define XML_PUBLIC_ID_SYNCML_SYNCML12 "-//SYNCML//DTD SyncML 1.2//EN" + #define XML_PUBLIC_ID_SYNCML_DEVINF12 "-//SYNCML//DTD DevInf 1.2//EN"