]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Added mail_index_sync_get_offsets().
authorTimo Sirainen <tss@iki.fi>
Fri, 20 Mar 2009 18:05:33 +0000 (14:05 -0400)
committerTimo Sirainen <tss@iki.fi>
Fri, 20 Mar 2009 18:05:33 +0000 (14:05 -0400)
--HG--
branch : HEAD

src/lib-index/mail-index-sync.c
src/lib-index/mail-index.h

index aeebe522f13974c21b112675d4290985557cc10e..17df3aadd5fac7adf16cc7242aa9515403ff1946 100644 (file)
@@ -535,6 +535,15 @@ bool mail_index_sync_have_any(struct mail_index *index,
        return ret;
 }
 
+void mail_index_sync_get_offsets(struct mail_index_sync_ctx *ctx,
+                                uint32_t *seq1_r, uoff_t *offset1_r,
+                                uint32_t *seq2_r, uoff_t *offset2_r)
+{
+       *seq1_r = ctx->view->map->hdr.log_file_seq;
+       *offset1_r = ctx->view->map->hdr.log_file_tail_offset;
+       mail_transaction_log_get_head(ctx->view->index->log, seq2_r, offset2_r);
+}
+
 static void
 mail_index_sync_get_expunge(struct mail_index_sync_rec *rec,
                            const struct mail_transaction_expunge *exp)
index 1fe624eb269963947bf45e530bddd1531f5a6ef9..dbdfbc5bb1515c2f191ffc4015f4ba271bc0f40d 100644 (file)
@@ -301,6 +301,10 @@ int mail_index_sync_begin_to(struct mail_index *index,
 /* Returns TRUE if it currently looks like syncing would return changes. */
 bool mail_index_sync_have_any(struct mail_index *index,
                              enum mail_index_sync_flags flags);
+/* Returns the log file seq+offsets for the area which this sync is handling. */
+void mail_index_sync_get_offsets(struct mail_index_sync_ctx *ctx,
+                                uint32_t *seq1_r, uoff_t *offset1_r,
+                                uint32_t *seq2_r, uoff_t *offset2_r);
 /* Returns -1 if error, 0 if sync is finished, 1 if record was filled. */
 bool mail_index_sync_next(struct mail_index_sync_ctx *ctx,
                          struct mail_index_sync_rec *sync_rec);