How macdee661/huffman works
This is a small C command-line Huffman compressor and decompressor. The user selects a file operation at the CLI; compression counts byte frequencies, builds a Huffman tree and codes, writes a frequency-table header, then encodes bits. Decompression reads that header, rebuilds the tree, and decodes the declared number of bytes. The graph shows the priority queue and bit-I/O helpers as internal layers. Relationships are based on the README and sampled source; unsampled test and measurement code is excluded.
Main entry points: huffman.c Compression · main.c CLI dispatch · bitio.c Bit I/O · priority_queue.c Priority queue
Components 12
Command line
- CLI dispatch
src/main.c
Huffman codec
- Compression
src/huffman.c - Decompression
src/huffman.c - Frequency scan
src/huffman.c - Tree and codes
src/huffman.c - Priority queue
src/priority_queue.c - Archive header
src/huffman.c - Bit encoding
src/huffman.c - Bit decoding
src/huffman.c
I/O helpers
- Bit I/O
src/bitio.c
Other components
- User
- Input/output files
Connections 15
- User → CLI dispatch: selects operation
src/main.c - CLI dispatch → Compression: dispatches compress
src/main.c - CLI dispatch → Decompression: dispatches decompress
src/main.c - Compression → Input/output files: reads input, writes archive
src/huffman.c - Compression → Frequency scan: counts bytes
src/huffman.c - Compression → Tree and codes: builds tree, codes
src/huffman.c - Tree and codes → Priority queue: queues nodes
src/huffman.c - Compression → Archive header: writes header
src/huffman.c - Compression → Bit encoding: encodes input
src/huffman.c - Bit encoding → Bit I/O: writes bits
src/huffman.c - Decompression → Input/output files: reads archive, writes output
src/huffman.c - Decompression → Archive header: reads header
src/huffman.c - Decompression → Tree and codes: rebuilds tree
src/huffman.c - Decompression → Bit decoding: decodes bytes
src/huffman.c - Bit decoding → Bit I/O: reads bits
src/huffman.c