diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-12-06 13:55:43 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-12-06 13:55:43 +0000 |
commit | 958cbf047b81c507d3d73deddaf1ee48a36e6415 (patch) | |
tree | ef8c1749a247ffa1262d454bd78f4a00364ed5e8 /src/libutil/regexp.c | |
parent | 13016e9b0e3eebb9145d7cf08f9d517e6e5b8688 (diff) | |
download | rspamd-958cbf047b81c507d3d73deddaf1ee48a36e6415.tar.gz rspamd-958cbf047b81c507d3d73deddaf1ee48a36e6415.zip |
Add method to set re class for any rspamd regexp
Diffstat (limited to 'src/libutil/regexp.c')
-rw-r--r-- | src/libutil/regexp.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/libutil/regexp.c b/src/libutil/regexp.c index 00c60a337..530574100 100644 --- a/src/libutil/regexp.c +++ b/src/libutil/regexp.c @@ -51,6 +51,7 @@ struct rspamd_regexp_s { regexp_id_t id; ref_entry_t ref; gpointer ud; + gpointer re_class; guint64 cache_id; gint flags; gint ncaptures; @@ -747,3 +748,24 @@ rspamd_regexp_get_id (rspamd_regexp_t *re) return re->id; } + +gpointer +rspamd_regexp_get_class (rspamd_regexp_t *re) +{ + g_assert (re != NULL); + + return re->re_class; +} + +gpointer +rspamd_regexp_set_class (rspamd_regexp_t *re, gpointer re_class) +{ + gpointer old_class; + + g_assert (re != NULL); + + old_class = re->re_class; + re->re_class = re_class; + + return old_class; +} |