Mercurial > dovecot > core-2.2
diff src/lib-storage/index/dbox-single/sdbox-storage.c @ 10657:e7f066508299 HEAD
lib-storage: Moved struct mail_index_* from index_mailbox to mailbox.
We're relying more and more of all mailboxes being used via lib-index, and
this change makes accessing the indexes easier.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 07 Feb 2010 15:44:33 +0200 |
parents | 9d3b5cbef222 |
children | 56b1d4dd9c7d |
line wrap: on
line diff
--- a/src/lib-storage/index/dbox-single/sdbox-storage.c Sun Feb 07 04:50:40 2010 +0200 +++ b/src/lib-storage/index/dbox-single/sdbox-storage.c Sun Feb 07 15:44:33 2010 +0200 @@ -65,7 +65,7 @@ mbox->ibox.box.pool = pool; mbox->ibox.box.storage = storage; mbox->ibox.box.list = list; - mbox->ibox.mail_vfuncs = &sdbox_mail_vfuncs; + mbox->ibox.box.mail_vfuncs = &sdbox_mail_vfuncs; mbox->ibox.save_commit_pre = sdbox_transaction_save_commit_pre; mbox->ibox.save_commit_post = sdbox_transaction_save_commit_post; @@ -73,7 +73,7 @@ index_storage_mailbox_alloc(&mbox->ibox, name, input, flags, DBOX_INDEX_PREFIX); - mail_index_set_fsync_types(mbox->ibox.index, + mail_index_set_fsync_types(mbox->ibox.box.index, MAIL_INDEX_SYNC_TYPE_APPEND | MAIL_INDEX_SYNC_TYPE_EXPUNGE); @@ -85,7 +85,7 @@ p_strconcat(pool, list->set.alt_dir, "/", list->set.maildir_name, NULL); mbox->hdr_ext_id = - mail_index_ext_register(mbox->ibox.index, "dbox-hdr", + mail_index_ext_register(mbox->ibox.box.index, "dbox-hdr", sizeof(struct sdbox_index_header), 0, 0); return &mbox->ibox.box; } @@ -96,7 +96,7 @@ const void *data; size_t data_size; - mail_index_get_header_ext(mbox->ibox.view, mbox->hdr_ext_id, + mail_index_get_header_ext(mbox->ibox.box.view, mbox->hdr_ext_id, &data, &data_size); if (data_size < SDBOX_INDEX_HEADER_MIN_SIZE && (!mbox->creating || data_size != 0)) { @@ -142,8 +142,8 @@ const struct mail_index_header *hdr; uint32_t uid_validity, uid_next; - hdr = mail_index_get_header(mbox->ibox.view); - trans = mail_index_transaction_begin(mbox->ibox.view, 0); + hdr = mail_index_get_header(box->view); + trans = mail_index_transaction_begin(box->view, 0); sdbox_update_header(mbox, trans, update); if (update != NULL && update->uid_validity != 0) @@ -165,7 +165,7 @@ &uid_next, sizeof(uid_next), TRUE); } if (update != NULL && update->min_highest_modseq != 0 && - mail_index_modseq_get_highest(mbox->ibox.view) < + mail_index_modseq_get_highest(box->view) < update->min_highest_modseq) { mail_index_update_highest_modseq(trans, update->min_highest_modseq); @@ -173,7 +173,7 @@ if (mail_index_transaction_commit(&trans) < 0) { mail_storage_set_internal_error(box->storage); - mail_index_reset_error(mbox->ibox.index); + mail_index_reset_error(box->index); return -1; } return 0;