aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/regexp.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-03-07 22:43:23 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-03-07 22:43:23 +0000
commit52285ba801090d1fad15060d6b1a61460dcbdc36 (patch)
tree47c4eda53e903dbfc0ca85376b16b97efc8a2e54 /src/libutil/regexp.h
parent289809e28780b529a2dc4a3c6057f82409196a10 (diff)
downloadrspamd-52285ba801090d1fad15060d6b1a61460dcbdc36.tar.gz
rspamd-52285ba801090d1fad15060d6b1a61460dcbdc36.zip
Allow storage of auxiliary userdata inside regexp structure.
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