diff options
author | Jurijs Klopovskis <jurijs.klopovskis@zabbix.com> | 2018-05-03 13:02:30 +0300 |
---|---|---|
committer | Jurijs Klopovskis <jurijs.klopovskis@zabbix.com> | 2018-05-03 13:02:30 +0300 |
commit | c26a1447d20d09041cb06a8bfa0b10fc627fccdf (patch) | |
tree | 9bcaf180de5ce11040f1279e2754baa7798cb0aa /include/zbxregexp.h | |
parent | 753431bf908456212334d66321b63ff169bf6523 (diff) |
...G....S. [ZBX-13730] imported changes from ZBX-13730
Diffstat (limited to 'include/zbxregexp.h')
-rw-r--r-- | include/zbxregexp.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/include/zbxregexp.h b/include/zbxregexp.h index 651c714a5fd..d7a413382ff 100644 --- a/include/zbxregexp.h +++ b/include/zbxregexp.h @@ -34,12 +34,20 @@ typedef struct } zbx_expression_t; +/* maps to ovector of pcre_exec() */ +typedef struct +{ + int rm_so; + int rm_eo; +} +zbx_regmatch_t; + /* regular expressions */ -int zbx_regexp_compile(const char *regex_txt, int flags, regex_t *regex_compiled, char **error); -int zbx_regexp_exec(const char *string, const regex_t *regex_compiled, int flags, size_t count, - regmatch_t *matches); -void zbx_regexp_free(regex_t *regex_compiled); -int zbx_regexp_match_precompiled(const char *string, const regex_t *regex); +pcre *zbx_regexp_compile(const char *pattern, int flags, const char **error); +int zbx_regexp_exec(const char *string, const pcre *regex_compiled, int flags, size_t count, + zbx_regmatch_t *matches); +void zbx_regexp_free(pcre *regexp); +int zbx_regexp_match_precompiled(const char *string, const pcre *regexp); char *zbx_regexp_match(const char *string, const char *pattern, int *len); char *zbx_iregexp_match(const char *string, const char *pattern, int *len); int zbx_regexp_sub(const char *string, const char *pattern, const char *output_template, char **out); |