diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-14 18:48:42 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-07-14 18:48:42 +0100 |
commit | a21fb8ed5b1642031c2b612cac45d176e9fc00f8 (patch) | |
tree | 357b4cd6043da7bb12a0641c5f327118af1ac847 /src/libutil | |
parent | 02b6117a397bb5cba27ca63a7e2df1c5dbfd0125 (diff) | |
download | rspamd-a21fb8ed5b1642031c2b612cac45d176e9fc00f8.tar.gz rspamd-a21fb8ed5b1642031c2b612cac45d176e9fc00f8.zip |
Start removing of old fuzzy algorithm.
Diffstat (limited to 'src/libutil')
-rw-r--r-- | src/libutil/fstring.c | 13 | ||||
-rw-r--r-- | src/libutil/fstring.h | 3 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/libutil/fstring.c b/src/libutil/fstring.c index 96c57131a..991cd3000 100644 --- a/src/libutil/fstring.c +++ b/src/libutil/fstring.c @@ -466,3 +466,16 @@ rspamd_fstrstrip (rspamd_fstring_t * str) str->len = r; } + +gboolean +rspamd_fstring_equal (const rspamd_fstring_t *s1, + const rspamd_fstring_t *s2) +{ + g_assert (s1 != NULL && s2 != NULL); + + if (s1->len == s2->len) { + return (memcmp (s1->begin, s2->begin, s1->len) == 0); + } + + return FALSE; +} diff --git a/src/libutil/fstring.h b/src/libutil/fstring.h index 3dbc2233b..27482877c 100644 --- a/src/libutil/fstring.h +++ b/src/libutil/fstring.h @@ -118,4 +118,7 @@ gchar * rspamd_fstr_c_str (rspamd_fstring_t *str, rspamd_mempool_t *pool); */ void rspamd_fstrstrip (rspamd_fstring_t *str); +gboolean rspamd_fstring_equal (const rspamd_fstring_t *s1, + const rspamd_fstring_t *s2); + #endif |