From: Timo Sirainen Date: Fri, 6 Feb 2009 18:49:07 +0000 (-0500) Subject: imap: Added module contexts to struct client_command_context. X-Git-Tag: 1.2.beta1~12 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bbd6e4793a10a99c3a1a6ced64ef925f97b28e3a;p=thirdparty%2Fdovecot%2Fcore.git imap: Added module contexts to struct client_command_context. --HG-- branch : HEAD --- diff --git a/src/imap/client.c b/src/imap/client.c index 88d47d1d39..46f927a6a1 100644 --- a/src/imap/client.c +++ b/src/imap/client.c @@ -17,6 +17,7 @@ #include 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; diff --git a/src/imap/client.h b/src/imap/client.h index 671455a227..cd00397611 100644 --- a/src/imap/client.h +++ b/src/imap/client.h @@ -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;