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-22 18:14:15
|
Author: henrik Date: Thu Jan 22 19:12:55 2009 New Revision: 5215 URL: http://www.opensync.org/changeset/5215 Log: Update to latest OpenSync API Modified: plugins/mozilla-sync/trunk/CMakeLists.txt plugins/mozilla-sync/trunk/src/mozilla-sync.cpp Modified: plugins/mozilla-sync/trunk/CMakeLists.txt ============================================================================== --- plugins/mozilla-sync/trunk/CMakeLists.txt Tue Jan 20 19:21:30 2009 (r5214) +++ plugins/mozilla-sync/trunk/CMakeLists.txt Thu Jan 22 19:12:55 2009 (r5215) @@ -29,7 +29,7 @@ ENDIF(COMMAND cmake_policy) SET( PROJECT_NAME mozilla-sync ) -PROJECT( ${PROJECT_NAME} CXX ) +PROJECT( ${PROJECT_NAME} C CXX ) SET( CPACK_PACKAGE_VERSION_MAJOR "0") SET( CPACK_PACKAGE_VERSION_MINOR "1") Modified: plugins/mozilla-sync/trunk/src/mozilla-sync.cpp ============================================================================== --- plugins/mozilla-sync/trunk/src/mozilla-sync.cpp Tue Jan 20 19:21:30 2009 (r5214) +++ plugins/mozilla-sync/trunk/src/mozilla-sync.cpp Thu Jan 22 19:12:55 2009 (r5215) @@ -201,7 +201,9 @@ @return TRUE on success; FALSE on error **/ gboolean mozilla_sync_report_addressbook_changes_to_hash( - OSyncMozillaDatabase *pOSyncMozillaDatabase, OSyncPluginInfo *pOSyncPluginInfo, OSyncContext *pOSyncContext) { + OSyncMozillaDatabase *pOSyncMozillaDatabase, + OSyncPluginInfo *pOSyncPluginInfo, + OSyncContext *pOSyncContext) { LOG_ENTRY(10, "(%p, %p, %p)", pOSyncMozillaDatabase, pOSyncPluginInfo, pOSyncContext); @@ -333,7 +335,9 @@ @return TRUE on success; FALSE on error **/ gboolean mozilla_sync_report_calendar_changes_to_hash( - OSyncMozillaDatabase *pOSyncMozillaDatabase, OSyncPluginInfo *pOSyncPluginInfo, OSyncContext *pOSyncContext) { + OSyncMozillaDatabase *pOSyncMozillaDatabase, + OSyncPluginInfo *pOSyncPluginInfo, + OSyncContext *pOSyncContext) { LOG_ENTRY(10, "(%p, %p, %p)", pOSyncMozillaDatabase, pOSyncPluginInfo, pOSyncContext); @@ -451,17 +455,21 @@ @param pOSyncPluginInfo On entry we have what we gave in get_sync_info. @param pOSyncContext The context of the connect (e.g. to report error) **/ -static void mozilla_sync_get_changes(void *data, OSyncPluginInfo *pOSyncPluginInfo, OSyncContext *pOSyncContext) +static void mozilla_sync_get_changes( + OSyncObjTypeSink* pOSyncObjTypeSink, + OSyncPluginInfo *pOSyncPluginInfo, + OSyncContext *pOSyncContext, + osync_bool fSlow, + void *data) { - LOG_ENTRY(10, "(%p, %p, %p)", data, pOSyncPluginInfo, pOSyncContext); - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(pOSyncPluginInfo); - OSyncMozillaDatabase *pOSyncMozillaDatabase = (OSyncMozillaDatabase*) osync_objtype_sink_get_userdata(sink); + LOG_ENTRY(10, "(%p, %p, %p, %d, %p)", pOSyncObjTypeSink, pOSyncPluginInfo, pOSyncContext, fSlow, data); + OSyncMozillaDatabase *pOSyncMozillaDatabase = (OSyncMozillaDatabase*) osync_objtype_sink_get_userdata(pOSyncObjTypeSink); int i = 0; OSyncError *pError = NULL; // Thank you Michael Bell for corrections // &&& osync_hashtable_reset_reports(pOSyncMozillaDatabase->pOSyncHashTable); - if (osync_objtype_sink_get_slowsync(pOSyncMozillaDatabase->pOSyncObjTypeSink)) { + if (osync_objtype_sink_get_slowsync(pOSyncMozillaDatabase->pOSyncObjTypeSink) || fSlow) { osync_trace(TRACE_INTERNAL, "Slow sync requested"); if (!osync_hashtable_slowsync(pOSyncMozillaDatabase->pOSyncHashTable, &pError)) { @@ -472,7 +480,7 @@ } } - LOG(10, "Getting changes for [%s]", osync_objtype_sink_get_name(sink)); + LOG(10, "Getting changes for [%s]", osync_objtype_sink_get_name(pOSyncObjTypeSink)); gboolean f; @@ -494,7 +502,7 @@ return; } - LOG(10, "Checking for deleted [%s]", osync_objtype_sink_get_name(sink)); + LOG(10, "Checking for deleted [%s]", osync_objtype_sink_get_name(pOSyncObjTypeSink)); OSyncList *u; OSyncList *uids = osync_hashtable_get_deleted(pOSyncMozillaDatabase->pOSyncHashTable); @@ -534,7 +542,7 @@ } osync_context_report_success(pOSyncContext); - LOG(10, "Done getting changes for [%s]", osync_objtype_sink_get_name(sink)); + LOG(10, "Done getting changes for [%s]", osync_objtype_sink_get_name(pOSyncObjTypeSink)); LOG_EXIT(10, "void"); } @@ -676,10 +684,13 @@ @param pOSyncContext The context of the connect (e.g. to report error) @param pChange The change we shall commit **/ -static void mozilla_sync_commit_change(void *data, OSyncPluginInfo *pOSyncPluginInfo, - OSyncContext *pOSyncContext, OSyncChange *pChange) +static void mozilla_sync_commit_change( + OSyncObjTypeSink* pOSyncObjTypeSink, + OSyncPluginInfo *pOSyncPluginInfo, + OSyncContext *pOSyncContext, + OSyncChange *pChange, void *data) { - LOG_ENTRY(10, "(%p, %p, %p, %p)", data, pOSyncPluginInfo, pOSyncContext, pChange); + LOG_ENTRY(10, "(%p, %p, %p, %p)", pOSyncObjTypeSink, pOSyncPluginInfo, pOSyncContext, data); // Log what we are about to do @@ -702,8 +713,7 @@ } - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(pOSyncPluginInfo); - OSyncMozillaDatabase *pOSyncMozillaDatabase = (OSyncMozillaDatabase*) osync_objtype_sink_get_userdata(sink); + OSyncMozillaDatabase *pOSyncMozillaDatabase = (OSyncMozillaDatabase*) osync_objtype_sink_get_userdata(pOSyncObjTypeSink); OSyncHashTable *pHT = pOSyncMozillaDatabase->pOSyncHashTable; gboolean f; @@ -755,17 +765,19 @@ @param pOSyncPluginInfo On entry we have what we gave in get_sync_info. @param pOSyncContext The context of the connect (e.g. to report error) **/ -static void mozilla_sync_done(void *data, OSyncPluginInfo *pOSyncPluginInfo, OSyncContext *pOSyncContext) +static void mozilla_sync_done(OSyncObjTypeSink* pOSyncObjTypeSink, + OSyncPluginInfo *pOSyncPluginInfo, + OSyncContext *pOSyncContext, + void *data) { - LOG_ENTRY(10, "(%p, %p, %p)", data, pOSyncPluginInfo, pOSyncContext); + LOG_ENTRY(10, "(%p, %p, %p)", pOSyncPluginInfo, pOSyncContext, data); - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(pOSyncPluginInfo); - OSyncMozillaDatabase *db = (OSyncMozillaDatabase*) osync_objtype_sink_get_userdata(sink); + OSyncMozillaDatabase *db = (OSyncMozillaDatabase*) osync_objtype_sink_get_userdata(pOSyncObjTypeSink); OSyncError *error = NULL; LOG(10, "Updating anchor to value [%s]", db->szAnchorValue); - OSyncAnchor *anchor = osync_objtype_sink_get_anchor(sink); + OSyncAnchor *anchor = osync_objtype_sink_get_anchor(pOSyncObjTypeSink); if (!osync_anchor_update(anchor, db->szAnchorValue, &error)) { osync_context_report_osyncerror(pOSyncContext, error); LOG_EXIT_ERROR_OSYNC_SZ(10, &error, "Could not do osync_anchor_update"); @@ -789,30 +801,33 @@ @param pOSyncPluginInfo On entry we have what we gave in get_sync_info. @param pOSyncContext The context of the connect (e.g. to report error) **/ -static void mozilla_sync_connect(void *data, OSyncPluginInfo *pOSyncPluginInfo, OSyncContext *pOSyncContext) +static void mozilla_sync_connect( + OSyncObjTypeSink* pOSyncObjTypeSink, + OSyncPluginInfo *pOSyncPluginInfo, + OSyncContext *pOSyncContext, + void *data) { - LOG_ENTRY(10, "(%p, %p, %p)", data, pOSyncPluginInfo, pOSyncContext); + LOG_ENTRY(10, "(%p, %p, %p, %p)", pOSyncObjTypeSink, pOSyncPluginInfo, pOSyncContext, data); OSyncError *error = NULL; - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(pOSyncPluginInfo); - OSyncMozillaDatabase *db = (OSyncMozillaDatabase*) osync_objtype_sink_get_userdata(sink); + OSyncMozillaDatabase *db = (OSyncMozillaDatabase*) osync_objtype_sink_get_userdata(pOSyncObjTypeSink); OSyncMozillaEnv *env = (OSyncMozillaEnv *)data; // TODO: Check the exact meaning of each timeout, and ajust accordingly - osync_objtype_sink_set_getchanges_timeout(sink, 4*60); // 4 minutes - osync_objtype_sink_set_commit_timeout(sink, 4*60); // 4 minutes - osync_objtype_sink_set_batchcommit_timeout(sink, 4*60); // 4 minutes - osync_objtype_sink_set_committedall_timeout(sink, 4*60); // 4 minutes - osync_objtype_sink_set_syncdone_timeout(sink, 4*60); // 4 minutes - osync_objtype_sink_set_write_timeout(sink, 4*60); // 4 minutes - osync_objtype_sink_set_read_timeout(sink, 4*60); // 4 minutes + osync_objtype_sink_set_getchanges_timeout(pOSyncObjTypeSink, 4*60); // 4 minutes + osync_objtype_sink_set_commit_timeout(pOSyncObjTypeSink, 4*60); // 4 minutes + osync_objtype_sink_set_batchcommit_timeout(pOSyncObjTypeSink, 4*60); // 4 minutes + osync_objtype_sink_set_committedall_timeout(pOSyncObjTypeSink, 4*60); // 4 minutes + osync_objtype_sink_set_syncdone_timeout(pOSyncObjTypeSink, 4*60); // 4 minutes + osync_objtype_sink_set_write_timeout(pOSyncObjTypeSink, 4*60); // 4 minutes + osync_objtype_sink_set_read_timeout(pOSyncObjTypeSink, 4*60); // 4 minutes char *tablepath = g_strdup_printf("%s" G_DIR_SEPARATOR_S "hashtable.db", osync_plugin_info_get_configdir(pOSyncPluginInfo)); LOG(10, "Initializing hashtable [%s]", tablepath); // Note that despite it's name, osync_hashtable_new, will re-use the hash-table, if it exists - db->pOSyncHashTable = osync_hashtable_new(tablepath, osync_objtype_sink_get_name(sink), &error); + db->pOSyncHashTable = osync_hashtable_new(tablepath, osync_objtype_sink_get_name(pOSyncObjTypeSink), &error); g_free(tablepath); if (!db->pOSyncHashTable) { @@ -826,7 +841,7 @@ return; } - OSyncAnchor *anchor = osync_objtype_sink_get_anchor(sink); + OSyncAnchor *anchor = osync_objtype_sink_get_anchor(pOSyncObjTypeSink); osync_bool same; if (!osync_anchor_compare(anchor, db->szAnchorValue, &same, &error)) { osync_context_report_osyncerror(pOSyncContext, error); @@ -875,13 +890,16 @@ @param pOSyncPluginInfo On entry we have what we gave in get_sync_info. @param pOSyncContext The context of the connect (e.g. to report error) **/ -static void mozilla_sync_disconnect(void *data, OSyncPluginInfo *pOSyncPluginInfo, OSyncContext *pOSyncContext) +static void mozilla_sync_disconnect( + OSyncObjTypeSink* pOSyncObjTypeSink, + OSyncPluginInfo *pOSyncPluginInfo, + OSyncContext *pOSyncContext, + void *data) { - LOG_ENTRY(10, "(%p, %p, %p)", data, pOSyncPluginInfo, pOSyncContext); + LOG_ENTRY(10, "(%p, %p, %p, %p)", pOSyncObjTypeSink, pOSyncPluginInfo, pOSyncContext, data); OSyncMozillaEnv *env = (OSyncMozillaEnv *)data; - OSyncObjTypeSink *sink = osync_plugin_info_get_sink(pOSyncPluginInfo); - OSyncMozillaDatabase *db = (OSyncMozillaDatabase*) osync_objtype_sink_get_userdata(sink); + OSyncMozillaDatabase *db = (OSyncMozillaDatabase*) osync_objtype_sink_get_userdata(pOSyncObjTypeSink); if (db->pOSyncHashTable) { osync_hashtable_unref(db->pOSyncHashTable); |
From: <dg...@su...> - 2009-01-22 15:27:32
|
Author: bellmich Date: Thu Jan 22 16:26:23 2009 New Revision: 180 URL: http://libwbxml.opensync.org/changeset/180 Log: OMA DM DDF has not WBXML public document ID. Modified: wbxmlTestSuite/trunk/launchTests.sh Modified: wbxmlTestSuite/trunk/launchTests.sh ============================================================================== --- wbxmlTestSuite/trunk/launchTests.sh Thu Jan 22 16:25:44 2009 (r179) +++ wbxmlTestSuite/trunk/launchTests.sh Thu Jan 22 16:26:23 2009 (r180) @@ -146,9 +146,12 @@ else if [ "$TESTDIR" = "airsync" ]; then PARAMS="-l AIRSYNC" + else if [ "$TESTDIR" = "ddf" ]; + then + PARAMS="-l DMDDF12" else PARAMS="" - fi fi + fi fi fi CMD="$WBXML2XML $PARAMS -o $OUT_XML $OUT_WBXML" $CMD if [ $? != 0 ]; then RESULT="FAILED"; fi |
From: <dg...@su...> - 2009-01-22 15:26:54
|
Author: bellmich Date: Thu Jan 22 16:25:44 2009 New Revision: 179 URL: http://libwbxml.opensync.org/changeset/179 Log: added initial OMA DM DDF support Only standalone management trees are tested until now. Modified: wbxml2/trunk/src/wbxml.h wbxml2/trunk/src/wbxml_tables.c wbxml2/trunk/src/wbxml_tables.h wbxml2/trunk/tools/wbxml2xml_tool.c Modified: wbxml2/trunk/src/wbxml.h ============================================================================== --- wbxml2/trunk/src/wbxml.h Thu Jan 22 16:22:04 2009 (r178) +++ wbxml2/trunk/src/wbxml.h Thu Jan 22 16:25:44 2009 (r179) @@ -229,6 +229,7 @@ WBXML_LANG_SYNCML_SYNCML12, /**< SYNCML 1.2 */ WBXML_LANG_SYNCML_DEVINF12, /**< DEVINF 1.2 */ WBXML_LANG_SYNCML_METINF12, /**< METINF 1.2 */ + WBXML_LANG_SYNCML_DMDDF12, /**< DMDDF 1.2 */ #endif /* WBXML_SUPPORT_SYNCML */ /* Wireless-Village */ Modified: wbxml2/trunk/src/wbxml_tables.c ============================================================================== --- wbxml2/trunk/src/wbxml_tables.c Thu Jan 22 16:22:04 2009 (r178) +++ wbxml2/trunk/src/wbxml_tables.c Thu Jan 22 16:25:44 2009 (r179) @@ -106,6 +106,7 @@ const WBXMLPublicIDEntry sv_syncml_syncml12_public_id = { WBXML_PUBLIC_ID_SYNCML_SYNCML12, XML_PUBLIC_ID_SYNCML_SYNCML12, "SyncML", "http://www.openmobilealliance.org/tech/DTD/OMA-TS-SyncML_RepPro_DTD-V1_2.dtd" }; const WBXMLPublicIDEntry sv_syncml_devinf12_public_id = { WBXML_PUBLIC_ID_SYNCML_DEVINF12, XML_PUBLIC_ID_SYNCML_DEVINF12, "DevInf", "http://www.openmobilealliance.org/tech/DTD/OMA-SyncML-Device_Information-DTD-1.2.dtd" }; const WBXMLPublicIDEntry sv_syncml_metinf12_public_id = { WBXML_PUBLIC_ID_SYNCML_METINF12, XML_PUBLIC_ID_SYNCML_METINF12, "MetInf", "http://www.openmobilealliance.org/tech/DTD/OMA-TS-SyncML_MetaInfo_DTD-V1_2.dtd" }; +const WBXMLPublicIDEntry sv_syncml_dmddf12_public_id = { WBXML_PUBLIC_ID_SYNCML_DMDDF12, XML_PUBLIC_ID_SYNCML_DMDDF12, "MgmtTree", "http://www.openmobilealliance.org/tech/DTD/dm_ddf-v1_2.dtd" }; #endif /* WBXML_SUPPORT_SYNCML */ #if defined( WBXML_SUPPORT_WV ) @@ -1865,7 +1866,7 @@ /********************************************************* - * SyncML DevInf 1.2 ("??.pdf") + * SyncML DevInf 1.2 ("OMA-TS-DS_DevInf-V1_2-20060710-A.pdf") */ const WBXMLTagEntry sv_syncml_devinf12_tag_table[] = { @@ -1952,6 +1953,75 @@ { NULL, 0x00, 0x00 } }; +/********************************************************* + * SyncML DM DDF 1.2 ("OMA-TS-DM_TND-V1_2_1-20080617-A.pdf") + */ + +const WBXMLTagEntry sv_syncml_dmddf12_tag_table[] = { + { "AccessType", 0x02, 0x05 }, + { "ACL", 0x02, 0x06 }, + { "Add", 0x02, 0x07 }, + { "b64", 0x02, 0x08 }, + { "bin", 0x02, 0x09 }, + { "bool", 0x02, 0x0A }, + { "chr", 0x02, 0x0B }, + { "CaseSense", 0x02, 0x0C }, + { "CIS", 0x02, 0x0D }, + { "Copy", 0x02, 0x0E }, + { "CS", 0x02, 0x0F }, + { "data", 0x02, 0x10 }, + { "DDFName", 0x02, 0x11 }, + { "DefaultValue", 0x02, 0x12 }, + { "Delete", 0x02, 0x13 }, + { "Description", 0x02, 0x14 }, + { "DFFormat", 0x02, 0x15 }, + { "DFProperties", 0x02, 0x16 }, + { "DFTitle", 0x02, 0x17 }, + { "DFType", 0x02, 0x18 }, + { "Dynamic", 0x02, 0x19 }, + { "Exec", 0x02, 0x1A }, + { "float", 0x02, 0x1B }, + { "Format", 0x02, 0x1C }, + { "Get", 0x02, 0x1D }, + { "int", 0x02, 0x1E }, + { "Man", 0x02, 0x1F }, + { "MgmtTree", 0x02, 0x20 }, + { "MIME", 0x02, 0x21 }, + { "Mod", 0x02, 0x22 }, + { "Name", 0x02, 0x23 }, + { "Node", 0x02, 0x24 }, + { "node", 0x02, 0x25 }, + { "NodeName", 0x02, 0x26 }, + { "null", 0x02, 0x27 }, + { "Occurrence", 0x02, 0x28 }, + { "One", 0x02, 0x29 }, + { "OneOrMore", 0x02, 0x2A }, + { "OneOrN", 0x02, 0x2B }, + { "Path", 0x02, 0x2C }, + { "Permanent", 0x02, 0x2D }, + { "Replace", 0x02, 0x2E }, + { "RTProperties", 0x02, 0x2F }, + { "Scope", 0x02, 0x30 }, + { "Size", 0x02, 0x31 }, + { "time", 0x02, 0x32 }, + { "Title", 0x02, 0x33 }, + { "TStamp", 0x02, 0x34 }, + { "Type", 0x02, 0x35 }, + { "Value", 0x02, 0x36 }, + { "VerDTD", 0x02, 0x37 }, + { "VerNo", 0x02, 0x38 }, + { "xml", 0x02, 0x39 }, + { "ZeroOrMore", 0x02, 0x3A }, + { "ZeroOrN", 0x02, 0x3B }, + { "ZeroOrOne", 0x02, 0x3C }, + { NULL, 0x00, 0x00 } +}; + +const WBXMLNameSpaceEntry sv_syncml_dmddf12_ns_table[] = { + { "MgmtTree", 0x02 }, /**< Code Page 2: DMDDF */ + { NULL, 0x00 } +}; + #endif /* WBXML_SUPPORT_SYNCML */ @@ -2909,6 +2979,7 @@ { WBXML_LANG_SYNCML_SYNCML12, &sv_syncml_syncml12_public_id, sv_syncml_syncml12_tag_table, sv_syncml_syncml12_ns_table, NULL, NULL, NULL }, { WBXML_LANG_SYNCML_DEVINF12, &sv_syncml_devinf12_public_id, sv_syncml_devinf12_tag_table, sv_syncml_devinf12_ns_table, NULL, NULL, NULL }, { WBXML_LANG_SYNCML_METINF12, &sv_syncml_metinf12_public_id, sv_syncml_metinf12_tag_table, NULL, NULL, NULL, NULL }, + { WBXML_LANG_SYNCML_DMDDF12, &sv_syncml_dmddf12_public_id, sv_syncml_dmddf12_tag_table, sv_syncml_dmddf12_ns_table, NULL, NULL, NULL }, /* SyncML 1.1 */ { WBXML_LANG_SYNCML_SYNCML11, &sv_syncml_syncml11_public_id, sv_syncml_syncml11_tag_table, sv_syncml_syncml11_ns_table, NULL, NULL, NULL }, Modified: wbxml2/trunk/src/wbxml_tables.h ============================================================================== --- wbxml2/trunk/src/wbxml_tables.h Thu Jan 22 16:22:04 2009 (r178) +++ wbxml2/trunk/src/wbxml_tables.h Thu Jan 22 16:25:44 2009 (r179) @@ -107,10 +107,12 @@ #define WBXML_PUBLIC_ID_SYNCML_SYNCML12 0x1201 #define WBXML_PUBLIC_ID_SYNCML_METINF12 0x1202 #define WBXML_PUBLIC_ID_SYNCML_DEVINF12 0x1203 +#define WBXML_PUBLIC_ID_SYNCML_DMDDF12 WBXML_PUBLIC_ID_UNKNOWN /* No WBXML PublicID defined for OMA DM DDF */ #define XML_PUBLIC_ID_SYNCML_SYNCML12 "-//SYNCML//DTD SyncML 1.2//EN" #define XML_PUBLIC_ID_SYNCML_DEVINF12 "-//SYNCML//DTD DevInf 1.2//EN" #define XML_PUBLIC_ID_SYNCML_METINF12 "-//SYNCML//DTD MetInf 1.2//EN" +#define XML_PUBLIC_ID_SYNCML_DMDDF12 "-//OMA//DTD-DM-DDF 1.2//EN" /* OMA Wireless Village CSP 1.1 / 1.2 - @todo Check for CSP 1.0 */ #define WBXML_PUBLIC_ID_WV_CSP11 0x10 Modified: wbxml2/trunk/tools/wbxml2xml_tool.c ============================================================================== --- wbxml2/trunk/tools/wbxml2xml_tool.c Thu Jan 22 16:22:04 2009 (r178) +++ wbxml2/trunk/tools/wbxml2xml_tool.c Thu Jan 22 16:25:44 2009 (r179) @@ -127,6 +127,8 @@ return WBXML_LANG_SYNCML_DEVINF12; if (WBXML_STRCMP(lang, "METINF12") == 0) return WBXML_LANG_SYNCML_METINF12; + if (WBXML_STRCMP(lang, "DMDDF12") == 0) + return WBXML_LANG_SYNCML_DMDDF12; #endif /* WBXML_SUPPORT_SYNCML */ #if defined( WBXML_SUPPORT_WV ) @@ -207,6 +209,7 @@ fprintf(stderr, " SYNCML12 : SYNCML 1.2\n"); fprintf(stderr, " DEVINF12 : DEVINF 1.2\n"); fprintf(stderr, " METINF12 : METINF 1.2\n"); + fprintf(stderr, " DMDDF12 : DMDDF 1.2\n"); #endif /* WBXML_SUPPORT_SYNCML */ #if defined( WBXML_SUPPORT_WV ) fprintf(stderr, " CSP11 : WV CSP 1.1\n"); |
From: <dg...@su...> - 2009-01-22 15:23:14
|
Author: bellmich Date: Thu Jan 22 16:22:04 2009 New Revision: 178 URL: http://libwbxml.opensync.org/changeset/178 Log: fixed OMA DM DDF examples again Modified: 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/ddf/dm_devdetail-v1_2.ddf ============================================================================== --- wbxmlTestSuite/trunk/ddf/dm_devdetail-v1_2.ddf Thu Jan 22 16:21:21 2009 (r177) +++ wbxmlTestSuite/trunk/ddf/dm_devdetail-v1_2.ddf Thu Jan 22 16:22:04 2009 (r178) @@ -9,7 +9,7 @@ --> <!DOCTYPE MgmtTree PUBLIC "-//OMA//DTD-DM-DDF 1.2//EN" - "http://www.openmobilealliance.org/tech/DTD/DM_DDF-V1_2.dtd" + "http://www.openmobilealliance.org/tech/DTD/dm_ddf-v1_2.dtd" [<?oma-dm-ddf-ver supported-versions="1.2"?>]> <!-- FILE INFORMATION Modified: wbxmlTestSuite/trunk/ddf/dm_devinfo-v1_2.ddf ============================================================================== --- wbxmlTestSuite/trunk/ddf/dm_devinfo-v1_2.ddf Thu Jan 22 16:21:21 2009 (r177) +++ wbxmlTestSuite/trunk/ddf/dm_devinfo-v1_2.ddf Thu Jan 22 16:22:04 2009 (r178) @@ -6,7 +6,7 @@ --> <!DOCTYPE MgmtTree PUBLIC "-//OMA//DTD-DM-DDF 1.2//EN" - "http://www.openmobilealliance.org/tech/DTD/DM_DDF-V1_2.dtd" + "http://www.openmobilealliance.org/tech/DTD/dm_ddf-v1_2.dtd" [<?oma-dm-ddf-ver supported-versions="1.2"?>]> <!-- Modified: wbxmlTestSuite/trunk/ddf/dm_dmacc-v1_2.ddf ============================================================================== --- wbxmlTestSuite/trunk/ddf/dm_dmacc-v1_2.ddf Thu Jan 22 16:21:21 2009 (r177) +++ wbxmlTestSuite/trunk/ddf/dm_dmacc-v1_2.ddf Thu Jan 22 16:22:04 2009 (r178) @@ -7,7 +7,7 @@ --> <!DOCTYPE MgmtTree PUBLIC "-//OMA//DTD-DM-DDF 1.2//EN" - "http://www.openmobilealliance.org/tech/DTD/DM_DDF-V1_2.dtd" + "http://www.openmobilealliance.org/tech/DTD/dm_ddf-v1_2.dtd" [<?oma-dm-ddf-ver supported-versions="1.2"?>]> <!-- FILE INFORMATION Modified: wbxmlTestSuite/trunk/ddf/ds_mo-v1_0.ddf ============================================================================== --- wbxmlTestSuite/trunk/ddf/ds_mo-v1_0.ddf Thu Jan 22 16:21:21 2009 (r177) +++ wbxmlTestSuite/trunk/ddf/ds_mo-v1_0.ddf Thu Jan 22 16:22:04 2009 (r178) @@ -1,4 +1,4 @@ -<?xml version="1.0" encoding="UTF-8"?> +<?xml version="1.0" encoding="UTF-8"?> <!-- OMA DS MO V1.0 DDF. Copyright Open Mobile Alliance Ltd., 2005-2007. All rights reserved @@ -7,8 +7,8 @@ --> <!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"?>]> + "http://www.openmobilealliance.org/tech/DTD/dm_ddf-v1_2.dtd" + [<?oma-dm-ddf-ver supported-versions="1.2"?>]> <!-- FILE INFORMATION OMA Permanent Document Modified: wbxmlTestSuite/trunk/ddf/mo_oma_imps-V1_3.ddf ============================================================================== --- wbxmlTestSuite/trunk/ddf/mo_oma_imps-V1_3.ddf Thu Jan 22 16:21:21 2009 (r177) +++ wbxmlTestSuite/trunk/ddf/mo_oma_imps-V1_3.ddf Thu Jan 22 16:22:04 2009 (r178) @@ -6,7 +6,7 @@ --> <!DOCTYPE MgmtTree PUBLIC "-//OMA//DTD-DM-DDF 1.2//EN" - "http://www.openmobilealliance.org/tech/DTD/DM_DDF-V1_2.dtd" + "http://www.openmobilealliance.org/tech/DTD/dm_ddf-v1_2.dtd" [<?oma-dm-ddf-ver supported-versions="1.2"?>]> <!-- |
From: <dg...@su...> - 2009-01-22 15:22:33
|
Author: bellmich Date: Thu Jan 22 16:21:21 2009 New Revision: 177 URL: http://libwbxml.opensync.org/changeset/177 Log: - added XML default encoding UTF-8 - removed [<? ... ?>] which is really special and not covered by WBXML - replaced all kinds of [\s\r\n]* combinations at the end of a line by a single newline Modified: wbxmlTestSuite/trunk/normalize_xml.pl Modified: wbxmlTestSuite/trunk/normalize_xml.pl ============================================================================== --- wbxmlTestSuite/trunk/normalize_xml.pl Thu Jan 22 14:26:49 2009 (r176) +++ wbxmlTestSuite/trunk/normalize_xml.pl Thu Jan 22 16:21:21 2009 (r177) @@ -60,6 +60,10 @@ if ($state eq "IGNORE" and $line =~ q{^\s*<\?}) { $state = "ENC_OPEN"; } + if ($state eq "ENC_OPEN" and $line =~ q{^\s*<\?.*\?>\s*$} and $line !~ q{\sencoding="[^"]*"}) { + # add default encoding + $line =~ s{\s*\?>\s*$}{ encoding="UTF-8"?>\n}; + } if ($state eq "ENC_OPEN" and $line =~ q{\?>\s*$}) { $state = "WRITE"; } @@ -68,6 +72,10 @@ if ($state eq "IGNORE" and $line =~ q{^\s*<!DOCTYPE}) { $state = "DTD_OPEN"; } + if ($state eq "DTD_OPEN" and $line =~ q{\s\[<\?.*\?>\]}) { + ## such special XML stuff is lost in WBXML + $line =~ s{\s\[<\?.*\?>\]}{}; + } if ($state eq "DTD_OPEN" and $line =~ q{>\s*$}) { $state = "WRITE"; } @@ -85,6 +93,7 @@ $line = <$ORG_FD>; } if ($state eq "WRITE") { + $line =~ s{[\s\r\n]*$}{\n}s; print $NEW_FD $line; $line = <$ORG_FD>; $state = "IGNORE"; |
From: <dg...@su...> - 2009-01-22 13:28:04
|
Author: bellmich Date: Thu Jan 22 14:26:49 2009 New Revision: 176 URL: http://libwbxml.opensync.org/changeset/176 Log: - fixed ticket #25 - replaced the getopt implementation because of a potential copyright problem (kannel.org uses a BSD license) Modified: wbxml2/trunk/tools/attgetopt.c wbxml2/trunk/tools/getopt.h wbxml2/trunk/tools/wbxml2xml_tool.c wbxml2/trunk/tools/xml2wbxml_tool.c Modified: wbxml2/trunk/tools/attgetopt.c ============================================================================== --- wbxml2/trunk/tools/attgetopt.c Tue Jan 20 13:18:47 2009 (r175) +++ wbxml2/trunk/tools/attgetopt.c Thu Jan 22 14:26:49 2009 (r176) @@ -7,61 +7,97 @@ * * From the mod.sources newsgroup, volume 3, issue 58, with modifications * to bring it up to 21st century C. + */ + +/* Copied from: http://everything2.com/e2node/getopt%2528%2529 + * getopt renamed to wbxml_getopt + */ + +/* getopt.c: + * a public domain implementation of getopt() + * + * The following source code is an adaptation of the public domain getopt() + * implementation presented at the 1985 UNIFORUM conference in Dallas, + * Texas. Slight edits have been made to improve readability and the result + * is released into the public domain like that from which it was derived. * - * Taken from Kannel Project (http://www.kannel.org/) */ #include <stdio.h> #include <string.h> +int optind = 1; +int optopt; +char *optarg; -#define ERR(s, c) if (opterr) (void) fprintf(stderr, "%s: %s\n", argv[0], s) - -int opterr = 1; -int optind = 1; -int optopt; -char *optarg; - -int getopt(int argc, char **argv, char *opts) +int +wbxml_getopt(int argc, char **argv, char *opts) { - static int sp = 1; - register int c; - register char *cp; - - if(sp == 1) { - if(optind >= argc || - argv[optind][0] != '-' || argv[optind][1] == '\0') - return(EOF); - else if(strcmp(argv[optind], "--") == 0) { - optind++; - return(EOF); - } - } - optopt = c = argv[optind][sp]; - if(c == ':' || (cp=strchr(opts, c)) == NULL) { - ERR(": illegal option -- ", c); - if(argv[optind][++sp] == '\0') { - optind++; - sp = 1; - } - return('?'); - } - if(*++cp == ':') { - if(argv[optind][sp+1] != '\0') - optarg = &argv[optind++][sp+1]; - else if(++optind >= argc) { - ERR(": option requires an argument -- ", c); - sp = 1; - return('?'); - } else - optarg = argv[optind++]; - sp = 1; - } else { - if(argv[optind][++sp] == '\0') { - sp = 1; - optind++; - } - optarg = NULL; - } - return(c); + static int sp = 1; + register int c; + register char *cp; + + if (sp == 1) { + + /* If all args are processed, finish */ + if (optind >= argc) { + return EOF; + } + if (argv[optind][0] != '-' || argv[optind][1] == '\0') { + return EOF; + } + + } else if (!strcmp(argv[optind], "--")) { + + /* No more options to be processed after this one */ + optind++; + return EOF; + + } + + optopt = c = argv[optind][sp]; + + /* Check for invalid option */ + if (c == ':' || (cp = strchr(opts, c)) == NULL) { + + fprintf(stderr, + "%s: illegal option -- %c\n", + argv[0], + c); + if (argv[optind][++sp] == '\0') { + optind++; + sp = 1; + } + + return '?'; + } + + /* Does this option require an argument? */ + if (*++cp == ':') { + + /* If so, get argument; if none provided output error */ + if (argv[optind][sp+1] != '\0') { + optarg = &argv[optind++][sp+1]; + } else if (++optind >= argc) { + fprintf(stderr, + "%s: option requires an argument -- %c\n", + argv[0], + c); + sp = 1; + return '?'; + } else { + optarg = argv[optind++]; + } + sp = 1; + + } else { + if (argv[optind][++sp] == '\0') { + sp = 1; + optind++; + } + optarg = NULL; + } + + return c; } + Modified: wbxml2/trunk/tools/getopt.h ============================================================================== --- wbxml2/trunk/tools/getopt.h Tue Jan 20 13:18:47 2009 (r175) +++ wbxml2/trunk/tools/getopt.h Thu Jan 22 14:26:49 2009 (r176) @@ -3,16 +3,13 @@ * @ingroup wbxml2xml_tool * @ingroup xml2wbxml_tool * - * @author Kannel Team (http://www.kannel.org/) - * - * @brief getopt() implementation + * @brief wbxml_getopt() is just another copy of the getopt implementation of AT&T */ #ifndef WBXML_GETOPT_H #define WBXML_GETOPT_H -int getopt(int argc, char **argv, char *opts); -extern int opterr; +int wbxml_getopt(int argc, char **argv, char *opts); extern int optind; extern int optopt; extern char *optarg; Modified: wbxml2/trunk/tools/wbxml2xml_tool.c ============================================================================== --- wbxml2/trunk/tools/wbxml2xml_tool.c Tue Jan 20 13:18:47 2009 (r175) +++ wbxml2/trunk/tools/wbxml2xml_tool.c Thu Jan 22 14:26:49 2009 (r176) @@ -236,7 +236,7 @@ params.indent = 1; params.keep_ignorable_ws = FALSE; - while ((opt = (WB_TINY) getopt(argc, argv, "kh?o:m:i:l:")) != EOF) + while ((opt = (WB_TINY) wbxml_getopt(argc, argv, "kh?o:m:i:l:")) != EOF) { switch (opt) { case 'k': Modified: wbxml2/trunk/tools/xml2wbxml_tool.c ============================================================================== --- wbxml2/trunk/tools/xml2wbxml_tool.c Tue Jan 20 13:18:47 2009 (r175) +++ wbxml2/trunk/tools/xml2wbxml_tool.c Thu Jan 22 14:26:49 2009 (r176) @@ -105,7 +105,7 @@ params.use_strtbl = TRUE; params.keep_ignorable_ws = FALSE; - while ((opt = (WB_TINY) getopt(argc, argv, "nkh?o:v:")) != EOF) + while ((opt = (WB_TINY) wbxml_getopt(argc, argv, "nkh?o:v:")) != EOF) { switch (opt) { case 'v': |
From: <dg...@su...> - 2009-01-20 18:22:38
|
Author: savago Date: Tue Jan 20 19:21:30 2009 New Revision: 5214 URL: http://www.opensync.org/changeset/5214 Log: Filling in some todos. Modified: format-plugins/xsltformat/src/xsltformat.c Modified: format-plugins/xsltformat/src/xsltformat.c ============================================================================== --- format-plugins/xsltformat/src/xsltformat.c Tue Jan 20 19:19:44 2009 (r5213) +++ format-plugins/xsltformat/src/xsltformat.c Tue Jan 20 19:21:30 2009 (r5214) @@ -25,7 +25,10 @@ * @brief A generic xslt format plugin. * * \todo: - * - make the convertion (should be easy thanks to xslt_aux functions) + * - add more error handling code + * - test the plugin for real + * - add support for other data types (notes, events, etc) + * - utests? * */ |
From: <dg...@su...> - 2009-01-20 18:20:47
|
Author: savago Date: Tue Jan 20 19:19:44 2009 New Revision: 5213 URL: http://www.opensync.org/changeset/5213 Log: Removing unneeded functions. Modified: format-plugins/xsltformat/src/xsltformat.c Modified: format-plugins/xsltformat/src/xsltformat.c ============================================================================== --- format-plugins/xsltformat/src/xsltformat.c Tue Jan 20 19:15:10 2009 (r5212) +++ format-plugins/xsltformat/src/xsltformat.c Tue Jan 20 19:19:44 2009 (r5213) @@ -33,39 +33,6 @@ #include <opensync/opensync-format.h> #include "xslt_aux.h" -static OSyncConvCmpResult compare_format1(const char *leftdata, unsigned int leftsize, - const char *rightdata, unsigned int rightsize, - void *user_data) -{ - /* - * This function can be used to compare two types of your formats. - * This is optional. For example, you can only provide a conversion - * from and to the xml format and let all the comparison be done there - * - */ - - /* - * Compare your objects here. You might need to cast the data of the change - * objects to you own defined types. - * - * The possible result of the comparison are: - * - * return OSYNC_CONV_DATA_SAME; - * The objects are exactly the same. (they might differ in some uid or - * timestamp though, but ALL the "real" information is the same) - * - * return OSYNC_CONV_DATA_SIMILAR; - * The objects are not _exactly_ the same, but they look similar. This is used - * to detect conflicts. It is up to you to decide what "similar" means for your - * object - * - * return OSYNC_CONV_DATA_MISMATCH; - * This means the objects are not the same and not similar. - * - */ - return OSYNC_CONV_DATA_MISMATCH; -} - static osync_bool conv_xslt_to_contact(char *input, unsigned int inpsize, char **output, unsigned int *outpsize, osync_bool *free_input, const char *config, void *userdata, OSyncError **error) { osync_bool result = FALSE; @@ -121,48 +88,12 @@ */ } -static osync_bool duplicate_format1(const char *uid, const char *input, unsigned int insize, char **newuid, char **output, unsigned int *outsize, osync_bool *dirty, OSyncError **error) -{ - /* - * This function can be used to duplicate your format. - * Duplication does not mean to make 2 objects out of one, - * but to change to uid of the object in such a way that it - * differes from the original uid. - * - * Most format will never need this. - * - */ - - return TRUE; -} - -static char *print_format1(const char *data, unsigned int size) -{ - /* - * If your format is not in a human printable format already - * you have to return a human readable string here describing the object - * as closely as possible. This information will be used by the user to decide - * which object to pick in a conflict. - * - */ - return NULL; -} - osync_bool get_format_info(OSyncFormatEnv *env, OSyncError **error) { - /* - * this function is called to register a new format - */ OSyncObjFormat *format = osync_objformat_new("xslt", "contact", error); if (!format) return FALSE; - osync_objformat_set_compare_func(format, compare_format1); - osync_objformat_set_destroy_func(format, destroy_format1); - //osync_objformat_set_duplicate_func(format, duplicate_format1); - //osync_objformat_set_print_func(format, print_format1); - - osync_format_env_register_objformat(env, format); osync_objformat_unref(format); |
From: <dg...@su...> - 2009-01-20 18:16:14
|
Author: savago Date: Tue Jan 20 19:15:10 2009 New Revision: 5212 URL: http://www.opensync.org/changeset/5212 Log: Filling the call to XSLT transform in the remaining converter function. Modified: format-plugins/xsltformat/src/xsltformat.c Modified: format-plugins/xsltformat/src/xsltformat.c ============================================================================== --- format-plugins/xsltformat/src/xsltformat.c Tue Jan 20 19:13:36 2009 (r5211) +++ format-plugins/xsltformat/src/xsltformat.c Tue Jan 20 19:15:10 2009 (r5212) @@ -80,7 +80,10 @@ *free_input = TRUE; - /* TODO: set OsyncError */ + /* TODO: + * - set OsyncError + * - use a common function to call xslt transform? + */ exit: return result; @@ -88,14 +91,25 @@ static osync_bool conv_contact_to_xslt(char *input, unsigned int inpsize, char **output, unsigned int *outpsize, osync_bool *free_input, const char *config, void *userdata, OSyncError **error) { - /* - * This function can be used to convert another format to your format. - * Return TRUE if the conversion was successful or return FALSE and set - * the error if something bad has happend. - * + osync_bool result = FALSE; + struct xslt_resources *converter = NULL; + + converter = (struct xslt_resources *)userdata; + if ((result = xslt_transform(converter, input))) + goto exit; + + if (!(*output = strdup(converter->xml_str))) + goto exit; + + *free_input = TRUE; + + /* TODO: + * - set OsyncError + * - use a common function to call xslt transform? */ - return TRUE; +exit: + return result; } |
From: <dg...@su...> - 2009-01-20 18:14:42
|
Author: savago Date: Tue Jan 20 19:13:36 2009 New Revision: 5211 URL: http://www.opensync.org/changeset/5211 Log: Adding code to actually do the conversion. Modified: format-plugins/xsltformat/src/xsltformat.c Modified: format-plugins/xsltformat/src/xsltformat.c ============================================================================== --- format-plugins/xsltformat/src/xsltformat.c Tue Jan 20 17:19:10 2009 (r5210) +++ format-plugins/xsltformat/src/xsltformat.c Tue Jan 20 19:13:36 2009 (r5211) @@ -68,42 +68,22 @@ static osync_bool conv_xslt_to_contact(char *input, unsigned int inpsize, char **output, unsigned int *outpsize, osync_bool *free_input, const char *config, void *userdata, OSyncError **error) { - /* - * This function can be used to convert your format to another format. - * Return TRUE if the conversion was successful or return FALSE and set - * the error if something bad has happend. - * - */ - - /* The arguments mean: - * - * - conv_data: - * Pointer to the data you returned in your init function (if any) - * - * - input: - * The data you need to convert - * - inpsize - * The size of the input data - * - * - output: - * After converting you need to set this - * to your result - * - outpsize: - * The size of the output - * - * - free_input: - * You need to set this to TRUE if opensync - * can free the input after the conversion (so you dont - * use any reference from or to the input). A example where - * *free_input = FALSE; needs to be done would be a encapsulator - * that stores the input reference somewhere in its struct - * - * - error: - * if something bad happens and you cannot convert, set the error! - * - */ + osync_bool result = FALSE; + struct xslt_resources *converter = NULL; - return TRUE; + converter = (struct xslt_resources *)userdata; + if ((result = xslt_transform(converter, input))) + goto exit; + + if (!(*output = strdup(converter->xml_str))) + goto exit; + + *free_input = TRUE; + + /* TODO: set OsyncError */ + +exit: + return result; } static osync_bool conv_contact_to_xslt(char *input, unsigned int inpsize, char **output, unsigned int *outpsize, osync_bool *free_input, const char *config, void *userdata, OSyncError **error) |
From: <dg...@su...> - 2009-01-20 16:20:14
|
Author: savago Date: Tue Jan 20 17:19:10 2009 New Revision: 5210 URL: http://www.opensync.org/changeset/5210 Log: Aesthetics. Modified: format-plugins/xsltformat/src/xsltformat.c Modified: format-plugins/xsltformat/src/xsltformat.c ============================================================================== --- format-plugins/xsltformat/src/xsltformat.c Tue Jan 20 17:07:23 2009 (r5209) +++ format-plugins/xsltformat/src/xsltformat.c Tue Jan 20 17:19:10 2009 (r5210) @@ -225,6 +225,7 @@ osync_bool get_conversion_info(OSyncFormatEnv *env, OSyncError **error) { + osync_bool result; /* Supported formats */ OSyncObjFormat *xslt_contact = osync_format_env_find_objformat(env, "xslt-contact"); if (!xslt_contact) { @@ -240,16 +241,16 @@ } /* XSLT to xml-contact */ - osync_bool result = reg_conv(env, xslt_contact, xml_contact, - conv_xslt_to_contact, - initialize_xslt, finalize_xslt); + result = reg_conv(env, xslt_contact, xml_contact, + conv_xslt_to_contact, + initialize_xslt, finalize_xslt); if (!result) return FALSE; /* xml-contact to XSLT */ result = reg_conv(env, xml_contact, xslt_contact, - conv_contact_to_xslt, - initialize_xslt, finalize_xslt); + conv_contact_to_xslt, + initialize_xslt, finalize_xslt); return result; } |
From: <dg...@su...> - 2009-01-20 16:08:31
|
Author: savago Date: Tue Jan 20 17:07:23 2009 New Revision: 5209 URL: http://www.opensync.org/changeset/5209 Log: Moving converter creation and registration to a function to avoid code duplication. Modified: format-plugins/xsltformat/src/xsltformat.c Modified: format-plugins/xsltformat/src/xsltformat.c ============================================================================== --- format-plugins/xsltformat/src/xsltformat.c Tue Jan 20 16:46:07 2009 (r5208) +++ format-plugins/xsltformat/src/xsltformat.c Tue Jan 20 17:07:23 2009 (r5209) @@ -201,6 +201,28 @@ } +static osync_bool reg_conv(OSyncFormatEnv *env, + OSyncObjFormat *from, OSyncObjFormat *to, + OSyncFormatConvertFunc convert_func, + OSyncFormatConverterInitializeFunc initialize_func, + OSyncFormatConverterFinalizeFunc finalize_func) +{ + OSyncError *error = NULL; + OSyncFormatConverter *conv = osync_converter_new(OSYNC_CONVERTER_CONV, + from, to, + convert_func, &error); + if (!conv) + return FALSE; + + osync_converter_set_initialize_func(conv, initialize_func); + osync_converter_set_finalize_func(conv, finalize_func); + osync_format_env_register_converter(env, conv); + osync_converter_unref(conv); + + return TRUE; + +} + osync_bool get_conversion_info(OSyncFormatEnv *env, OSyncError **error) { /* Supported formats */ @@ -218,27 +240,18 @@ } /* XSLT to xml-contact */ - OSyncFormatConverter *conv = osync_converter_new(OSYNC_CONVERTER_CONV, - xslt_contact, xml_contact, - conv_xslt_to_contact, error); - if (!conv) + osync_bool result = reg_conv(env, xslt_contact, xml_contact, + conv_xslt_to_contact, + initialize_xslt, finalize_xslt); + if (!result) return FALSE; - osync_converter_set_initialize_func(conv, initialize_xslt); - osync_converter_set_finalize_func(conv, finalize_xslt); - osync_format_env_register_converter(env, conv); - osync_converter_unref(conv); /* xml-contact to XSLT */ - conv = osync_converter_new(OSYNC_CONVERTER_CONV, - xml_contact, xslt_contact, - conv_contact_to_xslt, error); - if (!conv) - return FALSE; - osync_converter_set_initialize_func(conv, initialize_xslt); - osync_converter_set_finalize_func(conv, finalize_xslt); - osync_format_env_register_converter(env, conv); - osync_converter_unref(conv); - return TRUE; + result = reg_conv(env, xml_contact, xslt_contact, + conv_contact_to_xslt, + initialize_xslt, finalize_xslt); + return result; + } int get_version(void) |
From: <dg...@su...> - 2009-01-20 15:47:12
|
Author: savago Date: Tue Jan 20 16:46:07 2009 New Revision: 5208 URL: http://www.opensync.org/changeset/5208 Log: Purging unnecessary comment. Modified: format-plugins/xsltformat/src/xsltformat.c Modified: format-plugins/xsltformat/src/xsltformat.c ============================================================================== --- format-plugins/xsltformat/src/xsltformat.c Tue Jan 20 16:44:06 2009 (r5207) +++ format-plugins/xsltformat/src/xsltformat.c Tue Jan 20 16:46:07 2009 (r5208) @@ -236,7 +236,6 @@ return FALSE; osync_converter_set_initialize_func(conv, initialize_xslt); osync_converter_set_finalize_func(conv, finalize_xslt); - /* register converter */ osync_format_env_register_converter(env, conv); osync_converter_unref(conv); return TRUE; |
From: <dg...@su...> - 2009-01-20 15:45:15
|
Author: savago Date: Tue Jan 20 16:44:06 2009 New Revision: 5207 URL: http://www.opensync.org/changeset/5207 Log: Creating and deleting a XSLT transform context is the same code for both converting from whatever-format to xmlformat and vice-versa. Modified: format-plugins/xsltformat/src/xsltformat.c Modified: format-plugins/xsltformat/src/xsltformat.c ============================================================================== --- format-plugins/xsltformat/src/xsltformat.c Tue Jan 20 13:38:55 2009 (r5206) +++ format-plugins/xsltformat/src/xsltformat.c Tue Jan 20 16:44:06 2009 (r5207) @@ -175,7 +175,7 @@ return TRUE; } -void *init_xslt_to_contact(const char* config, OSyncError **error) +void *initialize_xslt(const char* config, OSyncError **error) { struct xslt_resources *converter = xslt_new(); int result = 0; @@ -190,7 +190,7 @@ } -void fin_xslt_to_contact(void *userdata) +void finalize_xslt(void *userdata) { struct xslt_resources *converter = NULL; if (!userdata) @@ -223,8 +223,8 @@ conv_xslt_to_contact, error); if (!conv) return FALSE; - osync_converter_set_initialize_func(conv, init_xslt_to_contact); - osync_converter_set_finalize_func(conv, fin_xslt_to_contact); + osync_converter_set_initialize_func(conv, initialize_xslt); + osync_converter_set_finalize_func(conv, finalize_xslt); osync_format_env_register_converter(env, conv); osync_converter_unref(conv); @@ -234,7 +234,8 @@ conv_contact_to_xslt, error); if (!conv) return FALSE; - /* e.g. this converter doesn't need init and finalize functions therefore don't set them */ + osync_converter_set_initialize_func(conv, initialize_xslt); + osync_converter_set_finalize_func(conv, finalize_xslt); /* register converter */ osync_format_env_register_converter(env, conv); osync_converter_unref(conv); |
From: <dg...@su...> - 2009-01-20 12:40:56
|
Author: savago Date: Tue Jan 20 12:43:51 2009 New Revision: 5205 URL: http://www.opensync.org/changeset/5205 Log: Since I changed the conversion path to create each change informed on get_changes, I got to copy the contents of converted google-data XML for each change (since it will have a pointer to this string). This fixes a double-free condition. Finally, I updated the type of each sink to reflect the change r5191. Modified: plugins/google-calendar/src/gcalendar.c Modified: plugins/google-calendar/src/gcalendar.c ============================================================================== --- plugins/google-calendar/src/gcalendar.c Mon Jan 19 23:39:30 2009 (r5204) +++ plugins/google-calendar/src/gcalendar.c Tue Jan 20 12:43:51 2009 (r5205) @@ -290,7 +290,7 @@ goto error; raw_xml = plgdata->xslt_ctx_gcal->xml_str; - odata = osync_data_new(raw_xml, + odata = osync_data_new(strdup(raw_xml), strlen(raw_xml), plgdata->gcal_format, &error); if (!odata) @@ -442,7 +442,7 @@ goto error; raw_xml = plgdata->xslt_ctx_gcont->xml_str; - odata = osync_data_new(raw_xml, + odata = osync_data_new(strdup(raw_xml), strlen(raw_xml), plgdata->gcont_format, &error); if (!odata) @@ -847,7 +847,7 @@ if (plgdata->calendar) { osync_trace(TRACE_INTERNAL, "\tcreating calendar sink...\n"); OSyncFormatEnv *formatenv1 = osync_plugin_info_get_format_env(info); - plgdata->gcal_format = osync_format_env_find_objformat(formatenv1, "xmlformat-event"); + plgdata->gcal_format = osync_format_env_find_objformat(formatenv1, "xmlformat-event-doc"); if (!plgdata->gcal_format) { osync_trace(TRACE_ERROR, "%s", "Failed to find objformat xmlformat-event!"); goto error_freeplg; @@ -877,7 +877,7 @@ if (plgdata->contacts) { osync_trace(TRACE_INTERNAL, "\tcreating contact sink...\n"); OSyncFormatEnv *formatenv2 = osync_plugin_info_get_format_env(info); - plgdata->gcont_format = osync_format_env_find_objformat(formatenv2, "xmlformat-contact"); + plgdata->gcont_format = osync_format_env_find_objformat(formatenv2, "xmlformat-contact-doc"); if (!plgdata->gcont_format) { osync_trace(TRACE_ERROR, "%s", "Failed to find objformat xmlformat-contact!"); goto error_freeplg; |
From: <dg...@su...> - 2009-01-20 12:40:05
|
Author: savago Date: Tue Jan 20 13:38:55 2009 New Revision: 5206 URL: http://www.opensync.org/changeset/5206 Log: Cannot free OSyncData buffer. Modified: plugins/google-calendar/src/gcalendar.c Modified: plugins/google-calendar/src/gcalendar.c ============================================================================== --- plugins/google-calendar/src/gcalendar.c Tue Jan 20 12:43:51 2009 (r5205) +++ plugins/google-calendar/src/gcalendar.c Tue Jan 20 13:38:55 2009 (r5206) @@ -593,7 +593,7 @@ } - free(osync_xml); + // free(osync_xml); osync_context_report_success(ctx); osync_trace(TRACE_EXIT, "%s", __func__); @@ -700,7 +700,7 @@ gcal_contact_delete(contact); } - free(osync_xml); + //free(osync_xml); osync_context_report_success(ctx); osync_trace(TRACE_EXIT, "%s", __func__); |
From: <dg...@su...> - 2009-01-20 12:19:58
|
Author: bellmich Date: Tue Jan 20 13:18:47 2009 New Revision: 175 URL: http://libwbxml.opensync.org/changeset/175 Log: ignore hexadecimal conversion tests Modified: wbxmlTestSuite/trunk/launchTests.sh Modified: wbxmlTestSuite/trunk/launchTests.sh ============================================================================== --- wbxmlTestSuite/trunk/launchTests.sh Tue Jan 20 13:18:27 2009 (r174) +++ wbxmlTestSuite/trunk/launchTests.sh Tue Jan 20 13:18:47 2009 (r175) @@ -161,7 +161,12 @@ else if [ `basename $j` = "syncml-012.xml" -o `basename $j` = "syncml-013.xml" ] then # SyncML CDATA fix makes comparing sometimes impossible - echo IMPOSSIBLE + echo CDATA_ENCAPSULATION + else if [ `basename $j` = "wv-021.xml" -o `basename $j` = "wv-022.xml" -o `basename $j` = "wv-023.xml" -o `basename $j` = "wv-024.xml" ] + then + # WV tests which test hexadecimal numbers can only executed + # because libwbxml always outputs decimal numbers + echo HEX_CONVERSION else $PERL_BIN $NORMALIZE_SCRIPT --delete-attribute xmlns $j $OUT_XML.org $PERL_BIN $NORMALIZE_SCRIPT --delete-attribute xmlns $OUT_XML $OUT_XML.new @@ -173,7 +178,7 @@ else echo SUCCEEDED fi - fi fi + fi fi fi done fi |
From: <dg...@su...> - 2009-01-20 12:19:50
|
Author: bellmich Date: Tue Jan 20 13:18:27 2009 New Revision: 174 URL: http://libwbxml.opensync.org/changeset/174 Log: - fixed ticket #26 (extension tokens must not be replaced within normal text) - fixed copyright (new year) Modified: wbxml2/trunk/src/wbxml_encoder.c wbxml2/trunk/src/wbxml_parser.c Modified: wbxml2/trunk/src/wbxml_encoder.c ============================================================================== --- wbxml2/trunk/src/wbxml_encoder.c Mon Jan 19 18:39:33 2009 (r173) +++ wbxml2/trunk/src/wbxml_encoder.c Tue Jan 20 13:18:27 2009 (r174) @@ -1,7 +1,7 @@ /* * libwbxml, the WBXML Library. * Copyright (C) 2002-2008 Aymerick Jehanne <aym...@je...> - * Copyright (C) 2008 Michael Bell <mic...@op...> + * Copyright (C) 2008-2009 Michael Bell <mic...@op...> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -2136,8 +2136,17 @@ if (WBXML_STRLEN(encoder->lang->extValueTable[j].xmlName) < 2) continue; - /* Is this Extension Token contained in this Buffer ? */ - if (wbxml_buffer_search_cstr(elt->u.str, (WB_UTINY *) encoder->lang->extValueTable[j].xmlName, 0, &index)) + /* Is this Extension Token contained in this Buffer ? + * + * The Extension Token must start at the beginning of + * the buffer. Otherwise we can damage normal text + * entities like 'My IM-application.' If 'IM' is an + * Extension Token. + * + * Assumption: The buffer is already normalized. + */ + // if (wbxml_buffer_search_cstr(elt->u.str, (WB_UTINY *) encoder->lang->extValueTable[j].xmlName, 0, &index)) + if (wbxml_buffer_compare_cstr(elt->u.str, (WB_UTINY *) encoder->lang->extValueTable[j].xmlName) == 0) { /* Create new Value Element */ if ((new_elt = wbxml_value_element_create()) == NULL) { Modified: wbxml2/trunk/src/wbxml_parser.c ============================================================================== --- wbxml2/trunk/src/wbxml_parser.c Mon Jan 19 18:39:33 2009 (r173) +++ wbxml2/trunk/src/wbxml_parser.c Tue Jan 20 13:18:27 2009 (r174) @@ -1,6 +1,7 @@ /* * libwbxml, the WBXML Library. * Copyright (C) 2002-2008 Aymerick Jehanne <aym...@je...> + * Copyright (C) 2009 Michael Bell <mic...@op...> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public |
From: <dg...@su...> - 2009-01-20 10:18:07
|
Author: bellmich Date: Tue Jan 20 11:16:53 2009 New Revision: 896 URL: http://libsyncml.opensync.org/changeset/896 Log: ticket #212 added IRDA support to OBEX client The patch was developed by Peter Collingbourne <pe...@pc...>. Modified: trunk/libsyncml/transports/obex_client.c trunk/libsyncml/transports/obex_client_internals.h trunk/tools/syncml-ds-tool.c Modified: trunk/libsyncml/transports/obex_client.c ============================================================================== --- trunk/libsyncml/transports/obex_client.c Mon Jan 19 11:47:43 2009 (r895) +++ trunk/libsyncml/transports/obex_client.c Tue Jan 20 11:16:53 2009 (r896) @@ -621,6 +621,11 @@ env->path = g_strdup(value); smlTrace(TRACE_INTERNAL, "%s: URL or Bluetooth MAC %s detected", __func__, VA_STRING(env->path)); + } else if (!strcmp(name, SML_TRANSPORT_CONFIG_IRDA_SERVICE)) { + if (env->irda_service) + smlSafeCFree(&(env->irda_service)); + env->irda_service = g_strdup(value); + smlTrace(TRACE_INTERNAL, "%s: IrDA service %s detected", __func__, VA_STRING(env->irda_service)); } else if (!strcmp(name, SML_TRANSPORT_CONFIG_AT_COMMAND)) { if (env->at_command) smlSafeCFree(&(env->at_command)); @@ -790,6 +795,8 @@ OBEX_Cleanup(env->obexhandle); + if (env->irda_service) + smlSafeCFree(&(env->irda_service)); if (env->at_command) smlSafeCFree(&(env->at_command)); if (env->manufacturer) @@ -892,6 +899,17 @@ smlErrorSet(&error, SML_ERROR_GENERIC, "Bluetooth not enabled"); goto error; #endif + } else if (env->type == SML_TRANSPORT_CONNECTION_TYPE_IRDA) { + smlTrace(TRACE_INTERNAL, "%s: connecting to IrDA service %s", __func__, env->irda_service ? env->irda_service : "OBEX"); + + if (GET_OBEX_RESULT(IrOBEX_TransportConnect(env->obexhandle, env->irda_service)) < 0) { + smlErrorSet(&error, SML_ERROR_GENERIC, + "The IrDA connect failed. %s (%i).", + strerror(errno), errno); + goto error; + } + + smlTrace(TRACE_INTERNAL, "%s: IrDA connect done", __func__); } else { struct termios tio; memset(&tio, 0, sizeof(tio)); @@ -937,7 +955,9 @@ tcflush(fd, TCIFLUSH); } - if (env->type != SML_TRANSPORT_CONNECTION_TYPE_USB && env->type != SML_TRANSPORT_CONNECTION_TYPE_BLUETOOTH) { + if (env->type != SML_TRANSPORT_CONNECTION_TYPE_USB + && env->type != SML_TRANSPORT_CONNECTION_TYPE_BLUETOOTH + && env->type != SML_TRANSPORT_CONNECTION_TYPE_IRDA) { /* Start the obex transport */ if (GET_OBEX_RESULT(FdOBEX_TransportSetup(env->obexhandle, fd, fd, 4096)) < 0) { smlErrorSet(&error, SML_ERROR_GENERIC, Modified: trunk/libsyncml/transports/obex_client_internals.h ============================================================================== --- trunk/libsyncml/transports/obex_client_internals.h Mon Jan 19 11:47:43 2009 (r895) +++ trunk/libsyncml/transports/obex_client_internals.h Tue Jan 20 11:16:53 2009 (r896) @@ -50,6 +50,7 @@ uint32_t connection_id; char *path; unsigned int port; + char *irda_service; char *at_command; char *manufacturer; char *model; Modified: trunk/tools/syncml-ds-tool.c ============================================================================== --- trunk/tools/syncml-ds-tool.c Mon Jan 19 11:47:43 2009 (r895) +++ trunk/tools/syncml-ds-tool.c Tue Jan 20 11:16:53 2009 (r896) @@ -83,6 +83,12 @@ * @param --ip "<addr>" "<port>" * Connect to this TCP/IP address. * + * @param --irda + * Connect using IrDA. + * + * @param --irda-service "<service>" + * Use the given IrDA service (default: OBEX). + * * @subsection OPTION_OBEX_SERVER_CONFIG OBEX server configuration * * @param --port "<port>" @@ -776,7 +782,9 @@ fprintf(stderr, "\t-u\t\tList all available USB interfaces.\n"); fprintf(stderr, "\t-u <id>\t\tConnect to the given usb interface number.\n"); fprintf(stderr, "\t-b <addr> <channel>\tConnect to the given bluetooth device.\n"); - fprintf(stderr, "\t--ip <addr> <port>\tConnect to this TCP/IP address.\n\n"); + fprintf(stderr, "\t--ip <addr> <port>\tConnect to this TCP/IP address.\n"); + fprintf(stderr, "\t--irda\t\tConnect using IrDA.\n"); + fprintf(stderr, "\t--irda-service <service>\tUse the given IrDA service (default: OBEX).\n\n"); fprintf(stderr, "\tOBEX server configuration:\n"); fprintf(stderr, "\t==========================\n\n"); @@ -987,6 +995,28 @@ printf("Bluetooth is not available in this build\n"); return 1; #endif + } else if (!strcmp (arg, "--irda")) { + if (!smlDataSyncSetOption( + dsObject, + SML_DATA_SYNC_CONFIG_CONNECTION_TYPE, + SML_DATA_SYNC_CONFIG_CONNECTION_IRDA, + error)) + goto error; + } else if (!strcmp (arg, "--irda-service")) { + if (!smlDataSyncSetOption( + dsObject, + SML_DATA_SYNC_CONFIG_CONNECTION_TYPE, + SML_DATA_SYNC_CONFIG_CONNECTION_IRDA, + error)) + goto error; + i++; + if (!argv[i]) + usage (argv[0]); + if (!smlDataSyncSetOption( + dsObject, + SML_TRANSPORT_CONFIG_IRDA_SERVICE, + argv[i], error)) + goto error; } else if (!strcmp (arg, "-s")) { if (!smlDataSyncSetOption( dsObject, |
From: <dg...@su...> - 2009-01-19 22:40:31
|
Author: dgollub Date: Mon Jan 19 23:39:30 2009 New Revision: 5204 URL: http://www.opensync.org/changeset/5204 Log: Call multiply callback only once. Modified: trunk/opensync/engine/opensync_engine.c Modified: trunk/opensync/engine/opensync_engine.c ============================================================================== --- trunk/opensync/engine/opensync_engine.c Mon Jan 19 22:31:55 2009 (r5203) +++ trunk/opensync/engine/opensync_engine.c Mon Jan 19 23:39:30 2009 (r5204) @@ -1083,14 +1083,7 @@ osync_engine_event(engine, OSYNC_ENGINE_EVENT_ERROR); } else { osync_status_update_engine(engine, OSYNC_ENGINE_EVENT_MULTIPLIED, NULL); - - /* This is only for debugging purposes */ - osync_engine_trace_multiply_summary(engine); - - if (engine->multiply_callback) - engine->multiply_callback(engine, engine->multiply_userdata); - else - osync_engine_event(engine, OSYNC_ENGINE_EVENT_MULTIPLIED); + osync_engine_event(engine, OSYNC_ENGINE_EVENT_MULTIPLIED); } } else osync_trace(TRACE_INTERNAL, "Not yet: %i", osync_bitcount(engine->obj_errors | engine->obj_multiplied)); |
From: <dg...@su...> - 2009-01-19 22:30:49
|
Author: savago Date: Mon Jan 19 22:31:55 2009 New Revision: 5203 URL: http://www.opensync.org/changeset/5203 Log: Defining xslt plugin format name. Modified: format-plugins/xsltformat/src/xsltformat.c Modified: format-plugins/xsltformat/src/xsltformat.c ============================================================================== --- format-plugins/xsltformat/src/xsltformat.c Mon Jan 19 22:26:37 2009 (r5202) +++ format-plugins/xsltformat/src/xsltformat.c Mon Jan 19 22:31:55 2009 (r5203) @@ -159,7 +159,7 @@ /* * this function is called to register a new format */ - OSyncObjFormat *format = osync_objformat_new("<your format name>", "<some object type>", error); + OSyncObjFormat *format = osync_objformat_new("xslt", "contact", error); if (!format) return FALSE; |
From: <dg...@su...> - 2009-01-19 21:27:37
|
Author: savago Date: Mon Jan 19 22:26:37 2009 New Revision: 5202 URL: http://www.opensync.org/changeset/5202 Log: Dont install gdata format plugin (I will use the generic xslt converter format plugin when it is done). Modified: plugins/google-calendar/src/CMakeLists.txt Modified: plugins/google-calendar/src/CMakeLists.txt ============================================================================== --- plugins/google-calendar/src/CMakeLists.txt Mon Jan 19 22:24:24 2009 (r5201) +++ plugins/google-calendar/src/CMakeLists.txt Mon Jan 19 22:26:37 2009 (r5202) @@ -11,7 +11,8 @@ ###### INSTALL ################### OPENSYNC_PLUGIN_INSTALL( gcalendar ) -OPENSYNC_FORMAT_INSTALL( gdata-format ) +#Dont install it, see https://svn.opensync.org/format-plugins/xsltformat +#OPENSYNC_FORMAT_INSTALL( gdata-format ) # Install config template OPENSYNC_PLUGIN_CONFIG( google-data ) |
From: <dg...@su...> - 2009-01-19 21:25:24
|
Author: savago Date: Mon Jan 19 22:24:24 2009 New Revision: 5201 URL: http://www.opensync.org/changeset/5201 Log: Renaming initialize function and adding code to cleanup the XSLT context in finalize. Modified: format-plugins/xsltformat/src/xsltformat.c Modified: format-plugins/xsltformat/src/xsltformat.c ============================================================================== --- format-plugins/xsltformat/src/xsltformat.c Mon Jan 19 22:20:49 2009 (r5200) +++ format-plugins/xsltformat/src/xsltformat.c Mon Jan 19 22:24:24 2009 (r5201) @@ -175,7 +175,7 @@ return TRUE; } -void *initialize(const char* config, OSyncError **error) +void *init_xslt_to_contact(const char* config, OSyncError **error) { struct xslt_resources *converter = xslt_new(); int result = 0; @@ -190,15 +190,15 @@ } -void finalize(void *userdata) +void fin_xslt_to_contact(void *userdata) { - /* - * Here you can free all your converter specific data. - */ -/* format_data *formatdata =(format_data*)userdata; - g_free(formatdata->data); - g_free(formatdata); -*/ + struct xslt_resources *converter = NULL; + if (!userdata) + return; + + converter = (struct xslt_resources *)userdata; + xslt_delete(converter); + } osync_bool get_conversion_info(OSyncFormatEnv *env, OSyncError **error) @@ -223,8 +223,8 @@ conv_xslt_to_contact, error); if (!conv) return FALSE; - osync_converter_set_initialize_func(conv, initialize); - osync_converter_set_finalize_func(conv, finalize); + osync_converter_set_initialize_func(conv, init_xslt_to_contact); + osync_converter_set_finalize_func(conv, fin_xslt_to_contact); osync_format_env_register_converter(env, conv); osync_converter_unref(conv); |
From: <dg...@su...> - 2009-01-19 21:21:50
|
Author: savago Date: Mon Jan 19 22:20:49 2009 New Revision: 5200 URL: http://www.opensync.org/changeset/5200 Log: Adding code to create a XSLT context and load the transformation stylesheet. Modified: format-plugins/xsltformat/src/xsltformat.c Modified: format-plugins/xsltformat/src/xsltformat.c ============================================================================== --- format-plugins/xsltformat/src/xsltformat.c Mon Jan 19 22:15:35 2009 (r5199) +++ format-plugins/xsltformat/src/xsltformat.c Mon Jan 19 22:20:49 2009 (r5200) @@ -177,14 +177,17 @@ void *initialize(const char* config, OSyncError **error) { - /* - * Here you can create converter specific data. - * If you return the converter specific data, it is passed - * to the conversion and detector function as void *userdata - */ -/* format_data *userdata = osync_try_malloc0(sizeof(format_data), error); - return (void*)userdata; -*/ + struct xslt_resources *converter = xslt_new(); + int result = 0; + if (!converter) + osync_error_set(error, OSYNC_ERROR_GENERIC, + "Unable create xslt converter context."); + if ((result = xslt_initialize(converter, config))) + osync_error_set(error, OSYNC_ERROR_GENERIC, + "Unable load xslt stylesheet."); + + return converter; + } void finalize(void *userdata) |
From: <dg...@su...> - 2009-01-19 21:16:36
|
Author: savago Date: Mon Jan 19 22:15:35 2009 New Revision: 5199 URL: http://www.opensync.org/changeset/5199 Log: Updating function signature (eliminates compiler warning). Modified: format-plugins/xsltformat/src/xsltformat.c Modified: format-plugins/xsltformat/src/xsltformat.c ============================================================================== --- format-plugins/xsltformat/src/xsltformat.c Mon Jan 19 21:56:21 2009 (r5198) +++ format-plugins/xsltformat/src/xsltformat.c Mon Jan 19 22:15:35 2009 (r5199) @@ -33,7 +33,9 @@ #include <opensync/opensync-format.h> #include "xslt_aux.h" -static OSyncConvCmpResult compare_format1(const char *leftdata, unsigned int leftsize, const char *rightdata, unsigned int rightsize) +static OSyncConvCmpResult compare_format1(const char *leftdata, unsigned int leftsize, + const char *rightdata, unsigned int rightsize, + void *user_data) { /* * This function can be used to compare two types of your formats. @@ -116,7 +118,8 @@ return TRUE; } -static void destroy_format1(char *input, size_t inpsize) + +static void destroy_format1(char *input, unsigned int inpsize, void *user_data) { /* * Here you have to free the data allocated by your format @@ -162,8 +165,8 @@ osync_objformat_set_compare_func(format, compare_format1); osync_objformat_set_destroy_func(format, destroy_format1); - osync_objformat_set_duplicate_func(format, duplicate_format1); - osync_objformat_set_print_func(format, print_format1); + //osync_objformat_set_duplicate_func(format, duplicate_format1); + //osync_objformat_set_print_func(format, print_format1); osync_format_env_register_objformat(env, format); |