diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-04-23 10:32:48 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-04-23 10:42:05 +0100 |
commit | 79f15b27c647f6a7028b6167f9c243ca3f6fa96a (patch) | |
tree | 84dfdd5158604bdc3d988e7fafaed04ae6cd5a45 /src/libutil/str_util.h | |
parent | 278b44e90d80fca828c8595e42563f312c0f2a05 (diff) | |
download | rspamd-79f15b27c647f6a7028b6167f9c243ca3f6fa96a.tar.gz rspamd-79f15b27c647f6a7028b6167f9c243ca3f6fa96a.zip |
[Minor] Move regexp escape function to the public space
Diffstat (limited to 'src/libutil/str_util.h')
-rw-r--r-- | src/libutil/str_util.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libutil/str_util.h b/src/libutil/str_util.h index 5f0695c2a..45507e2be 100644 --- a/src/libutil/str_util.h +++ b/src/libutil/str_util.h @@ -375,4 +375,16 @@ rspamd_str_has_8bit (const guchar *beg, gsize len) gboolean rspamd_normalise_unicode_inplace (rspamd_mempool_t *pool, gchar *start, guint *len); +/** + * Escapes special characters when reading plain data to be processed in pcre + * @param pattern pattern to process + * @param slen source length + * @param dst_len destination length pointer (can be NULL) + * @param allow_glob allow glob expressions to be translated into pcre + * @return newly allocated zero terminated escaped pattern + */ +gchar * +rspamd_str_regexp_escape (const gchar *pattern, gsize slen, + gsize *dst_len, gboolean allow_glob); + #endif /* SRC_LIBUTIL_STR_UTIL_H_ */ |