NAME

pdbc - palm database compiler


SYNOPSIS

pdbc [-h -V -W -o file -w[01] -v[0-4]] file


DESCRIPTION

pdbc compiles a text source file into a binary Palm DataBase (PDB) file.

This PDB file can then be loaded into your palm and used by a Palm application.

PDB File Format (Output)

A PDB file has some attributes (e.g. a filename, creator and type id, ...) and zero or more data records.

Optionally it can have 2 special data chunks --- the appinfo and the sortinfo blocks.

Each data record has some record attributes and the user data.

pdbc converts an ascii text source file into a binary PDB file.

Source File Format (Input)

A pdbc source file is an ascii text file. Keywords are lowercase, value literals are case insensitive. The // marks the beginning of a comment until end of line.

Simple Source File Example

        file
         filename = "mydatabase";
         creatorid = 'ABCD';
         typeid = 'PQRS';
        begin
         record
         begin
          01 02 03 04           // written as: 01 02 03 04
          dec word
          1234 5678 0           // written as: 04 D2 16 2E 00 00
         end;
         record
         begin
          "ABC"                 // written as: 41 42 43 00
          'A' 'B' 'C' 'D'       // written as: 41 42 43 44
          'ABCD'                // written as: 41 42 43 44
         end;
        end;


OPTIONS

--help | -h | -?
Simple help text

--verbose=0 | -v0
Verbose: off

--verbose=1 | -v1
Verbose: normal level (default)

--verbose=2 | -v2
Verbose: more info

--verbose=3 | -v3
Verbose: a lot of info

--verbose=4 | -v4
Verbose: way too much info

--version | -V
Version information

--warnings=0 | -w0
Supress warnings

--warnings=1 | -w1
Don't supress warnings (default)

--strict | -W
Treat warnings as errors

--out=file | -o file
Output file

--newline=newlinespec | -N newlinespec
Specifies the newline style of the output (stdout).

The newlinespec is one of: unix, windows, mac.

This option is intended to produce reproducable results on several platforms (for my automated regression tests).


ERRORS

Errors

        Could not open binary include file '%s' for binary include.
        Could not open source file '%s'.
        Illegal base %d.
        Illegal character '%c' (=0x%02x) in '%s' base %d
        Illegal digit '%c' in '%s' base %d
        Illegal number size %d
        Illegal padchar %d.
        Illegal padstring %d.
        Illegal size %d.
        Includes nested too deeply (%d)
        Multiple appinfo blocks
        Multiple sortinfo blocks
        No record allowed in resource file (.prc)
        No resource allowed in record file (.pdb)
        Not allowed to set record header settings outside record.
        Not allowed to set resource id outside resource.
        Not allowed to set resource type id outside resource.
        Not allowed to write data outside record.
        Option -o needs 1 argument\n
        Unknown option %s\n
        Unterminated comment starting at line %d
        User error: %s

Warnings

        Could not compute date %04d/%02d/%02d
        '%s' base %d too big for %d bytes - extended to %d bytes
        String '%s' too long for padding to %d bytes
        User warning: %s


DIAGNOSTICS

Possible exit status values:

Exit 0
Successful completion

Exit 1
Missing sourcefile argument

Exit 2
Unknown commandline option

Exit 3
Commandline option error (e.g. missing option argument)

Exit 4
Misc errors (e.g. missing files, file permissions)

Exit 5
Compiler error in source file


EXAMPLES

pdbc -V
 pdbc 1.0
pdbc mystuff.pdbc
 Writing 2 records into file 'out.pdb'.
 105 bytes written.
pdbc -v2 mystuff.pdbc
 ------ Fileheader ------
 Fileheader begins at addr 00000000
 Fileheader ends at addr 0000004e
 ------ Recordheaders (2 records) ------
 Record [0] header at addr 0000004e
 Record [1] header at addr 00000056
 ------ Record data (2 records) ------
 Record [0] data at addr 00000060
 Record [1] data at addr 00000064
 ====== Data linked ======
 Writing 2 records into file 'out.pdb'.
 105 bytes written.


SEE ALSO

pdbc(4), pdbdec(1), EBNF Syntax of pdbc(4),


BUGS

Real Bugs

Not Yet Implemented


AUTHOR

Eric Obermuhlner (eric@obermuhlner.com)