They're not actually used anywhere.
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);
}
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;
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;
}
#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)
uint16_t record_align;
mail_index_expunge_handler_t *expunge_handler;
-
- void *expunge_context;
};
struct mail_index_record_map {
/* 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);
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;
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);
}
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);
}
}
}
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;
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,