From: Vsevolod Stakhov Date: Fri, 16 Dec 2016 17:56:32 +0000 (+0000) Subject: [Minor] Add macro to make ftok_t from string literal X-Git-Tag: 1.5.0~566^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=98ef56b2b103b07f7678cc47cd0ccbb0a48c5616;p=thirdparty%2Frspamd.git [Minor] Add macro to make ftok_t from string literal --- diff --git a/src/libutil/fstring.h b/src/libutil/fstring.h index e23bd5e19f..c1b2058178 100644 --- a/src/libutil/fstring.h +++ b/src/libutil/fstring.h @@ -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