diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-04-26 20:09:45 +0200 |
---|---|---|
committer | Johannes Berg <johannes@sipsolutions.net> | 2008-04-26 20:09:45 +0200 |
commit | ba068756b782e55251bd58ac67f0a9700f745fbe (patch) | |
tree | a27f284c3b7f877a8b102ac0c5e9fef1062735d6 | |
parent | 938d7cf7209014f0b219a58c0c6cc6bc5f7cce4c (diff) | |
download | dovecot-antispam-ba068756b782e55251bd58ac67f0a9700f745fbe.tar.gz dovecot-antispam-ba068756b782e55251bd58ac67f0a9700f745fbe.tar.xz dovecot-antispam-ba068756b782e55251bd58ac67f0a9700f745fbe.zip |
shuffle some code, add _id for 1.1 plugin
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | antispam-plugin.c | 11 | ||||
-rw-r--r-- | antispam-plugin.h | 8 |
3 files changed, 14 insertions, 7 deletions
@@ -38,9 +38,11 @@ endif # dovecot version rules objs += antispam-storage-$(DOVECOT_VERSION).o ifeq ("$(DOVECOT_VERSION)", "1.0") +CFLAGS += -DCONFIG_DOVECOT_10 CFLAGS += -Dstr_array_length=strarray_length CFLAGS += "-Dmempool_unref(x)=pool_unref(*(x))" else +CFLAGS += -DCONFIG_DOVECOT_11 CFLAGS += "-Dmempool_unref(x)=pool_unref(x)" endif diff --git a/antispam-plugin.c b/antispam-plugin.c index 1e58722..fdde26d 100644 --- a/antispam-plugin.c +++ b/antispam-plugin.c @@ -40,6 +40,10 @@ extern void (*hook_mail_storage_created)(struct mail_storage *storage); /* internal stuff we need */ #include "antispam-plugin.h" +#ifdef CONFIG_DOVECOT_11 +uint32_t PLUGIN_FUNCTION(id) = 0; +#endif + static pool_t global_pool; static char **trash_folders = NULL; static char *default_spam_folders[] = { @@ -118,13 +122,6 @@ const char *get_setting(const char *name) return env; } -#define __PLUGIN_FUNCTION(name, ioe) \ - name ## _plugin_ ## ioe -#define _PLUGIN_FUNCTION(name, ioe) \ - __PLUGIN_FUNCTION(name, ioe) -#define PLUGIN_FUNCTION(ioe) \ - _PLUGIN_FUNCTION(PLUGINNAME, ioe) - void PLUGIN_FUNCTION(init)(void) { const char *tmp; diff --git a/antispam-plugin.h b/antispam-plugin.h index 8a7958d..f614894 100644 --- a/antispam-plugin.h +++ b/antispam-plugin.h @@ -10,6 +10,14 @@ #define __stringify_1(x) #x #define stringify(x) __stringify_1(x) +#define __PLUGIN_FUNCTION(name, ioe) \ + name ## _plugin_ ## ioe +#define _PLUGIN_FUNCTION(name, ioe) \ + __PLUGIN_FUNCTION(name, ioe) +#define PLUGIN_FUNCTION(ioe) \ + _PLUGIN_FUNCTION(PLUGINNAME, ioe) + +extern uint32_t PLUGIN_FUNCTION(id); struct antispam_transaction_context; |