ybubnov / libhuffman

The Huffman library is a simple, pure C99 library for encoding and decoding data using a frequency-sorted binary tree.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

C example

Mitchbux opened this issue · comments

Hello

What would be the decode program for

huf_read_writer_t *file_in;
huf_fdopen(&file_in, 0) // Read from standard input.

void *buf = NULL;
huf_read_writer_t *mem_out;
huf_memopen(&mem_out, &buf, HUF_1MIB_BUFFER);

huf_config_t config = {
.reader = file_in,
.writer = mem_out,
.length = length,
.blocksize = HUF_64KIB_BUFFER,
.reader_buffer_size = HUF_128KIB_BUFFER,
.writer_buffer_size = HUF_128KIB_BUFFER,
};

??

I'm having problem finding the encoded data.

@Mitchbux, I apologize for not replying fast. I recommend seeing the example in the C-test encode_test.c