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

Re: AddressDB.pdb --> AddressDB.txt ?



Kerry Whittle writes:
>I would think that he meant for use with Solaris.  I do not (nor do
>intend to) use anything but Solaris and am interested in the same
>function for my workstation.
>
>If I had the specs for the the .db file, I could write the
>conversion, but I have no idea where to start finding it.

For a few weeks now I have been writing on a perl script that will
list addresses and grep stuff from the AddressDB.pdb file, but my
schedule is a little cramped and the script is not releasable yet.
I'll spend some hours on it tomorrow (assuming that my boss is looking
the other way) and then post the results, functional or not.

FYI, I first thought of writing an address book application in Java,
that would sync nicely with the Pilot, but realised that the
aforementioned script would do just as well for me.  I'm still
interested in the Java-applet idea, though, and need to learn Java
asap.

Below is the AddressDB information I've gathered from different
places.  The left column is the length of the field in bytes (nib =
nibble = 1/2 byte = 4 bits) and the right column is the field name.
The listing starts from the beginning of the AddressDB file and is
one-to-one with *my* AddressDB.pdb, YMMV.  The pseudocode snippet at
the end is from address.c in pilot-link.

-----------
AddressDB.pdb format

PDB header:
32	file name
2	flags #
2	version #
4	creation time
4	mod time
4	backup time
4	modnum
4	app_info
4	sort_info
8	'DATAaddr' (type/crea)
4	unique_id_seed
4	next_record_list
2	numRecs

Resource header:
numRecs * (
  2	offset to record N
  1	category ID
  3	unique ID != 0
  2	pad
)
2	renamed categories (bit flags?)
16 x str16	categories[16]
16 x int	category_id[16]
4	last_unigue_id
4	renamed field labels (bit field)
22 x str16	labels[22]
2	country
1	sort_by_company (boolean)
1	pad

Record data:
numRecs * (
  1	pad
  nib	which phone
  5 x nib	phonelabel[5] (bkwds 4...0)
  4	contents: bit N is on if field N has data
for(v=0;v<19;v++) {
	if (contents & (1<<v)) {
		entry[v]=getNextStr;
	} else { entry[v]=''; }}
)
--------

--Martin

Martin von Weissenberg     <http://www.hut.fi/~mweissen>
WOKING, n.: Standing in the kitchen wondering what you came in here for. (DA)
---------------------------------------------------------------------
********************************************
*   PLEASE DO NOT POST PILOTMANAGER BUGS   *
*  TO THIS ALIAS.  SUBMIT BUG REPORTS VIA  *
*     THE FEEDBACK MENU IN PILOTMANAGER    *
*             --------------------         *
*      This is a public mailing list!      *
*  Please do not publish Sun proprietary   *
*            information here!             *
********************************************


SourceForge.net Logo