return s1->len - s2->len;
}
+gboolean
+rspamd_ftok_starts_with (const rspamd_ftok_t *s1,
+ const rspamd_ftok_t *s2)
+{
+ g_assert (s1 != NULL && s2 != NULL);
+
+ if (s1->len >= s2->len) {
+ return !!(memcmp (s1->begin, s2->begin, s1->len) == 0);
+ }
+
+ return FALSE;
+}
+
void
rspamd_fstring_mapped_ftok_free (gpointer p)
{
gint rspamd_ftok_cmp (const rspamd_ftok_t *s1,
const rspamd_ftok_t *s2);
+/**
+ * Returns true if `s1` starts with `s2`
+ * @param s1
+ * @param s2
+ * @return
+ */
+gboolean rspamd_ftok_starts_with (const rspamd_ftok_t *s1,
+ const rspamd_ftok_t *s2);
+
/**
* Return TRUE if ftok is equal to specified C string
*/