diff options
author | Jurijs Klopovskis <jurijs.klopovskis@zabbix.com> | 2018-05-23 13:19:17 +0300 |
---|---|---|
committer | Jurijs Klopovskis <jurijs.klopovskis@zabbix.com> | 2018-05-23 13:19:17 +0300 |
commit | 09ce8f1b2d388e51ae50cb9bc09dd0bebba5e150 (patch) | |
tree | 6a603f861f79e1126d69a19090f449f4b48c91b6 /include/zbxregexp.h | |
parent | c26a1447d20d09041cb06a8bfa0b10fc627fccdf (diff) |
...G....S. [ZBX-13730] imported changes from ZBX-13730
Diffstat (limited to 'include/zbxregexp.h')
-rw-r--r-- | include/zbxregexp.h | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/include/zbxregexp.h b/include/zbxregexp.h index d7a413382ff..8540630f78e 100644 --- a/include/zbxregexp.h +++ b/include/zbxregexp.h @@ -24,6 +24,8 @@ #define ZBX_REGEXP_NO_MATCH 0 #define ZBX_REGEXP_MATCH 1 +typedef struct zbx_regexp zbx_regexp_t; + typedef struct { char *name; @@ -34,22 +36,11 @@ typedef struct } zbx_expression_t; -/* maps to ovector of pcre_exec() */ -typedef struct -{ - int rm_so; - int rm_eo; -} -zbx_regmatch_t; - /* regular expressions */ -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); +int zbx_regexp_compile(const char *pattern, zbx_regexp_t **regexp, const char **error); +void zbx_regexp_free(zbx_regexp_t *regexp); +int zbx_regexp_match_precompiled(const char *string, const zbx_regexp_t *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); int zbx_mregexp_sub(const char *string, const char *pattern, const char *output_template, char **out); int zbx_iregexp_sub(const char *string, const char *pattern, const char *output_template, char **out); |