#ifndef DECOMPRESS_H  
#define DECOMPRESS_H  

#include <stddef.h>  
#include <stdint.h>  

// 基础数据结构定义  
typedef struct BitReader {  
    const unsigned char* data;  
    size_t total_bits;  
    size_t current_bit;  
} BitReader;  

typedef struct CodeEntry {  
    unsigned char byte;  
    unsigned char code_len;  
    uint32_t code;  
} CodeEntry;  

// 函数声明  
void init_bit_reader(BitReader* reader, const unsigned char* data, size_t size);  
uint32_t read_bits(BitReader* reader, int num_bits);  
CodeEntry* load_code_table(const char* filename, size_t* unique_chars, size_t* orig_size);  
int decompress_file(const char* filename, const char* sender_info, const char* receiver_info);  

#endif // DECOMPRESS_H