dovecot-1.2: imap: Added module contexts to struct client_comman...
dovecot at dovecot.org
dovecot at dovecot.org
Fri Feb 6 21:41:04 EET 2009
details: http://hg.dovecot.org/dovecot-1.2/rev/3949c6d2e4c8
changeset: 8731:3949c6d2e4c8
user: Timo Sirainen <tss at iki.fi>
date: Fri Feb 06 13:49:07 2009 -0500
description:
imap: Added module contexts to struct client_command_context.
diffstat:
2 files changed, 14 insertions(+)
src/imap/client.c | 2 ++
src/imap/client.h | 12 ++++++++++++
diffs (48 lines):
diff -r 9b5d68776d03 -r 3949c6d2e4c8 src/imap/client.c
--- a/src/imap/client.c Fri Feb 06 13:39:48 2009 -0500
+++ b/src/imap/client.c Fri Feb 06 13:49:07 2009 -0500
@@ -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;
diff -r 9b5d68776d03 -r 3949c6d2e4c8 src/imap/client.h
--- a/src/imap/client.h Fri Feb 06 13:39:48 2009 -0500
+++ b/src/imap/client.h Fri Feb 06 13:49:07 2009 -0500
@@ -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;
@@ -60,6 +69,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;
More information about the dovecot-cvs
mailing list