2 #define _BYTESOURCE_H 1
7 static const unsigned BYTESOURCE_CHUNK_SIZE = 4096;
9 // Same as input_func_t, although it expects raw bytes, ie. with markers
11 typedef ssize_t (raw_input_func_t)(void*, uint8_t*, size_t);
13 // A data source taking in a byte stream and returning unstuffed bytes until
14 // there's a marker. When there's a marker, it artificially returns EOF until
15 // byte_source_read_marker() is called.
18 unsigned bytes_available;
20 raw_input_func_t* input_func;
23 void init_byte_source(struct byte_source* source, raw_input_func_t* input_func, void* userdata);
24 uint8_t byte_source_read_marker(struct byte_source* source);
25 ssize_t byte_source_input_func(void* source, uint8_t* buf, size_t len);
27 #endif /* !defined(_BYTESOURCE_H) */