1
/* Copyright (c) 2002-2009 Dovecot Sieve authors, see the included COPYING file
9
#include "sieve-match-types.h"
10
#include "sieve-comparators.h"
11
#include "sieve-match.h"
17
* Forward declarations
20
static int mcht_is_match
21
(struct sieve_match_context *mctx, const char *val, size_t val_size,
22
const char *key, size_t key_size, int key_index);
28
const struct sieve_match_type is_match_type = {
29
SIEVE_OBJECT("is", &match_type_operand, SIEVE_MATCH_TYPE_IS),
37
* Match-type implementation
40
static int mcht_is_match
41
(struct sieve_match_context *mctx ATTR_UNUSED,
42
const char *val, size_t val_size,
43
const char *key, size_t key_size, int key_index ATTR_UNUSED)
45
if ( (val == NULL || val_size == 0) )
46
return ( key_size == 0 );
48
if ( mctx->comparator->compare != NULL )
49
return (mctx->comparator->compare(mctx->comparator,
50
val, val_size, key, key_size) == 0);