2012-09-06 14:12:54 +00:00
|
|
|
#include <stdbool.h>
|
2012-08-09 19:09:29 +00:00
|
|
|
|
|
|
|
struct huffman_node {
|
|
|
|
int weight;
|
|
|
|
void *value;
|
|
|
|
struct huffman_node *left;
|
|
|
|
struct huffman_node *right;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct huffman_node *huffman_build_tree(void **values, int count);
|
|
|
|
|
|
|
|
void *huffman_lookup (struct huffman_node *tree, unsigned char *bits,
|
2012-09-06 14:12:54 +00:00
|
|
|
int *bits_read, bool print);
|
2012-09-06 14:51:37 +00:00
|
|
|
|
|
|
|
void huffman_reverse_lookup (struct huffman_node *tree, void *value);
|