diff --git a/src/lib-sieve/plugins/relational/ext-relational-common.c b/src/lib-sieve/plugins/relational/ext-relational-common.c index a718a23b3b19e25262dd58da7b60afc7e869daa0..88c80a0db3c3003e215150c7f4ccfaebe1070ac6 100644 --- a/src/lib-sieve/plugins/relational/ext-relational-common.c +++ b/src/lib-sieve/plugins/relational/ext-relational-common.c @@ -1,3 +1,6 @@ +/* Copyright (c) 2002-2008 Dovecot Sieve authors, see the included COPYING file + */ + /* Syntax: * MATCH-TYPE =/ COUNT / VALUE * COUNT = ":count" relational-match diff --git a/src/lib-sieve/plugins/relational/ext-relational-common.h b/src/lib-sieve/plugins/relational/ext-relational-common.h index 14c997ff7403bd5c5d6f1e8ff28ba75b22fdc2a4..195cf2fda587f85cbc3cb6dcec8677a6d1bd5d04 100644 --- a/src/lib-sieve/plugins/relational/ext-relational-common.h +++ b/src/lib-sieve/plugins/relational/ext-relational-common.h @@ -1,3 +1,6 @@ +/* Copyright (c) 2002-2008 Dovecot Sieve authors, see the included COPYING file + */ + #ifndef __EXT_RELATIONAL_COMMON_H #define __EXT_RELATIONAL_COMMON_H @@ -41,16 +44,17 @@ int ext_relational_my_id; extern const struct sieve_extension relational_extension; extern const struct sieve_match_type_extension relational_match_extension; -bool mcht_relational_validate - (struct sieve_validator *validator, struct sieve_ast_argument **arg, - struct sieve_match_type_context *ctx); -int mcht_value_match - (struct sieve_match_context *mctx, const char *val, size_t val_size, - const char *key, size_t key_size, int key_index); +/* + * Match types + */ + +/* Registered for validation */ extern const struct sieve_match_type value_match_type; extern const struct sieve_match_type count_match_type; +/* Used in byte code */ + extern const struct sieve_match_type rel_match_count_gt; extern const struct sieve_match_type rel_match_count_ge; extern const struct sieve_match_type rel_match_count_lt; @@ -65,6 +69,28 @@ extern const struct sieve_match_type rel_match_value_le; extern const struct sieve_match_type rel_match_value_eq; extern const struct sieve_match_type rel_match_value_ne; +/* + * Operand + */ + extern const struct sieve_operand rel_match_type_operand; -#endif + +/* + * Match type validation + */ + +bool mcht_relational_validate + (struct sieve_validator *validator, struct sieve_ast_argument **arg, + struct sieve_match_type_context *ctx); + +/* + * Value match function (also used by :count) + */ + +int mcht_value_match + (struct sieve_match_context *mctx, const char *val, size_t val_size, + const char *key, size_t key_size, int key_index); + + +#endif /* __EXT_RELATIONAL_COMMON_H */ diff --git a/src/lib-sieve/plugins/relational/ext-relational.c b/src/lib-sieve/plugins/relational/ext-relational.c index 26a4c92062daaa440f772fb4744066f37f953f42..8570982de3b99e8f16b30b317273baf4bac06d4f 100644 --- a/src/lib-sieve/plugins/relational/ext-relational.c +++ b/src/lib-sieve/plugins/relational/ext-relational.c @@ -1,3 +1,6 @@ +/* Copyright (c) 2002-2008 Dovecot Sieve authors, see the included COPYING file + */ + /* Extension relational * -------------------- * @@ -26,14 +29,12 @@ #include "ext-relational-common.h" /* - * Forward declarations + * Extension */ static bool ext_relational_load(int ext_id); static bool ext_relational_validator_load(struct sieve_validator *validator); -/* Extension definitions */ - int ext_relational_my_id; const struct sieve_extension relational_extension = { @@ -53,10 +54,6 @@ static bool ext_relational_load(int ext_id) return TRUE; } -/* - * Load extension into validator - */ - static bool ext_relational_validator_load(struct sieve_validator *validator) { sieve_match_type_register(validator, &value_match_type); diff --git a/src/lib-sieve/plugins/relational/mcht-count.c b/src/lib-sieve/plugins/relational/mcht-count.c index fe7bcc7753ee048817493fc945f5ccee385edd72..0616488275312fe5fe9ec7323468c88cb615f563 100644 --- a/src/lib-sieve/plugins/relational/mcht-count.c +++ b/src/lib-sieve/plugins/relational/mcht-count.c @@ -1,3 +1,6 @@ +/* Copyright (c) 2002-2008 Dovecot Sieve authors, see the included COPYING file + */ + /* Match-type ':count' */ @@ -5,7 +8,6 @@ #include "str.h" #include "sieve-common.h" - #include "sieve-ast.h" #include "sieve-code.h" #include "sieve-extensions.h" @@ -32,7 +34,7 @@ static int mcht_count_match_deinit(struct sieve_match_context *mctx); /* * Match-type objects */ - + const struct sieve_match_type count_match_type = { SIEVE_OBJECT("count", &rel_match_type_operand, RELATIONAL_COUNT), FALSE, FALSE, diff --git a/src/lib-sieve/plugins/relational/mcht-value.c b/src/lib-sieve/plugins/relational/mcht-value.c index d9c12123369b005febbe21b4dc1c098a529c7292..c259583db0ea91a37ea4e6c4c8b9f91f118a60ba 100644 --- a/src/lib-sieve/plugins/relational/mcht-value.c +++ b/src/lib-sieve/plugins/relational/mcht-value.c @@ -1,3 +1,6 @@ +/* Copyright (c) 2002-2008 Dovecot Sieve authors, see the included COPYING file + */ + #include "lib.h" #include "str.h"