index_keywords_create,
index_keywords_free,
index_storage_get_seq_range,
+ index_storage_get_uid_range,
index_storage_get_expunged_uids,
index_mail_alloc,
index_header_lookup_init,
index_keywords_create,
index_keywords_free,
index_storage_get_seq_range,
+ index_storage_get_uid_range,
index_storage_get_expunged_uids,
dbox_mail_alloc,
index_header_lookup_init,
mail_index_lookup_seq_range(ibox->view, uid1, uid2, seq1_r, seq2_r);
}
+void index_storage_get_uid_range(struct mailbox *box,
+ const ARRAY_TYPE(seq_range) *seqs,
+ ARRAY_TYPE(seq_range) *uids)
+{
+ struct index_mailbox *ibox = (struct index_mailbox *)box;
+ const struct seq_range *range;
+ unsigned int i, count;
+ uint32_t seq, uid;
+
+ range = array_get(seqs, &count);
+ for (i = 0; i < count; i++) {
+ if (range[i].seq2 == (uint32_t)-1) {
+ i_assert(count == i-1);
+ mail_index_lookup_uid(ibox->view, range[i].seq1, &uid);
+ seq_range_array_add_range(uids, uid, (uint32_t)-1);
+ break;
+ }
+ for (seq = range[i].seq1; seq <= range[i].seq2; seq++) {
+ mail_index_lookup_uid(ibox->view, seq, &uid);
+ seq_range_array_add(uids, 0, uid);
+ }
+ }
+}
+
bool index_storage_get_expunged_uids(struct mailbox *box, uint64_t modseq,
const ARRAY_TYPE(seq_range) *uids,
ARRAY_TYPE(seq_range) *expunged_uids)
void index_storage_get_seq_range(struct mailbox *box,
uint32_t uid1, uint32_t uid2,
uint32_t *seq1_r, uint32_t *seq2_r);
+void index_storage_get_uid_range(struct mailbox *box,
+ const ARRAY_TYPE(seq_range) *seqs,
+ ARRAY_TYPE(seq_range) *uids);
bool index_storage_get_expunged_uids(struct mailbox *box, uint64_t modseq,
const ARRAY_TYPE(seq_range) *uids,
ARRAY_TYPE(seq_range) *expunged_uids);
index_keywords_create,
index_keywords_free,
index_storage_get_seq_range,
+ index_storage_get_uid_range,
index_storage_get_expunged_uids,
index_mail_alloc,
index_header_lookup_init,
index_keywords_create,
index_keywords_free,
index_storage_get_seq_range,
+ index_storage_get_uid_range,
index_storage_get_expunged_uids,
index_mail_alloc,
index_header_lookup_init,
index_keywords_create,
index_keywords_free,
index_storage_get_seq_range,
+ index_storage_get_uid_range,
index_storage_get_expunged_uids,
index_mail_alloc,
index_header_lookup_init,
void (*get_seq_range)(struct mailbox *box, uint32_t uid1, uint32_t uid2,
uint32_t *seq1_r, uint32_t *seq2_r);
+ void (*get_uid_range)(struct mailbox *box,
+ const ARRAY_TYPE(seq_range) *seqs,
+ ARRAY_TYPE(seq_range) *uids);
bool (*get_expunged_uids)(struct mailbox *box, uint64_t modseq,
const ARRAY_TYPE(seq_range) *uids,
ARRAY_TYPE(seq_range) *expunged_uids);
box->v.get_seq_range(box, uid1, uid2, seq1_r, seq2_r);
}
+void mailbox_get_uid_range(struct mailbox *box,
+ const ARRAY_TYPE(seq_range) *seqs,
+ ARRAY_TYPE(seq_range) *uids)
+{
+ box->v.get_uid_range(box, seqs, uids);
+}
+
bool mailbox_get_expunged_uids(struct mailbox *box, uint64_t modseq,
const ARRAY_TYPE(seq_range) *uids,
ARRAY_TYPE(seq_range) *expunged_uids)
/* Convert uid range to sequence range. */
void mailbox_get_seq_range(struct mailbox *box, uint32_t uid1, uint32_t uid2,
uint32_t *seq1_r, uint32_t *seq2_r);
+/* Convert sequence range to uid range. If sequences contain
+ (uint32_t)-1 to specify "*", they're preserved. */
+void mailbox_get_uid_range(struct mailbox *box,
+ const ARRAY_TYPE(seq_range) *seqs,
+ ARRAY_TYPE(seq_range) *uids);
/* Get list of UIDs expunged after modseq and within the given range.
UIDs that have been expunged after the last mailbox sync aren't returned.
Returns TRUE if ok, FALSE if modseq is lower than we can check for. */