X-Git-Url: https://git.sesse.net/?p=fjl;a=blobdiff_plain;f=bitsource.h;h=6cabbf004245139d6f3f5a8f5f5fac5cfdb646e6;hp=e5bdd282ae104de0c9017f651efa6a7d60dd3751;hb=352c52d38c212a2aa93a9970731c9d7a2f8d4dac;hpb=b8abdf976177386c5fe85712280a669ba80a41d2 diff --git a/bitsource.h b/bitsource.h index e5bdd28..6cabbf0 100644 --- a/bitsource.h +++ b/bitsource.h @@ -7,6 +7,8 @@ #include #include +#include "input.h" + // Optimize for 64 bits. We might want to replace this for 32-bit machines // (benchmark later). typedef uint64_t bitreservoir_t; @@ -21,11 +23,6 @@ static const unsigned BITRESERVOIR_SIZE = 8 * sizeof(bitreservoir_t); static const unsigned BITRESERVOIR_FILL_SIZE = 8 * sizeof(bitreservoir_fill_t); static const unsigned BYTERESERVOIR_SIZE = 4096; -// A function to read bytes from some input source. The bytes should be -// already unstuffed (and thus without markers). -// A return value of -1 indicates error, a return value of 0 indicates EOF. -typedef ssize_t (input_func_t)(void*, uint8_t*, size_t); - // A data source for efficient reading of bit-level data. struct bit_source { // Short-term bit reservoir; holds up to 64 bits. When it's empty,