|
PDB File structure
Contents
PDB header structure Page 2
Record header structure Page 3
Assembling the file Page 3
Record data (PDA Toolbox format) Page 4
Data data header
Field header
Digital Ink header
Assembling the record data
Field |
Bytes |
Type |
Notes |
Name |
32 |
Null terminated string |
This is the name of the database on the palm device. It need not match the name of the PDB file in the environment in which it is created. |
File Attributes |
2 |
Numeric* |
0x0002 Read-Only 0x0004 Dirty AppInfoArea 0x0008 Backup this Database 0x0010 (16 decimal) Okay to
install newer over existing copy, if present
on Palm 0x0020 (32 decimal) Force the
Pilot to reset after this database is installed 0x0040 (64 decimal) Dont allow copy of file to be beamed to other Palm. |
Version |
2 |
Numeric* |
Defined by the application |
Creation Date |
4 |
Numeric* |
Expressed as the number of seconds since januari 1,1904 (Palm OS 3.0 and newer) |
Modification Date |
4 |
Numeric* |
Expressed as the number of seconds since January 1,1904 (Palm OS 3.0 and newer) |
Last Backup Date |
4 |
Numeric* |
Expressed as the number of seconds since January 1,1904 (Palm OS 3.0 and newer) |
Modification Number |
4 |
Numeric* |
Set to zero |
AppInfoArea |
4 |
Numeric* |
The byte number in the PDB file (counting from zero) at which the AppInfoArea is located. This must be the first entry in the data portion of the PDB file. If this database does not have a AppInfoArea, set this value to zero. |
SortInfoArea |
4 |
Numeric* |
The byte number in the PDB file (counting from zero) at which the SortInfoArea is located. This must be placed immediately after the AppInfoArea, if one exists, within the data portion of the PDB file. If this database does not have a SortInfoArea, set this value to zero. Do not use this |
Database Type |
4 |
String |
Set this to the desired value. Generally it should match the Database type used by the corresponding application. This is 4 character long and does not have a terminating zero. |
Creator ID |
4 |
String |
Set this to the desired value. Generally it should match the Creator ID used by the corresponding application. In all cases, you should always register you Creator ID before using it. This is 4 character long and does not have a terminating zero. |
Unique ID Seed |
4 |
Numeric* |
This is used to generate the Unique ID number of subsequent records. This should be set to zero. |
NextRecordList ID |
4 |
Numeric* |
Set this to zero. The element is used only in the in memory representation of a PDB file, but exists in the external version for consistency. |
Number of Records |
2 |
Numeric* |
This contains the number of records. |
Record header
Field |
Bytes |
Type |
Notes |
Record Data Offset |
4 |
Numeric* |
The byte number in the PDB file (counting from zero) at which the record is located. |
Record Attributes |
1 |
Numeric* |
0x10 (16 decimal) Secret
record bit 0x20 (32 decimal) Record in
use (busy bit) 0x40 (64 decimal) Dirty record
bit. 0x80 (128, unsigned decimal)
Delete record on next HotSync The lest significant four bits are used to represent the category values. |
Unique ID |
3 |
Numeric* |
Set this to zero and do not try to second-guess what PalmOS will do whit this value. |
Area |
Description |
Database Header |
The complete header format, as described above (78 bytes) |
Record List |
Must contain at atleast one entry (Record headers) |
Filler |
Upon transferring a database from the Palm to the desktop environment, the PDB file will have two bytes of filler here. It does not appear to be necessary to insert these two bytes here when creating a PDB file for installation on the Palm. However, if you read a PDB file created by the backup conduit (setting the backup bit), you will find that there are two bytes of data in this location. |
Data Area |
It must be in this order: AppInfoArea (if present), SortInfoArea (if present), and records, sequentially. The order is important because each elements size is computed based on the location of the following element. |
The Record data is saved in
a binary format and how the is assembled differs from application to
application.
Here is the record data structure for a PDB file created from a database that is created with a PDAToolbox application. The PDB file created from a PDAToolbox database doesnt have any AppInfoArea and SortInfoArea and the number of fields and the order of the fields can differ from record to record.
The Record data is saved in
a binary format and how the is assembled differs from application to
application.
Here is the record data structure
for a PDB file created from a database that is created with a PDAToolbox
application. The PDB file created from a PDAToolbox database doesnt
have any AppInfoArea and SortInfoArea and the number of fields and the
order of the fields can differ from record to record.
Field |
Bytes |
Type |
Notes |
Number of Fields |
2 |
Numeric* |
Number of Fields in the record, each record can contain different number of records. |
Field |
Bytes |
Type |
Notes |
Field Name |
4 |
String |
Name of the field, This is 4 character long and does not have a terminating zero |
Field Type |
2 |
Numeric* |
0 String 1 Boolean 2 Date, number of days since January 1 1904 3 Time, number of minutes since midnight 5 Digital Ink 6 Alarm, number of seconds since January 1 1904 |
Field Size |
2 |
Numeric* |
The size of the field in bytes. The size depends on the Field Type. String: Length of the text, the size is always even so if the actually length is odd an extra byte is added. Boolean: 2 bytes. Date: 4 bytes. Time 4 Bytes. Digital Ink: Size of the image plus a 16 bytes header** Alarm: 4 Bytes |
** The Digital Ink header (standard Palm bitmap header)
Field |
Bytes |
Type |
Notes |
Width |
2 |
Numeric* |
Width in pixel of image. |
Height |
2 |
Numeric* |
Height in pixel of image. |
BytesPerRow |
2 |
Numeric* |
The number of bytes for each row in the image. |
BitmapsFlags |
2 |
Numeric* |
1 Compressed 2 HasColorTable 4 HasTransparency 8 inderect 16 for screen This field is not used for Dinks |
PixelSize |
1 |
Numeric* |
The pixel depth Currently supported pixel depths are 1, 2, 4, and 8-bit. |
Version |
1 |
Numeric* |
The version of bitmap encoding used 0 Bitmap encoding PalmOS v1, 1 Bitmap encoding PalmOS v3 2 Bitmap encoding PalmOS v3.5 This must be set to 0 |
nextDepthOffset |
2 |
Numeric* |
Not used set to 0 |
transparentIndex |
1 |
Numeric* |
Not used set to 0 |
compressionType |
1 |
Numeric* |
Not used set to 0 |
reserved |
8 |
Numeric* |
Reserved set to 0 |
Area |
Description |
Record Data Header |
|
Field Headers |
Field 1 to n |
Data Area |
Data for field 1 to n |