diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-03-19 18:57:43 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-03-19 18:57:43 +0000 |
commit | 759edd03e2d11c2f44ccc91b0160e05d22e4f29b (patch) | |
tree | a56b129a4c5e592fff05394a587795f2ffbec989 /src/libserver/task.h | |
parent | 033d4b2d749fca44e4b067f9a5486a289b61a95e (diff) | |
download | rspamd-759edd03e2d11c2f44ccc91b0160e05d22e4f29b.tar.gz rspamd-759edd03e2d11c2f44ccc91b0160e05d22e4f29b.zip |
Add re cache logic to task routines.
Diffstat (limited to 'src/libserver/task.h')
-rw-r--r-- | src/libserver/task.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/libserver/task.h b/src/libserver/task.h index 799182f01..f4f22823f 100644 --- a/src/libserver/task.h +++ b/src/libserver/task.h @@ -218,5 +218,24 @@ gboolean rspamd_task_add_recipient (struct rspamd_task *task, const gchar *rcpt) */ gboolean rspamd_task_add_sender (struct rspamd_task *task, const gchar *sender); +#define RSPAMD_TASK_CACHE_NO_VALUE ((guint)-1) + +/** + * Add or replace the value to the task cache of regular expressions results + * @param task task object + * @param re text value of regexp + * @param value value to add + * @return previous value of element or RSPAMD_TASK_CACHE_NO_VALUE + */ +guint rspamd_task_re_cache_add (struct rspamd_task *task, gchar *re, + guint value); + +/** + * Check for cached result of re inside cache + * @param task task object + * @param re text value of regexp + * @return the current value of element or RSPAMD_TASK_CACHE_NO_VALUE + */ +guint rspamd_task_re_cache_check (struct rspamd_task *task, const gchar *re); #endif /* TASK_H_ */ |