DB Database Format
------------------

The first database format that DB used was not designed to be
extensible. Any additions to the format would break compatibility for
previous versions. The new database format for DB is designed to be
extensible so that any additional data added to the application info
block will not break databases without that data.

Application Info Block
----------------------

The app info block starts with a small header defining some values
that all databases will have. The header is:

  UInt16 flags
  UInt16 num_fields

The remainder of the data in the app info block is stored as
"chunks". Each chunk consists of a simple header followed by the chunk
data itself. All of the chunks sit contiguously in the app info
block. The header of a chunk is:

  UInt16 chunk_type
  UInt16 data_size

The next section describes each chunk. For each chunk, the name and
chunk_type value are given followed by a brief description of the
chunk and its data.

CHUNK_FIELD_NAMES (0)

This chunk holds the name of each field in the database. The chunk
data consists of a series of zero-terminated strings, one for each
name.

CHUNK_FIELD_TYPES (1)

This chunk holds the type of each field in the database. The chunk
data consists of a UInt16 for each field describing the field type:

  0 - Zero-terminated string
  1 - Boolean
  2 - Integer (32-bits)

CHUNK_LISTVIEW_DEFINITION (64)

This chunk defines a set of columns to be displayed in the list view
mode. Each column is defined by the width of the column in the display
as well as the field from the database that will be displayed. The
chunk data consists of a short header follwed by an entry for each column:

  UInt16 flags
  UInt16 number_of_columns
  char name[32]

  UInt16 field_number
  UInt16 column_width

CHUNK_LISTVIEW_OPTIONS (65)

This chunk stores several of the options that the list view
uses. There should be exactly one copy of this chunk in any DB
database. Its format is as follows:

  UInt16 active_view
  UInt16 first_visible_record

CHUNK_LFIND_OPTIONS (128)

This chunk stores options for the local find dialog. There should be
exactly one copy of this chunk in any DB database. Its format is as
follows:

  UInt16 flags
