diff --git a/src/lib-sieve/plugins/regex/ext-regex-common.c b/src/lib-sieve/plugins/regex/ext-regex-common.c index fd95c1a42beabce58ac821b41fbc409632ad6e9f..37521741692a53961a72aad14a5e6975da9c4b4b 100644 --- a/src/lib-sieve/plugins/regex/ext-regex-common.c +++ b/src/lib-sieve/plugins/regex/ext-regex-common.c @@ -1,3 +1,6 @@ +/* Copyright (c) 2002-2008 Dovecot Sieve authors, see the included COPYING file + */ + #include "sieve-common.h" #include "sieve-match-types.h" diff --git a/src/lib-sieve/plugins/regex/ext-regex-common.h b/src/lib-sieve/plugins/regex/ext-regex-common.h index e2399e9a36febb22aba68f7abfefa0c4af9923c2..cc638b69b8cefd17bb3a4de457c52e752de9486c 100644 --- a/src/lib-sieve/plugins/regex/ext-regex-common.h +++ b/src/lib-sieve/plugins/regex/ext-regex-common.h @@ -1,12 +1,27 @@ +/* Copyright (c) 2002-2008 Dovecot Sieve authors, see the included COPYING file + */ + #ifndef __EXT_REGEX_COMMON_H #define __EXT_REGEX_COMMON_H +/* + * Extension + */ + const struct sieve_extension regex_extension; +/* + * Operand + */ + const struct sieve_operand regex_match_type_operand; +/* + * Match type + */ + extern const struct sieve_match_type regex_match_type; -#endif +#endif /* __EXT_REGEX_COMMON_H */ diff --git a/src/lib-sieve/plugins/regex/ext-regex.c b/src/lib-sieve/plugins/regex/ext-regex.c index ede583fb59368e2ba0f351b56157c7a714085730..6e246d776bfa452b3b497a06c434fd2be8ce521b 100644 --- a/src/lib-sieve/plugins/regex/ext-regex.c +++ b/src/lib-sieve/plugins/regex/ext-regex.c @@ -1,3 +1,6 @@ +/* Copyright (c) 2002-2008 Dovecot Sieve authors, see the included COPYING file + */ + /* Extension regex * --------------- * @@ -36,13 +39,13 @@ #include <sys/types.h> #include <regex.h> -/* Forward declarations */ +/* + * Extension + */ static bool ext_regex_load(int ext_id); static bool ext_regex_validator_load(struct sieve_validator *validator); -/* Extension definitions */ - static int ext_my_id; const struct sieve_extension regex_extension = { @@ -62,10 +65,6 @@ static bool ext_regex_load(int ext_id) return TRUE; } -/* - * Load extension into validator - */ - static bool ext_regex_validator_load(struct sieve_validator *validator) { sieve_match_type_register(validator, ®ex_match_type); diff --git a/src/lib-sieve/plugins/regex/mcht-regex.c b/src/lib-sieve/plugins/regex/mcht-regex.c index a7935c2f1750df58c4d943c58eea880abde91ed3..cd4b41b44afcebc46278e158880fc96ee350d7eb 100644 --- a/src/lib-sieve/plugins/regex/mcht-regex.c +++ b/src/lib-sieve/plugins/regex/mcht-regex.c @@ -1,3 +1,6 @@ +/* Copyright (c) 2002-2008 Dovecot Sieve authors, see the included COPYING file + */ + /* Match-type ':regex' */ @@ -29,8 +32,12 @@ #define MCHT_REGEX_MAX_SUBSTITUTIONS SIEVE_MAX_MATCH_VALUES /* - * Forward declarations + * Match type */ + +bool mcht_regex_validate_context +(struct sieve_validator *validator, struct sieve_ast_argument *arg, + struct sieve_match_type_context *ctx, struct sieve_ast_argument *key_arg); static void mcht_regex_match_init(struct sieve_match_context *mctx); static int mcht_regex_match @@ -38,10 +45,6 @@ static int mcht_regex_match const char *key, size_t key_size, int key_index); static int mcht_regex_match_deinit(struct sieve_match_context *mctx); -bool mcht_regex_validate_context -(struct sieve_validator *validator, struct sieve_ast_argument *arg, - struct sieve_match_type_context *ctx, struct sieve_ast_argument *key_arg); - const struct sieve_match_type regex_match_type = { SIEVE_OBJECT("regex", ®ex_match_type_operand, 0), TRUE, FALSE, @@ -53,7 +56,7 @@ const struct sieve_match_type regex_match_type = { }; /* - * Match-type validation + * Match type validation */ /* Wrapper around the regerror function for easy access */ @@ -160,7 +163,7 @@ bool mcht_regex_validate_context } /* - * Match-type implementation + * Match type implementation */ struct mcht_regex_context {