mirror of
https://github.com/Hizenberg469/Compression-Algorithm.git
synced 2026-04-19 18:02:24 +03:00
Huffman Compression
This commit is contained in:
29
include/bitio.h
Normal file
29
include/bitio.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef _BITIO_H
|
||||
#define _BITIO_H
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
typedef struct bit_file {
|
||||
|
||||
FILE* file;
|
||||
unsigned char mask;
|
||||
int rack;
|
||||
int pacifier_counter;
|
||||
|
||||
} BIT_FILE;
|
||||
|
||||
|
||||
BIT_FILE* OpenInputBitFile(char* name);
|
||||
BIT_FILE* OpenOutputBitFile(char* name);
|
||||
void OutputBit(BIT_FILE* bit_file, int bit);
|
||||
void OutputBits(BIT_FILE* bit_file, unsigned long code, int count);
|
||||
|
||||
int InputBit(BIT_FILE* bit_file);
|
||||
unsigned long InputBits(BIT_FILE* bit_file, int bit_count);
|
||||
|
||||
|
||||
void CloseInputBitFile(BIT_FILE* bit_file);
|
||||
void CloseOutputBitFile(BIT_FILE* bit_file);
|
||||
void FilePrintBinary(FILE* file, unsigned int code, int bits);
|
||||
|
||||
#endif /* _BITIO_H */
|
||||
6
include/errhand.h
Normal file
6
include/errhand.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef _ERRHAND_H
|
||||
#define _ERRHAND_H
|
||||
|
||||
void fatal_error(char* fmt, ...);
|
||||
|
||||
#endif /* _ERRHAND_H */
|
||||
11
include/main.h
Normal file
11
include/main.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#ifndef _MAIN_H
|
||||
#define _MAIN_H
|
||||
|
||||
void CompressFile(FILE* input, BIT_FILE* output, int argc, char* argv[]);
|
||||
void ExpandFile(BIT_FILE* input, FILE* output, int argc, char* argv[]);
|
||||
|
||||
extern char* Usage;
|
||||
extern char* CompressionName;
|
||||
|
||||
|
||||
#endif /* _MAIN_H */
|
||||
Reference in New Issue
Block a user