]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: mail_index_expunge_handler_t - Remove seq and context parameters
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Sat, 6 Feb 2021 19:00:58 +0000 (21:00 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Mon, 3 May 2021 13:01:05 +0000 (13:01 +0000)
They're not actually used anywhere.

src/lib-index/mail-cache-private.h
src/lib-index/mail-cache-sync-update.c
src/lib-index/mail-cache.c
src/lib-index/mail-index-private.h
src/lib-index/mail-index-sync-ext.c
src/lib-index/mail-index-sync-update.c
src/lib-index/mail-index.c

index 6ad14559b198d6b53ff5b8408520eff141bf3fe3..178d3ae349fd6eed6d075fc47404ef28bd5be314 100644 (file)
@@ -295,8 +295,7 @@ mail_cache_purge_drop_test(struct mail_cache_purge_drop_ctx *ctx,
                           unsigned int field);
 
 int mail_cache_expunge_handler(struct mail_index_sync_map_ctx *sync_ctx,
-                              uint32_t seq, const void *data,
-                              void **sync_context, void *context);
+                              const void *data, void **sync_context);
 
 void mail_cache_set_syscall_error(struct mail_cache *cache,
                                  const char *function);
index a79745dd5ed5d6da1396a6d619a98b1273cd4ed8..90731876f7586b8652ee7f6126f5f9e745078ab7 100644 (file)
@@ -48,8 +48,7 @@ static void mail_cache_handler_deinit(struct mail_index_sync_map_ctx *sync_ctx,
 }
 
 int mail_cache_expunge_handler(struct mail_index_sync_map_ctx *sync_ctx,
-                              uint32_t seq ATTR_UNUSED, const void *data,
-                              void **sync_context, void *context ATTR_UNUSED)
+                              const void *data, void **sync_context)
 {
        struct mail_cache_sync_context *ctx = *sync_context;
        const uint32_t *cache_offset = data;
index e9a9f25f7bc264bf36d9aa6db3bff60ad030e939..bd3c9396b2510cd0148d5275354c4fe0a92bd176 100644 (file)
@@ -596,7 +596,7 @@ mail_cache_open_or_create_path(struct mail_index *index, const char *path)
                mail_index_ext_register(index, "cache", 0,
                                        sizeof(uint32_t), sizeof(uint32_t));
        mail_index_register_expunge_handler(index, cache->ext_id,
-                                           mail_cache_expunge_handler, cache);
+                                           mail_cache_expunge_handler);
        return cache;
 }
 
index bd1ed658cab3ba9a2f21b034705d00331a8e8168..9c1dac91b2e862642f1332b4d0966166ab2f2081 100644 (file)
@@ -43,8 +43,7 @@ struct mail_index_sync_map_ctx;
 #define MAIL_INDEX_EXT_KEYWORDS "keywords"
 
 typedef int mail_index_expunge_handler_t(struct mail_index_sync_map_ctx *ctx,
-                                        uint32_t seq, const void *data,
-                                        void **sync_context, void *context);
+                                        const void *data, void **sync_context);
 
 #define MAIL_INDEX_HEADER_SIZE_ALIGN(size) \
        (((size) + 7) & ~7U)
@@ -97,8 +96,6 @@ struct mail_index_registered_ext {
        uint16_t record_align;
 
        mail_index_expunge_handler_t *expunge_handler;
-
-       void *expunge_context;
 };
 
 struct mail_index_record_map {
@@ -261,8 +258,7 @@ extern struct event_category event_category_mail_index;
 /* Add/replace expunge handler for specified extension. */
 void mail_index_register_expunge_handler(struct mail_index *index,
                                         uint32_t ext_id,
-                                        mail_index_expunge_handler_t *callback,
-                                        void *context);
+                                        mail_index_expunge_handler_t *callback);
 void mail_index_unregister_expunge_handler(struct mail_index *index,
                                           uint32_t ext_id);
 
index e6168cfec104d7b165996db026699e394f97ef9e..3eec2f1a154678bccac78d808b9c717b1c39c9f3 100644 (file)
@@ -43,7 +43,6 @@ void mail_index_sync_init_expunge_handlers(struct mail_index_sync_map_ctx *ctx)
                        continue;
 
                eh.handler = rext[idx_ext_id].expunge_handler;
-               eh.context = rext[idx_ext_id].expunge_context;
                eh.sync_context = &contexts[idx_ext_id];
                eh.record_offset = map_ext_id == (uint32_t)-1 ? 0 :
                        ext[map_ext_id].record_offset;
@@ -62,10 +61,8 @@ mail_index_sync_deinit_expunge_handlers(struct mail_index_sync_map_ctx *ctx)
                return;
 
        array_foreach(&ctx->expunge_handlers, eh) {
-               if (eh->sync_context != NULL) {
-                       eh->handler(ctx, 0, NULL, eh->sync_context,
-                                   eh->context);
-               }
+               if (eh->sync_context != NULL)
+                       eh->handler(ctx, NULL, eh->sync_context);
        }
        array_free(&ctx->expunge_handlers);
 }
index 0f194d93a95386b8f05a33cc36ffc113494990a0..47e620a2127af3075a78db451a379f263d35f6fa 100644 (file)
@@ -209,13 +209,8 @@ sync_expunge_call_handlers(struct mail_index_sync_map_ctx *ctx,
        array_foreach(&ctx->expunge_handlers, eh) {
                for (seq = seq1; seq <= seq2; seq++) {
                        rec = MAIL_INDEX_REC_AT_SEQ(ctx->view->map, seq);
-                       /* FIXME: does expunge handler's return value matter?
-                          we probably shouldn't disallow expunges if the
-                          handler returns failure.. should it be just changed
-                          to return void? */
-                       (void)eh->handler(ctx, seq,
-                                         PTR_OFFSET(rec, eh->record_offset),
-                                         eh->sync_context, eh->context);
+                       eh->handler(ctx, PTR_OFFSET(rec, eh->record_offset),
+                                   eh->sync_context);
                }
        }
 }
index 0a2f246337873ed38ccc63b39c58a298983fba79..809547ed494cf6f65a6aef568948709ba05ad506 100644 (file)
@@ -308,8 +308,7 @@ bool mail_index_ext_lookup(struct mail_index *index, const char *name,
 
 void mail_index_register_expunge_handler(struct mail_index *index,
                                         uint32_t ext_id,
-                                        mail_index_expunge_handler_t *cb,
-                                        void *context)
+                                        mail_index_expunge_handler_t *cb)
 {
        struct mail_index_registered_ext *rext;
 
@@ -317,7 +316,6 @@ void mail_index_register_expunge_handler(struct mail_index *index,
        i_assert(rext->expunge_handler == NULL || rext->expunge_handler == cb);
 
        rext->expunge_handler = cb;
-       rext->expunge_context = context;
 }
 
 void mail_index_unregister_expunge_handler(struct mail_index *index,