From 79e437a712efba0d901c9b9d7c8c82e4d1283260 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 13 Apr 2016 13:46:33 +0100 Subject: [Feature] Add utility methods for multipattern --- src/libutil/multipattern.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/libutil/multipattern.h') diff --git a/src/libutil/multipattern.h b/src/libutil/multipattern.h index 45ade2743..c27977159 100644 --- a/src/libutil/multipattern.h +++ b/src/libutil/multipattern.h @@ -112,6 +112,21 @@ gboolean rspamd_multipattern_compile (struct rspamd_multipattern *mp, gint rspamd_multipattern_lookup (struct rspamd_multipattern *mp, const gchar *in, gsize len, rspamd_multipattern_cb_t cb, gpointer ud, guint *pnfound); +/** + * Get pattern string from multipattern identified by index + * @param mp + * @param index + * @return + */ +const gchar* rspamd_multipattern_get_pattern (struct rspamd_multipattern *mp, + guint index); + +/** + * Returns number of patterns in a multipattern matcher + * @param mp + * @return + */ +guint rspamd_multipattern_get_npatterns (struct rspamd_multipattern *mp); /** * Destroys multipattern structure -- cgit v1.2.3