From: Markus Valentin Date: Thu, 20 May 2021 21:21:10 +0000 (+0200) Subject: imap-acl: Add imap_acl_storage with module context X-Git-Tag: 2.3.15~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0e19b0511876e4c4160b6fecbb5500808b7bab9c;p=thirdparty%2Fdovecot%2Fcore.git imap-acl: Add imap_acl_storage with module context --- diff --git a/src/plugins/imap-acl/imap-acl-plugin.c b/src/plugins/imap-acl/imap-acl-plugin.c index df3608b494..b86f8ac5d9 100644 --- a/src/plugins/imap-acl/imap-acl-plugin.c +++ b/src/plugins/imap-acl/imap-acl-plugin.c @@ -7,6 +7,8 @@ #include "imap-commands.h" #include "mail-storage.h" #include "mail-namespace.h" +#include "mail-storage-private.h" +#include "module-context.h" #include "acl-api.h" #include "acl-storage.h" #include "acl-plugin.h" @@ -23,6 +25,11 @@ #define IMAP_ACL_GROUP_OVERRIDE_PREFIX "!$" #define IMAP_ACL_GLOBAL_PREFIX "#" +#define IMAP_ACL_CONTEXT(obj) \ + MODULE_CONTEXT(obj, imap_acl_storage_module) +#define IMAP_ACL_CONTEXT_REQUIRE(obj) \ + MODULE_CONTEXT_REQUIRE(obj, imap_acl_storage_module) + struct imap_acl_letter_map { char letter; const char *name; @@ -43,6 +50,14 @@ static const struct imap_acl_letter_map imap_acl_letter_map[] = { { '\0', NULL } }; +struct imap_acl_storage { + union mail_storage_module_context module_ctx; + struct imapc_acl_context *iacl_ctx; +}; + +struct imap_acl_storage_module imap_acl_storage_module = + MODULE_CONTEXT_INIT(&mail_storage_module_register); + const char *imap_acl_plugin_version = DOVECOT_ABI_VERSION; static struct module *imap_acl_module; diff --git a/src/plugins/imap-acl/imap-acl-plugin.h b/src/plugins/imap-acl/imap-acl-plugin.h index b15478a495..117e8fbca4 100644 --- a/src/plugins/imap-acl/imap-acl-plugin.h +++ b/src/plugins/imap-acl/imap-acl-plugin.h @@ -4,6 +4,8 @@ extern const char *imap_acl_plugin_dependencies[]; extern const char imap_acl_plugin_binary_dependency[]; +extern MODULE_CONTEXT_DEFINE(imap_acl_storage_module, &mail_storage_module_register); + void imap_acl_plugin_init(struct module *module); void imap_acl_plugin_deinit(void);