summaryrefslogtreecommitdiff
path: root/inc/huffman.h
blob: 1ac7ff6e6207905c1d188ca81a55978e42a09f24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#ifndef HUFFMAN_H
#define HUFFMAN_H

/* Initialize huffman */
/* Uses the standard frequency table if NULL is provided */
void inithuff(const unsigned int *frequencies);

/* Compress contents of input buffer, result in output buffer */
/* Returns -1 on too small output buffer */
int compresshuff(const char *inputbuff, int inputsize, char *outputbuff, int outputsize);

/* Decompress contents of input buffer, result in output buffer */
/* Returns -1 on decompress error */
int decompresshuff(const char *inputbuff, int inputsize, char *outputbuff, int outputsize);

#endif // HUFFMAN_H