diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-04-07 14:42:58 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-04-07 14:43:15 +0100 |
commit | 3ca316cd22f55b484b0a00a5818617dd585325b4 (patch) | |
tree | bee7488fb1dac0cd71b89f69abfca38430f622c7 /src/libutil/str_util.h | |
parent | b9ef79d942ab8c71b2b05ca9d0d1adb01d1f0755 (diff) | |
download | rspamd-3ca316cd22f55b484b0a00a5818617dd585325b4.tar.gz rspamd-3ca316cd22f55b484b0a00a5818617dd585325b4.zip |
[Minor] Unify substring search routines
Diffstat (limited to 'src/libutil/str_util.h')
-rw-r--r-- | src/libutil/str_util.h | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/src/libutil/str_util.h b/src/libutil/str_util.h index ea3d97278..2a213d738 100644 --- a/src/libutil/str_util.h +++ b/src/libutil/str_util.h @@ -264,7 +264,8 @@ GString *rspamd_header_value_fold (const gchar *name, enum rspamd_newlines_type how); /** - * Search for a substring `srch` in the text `in` using Karp-Rabin algorithm + * Search for a substring `srch` in the text `in` using Apostolico-Crochemore algorithm + * http://www-igm.univ-mlv.fr/~lecroq/string/node12.html#SECTION00120 * @param in input * @param inlen input len * @param srch search string @@ -275,7 +276,8 @@ goffset rspamd_substring_search (const gchar *in, gsize inlen, const gchar *srch, gsize srchlen); /** - * Search for a substring `srch` in the text `in` using Karp-Rabin algorithm in caseless matter (ASCII only) + * Search for a substring `srch` in the text `in` using Apostolico-Crochemore algorithm in caseless matter (ASCII only) + * http://www-igm.univ-mlv.fr/~lecroq/string/node12.html#SECTION00120 * @param in input * @param inlen input len * @param srch search string @@ -286,18 +288,6 @@ goffset rspamd_substring_search_caseless (const gchar *in, gsize inlen, const gchar *srch, gsize srchlen); /** - * Search for a substring `srch` in the text `in` using 2-way algorithm: - * http://www-igm.univ-mlv.fr/~lecroq/string/node26.html#SECTION00260 - * @param in input - * @param inlen input len - * @param srch search string - * @param srchlen length of the search string - * @return position of the first substring match or (-1) if not found - */ -goffset rspamd_substring_search_twoway (const gchar *in, gint inlen, - const gchar *srch, gint srchlen); - -/** * Search for end-of-headers mark in the input string. Returns position just after * the last header in message (but before the last newline character). * Hence, to obtain the real EOH position, it is also required to skip |