1 #ifndef INPUT_H 2 #define INPUT_H 3 4 #include <stdio.h> 5 #include "unicode.h" 6 7 typedef struct input_t input_t; 8 9 input_t *input_from_stream(FILE *stream, const char *encoding); 10 input_t *input_from_string(const char *string, const char *encoding); 11 12 /** Type for a function being called on an input (or encoding) errors. */ 13 typedef void (*input_error_callback_func)(unsigned delta_lines, 14 unsigned delta_cols, 15 const char *message); 16 17 void set_input_error_callback(input_error_callback_func func); 18 19 size_t decode(input_t *input, utf32 *buffer, size_t buffer_size); 20 21 void input_free(input_t *input); 22 23 #endif 24