[dovecot-cvs] dovecot: Added mail_index_transaction_is_expunged()

dovecot at dovecot.org dovecot at dovecot.org
Tue May 22 20:19:40 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/bc3652a97a0f
changeset: 5646:bc3652a97a0f
user:      Timo Sirainen <tss at iki.fi>
date:      Tue May 22 20:19:35 2007 +0300
description:
Added mail_index_transaction_is_expunged()

diffstat:

2 files changed, 11 insertions(+)
src/lib-index/mail-index-transaction.c |    7 +++++++
src/lib-index/mail-index.h             |    4 ++++

diffs (34 lines):

diff -r caf10b68dad7 -r bc3652a97a0f src/lib-index/mail-index-transaction.c
--- a/src/lib-index/mail-index-transaction.c	Tue May 22 20:11:01 2007 +0300
+++ b/src/lib-index/mail-index-transaction.c	Tue May 22 20:19:35 2007 +0300
@@ -92,6 +92,13 @@ mail_index_transaction_get_view(struct m
 mail_index_transaction_get_view(struct mail_index_transaction *t)
 {
 	return t->view;
+}
+
+bool mail_index_transaction_is_expunged(struct mail_index_transaction *t,
+					uint32_t seq)
+{
+	return array_is_created(&t->expunges) &&
+		seq_range_exists(&t->expunges, seq);
 }
 
 void mail_index_transaction_ref(struct mail_index_transaction *t)
diff -r caf10b68dad7 -r bc3652a97a0f src/lib-index/mail-index.h
--- a/src/lib-index/mail-index.h	Tue May 22 20:11:01 2007 +0300
+++ b/src/lib-index/mail-index.h	Tue May 22 20:19:35 2007 +0300
@@ -189,9 +189,13 @@ void mail_index_transaction_rollback(str
 void mail_index_transaction_rollback(struct mail_index_transaction **t);
 /* Discard all changes in the transaction. */
 void mail_index_transaction_reset(struct mail_index_transaction *t);
+
 /* Returns the view transaction was created for. */
 struct mail_index_view *
 mail_index_transaction_get_view(struct mail_index_transaction *t);
+/* Returns TRUE if the given sequence is being expunged in this transaction. */
+bool mail_index_transaction_is_expunged(struct mail_index_transaction *t,
+					uint32_t seq);
 
 /* Returns a view to transaction. Currently this differs from normal view only
    in that it contains newly appended messages in transaction. The view can


More information about the dovecot-cvs mailing list