Palm OS Databases (Cont.)
Structure of a Database Header
A database header consists of some basic database information and a list of records in the database.
Each record entry in the header has the local ID of the record, 8 attribute bits, and a 3-byte unique ID for the record.
The database header has the following fields:
- The
name
field holds the name of the database.
- The
attributes
field has flags for the database.
- The
version
field holds an application-specific version number for that database.
- The
modificationNumber
is incremented every time a record in the database is deleted, added, or modified.
Thus applications can quickly determine if a shared database has been modified by another process.
- The
appInfoID
is an optional field that an application can use to store application-specific information about the database.
For example, it might be used to store user display preferences for a particular database.
- The
sortInfoID
is another optional field an application can use for storing the local ID of a sort table for the database.
- The
type
and creator
fields are each 4 bytes and hold the database type and creator.
The system uses these fields to distinguish application databases from data databases and to associate data databases with the appropriate application.
- The
numRecords
field holds the number of record entries stored in the database header itself.
If all the record entries cannot fit in the header, then nextRecordList
has the local ID of a recordList
that contains the next set of records.
Each record entry stored in a record list has three fields and is 8 bytes in length.
Each entry has the local ID of the record which takes up 4 bytes: 1 byte of attributes and a 3-byte unique ID for the record.