aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/regexp.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/regexp.h')
-rw-r--r--src/libutil/regexp.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/libutil/regexp.h b/src/libutil/regexp.h
index 41835af84..3c08de71a 100644
--- a/src/libutil/regexp.h
+++ b/src/libutil/regexp.h
@@ -76,6 +76,20 @@ rspamd_regexp_t* rspamd_regexp_ref (rspamd_regexp_t *re);
void rspamd_regexp_unref (rspamd_regexp_t *re);
/**
+ * Set auxiliary userdata for the specified regexp
+ * @param re regexp object
+ * @param ud opaque pointer
+ */
+void rspamd_regexp_set_ud (rspamd_regexp_t *re, gpointer ud);
+
+/**
+ * Get userdata for a regexp object
+ * @param re regexp object
+ * @return opaque pointer
+ */
+gpointer rspamd_regexp_get_ud (rspamd_regexp_t *re);
+
+/**
* Get pattern for the specified regexp object
* @param re
* @return
@@ -100,6 +114,17 @@ rspamd_regexp_t* rspamd_regexp_cache_query (struct rspamd_regexp_cache* cache,
const gchar *flags);
/**
+ * Insert item to the cache using custom pattern and flags
+ * @param cache
+ * @param pattern
+ * @param flags
+ * @param re
+ */
+void rspamd_regexp_cache_insert (struct rspamd_regexp_cache* cache,
+ const gchar *pattern,
+ const gchar *flags, rspamd_regexp_t *re);
+
+/**
* Create or get cached regexp from the specified cache
* @param cache regexp cache. if NULL, the superglobal cache is used (*not* thread-safe)
* @param pattern regexp pattern