diff options
author | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-07-20 19:35:07 +0400 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rambler-co.ru> | 2011-07-20 19:35:07 +0400 |
commit | 5c9372c4a8678c6856360891180b02c2fdf688ee (patch) | |
tree | bc67f5cb057c4784c67e691f76aa8a8f80a40e51 /src/diff.h | |
parent | 9bc06fea2eac12cc46028fcdd630d291a76b68ae (diff) | |
download | rspamd-5c9372c4a8678c6856360891180b02c2fdf688ee.tar.gz rspamd-5c9372c4a8678c6856360891180b02c2fdf688ee.zip |
* Add start script for red hat compatible systems
Add descriptions for some rspamd API functions (no functional changes).
--HG--
rename : linux/rspamd => linux/rspamd_debian.in
Diffstat (limited to 'src/diff.h')
-rw-r--r-- | src/diff.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/diff.h b/src/diff.h index b1c5426d2..e10fe943d 100644 --- a/src/diff.h +++ b/src/diff.h @@ -42,8 +42,26 @@ struct diff_edit gint len; }; +/* + * Calculate difference between two strings using diff algorithm + * @param a the first line begin + * @param aoff the first line offset + * @param n the first line length + * @param b the second line begin + * @param boff the second line offset + * @param b the second line length + * @param dmax maximum differences number + * @param ses here would be stored the shortest script to transform a to b + * @param sn here would be stored a number of differences between a and b + * @return distance between strings or -1 in case of error + */ gint rspamd_diff(const void *a, gint aoff, gint n, const void *b, gint boff, gint m, gint dmax, GArray *ses, gint *sn); + +/* + * Calculate distance between two strings (in percentage) using diff algorithm. + * @return 100 in case of identical strings and 0 in case of totally different strings. + */ guint32 compare_diff_distance (f_str_t *s1, f_str_t *s2); #endif /* DIFF_H_ */ |