1
/* Copyright (c) 2002-2009 Dovecot Sieve authors, see the included COPYING file
4
#ifndef __EXT_RELATIONAL_COMMON_H
5
#define __EXT_RELATIONAL_COMMON_H
10
#include "sieve-common.h"
16
enum ext_relational_match_type {
21
enum relational_match {
23
REL_MATCH_GREATER_EQUAL,
31
#define REL_MATCH_INDEX(type, match) \
32
(type * REL_MATCH_INVALID + match)
33
#define REL_MATCH_TYPE(index) \
34
(index / REL_MATCH_INVALID)
35
#define REL_MATCH(index) \
36
(index % REL_MATCH_INVALID)
39
* Extension definitions
42
extern int ext_relational_my_id;
44
extern const struct sieve_extension relational_extension;
45
extern const struct sieve_match_type_extension relational_match_extension;
51
/* Registered for validation */
53
extern const struct sieve_match_type value_match_type;
54
extern const struct sieve_match_type count_match_type;
56
/* Used in byte code */
58
extern const struct sieve_match_type rel_match_count_gt;
59
extern const struct sieve_match_type rel_match_count_ge;
60
extern const struct sieve_match_type rel_match_count_lt;
61
extern const struct sieve_match_type rel_match_count_le;
62
extern const struct sieve_match_type rel_match_count_eq;
63
extern const struct sieve_match_type rel_match_count_ne;
65
extern const struct sieve_match_type rel_match_value_gt;
66
extern const struct sieve_match_type rel_match_value_ge;
67
extern const struct sieve_match_type rel_match_value_lt;
68
extern const struct sieve_match_type rel_match_value_le;
69
extern const struct sieve_match_type rel_match_value_eq;
70
extern const struct sieve_match_type rel_match_value_ne;
76
extern const struct sieve_operand rel_match_type_operand;
80
* Match type validation
83
bool mcht_relational_validate
84
(struct sieve_validator *validator, struct sieve_ast_argument **arg,
85
struct sieve_match_type_context *ctx);
88
* Value match function (also used by :count)
92
(struct sieve_match_context *mctx, const char *val, size_t val_size,
93
const char *key, size_t key_size, int key_index);
96
#endif /* __EXT_RELATIONAL_COMMON_H */