How fragglet/lhasa works
Main Components
The system should be divided into these key components:
a) Library Core (lib/)
• File Header Processing
• Decompression Algorithms
• Stream Handling
• Platform-specific Code
b) Command Line Interface (src/)
• User Input Processing
• Archive Operations
• Output Formatting
c) Testing Framework (test/)
• Test Suite
• Archive Samples
• Validation Tools
Component Relationships
[Command Line Interface]
• ↓
• [Library Core]
• ↓
[Platform Abstraction Layer]
• ↓
[Operating System / File System]
Detailed Component Breakdown
a) Library Core Components:
[File Header Parser] → [Decompression Engine]
• ↓ ↓
[Stream Handler] ←→ [Archive Reader]
• ↓
[Platform-specific I/O]
• Blue: Public API components
• Green: Core processing components
• Yellow: Platform-specific components
• Gray: Support/utility components
Key Interfaces to Highlight
Public API (lib/public/):
• lha_decoder.h
• lha_file_header.h
• lha_input_stream.h
• lha_reader.h
• lhasa.h
Data Flow
[Input Archive] → [Header Parser] → [Decompression] → [Output Files]
• ↓
• [Metadata/CRC]
Implementation Details
• Multiple compression algorithm support (LH0-LH7, etc.)
• Cross-platform compatibility layer
• Error handling paths
• CRC verification flow
→ Data flow
↔ Bidirectional interaction
□ Core component
○ Support component
◇ External interface
Testing infrastructure integration
Remember to include version information and supported archive format types (LHA, LArc, PMarc) in supplementary documentation.
This design reflects the project's focus on archive reading/decompression functionality while leaving room for future compression support.