Compressing Databases

Discuss OrbForms Designer and PocketC Architect

Postby Ca-Sa on Fri Sep 06, 2002 3:34 pm

I am working on an application, which has 1000s of database entries.

Now I'm searching for a method to compress these data in a pdb. The Textfile on my PC is about 2-3MB and still growing :/

Any Ideas?

Carsten Sandtner
Carsten Sandtner
Posts: 19
Joined: Thu Oct 04, 2001 4:15 pm
Location: Germany

Postby jstadolnik on Fri Sep 06, 2002 4:12 pm

The only way to do this at reasonable speeds is through a native add-in.

I used standard pdoc (palm doc) compression in the Compress() function for the PToolboxLib. The chief reasons being: 1) small code footprint (<1.5k), and decent compression ~40% for text (compared to gzip compression yields ~50% and has a ~30k footprint).


The PToolboxLib guy.
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Postby Ca-Sa on Mon Sep 09, 2002 6:17 am

Hmmm... I seems so, that I have to write an Add-in for Orbforms to have this Compression.

Any tips&tricks how to do this? What kind of Compiler do I need?

And I need infos about this Pdoc.

Thanks so far.

Carsten Sandtner
Carsten Sandtner
Posts: 19
Joined: Thu Oct 04, 2001 4:15 pm
Location: Germany

Postby PenreeSoft on Mon Sep 09, 2002 5:22 pm

Codewarror is the tool of choice. Heres some PDoc info:

It's actually really
easy - it's just a normal Palm Database with record 0 being the header

Doc (Pilot standard text document) file format

struct doc_record0 { /* 16 bytes total */
Word version; /* 1 = plain text, 2 = compressed text */
Word reserved1;
DWord doc_size; /* uncompressed size in bytes */
Word num_recs; /* not counting itself */
Word rec_size; /* in bytes: usually 4096 (4K) */
DWord reserved2;

The Doc file format is the standard text document format
used by all models of the 3Com PalmPilot and the IBM Work-
pad. A Doc file is a pdb(4) file: this manual page
describes only those aspects specific to Doc files.

A Doc file consists of 0 to num_recs records; record 0 is
the header for the document. (This header is distinct from
the pdb(4) header.) The remaining records contain text,
either plain or compressed depending upon version.

Word Sizes
In the synopsis above, the types ``Word'' and ``DWord'' are
used just as in the Pilot headers. The type ``Word'' is 16
bits; the type ``DWord'' is 32 bits. Both are in big-endian

Compression Format
A character ``c'' in a compressed record is in one of four

01-08 Copy ``c'' bytes

00,09-7F Self

80-BF Sequence

C0-FF A space plus the ASCII character ``c ^ 0x80''

txt2pdbdoc(1), pdb(4)

Paul J. Lucas <>

Nicholas J. Penree
Nicholas J. Penree
Posts: 138
Joined: Sun May 26, 2002 8:14 pm
Location: USA

Return to OrbForms Designer and PocketC Architect

Who is online

Users browsing this forum: No registered users and 1 guest