25 */ |
25 */ |
26 |
26 |
27 #ifndef REGEX_PARSER_H_ |
27 #ifndef REGEX_PARSER_H_ |
28 #define REGEX_PARSER_H_ |
28 #define REGEX_PARSER_H_ |
29 |
29 |
30 #define REGEX_MAX_LINELENGTH 2048 |
30 #define MAX_LINELENGTH 4096u |
31 |
31 |
32 #include <sys/types.h> |
32 #include <sys/types.h> |
33 #include <stdbool.h> |
33 #include <stdbool.h> |
34 #include <regex.h> |
34 #include <regex.h> |
35 #include "string_list.h" |
35 #include "string_list.h" |
38 string_list_t* pattern_list; /* even entries: start ; odd entries: end */ |
38 string_list_t* pattern_list; /* even entries: start ; odd entries: end */ |
39 regex_t** compiled_patterns; |
39 regex_t** compiled_patterns; |
40 size_t compiled_pattern_count; |
40 size_t compiled_pattern_count; |
41 unsigned int pattern_match; /* save position of end pattern to match - |
41 unsigned int pattern_match; /* save position of end pattern to match - |
42 NULL when a start pattern shall match first */ |
42 NULL when a start pattern shall match first */ |
43 unsigned int matched_lines; |
43 unsigned int matched_counted; |
|
44 bool count_chars; |
44 } regex_parser_t; |
45 } regex_parser_t; |
45 |
46 |
46 #ifdef _cplusplus |
47 #ifdef _cplusplus |
47 extern "C" { |
48 extern "C" { |
48 #endif |
49 #endif |