]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Added mail_index_view_get_transaction_count().
authorTimo Sirainen <tss@iki.fi>
Sun, 13 Jun 2010 14:40:10 +0000 (15:40 +0100)
committerTimo Sirainen <tss@iki.fi>
Sun, 13 Jun 2010 14:40:10 +0000 (15:40 +0100)
--HG--
branch : HEAD

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

index ddfa08b6b9c781f3f87af5cac8e5152fb8e33e2b..67493f6f616fb86337e206ffc8f89a294c973400 100644 (file)
@@ -68,6 +68,14 @@ struct mail_index *mail_index_view_get_index(struct mail_index_view *view)
        return view->index;
 }
 
+unsigned int
+mail_index_view_get_transaction_count(struct mail_index_view *view)
+{
+       i_assert(view->transactions >= 0);
+
+       return view->transactions;
+}
+
 void mail_index_view_transaction_ref(struct mail_index_view *view)
 {
        view->transactions++;
index 2bf75b0c567c510074d8ee2d1112e0e314af1253..e62681b51a4ede30240d7ad90a3b967f309e343f 100644 (file)
@@ -250,6 +250,9 @@ struct mail_index *mail_index_view_get_index(struct mail_index_view *view);
 uint32_t mail_index_view_get_messages_count(struct mail_index_view *view);
 /* Returns TRUE if we lost track of changes for some reason. */
 bool mail_index_view_is_inconsistent(struct mail_index_view *view);
+/* Returns number of transactions open for the view. */
+unsigned int
+mail_index_view_get_transaction_count(struct mail_index_view *view);
 
 /* Transaction has to be opened to be able to modify index. You can have
    multiple transactions open simultaneously. Committed transactions won't