7 // A function to read bytes from some input source. The bytes should be
8 // already unstuffed (and thus without markers).
9 // A return value of -1 indicates error, a return value of 0 indicates EOF.
10 typedef ssize_t (input_func_t)(void*, uint8_t*, size_t);
12 // Same as input_func_t, although it expects raw bytes, ie. with markers
14 typedef ssize_t (raw_input_func_t)(void*, uint8_t*, size_t);
16 void reliable_read(raw_input_func_t* input_func, void* userdata, uint8_t* buf, size_t len);
18 uint8_t read_uint8(raw_input_func_t* input_func, void* userdata);
19 uint16_t read_uint16(raw_input_func_t* input_func, void* userdata);
21 #endif /* !defined(_INPUT_H) */