aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-07-14 18:48:42 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-07-14 18:48:42 +0100
commita21fb8ed5b1642031c2b612cac45d176e9fc00f8 (patch)
tree357b4cd6043da7bb12a0641c5f327118af1ac847 /src/libutil
parent02b6117a397bb5cba27ca63a7e2df1c5dbfd0125 (diff)
downloadrspamd-a21fb8ed5b1642031c2b612cac45d176e9fc00f8.tar.gz
rspamd-a21fb8ed5b1642031c2b612cac45d176e9fc00f8.zip
Start removing of old fuzzy algorithm.
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/fstring.c13
-rw-r--r--src/libutil/fstring.h3
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