Welcome to pdbc

This is the HTML documentation to the pdbc distribution V0.9.5

Copyright 2001-2004 by Eric Obermuhlner


What is pdbc

pdbc is a compiler than converts a source file into a Palm DataBase (PDB) file or Palm Resource (PRC) file. The language the pdbc compiler understands is designed to be easy to understand und write. It is powerful enough to give the freedom to describe the binary content of the database records in a variety of ways.

It should also be easy to generate the pdbc source file from another language (e.g. Perl).

In addition to the pdbc tool there is also 'pdbdec'. pdbdec is a decompiler which converts any valid PDB or PRC file into a pdbc source file. This is useful to check the correctness of the pdbc generated file and to analyze other PDB files.


Why pdbc was written

When I started to program for the Palm (using the GNU tools on a Windows PC) I had difficulties to generate the PDB files I wanted to distribute together with my Palm application.

My first approach was to write a dedicated Palm application whose sole purpose was to generate a DataBase on the Palm from static data. After a hotsync the PDB file was then available on my PC. This was too much overhead.

The second approach was to write a C application on the PC that would write the PDB file directly from static data (the static data was generated by shell scripts+awk and included into the C source). Better, put still pretty awkward (I still have the application around in case somebody is interested).

Then I started to write pdbc as a general purpose tool with enough flexibility to serve my needs and maybe other peoples needs to.

I hope you find it useful.


How to install pdbc

Unpack the contents of the distribution package into a directory (e.g. C:\PalmDev\PDBC).

In the Control Panel ``System'' add the path to the 'bin' directory to the PATH environment variable (e.g. C:\PalmDev\PDBC\bin).


How to use pdbc

pdbc comes with several 'man' pages for compiler, decompiler, and source file format.

Check the following pages:

In a nutshell you can use pdbc/pdbdec like this:

pdbc sourcefile
generates a PDB file named 'out.pdb'

pdbdec pdbfile
decompiles a PDB file into pdbc source on stdout

Here the synopsys:

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


Goodies

I wrote an emacs mode for pdbc files. The main feature is syntax-highlighting. I am still working on getting the automatic indenting right.

To install and use pdbc emacs-mode, please follow the instructions in the file emacs/pdbc-mode.el.


History

V0.9.5

Thanks to Per-Erik Martin it should now really compile on many Unixes.

For Micro$oft use the 'build.bat' to build from sources.

Implemented missing file attributes (launchable, recyclable, bundle).

V0.9.4

Switched development to cygwin tools. The 'Makefile' should work on cygwin and many Unixes. For Micro$oft use the 'build.bat' to build from sources.

Added --newline option to pdbc and pdbdec.

V0.9.3

Added GNU-style --options to pdbc and pdbdec. Fixed -o option (was ignored) in pdbdec.

V0.9.2

This release fixes float and double values in pdbc and adds the possibility to decompile float and double with pdbdec.

V0.9.1

This release that contains some useful improvements to both pdbc and pdbdec.

create resource files (.prc) as well as database files (.pdb)
With the attrib = resource flag pdbc will create .prc files. Instead of 'record' blocks you will then need to specify 'resource' blocks in the source file.

These 'resource' blocks can have resource specific attributes (typeid and id).

C-Style comments
/* */ style comments are now allowed additionally to the ANSI-C Style //

improved double/float specification
double and float values can now be specified by a trailing 'd' or 'f' or with the keywords 'double' and 'float'.

added some fileheader attributes
'resource', 'stream' and 'hidden' where added to the fileheader attributes.

pdbdec: improved -F format commands
The -F option understands now a comma separated list of key=value pairs.

Additional formatting features where added (automatic string recognition, byte/word/long, bin/oct/dec/hex, ...).

V0.9.0

This is the first release of pdbc. I decided to give it a release number less than 1.0 because I wanted to get some feedback before I make syntax and semantics of the tool final.

Once I have reached V1.0 all releases with the same major version number should be backward compatible. (Undocumented features, and bugs of course may change within a minor release) This means also that I will be stuck with any shortcomings of the current syntax. So if you have any feedback -- don't hesitate.


Credits

pdbc was written by Eric Obermuhlner.

Thanks to Andreas Gieriet for discussing syntactical niceties and for the ebnf2annot tool with which the HTML syntax file was created. Thanks to Pius Krucker for proof reading the man pages.

Massimo Penta told me about the fileheader attributes that where added between PalmOS 3.0 and 4.0 and found the double/float bug which led to release 0.9.2.

Per-Erik Martin ported the code to several platforms (Linux, Solaris, MacOS X).

Michael Campanella noticed the missing fileheader atributes.


Contact

The author of pdbc can be reached at eric@obermuhlner.com.

There is a mailing-list you might want to join:

pdbc-discuss@obermuhlner.com
pdbc discussion list. Join this mailing list if you want to discuss bugs and features of pdbc (and pdbdec). This list is unmoderated (as long as nobody spams it).

To join this list send an email to:


License

It is my intent to publish pdbc under Gnu Public License (GPL). I am not yet 100% sure what I need to add to the distribution to make it legally waterproof, but I will do so with one of the next releases.