How greyvoidbloom/rle-compression works
Main Components
a. Input Layer:
• CLI Interface (represented by cli_handling.c/h)
• Command argument parsing
• Option handling (-c, -d, --h, --version)
b. Processing Layer:
• Compression Module (rle_compress.c/h)
• Decompression Module (rle_decompress.c/h)
c. Main Controller:
• Program flow coordination (main.c)
┌─────────────────┐
• User Input │
• ┬────────┘
• ↓
┌─────────────────┐
• CLI Handler │
• ┬────────┘
• ↓
┌─────────────────┐
• Main │
• Controller │
• ┬────────┘
• ↓
• ┌────┴────┐
• ↓ ↓
┌─────────┐ ┌─────────┐
• Compress │ │Decompress│
• Module │ │ Module │
• ┘ └─────────┘
Component Details
a. CLI Handler:
• Option parsing (-c, -d, --h, --version)
• Input validation
• Help message display
b. Main Controller:
• Program flow control
• Module selection based on options
• Error handling
c. Compression Module:
• RLE compression algorithm
• Input string processing
• Output format: character + count
d. Decompression Module:
• RLE decompression algorithm
• Input format parsing
• Output string generation