]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
director: Code cleanup - typedef user_free_hook
authorAki Tuomi <aki.tuomi@dovecot.fi>
Tue, 1 Nov 2016 12:36:19 +0000 (14:36 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 9 Nov 2016 12:51:44 +0000 (14:51 +0200)
This is done because user_free_hook needs to be
also used in mail_host. If it changes, this
reduces the places that need touching.

src/director/user-directory.c
src/director/user-directory.h

index 538c29cbf8ea65f6676c73b2ded4e82cfe18b386..1c2e4cfb9e739f9009082befb14baf58e3ffc3d1 100644 (file)
@@ -26,7 +26,7 @@ struct user_directory {
        struct user *prev_insert_pos;
 
        ARRAY(struct user_directory_iter *) iters;
-       void (*user_free_hook)(struct user *);
+       user_free_hook_t *user_free_hook;
 
        unsigned int timeout_secs;
        /* If user's expire time is less than this many seconds away,
@@ -271,7 +271,7 @@ bool user_directory_user_is_near_expiring(struct user_directory *dir,
 
 struct user_directory *
 user_directory_init(unsigned int timeout_secs,
-                   void (*user_free_hook)(struct user *))
+                   user_free_hook_t *user_free_hook)
 {
        struct user_directory *dir;
 
index f415560661486747a763cc531d2f32fc614cc2b8..690e07ae5ea4caca7d0733cc56f2f3c4f027bb3e 100644 (file)
@@ -26,11 +26,13 @@ struct user {
        unsigned int weak:1;
 };
 
+typedef void user_free_hook_t(struct user *);
+
 /* Create a new directory. Users are dropped if their time gets older
    than timeout_secs. */
 struct user_directory *
 user_directory_init(unsigned int timeout_secs,
-                   void (*user_free_hook)(struct user *));
+                   user_free_hook_t *user_free_hook);
 void user_directory_deinit(struct user_directory **dir);
 
 /* Returns the number of users currently in directory. */