You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
(56) |
Apr
(109) |
May
(15) |
Jun
(3) |
Jul
(37) |
Aug
(96) |
Sep
(40) |
Oct
(4) |
Nov
(54) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(47) |
Feb
(30) |
Mar
(102) |
Apr
(120) |
May
(68) |
Jun
(54) |
Jul
(53) |
Aug
(122) |
Sep
(190) |
Oct
(71) |
Nov
(85) |
Dec
(108) |
2007 |
Jan
(72) |
Feb
(190) |
Mar
(53) |
Apr
(101) |
May
(145) |
Jun
(148) |
Jul
(167) |
Aug
(143) |
Sep
(23) |
Oct
(198) |
Nov
(223) |
Dec
(195) |
2008 |
Jan
(100) |
Feb
(129) |
Mar
(79) |
Apr
(77) |
May
(34) |
Jun
(95) |
Jul
(112) |
Aug
(160) |
Sep
(82) |
Oct
(124) |
Nov
(199) |
Dec
(355) |
2009 |
Jan
(436) |
Feb
(89) |
Mar
(298) |
Apr
(189) |
May
(33) |
Jun
(88) |
Jul
(105) |
Aug
(44) |
Sep
(181) |
Oct
(87) |
Nov
(75) |
Dec
(1) |
2010 |
Jan
(63) |
Feb
(21) |
Mar
(3) |
Apr
(1) |
May
(1) |
Jun
(3) |
Jul
(26) |
Aug
(37) |
Sep
(26) |
Oct
(15) |
Nov
(13) |
Dec
|
From: <dg...@su...> - 2009-01-14 13:48:32
|
Author: bellmich Date: Wed Jan 14 14:47:37 2009 New Revision: 156 URL: http://libwbxml.opensync.org/changeset/156 Log: added code to check for xmllint and diff These programs are needed to test the correctness of the conversions. Modified: wbxml2/trunk/CMakeLists.txt Modified: wbxml2/trunk/CMakeLists.txt ============================================================================== --- wbxml2/trunk/CMakeLists.txt Wed Jan 14 14:46:04 2009 (r155) +++ wbxml2/trunk/CMakeLists.txt Wed Jan 14 14:47:37 2009 (r156) @@ -71,6 +71,7 @@ # popt is not used # zlib is not used # nsl is part of libc6 + FIND_PACKAGE( Expat REQUIRED ) FIND_PACKAGE( Check ) @@ -83,6 +84,23 @@ INCLUDE( Testing ) ENDIF(CHECK_FOUND) +# look for the commands required for testing + +FIND_PROGRAM( XMLLINT_PROGRAM "xmllint" ) +FIND_PROGRAM( DIFF_PROGRAM "diff" ) + +IF( XMLLINT_PROGRAM ) + SET( ENABLE_XMLLINT ON ) +ELSE( XMLLINT_PROGRAM ) + SET( ENABLE_XMLLINT OFF ) +ENDIF( XMLLINT_PROGRAM ) + +IF( DIFF_PROGRAM ) + SET( ENABLE_DIFF ON ) +ELSE( DIFF_PROGRAM ) + SET( ENABLE_DIFF OFF ) +ENDIF( DIFF_PROGRAM ) + OPTION( WBXML_LIB_VERBOSE "verbose mode" OFF ) OPTION( WBXML_ENCODER_USE_STRTBL "enable string tables" ON ) OPTION( WBXML_SUPPORT_WML "enable WML support" ON ) @@ -162,6 +180,8 @@ MESSAGE( STATUS "==================================================" ) SHOW_STATUS( WBXML_LIB_VERBOSE "verbose mode\t\t\t" ) SHOW_STATUS( ENABLE_UNIT_TEST "unit tests\t\t\t" ) +SHOW_STATUS( ENABLE_XMLLINT "xmllint binary (test generated XML)" ) +SHOW_STATUS( ENABLE_DIFF "diff binary (test generated XML)" ) SHOW_STATUS( WBXML_ENCODER_USE_STRTBL "enable string tables\t\t" ) SHOW_STATUS( WBXML_SUPPORT_WML "enable WML support\t\t" ) SHOW_STATUS( WBXML_SUPPORT_WTA "enable WTA support\t\t" ) |
From: <dg...@su...> - 2009-01-14 13:46:54
|
Author: bellmich Date: Wed Jan 14 14:46:04 2009 New Revision: 155 URL: http://libwbxml.opensync.org/changeset/155 Log: added code to compare original and generated XML The correctness is tested now. Modified: wbxmlTestSuite/trunk/launchTests.sh Modified: wbxmlTestSuite/trunk/launchTests.sh ============================================================================== --- wbxmlTestSuite/trunk/launchTests.sh Wed Jan 14 13:21:48 2009 (r154) +++ wbxmlTestSuite/trunk/launchTests.sh Wed Jan 14 14:46:04 2009 (r155) @@ -10,6 +10,19 @@ XML2WBXML=`which xml2wbxml` fi +if [ " ${XMLLINT_PROGRAM}" != " " ] +then + XMLLINT_BIN="${XMLLINT_PROGRAM}" +else + XMLLINT_BIN=`which xmllint` +fi +if [ " ${DIFF_BIN}" != " " ] +then + DIFF_BIN="${DIFF_BIN}" +else + DIFF_BIN=`which diff` +fi + if [ ! -x "$WBXML2XML" ] then echo Set WBXML2XML to the binary executable of wbxml2xml tool in order to use that script. @@ -106,16 +119,18 @@ OUT_WBXML="$TMP_DIR/`basename $i`/`basename $j .xml`.wbxml" OUT_XML="$TMP_DIR/`basename $i`/`basename $j`" - # Create output directory if they don't exist + # Create output directory if they don't exist if [ ! -d "$TMP_DIR/`basename $i`" ]; then mkdir -p "$TMP_DIR/`basename $i`" fi + # XML ==> WBXML echo Converting into: $OUT_WBXML CMD="$XML2WBXML -o $OUT_WBXML $j" $CMD if [ $? != 0 ]; then RESULT="FAILED"; fi + # WBXML ==> XML echo Converting back: $OUT_XML TESTDIR=`basename $i` if [ "$TESTDIR" = "ota" ]; @@ -130,6 +145,26 @@ CMD="$WBXML2XML $PARAMS -o $OUT_XML $OUT_WBXML" $CMD if [ $? != 0 ]; then RESULT="FAILED"; fi + + # compare original and generated XML + echo -n "Comparing the original and the generated XML ... " + if [ " $XMLLINT_BIN" = " " -o " $DIFF_BIN" = " " ] + then + echo UNSUPPORTED + else + # (first we strip the comments from the original file) + awk '/<!--/,/-->/{next}1' $j > ${OUT_XML}.org + xmllint -format ${OUT_XML}.org > ${OUT_XML}.org0 + xmllint -format ${OUT_XML} > ${OUT_XML}.new0 + DIFF_RESULT=`diff ${OUT_XML}.org0 ${OUT_XML}.new0` + if [ " ${DIFF_RESULT}" != " " ]; + then + echo FAILED + RESULT="FAILED"; + else + echo SUCCEEDED + fi + fi done fi |
From: <dg...@su...> - 2009-01-14 12:53:59
|
Author: Graham Cobb Date: Wed Jan 14 12:51:38 2009 New Revision: 5141 URL: http://www.opensync.org/changeset/5141 Log: gpe-sync: Remove already commented out "member" from environment Modified: plugins/gpe/ChangeLog plugins/gpe/src/gpe_sync.h Modified: plugins/gpe/ChangeLog ============================================================================== --- plugins/gpe/ChangeLog Wed Jan 14 12:18:16 2009 (r5140) +++ plugins/gpe/ChangeLog Wed Jan 14 12:51:38 2009 (r5141) @@ -1,5 +1,7 @@ 2009-01-14 Graham Cobb <g+...@co...> + * src/gpe_sync.h: Remove already commented out "member" from environment + * src/utils.c (report_change): Fix setting objtype of data in change. Fix setting change type. Modified: plugins/gpe/src/gpe_sync.h ============================================================================== --- plugins/gpe/src/gpe_sync.h Wed Jan 14 12:18:16 2009 (r5140) +++ plugins/gpe/src/gpe_sync.h Wed Jan 14 12:51:38 2009 (r5141) @@ -46,8 +46,6 @@ } sink_environment; typedef struct gpe_environment { - // OSyncMember *member; - struct sink_environment contact_sink; struct sink_environment todo_sink; struct sink_environment calendar_sink; @@ -66,12 +64,12 @@ const char *calendar; // Name of GPE calendar to use or NULL int debuglevel; - + /* Peer information */ int v_major; int v_minor; int v_edit; - + /* Status */ int configured; /* Configuration has been parsed */ int discovered; /* Discovery has happened */ |
From: <dg...@su...> - 2009-01-14 12:53:53
|
Author: bellmich Date: Wed Jan 14 13:21:48 2009 New Revision: 154 URL: http://libwbxml.opensync.org/changeset/154 Log: TESTCASE does not exist. TESTDIR is the correct parameter. Modified: wbxml2/trunk/CMakeLists.txt Modified: wbxml2/trunk/CMakeLists.txt ============================================================================== --- wbxml2/trunk/CMakeLists.txt Wed Jan 14 13:21:10 2009 (r153) +++ wbxml2/trunk/CMakeLists.txt Wed Jan 14 13:21:48 2009 (r154) @@ -219,6 +219,6 @@ SET( wv_tests 105 ) FOREACH( TESTDIR airsync ddf drmrel emn ota prov si sl syncml wv ) FOREACH( ITEM RANGE 1 ${${TESTDIR}_tests} ) - ADD_TEST( "${TESTDIR}_${ITEM}" launchTests.sh "${CMAKE_SOURCE_DIR}/tests" "${TESTCASE}" $ITEM ) + ADD_TEST( "${TESTDIR}_${ITEM}" launchTests.sh "${CMAKE_SOURCE_DIR}/tests" "${TESTDIR}" ${ITEM} ) ENDFOREACH( ITEM RANGE 1 ${${TESTDIR}_tests} ) ENDFOREACH( TESTDIR airsync ddf drmrel emn ota prov si sl syncml wv ) |
From: <dg...@su...> - 2009-01-14 12:53:52
|
Author: bellmich Date: Wed Jan 14 13:21:10 2009 New Revision: 153 URL: http://libwbxml.opensync.org/changeset/153 Log: RESULT is used to detect errors. Don't use it for other things. Modified: wbxmlTestSuite/trunk/launchTests.sh Modified: wbxmlTestSuite/trunk/launchTests.sh ============================================================================== --- wbxmlTestSuite/trunk/launchTests.sh Wed Jan 14 11:10:58 2009 (r152) +++ wbxmlTestSuite/trunk/launchTests.sh Wed Jan 14 13:21:10 2009 (r153) @@ -92,10 +92,10 @@ COUNTER=$(($COUNTER + 1)) if [ "$COUNTER" -eq "$3" ] then - RESULT=$ITEM + TESTCASE=$ITEM fi done - TESTLIST=$RESULT + TESTLIST=$TESTCASE fi # For each directory |
From: <dg...@su...> - 2009-01-14 11:19:10
|
Author: Graham Cobb Date: Wed Jan 14 12:18:16 2009 New Revision: 5140 URL: http://www.opensync.org/changeset/5140 Log: gpe-sync: Fix change type handling Modified: plugins/gpe/ChangeLog plugins/gpe/src/utils.c Modified: plugins/gpe/ChangeLog ============================================================================== --- plugins/gpe/ChangeLog Wed Jan 14 11:00:59 2009 (r5139) +++ plugins/gpe/ChangeLog Wed Jan 14 12:18:16 2009 (r5140) @@ -1,3 +1,8 @@ +2009-01-14 Graham Cobb <g+...@co...> + + * src/utils.c (report_change): Fix setting objtype of data in change. + Fix setting change type. + 2009-01-13 Graham Cobb <g+...@co...> * src/contacts.c (gpe_contacts_commit_change, gpe_contacts_get_changes): Modified: plugins/gpe/src/utils.c ============================================================================== --- plugins/gpe/src/utils.c Wed Jan 14 11:00:59 2009 (r5139) +++ plugins/gpe/src/utils.c Wed Jan 14 12:18:16 2009 (r5140) @@ -89,6 +89,7 @@ osync_error_unref(&error); return FALSE; } + osync_data_set_objtype (data, type); OSyncChange *change = osync_change_new (&error); if (!change) { @@ -105,16 +106,16 @@ sprintf (buf, "gpe-%s-%s", type, uid); osync_change_set_uid (change, buf); - osync_change_set_objtype (change, type); osync_change_set_hash (change, hash); osync_change_set_data (change, data); OSyncChangeType changetype = osync_hashtable_get_changetype(sinkenv->hashtable, change); + osync_change_set_changetype(change, changetype); + osync_hashtable_update_change (sinkenv->hashtable, change); + if (changetype != OSYNC_CHANGE_TYPE_UNMODIFIED) { - osync_change_set_changetype(change, changetype); osync_context_report_change (ctx, change); } - osync_hashtable_update_change (sinkenv->hashtable, change); osync_change_unref(change); |
From: <dg...@su...> - 2009-01-14 10:11:43
|
Author: bellmich Date: Wed Jan 14 11:10:58 2009 New Revision: 152 URL: http://libwbxml.opensync.org/changeset/152 Log: minor release management related fixes Modified: wbxml2/trunk/ChangeLog wbxml2/trunk/RELEASE Modified: wbxml2/trunk/ChangeLog ============================================================================== --- wbxml2/trunk/ChangeLog Wed Jan 14 11:10:24 2009 (r151) +++ wbxml2/trunk/ChangeLog Wed Jan 14 11:10:58 2009 (r152) @@ -1,4 +1,5 @@ 2009-01-06 Michael Bell <mic...@we...> + * Released 0.10.1 * Removed a useless buffer which only creates a memory leak. * The installation of the documentation can be disabled. * LIBDATA_INSTALL_DIR was introduced (used by pkgconfig). @@ -7,6 +8,7 @@ * The timezone of the nightly build-time was fixed. 2008-12-05 Michael Bell <mic...@we...> + * Released 0.10.0 * Fixed ticket #14 with patch from ticket (hexadecimal integer support for Wireless-Village) * Added datetime encoding support for Wireless-Village. Modified: wbxml2/trunk/RELEASE ============================================================================== --- wbxml2/trunk/RELEASE Wed Jan 14 11:10:24 2009 (r151) +++ wbxml2/trunk/RELEASE Wed Jan 14 11:10:58 2009 (r152) @@ -56,3 +56,4 @@ Tips: * make diff of the exported symbols "nm -g -P libwbxml.so" * read svn log + * check trac tickets which are attached to the according milestone |
From: <dg...@su...> - 2009-01-14 10:11:14
|
Author: bellmich Date: Wed Jan 14 11:10:24 2009 New Revision: 151 URL: http://libwbxml.opensync.org/changeset/151 Log: activated DDF tests Modified: wbxml2/trunk/CMakeLists.txt Modified: wbxml2/trunk/CMakeLists.txt ============================================================================== --- wbxml2/trunk/CMakeLists.txt Wed Jan 14 10:55:32 2009 (r150) +++ wbxml2/trunk/CMakeLists.txt Wed Jan 14 11:10:24 2009 (r151) @@ -208,6 +208,7 @@ ENABLE_TESTING() CONFIGURE_FILE( "tests/launchTests.sh" "${CMAKE_CURRENT_BINARY_DIR}/launchTests.sh") SET( airsync_tests 1 ) +SET( ddf_tests 5 ) SET( drmrel_tests 3 ) SET( emn_tests 17 ) SET( ota_tests 3 ) @@ -216,8 +217,8 @@ SET( sl_tests 13 ) SET( syncml_tests 14 ) SET( wv_tests 105 ) -FOREACH( TESTDIR airsync drmrel emn ota prov si sl syncml wv ) +FOREACH( TESTDIR airsync ddf drmrel emn ota prov si sl syncml wv ) FOREACH( ITEM RANGE 1 ${${TESTDIR}_tests} ) ADD_TEST( "${TESTDIR}_${ITEM}" launchTests.sh "${CMAKE_SOURCE_DIR}/tests" "${TESTCASE}" $ITEM ) ENDFOREACH( ITEM RANGE 1 ${${TESTDIR}_tests} ) -ENDFOREACH( TESTDIR airsync drmrel emn ota prov si sl syncml wv ) +ENDFOREACH( TESTDIR airsync ddf drmrel emn ota prov si sl syncml wv ) |
From: <dg...@su...> - 2009-01-14 10:01:52
|
Author: friedrich.beckmann Date: Wed Jan 14 11:00:59 2009 New Revision: 5139 URL: http://www.opensync.org/changeset/5139 Log: Corrected Indentation Modified: trunk/tests/mock-plugin/mock_sync.c Modified: trunk/tests/mock-plugin/mock_sync.c ============================================================================== --- trunk/tests/mock-plugin/mock_sync.c Wed Jan 14 09:52:20 2009 (r5138) +++ trunk/tests/mock-plugin/mock_sync.c Wed Jan 14 11:00:59 2009 (r5139) @@ -391,7 +391,7 @@ } if (mock_get_error(info->memberid, "GET_CHANGES_TIMEOUT2")) - g_usleep(8*G_USEC_PER_SEC); + g_usleep(8*G_USEC_PER_SEC); if (osync_objtype_sink_get_slowsync(sink)) { osync_trace(TRACE_INTERNAL, "Slow sync requested"); |
From: <dg...@su...> - 2009-01-14 09:56:27
|
Author: bellmich Date: Wed Jan 14 10:55:32 2009 New Revision: 150 URL: http://libwbxml.opensync.org/changeset/150 Log: The original OMA files are not valid XML. Modified: wbxmlTestSuite/trunk/ddf/dm_devdetail-v1_2.ddf wbxmlTestSuite/trunk/ddf/dm_dmacc-v1_2.ddf wbxmlTestSuite/trunk/ddf/mo_oma_imps-V1_3.ddf Modified: wbxmlTestSuite/trunk/ddf/dm_devdetail-v1_2.ddf ============================================================================== --- wbxmlTestSuite/trunk/ddf/dm_devdetail-v1_2.ddf Wed Jan 14 10:37:07 2009 (r149) +++ wbxmlTestSuite/trunk/ddf/dm_devdetail-v1_2.ddf Wed Jan 14 10:55:32 2009 (r150) @@ -325,7 +325,7 @@ <AccessType> <Get/> </AccessType> - <!--Here the manufacturer must fill in whether the device supports large object handling Typically, this is a property of the SyncML management agent.-- > + <!--Here the manufacturer must fill in whether the device supports large object handling Typically, this is a property of the SyncML management agent.--> <DefaultValue/> <Description>Large object handling supported if value is true.</Description> <DFFormat> Modified: wbxmlTestSuite/trunk/ddf/dm_dmacc-v1_2.ddf ============================================================================== --- wbxmlTestSuite/trunk/ddf/dm_dmacc-v1_2.ddf Wed Jan 14 10:37:07 2009 (r149) +++ wbxmlTestSuite/trunk/ddf/dm_dmacc-v1_2.ddf Wed Jan 14 10:55:32 2009 (r150) @@ -195,7 +195,7 @@ <Occurrence> <OneOrMore/> </Occurrence> - <DFTitle>The amenode for one or more connectivity parameters</DFTitle> + <DFTitle>The "name" node for one or more connectivity parameters</DFTitle> </DFProperties> <Node> <NodeName>ConRef</NodeName> @@ -243,7 +243,7 @@ <Occurrence> <OneOrMore/> </Occurrence> - <DFTitle>The amenode for multiple AppAddr objects</DFTitle> + <DFTitle>The "name" node for multiple AppAddr objects</DFTitle> </DFProperties> <Node> <NodeName>Addr</NodeName> @@ -307,7 +307,7 @@ <Occurrence> <OneOrMore/> </Occurrence> - <DFTitle>The amenode for a Port object</DFTitle> + <DFTitle>The "name" node for a Port object</DFTitle> </DFProperties> <Node> <NodeName>PortNbr</NodeName> @@ -375,7 +375,7 @@ <Occurrence> <OneOrMore/> </Occurrence> - <DFTitle>The amenode for multiple Application Authentication objects</DFTitle> + <DFTitle>The "name" node for multiple Application Authentication objects</DFTitle> </DFProperties> <Node> <NodeName>AAuthLevel</NodeName> Modified: wbxmlTestSuite/trunk/ddf/mo_oma_imps-V1_3.ddf ============================================================================== --- wbxmlTestSuite/trunk/ddf/mo_oma_imps-V1_3.ddf Wed Jan 14 10:37:07 2009 (r149) +++ wbxmlTestSuite/trunk/ddf/mo_oma_imps-V1_3.ddf Wed Jan 14 10:55:32 2009 (r150) @@ -641,6 +641,4 @@ </Node> </Node> </Node> - - - +</MgmtTree> |
From: <dg...@su...> - 2009-01-14 09:37:56
|
Author: bellmich Date: Wed Jan 14 10:37:07 2009 New Revision: 149 URL: http://libwbxml.opensync.org/changeset/149 Log: added OMA DM DDF test documents Added: wbxmlTestSuite/trunk/ddf/ wbxmlTestSuite/trunk/ddf/dm_devdetail-v1_2.ddf wbxmlTestSuite/trunk/ddf/dm_devinfo-v1_2.ddf wbxmlTestSuite/trunk/ddf/dm_dmacc-v1_2.ddf wbxmlTestSuite/trunk/ddf/ds_mo-v1_0.ddf wbxmlTestSuite/trunk/ddf/mo_oma_imps-V1_3.ddf Modified: wbxmlTestSuite/trunk/launchTests.sh Added: wbxmlTestSuite/trunk/ddf/dm_devdetail-v1_2.ddf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ wbxmlTestSuite/trunk/ddf/dm_devdetail-v1_2.ddf Wed Jan 14 10:37:07 2009 (r149) @@ -0,0 +1,347 @@ +<?xml version="1.0" encoding="UTF-8"?> + + +<!-- +OMA DM DevDetail V1.2 DDF. +Copyright Open Mobile Alliance Ltd., 2005-2007. All rights reserved +This DDF contains a description of the DM detail information management object (DevDetail), +according to the OMA DM Description Framework. +--> + +<!DOCTYPE MgmtTree PUBLIC "-//OMA//DTD-DM-DDF 1.2//EN" + "http://www.openmobilealliance.org/tech/DTD/DM_DDF-V1_2.dtd" + [<?oma-dm-ddf-ver supported-versions="1.2"?>]> + +<!-- FILE INFORMATION +OMA Permanent Document + File: OMA-SUP-MO_dm_devdetail-V1_2-20070209-A + Type: Text +Public Reachable Information + Path: http://www.openmobilealliance.org/tech/omna/dm_mo + Name: dm_devdetail-v1_2.ddf + +NORMATIVE INFORMATION +This DDF contains a description of the DM detail information management object +(DevDetail), according to the OMA DM Description Framework. +Information about this Management Object is available in the Specification +OMA-TS-DM_DevDetail_MO-V1_2 + +Send comments to tec...@ma... + +LEGAL DISCLAIMER + +Use of this document is subject to all of the terms and conditions +of the Use Agreement located at + http://www.openmobilealliance.org/UseAgreement.html + +You may use this document or any part of the document for internal +or educational purposes only, provided you do not modify, edit or +take out of context the information in this document in any manner. +Information contained in this document may be used, at your sole +risk, for any purposes. + +You may not use this document in any other manner without the prior +written permission of the Open Mobile Alliance. The Open Mobile +Alliance authorizes you to copy this document, provided that you +retain all copyright and other proprietary notices contained in the +original materials on any copies of the materials and that you +comply strictly with these terms. This copyright permission does +not constitute an endorsement of the products or services. The +Open Mobile Alliance assumes no responsibility for errors or +omissions in this document. + +Each Open Mobile Alliance member has agreed to use reasonable +endeavors to inform the Open Mobile Alliance in a timely manner of +Essential IPR as it becomes aware that the Essential IPR is related +to the prepared or published specification. However, the members +do not have an obligation to conduct IPR searches. The declared +Essential IPR is publicly available to members and non-members of +the Open Mobile Alliance and may be found on the 'OMA IPR +Declarations' list at http://www.openmobilealliance.org/ipr.html. +The Open Mobile Alliance has not conducted an independent IPR review +of this document and the information contained herein, and makes no +representations or warranties regarding third party IPR, including +without limitation patents, copyrights or trade secret rights. This +document may contain inventions for which you must obtain licenses +from third parties before making, using or selling the inventions. +Defined terms above are set forth in the schedule to the Open Mobile +Alliance Application Form. + +NO REPRESENTATIONS OR WARRANTIES (WHETHER EXPRESS OR IMPLIED) ARE +MADE BY THE OPEN MOBILE ALLIANCE OR ANY OPEN MOBILE ALLIANCE MEMBER +OR ITS AFFILIATES REGARDING ANY OF THE IPR'S REPRESENTED ON THE 'OMA +IPR DECLARATIONS' LIST, INCLUDING, BUT NOT LIMITED TO THE ACCURACY, +COMPLETENESS, VALIDITY OR RELEVANCE OF THE INFORMATION OR WHETHER OR +NOT SUCH RIGHTS ARE ESSENTIAL OR NON-ESSENTIAL. + +THE OPEN MOBILE ALLIANCE IS NOT LIABLE FOR AND HEREBY DISCLAIMS ANY +DIRECT, INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR +EXEMPLARY DAMAGES ARISING OUT OF OR IN CONNECTION WITH THE USE OF +DOCUMENTS AND THE INFORMATION CONTAINED IN THE DOCUMENTS. + +(c) 2007 Open Mobile Alliance Ltd. All Rights Reserved. +Used with the permission of the Open Mobile Alliance Ltd. under the +terms set forth above. +--> + +<MgmtTree> + <VerDTD>1.2</VerDTD> + <Node> + <NodeName>DevDetail</NodeName> + <!--The '.' shows that this node is located immediately under the root.--> + <Path>.</Path> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Scope> + <Permanent/> + </Scope> + <DFTitle>The interior node holding all devinfo nodes</DFTitle> + <DFType> + <DDFName></DDFName> + </DFType> + </DFProperties> + <Node> + <NodeName>Ext</NodeName> + <!--There are no further items here at the moment.--> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Scope> + <Permanent/> + </Scope> + <DFTitle>The extendable DevInfo branch.</DFTitle> + <DFType> + <DDFName></DDFName> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>Bearer</NodeName> + <!--There are no further items here at the moment.--> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Scope> + <Permanent/> + </Scope> + <DFTitle>The bearer specific DevInfo branch.</DFTitle> + <DFType> + <DDFName></DDFName> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>URI</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Scope> + <Permanent/> + </Scope> + <DFTitle>The tree limitations branch.</DFTitle> + <DFType> + <DDFName></DDFName> + </DFType> + </DFProperties> + <Node> + <NodeName>MaxDepth</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <Description>Maximum tree depth supported by the device.</Description> + <DFFormat> + <chr/> + </DFFormat> + <Scope> + <Permanent/> + </Scope> + <DFTitle>Maximum tree depth</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>MaxTotLen</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <Description>Maximum total URI length supported by the device.</Description> + <DFFormat> + <chr/> + </DFFormat> + <Scope> + <Permanent/> + </Scope> + <DFTitle>Maximum URI length</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>MaxSegLen</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <Description>Maximum URI segment length supported by the device.</Description> + <DFFormat> + <chr/> + </DFFormat> + <Scope> + <Permanent/> + </Scope> + <DFTitle>Maximum URI segment length</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + </Node> + <Node> + <NodeName>DevTyp</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <!--Here the manufacturer must fill in the type of the device.--> + <DefaultValue>MobilePhone</DefaultValue> + <Description>The type of the device.</Description> + <DFFormat> + <chr/> + </DFFormat> + <Scope> + <Permanent/> + </Scope> + <DFTitle>The device type.</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>OEM</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <Description>Name of OEM</Description> + <DFFormat> + <chr/> + </DFFormat> + <Scope> + <Permanent/> + </Scope> + <DFTitle>The OEM for the device.</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>FwV</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <!--Here the manufacturer must fill in the firmware revision of the device.--> + <Description>The firmware revision of the device.</Description> + <DFFormat> + <chr/> + </DFFormat> + <Scope> + <Permanent/> + </Scope> + <DFTitle>The current firmware revision of the device.</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>SwV</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <!--Here the manufacturer must fill in the software revision of the device.--> + <Description>The software revision of the device.</Description> + <DFFormat> + <chr/> + </DFFormat> + <Scope> + <Permanent/> + </Scope> + <DFTitle>The current software revision of the device.</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>HwV</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <!--Here the manufacturer must fill in the hardware revision of the device.--> + <DefaultValue/> + <Description>The hardware revision of the device.</Description> + <DFFormat> + <chr/> + </DFFormat> + <Scope> + <Permanent/> + </Scope> + <DFTitle>The current hardware revision of the device.</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>LrgObj</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <!--Here the manufacturer must fill in whether the device supports large object handling Typically, this is a property of the SyncML management agent.-- > + <DefaultValue/> + <Description>Large object handling supported if value is true.</Description> + <DFFormat> + <bool/> + </DFFormat> + <Scope> + <Permanent/> + </Scope> + <DFTitle>Large object handling flag.</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + </Node> +</MgmtTree> + + + Added: wbxmlTestSuite/trunk/ddf/dm_devinfo-v1_2.ddf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ wbxmlTestSuite/trunk/ddf/dm_devinfo-v1_2.ddf Wed Jan 14 10:37:07 2009 (r149) @@ -0,0 +1,248 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +OMA DM DevInfo V1.2 DDF. +Copyright Open Mobile Alliance Ltd., 2005-2007. All rights reserved +This DDF contains a description of the DM information management object (DevInfo), according to the OMA DM Description Framework. +--> + +<!DOCTYPE MgmtTree PUBLIC "-//OMA//DTD-DM-DDF 1.2//EN" + "http://www.openmobilealliance.org/tech/DTD/DM_DDF-V1_2.dtd" + [<?oma-dm-ddf-ver supported-versions="1.2"?>]> + +<!-- +FILE INFORMATION +OMA Permanent Document + File: OMA-SUP-MO_dm_devinfo-V1_2-20070209-A + Type: Text +Public Reachable Information + Path: http://www.openmobilealliance.org/tech/omna/dm_mo + Name: dm_devinfo-v1_2.ddf +NORMATIVE INFORMATION +This DDF contains a description of the DM information management object (DevInfo), according to the OMA DM Description Framework. +Information about this Management Object is available in the Specification + OMA-TS-DM_StdObj-V1_2-20070209-A +Send comments to tec...@ma... + +LEGAL DISCLAIMER + +Use of this document is subject to all of the terms and conditions +of the Use Agreement located at + http://www.openmobilealliance.org/UseAgreement.html + +You may use this document or any part of the document for internal +or educational purposes only, provided you do not modify, edit or +take out of context the information in this document in any manner. +Information contained in this document may be used, at your sole +risk, for any purposes. + +You may not use this document in any other manner without the prior +written permission of the Open Mobile Alliance. The Open Mobile +Alliance authorizes you to copy this document, provided that you +retain all copyright and other proprietary notices contained in the +original materials on any copies of the materials and that you +comply strictly with these terms. This copyright permission does +not constitute an endorsement of the products or services. The +Open Mobile Alliance assumes no responsibility for errors or +omissions in this document. + +Each Open Mobile Alliance member has agreed to use reasonable +endeavors to inform the Open Mobile Alliance in a timely manner of +Essential IPR as it becomes aware that the Essential IPR is related +to the prepared or published specification. However, the members +do not have an obligation to conduct IPR searches. The declared +Essential IPR is publicly available to members and non-members of +the Open Mobile Alliance and may be found on the 'OMA IPR +Declarations' list at http://www.openmobilealliance.org/ipr.html. +The Open Mobile Alliance has not conducted an independent IPR review +of this document and the information contained herein, and makes no +representations or warranties regarding third party IPR, including +without limitation patents, copyrights or trade secret rights. This +document may contain inventions for which you must obtain licenses +from third parties before making, using or selling the inventions. +Defined terms above are set forth in the schedule to the Open Mobile +Alliance Application Form. + +NO REPRESENTATIONS OR WARRANTIES (WHETHER EXPRESS OR IMPLIED) ARE +MADE BY THE OPEN MOBILE ALLIANCE OR ANY OPEN MOBILE ALLIANCE MEMBER +OR ITS AFFILIATES REGARDING ANY OF THE IPR'S REPRESENTED ON THE 'OMA +IPR DECLARATIONS' LIST, INCLUDING, BUT NOT LIMITED TO THE ACCURACY, +COMPLETENESS, VALIDITY OR RELEVANCE OF THE INFORMATION OR WHETHER OR +NOT SUCH RIGHTS ARE ESSENTIAL OR NON-ESSENTIAL. + +THE OPEN MOBILE ALLIANCE IS NOT LIABLE FOR AND HEREBY DISCLAIMS ANY +DIRECT, INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR +EXEMPLARY DAMAGES ARISING OUT OF OR IN CONNECTION WITH THE USE OF +DOCUMENTS AND THE INFORMATION CONTAINED IN THE DOCUMENTS. + +(c) 2007 Open Mobile Alliance Ltd. All Rights Reserved. +Used with the permission of the Open Mobile Alliance Ltd. under the +terms set forth above. +--> + +<MgmtTree> + <VerDTD>1.2</VerDTD> + <Node> + <NodeName>DevInfo</NodeName> + <!--The '.' shows that this node is located immediately under the root.--> + <Path>.</Path> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Scope> + <Permanent/> + </Scope> + <DFTitle>The interior node holding all devinfo objects</DFTitle> + <DFType> + <DDFName></DDFName> + </DFType> + </DFProperties> + <Node> + <NodeName>Ext</NodeName> + <!--There are no further items here at the moment.--> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Scope> + <Permanent/> + </Scope> + <DFTitle>The extendable DevInfo branch.</DFTitle> + <DFType> + <DDFName></DDFName> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>Bearer</NodeName> + <!--There are no further items here at the moment.--> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Scope> + <Permanent/> + </Scope> + <DFTitle>The bearer specific DevInfo branch.</DFTitle> + <DFType> + <DDFName></DDFName> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>DevId</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <!--Here the manufacturer must fill in the device ID (serial number) of the device.--> + <DefaultValue/> + <Description>A unique device identifier.</Description> + <DFFormat> + <chr/> + </DFFormat> + <Scope> + <Permanent/> + </Scope> + <DFTitle>The unique device identifier.</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>Man</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <!--Here the manufacturer must fill in their name. --> + <DefaultValue/> + <Description>The name of the device manufacturer </Description> + <DFFormat> + <chr/> + </DFFormat> + <Scope> + <Permanent/> + </Scope> + <DFTitle>The name of the device manufacturer.</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>Mod</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <!--Here the manufacturer must fill in the model name of the device.--> + <DefaultValue/> + <Description>The name of the device model</Description> + <DFFormat> + <chr/> + </DFFormat> + <Scope> + <Permanent/> + </Scope> + <DFTitle>Model name</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>DmV</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <!--Here the manufacturer must fill in the management client revision of the device.--> + <DefaultValue/> + <Description>The management client revision of the device.</Description> + <DFFormat> + <chr/> + </DFFormat> + <Scope> + <Permanent/> + </Scope> + <DFTitle>The current management client revision of the device.</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>Lang</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DefaultValue/> + <Description>The current language setting of the device.</Description> + <DFFormat> + <chr/> + </DFFormat> + <Scope> + <Permanent/> + </Scope> + <DFTitle>Current language.</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + </Node> +</MgmtTree> + + Added: wbxmlTestSuite/trunk/ddf/dm_dmacc-v1_2.ddf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ wbxmlTestSuite/trunk/ddf/dm_dmacc-v1_2.ddf Wed Jan 14 10:37:07 2009 (r149) @@ -0,0 +1,489 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +OMA DM DMAcc V1.2 DDF. +Copyright Open Mobile Alliance Ltd., 2005-2007. All rights reserved +This DDF contains a description of the DM Account management object (DMAcc), +according to the OMA DM Description Framework. +--> + +<!DOCTYPE MgmtTree PUBLIC "-//OMA//DTD-DM-DDF 1.2//EN" + "http://www.openmobilealliance.org/tech/DTD/DM_DDF-V1_2.dtd" + [<?oma-dm-ddf-ver supported-versions="1.2"?>]> + +<!-- FILE INFORMATION +OMA Permanent Document + File: OMA-SUP-MO_dm_dmacc-V1_2-20070209-A + Type: Text +Public Reachable Information + Path: http://www.openmobilealliance.org/tech/omna/dm_mo + Name: dm_dmacc-v1_2.ddf +NORMATIVE INFORMATION +This DDF contains a description of the DM account management object (DMAcc), +according to the OMA DM Description Framework. +Information about this Management Object is available in the Specification +OMA-TS-DM_DMAcc_MO-V1_2 +Send comments to tec...@ma... + +LEGAL DISCLAIMER + +Use of this document is subject to all of the terms and conditions +of the Use Agreement located at + http://www.openmobilealliance.org/UseAgreement.html + +You may use this document or any part of the document for internal +or educational purposes only, provided you do not modify, edit or +take out of context the information in this document in any manner. +Information contained in this document may be used, at your sole +risk, for any purposes. + +You may not use this document in any other manner without the prior +written permission of the Open Mobile Alliance. The Open Mobile +Alliance authorizes you to copy this document, provided that you +retain all copyright and other proprietary notices contained in the +original materials on any copies of the materials and that you +comply strictly with these terms. This copyright permission does +not constitute an endorsement of the products or services. The +Open Mobile Alliance assumes no responsibility for errors or +omissions in this document. + +Each Open Mobile Alliance member has agreed to use reasonable +endeavors to inform the Open Mobile Alliance in a timely manner of +Essential IPR as it becomes aware that the Essential IPR is related +to the prepared or published specification. However, the members +do not have an obligation to conduct IPR searches. The declared +Essential IPR is publicly available to members and non-members of +the Open Mobile Alliance and may be found on the 'OMA IPR +Declarations' list at http://www.openmobilealliance.org/ipr.html. +The Open Mobile Alliance has not conducted an independent IPR review +of this document and the information contained herein, and makes no +representations or warranties regarding third party IPR, including +without limitation patents, copyrights or trade secret rights. This +document may contain inventions for which you must obtain licenses +from third parties before making, using or selling the inventions. +Defined terms above are set forth in the schedule to the Open Mobile +Alliance Application Form. + +NO REPRESENTATIONS OR WARRANTIES (WHETHER EXPRESS OR IMPLIED) ARE +MADE BY THE OPEN MOBILE ALLIANCE OR ANY OPEN MOBILE ALLIANCE MEMBER +OR ITS AFFILIATES REGARDING ANY OF THE IPR'S REPRESENTED ON THE 'OMA +IPR DECLARATIONS' LIST, INCLUDING, BUT NOT LIMITED TO THE ACCURACY, +COMPLETENESS, VALIDITY OR RELEVANCE OF THE INFORMATION OR WHETHER OR +NOT SUCH RIGHTS ARE ESSENTIAL OR NON-ESSENTIAL. + +THE OPEN MOBILE ALLIANCE IS NOT LIABLE FOR AND HEREBY DISCLAIMS ANY +DIRECT, INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR +EXEMPLARY DAMAGES ARISING OUT OF OR IN CONNECTION WITH THE USE OF +DOCUMENTS AND THE INFORMATION CONTAINED IN THE DOCUMENTS. + +(c) 2007 Open Mobile Alliance Ltd. All Rights Reserved. +Used with the permission of the Open Mobile Alliance Ltd. under the +terms set forth above. +--> + + +<MgmtTree> + <VerDTD>1.2</VerDTD> + <Man>--The device manufacturer--</Man> + <Mod>--The device model--</Mod> + <Node> + <NodeName/> + <DFProperties> + <AccessType/> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <OneOrMore/> + </Occurrence> + <DFTitle>--The Interior node--</DFTitle> + </DFProperties> + <Node> + <NodeName>AppID</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <One/> + </Occurrence> + <DFTitle>Application ID for DM Account MO</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>ServerID</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <One/> + </Occurrence> + <DFTitle>Server Identifier</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>Name</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <DFTitle>Displayable name for the Management Server</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>PrefConRef</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <DFTitle>Reference to preferred connectivity</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>ToConRef</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <DFTitle>A collection of references to connectivity definitions</DFTitle> + </DFProperties> + <Node> + <NodeName/> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <OneOrMore/> + </Occurrence> + <DFTitle>The amenode for one or more connectivity parameters</DFTitle> + </DFProperties> + <Node> + <NodeName>ConRef</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <One/> + </Occurrence> + <DFTitle>Linkage to connectivity parameters</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + </Node> + </Node> + <Node> + <NodeName>AppAddr</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <One/> + </Occurrence> + <DFTitle>A collection of all references to AppAddr objects</DFTitle> + </DFProperties> + <Node> + <NodeName/> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <OneOrMore/> + </Occurrence> + <DFTitle>The amenode for multiple AppAddr objects</DFTitle> + </DFProperties> + <Node> + <NodeName>Addr</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <One/> + </Occurrence> + <DFTitle>Management Server Address</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>AddrType</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <One/> + </Occurrence> + <DFTitle>Management Server Address Type</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>Port</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <DFTitle>A collection of all Port objects</DFTitle> + </DFProperties> + <Node> + <NodeName/> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <OneOrMore/> + </Occurrence> + <DFTitle>The amenode for a Port object</DFTitle> + </DFProperties> + <Node> + <NodeName>PortNbr</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <One/> + </Occurrence> + <DFTitle>Port</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + </Node> + </Node> + </Node> + </Node> + <Node> + <NodeName>AAuthPref</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <DFTitle>Application Authentication Type preference</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>AppAuth</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <DFTitle>A collection of all references to multiple Application Authentication objects</DFTitle> + </DFProperties> + <Node> + <NodeName/> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <OneOrMore/> + </Occurrence> + <DFTitle>The amenode for multiple Application Authentication objects</DFTitle> + </DFProperties> + <Node> + <NodeName>AAuthLevel</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <One/> + </Occurrence> + <DFTitle>Application Authentication level</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>AAuthType</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <One/> + </Occurrence> + <DFTitle>Application Authentication Type</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>AAuthName</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <DFTitle>Application Authentication Name</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>AAuthSecret</NodeName> + <DFProperties> + <AccessType> + <!-- no GET--> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <DFTitle>Application Authentication Secret</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>AAuthData</NodeName> + <DFProperties> + <AccessType> + <!-- no GET--> + </AccessType> + <DFFormat> + <bin/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <DFTitle>Application Authentication Data</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + </Node> + </Node> + <Node> + <NodeName>Ext</NodeName> + <DFProperties> + <AccessType> + <!-- None defined --> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <DFTitle>Vendor specific information</DFTitle> + </DFProperties> + </Node> + </Node> +</MgmtTree> + Added: wbxmlTestSuite/trunk/ddf/ds_mo-v1_0.ddf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ wbxmlTestSuite/trunk/ddf/ds_mo-v1_0.ddf Wed Jan 14 10:37:07 2009 (r149) @@ -0,0 +1,698 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +OMA DS MO V1.0 DDF. +Copyright Open Mobile Alliance Ltd., 2005-2007. All rights reserved +This DDF contains a description of the Data Synchronization management object (DS MO), +according to the OMA DM Description Framework. +--> + +<!DOCTYPE MgmtTree PUBLIC "-//OMA//DTD-DM-DDF 1.2//EN" + "http://www.openmobilealliance.org/tech/DTD/DM_DDF-V1_0.dtd" + [<?oma-dm-ddf-ver supported-versions="1.0"?>]> +<!-- +FILE INFORMATION +OMA Permanent Document + File: OMA-SUP-MO_DS-V1_0-20070515-D + Type: Text +Public Reachable Information + Path: http://www.openmobilealliance.org/tech/omna/dm_mo + Name: ds_mo-v1_0.ddf + +NORMATIVE INFORMATION +This DDF contains a description of the Data Synchronization management object (DS MO), +according to the OMA DM Description Framework. +Information about this Management Object is available in the Specification +OMA-TS-DS_MO-V1_0 +Send comments to tec...@ma... + +LEGAL DISCLAIMER + +Use of this document is subject to all of the terms and conditions +of the Use Agreement located at + http://www.openmobilealliance.org/UseAgreement.html + +You may use this document or any part of the document for internal +or educational purposes only, provided you do not modify, edit or +take out of context the information in this document in any manner. +Information contained in this document may be used, at your sole +risk, for any purposes. + +You may not use this document in any other manner without the prior +written permission of the Open Mobile Alliance. The Open Mobile +Alliance authorizes you to copy this document, provided that you +retain all copyright and other proprietary notices contained in the +original materials on any copies of the materials and that you +comply strictly with these terms. This copyright permission does +not constitute an endorsement of the products or services. The +Open Mobile Alliance assumes no responsibility for errors or +omissions in this document. + +Each Open Mobile Alliance member has agreed to use reasonable +endeavors to inform the Open Mobile Alliance in a timely manner of +Essential IPR as it becomes aware that the Essential IPR is related +to the prepared or published specification. However, the members +do not have an obligation to conduct IPR searches. The declared +Essential IPR is publicly available to members and non-members of +the Open Mobile Alliance and may be found on the 'OMA IPR +Declarations' list at http://www.openmobilealliance.org/ipr.html. +The Open Mobile Alliance has not conducted an independent IPR review +of this document and the information contained herein, and makes no +representations or warranties regarding third party IPR, including +without limitation patents, copyrights or trade secret rights. This +document may contain inventions for which you must obtain licenses +from third parties before making, using or selling the inventions. +Defined terms above are set forth in the schedule to the Open Mobile +Alliance Application Form. + +NO REPRESENTATIONS OR WARRANTIES (WHETHER EXPRESS OR IMPLIED) ARE +MADE BY THE OPEN MOBILE ALLIANCE OR ANY OPEN MOBILE ALLIANCE MEMBER +OR ITS AFFILIATES REGARDING ANY OF THE IPR'S REPRESENTED ON THE 'OMA +IPR DECLARATIONS' LIST, INCLUDING, BUT NOT LIMITED TO THE ACCURACY, +COMPLETENESS, VALIDITY OR RELEVANCE OF THE INFORMATION OR WHETHER OR +NOT SUCH RIGHTS ARE ESSENTIAL OR NON-ESSENTIAL. + +THE OPEN MOBILE ALLIANCE IS NOT LIABLE FOR AND HEREBY DISCLAIMS ANY +DIRECT, INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR +EXEMPLARY DAMAGES ARISING OUT OF OR IN CONNECTION WITH THE USE OF +DOCUMENTS AND THE INFORMATION CONTAINED IN THE DOCUMENTS. + +(c) 2007 Open Mobile Alliance Ltd. All Rights Reserved. +Used with the permission of the Open Mobile Alliance Ltd. under the +terms set forth above. +--> + +<MgmtTree> + <VerDTD>1.2</VerDTD> + <Man>--The device manufacturer--</Man> + <Mod>--The device model--</Mod> + <Node> + <NodeName/> + <DFProperties> + <AccessType/> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <OneOrMore/> + </Occurrence> + <DFTitle>--The Interior node--</DFTitle> + <DFType> + <DDFName/> + </DFType> + </DFProperties> + <Node> + <NodeName>Version</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <One/> + </Occurrence> + <DFTitle>Version number for DS MO</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>ServerID</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <One/> + </Occurrence> + <DFTitle>DS Server Identifier</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>Name</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <DFTitle>Displayable name for the DS Server</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>PrefConRef</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <DFTitle>Reference to preferred connectivity</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>ToConRef</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <DFTitle>A collection of references to connectivity definitions</DFTitle> + <DFType> + <DDFName/> + </DFType> + </DFProperties> + <Node> + <NodeName/> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <OneOrMore/> + </Occurrence> + <DFTitle>The "name" node for one or more connectivity parameters</DFTitle> + <DFType> + <DDFName/> + </DFType> + </DFProperties> + <Node> + <NodeName>ConRef</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <One/> + </Occurrence> + <DFTitle>Linkage to connectivity parameters</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + </Node> + </Node> + <Node> + <NodeName>AppAddr</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <One/> + </Occurrence> + <DFTitle>A collection of DS Server addresses</DFTitle> + <DFType> + <DDFName/> + </DFType> + </DFProperties> + <Node> + <NodeName/> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <OneOrMore/> + </Occurrence> + <DFTitle>The "name" node for one or more DS Server addresses</DFTitle> + <DFType> + <DDFName/> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>Addr</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <One/> + </Occurrence> + <DFTitle>DS Server Address</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>AddrType</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <One/> + </Occurrence> + <DFTitle>DS Server Address Type</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>Port</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <DFTitle>A collection of all Port objects</DFTitle> + <DFType> + <DDFName/> + </DFType> + </DFProperties> + <Node> + <NodeName/> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <OneOrMore/> + </Occurrence> + <DFTitle>The "name" node for a Port object</DFTitle> + <DFType> + <DDFName/> + </DFType> + </DFProperties> + <Node> + <NodeName>PortNbr</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <One/> + </Occurrence> + <DFTitle>Port</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + </Node> + </Node> + </Node> + <Node> + <NodeName>AuthInfo</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <DFTitle>A collection of all references to multiple Authentication information objects</DFTitle> + <DFType> + <DDFName/> + </DFType> + </DFProperties> + <Node> + <NodeName/> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <OneOrMore/> + </Occurrence> + <DFTitle>The "name" node for multiple Authentication information objects</DFTitle> + <DFType> + <DDFName/> + </DFType> + </DFProperties> + <Node> + <NodeName>AuthLevel</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <One/> + </Occurrence> + <DFTitle>Application Authentication level</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>AuthType</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <One/> + </Occurrence> + <DFTitle>Application Authentication Type</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>AuthName</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <One/> + </Occurrence> + <DFTitle>Application Authentication Name</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>AuthSecret</NodeName> + <DFProperties> + <AccessType> + <!-- no GET--> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <One/> + </Occurrence> + <DFTitle>Application Authentication Secret</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>AuthData</NodeName> + <DFProperties> + <AccessType> + <!-- no GET--> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <DFTitle>Application Authentication Data</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + </Node> + </Node> + <Node> + <NodeName>Resource</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <One/> + </Occurrence> + <DFTitle>A collection of all references to multiple data base settings objects</DFTitle> + <DFType> + <DDFName/> + </DFType> + </DFProperties> + <Node> + <NodeName/> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <OneOrMore/> + </Occurrence> + <DFTitle>The "name" node for multiple data base</DFTitle> + <DFType> + <DDFName/> + </DFType> + </DFProperties> + <Node> + <NodeName>Accept</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <One/> + </Occurrence> + <DFTitle>MIME content types</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>Name</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <DFTitle>Displayable name for the database</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>URI</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <One/> + </Occurrence> + <DFTitle>URI of the database</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>AuthType</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <DFTitle>Database Authentication Type</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>AuthName</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <DFTitle>Database Authentication Name</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>AuthSecret</NodeName> + <DFProperties> + <AccessType> + <!-- no GET--> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <DFTitle>Database Authentication Secret</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>AuthData</NodeName> + <DFProperties> + <AccessType> + <!-- no GET--> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <DFTitle>Database Authentication Data</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>ClientURI</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <DFTitle>Client's database URI</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>SyncType</NodeName> + <DFProperties> + <AccessType> + <Get/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <DFTitle>Sync type to be performed on the database</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + </Node> + </Node> + <Node> + <NodeName>Ext</NodeName> + <DFProperties> + <AccessType> + <!-- None defined --> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <DFTitle>Vendor specific information</DFTitle> + <DFType> + <DDFName/> + </DFType> + </DFProperties> + </Node> + </Node> +</MgmtTree> Added: wbxmlTestSuite/trunk/ddf/mo_oma_imps-V1_3.ddf ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ wbxmlTestSuite/trunk/ddf/mo_oma_imps-V1_3.ddf Wed Jan 14 10:37:07 2009 (r149) @@ -0,0 +1,646 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +OMA IMPS V1.3 DDF. +Copyright Open Mobile Alliance Ltd., 2007. All rights reserved +This DDF contains a description of the IMPS detail information management object, according to the OMA DM Description Framework. +--> + +<!DOCTYPE MgmtTree PUBLIC "-//OMA//DTD-DM-DDF 1.2//EN" + "http://www.openmobilealliance.org/tech/DTD/DM_DDF-V1_2.dtd" + [<?oma-dm-ddf-ver supported-versions="1.2"?>]> + +<!-- +FILE INFORMATION +OMA Permanent Document + File: OMA-SUP-MO_oma_imps-V1_3-20070123-A + Type: Text +Public Reachable Information + Path: http://www.openmobilealliance.org/tech/omna/dm_mo + Name: mo_oma_imps-v1_3.ddf + +NORMATIVE INFORMATION +This DDF contains a description of the IMPS detail information management object, according to the OMA DM Description Framework. + +Information about this Management Object is available in the Specification OMA-TS-IMPS-MO-V1_3 + +Send comments to tec...@ma... + + +LEGAL DISCLAIMER + +Use of this document is subject to all of the terms and conditions +of the Use Agreement located at + http://www.openmobilealliance.org/UseAgreement.html + +You may use this document or any part of the document for internal +or educational purposes only, provided you do not modify, edit or +take out of context the information in this document in any manner. +Information contained in this document may be used, at your sole +risk, for any purposes. + +You may not use this document in any other manner without the prior +written permission of the Open Mobile Alliance. The Open Mobile +Alliance authorizes you to copy this document, provided that you +retain all copyright and other proprietary notices contained in the +original materials on any copies of the materials and that you +comply strictly with these terms. This copyright permission does +not constitute an endorsement of the products or services. The +Open Mobile Alliance assumes no responsibility for errors or +omissions in this document. + +Each Open Mobile Alliance member has agreed to use reasonable +endeavors to inform the Open Mobile Alliance in a timely manner of +Essential IPR as it becomes aware that the Essential IPR is related +to the prepared or published specification. However, the members +do not have an obligation to conduct IPR searches. The declared +Essential IPR is publicly available to members and non-members of +the Open Mobile Alliance and may be found on the 'OMA IPR +Declarations' list at http://www.openmobilealliance.org/ipr.html. +The Open Mobile Alliance has not conducted an independent IPR review +of this document and the information contained herein, and makes no +representations or warranties regarding third party IPR, including +without limitation patents, copyrights or trade secret rights. This +document may contain inventions for which you must obtain licenses +from third parties before making, using or selling the inventions. +Defined terms above are set forth in the schedule to the Open Mobile +Alliance Application Form. + +NO REPRESENTATIONS OR WARRANTIES (WHETHER EXPRESS OR IMPLIED) ARE +MADE BY THE OPEN MOBILE ALLIANCE OR ANY OPEN MOBILE ALLIANCE MEMBER +OR ITS AFFILIATES REGARDING ANY OF THE IPR'S REPRESENTED ON THE 'OMA +IPR DECLARATIONS' LIST, INCLUDING, BUT NOT LIMITED TO THE ACCURACY, +COMPLETENESS, VALIDITY OR RELEVANCE OF THE INFORMATION OR WHETHER OR +NOT SUCH RIGHTS ARE ESSENTIAL OR NON-ESSENTIAL. + +THE OPEN MOBILE ALLIANCE IS NOT LIABLE FOR AND HEREBY DISCLAIMS ANY +DIRECT, INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR +EXEMPLARY DAMAGES ARISING OUT OF OR IN CONNECTION WITH THE USE OF +DOCUMENTS AND THE INFORMATION CONTAINED IN THE DOCUMENTS. + +(c) 2007 Open Mobile Alliance Ltd. All Rights Reserved. +Used with the permission of the Open Mobile Alliance Ltd. under the +terms set forth above. +--> + +<MgmtTree> + <VerDTD>1.1</VerDTD> + <Man>--The manufacturer--</Man> + <Mod>--The device model--</Mod> + <Node> + <NodeName/> + <DFProperties> + <AccessType> + <Add/> + <Delete/> + <Get/> + <Replace/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <ZeroOrMore/> + </Occurrence> + <Scope> + <Dynamic/> + </Scope> + <DFTitle>The "name" node for a IMPS object</DFTitle> + <DFType> + <DDFName/> + </DFType> + </DFProperties> + <Node> + <NodeName>APPID</NodeName> + <DFProperties> + <AccessType> + <Add/> + <Delete/> + <Get/> + <Replace/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <Scope> + <Dynamic/> + </Scope> + <DFTitle>Application ID</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>ProviderID</NodeName> + <DFProperties> + <AccessType> + <Add/> + <Delete/> + <Get/> + <Replace/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <Scope> + <Dynamic/> + </Scope> + <DFTitle>ProviderID</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>Name</NodeName> + <DFProperties> + <AccessType> + <Add/> + <Delete/> + <Get/> + <Replace/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <Scope> + <Dynamic/> + </Scope> + <DFTitle>User displayable name for the node</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>AAccept</NodeName> + <DFProperties> + <AccessType> + <Add/> + <Delete/> + <Get/> + <Replace/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <Scope> + <Dynamic/> + </Scope> + <DFTitle>Accepted Content Types</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>PrefConRef</NodeName> + <DFProperties> + <AccessType> + <Add/> + <Delete/> + <Get/> + <Replace/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <Scope> + <Dynamic/> + </Scope> + <DFTitle>Preferred Connection Reference</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>ToConRef</NodeName> + <!--ToConRef node starts here.--> + <DFProperties> + <AccessType> + <Add/> + <Delete/> + <Get/> + <Replace/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <Scope> + <Dynamic/> + </Scope> + <DFTitle>A collection of To Con Ref objects.</DFTitle> + <DFType> + <DDFName/> + </DFType> + </DFProperties> + <Node> + <NodeName/> + <DFProperties> + <AccessType> + <Add/> + <Delete/> + <Get/> + <Replace/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <ZeroOrMore/> + </Occurrence> + <Scope> + <Dynamic/> + </Scope> + <DFTitle>The "name" node for a Connection Reference Object</DFTitle> + <DFType> + <DDFName/> + </DFType> + </DFProperties> + <Node> + <NodeName>ConRef</NodeName> + <DFProperties> + <AccessType> + <Add/> + <Delete/> + <Get/> + <Replace/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <Scope> + <Dynamic/> + </Scope> + <DFTitle>Connection Reference</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + </Node> + </Node> + <Node> + <NodeName>PrefAddr</NodeName> + <DFProperties> + <AccessType> + <Add/> + <Delete/> + <Get/> + <Replace/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <Scope> + <Dynamic/> + </Scope> + <DFTitle>Preferred Address</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>AppAddr</NodeName> + <!--AppAddr node starts here.--> + <DFProperties> + <AccessType> + <Add/> + <Delete/> + <Get/> + <Replace/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <Scope> + <Dynamic/> + </Scope> + <DFTitle>A collection of all AppAddr objects.</DFTitle> + <DFType> + <DDFName/> + </DFType> + </DFProperties> + <Node> + <NodeName/> + <DFProperties> + <AccessType> + <Add/> + <Delete/> + <Get/> + <Replace/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <OneOrMore/> + </Occurrence> + <Scope> + <Dynamic/> + </Scope> + <DFTitle>The "name" node for a Application Address Object</DFTitle> + <DFType> + <DDFName/> + </DFType> + </DFProperties> + <Node> + <NodeName>Addr</NodeName> + <DFProperties> + <AccessType> + <Add/> + <Delete/> + <Get/> + <Replace/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <Scope> + <Dynamic/> + </Scope> + <DFTitle>Address</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + <Node> + <NodeName>AddrType</NodeName> + <DFProperties> + <AccessType> + <Add/> + <Delete/> + <Get/> + <Replace/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <Scope> + <Dynamic/> + </Scope> + <DFTitle>Address Type</DFTitle> + <DFType> + <MIME>text/plain</MIME> + </DFType> + </DFProperties> + </Node> + </Node> + </Node> + <Node> + <NodeName>AppAuth</NodeName> + <!--AppAuth node starts here.--> + <DFProperties> + <AccessType> + <Add/> + <Delete/> + <Get/> + <Replace/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <Scope> + <Dynamic/> + </Scope> + <DFTitle>A collection of all Application Authentication objects.</DFTitle> + <DFType> + <DDFName/> + </DFType> + </DFProperties> + <Node> + <NodeName/> + <DFProperties> + <AccessType> + <Add/> + <Delete/> + <Get/> + <Replace/> + </AccessType> + <DFFormat> + <node/> + </DFFormat> + <Occurrence> + <ZeroOrMore/> + </Occurrence> + <Scope> + <Dynamic/> + </Scope> + <DFTitle>The "name" node for a Applicaton Authentication Object</DFTitle> + <DFType> + <DDFName/> + </DFType> + </DFProperties> + <Node> + <NodeName>AAuthLevel</NodeName> + <DFProperties> + <AccessType> + <Add/> + <Delete/> + <Get/> + <Replace/> + </AccessType> + <DFFormat> + <chr/> + </DFFormat> + <Occurrence> + <ZeroOrOne/> + </Occurrence> + <Scope> + <Dynamic/> + </Scope> + <DFTitle>Authentication Level</DFTitle> + <DFType> + <MI... [truncated message content] |
From: <dg...@su...> - 2009-01-14 08:53:09
|
Author: friedrich.beckmann Date: Wed Jan 14 09:52:20 2009 New Revision: 5138 URL: http://www.opensync.org/changeset/5138 Log: windows port - Fixed gthread.h header not found on windows platform Modified: branches/3rd-party-cmake-modules/modules/FindGTHREAD2.cmake Modified: branches/3rd-party-cmake-modules/modules/FindGTHREAD2.cmake ============================================================================== --- branches/3rd-party-cmake-modules/modules/FindGTHREAD2.cmake Wed Jan 14 01:47:58 2009 (r5137) +++ branches/3rd-party-cmake-modules/modules/FindGTHREAD2.cmake Wed Jan 14 09:52:20 2009 (r5138) @@ -28,7 +28,7 @@ IF( NOT GTHREAD2_FOUND AND NOT PKG_CONFIG_FOUND ) - FIND_PATH( GTHREAD2_INCLUDE_DIRS gthread.h PATH_SUFFIXES glib-2.0 glib GLib.framework/Headers/glib ) + FIND_PATH( GTHREAD2_INCLUDE_DIRS gthread.h PATH_SUFFIXES glib-2.0/glib GLib.framework/Headers/glib ) IF ( APPLE ) FIND_LIBRARY( GTHREAD2_LIBRARIES glib ) ELSE ( APPLE ) |
From: <dg...@su...> - 2009-01-14 00:48:43
|
Author: henrik Date: Wed Jan 14 01:47:58 2009 New Revision: 5137 URL: http://www.opensync.org/changeset/5137 Log: Update to make sure that we have the right <Preferred> format Modified: plugins/mozilla-sync/trunk/tests/blackbox_test_abook_vcard_compare.sh plugins/mozilla-sync/trunk/tests/blackbox_test_common.shinc.in Modified: plugins/mozilla-sync/trunk/tests/blackbox_test_abook_vcard_compare.sh ============================================================================== --- plugins/mozilla-sync/trunk/tests/blackbox_test_abook_vcard_compare.sh Wed Jan 14 00:48:41 2009 (r5136) +++ plugins/mozilla-sync/trunk/tests/blackbox_test_abook_vcard_compare.sh Wed Jan 14 01:47:58 2009 (r5137) @@ -26,7 +26,7 @@ GROUP_NAME="${SCRIPT_NAME}" copy_dir VCARD_DIR_1 vcard_orig "${VCARD_DIR_BASE}" make_temp_dir VCARD_DIR_2 compare -create_msync_group_file_file "${GROUP_NAME}" "${VCARD_DIR_1}" "${VCARD_DIR_2}" +create_msync_group_file_file "${GROUP_NAME}" "${VCARD_DIR_1}" "${VCARD_DIR_2}" vcard21 msync_sync "${GROUP_NAME}" compare_vcard_dirs "${VCARD_DIR_1}" "${VCARD_DIR_2}" \ "This probably means, that the VCARD format in file-sync has changed" Modified: plugins/mozilla-sync/trunk/tests/blackbox_test_common.shinc.in ============================================================================== --- plugins/mozilla-sync/trunk/tests/blackbox_test_common.shinc.in Wed Jan 14 00:48:41 2009 (r5136) +++ plugins/mozilla-sync/trunk/tests/blackbox_test_common.shinc.in Wed Jan 14 01:47:58 2009 (r5137) @@ -371,10 +371,11 @@ local MEMBER=$2 local VCARD_DIR=$3 local OBJTYPE=$4 + local PREFERRED=$5 myecho "Configuring [file-sync] member for [${STEP}]" -msync --configure "${GROUP_NAME}" "${MEMBER}" <<EOF_2 || \ +msync --configure "${GROUP_NAME}" "${MEMBER}" <<EOF_3 || \ error_exit "Could not configure [file-sync] member for [${STEP}]" 1 <?xml version="1.0"?> <config version="1.0"> @@ -385,6 +386,7 @@ <Format> <Name>file</Name> </Format> + <Preferred>${PREFERRED}</Preferred> </Formats> <Name></Name> <MIME></MIME> @@ -394,7 +396,7 @@ </Resource> </Resources> </config> -EOF_2 +EOF_3 } @@ -404,6 +406,7 @@ local GROUP_NAME=$1 local VCARD_DIR_1=$2 local VCARD_DIR_2=$3 + local PREFERRED=$4 myecho "Creating and configuring group [${GROUP_NAME}]" @@ -414,8 +417,8 @@ msync --addmember "${GROUP_NAME}" "file-sync" || error_exit "Could not add group member [file-sync] to [${GROUP_NAME}] for [${STEP}]" $? - configure_msync_member_file "${GROUP_NAME}" 1 "${VCARD_DIR_1}" contact - configure_msync_member_file "${GROUP_NAME}" 2 "${VCARD_DIR_2}" contact + configure_msync_member_file "${GROUP_NAME}" 1 "${VCARD_DIR_1}" contact "${PREFERRED}" + configure_msync_member_file "${GROUP_NAME}" 2 "${VCARD_DIR_2}" contact "${PREFERRED}" msync --discover "${GROUP_NAME}" || error_exit "Could not discover group [${GROUP_NAME}] for [${STEP}]" 1 @@ -440,7 +443,7 @@ error_exit "Could not add group member [file-sync] to [${GROUP_NAME}] for [${STEP}]" $? configure_msync_member_abook "${GROUP_NAME}" 1 "${ABOOK}" - configure_msync_member_file "${GROUP_NAME}" 2 "${VCARD_DIR}" contact + configure_msync_member_file "${GROUP_NAME}" 2 "${VCARD_DIR}" contact vcard21 msync --discover "${GROUP_NAME}" || error_exit "Could not discover group [${GROUP_NAME}] for [${STEP}]" 1 @@ -465,7 +468,7 @@ error_exit "Could not add group member [file-sync] to [${GROUP_NAME}] for [${STEP}]" $? configure_msync_member_cal "${GROUP_NAME}" 1 "${CAL}" - configure_msync_member_file "${GROUP_NAME}" 2 "${VCARD_DIR}" event + configure_msync_member_file "${GROUP_NAME}" 2 "${VCARD_DIR}" event vevent10 msync --discover "${GROUP_NAME}" || error_exit "Could not discover group [${GROUP_NAME}] for [${STEP}]" 1 |
From: <dg...@su...> - 2009-01-14 00:06:18
|
Author: dgollub Date: Tue Jan 13 23:02:19 2009 New Revision: 5132 URL: http://www.opensync.org/changeset/5132 Log: Link new child nodes insdie OSyncXMLField struct. Fixes #1021 TODO: write regression testcase also for OpenSync not only for xmlformat-plugin Modified: trunk/opensync/xmlformat/opensync_xmlfield.c Modified: trunk/opensync/xmlformat/opensync_xmlfield.c ============================================================================== --- trunk/opensync/xmlformat/opensync_xmlfield.c Tue Jan 13 21:34:50 2009 (r5131) +++ trunk/opensync/xmlformat/opensync_xmlfield.c Tue Jan 13 23:02:19 2009 (r5132) @@ -110,6 +110,7 @@ while (node != NULL) { + /* TODO: error handing - could be NULL */ xmlfield = osync_xmlfield_new_xmlfield(parent, node, error); if (!xmlfield) goto error; @@ -236,6 +237,7 @@ osync_assert(xmlformat); osync_assert(name); + /* TODO: error handing - could be NULL */ node = xmlNewTextChild(xmlDocGetRootElement(xmlformat->doc), NULL, BAD_CAST name, NULL); xmlfield = osync_xmlfield_new_xmlformat(xmlformat, node, error); @@ -408,19 +410,28 @@ break; } } + + /* TODO: error handling - API breaking? */ if(cur == NULL) - xmlNewTextChild(xmlfield->node, NULL, BAD_CAST key, BAD_CAST value); + cur = xmlNewTextChild(xmlfield->node, NULL, BAD_CAST key, BAD_CAST value); + + /* TODO: error handing - could be NULL */ + osync_xmlfield_new_xmlfield(xmlfield, cur, NULL); xmlfield->sorted = FALSE; } void osync_xmlfield_add_key_value(OSyncXMLField *xmlfield, const char *key, const char *value) { + xmlNodePtr cur; + osync_assert(xmlfield); osync_assert(key); osync_assert(value); - xmlNewTextChild(xmlfield->node, NULL, BAD_CAST key, BAD_CAST value); + cur = xmlNewTextChild(xmlfield->node, NULL, BAD_CAST key, BAD_CAST value); + /* TODO: error handing - could be NULL */ + osync_xmlfield_new_xmlfield(xmlfield, cur, NULL); xmlfield->sorted = FALSE; } |
From: <dg...@su...> - 2009-01-13 23:49:34
|
Author: Graham Cobb Date: Wed Jan 14 00:48:41 2009 New Revision: 5136 URL: http://www.opensync.org/changeset/5136 Log: Replace environment save/restore with repeated config and repeated discovery Modified: plugins/gpe/ChangeLog plugins/gpe/src/calendar.c plugins/gpe/src/contacts.c plugins/gpe/src/gpe_sync.c plugins/gpe/src/gpe_sync.h plugins/gpe/src/todo.c Modified: plugins/gpe/ChangeLog ============================================================================== --- plugins/gpe/ChangeLog Tue Jan 13 23:59:59 2009 (r5135) +++ plugins/gpe/ChangeLog Wed Jan 14 00:48:41 2009 (r5136) @@ -1,3 +1,22 @@ +2009-01-13 Graham Cobb <g+...@co...> + + * src/contacts.c (gpe_contacts_commit_change, gpe_contacts_get_changes): + Assert plugin is configured and discovered. + + * src/todo.c (gpe_todo_commit_change, gpe_todo_get_changes): + Assert plugin is configured and discovered. + + * src/calendar.c (gpe_calendar_commit_change, gpe_calendar_get_changes): + Assert plugin is configured and discovered. + + * src/gpe_sync.c (discover): Split discovery into "internal" and full. + Change order of discovery parameters to match API change. + + * src/gpe_sync.h: Add "configured" and "discovered" flags to environment. + Add version numbers to environment. + Add const qualifier to calendar path string. + Create gpe_assert and gpe_assert_error. + 2009-01-12 Graham Cobb <g+...@co...> * README: Rewrite to bring up to date Modified: plugins/gpe/src/calendar.c ============================================================================== --- plugins/gpe/src/calendar.c Tue Jan 13 23:59:59 2009 (r5135) +++ plugins/gpe/src/calendar.c Wed Jan 14 00:48:41 2009 (r5136) @@ -39,6 +39,12 @@ char *error = NULL; char *data_ptr; unsigned int data_size; + + if (!gpe_assert(env->configured && env->discovered)) { + osync_trace(TRACE_ERROR, "GPE plugin not initialised: configured = %d, discovered = %d", env->configured, env->discovered ); + osync_context_report_error (ctx, OSYNC_ERROR_GENERIC, "GPE plugin not initialised: configured = %d, discovered = %d", env->configured, env->discovered); + return; + } switch (osync_change_get_changetype (change)) { case OSYNC_CHANGE_TYPE_DELETED: @@ -115,6 +121,12 @@ gpe_environment *env = (gpe_environment *)userdata; sink_environment *sinkenv = (sink_environment *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); + if (!gpe_assert(env->configured && env->discovered)) { + osync_trace(TRACE_ERROR, "GPE plugin not initialised: configured = %d, discovered = %d", env->configured, env->discovered ); + osync_context_report_error (ctx, OSYNC_ERROR_GENERIC, "GPE plugin not initialised: configured = %d, discovered = %d", env->configured, env->discovered); + return; + } + if (osync_objtype_sink_get_slowsync(sinkenv->sink)) { osync_trace(TRACE_INTERNAL, "Slow sync requested"); if (!osync_hashtable_slowsync(sinkenv->hashtable, &error)) { Modified: plugins/gpe/src/contacts.c ============================================================================== --- plugins/gpe/src/contacts.c Tue Jan 13 23:59:59 2009 (r5135) +++ plugins/gpe/src/contacts.c Wed Jan 14 00:48:41 2009 (r5136) @@ -39,6 +39,12 @@ char *error = NULL; char *data_ptr; unsigned int data_size; + + if (!gpe_assert(env->configured && env->discovered)) { + osync_trace(TRACE_ERROR, "GPE plugin not initialised: configured = %d, discovered = %d", env->configured, env->discovered ); + osync_context_report_error (ctx, OSYNC_ERROR_GENERIC, "GPE plugin not initialised: configured = %d, discovered = %d", env->configured, env->discovered); + return; + } switch (osync_change_get_changetype (change)) { case OSYNC_CHANGE_TYPE_DELETED: @@ -115,6 +121,12 @@ gpe_environment *env = (gpe_environment *)userdata; sink_environment *sinkenv = (sink_environment *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); + if (!gpe_assert(env->configured && env->discovered)) { + osync_trace(TRACE_ERROR, "GPE plugin not initialised: configured = %d, discovered = %d", env->configured, env->discovered ); + osync_context_report_error (ctx, OSYNC_ERROR_GENERIC, "GPE plugin not initialised: configured = %d, discovered = %d", env->configured, env->discovered); + return; + } + if (osync_objtype_sink_get_slowsync(sinkenv->sink)) { osync_trace(TRACE_INTERNAL, "Slow sync requested"); if (!osync_hashtable_slowsync(sinkenv->hashtable, &error)) { Modified: plugins/gpe/src/gpe_sync.c ============================================================================== --- plugins/gpe/src/gpe_sync.c Tue Jan 13 23:59:59 2009 (r5135) +++ plugins/gpe/src/gpe_sync.c Wed Jan 14 00:48:41 2009 (r5136) @@ -21,241 +21,6 @@ #include "gpe_sync.h" -/* Save and restore environment data */ -static void save_environment(gpe_environment *env, OSyncPluginInfo *info) -{ - char buf[20]; - - osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p)", __func__, env, info); - - /* We save the fields in the Anchor DB */ - char *anchorpath = g_strdup_printf("%s/anchor.db", osync_plugin_info_get_configdir(info)); - - /* For sinks we just need to save the objformat name */ - if (env->contact_sink.objformat) osync_anchor_update(anchorpath, "EnvContactSinkObjFormat", osync_objformat_get_name(env->contact_sink.objformat)); - if (env->todo_sink.objformat) osync_anchor_update(anchorpath, "EnvTodoSinkObjFormat", osync_objformat_get_name(env->todo_sink.objformat)); - if (env->calendar_sink.objformat) osync_anchor_update(anchorpath, "EnvCalendarSinkObjFormat", osync_objformat_get_name(env->calendar_sink.objformat)); - - /* Config info */ - if (env->device_addr) osync_anchor_update(anchorpath, "EnvDeviceAddr", env->device_addr); - if (env->username) osync_anchor_update(anchorpath, "EnvUsername", env->username); - if (env->command) osync_anchor_update(anchorpath, "EnvCommand", env->command); - snprintf(buf, sizeof(buf), "%d", env->device_port); - osync_anchor_update(anchorpath, "EnvDevicePort", buf); - snprintf(buf, sizeof(buf), "%d", env->use_ssh); - osync_anchor_update(anchorpath, "EnvUseSsh", buf); - snprintf(buf, sizeof(buf), "%d", env->use_local); - osync_anchor_update(anchorpath, "EnvUseLocal", buf); - snprintf(buf, sizeof(buf), "%d", env->use_remote); - osync_anchor_update(anchorpath, "EnvUseRemote", buf); - if (env->calendar) osync_anchor_update(anchorpath, "EnvCalendar", env->calendar); - snprintf(buf, sizeof(buf), "%d", env->debuglevel); - osync_anchor_update(anchorpath, "EnvDebuglevel", buf); - - g_free(anchorpath); - osync_trace(TRACE_EXIT, "GPE-SYNC %s", __func__); -} -static void restore_environment(gpe_environment *env, OSyncPluginInfo *info) -{ - char *value; - osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p)", __func__, env, info); - - /* We save the fields in the Anchor DB */ - char *anchorpath = g_strdup_printf("%s/anchor.db", osync_plugin_info_get_configdir(info)); - - /* For sinks we just need to restore the objformat */ - OSyncFormatEnv *formatenv = osync_plugin_info_get_format_env(info); - value = osync_anchor_retrieve(anchorpath, "EnvContactSinkObjFormat"); - if (value) env->contact_sink.objformat = osync_format_env_find_objformat(formatenv, value); - value = osync_anchor_retrieve(anchorpath, "EnvTodoSinkObjFormat"); - if (value) env->todo_sink.objformat = osync_format_env_find_objformat(formatenv, value); - value = osync_anchor_retrieve(anchorpath, "EnvCalendarSinkObjFormat"); - if (value) env->calendar_sink.objformat = osync_format_env_find_objformat(formatenv, value); - - /* Config info */ - env->device_addr = osync_anchor_retrieve(anchorpath, "EnvDeviceAddr"); - env->username = osync_anchor_retrieve(anchorpath, "EnvUsername"); - env->command = osync_anchor_retrieve(anchorpath, "EnvCommand"); - value = osync_anchor_retrieve(anchorpath, "EnvDevicePort"); - if (value) env->device_port = atoi(value); - value = osync_anchor_retrieve(anchorpath, "EnvUseSsh"); - if (value) env->use_ssh = atoi(value); - value = osync_anchor_retrieve(anchorpath, "EnvUseLocal"); - if (value) env->use_local = atoi(value); - value = osync_anchor_retrieve(anchorpath, "EnvUseRemote"); - if (value) env->use_remote = atoi(value); - env->calendar = osync_anchor_retrieve(anchorpath, "EnvCalendar"); - value = osync_anchor_retrieve(anchorpath, "EnvDebuglevel"); - if (value) env->debuglevel = atoi(value); - - g_free(anchorpath); - osync_trace(TRACE_EXIT, "GPE-SYNC %s", __func__); -} - -/*! \brief Closes the connection to the databases - * - * \brief ctx The context of the plugin - */ -static void gpe_disconnect_internal(gpe_environment *env) -{ - osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p)", __func__, env); - - if (env->client) { - gpesync_client_close (env->client); - env->client = NULL; - } - - osync_trace(TRACE_EXIT, "GPE-SYNC %s", __func__); -} -static void gpe_disconnect(void *data, OSyncPluginInfo *info, OSyncContext *ctx) -{ - osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p)", __func__, data, info, ctx); - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); - void *userdata = (sink_environment *)osync_objtype_sink_get_userdata(sink); - gpe_environment *env = ((sink_environment *)userdata)->gpe_env; - - gpe_disconnect_internal(env); - - //Answer the call - osync_context_report_success(ctx); - osync_trace(TRACE_EXIT, "GPE-SYNC %s", __func__); -} - -/*! \brief Connects to the databases of GPE - * - * \param ctx The context of the plugin - */ -static void gpe_connect_internal(gpe_environment *env, char **client_err) -{ - osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p)", __func__, env, client_err); - - // Do nothing if already connected - if (env->client) { - osync_trace(TRACE_INTERNAL, "GPE-SYNC %s: already connected", __func__); - } else { - if (env->use_local) { - env->client = gpesync_client_open_local(env->command, client_err); - } - else if (env->use_ssh) - { - gchar *path = g_strdup_printf ("%s@%s", env->username, env->device_addr); - env->client = gpesync_client_open_ssh (path, env->command, client_err); - } - else - env->client = gpesync_client_open (env->device_addr, env->device_port, client_err); - } - - osync_trace(TRACE_EXIT, "GPE-SYNC %s", __func__); -} -static void gpe_connect(void *data, OSyncPluginInfo *info, OSyncContext *ctx) -{ - char *client_err = NULL; - - osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p)", __func__, data, info, ctx); - - // We need to get the context to load all our stuff. - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); - void *userdata = (sink_environment *)osync_objtype_sink_get_userdata(sink); - gpe_environment *env = ((sink_environment *)userdata)->gpe_env; - - gpe_connect_internal(env, &client_err); - - if (env->client == NULL) { - osync_context_report_error(ctx, OSYNC_ERROR_NO_CONNECTION, client_err); - osync_trace(TRACE_EXIT_ERROR, "GPE-SYNC %s: connect failed: %s", __func__, client_err); - if (client_err) g_free(client_err); - return; - } - - // Set calendar name -- note that we checked that the version of gpesyncd supports - // setting the calendar name in the discovery phase - if (env->calendar) { - gchar *response = NULL; - gpesync_client_exec_printf(env->client, "path vevent %s", client_callback_string, &response, NULL, env->calendar); - if (strncmp(response, "OK", 2) != 0) { - osync_context_report_error(ctx, OSYNC_ERROR_MISCONFIGURATION, "calendar %s not found", - env->calendar); - osync_trace(TRACE_EXIT_ERROR, "GPE-SYNC %s: calendar %s not found", - __func__, env->calendar); - gpe_disconnect_internal(env); - g_free(response); - return; - } - g_free(response); - } - - osync_context_report_success(ctx); - - osync_trace(TRACE_EXIT, "GPE-SYNC %s", __func__); -} - -/*! \brief This is called once all objects have been sent to the plugin - * - * \param ctx The context of the plugin - */ -static void sync_done(void *data, OSyncPluginInfo *info, OSyncContext *ctx) -{ - OSyncError *error = NULL; - - osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p)", __func__, data, info, ctx); - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); - void *userdata = (sink_environment *)osync_objtype_sink_get_userdata(sink); - gpe_environment *env = ((sink_environment *)userdata)->gpe_env; - - //If we use anchors we have to update it now. - - // Save hashtables - if (!osync_hashtable_save(env->contact_sink.hashtable, &error)) - goto error; - if (!osync_hashtable_save(env->todo_sink.hashtable, &error)) - goto error; - if (!osync_hashtable_save(env->calendar_sink.hashtable, &error)) - goto error; - - //Answer the call - osync_context_report_success(ctx); - osync_trace(TRACE_EXIT, "GPE-SYNC %s", __func__); - return; - -error: - osync_context_report_osyncerror(ctx, error); - osync_trace(TRACE_EXIT_ERROR, "GPE-SYNC %s: %s", __func__, osync_error_print(&error)); - osync_error_unref(&error); -} - -static void free_sink(sink_environment *sinkenv) -{ - sinkenv->sink = NULL; - if (sinkenv->hashtable) osync_hashtable_unref(sinkenv->hashtable); - sinkenv->hashtable = NULL; -} - - -/*! \brief The counterpart to initialize - * - * \param data The data of the plugin (configuration, etc.) - */ -static void finalize(void *data) -{ - osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p)", __func__, data); - gpe_environment *env = (gpe_environment *)data; - - //Free all stuff that you have allocated here. - g_free(env->username); - g_free(env->device_addr); - - if (env->client) - gpesync_client_close (env->client); - - free_sink(&env->contact_sink); - free_sink(&env->todo_sink); - free_sink(&env->calendar_sink); - free_sink(&env->main_sink); - - g_free(env); - osync_trace(TRACE_EXIT, "GPE-SYNC %s", __func__); -} - /*! \brief Fetches the configuration data and validates it * * \param env The GPE plugin environment @@ -387,6 +152,8 @@ if (env->calendar) osync_trace(TRACE_INTERNAL, "GPE-SYNC %s: calendar = %d", __func__, env->calendar); } + env->configured = TRUE; + osync_trace(TRACE_EXIT, "GPE-SYNC %s", __func__); return TRUE; @@ -394,73 +161,72 @@ return FALSE; } -/*! \brief Initializes the plugin (needed for opensync) +/*! \brief Closes the connection to the databases * - * \param member The member of the sync pair - * \param error If an error occurs it will be stored here + * \brief ctx The context of the plugin */ -static void *initialize(OSyncPlugin *plugin, OSyncPluginInfo *info, OSyncError **error) +static void gpe_disconnect_internal(gpe_environment *env) { - const char *configdata = NULL; - - osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p)", __func__, plugin, info, error); - - gpe_environment *env = osync_try_malloc0(sizeof(gpe_environment), error); - if (!env) - goto error; - - restore_environment(env, info); - - // Create the main sink (which handles connect & disconnect) - env->main_sink.sink = osync_objtype_main_sink_new(error); - if (!env->main_sink.sink) goto error_free_env; + osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p)", __func__, env); + + if (env->client) { + gpesync_client_close (env->client); + env->client = NULL; + } - OSyncObjTypeSinkFunctions functions; - memset(&functions, 0, sizeof(functions)); - functions.connect = gpe_connect; - functions.disconnect = gpe_disconnect; - functions.sync_done = sync_done; - osync_objtype_sink_set_functions(env->main_sink.sink, functions, &env->main_sink); + osync_trace(TRACE_EXIT, "GPE-SYNC %s", __func__); +} +static void gpe_disconnect(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +{ + osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p)", __func__, data, info, ctx); + OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); + void *userdata = (sink_environment *)osync_objtype_sink_get_userdata(sink); + gpe_environment *env = ((sink_environment *)userdata)->gpe_env; + + gpe_disconnect_internal(env); - osync_plugin_info_set_main_sink(info, env->main_sink.sink); - env->main_sink.gpe_env = env; + //Answer the call + osync_context_report_success(ctx); + osync_trace(TRACE_EXIT, "GPE-SYNC %s", __func__); +} - // Set up contact sink - if (!gpe_contacts_setup(&env->contact_sink, env, info, error)) - goto error_free_env; - - // Set up calendar sink - if (!gpe_calendar_setup(&env->calendar_sink, env, info, error)) - goto error_free_env; - - // Set up todo sink - if (!gpe_todo_setup(&env->todo_sink, env, info, error)) - goto error_free_env; +/*! \brief Connects to the databases of GPE + * + * \param ctx The context of the plugin + */ +static void gpe_connect_internal(gpe_environment *env, char **client_err) +{ + osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p)", __func__, env, client_err); - // All done - osync_trace(TRACE_EXIT, "GPE-SYNC %s: %p", __func__, env); - return (void *)env; + // Do nothing if already connected + if (env->client) { + osync_trace(TRACE_INTERNAL, "GPE-SYNC %s: already connected", __func__); + } else { + if (env->use_local) { + env->client = gpesync_client_open_local(env->command, client_err); + } + else if (env->use_ssh) + { + gchar *path = g_strdup_printf ("%s@%s", env->username, env->device_addr); + env->client = gpesync_client_open_ssh (path, env->command, client_err); + } + else + env->client = gpesync_client_open (env->device_addr, env->device_port, client_err); + } -error_free_env: - finalize(env); -error: - osync_trace(TRACE_EXIT_ERROR, "GPE-SYNC %s: %s", __func__, osync_error_print(error)); - return NULL; + osync_trace(TRACE_EXIT, "GPE-SYNC %s", __func__); } /* Here we actually tell opensync which sinks are available. */ -static osync_bool discover(void *data, OSyncPluginInfo *info, OSyncError **error) +static osync_bool gpe_discover_internal(gpe_environment *env, OSyncPluginInfo *info, OSyncError **error) { gchar *err_string = NULL; gchar *response = NULL; unsigned int v_major = 1, v_minor = 0, v_edit = 0; // Default version 1.0.0 - osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p)", __func__, data, info, error); - - gpe_environment *env = (gpe_environment *)data; + osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p)", __func__, env, info, error); - // Get config - if (!gpe_parse_settings(env, info, error)) goto error; + if (!gpe_assert_error(env->configured && !env->discovered, error)) goto error; // Try to connect gpe_connect_internal(env, &err_string); @@ -491,16 +257,10 @@ goto error; } - gchar *version_string = g_strdup_printf("%d.%d.%d", v_major, v_minor, v_edit); - OSyncVersion *version = osync_version_new(error); - osync_version_set_plugin(version, "gpe-sync"); - //osync_version_set_modelversion(version, "version"); - //osync_version_set_firmwareversion(version, "firmwareversion"); - osync_version_set_softwareversion(version, version_string); - //osync_version_set_hardwareversion(version, "hardwareversion"); - osync_plugin_info_set_version(info, version); - osync_version_unref(version); - g_free(version_string); + env->v_major = v_major; + env->v_minor = v_minor; + env->v_edit = v_edit; + /* TODO: check these are the same versions which were reported at discovery time */ if (env->calendar) { // Calendar support requires at least version 1.2 @@ -523,7 +283,7 @@ } } - // Set objformats (could be dependent on version info in future) + // Work out formats for data received from peer (could be dependent on version info in future) OSyncFormatEnv *formatenv = osync_plugin_info_get_format_env(info); env->contact_sink.objformat = osync_format_env_find_objformat(formatenv, "vcard30"); @@ -547,6 +307,47 @@ goto error; } + env->discovered = TRUE; + + gpe_disconnect_internal(env); + + g_free(response); + osync_trace(TRACE_EXIT, "GPE-SYNC %s", __func__); + return TRUE; + + error: + if (env->client) gpe_disconnect_internal(env); + if (err_string) g_free(err_string); + if (response) g_free(response); + return FALSE; + +} + +static osync_bool discover(OSyncPluginInfo *info, void *data, OSyncError **error) +{ + osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p)", __func__, data, info, error); + + gpe_environment *env = (gpe_environment *)data; + + if (!gpe_assert_error(!env->configured && !env->discovered, error)) goto error; + + // Get config + if (!gpe_parse_settings(env, info, error)) goto error; + + // Do discovery + if (!gpe_discover_internal(env, info, error)) goto error; + + gchar *version_string = g_strdup_printf("%d.%d.%d", env->v_major, env->v_minor, env->v_edit); + OSyncVersion *version = osync_version_new(error); + osync_version_set_plugin(version, "gpe-sync"); + //osync_version_set_modelversion(version, "version"); + //osync_version_set_firmwareversion(version, "firmwareversion"); + osync_version_set_softwareversion(version, version_string); + //osync_version_set_hardwareversion(version, "hardwareversion"); + osync_plugin_info_set_version(info, version); + osync_version_unref(version); + g_free(version_string); + // Report available sinks... // GPE always supports contacts, todos and events if (env->contact_sink.sink) osync_objtype_sink_set_available(env->contact_sink.sink, TRUE); @@ -554,22 +355,199 @@ if (env->calendar_sink.sink) osync_objtype_sink_set_available(env->calendar_sink.sink, TRUE); // One day we may add notes... - gpe_disconnect_internal(env); - - save_environment(env, info); + if (!gpe_assert_error(env->configured && env->discovered, error)) goto error; - g_free(response); osync_trace(TRACE_EXIT, "GPE-SYNC %s", __func__); return TRUE; error: - if (env->client) gpe_disconnect_internal(env); - if (err_string) g_free(err_string); - if (response) g_free(response); return FALSE; } +static void gpe_connect(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +{ + char *client_err = NULL; + OSyncError *error = NULL; + + osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p)", __func__, data, info, ctx); + + // We need to get the context to load all our stuff. + OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); + void *userdata = (sink_environment *)osync_objtype_sink_get_userdata(sink); + gpe_environment *env = ((sink_environment *)userdata)->gpe_env; + + /* Re-parse and re-discover */ + if ( + !gpe_assert_error(!env->configured && !env->discovered, &error) || + !gpe_parse_settings(env, info, &error) || + !gpe_discover_internal(env, info, &error) || + !gpe_assert_error(env->configured && env->discovered, &error) + ) { + osync_context_report_osyncerror(ctx, error); + client_err = osync_error_print_stack(&error); + osync_trace(TRACE_EXIT_ERROR, "GPE-SYNC %s: connect failed: %s", __func__, client_err); + if (client_err) g_free(client_err); + osync_error_unref(&error); + return; + } + + gpe_connect_internal(env, &client_err); + + if (env->client == NULL) { + osync_context_report_error(ctx, OSYNC_ERROR_NO_CONNECTION, client_err); + osync_trace(TRACE_EXIT_ERROR, "GPE-SYNC %s: connect failed: %s", __func__, client_err); + if (client_err) g_free(client_err); + return; + } + + // Set calendar name -- note that we checked that the version of gpesyncd supports + // setting the calendar name in the discovery phase + if (env->calendar) { + gchar *response = NULL; + gpesync_client_exec_printf(env->client, "path vevent %s", client_callback_string, &response, NULL, env->calendar); + if (strncmp(response, "OK", 2) != 0) { + osync_context_report_error(ctx, OSYNC_ERROR_MISCONFIGURATION, "calendar %s not found", + env->calendar); + osync_trace(TRACE_EXIT_ERROR, "GPE-SYNC %s: calendar %s not found", + __func__, env->calendar); + gpe_disconnect_internal(env); + g_free(response); + return; + } + g_free(response); + } + + osync_context_report_success(ctx); + + osync_trace(TRACE_EXIT, "GPE-SYNC %s", __func__); +} + +/*! \brief This is called once all objects have been sent to the plugin + * + * \param ctx The context of the plugin + */ +static void sync_done(void *data, OSyncPluginInfo *info, OSyncContext *ctx) +{ + OSyncError *error = NULL; + + osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p)", __func__, data, info, ctx); + OSyncObjTypeSink *sink = osync_plugin_info_get_sink(info); + void *userdata = (sink_environment *)osync_objtype_sink_get_userdata(sink); + gpe_environment *env = ((sink_environment *)userdata)->gpe_env; + + if (!gpe_assert(env->configured && env->discovered)) { + osync_trace(TRACE_ERROR, "GPE plugin not initialised: configured = %d, discovered = %d", env->configured, env->discovered ); + osync_context_report_error (ctx, OSYNC_ERROR_GENERIC, "GPE plugin not initialised: configured = %d, discovered = %d", env->configured, env->discovered); + return; + } + + //If we use anchors we have to update it now. + + // Save hashtables + if (!osync_hashtable_save(env->contact_sink.hashtable, &error)) + goto error; + if (!osync_hashtable_save(env->todo_sink.hashtable, &error)) + goto error; + if (!osync_hashtable_save(env->calendar_sink.hashtable, &error)) + goto error; + + //Answer the call + osync_context_report_success(ctx); + osync_trace(TRACE_EXIT, "GPE-SYNC %s", __func__); + return; + +error: + osync_context_report_osyncerror(ctx, error); + osync_trace(TRACE_EXIT_ERROR, "GPE-SYNC %s: %s", __func__, osync_error_print(&error)); + osync_error_unref(&error); +} + +static void free_sink(sink_environment *sinkenv) +{ + sinkenv->sink = NULL; + if (sinkenv->hashtable) osync_hashtable_unref(sinkenv->hashtable); + sinkenv->hashtable = NULL; +} + + +/*! \brief The counterpart to initialize + * + * \param data The data of the plugin (configuration, etc.) + */ +static void finalize(void *data) +{ + osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p)", __func__, data); + gpe_environment *env = (gpe_environment *)data; + + //Free all stuff that you have allocated here. + g_free(env->username); + g_free(env->device_addr); + + if (env->client) + gpesync_client_close (env->client); + + free_sink(&env->contact_sink); + free_sink(&env->todo_sink); + free_sink(&env->calendar_sink); + free_sink(&env->main_sink); + + g_free(env); + osync_trace(TRACE_EXIT, "GPE-SYNC %s", __func__); +} + +/*! \brief Initializes the plugin (needed for opensync) + * + * \param member The member of the sync pair + * \param error If an error occurs it will be stored here + */ +static void *initialize(OSyncPlugin *plugin, OSyncPluginInfo *info, OSyncError **error) +{ + const char *configdata = NULL; + + osync_trace(TRACE_ENTRY, "GPE-SYNC %s(%p, %p, %p)", __func__, plugin, info, error); + + gpe_environment *env = osync_try_malloc0(sizeof(gpe_environment), error); + if (!env) + goto error; + + // Create the main sink (which handles connect & disconnect) + env->main_sink.sink = osync_objtype_main_sink_new(error); + if (!env->main_sink.sink) goto error_free_env; + + OSyncObjTypeSinkFunctions functions; + memset(&functions, 0, sizeof(functions)); + functions.connect = gpe_connect; + functions.disconnect = gpe_disconnect; + functions.sync_done = sync_done; + osync_objtype_sink_set_functions(env->main_sink.sink, functions, &env->main_sink); + + osync_plugin_info_set_main_sink(info, env->main_sink.sink); + env->main_sink.gpe_env = env; + + // Set up contact sink + if (!gpe_contacts_setup(&env->contact_sink, env, info, error)) + goto error_free_env; + + // Set up calendar sink + if (!gpe_calendar_setup(&env->calendar_sink, env, info, error)) + goto error_free_env; + + // Set up todo sink + if (!gpe_todo_setup(&env->todo_sink, env, info, error)) + goto error_free_env; + + // All done + osync_trace(TRACE_EXIT, "GPE-SYNC %s: %p", __func__, env); + return (void *)env; + +error_free_env: + finalize(env); +error: + osync_trace(TRACE_EXIT_ERROR, "GPE-SYNC %s: %s", __func__, osync_error_print(error)); + return NULL; +} + /*! \brief This function has to be in every opensync plugin * * \brief env The environment of the plugin containing basic Modified: plugins/gpe/src/gpe_sync.h ============================================================================== --- plugins/gpe/src/gpe_sync.h Tue Jan 13 23:59:59 2009 (r5135) +++ plugins/gpe/src/gpe_sync.h Wed Jan 14 00:48:41 2009 (r5136) @@ -63,9 +63,18 @@ int use_ssh; int use_local; int use_remote; - char *calendar; // Name of GPE calendar to use or NULL + const char *calendar; // Name of GPE calendar to use or NULL int debuglevel; + + /* Peer information */ + int v_major; + int v_minor; + int v_edit; + + /* Status */ + int configured; /* Configuration has been parsed */ + int discovered; /* Discovery has happened */ } gpe_environment; #include "utils.h" @@ -91,4 +100,12 @@ #define MIN_PROTOCOL_MAJOR 1 #define MIN_PROTOCOL_MINOR 0 +#ifndef NDEBUG +#define gpe_assert(x) ( (x) ? TRUE : ( fprintf(stderr, "%s:%i:E:%s: Assertion \"" #x "\" failed\n", __FILE__, __LINE__, __func__), abort(), FALSE ) ) +#else +#define gpe_assert(x) (x) +#endif + +#define gpe_assert_error(x, e) ( gpe_assert(x) ? TRUE : ( osync_error_set((e), OSYNC_ERROR_GENERIC, "%s:%i:E:%s: Assertion \"" #x "\" failed\n", __FILE__, __LINE__, __func__) , FALSE ) ) + #endif Modified: plugins/gpe/src/todo.c ============================================================================== --- plugins/gpe/src/todo.c Tue Jan 13 23:59:59 2009 (r5135) +++ plugins/gpe/src/todo.c Wed Jan 14 00:48:41 2009 (r5136) @@ -39,6 +39,12 @@ char *error = NULL; char *data_ptr; unsigned int data_size; + + if (!gpe_assert(env->configured && env->discovered)) { + osync_trace(TRACE_ERROR, "GPE plugin not initialised: configured = %d, discovered = %d", env->configured, env->discovered ); + osync_context_report_error (ctx, OSYNC_ERROR_GENERIC, "GPE plugin not initialised: configured = %d, discovered = %d", env->configured, env->discovered); + return; + } switch (osync_change_get_changetype (change)) { case OSYNC_CHANGE_TYPE_DELETED: @@ -116,6 +122,12 @@ gpe_environment *env = (gpe_environment *)userdata; sink_environment *sinkenv = (sink_environment *)osync_objtype_sink_get_userdata(osync_plugin_info_get_sink(info)); + if (!gpe_assert(env->configured && env->discovered)) { + osync_trace(TRACE_ERROR, "GPE plugin not initialised: configured = %d, discovered = %d", env->configured, env->discovered ); + osync_context_report_error (ctx, OSYNC_ERROR_GENERIC, "GPE plugin not initialised: configured = %d, discovered = %d", env->configured, env->discovered); + return; + } + if (osync_objtype_sink_get_slowsync(sinkenv->sink)) { osync_trace(TRACE_INTERNAL, "Slow sync requested"); if (!osync_hashtable_slowsync(sinkenv->hashtable, &error)) { |
From: <dg...@su...> - 2009-01-13 23:16:13
|
Author: dgollub Date: Tue Jan 13 23:23:34 2009 New Revision: 5134 URL: http://www.opensync.org/changeset/5134 Log: Drop anchor_path - not required with new OSyncAnchor interface. Modified: plugins/syncml/src/syncml_common.c plugins/syncml/src/syncml_common.h Modified: plugins/syncml/src/syncml_common.c ============================================================================== --- plugins/syncml/src/syncml_common.c Tue Jan 13 23:14:59 2009 (r5133) +++ plugins/syncml/src/syncml_common.c Tue Jan 13 23:23:34 2009 (r5134) @@ -278,8 +278,6 @@ /* plugin config */ - if (env->anchor_path) - safe_cfree(&(env->anchor_path)); if (env->devinf_path) safe_cfree(&(env->devinf_path)); osync_trace(TRACE_INTERNAL, "%s - plugin configuration cleaned", __func__); @@ -770,7 +768,6 @@ osync_objtype_sink_unref(mainsink); /* prepare paths for callbacks */ - env->anchor_path = g_strdup_printf("%s/anchor.db", osync_plugin_info_get_configdir(info)); env->devinf_path = g_strdup_printf("%s/devinf.db", osync_plugin_info_get_configdir(info)); /* set callbacks */ Modified: plugins/syncml/src/syncml_common.h ============================================================================== --- plugins/syncml/src/syncml_common.h Tue Jan 13 23:14:59 2009 (r5133) +++ plugins/syncml/src/syncml_common.h Tue Jan 13 23:23:34 2009 (r5134) @@ -105,7 +105,6 @@ /* environment data */ OSyncPluginInfo *pluginInfo; - char *anchor_path; char *devinf_path; GSource *source; |
From: <dg...@su...> - 2009-01-13 23:16:11
|
Author: dgollub Date: Tue Jan 13 23:14:59 2009 New Revision: 5133 URL: http://www.opensync.org/changeset/5133 Log: Add regression testcase for #1021 Modified: trunk/tests/CMakeLists.txt trunk/tests/capabilities-tests/check_xmlformat.c Modified: trunk/tests/CMakeLists.txt ============================================================================== --- trunk/tests/CMakeLists.txt Tue Jan 13 23:02:19 2009 (r5132) +++ trunk/tests/CMakeLists.txt Tue Jan 13 23:14:59 2009 (r5133) @@ -370,6 +370,7 @@ OSYNC_TESTCASE(xmlformat xmlformat_schema_validate) OSYNC_TESTCASE(xmlformat xmlfield_new) OSYNC_TESTCASE(xmlformat xmlfield_sort) +OSYNC_TESTCASE(xmlformat xmlfield_childlink_for_getter_setter) CONFIGURE_FILE( "${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.cmake" Modified: trunk/tests/capabilities-tests/check_xmlformat.c ============================================================================== --- trunk/tests/capabilities-tests/check_xmlformat.c Tue Jan 13 23:02:19 2009 (r5132) +++ trunk/tests/capabilities-tests/check_xmlformat.c Tue Jan 13 23:14:59 2009 (r5133) @@ -222,6 +222,28 @@ } END_TEST +/* Regression test for missing child link when unsing + * OSyncXMLField key getter/setter interface (#1021) + */ +START_TEST (xmlfield_childlink_for_getter_setter) +{ + char *testbed = setup_testbed(NULL); + OSyncError *error = NULL; + + OSyncXMLFormat *xmlformat = osync_xmlformat_new("top", &error); + + OSyncXMLField *foo = osync_xmlfield_new(xmlformat, "foo", &error); + osync_xmlfield_set_key_value(foo, "fookeyname1", "foorandomvalue"); + + fail_unless(osync_xmlfield_get_child(foo) != NULL); + + osync_xmlformat_unref(xmlformat); + + destroy_testbed(testbed); +} +END_TEST + + OSYNC_TESTCASE_START("xmlformat") // xmlformat OSYNC_TESTCASE_ADD(xmlformat_new) @@ -234,5 +256,6 @@ // xmlfield OSYNC_TESTCASE_ADD(xmlfield_new) OSYNC_TESTCASE_ADD(xmlfield_sort) +OSYNC_TESTCASE_ADD(xmlfield_childlink_for_getter_setter) OSYNC_TESTCASE_END |
From: <dg...@su...> - 2009-01-13 23:00:52
|
Author: dgollub Date: Tue Jan 13 23:59:59 2009 New Revision: 5135 URL: http://www.opensync.org/changeset/5135 Log: Load anchor for main_sink, if requested. By accident only the ObjTypesink anchors got loaded. Modified: trunk/opensync/client/opensync_client.c Modified: trunk/opensync/client/opensync_client.c ============================================================================== --- trunk/opensync/client/opensync_client.c Tue Jan 13 23:23:34 2009 (r5134) +++ trunk/opensync/client/opensync_client.c Tue Jan 13 23:59:59 2009 (r5135) @@ -567,7 +567,7 @@ OSyncQueue *outgoing = NULL; OSyncList *r = NULL; OSyncPluginResource *res = NULL; - OSyncObjTypeSink *sink = NULL; + OSyncObjTypeSink *sink = NULL, *main_sink = NULL; const char *objtype = NULL; const char *preferred_format = NULL; OSyncList *o = NULL; @@ -702,6 +702,14 @@ } } + main_sink = osync_plugin_info_get_main_sink(client->plugin_info); + if (main_sink) { + if (!osync_objtype_sink_load_anchor(main_sink, + client->plugin_info, error)) + goto error_finalize; + + } + reply = osync_message_new_reply(message, error); if (!reply) goto error_finalize; |
From: <dg...@su...> - 2009-01-13 20:35:38
|
Author: friedrich.beckmann Date: Tue Jan 13 21:34:50 2009 New Revision: 5131 URL: http://www.opensync.org/changeset/5131 Log: windows port - localtime_r and gmtime_r are not available in windows (export for test) Modified: trunk/opensync/format/opensync_time.h Modified: trunk/opensync/format/opensync_time.h ============================================================================== --- trunk/opensync/format/opensync_time.h Tue Jan 13 21:17:46 2009 (r5130) +++ trunk/opensync/format/opensync_time.h Tue Jan 13 21:34:50 2009 (r5131) @@ -349,6 +349,14 @@ */ OSYNC_EXPORT struct tm *osync_time_relative2tm(const char *byday, const int bymonth, const int year); +#ifdef _WIN32 +/* Windows does not provide gmtime_r and localtime_r */ +/* This module uses these two functions internally */ +/* They are also exported for testing purposes */ +OSYNC_TEST_EXPORT inline struct tm* gmtime_r (const time_t *clock, struct tm *result); +OSYNC_TEST_EXPORT inline struct tm* localtime_r (const time_t *clock, struct tm *result); +#endif /* _WIN32 */ + /*@}*/ #endif /*_OPENSYNC_TIME_H_*/ |
From: <dg...@su...> - 2009-01-13 20:18:34
|
Author: friedrich.beckmann Date: Tue Jan 13 21:17:46 2009 New Revision: 5130 URL: http://www.opensync.org/changeset/5130 Log: windows port - replaced sleep with g_usleep Modified: trunk/tests/mock-plugin/mock_sync.c Modified: trunk/tests/mock-plugin/mock_sync.c ============================================================================== --- trunk/tests/mock-plugin/mock_sync.c Tue Jan 13 18:39:02 2009 (r5129) +++ trunk/tests/mock-plugin/mock_sync.c Tue Jan 13 21:17:46 2009 (r5130) @@ -337,7 +337,7 @@ osync_assert(osync_file_read(filename, &(file->data), &(file->size), &error)); if (mock_get_error(info->memberid, "SLOW_REPORT")) - sleep(1); + g_usleep(1*G_USEC_PER_SEC); odata = osync_data_new((char *)file, sizeof(OSyncFileFormat), directory->objformat, &error); osync_assert(odata); @@ -391,7 +391,7 @@ } if (mock_get_error(info->memberid, "GET_CHANGES_TIMEOUT2")) - sleep(8); + g_usleep(8*G_USEC_PER_SEC); if (osync_objtype_sink_get_slowsync(sink)) { osync_trace(TRACE_INTERNAL, "Slow sync requested"); |
From: <dg...@su...> - 2009-01-13 17:39:48
|
Author: cstender Date: Tue Jan 13 18:39:02 2009 New Revision: 5129 URL: http://www.opensync.org/changeset/5129 Log: removed warning about unused variable 'memberid' when building with tests disabled. Modified: trunk/opensync/client/opensync_client_proxy.c Modified: trunk/opensync/client/opensync_client_proxy.c ============================================================================== --- trunk/opensync/client/opensync_client_proxy.c Tue Jan 13 17:12:00 2009 (r5128) +++ trunk/opensync/client/opensync_client_proxy.c Tue Jan 13 18:39:02 2009 (r5129) @@ -1129,7 +1129,9 @@ callContext *ctx = NULL; int haspluginconfig = config ? TRUE : FALSE; OSyncMessage *message = NULL; - long long int memberid = 0; +#ifdef OPENSYNC_UNITTESTS + long long int memberid = 0; +#endif osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %s, %s, %s, %s, %p, %p)", __func__, proxy, callback, userdata, formatdir, plugindir, plugin, groupname, configdir, config, error); osync_assert(proxy); |
From: <dg...@su...> - 2009-01-13 16:12:58
|
Author: ianmartin Date: Tue Jan 13 17:12:00 2009 New Revision: 5128 URL: http://www.opensync.org/changeset/5128 Log: Prefer opensync memory allocation to glib. Ticket #977 Modified: trunk/opensync/archive/opensync_archive.c trunk/opensync/capabilities/opensync_capabilities.c trunk/opensync/capabilities/opensync_capability.c trunk/opensync/common/opensync_list.c trunk/opensync/common/opensync_list.h trunk/opensync/data/opensync_change.c trunk/opensync/data/opensync_data.c trunk/opensync/db/opensync_db.c trunk/opensync/engine/opensync_engine.c trunk/opensync/engine/opensync_engine_private.h trunk/opensync/engine/opensync_mapping_engine.c trunk/opensync/engine/opensync_mapping_engine_internals.h trunk/opensync/engine/opensync_mapping_entry_engine.c trunk/opensync/engine/opensync_obj_engine.c trunk/opensync/engine/opensync_obj_engine_internals.h trunk/opensync/engine/opensync_sink_engine.c trunk/opensync/engine/opensync_status.c trunk/opensync/format/opensync_converter.c trunk/opensync/format/opensync_converter_private.h trunk/opensync/format/opensync_filter.c trunk/opensync/format/opensync_format_env.c trunk/opensync/format/opensync_format_env_internals.h trunk/opensync/format/opensync_objformat.c trunk/opensync/format/opensync_objformat_sink.c trunk/opensync/helper/opensync_anchor.c trunk/opensync/helper/opensync_hashtable.c trunk/opensync/ipc/opensync_queue.c trunk/opensync/ipc/opensync_queue_private.h trunk/opensync/ipc/opensync_serializer.c trunk/opensync/mapping/opensync_mapping.c trunk/opensync/mapping/opensync_mapping_entry.c trunk/opensync/mapping/opensync_mapping_internals.h trunk/opensync/mapping/opensync_mapping_table.c trunk/opensync/mapping/opensync_mapping_table_internals.h trunk/opensync/module/opensync_module.c trunk/opensync/plugin/opensync_context.c trunk/opensync/plugin/opensync_objtype_sink.c trunk/opensync/plugin/opensync_objtype_sink_private.h trunk/opensync/plugin/opensync_plugin.c trunk/opensync/plugin/opensync_plugin.h trunk/opensync/plugin/opensync_plugin_advancedoptions.c trunk/opensync/plugin/opensync_plugin_authentication.c trunk/opensync/plugin/opensync_plugin_config.c trunk/opensync/plugin/opensync_plugin_connection.c trunk/opensync/plugin/opensync_plugin_env.c trunk/opensync/plugin/opensync_plugin_env_private.h trunk/opensync/plugin/opensync_plugin_info.c trunk/opensync/plugin/opensync_plugin_info_private.h trunk/opensync/plugin/opensync_plugin_localization.c trunk/opensync/plugin/opensync_plugin_resource.c trunk/opensync/version/opensync_version.c trunk/tests/group-tests/check_lock.c Modified: trunk/opensync/archive/opensync_archive.c ============================================================================== --- trunk/opensync/archive/opensync_archive.c Mon Jan 12 23:22:19 2009 (r5127) +++ trunk/opensync/archive/opensync_archive.c Tue Jan 13 17:12:00 2009 (r5128) @@ -162,7 +162,7 @@ goto error_and_free; if (!osync_db_open(archive->db, filename, error)) { - g_free(archive->db); + osync_free(archive->db); goto error_and_free; } @@ -170,7 +170,7 @@ return archive; error_and_free: - g_free(archive); + osync_free(archive); error: osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); @@ -198,8 +198,8 @@ osync_trace(TRACE_INTERNAL, "Can't close database"); } - g_free(archive->db); - g_free(archive); + osync_free(archive->db); + osync_free(archive); osync_trace(TRACE_EXIT, "%s", __func__); } @@ -220,16 +220,16 @@ // FIXME: Avoid subselect - this query needs up to 0.5s escaped_objtype = osync_db_sql_escape(objtype); - query = g_strdup_printf("REPLACE INTO tbl_archive (objtype, mappingid, data) VALUES('%s', %lli, ?)", escaped_objtype, id); - g_free(escaped_objtype); + query = osync_strdup_printf("REPLACE INTO tbl_archive (objtype, mappingid, data) VALUES('%s', %lli, ?)", escaped_objtype, id); + osync_free(escaped_objtype); escaped_objtype = NULL; if (!osync_db_bind_blob(archive->db, query, data, size, error)) { - g_free(query); + osync_free(query); goto error; } - g_free(query); + osync_free(query); osync_trace(TRACE_EXIT, "%s", __func__); return TRUE; @@ -257,15 +257,15 @@ escaped_uid = osync_db_sql_escape(uid); escaped_objtype = osync_db_sql_escape(objtype); - query = g_strdup_printf("SELECT data FROM tbl_archive WHERE objtype='%s' AND mappingid=(SELECT mappingid FROM tbl_changes WHERE objtype='%s' AND uid='%s' LIMIT 1)", escaped_objtype, escaped_objtype, escaped_uid); - g_free(escaped_objtype); + query = osync_strdup_printf("SELECT data FROM tbl_archive WHERE objtype='%s' AND mappingid=(SELECT mappingid FROM tbl_changes WHERE objtype='%s' AND uid='%s' LIMIT 1)", escaped_objtype, escaped_objtype, escaped_uid); + osync_free(escaped_objtype); escaped_objtype = NULL; ret = osync_db_get_blob(archive->db, query, data, size, error); - g_free(query); - g_free(escaped_uid); + osync_free(query); + osync_free(escaped_uid); if (ret < 0) { goto error; @@ -300,21 +300,21 @@ escaped_objtype = osync_db_sql_escape(objtype); if (!id) { - query = g_strdup_printf("INSERT INTO tbl_changes (objtype, uid, mappingid, memberid) VALUES('%s', '%s', '%lli', '%lli')", escaped_objtype, escaped_uid, mappingid, memberid); + query = osync_strdup_printf("INSERT INTO tbl_changes (objtype, uid, mappingid, memberid) VALUES('%s', '%s', '%lli', '%lli')", escaped_objtype, escaped_uid, mappingid, memberid); } else { - query = g_strdup_printf("UPDATE tbl_changes SET uid='%s', mappingid='%lli', memberid='%lli' WHERE objtype='%s' AND id=%lli", escaped_uid, mappingid, memberid, escaped_objtype, id); + query = osync_strdup_printf("UPDATE tbl_changes SET uid='%s', mappingid='%lli', memberid='%lli' WHERE objtype='%s' AND id=%lli", escaped_uid, mappingid, memberid, escaped_objtype, id); } - g_free(escaped_objtype); - g_free(escaped_uid); + osync_free(escaped_objtype); + osync_free(escaped_uid); escaped_objtype = NULL; escaped_uid = NULL; if (!osync_db_query(archive->db, query, error)) { - g_free(query); + osync_free(query); goto error; } - g_free(query); + osync_free(query); if (!id) id = osync_db_last_rowid(archive->db); @@ -339,15 +339,15 @@ goto error; escaped_objtype = osync_db_sql_escape(objtype); - query = g_strdup_printf("DELETE FROM tbl_changes WHERE objtype='%s' AND id=%lli", escaped_objtype, id); - g_free(escaped_objtype); + query = osync_strdup_printf("DELETE FROM tbl_changes WHERE objtype='%s' AND id=%lli", escaped_objtype, id); + osync_free(escaped_objtype); escaped_objtype = NULL; if (!osync_db_query(archive->db, query, error)) { - g_free(query); + osync_free(query); goto error; } - g_free(query); + osync_free(query); osync_trace(TRACE_EXIT, "%s", __func__); return TRUE; @@ -379,12 +379,12 @@ goto error; escaped_objtype = osync_db_sql_escape(objtype); - query = g_strdup_printf("SELECT id, uid, mappingid, memberid FROM tbl_changes WHERE objtype='%s' ORDER BY mappingid", escaped_objtype); - g_free(escaped_objtype); + query = osync_strdup_printf("SELECT id, uid, mappingid, memberid FROM tbl_changes WHERE objtype='%s' ORDER BY mappingid", escaped_objtype); + osync_free(escaped_objtype); escaped_objtype = NULL; result = osync_db_query_table(archive->db, query, error); - g_free(query); + osync_free(query); /* Check for error of osync_db_query_table() call. */ if (osync_error_is_set(error)) @@ -421,7 +421,7 @@ memberid = g_ascii_strtoull(value_str, NULL, 0); *ids = osync_list_append((*ids), GINT_TO_POINTER((int)id)); - *uids = osync_list_append((*uids), g_strdup(uid)); + *uids = osync_list_append((*uids), osync_strdup(uid)); *mappingids = osync_list_append((*mappingids), GINT_TO_POINTER((int)mappingid)); *memberids = osync_list_append((*memberids), GINT_TO_POINTER((int)memberid)); @@ -450,16 +450,16 @@ goto error; escaped_objtype = osync_db_sql_escape(objtype); - query = g_strdup_printf("DELETE FROM tbl_changes WHERE objtype='%s'", escaped_objtype); - g_free(escaped_objtype); + query = osync_strdup_printf("DELETE FROM tbl_changes WHERE objtype='%s'", escaped_objtype); + osync_free(escaped_objtype); escaped_objtype = NULL; if (!osync_db_query(archive->db, query, error)) { - g_free(query); + osync_free(query); goto error; } - g_free(query); + osync_free(query); osync_trace(TRACE_EXIT, "%s", __func__); return TRUE; @@ -488,12 +488,12 @@ goto error; escaped_objtype = osync_db_sql_escape(objtype); - query = g_strdup_printf("SELECT entryid, changetype FROM tbl_changelog WHERE objtype='%s' ORDER BY id", escaped_objtype); - g_free(escaped_objtype); + query = osync_strdup_printf("SELECT entryid, changetype FROM tbl_changelog WHERE objtype='%s' ORDER BY id", escaped_objtype); + osync_free(escaped_objtype); escaped_objtype = NULL; result = osync_db_query_table(archive->db, query, error); - g_free(query); + osync_free(query); /* Check for error of osync_db_query_table() call. */ if (osync_error_is_set(error)) @@ -533,16 +533,16 @@ goto error; escaped_objtype = osync_db_sql_escape(objtype); - query = g_strdup_printf("INSERT INTO tbl_changelog (objtype, entryid, changetype) VALUES('%s', '%lli', '%i')", escaped_objtype, id, changetype); - g_free(escaped_objtype); + query = osync_strdup_printf("INSERT INTO tbl_changelog (objtype, entryid, changetype) VALUES('%s', '%lli', '%i')", escaped_objtype, id, changetype); + osync_free(escaped_objtype); escaped_objtype = NULL; if (!osync_db_query(archive->db, query, error)) { - g_free(query); + osync_free(query); goto error; } - g_free(query); + osync_free(query); osync_trace(TRACE_EXIT, "%s: %lli", __func__, id); return TRUE; @@ -564,16 +564,16 @@ goto error; escaped_objtype = osync_db_sql_escape(objtype); - query = g_strdup_printf("DELETE FROM tbl_changelog WHERE objtype='%s'", escaped_objtype); - g_free(escaped_objtype); + query = osync_strdup_printf("DELETE FROM tbl_changelog WHERE objtype='%s'", escaped_objtype); + osync_free(escaped_objtype); escaped_objtype = NULL; if (!osync_db_query(archive->db, query, error)) { - g_free(query); + osync_free(query); goto error; } - g_free(query); + osync_free(query); osync_trace(TRACE_EXIT, "%s", __func__); return TRUE; Modified: trunk/opensync/capabilities/opensync_capabilities.c ============================================================================== --- trunk/opensync/capabilities/opensync_capabilities.c Mon Jan 12 23:22:19 2009 (r5127) +++ trunk/opensync/capabilities/opensync_capabilities.c Tue Jan 13 17:12:00 2009 (r5128) @@ -260,17 +260,17 @@ osync_trace(TRACE_ENTRY, "%s(%s, %p)", __func__, file, error); osync_assert(file); - filename = g_strdup_printf("%s%c%s", OPENSYNC_CAPABILITIESDIR, G_DIR_SEPARATOR, file); + filename = osync_strdup_printf("%s%c%s", OPENSYNC_CAPABILITIESDIR, G_DIR_SEPARATOR, file); b = osync_file_read(filename, &buffer, &size, error); - g_free(filename); + osync_free(filename); if(!b) { osync_trace(TRACE_EXIT_ERROR, "%s: %s" , __func__, osync_error_print(error)); return NULL; } capabilities = osync_capabilities_parse(buffer, size, error); - g_free(buffer); + osync_free(buffer); if(!capabilities) { osync_trace(TRACE_EXIT_ERROR, "%s: %s" , __func__, osync_error_print(error)); return NULL; @@ -288,9 +288,9 @@ osync_trace(TRACE_ENTRY, "%s(%p)", __func__, member); osync_assert(member); - filename = g_strdup_printf("%s%ccapabilities.xml", osync_member_get_configdir(member), G_DIR_SEPARATOR); + filename = osync_strdup_printf("%s%ccapabilities.xml", osync_member_get_configdir(member), G_DIR_SEPARATOR); res = g_file_test(filename, G_FILE_TEST_IS_REGULAR); - g_free(filename); + osync_free(filename); osync_trace(TRACE_EXIT, "%s: %i", __func__, res); return res; @@ -306,9 +306,9 @@ osync_trace(TRACE_ENTRY, "%s(%p, %p)", __func__, member, error); osync_assert(member); - filename = g_strdup_printf("%s%ccapabilities.xml", osync_member_get_configdir(member), G_DIR_SEPARATOR); + filename = osync_strdup_printf("%s%ccapabilities.xml", osync_member_get_configdir(member), G_DIR_SEPARATOR); res = osync_file_read(filename, &buffer, &size, error); - g_free(filename); + osync_free(filename); if(!res) { osync_trace(TRACE_EXIT_ERROR, "%s: %s" , __func__, osync_error_print(error)); @@ -316,7 +316,7 @@ } capabilities = osync_capabilities_parse(buffer, size, error); - g_free(buffer); + osync_free(buffer); if(!capabilities) { osync_trace(TRACE_EXIT_ERROR, "%s: %s" , __func__, osync_error_print(error)); return NULL; @@ -340,10 +340,10 @@ osync_assert(capabilities); osync_capabilities_assemble(capabilities, &buffer, &size); - filename = g_strdup_printf("%s%ccapabilities.xml", osync_member_get_configdir(member), G_DIR_SEPARATOR); + filename = osync_strdup_printf("%s%ccapabilities.xml", osync_member_get_configdir(member), G_DIR_SEPARATOR); res = osync_file_write(filename, buffer, size, 0600, error); - g_free(filename); - g_free(buffer); + osync_free(filename); + osync_free(buffer); if(!res) { osync_trace(TRACE_EXIT_ERROR, "%s: %s" , __func__, osync_error_print(error)); return FALSE; Modified: trunk/opensync/capabilities/opensync_capability.c ============================================================================== --- trunk/opensync/capabilities/opensync_capability.c Mon Jan 12 23:22:19 2009 (r5127) +++ trunk/opensync/capabilities/opensync_capability.c Tue Jan 13 17:12:00 2009 (r5128) @@ -140,7 +140,7 @@ capability->child = tmp; } - g_free(capability); + osync_free(capability); } int osync_capability_compare_stdlib(const void *capability1, const void *capability2) Modified: trunk/opensync/common/opensync_list.c ============================================================================== --- trunk/opensync/common/opensync_list.c Mon Jan 12 23:22:19 2009 (r5127) +++ trunk/opensync/common/opensync_list.c Tue Jan 13 17:12:00 2009 (r5128) @@ -376,7 +376,7 @@ OSyncList* osync_list_find (OSyncList *list, - void * data) + const void *data) { while (list) { @@ -390,7 +390,7 @@ OSyncList* osync_list_find_custom (OSyncList *list, - void * data, + const void *data, OSyncCompareFunc func) { g_return_val_if_fail (func != NULL, list); Modified: trunk/opensync/common/opensync_list.h ============================================================================== --- trunk/opensync/common/opensync_list.h Mon Jan 12 23:22:19 2009 (r5127) +++ trunk/opensync/common/opensync_list.h Tue Jan 13 17:12:00 2009 (r5128) @@ -40,8 +40,8 @@ OSyncList *prev; }; -typedef int (*OSyncCompareFunc)(void *a, void *b); -typedef int (*OSyncCompareDataFunc)(void *a, void *b, void *user_data); +typedef int (*OSyncCompareFunc)(const void *a, const void *b); +typedef int (*OSyncCompareDataFunc)(const void *a, const void *b, void *user_data); typedef void (*OSyncFunc)(void *data, void *user_data); /* Doubly linked lists @@ -84,9 +84,9 @@ OSYNC_EXPORT OSyncList* osync_list_nth_prev (OSyncList *list, unsigned int n); OSYNC_EXPORT OSyncList* osync_list_find (OSyncList *list, - void * data); + const void * data); OSYNC_EXPORT OSyncList* osync_list_find_custom (OSyncList *list, - void * data, + const void * data, OSyncCompareFunc func); OSYNC_EXPORT int osync_list_position (OSyncList *list, OSyncList *llink); Modified: trunk/opensync/data/opensync_change.c ============================================================================== --- trunk/opensync/data/opensync_change.c Mon Jan 12 23:22:19 2009 (r5127) +++ trunk/opensync/data/opensync_change.c Tue Jan 13 17:12:00 2009 (r5128) @@ -60,12 +60,12 @@ osync_data_unref(change->data); if (change->uid) - g_free(change->uid); + osync_free(change->uid); if (change->hash) - g_free(change->hash); + osync_free(change->hash); - g_free(change); + osync_free(change); } } @@ -111,8 +111,8 @@ { osync_assert(change); if (change->hash) - g_free(change->hash); - change->hash = g_strdup(hash); + osync_free(change->hash); + change->hash = osync_strdup(hash); } const char *osync_change_get_hash(OSyncChange *change) @@ -127,8 +127,8 @@ osync_assert(uid); if (change->uid) - g_free(change->uid); - change->uid = g_strdup(uid); + osync_free(change->uid); + change->uid = osync_strdup(uid); } const char *osync_change_get_uid(OSyncChange *change) @@ -166,10 +166,10 @@ osync_change_set_data(change, source->data); if (source->uid) - change->uid = g_strdup(source->uid); + change->uid = osync_strdup(source->uid); if (source->hash) - change->hash = g_strdup(source->hash); + change->hash = osync_strdup(source->hash); if (source->changetype) change->changetype = osync_change_get_changetype(source); @@ -238,7 +238,7 @@ if (newuid) { osync_change_set_uid(change, newuid); - g_free(newuid); + osync_free(newuid); } if (output) { Modified: trunk/opensync/data/opensync_data.c ============================================================================== --- trunk/opensync/data/opensync_data.c Mon Jan 12 23:22:19 2009 (r5127) +++ trunk/opensync/data/opensync_data.c Tue Jan 13 17:12:00 2009 (r5128) @@ -66,9 +66,9 @@ osync_objformat_unref(data->objformat); if (data->objtype) - g_free(data->objtype); + osync_free(data->objtype); - g_free(data); + osync_free(data); } } @@ -107,8 +107,8 @@ { osync_assert(data); if (data->objtype) - g_free(data->objtype); - data->objtype = g_strdup(objtype); + osync_free(data->objtype); + data->objtype = osync_strdup(objtype); } void osync_data_get_data(OSyncData *data, char **buffer, unsigned int *size) @@ -162,7 +162,7 @@ if (!data) return NULL; - data->objtype = g_strdup(source->objtype); + data->objtype = osync_strdup(source->objtype); if (source->data) { if (!osync_objformat_copy(source->objformat, source->data, source->size, &buffer, &size, error)) { Modified: trunk/opensync/db/opensync_db.c ============================================================================== --- trunk/opensync/db/opensync_db.c Mon Jan 12 23:22:19 2009 (r5127) +++ trunk/opensync/db/opensync_db.c Tue Jan 13 17:12:00 2009 (r5128) @@ -149,7 +149,7 @@ OSyncList *row = NULL; for (i=0; i < numcolumns; i++) /* speed up - prepend instead of append */ - row = osync_list_prepend(row, g_strdup(result[column_count++])); + row = osync_list_prepend(row, osync_strdup(result[column_count++])); /* items got prepended, reverse the list again */ row = osync_list_reverse(row); @@ -172,7 +172,7 @@ osync_trace(TRACE_ENTRY, "%s(%p)", __func__, list); for (row = list; row; row = row->next) { - osync_list_foreach((OSyncList *) row->data, (GFunc) g_free, NULL); + osync_list_foreach((OSyncList *) row->data, (GFunc) osync_free, NULL); osync_list_free((OSyncList *) row->data); } @@ -202,7 +202,7 @@ return NULL; } - result = g_strdup((const char *)sqlite3_column_text(ppStmt, 0)); + result = osync_strdup((const char *)sqlite3_column_text(ppStmt, 0)); if (sqlite3_step(ppStmt) == SQLITE_ROW) { osync_error_set(error, OSYNC_ERROR_GENERIC, "Returned more than one result! This function only handle a single string!"); @@ -215,7 +215,7 @@ return result; error: - g_free(result); + osync_free(result); sqlite3_finalize(ppStmt); osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); return NULL; @@ -268,17 +268,17 @@ osync_assert(db); osync_assert(tablename); - query = g_strdup_printf("DELETE FROM %s", tablename); + query = osync_strdup_printf("DELETE FROM %s", tablename); if (!osync_db_query(db, query, error)) goto error; - g_free(query); + osync_free(query); osync_trace(TRACE_EXIT, "%s", __func__); return TRUE; error: - g_free(query); + osync_free(query); osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); return FALSE; } @@ -291,7 +291,7 @@ osync_assert(db); - query = g_strdup("SELECT name FROM (SELECT * FROM sqlite_master) WHERE type='table'"); + query = osync_strdup("SELECT name FROM (SELECT * FROM sqlite_master) WHERE type='table'"); if (sqlite3_prepare(db->sqlite3db, query, -1, &ppStmt, NULL) != SQLITE_OK) { osync_error_set(error, OSYNC_ERROR_GENERIC, "Query Error: %s", sqlite3_errmsg(db->sqlite3db)); @@ -346,12 +346,12 @@ osync_assert(db); osync_assert(tablename); - query = g_strdup_printf("SELECT name FROM (SELECT * FROM sqlite_master UNION ALL SELECT * FROM sqlite_temp_master) WHERE type='table' AND name='%s'", + query = osync_strdup_printf("SELECT name FROM (SELECT * FROM sqlite_master UNION ALL SELECT * FROM sqlite_temp_master) WHERE type='table' AND name='%s'", tablename); if (sqlite3_prepare(db->sqlite3db, query, -1, &ppStmt, NULL) != SQLITE_OK) { sqlite3_finalize(ppStmt); - g_free(query); + osync_free(query); osync_error_set(error, OSYNC_ERROR_GENERIC, "Query Error: %s", sqlite3_errmsg(db->sqlite3db)); osync_trace(TRACE_EXIT_ERROR, "Database query error: %s", sqlite3_errmsg(db->sqlite3db)); @@ -361,14 +361,14 @@ if (sqlite3_step(ppStmt) != SQLITE_ROW) { sqlite3_finalize(ppStmt); - g_free(query); + osync_free(query); osync_trace(TRACE_EXIT, "%s: table \"%s\" doesn't exist.", __func__, tablename); return 0; } sqlite3_finalize(ppStmt); - g_free(query); + osync_free(query); osync_trace(TRACE_EXIT, "%s: table \"%s\" exists.", __func__, tablename); return 1; Modified: trunk/opensync/engine/opensync_engine.c ============================================================================== --- trunk/opensync/engine/opensync_engine.c Mon Jan 12 23:22:19 2009 (r5127) +++ trunk/opensync/engine/opensync_engine.c Tue Jan 13 17:12:00 2009 (r5128) @@ -116,7 +116,7 @@ osync_assert(engine); osync_assert(proxy); - ret = g_list_index(engine->proxies, proxy); + ret = osync_list_index(engine->proxies, proxy); osync_assert(ret >= 0); @@ -137,7 +137,7 @@ osync_assert(engine); osync_assert(objengine); - ret = g_list_index(engine->object_engines, objengine); + ret = osync_list_index(engine->object_engines, objengine); osync_assert(ret >= 0); @@ -150,7 +150,7 @@ return; osync_trace(TRACE_INTERNAL, "Setting internal format of %s to %p:%s", objtype, format, osync_objformat_get_name(format)); - g_hash_table_insert(engine->internalFormats, g_strdup(objtype), g_strdup(osync_objformat_get_name(format))); + g_hash_table_insert(engine->internalFormats, osync_strdup(objtype), osync_strdup(osync_objformat_get_name(format))); } static OSyncFormatConverterPath *_osync_engine_get_converter_path(OSyncEngine *engine, const char *member_objtype) @@ -164,7 +164,7 @@ osync_trace(TRACE_INTERNAL, "Setting converter_path of %s to %p", member_objtype, converter_path); if (!converter_path) return; - g_hash_table_insert(engine->converterPathes, g_strdup(member_objtype), converter_path); + g_hash_table_insert(engine->converterPathes, osync_strdup(member_objtype), converter_path); } static void _osync_engine_converter_path_unref(gpointer data) { @@ -213,7 +213,7 @@ objtype = osync_objformat_get_objtype(detected_format); } - member_objtype = g_strdup_printf("%lli_%s", memberid, objtype); + member_objtype = osync_strdup_printf("%lli_%s", memberid, objtype); /* Convert the format to the internal format */ internalFormat = _osync_engine_get_internal_format(engine, objtype); @@ -311,7 +311,7 @@ } /* Search for the correct objengine */ - {GList * o = NULL; + {OSyncList * o = NULL; for (o = engine->object_engines; o; o = o->next) { OSyncObjEngine *objengine = o->data; if (!strcmp(osync_change_get_objtype(change), osync_obj_engine_get_objtype(objengine))) { @@ -327,13 +327,13 @@ goto error; } - g_free(member_objtype); + osync_free(member_objtype); osync_trace(TRACE_EXIT, "%s", __func__); return; error: - g_free(member_objtype); + osync_free(member_objtype); osync_engine_set_error(engine, error); osync_status_update_member(engine, osync_client_proxy_get_member(proxy), OSYNC_CLIENT_EVENT_ERROR, NULL, error); @@ -354,7 +354,7 @@ osync_trace(TRACE_INTERNAL, "Dispatching %p: %i", command, command->cmd); osync_engine_command(engine, command); - g_free(command); + osync_free(command); } osync_trace(TRACE_EXIT, "%s: Done dispatching", __func__); @@ -463,9 +463,9 @@ if (!g_thread_supported ()) g_thread_init (NULL); - engine->internalFormats = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); - engine->internalSchemas = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); - engine->converterPathes = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, _osync_engine_converter_path_unref); + engine->internalFormats = g_hash_table_new_full(g_str_hash, g_str_equal, osync_free, osync_free); + engine->internalSchemas = g_hash_table_new_full(g_str_hash, g_str_equal, osync_free, NULL); + engine->converterPathes = g_hash_table_new_full(g_str_hash, g_str_equal, osync_free, _osync_engine_converter_path_unref); engine->context = g_main_context_new(); engine->thread = osync_thread_new(engine->context, error); @@ -480,15 +480,17 @@ if (!osync_group_get_configdir(group)) { osync_trace(TRACE_INTERNAL, "No config dir found. Making stateless sync"); } else { - char *filename = g_strdup_printf("%s%carchive.db", osync_group_get_configdir(group), G_DIR_SEPARATOR); + char *filename = osync_strdup_printf("%s%carchive.db", osync_group_get_configdir(group), G_DIR_SEPARATOR); engine->archive = osync_archive_new(filename, error); - g_free(filename); + osync_free(filename); if (!engine->archive) goto error_free_engine; } /* Now we attach a queue to the engine which handles our commands */ - engine->command_functions = g_malloc0(sizeof(GSourceFuncs)); + engine->command_functions = osync_try_malloc0(sizeof(GSourceFuncs), error); + if (!engine->command_functions) + goto error_free_engine; engine->command_functions->prepare = _command_prepare; engine->command_functions->check = _command_check; engine->command_functions->dispatch = _command_dispatch; @@ -505,15 +507,15 @@ g_source_attach(engine->command_source, engine->context); g_main_context_ref(engine->context); - enginesdir = g_strdup_printf("%s%cengines", osync_group_get_configdir(group), G_DIR_SEPARATOR); - engine->engine_path = g_strdup_printf("%s%cenginepipe", enginesdir, G_DIR_SEPARATOR); + enginesdir = osync_strdup_printf("%s%cengines", osync_group_get_configdir(group), G_DIR_SEPARATOR); + engine->engine_path = osync_strdup_printf("%s%cenginepipe", enginesdir, G_DIR_SEPARATOR); if (g_mkdir_with_parents(enginesdir, 0755) < 0) { osync_error_set(error, OSYNC_ERROR_GENERIC, "Couldn't create engines directory: %s", g_strerror(errno)); - g_free(enginesdir); + osync_free(enginesdir); goto error_free_engine; } - g_free(enginesdir); + osync_free(enginesdir); engine->syncing_mutex = g_mutex_new(); engine->syncing = g_cond_new(); @@ -550,7 +552,7 @@ while (engine->object_engines) { OSyncObjEngine *objengine = engine->object_engines->data; osync_obj_engine_unref(objengine); - engine->object_engines = g_list_remove(engine->object_engines, engine->object_engines->data); + engine->object_engines = osync_list_remove(engine->object_engines, engine->object_engines->data); } if (engine->internalFormats) @@ -563,13 +565,13 @@ osync_group_unref(engine->group); if (engine->engine_path) - g_free(engine->engine_path); + osync_free(engine->engine_path); if (engine->plugin_dir) - g_free(engine->plugin_dir); + osync_free(engine->plugin_dir); if (engine->format_dir) - g_free(engine->format_dir); + osync_free(engine->format_dir); if (engine->thread) osync_thread_unref(engine->thread); @@ -596,7 +598,7 @@ g_source_unref(engine->command_source); if (engine->command_functions) - g_free(engine->command_functions); + osync_free(engine->command_functions); if (engine->archive) osync_archive_unref(engine->archive); @@ -609,10 +611,10 @@ #ifdef OPENSYNC_UNITTESTS if (engine->schema_dir) - g_free(engine->schema_dir); + osync_free(engine->schema_dir); #endif /* OPENSYNC_UNITTESTS */ - g_free(engine); + osync_free(engine); osync_trace(TRACE_EXIT, "%s", __func__); } } @@ -621,8 +623,8 @@ { osync_assert(engine); if (engine->plugin_dir) - g_free(engine->plugin_dir); - engine->plugin_dir = g_strdup(dir); + osync_free(engine->plugin_dir); + engine->plugin_dir = osync_strdup(dir); } OSyncGroup *osync_engine_get_group(OSyncEngine *engine) @@ -641,8 +643,8 @@ { osync_assert(engine); if (engine->format_dir) - g_free(engine->format_dir); - engine->format_dir = g_strdup(dir); + osync_free(engine->format_dir); + engine->format_dir = osync_strdup(dir); } static osync_bool _osync_engine_start(OSyncEngine *engine, OSyncError **error) @@ -700,7 +702,7 @@ if (!osync_client_proxy_shutdown(proxy, error)) goto error; - engine->proxies = g_list_remove(engine->proxies, proxy); + engine->proxies = osync_list_remove(engine->proxies, proxy); osync_client_proxy_unref(proxy); @@ -767,7 +769,7 @@ //FIXME while (engine->busy) { g_usleep(100); } - engine->proxies = g_list_append(engine->proxies, proxy); + engine->proxies = osync_list_append(engine->proxies, proxy); if (engine->error) { _osync_engine_finalize_member(engine, proxy, NULL); @@ -794,11 +796,11 @@ { OSyncError *locerror = NULL; - if (osync_bitcount(engine->proxy_errors | engine->proxy_connects) != g_list_length(engine->proxies)) + if (osync_bitcount(engine->proxy_errors | engine->proxy_connects) != osync_list_length(engine->proxies)) return FALSE; - if (osync_bitcount(engine->obj_errors | engine->obj_connects) == g_list_length(engine->object_engines)) { - if (osync_bitcount(engine->obj_errors) == g_list_length(engine->object_engines)) { + if (osync_bitcount(engine->obj_errors | engine->obj_connects) == osync_list_length(engine->object_engines)) { + if (osync_bitcount(engine->obj_errors) == osync_list_length(engine->object_engines)) { osync_error_set(&locerror, OSYNC_ERROR_GENERIC, "No objtypes left without error. Aborting"); osync_trace(TRACE_ERROR, "%s", osync_error_print(&locerror)); osync_engine_set_error(engine, locerror); @@ -825,10 +827,10 @@ static void _osync_engine_generate_connect_done_event(OSyncEngine *engine) { - if (osync_bitcount(engine->proxy_errors | engine->proxy_connect_done) != g_list_length(engine->proxies)) + if (osync_bitcount(engine->proxy_errors | engine->proxy_connect_done) != osync_list_length(engine->proxies)) return; - if (osync_bitcount(engine->obj_errors | engine->obj_connect_done) == g_list_length(engine->object_engines)) { + if (osync_bitcount(engine->obj_errors | engine->obj_connect_done) == osync_list_length(engine->object_engines)) { if (osync_bitcount(engine->obj_errors)) { OSyncError *locerror = NULL; osync_error_set(&locerror, OSYNC_ERROR_GENERIC, "At least one object engine failed within connect_done. Aborting"); @@ -845,12 +847,12 @@ osync_bool osync_engine_check_get_changes(OSyncEngine *engine) { - if (osync_bitcount(engine->proxy_errors | engine->proxy_get_changes) != g_list_length(engine->proxies)) { - osync_trace(TRACE_INTERNAL, "Not yet. main sinks still need to read: %i", osync_bitcount(engine->proxy_errors | engine->proxy_get_changes), g_list_length(engine->proxies)); + if (osync_bitcount(engine->proxy_errors | engine->proxy_get_changes) != osync_list_length(engine->proxies)) { + osync_trace(TRACE_INTERNAL, "Not yet. main sinks still need to read: %i", osync_bitcount(engine->proxy_errors | engine->proxy_get_changes), osync_list_length(engine->proxies)); return FALSE; } - if (osync_bitcount(engine->obj_errors | engine->obj_get_changes) == g_list_length(engine->object_engines)) + if (osync_bitcount(engine->obj_errors | engine->obj_get_changes) == osync_list_length(engine->object_engines)) return TRUE; osync_trace(TRACE_INTERNAL, "Not yet. Obj Engines still need to read: %i", osync_bitcount(engine->obj_errors | engine->obj_get_changes)); @@ -879,7 +881,7 @@ static void _osync_engine_generate_prepared_map(OSyncEngine *engine) { - if (osync_bitcount(engine->obj_errors | engine->obj_prepared_map) == g_list_length(engine->object_engines)) { + if (osync_bitcount(engine->obj_errors | engine->obj_prepared_map) == osync_list_length(engine->object_engines)) { if (osync_bitcount(engine->obj_errors)) { OSyncError *locerror = NULL; osync_error_set(&locerror, OSYNC_ERROR_GENERIC, "At least one object engine failed while preparing for mapping the changes. Aborting"); @@ -901,7 +903,7 @@ static void _osync_engine_generate_mapped_event(OSyncEngine *engine) { - if (osync_bitcount(engine->obj_errors | engine->obj_mapped) == g_list_length(engine->object_engines)) { + if (osync_bitcount(engine->obj_errors | engine->obj_mapped) == osync_list_length(engine->object_engines)) { if (osync_bitcount(engine->obj_errors)) { OSyncError *locerror = NULL; osync_error_set(&locerror, OSYNC_ERROR_GENERIC, "At least one object engine failed while mapping changes. Aborting"); @@ -925,7 +927,7 @@ static void _osync_engine_generate_end_conflicts_event(OSyncEngine *engine) { - if (osync_bitcount(engine->obj_errors | engine->obj_solved) == g_list_length(engine->object_engines)) { + if (osync_bitcount(engine->obj_errors | engine->obj_solved) == osync_list_length(engine->object_engines)) { if (osync_bitcount(engine->obj_errors)) { OSyncError *locerror = NULL; osync_error_set(&locerror, OSYNC_ERROR_GENERIC, "At least one object engine failed while solving conflicts. Aborting"); @@ -948,7 +950,7 @@ void osync_engine_trace_multiply_summary(OSyncEngine *engine) { - GList *o, *s; + OSyncList *o, *s; OSyncList *e; unsigned int added, modified, deleted, unmodified, unknown; long long int memberid; @@ -1010,7 +1012,7 @@ static void _osync_engine_generate_multiplied_event(OSyncEngine *engine) { - if (osync_bitcount(engine->obj_errors | engine->obj_multiplied) == g_list_length(engine->object_engines)) { + if (osync_bitcount(engine->obj_errors | engine->obj_multiplied) == osync_list_length(engine->object_engines)) { if (osync_bitcount(engine->obj_errors)) { OSyncError *locerror = NULL; osync_error_set(&locerror, OSYNC_ERROR_GENERIC, "At least one object engine failed while multiplying changes. Aborting"); @@ -1036,7 +1038,7 @@ static void _osync_engine_generate_prepared_write_event(OSyncEngine *engine) { - if (osync_bitcount(engine->obj_errors | engine->obj_prepared_write) == g_list_length(engine->object_engines)) { + if (osync_bitcount(engine->obj_errors | engine->obj_prepared_write) == osync_list_length(engine->object_engines)) { if (osync_bitcount(engine->obj_errors)) { OSyncError *locerror = NULL; osync_error_set(&locerror, OSYNC_ERROR_GENERIC, "At least one object engine failed while preparing the write event. Aborting"); @@ -1057,10 +1059,10 @@ static void _osync_engine_generate_written_event(OSyncEngine *engine) { - if (osync_bitcount(engine->proxy_errors | engine->proxy_written) != g_list_length(engine->proxies)) + if (osync_bitcount(engine->proxy_errors | engine->proxy_written) != osync_list_length(engine->proxies)) return; - if (osync_bitcount(engine->obj_errors | engine->obj_written) == g_list_length(engine->object_engines)) { + if (osync_bitcount(engine->obj_errors | engine->obj_written) == osync_list_length(engine->object_engines)) { if (osync_bitcount(engine->obj_errors)) { OSyncError *locerror = NULL; osync_error_set(&locerror, OSYNC_ERROR_GENERIC, "At least one object engine failed while writting changes. Aborting"); @@ -1080,10 +1082,10 @@ static void _osync_engine_generate_sync_done_event(OSyncEngine *engine) { - if (osync_bitcount(engine->proxy_errors | engine->proxy_sync_done) != g_list_length(engine->proxies)) + if (osync_bitcount(engine->proxy_errors | engine->proxy_sync_done) != osync_list_length(engine->proxies)) return; - if (osync_bitcount(engine->obj_errors | engine->obj_sync_done) == g_list_length(engine->object_engines)) { + if (osync_bitcount(engine->obj_errors | engine->obj_sync_done) == osync_list_length(engine->object_engines)) { if (osync_bitcount(engine->obj_errors)) { OSyncError *locerror = NULL; osync_error_set(&locerror, OSYNC_ERROR_GENERIC, "At least one object engine failed within sync_done. Aborting"); @@ -1101,10 +1103,10 @@ static osync_bool _osync_engine_generate_disconnected_event(OSyncEngine *engine) { - if (osync_bitcount(engine->proxy_errors | engine->proxy_disconnects) != g_list_length(engine->proxies)) + if (osync_bitcount(engine->proxy_errors | engine->proxy_disconnects) != osync_list_length(engine->proxies)) return FALSE; - if (osync_bitcount(engine->obj_errors | engine->obj_disconnects) == g_list_length(engine->object_engines)) { + if (osync_bitcount(engine->obj_errors | engine->obj_disconnects) == osync_list_length(engine->object_engines)) { /* Error handling in this case is quite special. We have to call OSYNC_ENGINE_EVENT_DISCONNECTED, even on errors. Since OSYNC_ENGINE_EVENT_ERROR would emit this DISCONNECTED event again - deadlock! */ @@ -1119,7 +1121,7 @@ static void _osync_engine_connect_callback(OSyncClientProxy *proxy, void *userdata, osync_bool slowsync, OSyncError *error) { - GList *o = NULL; + OSyncList *o = NULL; OSyncEngine *engine = NULL; int position = 0; @@ -1502,7 +1504,7 @@ goto error; osync_obj_engine_set_callback(objengine, _osync_engine_event_callback, engine); - engine->object_engines = g_list_append(engine->object_engines, objengine); + engine->object_engines = osync_list_append(engine->object_engines, objengine); /* If previous sync was unclean, then trigger SlowSync for all ObjEngines. * Also trigger SlowSync if this is the first synchronization. */ @@ -1538,7 +1540,7 @@ while (engine->object_engines) { OSyncObjEngine *objengine = engine->object_engines->data; osync_obj_engine_unref(objengine); - engine->object_engines = g_list_remove(engine->object_engines, engine->object_engines->data); + engine->object_engines = osync_list_remove(engine->object_engines, engine->object_engines->data); } while (engine->proxies) { @@ -1578,8 +1580,8 @@ void osync_engine_command(OSyncEngine *engine, OSyncEngineCommand *command) { - GList *o = NULL; - GList *p = NULL; + OSyncList *o = NULL; + OSyncList *p = NULL; OSyncError *locerror = NULL; OSyncClientProxy *proxy = NULL; @@ -1712,7 +1714,7 @@ void osync_engine_event(OSyncEngine *engine, OSyncEngineEvent event) { - GList *o = NULL; + OSyncList *o = NULL; OSyncError *locerror = NULL; osync_trace(TRACE_ENTRY, "%s(%p, %s)", __func__, engine, osync_engine_get_eventstr(event)); @@ -1962,7 +1964,7 @@ if (engine->error) { char *msg = osync_error_print_stack(&(engine->error)); osync_trace(TRACE_ERROR, "error while synchronizing: %s", msg); - g_free(msg); + osync_free(msg); osync_error_set_from_error(error, &(engine->error)); goto error; } @@ -2074,18 +2076,18 @@ unsigned int osync_engine_num_proxies(OSyncEngine *engine) { osync_return_val_if_fail(engine, 0); - return g_list_length(engine->proxies); + return osync_list_length(engine->proxies); } OSyncClientProxy *osync_engine_nth_proxy(OSyncEngine *engine, unsigned int nth) { osync_return_val_if_fail(engine, NULL); - return g_list_nth_data(engine->proxies, nth); + return osync_list_nth_data(engine->proxies, nth); } OSyncClientProxy *osync_engine_find_proxy(OSyncEngine *engine, OSyncMember *member) { - GList *p = NULL; + OSyncList *p = NULL; OSyncClientProxy *proxy = NULL; osync_return_val_if_fail(engine, NULL); @@ -2102,18 +2104,18 @@ unsigned int osync_engine_num_objengines(OSyncEngine *engine) { osync_return_val_if_fail(engine, 0); - return g_list_length(engine->object_engines); + return osync_list_length(engine->object_engines); } OSyncObjEngine *osync_engine_nth_objengine(OSyncEngine *engine, unsigned int nth) { osync_return_val_if_fail(engine, NULL); - return g_list_nth_data(engine->object_engines, nth); + return osync_list_nth_data(engine->object_engines, nth); } OSyncObjEngine *osync_engine_find_objengine(OSyncEngine *engine, const char *objtype) { - GList *p = NULL; + OSyncList *p = NULL; OSyncObjEngine *objengine = NULL; osync_return_val_if_fail(engine, NULL); @@ -2190,7 +2192,7 @@ /* ...and flush all pending commands. To make sure the abort command will be the next and last command. */ while ((pending_command = g_async_queue_try_pop_unlocked(engine->command_queue))) - g_free(pending_command); + osync_free(pending_command); /* Push the abort command on the empty queue. */ g_async_queue_push_unlocked(engine->command_queue, cmd); @@ -2366,9 +2368,9 @@ osync_assert(schema_dir); if (engine->schema_dir) - g_free(engine->schema_dir); + osync_free(engine->schema_dir); - engine->schema_dir = g_strdup(schema_dir); + engine->schema_dir = osync_strdup(schema_dir); } #endif /* OPENSYNC_UNITTESTS */ Modified: trunk/opensync/engine/opensync_engine_private.h ============================================================================== --- trunk/opensync/engine/opensync_engine_private.h Mon Jan 12 23:22:19 2009 (r5127) +++ trunk/opensync/engine/opensync_engine_private.h Tue Jan 13 17:12:00 2009 (r5128) @@ -95,10 +95,10 @@ GMutex* started_mutex; /** proxies contains a list of all OSyncClientProxy objects **/ - GList *proxies; + OSyncList *proxies; /** object_engines contains a list of all OSyncObjEngine objects **/ - GList *object_engines; + OSyncList *object_engines; osync_bool man_dispatch; osync_bool allow_sync_alert; Modified: trunk/opensync/engine/opensync_mapping_engine.c ============================================================================== --- trunk/opensync/engine/opensync_mapping_engine.c Mon Jan 12 23:22:19 2009 (r5127) +++ trunk/opensync/engine/opensync_mapping_engine.c Tue Jan 13 17:12:00 2009 (r5128) @@ -49,7 +49,7 @@ OSyncMappingEngine *osync_mapping_engine_new(OSyncObjEngine *parent, OSyncMapping *mapping, OSyncError **error) { OSyncMappingEngine *engine = NULL; - GList *s = NULL; + OSyncList *s = NULL; osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, parent, mapping, error); osync_assert(parent); @@ -83,7 +83,7 @@ if (!entry_engine) goto error_free_engine; - engine->entries = g_list_append(engine->entries, entry_engine); + engine->entries = osync_list_append(engine->entries, entry_engine); } osync_trace(TRACE_EXIT, "%s: %p", __func__, engine); @@ -120,16 +120,16 @@ OSyncMappingEntryEngine *entry = engine->entries->data; osync_entry_engine_unref(entry); - engine->entries = g_list_remove(engine->entries, engine->entries->data); + engine->entries = osync_list_remove(engine->entries, engine->entries->data); } - g_free(engine); + osync_free(engine); } } static OSyncMappingEntryEngine *_osync_mapping_engine_find_entry(OSyncMappingEngine *engine, OSyncChange *change) { - GList *e; + OSyncList *e; for (e = engine->entries; e; e = e->next) { OSyncMappingEntryEngine *entry = e->data; if (change && entry->change == change) @@ -223,7 +223,7 @@ { OSyncObjEngine *parent = NULL; osync_bool ignore_supported = TRUE; - GList *s = NULL; + OSyncList *s = NULL; osync_trace(TRACE_ENTRY, "%s(%p)", __func__, engine); osync_assert(engine); @@ -267,7 +267,7 @@ osync_bool osync_mapping_engine_multiply(OSyncMappingEngine *engine, OSyncError **error) { - GList *e = NULL; + OSyncList *e = NULL; osync_assert(engine); osync_assert(engine->mapping); @@ -426,7 +426,7 @@ osync_bool osync_mapping_engine_check_conflict(OSyncMappingEngine *engine) { int is_same = 0; - GList *e = NULL; + OSyncList *e = NULL; osync_trace(TRACE_ENTRY, "%s(%p)", __func__, engine); osync_assert(engine != NULL); @@ -446,7 +446,7 @@ OSyncChange *leftchange = osync_entry_engine_get_change(leftentry); OSyncChange *rightchange = NULL; - GList *n = NULL; + OSyncList *n = NULL; osync_trace(TRACE_INTERNAL, "change: %p: %i", leftchange, leftchange ? osync_change_get_changetype(leftchange) : OSYNC_CHANGE_TYPE_UNKNOWN); if (leftchange == NULL) continue; @@ -485,7 +485,7 @@ if (engine->conflict) { //conflict, solve conflict osync_trace(TRACE_INTERNAL, "Got conflict for mapping_engine %p", engine); - engine->parent->conflicts = g_list_append(engine->parent->conflicts, engine); + engine->parent->conflicts = osync_list_append(engine->parent->conflicts, engine); if (!osync_status_conflict(engine->parent->parent, engine)) goto error; @@ -496,8 +496,8 @@ osync_assert(engine->master); osync_status_update_mapping(engine->parent->parent, engine, OSYNC_MAPPING_EVENT_SOLVED, NULL); - if (is_same == prod(g_list_length(engine->entries) - 1)) { - GList *e = NULL; + if (is_same == prod(osync_list_length(engine->entries) - 1)) { + OSyncList *e = NULL; osync_trace(TRACE_INTERNAL, "No need to sync. All entries are the same"); for (e = engine->entries; e; e = e->next) { OSyncMappingEntryEngine *entry = e->data; @@ -518,7 +518,7 @@ OSyncMappingEntryEngine *osync_mapping_engine_get_entry(OSyncMappingEngine *engine, OSyncSinkEngine *sinkengine) { - GList *e = NULL; + OSyncList *e = NULL; for (e = engine->entries; e; e = e->next) { OSyncMappingEntryEngine *entry_engine = e->data; if (sinkengine == entry_engine->sink_engine) @@ -533,7 +533,7 @@ int osync_mapping_engine_num_changes(OSyncMappingEngine *engine) { int num = 0; - GList *e = NULL; + OSyncList *e = NULL; osync_assert(engine); for (e = engine->entries; e; e = e->next) { OSyncMappingEntryEngine *entry = e->data; @@ -547,7 +547,7 @@ OSyncChange *osync_mapping_engine_nth_change(OSyncMappingEngine *engine, int nth) { int num = 0; - GList *e = NULL; + OSyncList *e = NULL; osync_assert(engine); for (e = engine->entries; e; e = e->next) { OSyncMappingEntryEngine *entry = e->data; @@ -563,7 +563,7 @@ OSyncChange *osync_mapping_engine_member_change(OSyncMappingEngine *engine, int memberid) { - GList *e = NULL; + OSyncList *e = NULL; osync_assert(engine); for (e = engine->entries; e; e = e->next) { OSyncMappingEntryEngine *entry = e->data; @@ -585,7 +585,7 @@ engine->conflict = FALSE; osync_mapping_engine_set_master(engine, entry); osync_status_update_mapping(engine->parent->parent, engine, OSYNC_MAPPING_EVENT_SOLVED, NULL); - engine->parent->conflicts = g_list_remove(engine->parent->conflicts, engine); + engine->parent->conflicts = osync_list_remove(engine->parent->conflicts, engine); if (!osync_obj_engine_command(engine->parent, OSYNC_ENGINE_COMMAND_END_CONFLICTS, error)) goto error; @@ -604,7 +604,7 @@ OSyncArchive *archive = NULL; char *objtype = NULL; long long int id = 0; - GList *c = NULL; + OSyncList *c = NULL; osync_trace(TRACE_ENTRY, "%s(%p, %p)", __func__, engine, error); engine->conflict = FALSE; @@ -621,7 +621,7 @@ } osync_status_update_mapping(engine->parent->parent, engine, OSYNC_MAPPING_EVENT_SOLVED, NULL); - engine->parent->conflicts = g_list_remove(engine->parent->conflicts, engine); + engine->parent->conflicts = osync_list_remove(engine->parent->conflicts, engine); if (!osync_obj_engine_command(engine->parent, OSYNC_ENGINE_COMMAND_END_CONFLICTS, error)) goto error; @@ -648,7 +648,7 @@ engine->conflict = FALSE; osync_status_update_mapping(engine->parent->parent, engine, OSYNC_MAPPING_EVENT_SOLVED, NULL); - engine->parent->conflicts = g_list_remove(engine->parent->conflicts, engine); + engine->parent->conflicts = osync_list_remove(engine->parent->conflicts, engine); if (!osync_obj_engine_command(engine->parent, OSYNC_ENGINE_COMMAND_END_CONFLICTS, error)) goto error; @@ -675,7 +675,7 @@ { int elevation = 0; OSyncObjEngine *objengine = NULL; - GList *entries = NULL, *e = NULL, *mappings = NULL; + OSyncList *entries = NULL, *e = NULL, *mappings = NULL; osync_trace(TRACE_ENTRY, "%s(%p, %p)", __func__, existingMapping, error); g_assert(existingMapping); @@ -690,7 +690,7 @@ if (osync_change_get_changetype(entry->change) == OSYNC_CHANGE_TYPE_MODIFIED || osync_change_get_changetype(entry->change) == OSYNC_CHANGE_TYPE_ADDED) { osync_trace(TRACE_INTERNAL, "Appending entry %s, changetype %i from member %lli", osync_change_get_uid(entry->change), osync_change_get_changetype(entry->change), osync_member_get_id(osync_client_proxy_get_member(entry->sink_engine->proxy))); - entries = g_list_append(entries, entry); + entries = osync_list_append(entries, entry); } else { osync_trace(TRACE_INTERNAL, "Removing entry %s, changetype %i from member %lli", osync_change_get_uid(entry->change), osync_change_get_changetype(entry->change), osync_member_get_id(osync_client_proxy_get_member(entry->sink_engine->proxy))); osync_entry_engine_update(entry, NULL); @@ -701,14 +701,14 @@ } /* Create a list with mappings. In the beginning, only the exisiting mapping is in the list */ - mappings = g_list_append(NULL, existingMapping); + mappings = osync_list_append(NULL, existingMapping); osync_mapping_engine_ref(existingMapping); while (entries) { OSyncMappingEntryEngine *existingEntry = entries->data; /* Now lets see which mapping is the correct one for the entry */ - GList *m = NULL; + OSyncList *m = NULL; OSyncMappingEngine *mapping = NULL; OSyncChange *existingChange = NULL; osync_bool dirty = FALSE; @@ -716,7 +716,7 @@ elevation = 0; for (m = mappings; m; m = m->next) { - GList *e = NULL; + OSyncList *e = NULL; OSyncChange *change = NULL; OSyncMappingEntryEngine *entry = NULL; mapping = m->data; @@ -751,8 +751,8 @@ mapping = _osync_obj_engine_create_mapping_engine(objengine, error); if (!mapping) goto error; - mappings = g_list_append(mappings, mapping); - objengine->mapping_engines = g_list_append(objengine->mapping_engines, mapping); + mappings = osync_list_append(mappings, mapping); + objengine->mapping_engines = osync_list_append(objengine->mapping_engines, mapping); osync_mapping_engine_ref(mapping); } @@ -775,17 +775,17 @@ * this information here */ newEntry->dirty = dirty; - entries = g_list_remove(entries, existingEntry); + entries = osync_list_remove(entries, existingEntry); } while (mappings) { OSyncMappingEngine *mapping = mappings->data; osync_mapping_engine_unref(mapping); - mappings = g_list_remove(mappings, mapping); + mappings = osync_list_remove(mappings, mapping); } - objengine->conflicts = g_list_remove(objengine->conflicts, existingMapping); + objengine->conflicts = osync_list_remove(objengine->conflicts, existingMapping); osync_status_update_mapping(objengine->parent, existingMapping, OSYNC_MAPPING_EVENT_SOLVED, NULL); if (!osync_obj_engine_command(objengine, OSYNC_ENGINE_COMMAND_END_CONFLICTS, error)) @@ -798,7 +798,7 @@ while (mappings) { OSyncMappingEngine *mapping = mappings->data; osync_mapping_engine_unref(mapping); - mappings = g_list_remove(mappings, mapping); + mappings = osync_list_remove(mappings, mapping); } osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); return FALSE; Modified: trunk/opensync/engine/opensync_mapping_engine_internals.h ============================================================================== --- trunk/opensync/engine/opensync_mapping_engine_internals.h Mon Jan 12 23:22:19 2009 (r5127) +++ trunk/opensync/engine/opensync_mapping_engine_internals.h Tue Jan 13 17:12:00 2009 (r5128) @@ -36,7 +36,7 @@ int ref_count; OSyncMapping *mapping; OSyncMappingEntryEngine *master; - GList *entries; /* OSyncMappingEntryEngine */ + OSyncList *entries; /* OSyncMappingEntryEngine */ OSyncObjEngine *parent; osync_bool conflict; osync_bool synced; Modified: trunk/opensync/engine/opensync_mapping_entry_engine.c ============================================================================== --- trunk/opensync/engine/opensync_mapping_entry_engine.c Mon Jan 12 23:22:19 2009 (r5127) +++ trunk/opensync/engine/opensync_mapping_entry_engine.c Tue Jan 13 17:12:00 2009 (r5128) @@ -95,7 +95,7 @@ if (engine->entry) osync_mapping_entry_unref(engine->entry); - g_free(engine); + osync_free(engine); } } @@ -218,7 +218,7 @@ osync_trace(TRACE_INTERNAL, "Starting to convert from objtype %s and format %s", osync_change_get_objtype(entry_engine->change), osync_objformat_get_name(osync_change_get_objformat(entry_engine->change))); /* We have to save the objtype of the change so that it does not get * overwritten by the conversion */ - objtype = g_strdup(osync_change_get_objtype(change)); + objtype = osync_strdup(osync_change_get_objtype(change)); /* Now we have to convert to one of the formats * that the client can understand */ @@ -256,14 +256,14 @@ *cachedpath = path; osync_change_set_objtype(change, objtype); - g_free(objtype); + osync_free(objtype); return TRUE; error_free_path: osync_converter_path_unref(path); error_free_objtype: - g_free(objtype); + osync_free(objtype); /*error:*/ return FALSE; } Modified: trunk/opensync/engine/opensync_obj_engine.c ============================================================================== --- trunk/opensync/engine/opensync_obj_engine.c Mon Jan 12 23:22:19 2009 (r5127) +++ trunk/opensync/engine/opensync_obj_engine.c Tue Jan 13 17:12:00 2009 (r5128) @@ -53,7 +53,7 @@ { /* If there is none, create one */ OSyncMapping *mapping = osync_mapping_new(error); - GList *s = NULL; + OSyncList *s = NULL; OSyncMappingEngine *mapping_engine = NULL; if (!mapping) goto error; @@ -198,10 +198,10 @@ * return value is MISMATCH if no mapping could be found, * SIMILAR if a mapping has been found but its not completely the same * SAME if a mapping has been found and is the same */ -static OSyncConvCmpResult _osync_obj_engine_mapping_find(GList *mapping_engines, OSyncChange *change, OSyncSinkEngine *sinkengine, OSyncMappingEngine **mapping_engine) +static OSyncConvCmpResult _osync_obj_engine_mapping_find(OSyncList *mapping_engines, OSyncChange *change, OSyncSinkEngine *sinkengine, OSyncMappingEngine **mapping_engine) { - GList *m = NULL; - GList *e = NULL; + OSyncList *m = NULL; + OSyncList *e = NULL; osync_bool found_similar = FALSE; OSyncConvCmpResult result = OSYNC_CONV_DATA_MISMATCH; osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %p)", __func__, mapping_engines, change, sinkengine, mapping_engine); @@ -251,8 +251,8 @@ osync_bool osync_obj_engine_map_changes(OSyncObjEngine *engine, OSyncError **error) { OSyncMappingEngine *mapping_engine = NULL; - GList *new_mappings = NULL, *v = NULL; - GList *unmapped_mappings = NULL; + OSyncList *new_mappings = NULL, *v = NULL; + OSyncList *unmapped_mappings = NULL; OSyncConvCmpResult result = 0; OSyncMappingEntryEngine *entry_engine = NULL; @@ -270,7 +270,7 @@ long long int memberid = osync_member_get_id(osync_client_proxy_get_member(sinkengine->proxy)); osync_trace(TRACE_INTERNAL, "Sinkengine of member %lli", memberid); - unmapped_mappings = g_list_copy(new_mappings); + unmapped_mappings = osync_list_copy(new_mappings); /* For each sinkengine, go through all unmapped changes */ while (sinkengine->unmapped) { @@ -288,12 +288,12 @@ osync_trace(TRACE_INTERNAL, "Unable to find mapping. Creating new mapping with id %lli", osync_mapping_get_id(mapping_engine->mapping)); /* TODO: what about _prepend (O(1)) instead of _append (O(n))? Order doesn't matter here - right? */ - new_mappings = g_list_append(new_mappings, mapping_engine); - unmapped_mappings = g_list_append(unmapped_mappings, mapping_engine); + new_mappings = osync_list_append(new_mappings, mapping_engine); + unmapped_mappings = osync_list_append(unmapped_mappings, mapping_engine); } else if (result == OSYNC_CONV_DATA_SIMILAR) { mapping_engine->conflict = TRUE; } else if (result == OSYNC_CONV_DATA_SAME) { - unmapped_mappings = g_list_remove(unmapped_mappings, mapping_engine); + unmapped_mappings = osync_list_remove(unmapped_mappings, mapping_engine); } /* Update the entry which belongs to our sinkengine with the the change */ entry_engine = osync_mapping_engine_get_entry(mapping_engine, sinkengine); @@ -304,11 +304,11 @@ osync_change_unref(change); } - g_list_free(unmapped_mappings); + osync_list_free(unmapped_mappings); } - engine->mapping_engines = g_list_concat(engine->mapping_engines, new_mappings); + engine->mapping_engines = osync_list_concat(engine->mapping_engines, new_mappings); //osync_trace_enable(); osync_trace(TRACE_EXIT, "%s", __func__); @@ -362,7 +362,7 @@ osync_bool osync_obj_engine_receive_change(OSyncObjEngine *objengine, OSyncClientProxy *proxy, OSyncChange *change, OSyncError **error) { OSyncSinkEngine *sinkengine = NULL; - GList *s = NULL; + OSyncList *s = NULL; OSyncList *e = NULL; osync_assert(objengine); @@ -422,7 +422,7 @@ static void _osync_obj_engine_generate_written_event(OSyncObjEngine *engine, OSyncError *error) { osync_bool dirty = FALSE; - GList *p = NULL; + OSyncList *p = NULL; OSyncList *e = NULL; OSyncSinkEngine *sinkengine = NULL; OSyncError *locerror = NULL; @@ -601,7 +601,7 @@ if (!mapping_engine) goto error; - engine->mapping_engines = g_list_append(engine->mapping_engines, mapping_engine); + engine->mapping_engines = osync_list_append(engine->mapping_engines, mapping_engine); } osync_trace(TRACE_EXIT, "%s", __func__); @@ -634,12 +634,12 @@ OSyncMapping *ignored_mapping = osync_mapping_table_find_mapping(engine->mapping_table, id); - GList *e; + OSyncList *e; for (e = engine->mapping_engines; e; e = e->next) { OSyncMappingEngine *mapping_engine = e->data; if (mapping_engine->mapping == ignored_mapping) { - GList *m; + OSyncList *m; for (m = mapping_engine->entries; m; m = m->next) { OSyncMappingEntryEngine *entry = m->data; OSyncChangeType changetype = (OSyncChangeType) t->data; @@ -693,7 +693,7 @@ * dependent on the engine anyways */ engine->parent = parent; - engine->objtype = g_strdup(objtype); + engine->objtype = osync_strdup(objtype); engine->formatenv = osync_format_env_ref(formatenv); engine->mapping_table = osync_mapping_table_new(error); @@ -730,21 +730,21 @@ OSyncSinkEngine *sinkengine = engine->sink_engines->data; osync_sink_engine_unref(sinkengine); - engine->sink_engines = g_list_remove(engine->sink_engines, sinkengine); + engine->sink_engines = osync_list_remove(engine->sink_engines, sinkengine); } while (engine->mapping_engines) { OSyncMappingEngine *mapping_engine = engine->mapping_engines->data; osync_mapping_engine_unref(mapping_engine); - engine->mapping_engines = g_list_remove(engine->mapping_engines, mapping_engine); + engine->mapping_engines = osync_list_remove(engine->mapping_engines, mapping_engine); } if (engine->error) osync_error_unref(&engine->error); if (engine->objtype) - g_free(engine->objtype); + osync_free(engine->objtype); if (engine->mapping_table) osync_mapping_table_unref(engine->mapping_table); @@ -752,13 +752,13 @@ if (engine->formatenv) osync_format_env_unref(engine->formatenv); - g_free(engine); + osync_free(engine); } } static int _osync_obj_engine_num_write_sinks(OSyncObjEngine *objengine) { int num = 0; - GList *p = NULL; + OSyncList *p = NULL; OSyncSinkEngine *sink; osync_trace(TRACE_ENTRY, "%s(%p)", __func__, objengine); @@ -814,7 +814,7 @@ engine->dummies++; } - engine->sink_engines = g_list_append(engine->sink_engines, sinkengine); + engine->sink_engines = osync_list_append(engine->sink_engines, sinkengine); } if (engine->archive && e... [truncated message content] |
From: <dg...@su...> - 2009-01-13 09:44:28
|
Author: bellmich Date: Tue Jan 13 10:43:33 2009 New Revision: 893 URL: http://libsyncml.opensync.org/changeset/893 Log: fixed copy&paste based typos Modified: trunk/RELEASE Modified: trunk/RELEASE ============================================================================== --- trunk/RELEASE Mon Jan 12 14:55:46 2009 (r892) +++ trunk/RELEASE Tue Jan 13 10:43:33 2009 (r893) @@ -33,10 +33,10 @@ you have to "svn up" and run the tests again - once the commit succeeds, you have to create a new tag with - "mkdir tags/libwbxml-$MAJOR.$MINJOR.$PATCH", - "tar -C trunk --exclude=\"\\.svn\" -cf - . | tar -C tags/libwbxml-$MAJOR.$MINJOR.$PATCH -xf -" - "svn add tags/libwbxml-$MAJOR.$MINJOR.$PATCH" and - "svn commit tags/libwbxml-$MAJOR.$MINJOR.$PATCH" + "mkdir tags/libsyncml-$MAJOR.$MINJOR.$PATCH", + "tar -C trunk --exclude=\"\\.svn\" -cf - . | tar -C tags/libsyncml-$MAJOR.$MINJOR.$PATCH -xf -" + "svn add tags/libsyncml-$MAJOR.$MINJOR.$PATCH" and + "svn commit tags/libsyncml-$MAJOR.$MINJOR.$PATCH" (NEVER use "svn cp" because you must replace the external entities of the trunk directory with hard copies of the actual state.) |
From: <dg...@su...> - 2009-01-12 22:49:34
|
Author: ianmartin Date: Mon Jan 12 23:22:19 2009 New Revision: 5127 URL: http://www.opensync.org/changeset/5127 Log: Use getopt_long for option parsing. Ticket #1015 Modified: osynctool/trunk/tools/osynctool.c Modified: osynctool/trunk/tools/osynctool.c ============================================================================== --- osynctool/trunk/tools/osynctool.c Mon Jan 12 21:50:26 2009 (r5126) +++ osynctool/trunk/tools/osynctool.c Mon Jan 12 23:22:19 2009 (r5127) @@ -36,6 +36,7 @@ #include <sys/types.h> #include <glib.h> #include <errno.h> +#include <getopt.h> #include "config.h" @@ -44,9 +45,16 @@ OSyncConflictResolution conflict = OSYNC_CONFLICT_RESOLUTION_UNKNOWN; int winner = 0; +static void short_usage(char *name, int ecode) +{ + fprintf (stderr, "Usage: %s ACTION [OPTIONS]..\n", name); + fprintf (stderr, "Try `%s --help' for more information\n", name); + exit(ecode); +} + static void usage (char *name, int ecode) { - fprintf (stderr, "Usage: %s\n", name); + fprintf (stderr, "Usage: %s ACTION [OPTIONS]..\n", name); fprintf (stderr, "Information about installation:\n"); fprintf (stderr, "--listplugins Lists all plugins\n"); fprintf (stderr, "--listformats Lists all formats\n"); @@ -104,21 +112,23 @@ fprintf (stderr, "Synchronization:\n"); fprintf (stderr, "--sync <groupname>\n"); fprintf (stderr, " Sync all members in a group\n"); - fprintf (stderr, "[--wait]\n"); - fprintf (stderr, " Wait for a client to initialize the sync instead of starting immediately\n"); - fprintf (stderr, "[--multi]\n"); - fprintf (stderr, " Repeat to wait for sync alerts\n"); - fprintf (stderr, "[--slow-sync <objtype>]\n"); - fprintf (stderr, " Perform a slow-sync of all members in the group\n"); - fprintf (stderr, "[--manual]\n"); - fprintf (stderr, " Make manual engine iterations. Only for debugging.\n"); - fprintf (stderr, "[--configdir]\n"); - fprintf (stderr, " Set a different configuration directory than ~/.opensync\n"); - fprintf (stderr, "[--conflict 1-9/d/i/n] \n"); - fprintf (stderr, " Resolve all conflicts as side [1-9] wins, [d]uplicate, [i]gnore, or\n"); - fprintf (stderr, " keep [n]ewer\n"); - fprintf (stderr, "[--always-accept-forecast]\n"); - fprintf (stderr, " Always accept the Synchronization Forecast\n"); + fprintf (stderr, "\n"); + fprintf (stderr, " Synchronization options:\n"); + fprintf (stderr, " [--wait]\n"); + fprintf (stderr, " Wait for a client to initialize the sync instead of starting immediately\n"); + fprintf (stderr, " [--multi]\n"); + fprintf (stderr, " Repeat to wait for sync alerts\n"); + fprintf (stderr, " [--slow-sync <objtype>]\n"); + fprintf (stderr, " Perform a slow-sync of all members in the group\n"); + fprintf (stderr, " [--manual]\n"); + fprintf (stderr, " Make manual engine iterations. Only for debugging.\n"); + fprintf (stderr, " [--configdir]\n"); + fprintf (stderr, " Set a different configuration directory than ~/.opensync\n"); + fprintf (stderr, " [--conflict 1-9/d/i/n] \n"); + fprintf (stderr, " Resolve all conflicts as side [1-9] wins, [d]uplicate, [i]gnore, or\n"); + fprintf (stderr, " keep [n]ewer\n"); + fprintf (stderr, " [--always-accept-forecast]\n"); + fprintf (stderr, " Always accept the Synchronization Forecast\n"); exit (ecode); } @@ -1375,273 +1385,164 @@ osync_trace(TRACE_ENTRY, "%s(%i, %p)", __func__, argc, argv); - if (argc == 1) - usage (argv[0], 1); - - for (i = 1; i < argc; i++) { - char *arg = argv[i]; - if (!strcmp (arg, "--listplugins")) { //Install options - if (action != NONE) - usage (argv[0], 1); - action = OSYNCTOOL_INSTALL_LISTPLUGINS; - } else if (!strcmp (arg, "--listformats")) { - if (action != NONE) - usage (argv[0], 1); - action = OSYNCTOOL_INSTALL_LISTFORMATS; - } else if (!strcmp (arg, "--version")) { - if (action != NONE) - usage (argv[0], 1); - action = OSYNCTOOL_INSTALL_GETVERSION; - } else if (!strcmp (arg, "--listgroups")) { //Group info - if (action != NONE) - usage (argv[0], 1); - action = OSYNCTOOL_SHOW_GROUPS; - } else if (!strcmp (arg, "--showgroup")) { - if (action != NONE) - usage (argv[0], 1); - action = OSYNCTOOL_SHOW_GROUP; - groupname = argv[i + 1]; - i++; - if (!groupname) - usage (argv[0], 1); - } else if (!strcmp (arg, "--showobjtypes")) { - if (action != NONE) - usage (argv[0], 1); - action = OSYNCTOOL_SHOW_OBJTYPES; - groupname = argv[i + 1]; - i++; - if (!groupname) - usage (argv[0], 1); - } else if (!strcmp (arg, "--showfilter")) { - if (action != NONE) - usage (argv[0], 1); - action = OSYNCTOOL_SHOW_FILTER; - groupname = argv[i + 1]; - i++; - if (!groupname) - usage (argv[0], 1); - } else if (!strcmp (arg, "--showcapabilities")) { - if (action != NONE) - usage (argv[0], 1); - action = OSYNCTOOL_SHOW_CAPABILITIES; - groupname = argv[i + 1]; - i++; - if (!groupname) - usage (argv[0], 1); - } else if (!strcmp (arg, "--addgroup")) { //configure options - if (action != NONE) - usage (argv[0], 1); - action = OSYNCTOOL_CONFIGURE_ADDGROUP; - groupname = argv[i + 1]; - i += 1; - if (!groupname) - usage (argv[0], 1); - } else if (!strcmp (arg, "--delgroup")) { - if (action != NONE) - usage (argv[0], 1); - action = OSYNCTOOL_CONFIGURE_DELGROUP; - groupname = argv[i + 1]; - i += 1; - if (!groupname) - usage (argv[0], 1); - } else if (!strcmp (arg, "--addmember")) { - if (action != NONE) - usage (argv[0], 1); - action = OSYNCTOOL_CONFIGURE_ADDMEMBER; - groupname = argv[i + 1]; - pluginname = argv[i + 2]; - i += 2; - if (!groupname || !pluginname) - usage (argv[0], 1); - - if (argc > i) { - membername = argv[i + 1]; - i += 1; - } - } else if (!strcmp (arg, "--configure")) { - if (action != NONE) - usage (argv[0], 1); - action = OSYNCTOOL_CONFIGURE; - groupname = argv[i + 1]; - membername = argv[i + 2]; - i += 2; - if (!groupname || !membername) - usage (argv[0], 1); - } else if (!strcmp (arg, "--delmember")) { - if (action != NONE) - usage (argv[0], 1); - action = OSYNCTOOL_CONFIGURE_DELMEMBER; - groupname = argv[i + 1]; - membername = argv[i + 2]; - i += 2; - if (!groupname || !membername) - usage (argv[0], 1); - } else if (!strcmp (arg, "--enable-objtype")) { - if (action != NONE) - usage (argv[0], 1); - action = OSYNCTOOL_CONFIGURE_ENABLE_OBJTYPE; - groupname = argv[i + 1]; - objtype = argv[i + 2]; - i += 2; - if (!groupname || !objtype) - usage (argv[0], 1); - } else if (!strcmp (arg, "--disable-objtype")) { - if (action != NONE) - usage (argv[0], 1); - action = OSYNCTOOL_CONFIGURE_DISABLE_OBJTYPE; - groupname = argv[i + 1]; - objtype = argv[i + 2]; - i += 2; - if (!groupname || !objtype) - usage (argv[0], 1); - } else if (!strcmp (arg, "--enable-merger")) { - if (action != NONE) - usage (argv[0], 1); - action = OSYNCTOOL_CONFIGURE_ENABLE_MERGER; - groupname = argv[i + 1]; - i += 1; - if (!groupname) - usage (argv[0], 1); - } else if (!strcmp (arg, "--disable-merger")) { - if (action != NONE) - usage (argv[0], 1); - action = OSYNCTOOL_CONFIGURE_DISABLE_MERGER; - groupname = argv[i + 1]; - i += 1; - if (!groupname) - usage (argv[0], 1); - } else if (!strcmp (arg, "--enable-converter")) { - if (action != NONE) - usage (argv[0], 1); - action = OSYNCTOOL_CONFIGURE_ENABLE_CONVERTER; - groupname = argv[i + 1]; - i += 1; - if (!groupname) - usage (argv[0], 1); - } else if (!strcmp (arg, "--disable-converter")) { - if (action != NONE) - usage (argv[0], 1); - action = OSYNCTOOL_CONFIGURE_DISABLE_CONVERTER; - groupname = argv[i + 1]; - i += 1; - if (!groupname) - usage (argv[0], 1); - } else if (!strcmp (arg, "--configure-filter")) { - if (action != NONE) - usage (argv[0], 1); - action = OSYNCTOOL_CONFIGURE_FILTER; - groupname = argv[i + 1]; - i += 1; - if (!groupname) - usage (argv[0], 1); - } else if (!strcmp (arg, "--configure-capabilities")) { - if (action != NONE) - usage (argv[0], 1); - action = OSYNCTOOL_CONFIGURE_CAPABILITIES; - groupname = argv[i + 1]; - membername = argv[i + 2]; - i += 2; - if (!groupname || !membername) - usage (argv[0], 1); - } else if (!strcmp (arg, "--disable-readonly")) { - if (action != NONE) - usage (argv[0], 1); - action = OSYNCTOOL_CONFIGURE_MEMBER_ENABLE_WRITE; - groupname = argv[i + 1]; - membername = argv[i + 2]; - i += 2; - if (!groupname || !membername) - usage (argv[0], 1); - - if (argc > i) { - objtype = argv[i + 1]; - i += 1; - } - } else if (!strcmp (arg, "--enable-readonly")) { - if (action != NONE) - usage (argv[0], 1); - action = OSYNCTOOL_CONFIGURE_MEMBER_DISABLE_WRITE; - groupname = argv[i + 1]; - membername = argv[i + 2]; - i += 2; - if (!groupname || !membername) - usage (argv[0], 1); - - if (argc > i) { - objtype = argv[i + 1]; - i += 1; + int c; + int option_index = 0; + int action_count = 0; + + struct option long_options[] = { + {"listplugins", no_argument, (int *)&action, OSYNCTOOL_INSTALL_LISTPLUGINS}, + {"listformats", no_argument, (int *)&action, OSYNCTOOL_INSTALL_LISTFORMATS}, + {"version", no_argument, (int *)&action, OSYNCTOOL_INSTALL_GETVERSION}, + {"listgroups", no_argument, (int *)&action, OSYNCTOOL_SHOW_GROUPS}, + {"showgroup", no_argument, (int *)&action, OSYNCTOOL_SHOW_GROUP}, + {"showobjtypes", no_argument, (int *)&action, OSYNCTOOL_SHOW_OBJTYPES}, + {"showfilter", no_argument, (int *)&action, OSYNCTOOL_SHOW_FILTER}, + {"showcapabilities", no_argument, (int *)&action, OSYNCTOOL_SHOW_CAPABILITIES}, + {"addgroup", no_argument, (int *)&action, OSYNCTOOL_CONFIGURE_ADDGROUP}, + {"delgroup", no_argument, (int *)&action, OSYNCTOOL_CONFIGURE_DELGROUP}, + {"enable-merger", no_argument, (int *)&action, OSYNCTOOL_CONFIGURE_ENABLE_MERGER}, + {"disable-merger", no_argument, (int *)&action, OSYNCTOOL_CONFIGURE_DISABLE_MERGER}, + {"enable-converter", no_argument, (int *)&action, OSYNCTOOL_CONFIGURE_ENABLE_CONVERTER}, + {"disable-converter", no_argument, (int *)&action, OSYNCTOOL_CONFIGURE_DISABLE_CONVERTER}, + {"configure-filter", no_argument, (int *)&action, OSYNCTOOL_CONFIGURE_FILTER}, + {"configure-capabilities", no_argument, (int *)&action, OSYNCTOOL_CONFIGURE_CAPABILITIES}, + {"addmember", no_argument, (int *)&action, OSYNCTOOL_CONFIGURE_ADDMEMBER}, + {"configure", no_argument, (int *)&action, OSYNCTOOL_CONFIGURE}, + {"delmember", no_argument, (int *)&action, OSYNCTOOL_CONFIGURE_DELMEMBER}, + {"enable-objtype", no_argument, (int *)&action, OSYNCTOOL_CONFIGURE_ENABLE_OBJTYPE}, + {"disable-objtype", no_argument, (int *)&action, OSYNCTOOL_CONFIGURE_DISABLE_OBJTYPE}, + {"disable-readonly", no_argument, (int *)&action, OSYNCTOOL_CONFIGURE_MEMBER_ENABLE_WRITE}, + {"enable-readonly", no_argument, (int *)&action, OSYNCTOOL_CONFIGURE_MEMBER_ENABLE_WRITE}, + {"discover", no_argument, (int *)&action, OSYNCTOOL_CONFIGURE_DISCOVER}, + {"sync", no_argument, (int *)&action, OSYNCTOOL_SYNC}, + {"slow-sync", required_argument, 0, 's'}, + {"wait", no_argument, &wait, TRUE}, + {"always-accept-forecast", no_argument, &always_accept_forecast, TRUE}, + {"multi", no_argument, &multi, TRUE}, + {"conflict", required_argument, 0, 'c'}, + {"configdir", required_argument, 0, 'd'}, + {"manual", no_argument, &manual, TRUE}, + {"help", no_argument, 0, 'h'}, + {0, 0, 0, 0} + }; + + while (1) { + c = getopt_long(argc, argv, "", long_options, &option_index); + if (c == -1) + break; + switch(c) { + + case 0: /* flag has been set */ + if (long_options[option_index].flag == (int *)&action) { + if (action_count > 0) { + fprintf(stderr, "Error: Only one action may be given at a time\n"); + short_usage(argv[0], 1); + } + ++action_count; } - } else if (!strcmp (arg, "--discover")) { - if (action != NONE) - usage (argv[0], 1); - action = OSYNCTOOL_CONFIGURE_DISCOVER; - groupname = argv[i + 1]; - membername = argv[i + 2]; - i += 2; - if (!groupname) - usage (argv[0], 1); - } else if (!strcmp (arg, "--sync")) { //sync options - if (action != NONE) - usage (argv[0], 1); - action = OSYNCTOOL_SYNC; - groupname = argv[i + 1]; - i += 1; - if (!groupname) - usage (argv[0], 1); - } else if (!strcmp (arg, "--slow-sync")) { - objtype = argv[i + 1]; - slow_objects = g_list_append(slow_objects, objtype); - i += 1; - if (action != OSYNCTOOL_SYNC || !objtype) - usage (argv[0], 1); - } else if (!strcmp (arg, "--wait")) { - wait = TRUE; - if (action != OSYNCTOOL_SYNC) - usage (argv[0], 1); - } else if (!strcmp (arg, "--always-accept-forecast")) { - always_accept_forecast = TRUE; - if (action != OSYNCTOOL_SYNC) - usage (argv[0], 1); - } else if (!strcmp (arg, "--multi")) { - multi = TRUE; - if (action != OSYNCTOOL_SYNC) - usage (argv[0], 1); - } else if (!strcmp (arg, "--conflict")) { - const char *conflictstr = argv[i + 1]; - i++; - if (!conflictstr || action != OSYNCTOOL_SYNC) - usage (argv[0], 1); - - if (conflictstr[0] == 'd' || conflictstr[0] == 'D') + break; + case 's': + slow_objects = g_list_append(slow_objects, optarg); + break; + case 'c': + if (optarg[0] == 'd' || optarg[0] == 'D') conflict = OSYNC_CONFLICT_RESOLUTION_DUPLICATE; - else if (conflictstr[0] == 'i' || conflictstr[0] == 'I') + else if (optarg[0] == 'i' || optarg[0] == 'I') conflict = OSYNC_CONFLICT_RESOLUTION_IGNORE; - else if (conflictstr[0] == 'n' || conflictstr[0] == 'N') + else if (optarg[0] == 'n' || optarg[0] == 'N') conflict = OSYNC_CONFLICT_RESOLUTION_NEWER; - else if (strchr("123456789", conflictstr[0]) != NULL) { - winner = atoi(conflictstr) - 1; + else if (strchr("123456789", optarg[0]) != NULL) { + winner = atoi(optarg) - 1; if (winner < 0) usage (argv[0], 1); conflict = OSYNC_CONFLICT_RESOLUTION_SELECT; } else usage (argv[0], 1); - } else if (!strcmp (arg, "--configdir")) { - configdir = argv[i + 1]; - i++; - if (!configdir) - usage (argv[0], 1); - } else if (!strcmp (arg, "--manual")) { - manual = TRUE; - if (action != OSYNCTOOL_SYNC) + break; + case 'd': + configdir = optarg; + break; + case 'h': + usage(argv[0], 0); + break; + case '?': + default: + short_usage(argv[0], 1); + } + } + + switch (action) { + case NONE: + short_usage(argv[0], 1); + break; + case OSYNCTOOL_SHOW_GROUP: + case OSYNCTOOL_SHOW_OBJTYPES: + case OSYNCTOOL_SHOW_FILTER: + case OSYNCTOOL_SHOW_CAPABILITIES: + case OSYNCTOOL_CONFIGURE_ADDGROUP: + case OSYNCTOOL_CONFIGURE_DELGROUP: + case OSYNCTOOL_CONFIGURE_ENABLE_MERGER: + case OSYNCTOOL_CONFIGURE_DISABLE_MERGER: + case OSYNCTOOL_CONFIGURE_ENABLE_CONVERTER: + case OSYNCTOOL_CONFIGURE_DISABLE_CONVERTER: + case OSYNCTOOL_CONFIGURE_FILTER: + case OSYNCTOOL_SYNC: + if (argc - optind != 1) + usage(argv[0], 1); + groupname = argv[optind]; + break; + case OSYNCTOOL_CONFIGURE: + case OSYNCTOOL_CONFIGURE_DELMEMBER: + case OSYNCTOOL_CONFIGURE_CAPABILITIES: + if (argc - optind != 2) + usage(argv[0], 1); + groupname = argv[optind]; + membername = argv[optind + 1]; + break; + case OSYNCTOOL_CONFIGURE_ENABLE_OBJTYPE: + case OSYNCTOOL_CONFIGURE_DISABLE_OBJTYPE: + if (argc - optind != 2) usage (argv[0], 1); - } else if (!strcmp (arg, "--help")) { - usage (argv[0], 0); - } else if (!strcmp (arg, "--")) { + groupname = argv[optind]; + objtype = argv[optind + 1]; break; - } else if (arg[0] == '-') { - usage (argv[0], 1); - } else { - usage (argv[0], 1); + case OSYNCTOOL_CONFIGURE_ADDMEMBER: + if (argc - optind < 2 || argc - optind > 3) + usage(argv[0], 1); + groupname = argv[optind]; + pluginname = argv[optind + 1]; + if (argc - optind == 3) + membername = argv[optind + 2]; + break; + case OSYNCTOOL_CONFIGURE_MEMBER_ENABLE_WRITE: + case OSYNCTOOL_CONFIGURE_MEMBER_DISABLE_WRITE: + if (argc - optind < 2 || argc - optind > 3) + usage(argv[0], 1); + groupname = argv[optind]; + membername = argv[optind + 1]; + if (argc - optind == 3) + objtype = argv[optind + 2]; + break; + case OSYNCTOOL_CONFIGURE_DISCOVER: + if (argc - optind < 1 || argc - optind > 2) + usage(argv[0], 1); + groupname = argv[optind]; + if (argc - optind == 2) + membername = argv[optind + 1]; + break; + default: + if (argc != optind) + usage(argv[0], 1); + } + + if (action != OSYNCTOOL_SYNC) { + if (slow_objects != NULL || + wait == TRUE || + multi == TRUE || + conflict != OSYNC_CONFLICT_RESOLUTION_UNKNOWN || + manual == TRUE || + always_accept_forecast == TRUE) { + usage(argv[0], 1); } } @@ -1811,6 +1712,9 @@ case NONE: osync_error_set(&error, OSYNC_ERROR_GENERIC, "No action given"); goto error_free_plugin_env; + default: + osync_error_set(&error, OSYNC_ERROR_GENERIC, "Internal error, unhandled action selected"); + goto error_free_plugin_env; } g_list_free(slow_objects); |
From: <dg...@su...> - 2009-01-12 20:51:08
|
Author: Graham Cobb Date: Mon Jan 12 21:50:26 2009 New Revision: 5126 URL: http://www.opensync.org/changeset/5126 Log: gpe-sync: more README updates Modified: plugins/gpe/README Modified: plugins/gpe/README ============================================================================== --- plugins/gpe/README Mon Jan 12 21:49:20 2009 (r5125) +++ plugins/gpe/README Mon Jan 12 21:50:26 2009 (r5126) @@ -91,7 +91,7 @@ ''what parts of those specs it implements, what not?'' -== Related OpenSync Pages == +== Related !OpenSync Pages == * Information on GPE peer devices: [wiki:peers/gpe] |