DOC(4)

πŸ“¦ version 1.4.4, in debian bookworm, ubuntu jammy, ubuntu noble

πŸ’– DOC(4) πŸ’–

okay bestie, so this is the DOC page from the Kernel Interfaces Manual β€” it's all about the Pilot standard text document file format, and ngl it's kinda iconic once you get it. grab a strawberry πŸ“ and let's go.


✨ NAME ✨

DOC β€” the (Pilot standard text document) file format. that's it, that's the whole vibe πŸ’…


🌸 SYNOPSIS 🌸

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;
};

like… the whole format is right there in one little struct. main character energy, fr fr πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

so the Doc file format is the standard text document format that literally every single model of the Palm Pilot uses. no exceptions, no cap. ✨

a Doc file is a pdb(4) file β€” and this manual page is only gonna talk about the parts that are specific to Doc files. everything else? that's a pdb(4) situation, go read that page for the deets. 🫢

a Doc file is made up of 0 to num_recs records. record 0 is the header for the document. and before you @ me β€” yes, this header is different from the pdb(4) header. two separate headers, two separate moments, iykyk. πŸ™ˆ

the rest of the records contain the actual text, and it's either plain or compressed depending on version. that's the plot twist. 😌

πŸŽ€ Word Sizes πŸŽ€

in the synopsis up there, the types Word and DWord are used exactly the way they're used in the Pilot headers. so:

  • Word is 16 bits ✨
  • DWord is 32 bits ✨

and both of them are in big-endian format. big-endian girlies rise 🌈

🧚 Compression Format 🧚

a character c inside a compressed record falls into one of four classes, and this is the part where it gets lowkey spicy:

  • 01-08 β€” copy c bytes πŸ“‹
  • 00, 09-7F β€” Self
  • 80-BF β€” Sequence
  • C0-FF β€” a space plus the ASCII character c ^ 0x80 πŸ’«

🌟 SEE ALSO 🌟

also!! if you wanna go straight to the source, it's giving:

Christopher Bey and Kathleen Dupre. Palm File Format Specification, Document Number 3008-003, Palm, Inc., May 16, 2000.

πŸ’œ AUTHOR πŸ’œ

Paul J. Lucas <pauljlucas@mac.com> β€” we stan 🫢


okay that's the whole page, bestie!! this one came from the txt2pdbdoc crew and it's dated January 21, 2005, which is honestly so retro of it. slay, periodt, go read your pdb(4) page too πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from