| 38 #else |
38 #else |
| 39 #include <regex.h> |
39 #include <regex.h> |
| 40 #endif |
40 #endif |
| 41 |
41 |
| 42 typedef struct { |
42 typedef struct { |
| 43 string_list_t* pattern_list; /* even entries: start ; odd entries: end */ |
43 string_list* pattern_list; /* even entries: start ; odd entries: end */ |
| 44 regex_t* compiled_patterns; |
44 regex_t* compiled_patterns; |
| 45 size_t compiled_pattern_count; |
45 size_t compiled_pattern_count; |
| 46 unsigned int pattern_match; /* save position of end pattern to match - |
46 unsigned int pattern_match; /* save position of end pattern to match - |
| 47 NULL when a start pattern shall match first */ |
47 NULL when a start pattern shall match first */ |
| 48 unsigned int matched_counted; |
48 unsigned int matched_counted; |
| 49 bool count_chars; |
49 bool count_chars; |
| 50 } regex_parser_t; |
50 } regex_parser; |
| 51 |
51 |
| 52 #ifdef _cplusplus |
52 #ifdef _cplusplus |
| 53 extern "C" { |
53 extern "C" { |
| 54 #endif |
54 #endif |
| 55 |
55 |
| 56 regex_parser_t* new_regex_parser_t(); |
56 regex_parser* new_regex_parser(); |
| 57 void destroy_regex_parser_t(regex_parser_t*); |
57 void destroy_regex_parser(regex_parser*); |
| 58 void regex_parser_reset(regex_parser_t* parser); |
58 void regex_parser_reset(regex_parser* parser); |
| 59 |
59 |
| 60 bool regex_parser_matching(regex_parser_t*); |
60 bool regex_parser_matching(regex_parser*); |
| 61 bool regex_compile_all(regex_parser_t*); |
61 bool regex_compile_all(regex_parser*); |
| 62 int regex_parser_do(regex_parser_t*, char*); |
62 int regex_parser_do(regex_parser*, char*); |
| 63 |
63 |
| 64 #ifdef _cplusplus |
64 #ifdef _cplusplus |
| 65 } |
65 } |
| 66 #endif |
66 #endif |
| 67 |
67 |