#ifndef _BITSTREAM_H_ #define _BITSTREAM_H_ #include #include #include #include typedef struct bit_stream { uint8_t *buffer; size_t buffer_size; off_t offset; } BitStream; BitStream bitstream_load_from_file(FILE *fp); BitStream bitstream_init_empty(size_t size_in_bytes); uint8_t bitstream_get(BitStream bs, off_t offset); uint8_t bitstream_next(BitStream *bs); bool bitstream_end(BitStream bs); void bitstream_set(BitStream bs, off_t offset, uint8_t value); void bitstream_unload(BitStream *bs); #endif