2 #define _BYTESOURCE_H 1
9 static const unsigned BYTESOURCE_CHUNK_SIZE = 4096;
11 // A data source taking in a byte stream and returning unstuffed bytes until
12 // there's a marker. When there's a marker, it artificially returns EOF until
13 // byte_source_read_marker() is called.
16 unsigned bytes_available;
18 raw_input_func_t* input_func;
21 void init_byte_source(struct byte_source* source, raw_input_func_t* input_func, void* userdata);
23 // Returns 0x00 if no marker was available (ie. error).
24 uint8_t byte_source_read_marker(struct byte_source* source);
26 ssize_t byte_source_input_func(void* source, uint8_t* buf, size_t len);
28 #endif /* !defined(_BYTESOURCE_H) */