huffman_compress
Number of bytes in the compressed data if compressing the data is successful, or -1 otherwise.
Uses Huffman coding to compress a buffer of data specified
by original
, which contains
size
bytes. The compressed data is
written to a buffer returned in
compressed
. Since the amount of storage
required in compressed
is unknown to
the caller, huffman_compress dynamically
allocates the necessary storage using malloc.
It is the responsibility of the caller to free this storage using
free when it is no longer needed.