From: Emanoil K. <del...@ya...> - 2011-04-13 11:15:39
|
Hi, Michael is supposed to support it. Did you log a bug on libwbxml? I had to clean up all the libraries and stuff from the old version of wbxml. I don't think you can use and compile code successfully with both. Ask Michi for an answer. regards --- On Wed, 4/13/11, Thierry Passeron <thi...@gm...> wrote: From: Thierry Passeron <thi...@gm...> Subject: [Opensync-users] libwbxml issue To: ope...@li... Date: Wednesday, April 13, 2011, 11:38 AM #yiv256243819 p.yiv256243819p1 {margin:0.0px 0.0px 0.0px 0.0px;font:12.0px Helvetica;} #yiv256243819 p.yiv256243819p2 {margin:0.0px 0.0px 0.0px 0.0px;font:12.0px Helvetica;min-height:14.0px;} #yiv256243819 p.yiv256243819p3 {margin:0.0px 0.0px 0.0px 0.0px;font:12.0px Monaco;} #yiv256243819 p.yiv256243819p4 {margin:0.0px 0.0px 0.0px 0.0px;font:12.0px Monaco;min-height:16.0px;} #yiv256243819 p.yiv256243819p5 {margin:0.0px 0.0px 0.0px 0.0px;font:12.0px Monaco;color:#ff3e4a;min-height:16.0px;} #yiv256243819 p.yiv256243819p6 {margin:0.0px 0.0px 0.0px 0.0px;font:11.0px Menlo;} Hello there, I'm using libwbxml (0.10.9 and 0.11.beta 2) so far I have experienced weird behaviors while encoding and decoding XML/WBXML data. The lib is compiled as static lib for one of my projects on mac platform with Objective-C and I made a wrapper function to encode XML. The issue I'm experiencing is some kind of stack crushing in the encoding function. Here is a simple example: #import <Foundation/Foundation.h> #import "wbxml.h" NSData* myencode(NSData *XMLData) { NSData *WBXMLData = nil; WBXMLGenWBXMLParams params; params.wbxml_version = WBXML_VERSION_13; params.use_strtbl = TRUE; params.keep_ignorable_ws = FALSE; WB_UTINY *wbxml = NULL; WB_ULONG wbxml_len = 0; WB_UTINY *xml = (WB_UTINY *)[XMLData bytes]; WB_LONG xml_len = [XMLData length]; WBXMLError ret = wbxml_conv_xml2wbxml_withlen(xml, xml_len, &wbxml, &wbxml_len, ¶ms); if (ret == WBXML_OK) { WBXMLData = [NSData dataWithBytes:wbxml length:wbxml_len]; } if (wbxml != NULL) free(wbxml); return WBXMLData; } int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSData *XMLData = [NSData dataWithContentsOfFile:@"/Users/orion/Documents/_Clients/Mobiquant/test/test.txt"]; uint i; for (i=0; i<10; i++){ NSLog(@"encoded: %@", myencode(XMLData)); } [pool release]; return 0; } Now see the result log: GNU gdb 6.3.50-20050815 (Apple version gdb-1518) (Sat Feb 12 02:52:12 UTC 2011) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-apple-darwin". tty /dev/ttys010 Pending breakpoint 1 - "objc_exception_throw" resolved Pending breakpoint 4 - "_objc_error" resolved [Switching to process 16086 thread 0x0] 2011-04-13 10:13:56.109 wbxml-cmd-a[16086:903] encoded: <0300006a 1c2d2f2f 41495253 594e432f 2f445444 20416972 53796e63 2f2f454e 00000756 00004b03 30000101> 2011-04-13 10:13:56.123 wbxml-cmd-a[16086:903] encoded: <03016a00 00075600 004b0330 000101> 2011-04-13 10:13:56.126 wbxml-cmd-a[16086:903] encoded: <03016a00 00075600 004b0330 000101> 2011-04-13 10:13:56.130 wbxml-cmd-a[16086:903] encoded: <03016a00 00075600 004b0330 000101> 2011-04-13 10:13:56.134 wbxml-cmd-a[16086:903] encoded: <03016a00 00075600 004b0330 000101> 2011-04-13 10:13:56.138 wbxml-cmd-a[16086:903] encoded: <03016a00 00075600 004b0330 000101> 2011-04-13 10:13:56.142 wbxml-cmd-a[16086:903] encoded: <03016a00 00075600 004b0330 000101> 2011-04-13 10:13:56.152 wbxml-cmd-a[16086:903] encoded: <03016a00 00075600 004b0330 000101> 2011-04-13 10:13:56.163 wbxml-cmd-a[16086:903] encoded: <03016a00 00075600 004b0330 000101> 2011-04-13 10:13:56.168 wbxml-cmd-a[16086:903] encoded: <03016a00 00075600 004b0330 000101> Program ended with exit code: 0 Can anyone help me track the problem here ?Which version of the lib should I use for ActiveSync, 0.11.beta 2 ? Thanks and regards,Thierry Passeron -----Inline Attachment Follows----- ------------------------------------------------------------------------------ Forrester Wave Report - Recovery time is now measured in hours and minutes not days. Key insights are discussed in the 2010 Forrester Wave Report as part of an in-depth evaluation of disaster recovery service providers. Forrester found the best-in-class provider in terms of services and vision. Read this report now! http://p.sf.net/sfu/ibm-webcastpromo -----Inline Attachment Follows----- _______________________________________________ Opensync-users mailing list Ope...@li... https://lists.sourceforge.net/lists/listinfo/opensync-users |