]> arthur.barton.de Git - netdata.git/blob - src/simple_pattern.h
dns_query_time plugin: replace "." with "_" in dimensions
[netdata.git] / src / simple_pattern.h
1 #ifndef NETDATA_SIMPLE_PATTERN_H
2 #define NETDATA_SIMPLE_PATTERN_H
3
4 typedef enum {
5     SIMPLE_PATTERN_EXACT,
6     SIMPLE_PATTERN_PREFIX,
7     SIMPLE_PATTERN_SUFFIX,
8     SIMPLE_PATTERN_SUBSTRING
9 } SIMPLE_PREFIX_MODE;
10
11 typedef void SIMPLE_PATTERN;
12
13 // create a simple_pattern from the string given
14 // default_mode is used in cases where EXACT matches, without an asterisk,
15 // should be considered PREFIX matches.
16 extern SIMPLE_PATTERN *simple_pattern_create(const char *list, SIMPLE_PREFIX_MODE default_mode);
17
18 // test if string str is matched from the pattern
19 extern int simple_pattern_matches(SIMPLE_PATTERN *list, const char *str);
20
21 // free a simple_pattern that was created with simple_pattern_create()
22 // list can be NULL, in which case, this does nothing.
23 extern void simple_pattern_free(SIMPLE_PATTERN *list);
24
25 #endif //NETDATA_SIMPLE_PATTERN_H