aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil/regexp.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-06-30 12:22:08 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-06-30 12:22:08 +0100
commit1b19510e1392caefd92d7d1ecb0542b7c5a8fb29 (patch)
treeb1cbe161f70d2e89ab1f523be007fef02239c21e /src/libutil/regexp.h
parentb45930d5c64030e815f046761541f61924e856b9 (diff)
downloadrspamd-1b19510e1392caefd92d7d1ecb0542b7c5a8fb29.tar.gz
rspamd-1b19510e1392caefd92d7d1ecb0542b7c5a8fb29.zip
Improve regexp captures.
It is now possible to store regexp captures if needed.
Diffstat (limited to 'src/libutil/regexp.h')
-rw-r--r--src/libutil/regexp.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libutil/regexp.h b/src/libutil/regexp.h
index fc236c1b3..1301e5dd9 100644
--- a/src/libutil/regexp.h
+++ b/src/libutil/regexp.h
@@ -29,6 +29,10 @@
typedef struct rspamd_regexp_s rspamd_regexp_t;
struct rspamd_regexp_cache;
+struct rspamd_re_capture {
+ const char *p;
+ gsize len;
+};
/**
* Create new rspamd regexp
@@ -47,11 +51,14 @@ rspamd_regexp_t* rspamd_regexp_new (const gchar *pattern, const gchar *flags,
* @param len
* @param start position of start of match
* @param start position of end of match
+ * @param raw
+ * @param captures array of captured strings of type rspamd_fstring_capture or NULL
* @return
*/
gboolean rspamd_regexp_search (rspamd_regexp_t *re,
const gchar *text, gsize len,
- const gchar **start, const gchar **end, gboolean raw);
+ const gchar **start, const gchar **end, gboolean raw,
+ GArray *captures);
/**