Hello folks,

I want to construct a PDB database on a PC, so I need to understand the file 
format of the PDB files. I've read the documentation provided by PalmSource

http://www.palmos.com/dev/support/docs/protein_books/File_Formats/Intro.html#970019
http://www.palmos.com/dev/support/docs/protein_books/File_Formats/PDBandPRCFormat.html#972428

but when comparing to the actual stuff I see in a PDB file exported from the 
device, some things don't make sense...

OK, I understand that the PDB file has a 80-byte header:

UInt8 name[dmDBNameLength];     // 32 bytes
UInt16 attributes;              //  2 bytes
UInt16 version;                 //  2 bytes
UInt32 creationDate;            //  4 bytes
UInt32 modificationDate;        //  4 bytes
UInt32 lastBackupDate;          //  4 bytes
UInt32 modificationNumber;      //  4 bytes
LocalID appInfoID;              //  4 bytes
LocalID sortInfoID;             //  4 bytes
UInt32 type;                    //  4 bytes
UInt32 creator;                 //  4 bytes
UInt32 uniqueIDSeed;            //  4 bytes
LocalID nextRecordListID;       //  4 bytes
UInt16 numRecords;              //  2 bytes
UInt16 firstEntry;              //  2 bytes

What is supposed to follow is numRecords records, each having the following 
structure:

LocalID localChunkID;           //  4 bytes
UInt8 attributes;               //  1 byte
UInt8 uniqueID[3];              //  3 bytes

with all numbers being stored in big-endian format.

Now, if I examine a real PDB file with a hex editor, the stuff after the 
80-byte header looks like this:

02 D0 40 F3 20 01 00 00
02 F1 40 F3 20 02 00 00
03 04 40 F3 20 03 00 00
03 16 40 F3 20 04 00 00

etc.

OK, "20" is, presumably, the attributes and "01 00 00", etc. are the uniqueIDs. 
But how to interpret the localChunkID part?

According to the PalmOS documentation, the localChunkID is "The local offset 
from the top of the PDB to the start of the raw record data for this entry.". 
But I don't see how one can interpret, say, "02 D0 40 F3" like this.

In fact, in the particular file I'm examining, the first part ("02 D0") *can* 
be interpreted like that - indeed the first data record resides at offset 
0x02D0 from the beginning of the file. But where does "40 F3" come from and 
what is its meaning?

Regards,
Vesselin
-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/

Reply via email to