mail-index-sync-update.c revision 1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina/* Copyright (C) 2004 Timo Sirainen */
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březinastatic void mail_index_sync_replace_map(struct mail_index_view *view,
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina mail_index_unmap(view->index, view->index->map);
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březinamail_index_sync_init_expunge_handlers(struct mail_index_sync_map_ctx *ctx)
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina const mail_index_expunge_handler_t *const *handlers;
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina handlers = buffer_get_data(ctx->view->index->expunge_handlers,
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina /* set expunge handlers */
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina buffer_set_used_size(ctx->expunge_handlers, 0);
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina extensions = ctx->view->map->extensions->data;
04e870d99e72aa3160bdb6ab05d986fb4005c3edPavel Březina id_map = buffer_get_data(ctx->view->map->ext_id_map, &id_map_size);
for (i = 0; i < size; i++) {
sizeof(struct mail_index_ext));
for (i = 0; i < size; i++) {
if (seq1 == 0)
for (i = 0; i < expunge_handlers_count; i++) {
void *dest;
void *context)
int update_keywords;
if (seq1 == 0)
for (i = 0; i < INDEX_KEYWORDS_BYTE_COUNT; i++) {
if (u->add_keywords[i] != 0 ||
u->remove_keywords[i] != 0)
if (update_keywords) {
for (i = 0; i < INDEX_KEYWORDS_BYTE_COUNT; i++) {
void *context)
static struct mail_index_ext_header *
void *hdr_base;
return ext_hdr;
static struct mail_index_map *
const void *src;
t_push();
for (i = 0; i < size; i++) {
for (i = 0; i < size; i++) {
if (i == size) {
offset = 0;
sizeof(struct mail_index_record));
for (i = 0; i < size; i++) {
old_records_count != 0) {
for (i = 0; i < size; i++) {
t_pop();
return new_map;
if (modified) {
void *context)
const char *name;
t_push();
t_pop();
u->reset_id);
t_pop();
void *context)
uint32_t i;
void *context)
void *context)
void *old_data;
int ret;
if (seq == 0)
if (ret <= 0)
return ret;
unsigned int count)
void *hdr_copy;
t_push();
t_pop();
t_pop();
const int max_days =
int i, days;
const void *data)
int ret = 0;
case MAIL_TRANSACTION_APPEND: {
if (ret <= 0)
case MAIL_TRANSACTION_EXPUNGE:
if (ret <= 0)
case MAIL_TRANSACTION_FLAG_UPDATE: {
if (ret <= 0)
case MAIL_TRANSACTION_HEADER_UPDATE: {
if (ret <= 0)
case MAIL_TRANSACTION_EXT_INTRO: {
if (ret <= 0)
case MAIL_TRANSACTION_EXT_RESET: {
case MAIL_TRANSACTION_EXT_HDR_UPDATE: {
if (ret <= 0)
case MAIL_TRANSACTION_EXT_REC_UPDATE: {
unsigned int record_size;
if (ret <= 0)
i_unreached();
return ret;
int sync_only_external)
const void *data;
if (had_dirty)
first_append_uid = 0;
if (sync_only_external) {
} else if (check_ext_offsets) {
&prev_seq,
&prev_offset);
if (first_append_uid == 0)
if (ret < 0) {
if (!sync_only_external)
if (first_append_uid != 0)
had_dirty) {
return ret;