You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
(9) |
Apr
(84) |
May
(18) |
Jun
(12) |
Jul
(6) |
Aug
(7) |
Sep
(10) |
Oct
(31) |
Nov
(59) |
Dec
(14) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(53) |
Feb
(15) |
Mar
(43) |
Apr
(40) |
May
(63) |
Jun
(142) |
Jul
(54) |
Aug
(31) |
Sep
(30) |
Oct
(39) |
Nov
(36) |
Dec
(64) |
| 2007 |
Jan
(128) |
Feb
(261) |
Mar
(156) |
Apr
(127) |
May
(76) |
Jun
(131) |
Jul
(83) |
Aug
(124) |
Sep
(83) |
Oct
(88) |
Nov
(180) |
Dec
(90) |
| 2008 |
Jan
(86) |
Feb
(93) |
Mar
(117) |
Apr
(104) |
May
(65) |
Jun
(35) |
Jul
(38) |
Aug
(111) |
Sep
(58) |
Oct
(33) |
Nov
(102) |
Dec
(194) |
| 2009 |
Jan
(193) |
Feb
(74) |
Mar
(111) |
Apr
(77) |
May
(31) |
Jun
(20) |
Jul
(1) |
Aug
(3) |
Sep
(57) |
Oct
(125) |
Nov
(50) |
Dec
(3) |
| 2010 |
Jan
(26) |
Feb
(5) |
Mar
(13) |
Apr
(3) |
May
(3) |
Jun
(12) |
Jul
(27) |
Aug
(47) |
Sep
(105) |
Oct
(53) |
Nov
(34) |
Dec
(21) |
| 2011 |
Jan
(115) |
Feb
(17) |
Mar
|
Apr
(6) |
May
(16) |
Jun
(15) |
Jul
(85) |
Aug
(21) |
Sep
(13) |
Oct
(12) |
Nov
(28) |
Dec
(23) |
| 2012 |
Jan
|
Feb
(13) |
Mar
(4) |
Apr
|
May
(1) |
Jun
(5) |
Jul
(5) |
Aug
(31) |
Sep
(8) |
Oct
|
Nov
|
Dec
(1) |
| 2013 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(33) |
Sep
(9) |
Oct
(10) |
Nov
(2) |
Dec
|
| 2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
(4) |
| 2016 |
Jan
(2) |
Feb
|
Mar
(3) |
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
|
From: Henrik /K. <he...@ka...> - 2009-11-21 09:21:04
|
Daniel Gollub wrote: > On Monday 09 November 2009 07:19:37 pm Henrik /KaarPoSoft wrote: > >> However, I have a question: >> >> Assume we have a group with two members M1 and M2. >> Member M1 supports ObjFormat F1 with capabilities CAP1, and member M2 >> supports ObjFormat F2 with capabilities CAP2. >> >> The function _osync_obj_engine_mapping_find will try to compare two >> changes CHANGE1 and CHANGE2 from the two members. >> This is done by: _osync_obj_engine_clone_and_demerge_change(CAPS2, >> CHANGE1) and _osync_obj_engine_clone_and_demerge_change(CAPS1, CHANGE2). >> >> This means, that an ObjFormat F1, which supplies a (de)merger with >> capabilties CAP1, needs to be able to demerge changes of ObjFormat F2, >> which it does not know. >> > > OSyncCapsConverter take care about converting the caps-format to something the > demerge of F1 can handle ... > > For example the vformat plugins provides a caps-format converter for vformat > to xmlformat capabilities. > > So if the caps are reported in caps-format vformat .. and the entry to compare > is in xmlformat-contact, the caps get converted by this caps-format-converter > ... > > >> Some guidance on how the is supposed to work would be most appreciated. >> >> > > Does this help? > > Yes! Thank you very much for the explanation. I will see what I can do... /Henrik |
|
From: Daniel G. <go...@b1...> - 2009-11-20 11:49:11
|
On Monday 09 November 2009 07:19:37 pm Henrik /KaarPoSoft wrote: > However, I have a question: > > Assume we have a group with two members M1 and M2. > Member M1 supports ObjFormat F1 with capabilities CAP1, and member M2 > supports ObjFormat F2 with capabilities CAP2. > > The function _osync_obj_engine_mapping_find will try to compare two > changes CHANGE1 and CHANGE2 from the two members. > This is done by: _osync_obj_engine_clone_and_demerge_change(CAPS2, > CHANGE1) and _osync_obj_engine_clone_and_demerge_change(CAPS1, CHANGE2). > > This means, that an ObjFormat F1, which supplies a (de)merger with > capabilties CAP1, needs to be able to demerge changes of ObjFormat F2, > which it does not know. OSyncCapsConverter take care about converting the caps-format to something the demerge of F1 can handle ... For example the vformat plugins provides a caps-format converter for vformat to xmlformat capabilities. So if the caps are reported in caps-format vformat .. and the entry to compare is in xmlformat-contact, the caps get converted by this caps-format-converter ... > > Some guidance on how the is supposed to work would be most appreciated. > Does this help? Best Regards, Daniel -- Daniel Gollub Geschaeftsfuehrer: Ralph Dehner FOSS Developer Unternehmenssitz: Vohburg B1 Systems GmbH Amtsgericht: Ingolstadt Mobil: +49-(0)-160 47 73 970 Handelsregister: HRB 3537 EMail: go...@b1... http://www.b1-systems.de Adresse: B1 Systems GmbH, Osterfeldstraße 7, 85088 Vohburg http://pgpkeys.pca.dfn.de/pks/lookup?op=get&search=0xED14B95C2F8CA78D |
|
From: Henrik /K. <he...@ka...> - 2009-11-16 19:35:10
|
Chris Frey wrote: > On Thu, Nov 12, 2009 at 04:37:21PM +0100, Henrik /KaarPoSoft wrote: > >> Obviously a Frontend may have specific knowledge of specific plugins and >> create an even better GUI, but it would be nice if a Frontend could >> automatically create a GUI for any OpenSync plugin automatically. >> > > How is it possible to create a GUI for any plugin at the moment? > What if there are plugin-specific fields? How do you label them or > describe them in the GUI? > > blueZync is actually doing this at the moment. Far from perfect, but a start. See attached screenshots. The frontend simply creates a GUI based on advanced options and resources. > Would this have anything to do with these points: > > Subject: Config's AdvancedOption XML entity: Help? > http://sourceforge.net/mailarchive/forum.php?thread_name=20090221040116.GA15434%40foursquare.net&forum_name=opensync-devel > > Subject: localization in plugin configs > http://sourceforge.net/mailarchive/forum.php?thread_name=20091003014003.GA7477%40foursquare.net&forum_name=opensync-devel > Those would improve the GUI which could be presented. /Henrik |
|
From: Daniel G. <go...@b1...> - 2009-11-16 05:47:31
|
On Friday 13 November 2009 10:33:12 pm Chris Frey wrote: > I noticed that your patch added a prototype for > osync_mapping_entry_get_member_id() to the > opensync_mapping_entry_internals.h header. > > Yet that function already exists in opensync_mapping_entry.h > > Was this intended? > No, this was not intended. I reverted it ... thanks for finding this! Best Regards, Daniel -- Daniel Gollub Geschaeftsfuehrer: Ralph Dehner FOSS Developer Unternehmenssitz: Vohburg B1 Systems GmbH Amtsgericht: Ingolstadt Mobil: +49-(0)-160 47 73 970 Handelsregister: HRB 3537 EMail: go...@b1... http://www.b1-systems.de Adresse: B1 Systems GmbH, Osterfeldstraße 7, 85088 Vohburg http://pgpkeys.pca.dfn.de/pks/lookup?op=get&search=0xED14B95C2F8CA78D |
|
From: Daniel G. <go...@b1...> - 2009-11-15 12:01:38
|
On Friday 13 November 2009 10:30:03 pm Chris Frey wrote: > On Thu, Nov 12, 2009 at 04:36:40PM -0500, Chris Frey wrote: > > I think the GCC_FORMAT_CHECK is worth it in the long run (there were lots > > of printf style errors in the code), but the (void*) casts are > > unfortunate. Anyone know of a cleaner workaround? > > After a conversation on #gcc on irc.freenode.net (thanks to segher), > I had the following enlightenment: > > - the C standard does not guarantee that all pointers are the same > size on all platforms > > - for example, data pointers and function pointers can have > differing formats > > - the C standard guarantees that you can cast all pointers to void* > and back > > - the %p format string identifier only takes a void* > > - vararg functions cannot provide implicit casts, since there is > no prototype for the variable data > > - so in general, to be standard-C correct, you need to cast all > %p pointers to vararg functions > > - the -pedantic option makes all this show up explicitly, but in > most cases you don't need it, at least with gcc > > Basically there's no way around it, except disabling -pedantic in your > compiles, or adding (void*) casts to all %p pointers. > Thank you very much for sharing this knowledge! Best Regards, Daniel -- Daniel Gollub Geschaeftsfuehrer: Ralph Dehner FOSS Developer Unternehmenssitz: Vohburg B1 Systems GmbH Amtsgericht: Ingolstadt Mobil: +49-(0)-160 47 73 970 Handelsregister: HRB 3537 EMail: go...@b1... http://www.b1-systems.de Adresse: B1 Systems GmbH, Osterfeldstraße 7, 85088 Vohburg http://pgpkeys.pca.dfn.de/pks/lookup?op=get&search=0xED14B95C2F8CA78D |
|
From: Graham C. <g+o...@co...> - 2009-11-14 09:24:38
|
On Tue, Nov 10, 2009 at 01:46:46AM +0100, Henrik /KaarPoSoft wrote: > Now the question is: Where to put the definition of the C struct and the > wrapping functions? My suggestion would be to put the struct and wrapping functions in a completely separate library (nothing to do with Opensync) which you then use from both the format plugin and the sync plugin. Your new library would, of course, become a dependency of the plugins. I think there would be three options for distributing it: 1) Statically link it and don't distribute it at all. This would require getting Daniel to create you somewhere in the tree to store the library but you wouldn't be shipping the code at all. CMake magic could compile it whenever needed by either plugin. 2) Completely separate it from OpenSync: build it and distribute it separately and just make sure the CMake scripts for the two plugins correctly check for it being installed. A variant of this would be to ask Daniel to still host it in the OpenSync SVN somewhere but build it and distribute it separately (a bit like libsyncml). 3) Have it built and installed as part of the building of your plugins -- so building either your format plugin or your sync plugin would require previously building and installing your new library. Easy enough to do manually although it would be an extra step for anyone who wanted to build your plugins. Graham |
|
From: Chris F. <cd...@fo...> - 2009-11-13 22:48:30
|
On Thu, Nov 12, 2009 at 04:37:21PM +0100, Henrik /KaarPoSoft wrote: > Obviously a Frontend may have specific knowledge of specific plugins and > create an even better GUI, but it would be nice if a Frontend could > automatically create a GUI for any OpenSync plugin automatically. How is it possible to create a GUI for any plugin at the moment? What if there are plugin-specific fields? How do you label them or describe them in the GUI? Would this have anything to do with these points: Subject: Config's AdvancedOption XML entity: Help? http://sourceforge.net/mailarchive/forum.php?thread_name=20090221040116.GA15434%40foursquare.net&forum_name=opensync-devel Subject: localization in plugin configs http://sourceforge.net/mailarchive/forum.php?thread_name=20091003014003.GA7477%40foursquare.net&forum_name=opensync-devel - Chris |
|
From: Chris F. <cd...@fo...> - 2009-11-13 21:42:11
|
Hi,
At long last, I present my long long patch, which also changes the various
ID variables into typedefs in the process. I think this makes the code
cleaner, and easier to change in the future. So even if we don't want
to change mappingids, memberids, etc to ints, we should keep the
typedefs in my opinion.
This is a Request for Comments patch only. If it is satisfactory, I
can apply it in a few days.
It is fairly large, but the changes are as limited in scope as possible.
Thanks,
- Chris
[PATCH] Removed all unnecessary long longs from IDs, and gave IDs typedef names
The new ID types are:
typedef int osync_memberid;
typedef int osync_mappingid;
typedef int osync_groupid;
typedef long long int osync_archiveid;
typedef long long int osync_messageid;
osync_archiveid is 64 bits because the ID is the row ID of the underlying
database. This must match the database used.
Note that there is a bug in the implementation where the above 64 bit
IDs are crammed into a 32 bit pointer on 32 bit systems. The
implementation should be fixed, not the size of the osync_archiveid.
Look for FIXME's in the code.
osync_messageid is 64 bits because 6 bytes are used for the time in
seconds and microseconds, and the lower 2 bytes are a random number,
to create a unique IPC message ID.
The other 3 IDs usually start at 1 or 0 and increment from there,
and int should be completely sufficient for them.
---
opensync/archive/opensync_archive.c | 51 +++++++++++---------
opensync/archive/opensync_archive_internals.h | 8 ++--
opensync/client/opensync_client.c | 4 +-
opensync/client/opensync_client_proxy.c | 6 +-
opensync/engine/opensync_engine.c | 10 ++--
opensync/engine/opensync_engine_private.h | 2 +-
opensync/engine/opensync_mapping_engine.c | 12 ++--
opensync/engine/opensync_mapping_engine.h | 2 +-
opensync/engine/opensync_obj_engine.c | 12 ++--
opensync/engine/opensync_sink_engine.c | 2 +-
opensync/group/opensync_group.c | 14 +++---
opensync/group/opensync_group.h | 6 +-
opensync/group/opensync_group_env.c | 8 ++--
opensync/group/opensync_group_env_private.h | 2 +-
opensync/group/opensync_group_internals.h | 2 +-
opensync/group/opensync_group_private.h | 2 +-
opensync/group/opensync_member.c | 4 +-
opensync/group/opensync_member.h | 2 +-
opensync/group/opensync_member_internals.h | 2 +-
opensync/ipc/opensync_message.c | 4 +-
opensync/ipc/opensync_message_internals.h | 4 +-
opensync/ipc/opensync_message_private.h | 2 +-
opensync/ipc/opensync_queue.c | 6 +-
opensync/ipc/opensync_queue_private.h | 4 +-
opensync/mapping/opensync_mapping.c | 6 +-
opensync/mapping/opensync_mapping.h | 6 +-
opensync/mapping/opensync_mapping_entry.c | 8 ++--
opensync/mapping/opensync_mapping_entry.h | 8 ++--
.../mapping/opensync_mapping_entry_internals.h | 6 +-
opensync/mapping/opensync_mapping_internals.h | 2 +-
opensync/mapping/opensync_mapping_table.c | 14 +++--
opensync/mapping/opensync_mapping_table.h | 4 +-
opensync/opensync.h | 5 ++
opensync/plugin/opensync_plugin_info_private.h | 2 +-
tests/archive-tests/check_archive.c | 8 ++--
tests/mock-plugin/mock_sync.c | 2 +-
wrapper/opensync-group.i | 4 +-
37 files changed, 129 insertions(+), 117 deletions(-)
diff --git a/opensync/archive/opensync_archive.c b/opensync/archive/opensync_archive.c
index d3fbe8a..16e0d87 100644
--- a/opensync/archive/opensync_archive.c
+++ b/opensync/archive/opensync_archive.c
@@ -204,12 +204,12 @@ void osync_archive_unref(OSyncArchive *archive)
}
}
-osync_bool osync_archive_save_data(OSyncArchive *archive, long long int id, const char *objtype, const char *data, unsigned int size, OSyncError **error)
+osync_bool osync_archive_save_data(OSyncArchive *archive, osync_mappingid id, const char *objtype, const char *data, unsigned int size, OSyncError **error)
{
char *query = NULL;
char *escaped_objtype = NULL;
- osync_trace(TRACE_ENTRY, "%s(%p, %lli, %s, %p, %u, %p)", __func__, archive, id, objtype, data, size, error);
+ osync_trace(TRACE_ENTRY, "%s(%p, %i, %s, %p, %u, %p)", __func__, archive, id, objtype, data, size, error);
osync_assert(archive);
osync_assert(data);
osync_assert(size);
@@ -219,7 +219,7 @@ osync_bool osync_archive_save_data(OSyncArchive *archive, long long int id, cons
// FIXME: Avoid subselect - this query needs up to 0.5s
escaped_objtype = osync_db_sql_escape(objtype);
- query = osync_strdup_printf("REPLACE INTO tbl_archive (objtype, mappingid, data) VALUES('%s', %lli, ?)", escaped_objtype, id);
+ query = osync_strdup_printf("REPLACE INTO tbl_archive (objtype, mappingid, data) VALUES('%s', %i, ?)", escaped_objtype, id);
osync_free(escaped_objtype);
escaped_objtype = NULL;
@@ -281,14 +281,14 @@ int osync_archive_load_data(OSyncArchive *archive, const char *uid, const char *
return -1;
}
-long long int osync_archive_save_change(OSyncArchive *archive, long long int id, const char *uid, const char *objtype, long long int mappingid, long long int memberid, const char *objengine, OSyncError **error)
+osync_archiveid osync_archive_save_change(OSyncArchive *archive, osync_archiveid id, const char *uid, const char *objtype, osync_mappingid mappingid, osync_memberid memberid, const char *objengine, OSyncError **error)
{
char *query = NULL;
char *escaped_uid = NULL;
char *escaped_objtype = NULL;
char *escaped_objengine = NULL;
- osync_trace(TRACE_ENTRY, "%s(%p, %lli, %s, %s, %lli, %lli, %p, %p)", __func__, archive, id, uid, objtype, mappingid, memberid, __NULLSTR(objengine), error);
+ osync_trace(TRACE_ENTRY, "%s(%p, %lli, %s, %s, %i, %i, %p, %p)", __func__, archive, id, uid, objtype, mappingid, memberid, __NULLSTR(objengine), error);
osync_assert(archive);
osync_assert(uid);
osync_assert(objtype);
@@ -302,9 +302,9 @@ long long int osync_archive_save_change(OSyncArchive *archive, long long int id,
escaped_objengine = osync_db_sql_escape(objengine);
if (!id) {
- query = osync_strdup_printf("INSERT INTO tbl_changes (objtype, uid, mappingid, memberid, objengine) VALUES('%s', '%s', '%lli', '%lli', '%s')", escaped_objtype, escaped_uid, mappingid, memberid, objengine);
+ query = osync_strdup_printf("INSERT INTO tbl_changes (objtype, uid, mappingid, memberid, objengine) VALUES('%s', '%s', '%i', '%i', '%s')", escaped_objtype, escaped_uid, mappingid, memberid, objengine);
} else {
- query = osync_strdup_printf("UPDATE tbl_changes SET uid='%s', mappingid='%lli', memberid='%lli', objengine='%s' WHERE objtype='%s' AND id=%lli", escaped_uid, mappingid, memberid, escaped_objengine, escaped_objtype, id);
+ query = osync_strdup_printf("UPDATE tbl_changes SET uid='%s', mappingid='%i', memberid='%i', objengine='%s' WHERE objtype='%s' AND id=%lli", escaped_uid, mappingid, memberid, escaped_objengine, escaped_objtype, id);
}
osync_free(escaped_objengine);
osync_free(escaped_objtype);
@@ -331,7 +331,7 @@ long long int osync_archive_save_change(OSyncArchive *archive, long long int id,
return 0;
}
-osync_bool osync_archive_delete_change(OSyncArchive *archive, long long int id, const char *objtype, OSyncError **error)
+osync_bool osync_archive_delete_change(OSyncArchive *archive, osync_archiveid id, const char *objtype, OSyncError **error)
{
char *query = NULL;
char *escaped_objtype = NULL;
@@ -366,7 +366,9 @@ osync_bool osync_archive_load_changes(OSyncArchive *archive, const char *objtype
char *query = NULL;
char *escaped_objtype = NULL;
OSyncList *result = NULL, *row = NULL, *column = NULL;
- long long int id = 0, mappingid = 0, memberid = 0;
+ osync_archiveid id = 0;
+ osync_mappingid mappingid = 0;
+ osync_memberid memberid = 0;
const char *uid = NULL;
const char *value_str = NULL;
@@ -420,21 +422,23 @@ osync_bool osync_archive_load_changes(OSyncArchive *archive, const char *objtype
osync_error_set(error, OSYNC_ERROR_GENERIC, "Database table tbl_changes corrupt, mappingid is NULL");
goto error;
}
- mappingid = g_ascii_strtoull(value_str, NULL, 0);
+ mappingid = strtoul(value_str, NULL, 0);
value_str = osync_list_nth_data(column, 3);
if (!value_str) {
osync_error_set(error, OSYNC_ERROR_GENERIC, "Database table tbl_changes corrupt, memberid is NULL");
goto error;
}
- memberid = g_ascii_strtoull(value_str, NULL, 0);
+ memberid = strtoul(value_str, NULL, 0);
+ // FIXME - this (int) cast throws away part of the id's 64 bits
+ // and these 64 bits are governed by the DB layer's row ID
*ids = osync_list_append((*ids), GINT_TO_POINTER((int)id));
*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));
+ *mappingids = osync_list_append((*mappingids), GINT_TO_POINTER(mappingid));
+ *memberids = osync_list_append((*memberids), GINT_TO_POINTER(memberid));
- osync_trace(TRACE_INTERNAL, "Loaded change with uid %s, mappingid %lli from member %lli", uid, mappingid, memberid);
+ osync_trace(TRACE_INTERNAL, "Loaded change with uid %s, mappingid %i from member %i", uid, mappingid, memberid);
}
osync_db_free_list(result);
@@ -483,7 +487,8 @@ osync_bool osync_archive_load_ignored_conflicts(OSyncArchive *archive, const cha
OSyncList *result = NULL, *row = NULL, *column = NULL;
char *query = NULL;
char *escaped_objtype = NULL;
- long long int mappingid = 0, memberid = 0;
+ osync_mappingid mappingid = 0;
+ osync_memberid memberid = 0;
int changetype = 0;
osync_trace(TRACE_ENTRY, "%s(%p, %s, %p, %p)", __func__, archive, objtype, mappingids, error);
@@ -516,11 +521,11 @@ osync_bool osync_archive_load_ignored_conflicts(OSyncArchive *archive, const cha
mappingid = atoi(osync_list_nth_data(column, 1));
changetype = atoi(osync_list_nth_data(column, 2));
- *memberids = osync_list_append((*memberids), GINT_TO_POINTER((int)memberid));
- *mappingids = osync_list_append((*mappingids), GINT_TO_POINTER((int)mappingid));
- *changetypes = osync_list_append((*changetypes), GINT_TO_POINTER((int)changetype));
+ *memberids = osync_list_append((*memberids), GINT_TO_POINTER(memberid));
+ *mappingids = osync_list_append((*mappingids), GINT_TO_POINTER(mappingid));
+ *changetypes = osync_list_append((*changetypes), GINT_TO_POINTER(changetype));
- osync_trace(TRACE_INTERNAL, "Loaded ignored mapping with mappingid %lli", mappingid);
+ osync_trace(TRACE_INTERNAL, "Loaded ignored mapping with mappingid %i", mappingid);
}
osync_db_free_list(result);
@@ -532,11 +537,11 @@ osync_bool osync_archive_load_ignored_conflicts(OSyncArchive *archive, const cha
return FALSE;
}
-osync_bool osync_archive_save_ignored_conflict(OSyncArchive *archive, const char *objtype, long long int memberid, long long int mappingid, OSyncChangeType changetype, OSyncError **error)
+osync_bool osync_archive_save_ignored_conflict(OSyncArchive *archive, const char *objtype, osync_memberid memberid, osync_mappingid mappingid, OSyncChangeType changetype, OSyncError **error)
{
char *query = NULL;
char *escaped_objtype = NULL;
- osync_trace(TRACE_ENTRY, "%s(%p, %s, %lli, %lli, %p)", __func__, archive, objtype, memberid, mappingid, error);
+ osync_trace(TRACE_ENTRY, "%s(%p, %s, %i, %i, %p)", __func__, archive, objtype, memberid, mappingid, error);
osync_assert(archive);
osync_assert(objtype);
@@ -545,7 +550,7 @@ osync_bool osync_archive_save_ignored_conflict(OSyncArchive *archive, const char
goto error;
escaped_objtype = osync_db_sql_escape(objtype);
- query = osync_strdup_printf("INSERT INTO tbl_changelog (objtype, memberid, mappingid, changetype) VALUES('%s', '%lli', '%lli', '%i')", escaped_objtype, memberid, mappingid, changetype);
+ query = osync_strdup_printf("INSERT INTO tbl_changelog (objtype, memberid, mappingid, changetype) VALUES('%s', '%i', '%i', '%i')", escaped_objtype, memberid, mappingid, changetype);
osync_free(escaped_objtype);
escaped_objtype = NULL;
@@ -556,7 +561,7 @@ osync_bool osync_archive_save_ignored_conflict(OSyncArchive *archive, const char
osync_free(query);
- osync_trace(TRACE_EXIT, "%s: %lli", __func__, mappingid);
+ osync_trace(TRACE_EXIT, "%s: %i", __func__, mappingid);
return TRUE;
error:
diff --git a/opensync/archive/opensync_archive_internals.h b/opensync/archive/opensync_archive_internals.h
index 4757f88..56e8cf4 100644
--- a/opensync/archive/opensync_archive_internals.h
+++ b/opensync/archive/opensync_archive_internals.h
@@ -80,7 +80,7 @@ OSYNC_TEST_EXPORT osync_bool osync_archive_load_changes(OSyncArchive *archive, c
* @param error Pointer to an error struct
* @return Returns TRUE on success otherwise FALSE
*/
-OSYNC_TEST_EXPORT osync_bool osync_archive_save_data(OSyncArchive *archive, long long int id, const char *objtype, const char *data, unsigned int size, OSyncError **error);
+OSYNC_TEST_EXPORT osync_bool osync_archive_save_data(OSyncArchive *archive, osync_mappingid id, const char *objtype, const char *data, unsigned int size, OSyncError **error);
/**
* @brief Loads data of an entry which is stored in the group archive database (blob).
@@ -108,7 +108,7 @@ OSYNC_TEST_EXPORT int osync_archive_load_data(OSyncArchive *archive, const char
* @param error Pointer to an error struct
* @return Returns number of entries in archive group database. 0 on error.
*/
-OSYNC_TEST_EXPORT long long int osync_archive_save_change(OSyncArchive *archive, long long int id, const char *uid, const char *objtype, long long int mappingid, long long int memberid, const char *objengine, OSyncError **error);
+OSYNC_TEST_EXPORT osync_archiveid osync_archive_save_change(OSyncArchive *archive, osync_archiveid id, const char *uid, const char *objtype, osync_mappingid mappingid, osync_memberid memberid, const char *objengine, OSyncError **error);
/**
* @brief Deletes an entry from a group archive.
@@ -119,7 +119,7 @@ OSYNC_TEST_EXPORT long long int osync_archive_save_change(OSyncArchive *archive,
* @param error Pointer to an error struct
* @return TRUE if the specified change was deleted successfully, otherwise FALSE
*/
-osync_bool osync_archive_delete_change(OSyncArchive *archive, long long int id, const char *objtype, OSyncError **error);
+osync_bool osync_archive_delete_change(OSyncArchive *archive, osync_archiveid id, const char *objtype, OSyncError **error);
/**
* @brief Delete all changes from group archive for a certain object type.
@@ -155,7 +155,7 @@ osync_bool osync_archive_load_ignored_conflicts(OSyncArchive *archive, const cha
* @param error Pointer to an error struct
* @return Returns TRUE on success, FALSE otherwise
*/
-osync_bool osync_archive_save_ignored_conflict(OSyncArchive *archive, const char *objtype, long long int memberid, long long int mappingid, OSyncChangeType changetype, OSyncError **error);
+osync_bool osync_archive_save_ignored_conflict(OSyncArchive *archive, const char *objtype, osync_memberid memberid, osync_mappingid mappingid, OSyncChangeType changetype, OSyncError **error);
/**
* @brief Deletes all ignored conflict entries of the changelog with the objtype.
diff --git a/opensync/client/opensync_client.c b/opensync/client/opensync_client.c
index 4b77fa8..89079ae 100644
--- a/opensync/client/opensync_client.c
+++ b/opensync/client/opensync_client.c
@@ -783,8 +783,8 @@ static osync_bool _osync_client_handle_initialize(OSyncClient *client, OSyncMess
#ifdef OPENSYNC_UNITTESTS
{
- long long int memberid;
- if (!osync_message_read_long_long_int(message, &memberid, error)) // Introduced (only) for testing/debugging purpose (mock-sync)
+ osync_memberid memberid;
+ if (!osync_message_read_int(message, &memberid, error)) // Introduced (only) for testing/debugging purpose (mock-sync)
goto error;
client->plugin_info->memberid = memberid;
diff --git a/opensync/client/opensync_client_proxy.c b/opensync/client/opensync_client_proxy.c
index bbe0b24..666942a 100644
--- a/opensync/client/opensync_client_proxy.c
+++ b/opensync/client/opensync_client_proxy.c
@@ -1068,7 +1068,7 @@ osync_bool osync_client_proxy_spawn(OSyncClientProxy *proxy, OSyncStartType type
osync_queue_disconnect(read2, error);
osync_trace(TRACE_INTERNAL, "About to exec osplugin");
- //char *memberstring = g_strdup_printf("%lli", osync_member_get_id(proxy->member));
+ //char *memberstring = g_strdup_printf("%i", osync_member_get_id(proxy->member));
//execlp("osplugin", "osplugin", osync_group_get_configdir(osync_member_get_group(osync_proxy_get_member(proxy)), memberstring, NULL);
readfd = osync_strdup_printf("%i", osync_queue_get_fd(read1));
writefd = osync_strdup_printf("%i", osync_queue_get_fd(write2));
@@ -1293,7 +1293,7 @@ osync_bool osync_client_proxy_initialize(OSyncClientProxy *proxy, initialize_cb
int haspluginconfig = config ? TRUE : FALSE;
OSyncMessage *message = NULL;
#ifdef OPENSYNC_UNITTESTS
- long long int memberid = 0;
+ osync_memberid memberid = 0;
#endif
osync_trace(TRACE_ENTRY, "%s(%p, %p, %p, %s, %s, %s, %s, %s, %p, %p)", __func__, proxy, callback, userdata, formatdir, plugindir, plugin, groupname, configdir, config, error);
@@ -1355,7 +1355,7 @@ osync_bool osync_client_proxy_initialize(OSyncClientProxy *proxy, initialize_cb
if (proxy->member)
memberid = osync_member_get_id(proxy->member);
- osync_message_write_long_long_int(message, memberid, error);
+ osync_message_write_int(message, memberid, error);
#endif
osync_message_set_handler(message, _osync_client_proxy_init_handler, ctx);
diff --git a/opensync/engine/opensync_engine.c b/opensync/engine/opensync_engine.c
index ccd6e40..3e0a72b 100644
--- a/opensync/engine/opensync_engine.c
+++ b/opensync/engine/opensync_engine.c
@@ -195,7 +195,7 @@ static void _osync_engine_receive_change(OSyncClientProxy *proxy, void *userdata
OSyncError *error = NULL;
osync_bool found = FALSE;
OSyncMember *member = NULL;
- long long int memberid = 0;
+ osync_memberid memberid = 0;
const char *uid = NULL;
OSyncChangeType changetype = 0;
const char *format = NULL;
@@ -217,7 +217,7 @@ static void _osync_engine_receive_change(OSyncClientProxy *proxy, void *userdata
objtype_sink = osync_member_find_objtype_sink(member, objtype);
- osync_trace(TRACE_INTERNAL, "Received change %s, changetype %i, format %s, objtype %s from member %lli", uid, changetype, format, objtype, memberid);
+ osync_trace(TRACE_INTERNAL, "Received change %s, changetype %i, format %s, objtype %s from member %i", uid, changetype, format, objtype, memberid);
data = osync_change_get_data(change);
@@ -233,7 +233,7 @@ static void _osync_engine_receive_change(OSyncClientProxy *proxy, void *userdata
objtype = osync_objformat_get_objtype(detected_format);
}
- member_objtype = osync_strdup_printf("%lli_%s", memberid, objtype);
+ member_objtype = osync_strdup_printf("%i_%s", memberid, objtype);
/* Convert the format to the internal format */
internalFormat = _osync_engine_get_internal_format(engine, objtype);
@@ -1127,7 +1127,7 @@ void osync_engine_trace_multiply_summary(OSyncEngine *engine)
{
OSyncList *o;
unsigned int added, modified, deleted, unmodified, unknown, total, n;
- long long int memberid;
+ osync_memberid memberid;
if (!osync_trace_is_enabled())
return;
@@ -1176,7 +1176,7 @@ void osync_engine_trace_multiply_summary(OSyncEngine *engine)
}
}
- osync_trace(TRACE_INTERNAL, "\tMember: %lli "
+ osync_trace(TRACE_INTERNAL, "\tMember: %i "
"added:%u modified:%u deleted:%u "
"(unmodified:%u unknown:%u)",
memberid, added, modified, deleted, unmodified, unknown);
diff --git a/opensync/engine/opensync_engine_private.h b/opensync/engine/opensync_engine_private.h
index bee860c..7e4cf8b 100644
--- a/opensync/engine/opensync_engine_private.h
+++ b/opensync/engine/opensync_engine_private.h
@@ -176,7 +176,7 @@ struct OSyncEngineMappingUpdate {
/** The type of the status update */
OSyncEngineMappingEvent type;
/** If the mapping was already solved, this will have the id if the winning entry */
- long long int winner;
+ osync_memberid winner;
/** The mapping for which the status update is */
OSyncMapping *mapping;
/** If the status was a error, this error will be set */
diff --git a/opensync/engine/opensync_mapping_engine.c b/opensync/engine/opensync_mapping_engine.c
index a40d02f..6c81066 100644
--- a/opensync/engine/opensync_mapping_engine.c
+++ b/opensync/engine/opensync_mapping_engine.c
@@ -284,7 +284,7 @@ osync_bool osync_mapping_engine_multiply(OSyncMappingEngine *engine, OSyncError
osync_assert(engine);
osync_assert(engine->mapping);
- osync_trace(TRACE_ENTRY, "%s(%p(%lli), %p)", __func__, engine, osync_mapping_get_id(engine->mapping), error);
+ osync_trace(TRACE_ENTRY, "%s(%p(%i), %p)", __func__, engine, osync_mapping_get_id(engine->mapping), error);
if (engine->synced) {
osync_trace(TRACE_EXIT, "%s: No need to multiply. Already synced", __func__);
@@ -578,7 +578,7 @@ OSyncChange *osync_mapping_engine_nth_change(OSyncMappingEngine *engine, unsigne
return NULL;
}
-OSyncChange *osync_mapping_engine_member_change(OSyncMappingEngine *engine, long long int memberid)
+OSyncChange *osync_mapping_engine_member_change(OSyncMappingEngine *engine, osync_memberid memberid)
{
OSyncList *e = NULL;
osync_assert(engine);
@@ -620,7 +620,7 @@ osync_bool osync_mapping_engine_ignore(OSyncMappingEngine *engine, OSyncError **
OSyncObjEngine *objengine = NULL;
OSyncArchive *archive = NULL;
char *objtype = NULL;
- long long int id = 0;
+ osync_mappingid id = 0;
OSyncList *c = NULL;
osync_trace(TRACE_ENTRY, "%s(%p, %p)", __func__, engine, error);
@@ -705,15 +705,15 @@ osync_bool osync_mapping_engine_duplicate(OSyncMappingEngine *existingMapping, O
OSyncMappingEntryEngine *entry = e->data;
if (entry->change) {
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)));
+ osync_trace(TRACE_INTERNAL, "Appending entry %s, changetype %i from member %i", 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 = 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_trace(TRACE_INTERNAL, "Removing entry %s, changetype %i from member %i", 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);
}
} else {
- osync_trace(TRACE_INTERNAL, "member %lli does not have a entry", osync_member_get_id(osync_client_proxy_get_member(entry->sink_engine->proxy)));
+ osync_trace(TRACE_INTERNAL, "member %i does not have a entry", osync_member_get_id(osync_client_proxy_get_member(entry->sink_engine->proxy)));
}
}
diff --git a/opensync/engine/opensync_mapping_engine.h b/opensync/engine/opensync_mapping_engine.h
index 8655e21..cf53cc9 100644
--- a/opensync/engine/opensync_mapping_engine.h
+++ b/opensync/engine/opensync_mapping_engine.h
@@ -28,7 +28,7 @@
* @param memberid The member id of the request change.
* @returns The pointer to the change of the member. NULL if member doesn't have an entry in this mapping.
*/
-OSYNC_EXPORT OSyncChange *osync_mapping_engine_member_change(OSyncMappingEngine *engine, long long int memberid);
+OSYNC_EXPORT OSyncChange *osync_mapping_engine_member_change(OSyncMappingEngine *engine, osync_memberid memberid);
OSYNC_EXPORT OSyncMember *osync_mapping_engine_change_find_member(OSyncMappingEngine *engine, OSyncChange *change);
diff --git a/opensync/engine/opensync_obj_engine.c b/opensync/engine/opensync_obj_engine.c
index fc8487f..fd5ee6b 100644
--- a/opensync/engine/opensync_obj_engine.c
+++ b/opensync/engine/opensync_obj_engine.c
@@ -385,8 +385,8 @@ osync_bool osync_obj_engine_map_changes(OSyncObjEngine *engine, OSyncError **err
* the current sinkengine, since there will be only one entry (for the current sinkengine) so there
* is no need to compare */
- long long int memberid = osync_member_get_id(osync_client_proxy_get_member(sinkengine->proxy));
- osync_trace(TRACE_INTERNAL, "Sinkengine of member %lli", memberid);
+ osync_memberid memberid = osync_member_get_id(osync_client_proxy_get_member(sinkengine->proxy));
+ osync_trace(TRACE_INTERNAL, "Sinkengine of member %i", memberid);
unmapped_mappings = osync_list_copy(new_mappings);
@@ -394,7 +394,7 @@ osync_bool osync_obj_engine_map_changes(OSyncObjEngine *engine, OSyncError **err
while (sinkengine->unmapped) {
OSyncChange *change = sinkengine->unmapped->data;
- osync_trace(TRACE_INTERNAL, "Looking for mapping for change %s, changetype %i from member %lli", osync_change_get_uid(change), osync_change_get_changetype(change), memberid);
+ osync_trace(TRACE_INTERNAL, "Looking for mapping for change %s, changetype %i from member %i", osync_change_get_uid(change), osync_change_get_changetype(change), memberid);
/* See if there is an exisiting mapping, which fits the unmapped change */
result = _osync_obj_engine_mapping_find(unmapped_mappings, change, sinkengine, &mapping_engine, error);
@@ -405,7 +405,7 @@ osync_bool osync_obj_engine_map_changes(OSyncObjEngine *engine, OSyncError **err
if (!mapping_engine)
goto error;
- osync_trace(TRACE_INTERNAL, "Unable to find mapping. Creating new mapping with id %lli", osync_mapping_get_id(mapping_engine->mapping));
+ osync_trace(TRACE_INTERNAL, "Unable to find mapping. Creating new mapping with id %i", 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 = osync_list_append(new_mappings, mapping_engine);
unmapped_mappings = osync_list_append(unmapped_mappings, mapping_engine);
@@ -634,7 +634,7 @@ void osync_obj_engine_commit_change_callback(OSyncClientProxy *proxy, void *user
OSyncMappingEntry *entry = NULL;
const char *objtype = NULL;
const char *objengine_objtype = NULL;
- long long int id = 0;
+ osync_mappingid id = 0;
objengine_objtype = osync_obj_engine_get_objtype(engine);
@@ -784,7 +784,7 @@ static osync_bool _inject_changelog_entries(OSyncObjEngine *engine, OSyncError *
t = changetypes;
mid = memberids;
for (j = ids; j; j = j->next) {
- long long int id = (long long int)GPOINTER_TO_INT(j->data);
+ osync_archiveid id = GPOINTER_TO_INT(j->data);
OSyncMapping *ignored_mapping = osync_mapping_table_find_mapping(engine->mapping_table, id);
diff --git a/opensync/engine/opensync_sink_engine.c b/opensync/engine/opensync_sink_engine.c
index f1065dd..639e24a 100644
--- a/opensync/engine/opensync_sink_engine.c
+++ b/opensync/engine/opensync_sink_engine.c
@@ -230,7 +230,7 @@ osync_bool osync_sink_engine_write(OSyncSinkEngine *engine, OSyncArchive *archiv
OSyncChange *change = osync_entry_engine_get_change(entry_engine);
osync_assert(change);
- osync_trace(TRACE_INTERNAL, "Writing change %s, changetype %i, format %s , objtype %s from member %lli",
+ osync_trace(TRACE_INTERNAL, "Writing change %s, changetype %i, format %s , objtype %s from member %i",
osync_change_get_uid(change),
osync_change_get_changetype(change),
osync_objformat_get_name(osync_change_get_objformat(change)),
diff --git a/opensync/group/opensync_group.c b/opensync/group/opensync_group.c
index 81e0abb..ffb3c6b 100644
--- a/opensync/group/opensync_group.c
+++ b/opensync/group/opensync_group.c
@@ -76,16 +76,16 @@ static int flock(int fd, int operation)
#endif //not defined _WIN32
-static long long int osync_group_create_member_id(OSyncGroup *group)
+static osync_memberid osync_group_create_member_id(OSyncGroup *group)
{
char *filename = NULL;
- long long int i = 0;
+ osync_memberid i = 0;
do {
i++;
if (filename)
osync_free(filename);
- filename = osync_strdup_printf("%s%c%lli", group->configdir, G_DIR_SEPARATOR, i);
+ filename = osync_strdup_printf("%s%c%i", group->configdir, G_DIR_SEPARATOR, i);
} while (g_file_test(filename, G_FILE_TEST_EXISTS));
osync_free(filename);
@@ -778,7 +778,7 @@ void osync_group_add_member(OSyncGroup *group, OSyncMember *member)
if (!osync_member_get_configdir(member)) {
member->id = osync_group_create_member_id(group);
- char *configdir = osync_strdup_printf("%s%c%lli", group->configdir, G_DIR_SEPARATOR, member->id);
+ char *configdir = osync_strdup_printf("%s%c%i", group->configdir, G_DIR_SEPARATOR, member->id);
osync_member_set_configdir(member, configdir);
osync_free(configdir);
}
@@ -794,7 +794,7 @@ void osync_group_remove_member(OSyncGroup *group, OSyncMember *member)
osync_member_unref(member);
}
-OSyncMember *osync_group_find_member(OSyncGroup *group, long long int id)
+OSyncMember *osync_group_find_member(OSyncGroup *group, osync_memberid id)
{
OSyncList *m = NULL;
for (m = group->members; m; m = m->next) {
@@ -980,14 +980,14 @@ time_t osync_group_get_last_synchronization(OSyncGroup *group)
return group->last_sync;
}
-void osync_group_set_conflict_resolution(OSyncGroup *group, OSyncConflictResolution res, long long int winner)
+void osync_group_set_conflict_resolution(OSyncGroup *group, OSyncConflictResolution res, osync_memberid winner)
{
osync_assert(group);
group->conflict_resolution = res;
group->conflict_winner = winner;
}
-void osync_group_get_conflict_resolution(OSyncGroup *group, OSyncConflictResolution *res, long long int *winner)
+void osync_group_get_conflict_resolution(OSyncGroup *group, OSyncConflictResolution *res, osync_memberid *winner)
{
osync_assert(group);
osync_assert(res);
diff --git a/opensync/group/opensync_group.h b/opensync/group/opensync_group.h
index adb8fc6..9a47305 100644
--- a/opensync/group/opensync_group.h
+++ b/opensync/group/opensync_group.h
@@ -193,7 +193,7 @@ OSYNC_EXPORT void osync_group_remove_member(OSyncGroup *group, OSyncMember *memb
* @returns The member, or NULL if not found
*
*/
-OSYNC_EXPORT OSyncMember *osync_group_find_member(OSyncGroup *group, long long int id);
+OSYNC_EXPORT OSyncMember *osync_group_find_member(OSyncGroup *group, osync_memberid id);
/**
* @brief Returns a OSyncList that contains the OSyncMembers of this group
@@ -271,7 +271,7 @@ OSYNC_EXPORT time_t osync_group_get_last_synchronization(OSyncGroup *group);
* @param winner The Member ID which solves the conflict (winner)
*
*/
-OSYNC_EXPORT void osync_group_set_conflict_resolution(OSyncGroup *group, OSyncConflictResolution res, long long int winner);
+OSYNC_EXPORT void osync_group_set_conflict_resolution(OSyncGroup *group, OSyncConflictResolution res, osync_memberid winner);
/** @brief Get fixed conflict resolution for the group for all appearing conflicts
*
@@ -280,7 +280,7 @@ OSYNC_EXPORT void osync_group_set_conflict_resolution(OSyncGroup *group, OSyncCo
* @param winner Pointer to set Member ID value which solves the conflict (winner)
*
*/
-OSYNC_EXPORT void osync_group_get_conflict_resolution(OSyncGroup *group, OSyncConflictResolution *res, long long int *winner);
+OSYNC_EXPORT void osync_group_get_conflict_resolution(OSyncGroup *group, OSyncConflictResolution *res, osync_memberid *winner);
/** @brief Get group configured status of merger use.
*
diff --git a/opensync/group/opensync_group_env.c b/opensync/group/opensync_group_env.c
index b3ca99a..830f43f 100644
--- a/opensync/group/opensync_group_env.c
+++ b/opensync/group/opensync_group_env.c
@@ -26,15 +26,15 @@
#include "opensync_group_env_internals.h"
#include "opensync_group_env_private.h"
-static long long int osync_group_env_create_group_id(OSyncGroupEnv *env)
+static osync_groupid osync_group_env_create_group_id(OSyncGroupEnv *env)
{
char *filename = NULL;
- long long int i = 0;
+ osync_groupid i = 0;
do {
i++;
if (filename)
osync_free(filename);
- filename = osync_strdup_printf("%s%cgroup%lli", env->groupsdir, G_DIR_SEPARATOR, i);
+ filename = osync_strdup_printf("%s%cgroup%i", env->groupsdir, G_DIR_SEPARATOR, i);
} while (g_file_test(filename, G_FILE_TEST_EXISTS));
osync_free(filename);
return i;
@@ -409,7 +409,7 @@ osync_bool osync_group_env_add_group(OSyncGroupEnv *env, OSyncGroup *group, OSyn
}
if (!osync_group_get_configdir(group)) {
- char *configdir = osync_strdup_printf("%s%cgroup%lli", env->groupsdir, G_DIR_SEPARATOR, osync_group_env_create_group_id(env));
+ char *configdir = osync_strdup_printf("%s%cgroup%i", env->groupsdir, G_DIR_SEPARATOR, osync_group_env_create_group_id(env));
osync_group_set_configdir(group, configdir);
osync_free(configdir);
}
diff --git a/opensync/group/opensync_group_env_private.h b/opensync/group/opensync_group_env_private.h
index c1fc5ed..926f44c 100644
--- a/opensync/group/opensync_group_env_private.h
+++ b/opensync/group/opensync_group_env_private.h
@@ -37,7 +37,7 @@
* @returns The next free number
*
*/
-static long long int osync_group_env_create_group_id(OSyncGroupEnv *env);
+static osync_groupid osync_group_env_create_group_id(OSyncGroupEnv *env);
/*@}*/
diff --git a/opensync/group/opensync_group_internals.h b/opensync/group/opensync_group_internals.h
index f8c87ea..e60e977 100644
--- a/opensync/group/opensync_group_internals.h
+++ b/opensync/group/opensync_group_internals.h
@@ -52,7 +52,7 @@ struct OSyncGroup {
/** The defined resolution for this group */
OSyncConflictResolution conflict_resolution;
/** The winning side if the select resolution is choosen */
- long long int conflict_winner;
+ osync_memberid conflict_winner;
/** The configured merger status of this group */
osync_bool merger_enabled;
/** The configured converter status of this group */
diff --git a/opensync/group/opensync_group_private.h b/opensync/group/opensync_group_private.h
index d7f6cb1..a821930 100644
--- a/opensync/group/opensync_group_private.h
+++ b/opensync/group/opensync_group_private.h
@@ -36,7 +36,7 @@
* @returns A new unique member id
*
*/
-static long long int osync_group_create_member_id(OSyncGroup *group);
+static osync_memberid osync_group_create_member_id(OSyncGroup *group);
/** @brief Loads all members of a group
*
diff --git a/opensync/group/opensync_member.c b/opensync/group/opensync_member.c
index 20020a1..4fbd0e8 100644
--- a/opensync/group/opensync_member.c
+++ b/opensync/group/opensync_member.c
@@ -540,7 +540,7 @@ osync_bool osync_member_save(OSyncMember *member, OSyncError **error)
* member_configdir_deep_path
*/
if (g_mkdir_with_parents(member->configdir, 0700)) {
- osync_error_set(error, OSYNC_ERROR_IO_ERROR, "Unable to create directory for member %lli\n", member->id);
+ osync_error_set(error, OSYNC_ERROR_IO_ERROR, "Unable to create directory for member %i\n", member->id);
goto error;
}
}
@@ -629,7 +629,7 @@ osync_bool osync_member_delete(OSyncMember *member, OSyncError **error)
return TRUE;
}
-long long int osync_member_get_id(OSyncMember *member)
+osync_memberid osync_member_get_id(OSyncMember *member)
{
osync_assert(member);
return member->id;
diff --git a/opensync/group/opensync_member.h b/opensync/group/opensync_member.h
index 0412460..91b9504 100644
--- a/opensync/group/opensync_member.h
+++ b/opensync/group/opensync_member.h
@@ -191,7 +191,7 @@ OSYNC_EXPORT osync_bool osync_member_delete(OSyncMember *member, OSyncError **er
* @returns The id of the member thats unique in its group
*
*/
-OSYNC_EXPORT long long int osync_member_get_id(OSyncMember *member);
+OSYNC_EXPORT osync_memberid osync_member_get_id(OSyncMember *member);
/**
* @brief Returns a OSyncList that contains the objtypes of this member
diff --git a/opensync/group/opensync_member_internals.h b/opensync/group/opensync_member_internals.h
index 903f7ad..d6793ce 100644
--- a/opensync/group/opensync_member_internals.h
+++ b/opensync/group/opensync_member_internals.h
@@ -31,7 +31,7 @@
/** @brief A member of a group which represent a single device */
struct OSyncMember {
- long long int id;
+ osync_memberid id;
char *configdir;
OSyncPluginConfig *config;
diff --git a/opensync/ipc/opensync_message.c b/opensync/ipc/opensync_message.c
index 4f5de21..c135b8c 100644
--- a/opensync/ipc/opensync_message.c
+++ b/opensync/ipc/opensync_message.c
@@ -87,13 +87,13 @@ unsigned int osync_message_get_timeout(OSyncMessage *message)
return message->timeout;
}
-void osync_message_set_id(OSyncMessage *message, long long int id)
+void osync_message_set_id(OSyncMessage *message, osync_messageid id)
{
osync_assert(message);
message->id = id;
}
-long long int osync_message_get_id(OSyncMessage *message)
+osync_messageid osync_message_get_id(OSyncMessage *message)
{
osync_assert(message);
return message->id;
diff --git a/opensync/ipc/opensync_message_internals.h b/opensync/ipc/opensync_message_internals.h
index a2b155a..a8590b7 100644
--- a/opensync/ipc/opensync_message_internals.h
+++ b/opensync/ipc/opensync_message_internals.h
@@ -149,7 +149,7 @@ OSYNC_TEST_EXPORT OSyncMessageCommand osync_message_get_cmd(OSyncMessage *messag
* @param id The ID which get set for supplied message object
*
*/
-OSYNC_TEST_EXPORT void osync_message_set_id(OSyncMessage *message, long long int id);
+OSYNC_TEST_EXPORT void osync_message_set_id(OSyncMessage *message, osync_messageid id);
/** @brief Get message ID of supplied message object
*
@@ -157,7 +157,7 @@ OSYNC_TEST_EXPORT void osync_message_set_id(OSyncMessage *message, long long int
* @returns The message ID of supplied message
*
*/
-OSYNC_TEST_EXPORT long long int osync_message_get_id(OSyncMessage *message);
+OSYNC_TEST_EXPORT osync_messageid osync_message_get_id(OSyncMessage *message);
/** @brief Get marshal object of supplied message object
*
diff --git a/opensync/ipc/opensync_message_private.h b/opensync/ipc/opensync_message_private.h
index b02ee7b..bb53e62 100644
--- a/opensync/ipc/opensync_message_private.h
+++ b/opensync/ipc/opensync_message_private.h
@@ -39,7 +39,7 @@ struct OSyncMessage {
/** The type of this message */
OSyncMessageCommand cmd;
/** The name of the message*/
- long long int id;
+ osync_messageid id;
/** Where should the reply be received? */
OSyncMessageHandler callback;
/** The user data */
diff --git a/opensync/ipc/opensync_queue.c b/opensync/ipc/opensync_queue.c
index 641f93d..1515e6c 100644
--- a/opensync/ipc/opensync_queue.c
+++ b/opensync/ipc/opensync_queue.c
@@ -689,7 +689,7 @@ static gboolean _source_dispatch(GSource *source, GSourceFunc callback, gpointer
do {
int size = 0;
int cmd = 0, timeout = 0;
- long long int id = 0;
+ osync_messageid id = 0;
char *buffer = NULL;
/* The size of the buffer */
@@ -1375,7 +1375,7 @@ OSyncMessage *osync_queue_get_message(OSyncQueue *queue)
return g_async_queue_pop(queue->incoming);
}
-static long long int opensync_queue_gen_id(const GTimeVal *tv)
+static osync_messageid opensync_queue_gen_id(const GTimeVal *tv)
{
long long int now = (tv->tv_sec * 1000000 + tv->tv_usec) << 16;
long long int rnd = ((long long int)g_random_int()) & 0xFFFF;
@@ -1408,7 +1408,7 @@ osync_bool osync_queue_send_message_with_timeout(OSyncQueue *queue, OSyncQueue *
if (osync_message_get_handler(message)) {
OSyncPendingMessage *pending = NULL;
GTimeVal current_time;
- long long int id = 0;
+ osync_messageid id = 0;
osync_assert(replyqueue);
g_mutex_lock(replyqueue->pendingLock);
diff --git a/opensync/ipc/opensync_queue_private.h b/opensync/ipc/opensync_queue_private.h
index 25803ab..4a4b4b9 100644
--- a/opensync/ipc/opensync_queue_private.h
+++ b/opensync/ipc/opensync_queue_private.h
@@ -134,7 +134,7 @@ typedef struct OSyncTimeoutInfo {
*/
typedef struct OSyncPendingMessage {
/** ID of the expected Message */
- long long int id;
+ osync_messageid id;
/** Where should the reply be received? */
OSyncMessageHandler callback;
/** The user data */
@@ -151,7 +151,7 @@ typedef struct OSyncPendingMessage {
* the lower 2 bytes are a random number
*
* */
-static long long int opensync_queue_gen_id(const GTimeVal *tv);
+static osync_messageid opensync_queue_gen_id(const GTimeVal *tv);
/*@}*/
diff --git a/opensync/mapping/opensync_mapping.c b/opensync/mapping/opensync_mapping.c
index 20382f1..68101af 100644
--- a/opensync/mapping/opensync_mapping.c
+++ b/opensync/mapping/opensync_mapping.c
@@ -68,13 +68,13 @@ void osync_mapping_unref(OSyncMapping *mapping)
}
}
-long long int osync_mapping_get_id(OSyncMapping *mapping)
+osync_mappingid osync_mapping_get_id(OSyncMapping *mapping)
{
osync_assert(mapping);
return mapping->id;
}
-void osync_mapping_set_id(OSyncMapping *mapping, long long int id)
+void osync_mapping_set_id(OSyncMapping *mapping, osync_mappingid id)
{
osync_assert(mapping);
mapping->id = id;
@@ -109,7 +109,7 @@ void osync_mapping_remove_entry(OSyncMapping *mapping, OSyncMappingEntry *entry)
return NULL;
}*/
-OSyncMappingEntry *osync_mapping_find_entry_by_member_id(OSyncMapping *mapping, long long int memberid)
+OSyncMappingEntry *osync_mapping_find_entry_by_member_id(OSyncMapping *mapping, osync_memberid memberid)
{
OSyncList *e;
for (e = mapping->entries; e; e = e->next) {
diff --git a/opensync/mapping/opensync_mapping.h b/opensync/mapping/opensync_mapping.h
index cd6db32..0b24ca2 100644
--- a/opensync/mapping/opensync_mapping.h
+++ b/opensync/mapping/opensync_mapping.h
@@ -62,14 +62,14 @@ OSYNC_EXPORT void osync_mapping_unref(OSyncMapping *mapping);
* @param mapping Pointer to a mapping object
* @returns the mapping ID
*/
-OSYNC_EXPORT long long int osync_mapping_get_id(OSyncMapping *mapping);
+OSYNC_EXPORT osync_mappingid osync_mapping_get_id(OSyncMapping *mapping);
/**
* @brief Set the ID of a mapping object
* @param mapping Pointer to a mapping object
* @param id the mapping ID to set
*/
-OSYNC_EXPORT void osync_mapping_set_id(OSyncMapping *mapping, long long int id);
+OSYNC_EXPORT void osync_mapping_set_id(OSyncMapping *mapping, osync_mappingid id);
/**
* @brief Returns a OSyncList that contains the OSyncMappingEntries of this mapping
@@ -103,7 +103,7 @@ OSYNC_EXPORT void osync_mapping_remove_entry(OSyncMapping *mapping, OSyncMapping
* @param memberid The ID of the member
* @returns the entry with the specified member ID or NULL if not found
*/
-OSYNC_EXPORT OSyncMappingEntry *osync_mapping_find_entry_by_member_id(OSyncMapping *mapping, long long int memberid);
+OSYNC_EXPORT OSyncMappingEntry *osync_mapping_find_entry_by_member_id(OSyncMapping *mapping, osync_memberid memberid);
/*@}*/
diff --git a/opensync/mapping/opensync_mapping_entry.c b/opensync/mapping/opensync_mapping_entry.c
index ede816f..34d3aaa 100644
--- a/opensync/mapping/opensync_mapping_entry.c
+++ b/opensync/mapping/opensync_mapping_entry.c
@@ -124,25 +124,25 @@ const char *osync_mapping_entry_get_uid(OSyncMappingEntry *entry)
return entry->uid;
}
-long long int osync_mapping_entry_get_member_id(OSyncMappingEntry *entry)
+osync_memberid osync_mapping_entry_get_member_id(OSyncMappingEntry *entry)
{
osync_assert(entry);
return entry->member_id;
}
-void osync_mapping_entry_set_member_id(OSyncMappingEntry *entry, long long int id)
+void osync_mapping_entry_set_member_id(OSyncMappingEntry *entry, osync_memberid id)
{
osync_assert(entry);
entry->member_id = id;
}
-long long int osync_mapping_entry_get_id(OSyncMappingEntry *entry)
+osync_mappingid osync_mapping_entry_get_id(OSyncMappingEntry *entry)
{
osync_assert(entry);
return entry->id;
}
-void osync_mapping_entry_set_id(OSyncMappingEntry *entry, long long int id)
+void osync_mapping_entry_set_id(OSyncMappingEntry *entry, osync_mappingid id)
{
osync_assert(entry);
entry->id = id;
diff --git a/opensync/mapping/opensync_mapping_entry.h b/opensync/mapping/opensync_mapping_entry.h
index 52da95b..f30042f 100644
--- a/opensync/mapping/opensync_mapping_entry.h
+++ b/opensync/mapping/opensync_mapping_entry.h
@@ -98,14 +98,14 @@ OSYNC_EXPORT const char *osync_mapping_entry_get_uid(OSyncMappingEntry *entry);
* @param entry Pointer to a mapping entry object
* @returns the entry's member ID
*/
-OSYNC_EXPORT long long int osync_mapping_entry_get_member_id(OSyncMappingEntry *entry);
+OSYNC_EXPORT osync_memberid osync_mapping_entry_get_member_id(OSyncMappingEntry *entry);
/**
* @brief Set the member ID of the entry
* @param entry Pointer to a mapping entry object
* @param id the member ID to set
*/
-OSYNC_EXPORT void osync_mapping_entry_set_member_id(OSyncMappingEntry *entry, long long int id);
+OSYNC_EXPORT void osync_mapping_entry_set_member_id(OSyncMappingEntry *entry, osync_memberid id);
/**
@@ -113,14 +113,14 @@ OSYNC_EXPORT void osync_mapping_entry_set_member_id(OSyncMappingEntry *entry, lo
* @param entry Pointer to a mapping entry object
* @returns the entry's ID
*/
-OSYNC_EXPORT long long int osync_mapping_entry_get_id(OSyncMappingEntry *entry);
+OSYNC_EXPORT osync_mappingid osync_mapping_entry_get_id(OSyncMappingEntry *entry);
/**
* @brief Set the ID of the entry
* @param entry Pointer to a mapping entry object
* @param id the ID to set
*/
-OSYNC_EXPORT void osync_mapping_entry_set_id(OSyncMappingEntry *entry, long long int id);
+OSYNC_EXPORT void osync_mapping_entry_set_id(OSyncMappingEntry *entry, osync_mappingid id);
/*@}*/
diff --git a/opensync/mapping/opensync_mapping_entry_internals.h b/opensync/mapping/opensync_mapping_entry_internals.h
index a8c1fc7..1bc21bb 100644
--- a/opensync/mapping/opensync_mapping_entry_internals.h
+++ b/opensync/mapping/opensync_mapping_entry_internals.h
@@ -40,13 +40,13 @@ struct OSyncMappingEntry {
char *uid;
/** uniquely identifies the member */
- long long int member_id;
+ osync_memberid member_id;
/** uniquely identifies the mapping table entry */
- long long int id;
+ osync_mappingid id;
};
/*@}*/
-long long int osync_mapping_entry_get_member_id(OSyncMappingEntry *entry);
+osync_memberid osync_mapping_entry_get_member_id(OSyncMappingEntry *entry);
#endif /*OPENSYNC_MAPPING_ENTRY_INTERNALS_H_*/
diff --git a/opensync/mapping/opensync_mapping_internals.h b/opensync/mapping/opensync_mapping_internals.h
index 169498e..52759ff 100644
--- a/opensync/mapping/opensync_mapping_internals.h
+++ b/opensync/mapping/opensync_mapping_internals.h
@@ -38,7 +38,7 @@ struct OSyncMapping {
/** Reference Counter */
int ref_count;
/** ID of the mapping */
- long long int id;
+ osync_mappingid id;
/** list of entries */
OSyncList *entries;
};
diff --git a/opensync/mapping/opensync_mapping_table.c b/opensync/mapping/opensync_mapping_table.c
index 4e15342..d4cd572 100644
--- a/opensync/mapping/opensync_mapping_table.c
+++ b/opensync/mapping/opensync_mapping_table.c
@@ -88,10 +88,12 @@ osync_bool osync_mapping_table_load(OSyncMappingTable *table, OSyncArchive *arch
i = memberids;
for (u = uids; u; u = u->next) {
- long long int id = (long long int)GPOINTER_TO_INT(d->data);
+ // FIXME - GPOINTER_TO_INT() only guarantees 32bits of data,
+ // while long long int is 64bits.
+ osync_archiveid id = GPOINTER_TO_INT(d->data);
char *uid = u->data;
- long long int memberid = (long long int)GPOINTER_TO_INT(i->data);
- long long int mappingid = (long long int)GPOINTER_TO_INT(m->data);
+ osync_memberid memberid = GPOINTER_TO_INT(i->data);
+ osync_mappingid mappingid = GPOINTER_TO_INT(m->data);
entry = osync_mapping_entry_new(error);
if (!entry)
@@ -171,7 +173,7 @@ void osync_mapping_table_close(OSyncMappingTable *table)
osync_trace(TRACE_EXIT, "%s", __func__);
}
-OSyncMapping *osync_mapping_table_find_mapping(OSyncMappingTable *table, long long int id)
+OSyncMapping *osync_mapping_table_find_mapping(OSyncMappingTable *table, osync_mappingid id)
{
OSyncList *m;
osync_assert(table);
@@ -214,9 +216,9 @@ OSyncMapping *osync_mapping_table_nth_mapping(OSyncMappingTable *table, unsigned
return osync_list_nth_data(table->mappings, nth);
}
-long long int osync_mapping_table_get_next_id(OSyncMappingTable *table)
+osync_mappingid osync_mapping_table_get_next_id(OSyncMappingTable *table)
{
- long long int new_id = 1;
+ osync_mappingid new_id = 1;
OSyncList *m;
for (m = table->mappings; m; m = m->next) {
OSyncMapping *mapping = m->data;
diff --git a/opensync/mapping/opensync_mapping_table.h b/opensync/mapping/opensync_mapping_table.h
index 55a60a2..40e8f4a 100644
--- a/opensync/mapping/opensync_mapping_table.h
+++ b/opensync/mapping/opensync_mapping_table.h
@@ -90,7 +90,7 @@ OSYNC_EXPORT void osync_mapping_table_close(OSyncMappingTable *table);
* @param id The mapping id to search for
* @return Returns Mapping object or NULL if no mapping matched the mapping id
*/
-OSYNC_EXPORT OSyncMapping *osync_mapping_table_find_mapping(OSyncMappingTable *table, long long int id);
+OSYNC_EXPORT OSyncMapping *osync_mapping_table_find_mapping(OSyncMappingTable *table, osync_mappingid id);
/**
* @brief Add a mapping to the mapping table
@@ -125,7 +125,7 @@ OSYNC_EXPORT OSyncList *osync_mapping_table_get_mappings(OSyncMappingTable *tabl
* @param table The mapping table object
* @return Next free mapping id of mapping table
*/
-OSYNC_EXPORT long long int osync_mapping_table_get_next_id(OSyncMappingTable *table);
+OSYNC_EXPORT osync_mappingid osync_mapping_table_get_next_id(OSyncMappingTable *table);
/*@}*/
diff --git a/opensync/opensync.h b/opensync/opensync.h
index 2869486..8530135 100644
--- a/opensync/opensync.h
+++ b/opensync/opensync.h
@@ -141,6 +141,11 @@ OPENSYNC_BEGIN_DECLS
} } while(0)
typedef int osync_bool;
+typedef int osync_memberid;
+typedef int osync_mappingid;
+typedef int osync_groupid;
+typedef long long int osync_archiveid;
+typedef long long int osync_messageid;
/**************************************************************
* Enums
diff --git a/opensync/plugin/opensync_plugin_info_private.h b/opensync/plugin/opensync_plugin_info_private.h
index 5684704..e983f81 100644
--- a/opensync/plugin/opensync_plugin_info_private.h
+++ b/opensync/plugin/opensync_plugin_info_private.h
@@ -49,7 +49,7 @@ struct OSyncPluginInfo {
OSyncCapabilities *capabilities;
#ifdef OPENSYNC_UNITTESTS
- long long int memberid; // introduced only for testing purpose (mock-sync)
+ osync_memberid memberid; // introduced only for testing purpose (mock-sync)
#endif
};
diff --git a/tests/archive-tests/check_archive.c b/tests/archive-tests/check_archive.c
index 3c10f8e..0f37ddc 100644
--- a/tests/archive-tests/check_archive.c
+++ b/tests/archive-tests/check_archive.c
@@ -58,7 +58,7 @@ START_TEST (archive_save_change)
OSyncList *memberids;
osync_archive_load_changes(archive, "contact", &ids, &uids, &mappingids, &memberids, &error);
- long long int id = osync_archive_save_change(archive, 0, "uid", "contact", 1, 1, "contact", &error);
+ osync_archiveid id = osync_archive_save_change(archive, 0, "uid", "contact", 1, 1, "contact", &error);
fail_unless(id != 0, NULL);
fail_unless(error == NULL, NULL);
@@ -83,7 +83,7 @@ START_TEST (archive_save_data)
OSyncList *memberids;
osync_archive_load_changes(archive, "contact", &ids, &uids, &mappingids, &memberids, &error);
- long long int id = osync_archive_save_change(archive, 0, "uid", "contact", 1, 1, "contact", &error);
+ osync_archiveid id = osync_archive_save_change(archive, 0, "uid", "contact", 1, 1, "contact", &error);
fail_unless(id != 0, NULL);
fail_unless(error == NULL, NULL);
@@ -113,7 +113,7 @@ START_TEST (archive_load_data)
OSyncList *memberids;
osync_archive_load_changes(archive, "contact", &ids, &uids, &mappingids, &memberids, &error);
- long long int id = osync_archive_save_change(archive, 0, "uid", "contact", 1, 1, "contact", &error);
+ osync_archiveid id = osync_archive_save_change(archive, 0, "uid", "contact", 1, 1, "contact", &error);
fail_unless(id != 0, NULL);
fail_unless(error == NULL, NULL);
@@ -152,7 +152,7 @@ START_TEST (archive_load_data_with_closing_db)
OSyncList *memberids;
osync_archive_load_changes(archive, "contact", &ids, &uids, &mappingids, &memberids, &error);
- long long int id = osync_archive_save_change(archive, 0, "uid", "contact", 1, 1, "contact", &error);
+ osync_archiveid id = osync_archive_save_change(archive, 0, "uid", "contact", 1, 1, "contact", &error);
fail_unless(id != 0, NULL);
fail_unless(error == NULL, NULL);
diff --git a/tests/mock-plugin/mock_sync.c b/tests/mock-plugin/mock_sync.c
index 01e54b9..98f1117 100644
--- a/tests/mock-plugin/mock_sync.c
+++ b/tests/mock-plugin/mock_sync.c
@@ -23,7 +23,7 @@
#include "opensync/plugin/opensync_plugin_info_private.h" /* FIXME: access direclty private header */
-static osync_bool mock_get_error(long long int memberid, const char *domain)
+static osync_bool mock_get_error(osync_memberid memberid, const char *domain)
{
const char *env = g_getenv(domain);
diff --git a/wrapper/opensync-group.i b/wrapper/opensync-group.i
index 57ff246..a95fc96 100644
--- a/wrapper/opensync-group.i
+++ b/wrapper/opensync-group.i
@@ -182,7 +182,7 @@ typedef struct {} Group;
%apply ConflictResolution *OUTPUT { ConflictResolution *res, int *num };
%apply int *OUTPUT { ConflictResolution *res, int *num };
- void get_conflict_resolution(ConflictResolution *res, long long int *winner) {
+ void get_conflict_resolution(ConflictResolution *res, osync_memberid *winner) {
osync_group_get_conflict_resolution(self, res, winner);
}
@@ -314,7 +314,7 @@ typedef struct {} Member;
wrapper_exception("osync_member_delete failed but did not set error code");
}
- long long int get_id() {
+ osync_memberid get_id() {
return osync_member_get_id(self);
}
--
1.6.2.5
|
|
From: Chris F. <cd...@fo...> - 2009-11-13 21:33:45
|
On Fri, Nov 13, 2009 at 05:16:49PM +0100, Daniel Gollub wrote: > On Thursday 12 November 2009 10:23:59 pm Chris Frey wrote: > > This patch makes it much clearer to follow the IDs through the system. > > Thanks! > > > > Ok, thanks for your feedback. Just committed the patch. I noticed that your patch added a prototype for osync_mapping_entry_get_member_id() to the opensync_mapping_entry_internals.h header. Yet that function already exists in opensync_mapping_entry.h Was this intended? - Chris |
|
From: Chris F. <cd...@fo...> - 2009-11-13 21:30:45
|
On Thu, Nov 12, 2009 at 04:36:40PM -0500, Chris Frey wrote: > I think the GCC_FORMAT_CHECK is worth it in the long run (there were lots > of printf style errors in the code), but the (void*) casts are unfortunate. > Anyone know of a cleaner workaround? After a conversation on #gcc on irc.freenode.net (thanks to segher), I had the following enlightenment: - the C standard does not guarantee that all pointers are the same size on all platforms - for example, data pointers and function pointers can have differing formats - the C standard guarantees that you can cast all pointers to void* and back - the %p format string identifier only takes a void* - vararg functions cannot provide implicit casts, since there is no prototype for the variable data - so in general, to be standard-C correct, you need to cast all %p pointers to vararg functions - the -pedantic option makes all this show up explicitly, but in most cases you don't need it, at least with gcc Basically there's no way around it, except disabling -pedantic in your compiles, or adding (void*) casts to all %p pointers. - Chris |
|
From: Daniel G. <go...@b1...> - 2009-11-13 16:17:22
|
On Thursday 12 November 2009 10:23:59 pm Chris Frey wrote: > This patch makes it much clearer to follow the IDs through the system. > Thanks! > Ok, thanks for your feedback. Just committed the patch. Best Regards, Daniel -- Daniel Gollub Geschaeftsfuehrer: Ralph Dehner FOSS Developer Unternehmenssitz: Vohburg B1 Systems GmbH Amtsgericht: Ingolstadt Mobil: +49-(0)-160 47 73 970 Handelsregister: HRB 3537 EMail: go...@b1... http://www.b1-systems.de Adresse: B1 Systems GmbH, Osterfeldstraße 7, 85088 Vohburg http://pgpkeys.pca.dfn.de/pks/lookup?op=get&search=0xED14B95C2F8CA78D |
|
From: Chris F. <cd...@fo...> - 2009-11-12 21:37:20
|
Hi, I noticed that scriptor made some changes to the ldap-sync module, based on the new warnings caused by my GCC_FORMAT_CHECK patch. (r5955) I noticed that now there's a lot of (void*) casts for the osync_trace() calls, and that's likely due to using -pedantic when compiling. I think the GCC_FORMAT_CHECK is worth it in the long run (there were lots of printf style errors in the code), but the (void*) casts are unfortunate. Anyone know of a cleaner workaround? Thanks, - Chris |
|
From: Chris F. <cd...@fo...> - 2009-11-12 21:24:52
|
On Sun, Nov 08, 2009 at 06:16:46PM +0100, Daniel Gollub wrote: > Find attachtd a proof of concept patch which is implementing this ... This patch makes it much clearer to follow the IDs through the system. Thanks! - Chris |
|
From: Chris F. <cd...@fo...> - 2009-11-12 21:09:05
|
On Sun, Nov 08, 2009 at 05:14:23PM +0100, Daniel Gollub wrote:
> On Saturday 07 November 2009 12:58:38 am Chris Frey wrote:
> > Hi,
> >
> > In the opensync_archive_internals.h header, _save_ignored_conflict()
> > is documented as such:
> >
> > /**
> > * @brief Saves an entry in the ignored conflict list.
> > *
> > * @param archive The group archive
> > * @param objtype Reported object type of entry
> > * @param mappingid Mapping Entry ID of entry
>
> That's correct.
[...]
> > Isn't the entryid field used for the archive id's themselves, and not the
> > mapping ids?
>
> Not quite sure which ID you mean for "archive id".
By "archive id" I'm referring to the IDs returned by the function
osync_archive_save_change(), which seems to be used in other functions
to refer to a row number in the tbl_changes table.
By "mapping id", I'm referring to IDs returned by the function
osync_mapping_table_get_next_id().
According to your email above, the ID in osync_archive_save_ignored_conflict()
is a mapping id. This is what I was confused about.
It also seems like the id field in tbl_changelog is not used?
> While looking into this i found a bug in OpenSync which broke the support
> of "ignore conflicts". Which is hopefully fixed now with r5950
>
>
> Here is a dump of the tbl_changes and tbl_changelog, which contains two
> conflicts which got ignored. (I used for that a group with two file-sync members)
>
[snip]
>
> (changetypes: 3 == deleted, 4 == modified)
>
> And indeed this looks pretty strange - 4 tbl_changelog for 2 mappings ...
>
> The information is missing which member was sending which changetype ...
>
> I guess it should look like this:
>
>
> ----8<---
> BEGIN TRANSACTION;
> CREATE TABLE tbl_changelog (objtype VARCHAR(64) NOT NULL, memberid INTEGER NOT NULL, mappingid INTEGER NOT NULL, changetype INTEGER NOT NULL, PRIMARY KEY (objtype, memberid,
> mappingid) );
> INSERT INTO "tbl_changelog" VALUES('contact',1,4,4);
> INSERT INTO "tbl_changelog" VALUES('contact',2,4,4);
> INSERT INTO "tbl_changelog" VALUES('contact',1,6,4);
> INSERT INTO "tbl_changelog" VALUES('contact',2,6,3);
> COMMIT;
> ---->8---
>
>
> Does this sound sane?
> Does this address your question?
I'm sorry, but I don't fully understand the tables yet, so I can't
comment on whether it is sane. It does look better that there are no
NULL values in the ID field.
My question was merely which ID belonged where, since I'm working on the
long long patch.
Thanks!
- Chris
|
|
From: Henrik /K. <he...@ka...> - 2009-11-12 15:51:14
|
Daniel Gollub wrote: > On Thursday 12 November 2009 04:27:04 pm Henrik /KaarPoSoft wrote: > >> I am aware that I can create several plugins; but I was thinking that >> maybe there was a way to version plugins / plugin configurations. >> > > Oh i see .. i missudnerstood your initial topic. I haven't thought about that > yet. I guess thats not a problem we should concentrate on today .. .maybe we > should first get something which actually makes syning work and then talk > about handling different versions. > I have created ticket 1189 so we don't forget... /Henrik |
|
From: Henrik /K. <he...@ka...> - 2009-11-12 15:37:33
|
Juha Tuomala wrote: > On Mon, 9 Nov 2009, Henrik /KaarPoSoft wrote: >> A member of a group has a configuration file. >> >> Would it be possible to implement some mechanism, which would allow us >> to have more than one default configuration file per plugin? >> >> This would make sense, if different versions of a plugin supports >> different AdvancedOptions, different Resources, etc. > Correct me if I'm wrong, if I say that: > - the file is in XML format > - X in XML stands for eXtensible > - tools reading the XML don't care about stuff they don't understand. > - thus the XML, the configuration file is always backwards compatible? > - thus the same file can be used regardless of versions? The challenge is not so much the syntax. Even the schema is the same for all plugin configuration files. And a Frontend would probably let the OpenSync library do the parsing anyway. The challenge I am thinking of is this: How can a Frontend present a nice GUI to configure ANY OpenSync plugin? Maybe I am wrong, but the way I do it in blueZync is to look at the advanced options and creating GUI for those, and look at the resources and create GUI for the resources defined in the default config file. Obviously a Frontend may have specific knowledge of specific plugins and create an even better GUI, but it would be nice if a Frontend could automatically create a GUI for any OpenSync plugin automatically. /Henrik |
|
From: Daniel G. <go...@b1...> - 2009-11-12 15:35:43
|
On Thursday 12 November 2009 04:27:04 pm Henrik /KaarPoSoft wrote: > I am aware that I can create several plugins; but I was thinking that > maybe there was a way to version plugins / plugin configurations. > Oh i see .. i missudnerstood your initial topic. I haven't thought about that yet. I guess thats not a problem we should concentrate on today .. .maybe we should first get something which actually makes syning work and then talk about handling different versions. But what we have - what is maybe interesting for your "problem" ... we have the OSyncUpdater which updates old configs to new configs, with the help of XSLT conversion stylesheets. Best Regards, Daniel -- Daniel Gollub Geschaeftsfuehrer: Ralph Dehner FOSS Developer Unternehmenssitz: Vohburg B1 Systems GmbH Amtsgericht: Ingolstadt Mobil: +49-(0)-160 47 73 970 Handelsregister: HRB 3537 EMail: go...@b1... http://www.b1-systems.de Adresse: B1 Systems GmbH, Osterfeldstraße 7, 85088 Vohburg http://pgpkeys.pca.dfn.de/pks/lookup?op=get&search=0xED14B95C2F8CA78D |
|
From: Henrik /K. <he...@ka...> - 2009-11-12 15:27:16
|
Daniel Gollub wrote: > [...] > Close, try get_sync_info(). get_sync_info() get called when all the plugins > get loaded: > > e.g. osynctool --listplugins > > Perfect example would be the SyncML plugin. It's registering 4 plugins in one > get_version() call... > > [...] > > This is what i try suggested some weeks ago to spawn several plugins for the > mozilla-sync to avoid that user have to set the external_command by their own. > > It's just about registering some OSyncPlugin* to OSyncPluginEnv ... even if > those are the same shared-module or so. > Thank you very much for the explanation! I am aware that I can create several plugins; but I was thinking that maybe there was a way to version plugins / plugin configurations. But from the answer I understand that this is not the case, so I will just create two plugins (the new one probably named mozilla-sync-3). (As mozilla-sync is now a pure external plugin it will be with two xml files, not get_sync_info() ). /Henrik |
|
From: Juha T. <Juh...@ik...> - 2009-11-12 09:49:52
|
On Mon, 9 Nov 2009, Henrik /KaarPoSoft wrote: > A member of a group has a configuration file. > > Would it be possible to implement some mechanism, which would allow us > to have more than one default configuration file per plugin? > > This would make sense, if different versions of a plugin supports > different AdvancedOptions, different Resources, etc. Correct me if I'm wrong, if I say that: - the file is in XML format - X in XML stands for eXtensible - tools reading the XML don't care about stuff they don't understand. - thus the XML, the configuration file is always backwards compatible? - thus the same file can be used regardless of versions? br, Tuju -- Ajatteleva ihminen tarvitsee unta. |
|
From: Daniel G. <go...@b1...> - 2009-11-12 09:21:55
|
On Tuesday 10 November 2009 09:56:22 pm Jakub Marczynski wrote:
> > I could of course create just one default configuration file with both
> > Formats, but a GUI would not be able to figure out that this particular
> > version of the external plugin will only support one of them.
>
> Maybe, as a temporary solution, just make thin new version of a plugin
> exist as a new plugin, with another configuration file. Then, there's no
> need to change the Opensync logic. Does it make any sense?
Right. The "thinest" way is to build a OSyncPlugin* and register it with
osync_plugin_env_register_plugin()!
>
> > I have never figured out what the plugin's get_version is used for.
> > Could it be used here?
>
> This is a good point. I found a statement:
> "The format/conversion and main plugin modules that are part of a plugin
> now each have a function int get_version(void). At the moment this
> function must return 1. "
> Is this "MUST" still so importart?
Yes, check:
---8<---
osync_bool osync_module_check(OSyncModule *module, OSyncError **error)
{
int version = 0;
[...]
version = osync_module_get_version(module);
[...]
if (version != OPENSYNC_PLUGINVERSION) {
osync_error_set(error, OSYNC_ERROR_GENERIC, "Plugin API
version mismatch. Is: %i. Should %i", version, OPENSYNC_PLUGINVERSION);
----->8---
One day we might can use this to support several plugins which are
build/designed against different OpenSync plugins APIs.
Maybe we should introduce some #define instead of a confusing "return 0" ...
something like: return OSYNC_PLUGIN_SYNC_API_VERSION_1;
What do you think?
Best Regards,
Daniel
--
Daniel Gollub Geschaeftsfuehrer: Ralph Dehner
FOSS Developer Unternehmenssitz: Vohburg
B1 Systems GmbH Amtsgericht: Ingolstadt
Mobil: +49-(0)-160 47 73 970 Handelsregister: HRB 3537
EMail: go...@b1... http://www.b1-systems.de
Adresse: B1 Systems GmbH, Osterfeldstraße 7, 85088 Vohburg
http://pgpkeys.pca.dfn.de/pks/lookup?op=get&search=0xED14B95C2F8CA78D
|
|
From: Daniel G. <go...@b1...> - 2009-11-12 08:50:32
|
On Monday 09 November 2009 07:08:32 pm Henrik /KaarPoSoft wrote:
[...]
>
> I have never figured out what the plugin's get_version is used for.
> Could it be used here?
Close, try get_sync_info(). get_sync_info() get called when all the plugins
get loaded:
e.g. osynctool --listplugins
Perfect example would be the SyncML plugin. It's registering 4 plugins in one
get_version() call...
You do this with osync_plugin_env_register_plugin() or so ...
Just set different names for the plugins, then you can have several default-
configuration, due to the different plugins names.
Example:
------8<-----
osync_bool get_sync_info(OSyncPluginEnv *env, OSyncError **error)
{
OSyncPlugin *plugin;
plugin = osync_plugin_new(error);
if (!plugin)
goto error;
osync_plugin_set_name(plugin, "syncml-http-server");
osync_plugin_set_longname(plugin, "SyncML over HTTP Server");
osync_plugin_set_description(plugin, "Plugin to synchronize with
SyncML over HTTP");
osync_plugin_set_initialize(plugin, syncml_http_server_init);
osync_plugin_set_finalize(plugin, finalize);
osync_plugin_set_discover(plugin, syncml_http_server_discover);
if (!osync_plugin_env_register_plugin(env, plugin, error))
goto error;
osync_plugin_unref(plugin);
plugin = osync_plugin_new(error);
if (!plugin)
goto error;
osync_plugin_set_name(plugin, "syncml-http-client");
osync_plugin_set_longname(plugin, "SyncML over HTTP Client");
osync_plugin_set_description(plugin, "Plugin to synchronize with
SyncML over HTTP");
osync_plugin_set_initialize(plugin, syncml_http_client_init);
osync_plugin_set_finalize(plugin, finalize);
osync_plugin_set_discover(plugin, syncml_http_client_discover);
if (!osync_plugin_env_register_plugin(env, plugin, error))
goto error;
osync_plugin_unref(plugin);
return TRUE;
error:
return FALSE;
}
----8<---
This is registering two plugins, which have two different dfeault-
configuration: syncml-http-client and syncml-http-server.
In the case of the SyncML plugin those plugins just differ in the plugin init
function and discover function.
>
> Any comments on this would be most appreciated.
[...]
This is what i try suggested some weeks ago to spawn several plugins for the
mozilla-sync to avoid that user have to set the external_command by their own.
It's just about registering some OSyncPlugin* to OSyncPluginEnv ... even if
those are the same shared-module or so.
Hope this helps.
Best Regards,
Daniel
--
Daniel Gollub Geschaeftsfuehrer: Ralph Dehner
FOSS Developer Unternehmenssitz: Vohburg
B1 Systems GmbH Amtsgericht: Ingolstadt
Mobil: +49-(0)-160 47 73 970 Handelsregister: HRB 3537
EMail: go...@b1... http://www.b1-systems.de
Adresse: B1 Systems GmbH, Osterfeldstraße 7, 85088 Vohburg
http://pgpkeys.pca.dfn.de/pks/lookup?op=get&search=0xED14B95C2F8CA78D
|
|
From: Jakub M. <ja...@o2...> - 2009-11-10 20:56:44
|
Some comments from the "beginner's" point of view: > Frontends may use the default configuration file to show a nice GUI. > This could include GUI for AdvancedOptions, and GUI for selecting > specific Resources. > > Would it be possible to implement some mechanism, which would allow us > to have more than one default configuration file per plugin? I guess there can be only one "default" file ;) Isn't it possible for the GUI to use only the necessary options from all that are declared in the file? > As an example: Future versions of mozilla-sync may support only vformat, > whereas the current version supports xml-format. > It would be great if OpenSync could carry different configuration files > for this, and select the correct one depending on the actual blueZync it > is connecting to. > > I could of course create just one default configuration file with both > Formats, but a GUI would not be able to figure out that this particular > version of the external plugin will only support one of them. Maybe, as a temporary solution, just make thin new version of a plugin exist as a new plugin, with another configuration file. Then, there's no need to change the Opensync logic. Does it make any sense? > I have never figured out what the plugin's get_version is used for. > Could it be used here? This is a good point. I found a statement: "The format/conversion and main plugin modules that are part of a plugin now each have a function int get_version(void). At the moment this function must return 1. " Is this "MUST" still so importart? Bloosky ja...@o2... |
|
From: Henrik /K. <he...@ka...> - 2009-11-10 00:47:01
|
Dear all, During my work on upgrading mozilla-sync to Thunderbird 3, I am once again thinking about creating a mozilla-format FORMAT plugin. But, as always, I have a question... The mozilla-format would be an non-string format - basically a C struct with a couple of members, implementing a key/value array. The struct would be wrapped in functions like mozilla_format_add_key_value_pair(key, value). Now the question is: Where to put the definition of the C struct and the wrapping functions? Those definitions would have to be accessible both by the mozilla-format FORMAT plugin and the mozilla-sync SYNC plugin (an external plugin, by the way...) Looking at xmlformat we have functions like osync_xmlformat_parse and osync_xmlformat_assemble defined in the main OpenSync codebase (opensync/xmlformat/opensync_xmlformat.c), not in the format plugin. But I guess we would not like to pollute the main OpenSync codebase with mozilla-format stuff. Looking at vformat, it seems that the internal format is a string, so even if the vformat plugin has some internal woodo to convert to/from xmlformat, a peer wishing to create a vformat would just create a string. But this would not work for mozilla-format, where we would need to create the C struct. Putting the definition of the C struct and the wrapping functions inside the format plugin is no good, as they would not be published for the mozilla-sync SYNC plugin to use. So, I need some help here: Where to put the definition of the C struct and the wrapping functions? Bonus question: If I want to create a converter between mozilla-format and vformat, I would need access to the vformat functions. Currently those are internal function in the vformat plugin. How can I get access to them? /Henrik |
|
From: Henrik /K. <he...@ka...> - 2009-11-09 18:19:53
|
Dear all, As far as I can see, ticket 1183 is a real showstopper for 0.40 in general and mozilla-sync in particular. Are anybody working on this? If not, I may try to have a go at it, although it may take some time... However, I have a question: Assume we have a group with two members M1 and M2. Member M1 supports ObjFormat F1 with capabilities CAP1, and member M2 supports ObjFormat F2 with capabilities CAP2. The function _osync_obj_engine_mapping_find will try to compare two changes CHANGE1 and CHANGE2 from the two members. This is done by: _osync_obj_engine_clone_and_demerge_change(CAPS2, CHANGE1) and _osync_obj_engine_clone_and_demerge_change(CAPS1, CHANGE2). This means, that an ObjFormat F1, which supplies a (de)merger with capabilties CAP1, needs to be able to demerge changes of ObjFormat F2, which it does not know. Some guidance on how the is supposed to work would be most appreciated. /Henrik |
|
From: Henrik /K. <he...@ka...> - 2009-11-09 18:08:45
|
Dear all, A member of a group has a configuration file. The default configuration file comes from the plugin. E.g. http://opensync.org/browser/plugins/mozilla-sync/trunk/src/mozilla-sync Frontends may use the default configuration file to show a nice GUI. This could include GUI for AdvancedOptions, and GUI for selecting specific Resources. Would it be possible to implement some mechanism, which would allow us to have more than one default configuration file per plugin? This would make sense, if different versions of a plugin supports different AdvancedOptions, different Resources, etc. In particular, it would make a lot of sense for external plugins, where the OpenSync SVN only contains configuration files, but the actual code is hosted, build and distributed somewhere else. Several different default configuration files could be included in OpenSync, and OpenSync could select the appropriate configuration file depending on the actual external plugin version. As an example: Future versions of mozilla-sync may support only vformat, whereas the current version supports xml-format. It would be great if OpenSync could carry different configuration files for this, and select the correct one depending on the actual blueZync it is connecting to. I could of course create just one default configuration file with both Formats, but a GUI would not be able to figure out that this particular version of the external plugin will only support one of them. Daniel has already described how this is done for capabilities. See http://old.nabble.com/xml-file-with-capabilities-td25978588.html I was wondering if we could do something similar for the default configuration file. As far as I can see, the challenge is, that the capabilities file is read AFTER discover, and it is discover which sets the version information used to select the appropriate capabilities. On the other hand, the default capabilities file would be needed BEFORE discover. I have never figured out what the plugin's get_version is used for. Could it be used here? Any comments on this would be most appreciated. /Henrik |