]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Add macro to make ftok_t from string literal
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 16 Dec 2016 17:56:32 +0000 (17:56 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 16 Dec 2016 17:56:32 +0000 (17:56 +0000)
src/libutil/fstring.h

index e23bd5e19f9c0ca35b4cf1c2a2448ecaddbedf67..c1b2058178e3862fd8d8a6a2ebcf61b3342fb22f 100644 (file)
@@ -177,4 +177,6 @@ gchar *rspamd_ftokdup (const rspamd_ftok_t *src) G_GNUC_WARN_UNUSED_RESULT;
  * @return
  */
 gchar *rspamd_fstringdup (const rspamd_fstring_t *src) G_GNUC_WARN_UNUSED_RESULT;
+
+#define RSPAMD_FTOK_ASSIGN(t, lit) do { (t)->begin = (lit); (t)->len = sizeof(lit) - 1; } while (0)
 #endif