aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/libutil/regexp.c22
-rw-r--r--src/libutil/regexp.h11
2 files changed, 33 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;
+}
diff --git a/src/libutil/regexp.h b/src/libutil/regexp.h
index cf012668a..a67bef990 100644
--- a/src/libutil/regexp.h
+++ b/src/libutil/regexp.h
@@ -133,6 +133,17 @@ guint64 rspamd_regexp_get_cache_id (rspamd_regexp_t *re);
guint64 rspamd_regexp_set_cache_id (rspamd_regexp_t *re, guint64 id);
/**
+ * Get regexp class for the re object
+ */
+gpointer rspamd_regexp_get_class (rspamd_regexp_t *re);
+
+/**
+ * Set regexp class for the re object
+ * @return old re class value
+ */
+gpointer rspamd_regexp_set_class (rspamd_regexp_t *re, gpointer re_class);
+
+/**
* Create new regexp cache
* @return
*/