]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Added module contexts to struct client_command_context.
authorTimo Sirainen <tss@iki.fi>
Fri, 6 Feb 2009 18:49:07 +0000 (13:49 -0500)
committerTimo Sirainen <tss@iki.fi>
Fri, 6 Feb 2009 18:49:07 +0000 (13:49 -0500)
--HG--
branch : HEAD

src/imap/client.c
src/imap/client.h

index 88d47d1d3950272d44264f0602224810c7dc2237..46f927a6a17ed845d9716a70ccc93e6816528656 100644 (file)
@@ -17,6 +17,7 @@
 #include <unistd.h>
 
 extern struct mail_storage_callbacks mail_storage_callbacks;
+struct imap_module_register imap_module_register = { 0 };
 
 static struct client *my_client; /* we don't need more than one currently */
 
@@ -433,6 +434,7 @@ client_command_new(struct client *client)
        cmd = p_new(client->command_pool, struct client_command_context, 1);
        cmd->client = client;
        cmd->pool = client->command_pool;
+       p_array_init(&cmd->module_contexts, cmd->pool, 5);
 
        if (client->free_parser != NULL) {
                cmd->parser = client->free_parser;
index 671455a22731a7812a828898a4a46c5c9a8fdcd7..cd0039761127f2c4c9e0a8420a6fd96736f1505d 100644 (file)
@@ -43,6 +43,15 @@ enum client_command_state {
        CLIENT_COMMAND_STATE_DONE
 };
 
+struct imap_module_register {
+       unsigned int id;
+};
+
+union imap_module_context {
+       struct imap_module_register *reg;
+};
+extern struct imap_module_register imap_module_register;
+
 struct client_command_context {
        struct client_command_context *prev, *next;
        struct client *client;
@@ -61,6 +70,9 @@ struct client_command_context {
        command_func_t *func;
        void *context;
 
+       /* Module-specific contexts. */
+       ARRAY_DEFINE(module_contexts, union imap_module_context *);
+
        struct imap_parser *parser;
        enum client_command_state state;