1 #ifndef C_WRAP_H_
2 #define C_WRAP_H_
3 
4 #ifdef __cplusplus
5 extern "C"
6 {
7 #endif
8 
9 typedef struct ignore_flags
10 {
11     char    skip_parse;
12     char    skip_macro;
13 } ignore_flags_t;
14 
15 struct parser_callbacks
16 {
17     int (*getline)(char *buf, int len, ignore_flags_t *ignore, void *opaque);
18     void *gl_opaque;
19 
20     const char* (*get_pos)(int *line, void *opaque);
21     void *gp_opaque;
22 
23     int  (*get_eof)(void *opaque);
24     void *ge_opaque;
25 
26     int  (*reexam )(char *buf, int len, ignore_flags_t *ignore, void *opaque);
27     void *rx_opaque;
28 
29     void (*report_error)(const char *buf, void *opaque);
30     void *re_opaque;
31 };
32 
33 int  init_parser (struct parser_callbacks *pc);
34 void close_parser(void);
35 char *get_parsed_line(char **buf, int *maxlen, ignore_flags_t *ignore);
36 
37 #ifdef __cplusplus
38 }
39 #endif
40 
41 #endif
42