[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[coldsync-hackers] Categories: thoughts, anyone?



	In the not-too-distant future, it will finally be possible to
synchronize adatabase's AppInfo block, which includes the categories.
Hence, it will be possible to write a conduit that synchronizes categories
between the Palm and the desktop.
	The standard AppInfo block looks like this:

	struct {
		uword renamedCategories;
					/* Categories that have been
					 * renamed since the last sync. */
		char labels[16][16];	/* Category names */
		ubyte ids[16];		/* Category IDs */
		ubyte last_ID;		/* Last ID that was assigned */
	} StdAppInfo;

Or, more logically:

	struct {
		struct {
			Bool renamed;
			label[16];
			ubyte id;
		} category[16];

		ubyte last_ID;

	} StdAppInfo;

As you can see, given two AppInfo blocks (one from the Palm, one from
the backup on the desktop), it should be possible to combine them into
one, which can then be uploaded back to the Palm, and also written to
the database on disk.
	The easy cases are easy, but I'd appreciate some help with the
harder parts. For instance:
	- What if both AppInfo blocks already have 16 categories, but
	  each one has a new category (for a total of 18 categories
	  total)?
	- The user may have synced with some other machine (the
	  equivalent of a slow sync). Hence, the "renamedCategories"
	  bit-field might be wrong.
	- Category 17 has the label "Games" on the Palm, but "Sports"
	  on the desktop.
	- The database on the desktop might have two categories with
	  the same name, but different IDs.
	- Other potential problems.

The good news is that each record has a category ID that is stored
separately from the record data. This means that it's possible to
change a category's ID and move all of the records to the new ID
without knowing the record structure.

	So, any thoughts?

-- 
Andrew Arensburger                      This message *does* represent the
arensb@ooblick.com			views of ooblick.com
    I'm willing to suspend my disbelief, but not my intelligence.


--
This message was sent through the coldsync-hackers mailing list.  To remove
yourself from this mailing list, send a message to majordomo@thedotin.net
with the words "unsubscribe coldsync-hackers" in the message body.  For more
information on Coldsync, send mail to coldsync-hackers-owner@thedotin.net.