137d42ef9fac1ea47e6131a9765adc99cb1ed797
[cparser] / input.h
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
11 /** Type for a function being called on an input (or encoding) errors. */
12 typedef void (*input_error_callback_func)(unsigned delta_lines,
13                                           unsigned delta_cols,
14                                           const char *message);
15
16 void set_input_error_callback(input_error_callback_func func);
17
18 size_t decode(input_t *input, utf32 *buffer, size_t buffer_size);
19
20 void input_free(input_t *input);
21
22 #endif