aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-04-26 20:09:45 +0200
committerJohannes Berg <johannes@sipsolutions.net>2008-04-26 20:09:45 +0200
commitba068756b782e55251bd58ac67f0a9700f745fbe (patch)
treea27f284c3b7f877a8b102ac0c5e9fef1062735d6
parent938d7cf7209014f0b219a58c0c6cc6bc5f7cce4c (diff)
downloaddovecot-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--Makefile2
-rw-r--r--antispam-plugin.c11
-rw-r--r--antispam-plugin.h8
3 files changed, 14 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index bd614f0..4c649fb 100644
--- a/Makefile
+++ b/Makefile
@@ -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;