]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Added imap_client_created_hook_set() to update the hook.
authorTimo Sirainen <tss@iki.fi>
Mon, 4 Oct 2010 14:12:23 +0000 (15:12 +0100)
committerTimo Sirainen <tss@iki.fi>
Mon, 4 Oct 2010 14:12:23 +0000 (15:12 +0100)
src/imap/imap-common.h
src/imap/main.c

index 9fa2981d2b8939d574420533d6184e70c83df44c..ec4aff3cbb511d996cb287ca5a02e2f181b9ce96 100644 (file)
 #include "imap-client.h"
 #include "imap-settings.h"
 
-extern void (*hook_client_created)(struct client **client);
+typedef void imap_client_created_func_t(struct client **client);
+
+extern imap_client_created_func_t *hook_client_created;
+
+/* Sets the hook_client_created and returns the previous hook,
+   which the new_hook should call if it's non-NULL. */
+imap_client_created_func_t *
+imap_client_created_hook_set(imap_client_created_func_t *new_hook);
 
 void imap_refresh_proctitle(void);
 
index 149518778c36c592c06f43d172a14cfd01f177c0..0889fa4559ee767226c99cf77b0bb70899a16475 100644 (file)
@@ -32,7 +32,16 @@ static bool verbose_proctitle = FALSE;
 static struct mail_storage_service_ctx *storage_service;
 static struct master_login *master_login = NULL;
 
-void (*hook_client_created)(struct client **client) = NULL;
+imap_client_created_func_t *hook_client_created = NULL;
+
+imap_client_created_func_t *
+imap_client_created_hook_set(imap_client_created_func_t *new_hook)
+{
+       imap_client_created_func_t *old_hook = hook_client_created;
+
+       hook_client_created = new_hook;
+       return old_hook;
+}
 
 void imap_refresh_proctitle(void)
 {