aboutsummaryrefslogtreecommitdiffstats
path: root/src/fstring.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-07-13 19:39:37 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-07-13 19:39:37 +0400
commitb0ddff4f0d56a877305649a14b902b3f23140b4b (patch)
tree65a2066d13b480b062b20036280d18321fb91e94 /src/fstring.c
parent091e84951a2b032bb2930b300ffe43eaf01a304e (diff)
downloadrspamd-b0ddff4f0d56a877305649a14b902b3f23140b4b.tar.gz
rspamd-b0ddff4f0d56a877305649a14b902b3f23140b4b.zip
* Add new algorithm based on diff algorithm to compare relatively short text parts
Diffstat (limited to 'src/fstring.c')
-rw-r--r--src/fstring.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/fstring.c b/src/fstring.c
index 84c8c54bd..3f7ae2195 100644
--- a/src/fstring.c
+++ b/src/fstring.c
@@ -241,6 +241,23 @@ fstrpush (f_str_t * dest, gchar c)
}
/*
+ * Push one character to fstr
+ */
+gint
+fstrpush_unichar (f_str_t * dest, gunichar c)
+{
+ int l;
+ if (dest->size < dest->len) {
+ /* Need to reallocate string */
+ return 0;
+ }
+
+ l = g_unichar_to_utf8 (c, dest->begin + dest->len);
+ dest->len += l;
+ return l;
+}
+
+/*
* Allocate memory for f_str_t
*/
f_str_t *