aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/regexp.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-09 14:17:22 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-12-09 14:17:22 +0000
commit1fbe3f605d921e71839d41987c3328615d6f9cf3 (patch)
treed618ebeaa277d0cd4146072e2ad7ab9eef993099 /src/libutil/regexp.c
parent9283454d84781adfafc40e92a125a883d671c69d (diff)
downloadrspamd-1fbe3f605d921e71839d41987c3328615d6f9cf3.tar.gz
rspamd-1fbe3f605d921e71839d41987c3328615d6f9cf3.zip
Add methods to get re flags
Diffstat (limited to 'src/libutil/regexp.c')
-rw-r--r--src/libutil/regexp.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/libutil/regexp.c b/src/libutil/regexp.c
index 2fe614e90..9db031109 100644
--- a/src/libutil/regexp.c
+++ b/src/libutil/regexp.c
@@ -54,6 +54,7 @@ struct rspamd_regexp_s {
gpointer re_class;
guint64 cache_id;
gint flags;
+ gint pcre_flags;
gint ncaptures;
gint nbackref;
};
@@ -248,6 +249,7 @@ fin:
res->flags = rspamd_flags;
res->pattern = real_pattern;
res->cache_id = RSPAMD_INVALID_ID;
+ res->pcre_flags = regexp_flags;
if (rspamd_flags & RSPAMD_REGEXP_FLAG_RAW) {
res->raw_re = r;
@@ -489,6 +491,22 @@ rspamd_regexp_get_pattern (rspamd_regexp_t *re)
return re->pattern;
}
+guint
+rspamd_regexp_get_flags (rspamd_regexp_t *re)
+{
+ g_assert (re != NULL);
+
+ return re->flags;
+}
+
+guint
+rspamd_regexp_get_pcre_flags (rspamd_regexp_t *re)
+{
+ g_assert (re != NULL);
+
+ return re->pcre_flags;
+}
+
gint
rspamd_regexp_get_nbackrefs (rspamd_regexp_t *re)
{