Skip to main content

Crate arc_mac

Crate arc_mac 

Source
Expand description

Native readers for classic Macintosh archive formats.

These archives are trees of Mac files, each preserving a data fork, a resource fork, and Finder info (type/creator/flags). The reader exposes entries that map cleanly onto the rest of rusty-backup’s fork-aware tooling (BinHex export, MacBinary, HFS import).

  • stuffit — classic StuffIt (.sit, SIT! magic) and StuffIt self-extracting archives (.sea).
  • compactpro — Compact Pro (.cpt, and .sea self-extracting), commonly distributed BinHex-wrapped.
  • mar — Hampa Hug’s mar archive (.mar): a single Mac file or folder tree, read + written (stored).

See docs/native_mac_archives.md in rusty-backup for the format references and roadmap.

Licensing is per file (each starts with an SPDX line): the StuffIt / Compact Pro decompressors and parsers ported from XADMaster are LGPL-2.1-or-later, everything else is MIT. See THIRD_PARTY_NOTICES.md.

Modules§

bitreader_be
Big-endian (MSB-first) bit reader shared by the StuffIt Huffman (method 3) and LZAH (method 5) codecs. Matches XADMaster’s CSInputNextBit / CSInputNextBitString (the non-LE variants).
compactpro
Compact Pro (.cpt) archive reader — Bill Goodman’s Compactor / Compact Pro format, common for vintage Mac software and frequently distributed as a BinHex-wrapped self-extracting archive (.sea.hqx).
detect
Magic-sniff classifier for Mac archive bytes. Returns a single MacArchiveKind regardless of filename extension, so the GUI workflows in OPEN-WORK §6.1 can trigger off the actual file content rather than a possibly-misleading name.
extract
Shared archive open + extraction logic used by both the CLI (sit verb) and the GUI archive-browse tab.
macbinary
MacBinary I / II / III — the canonical full-fidelity parser for the family.
maczip
MacZip — Info-ZIP’s Macintosh port (D. Haase), the “new” Mac3 format.
mar
MAR archive reader + writer (classic Mac, Hampa Hug’s mar tool).
stuffit
Classic StuffIt (.sit) + StuffIt self-extracting (.sea) reader.
stuffit5
StuffIt 5 (.sit v5, magic “StuffIt (c)1997…”) container reader.
stuffit13_tables
Static Huffman length tables for StuffIt method 13 (selectors 1-5). Auto-generated from XADMaster XADStuffIt13Handle.m; do not edit by hand.
stuffit_arsenic
StuffIt compression method 15 (“Arsenic”): an arithmetic-coded BWT + MTF + RLE scheme (conceptually similar to bzip2). Used by StuffIt’s “maximum” setting and by most StuffIt 5 archives.
stuffit_huffman
StuffIt compression method 3 (“Huffman”): a plain byte-wise Huffman code whose tree is serialized at the head of the stream. Ported from XADMaster XADStuffItHuffmanHandle.m. Big-endian (MSB-first) bitstream.
stuffit_lzah
StuffIt compression method 5 (“LZAH”): an LHArc-style LZSS over a 4 KiB preset window, with an adaptive (FGK) Huffman code for literals/lengths and a static prefix code for the high bits of the match offset. Ported from XADMaster XADLZHDynamicHandle.m (+ XADLZSSHandle.m). Big-endian bitstream.
stuffit_lzh
StuffIt compression method 13 (“LZ+Huffman”): an LZSS scheme with per-block Huffman-coded literals/lengths/offsets. This is the dominant codec in classic .sit archives.
stuffit_lzw
StuffIt compression method 2 (“Compress”): the classic Unix compress(1) LZW with block mode (code 256 = table clear). StuffIt invokes it with flags 0x8e → block mode, 14-bit maximum code width.