00001 // huffman.h 00005 00006 #ifndef HUFFMAN_H 00007 #define HUFFMAN_H 00008 #include "substdio.h" 00009 00010 typedef struct hufftable 00011 { 00012 unsigned short rep[256]; 00013 unsigned char replen[256]; 00014 } hufftable; 00015 00016 typedef struct huffdecompresstable_entry 00017 { 00018 unsigned short binrep; // Occupies the TOP of the word (pad bits at the bottom) 00019 unsigned char binreplen; 00020 unsigned char byterep; 00021 } huffdecompresstable_entry; 00022 00023 typedef struct huffdecompresstable 00024 { 00025 huffdecompresstable_entry entries[256]; // sorted 00026 } huffdecompresstable; 00027 00028 00029 void fhuffmaninit_write(void); 00030 void fhuffmanflush(FILE *f); 00031 void fhuffmaninit_read(void); 00032 void fhuffmanputc(unsigned char c, FILE *f); 00033 char fhuffmangetc(FILE *f); 00034 00035 #endif //HUFFMAN_H 00036
1.3.6