1 
2 // parse.h
3 
4 #ifndef PARSE_H
5 #define PARSE_H
6 
7 // includes
8 
9 #include "util.h"
10 
11 // defined
12 
13 #define STAR_NUMBER         16
14 #define KEYWORD_NUMBER     256
15 
16 // types
17 
18 typedef struct {
19    const char * string;
20    int pos;
21    int keyword_nb;
22    const char * keyword[KEYWORD_NUMBER];
23 } parse_t;
24 
25 // variables
26 
27 extern char * Star[STAR_NUMBER];
28 
29 // functions
30 
31 extern bool match             (char string[], const char pattern[]);
32 
33 extern void parse_open        (parse_t * parse, const char string[]);
34 extern void parse_close       (parse_t * parse);
35 
36 extern void parse_add_keyword (parse_t * parse, const char keyword[]);
37 
38 extern bool parse_get_word    (parse_t * parse, char string[], int size);
39 extern bool parse_get_string  (parse_t * parse, char string[], int size);
40 
41 #endif // !defined PARSE_H
42 
43 // end of parse.h
44 
45