c115c742f730e312d6b6ab5064595cd0d8b4e26eTimo Sirainen#ifndef VIRTUAL_TRANSACTION_H
c115c742f730e312d6b6ab5064595cd0d8b4e26eTimo Sirainen#define VIRTUAL_TRANSACTION_H
c115c742f730e312d6b6ab5064595cd0d8b4e26eTimo Sirainen
c115c742f730e312d6b6ab5064595cd0d8b4e26eTimo Sirainen#include "index-storage.h"
c115c742f730e312d6b6ab5064595cd0d8b4e26eTimo Sirainen
c115c742f730e312d6b6ab5064595cd0d8b4e26eTimo Sirainenstruct virtual_transaction_context {
c04f9a724a7b3cc649485a61b0a540868d25d71bTimo Sirainen struct mailbox_transaction_context t;
c115c742f730e312d6b6ab5064595cd0d8b4e26eTimo Sirainen
4ee00532a265bdfb38539d811fcd12d51210ac35Timo Sirainen ARRAY(struct mailbox_transaction_context *) backend_transactions;
c115c742f730e312d6b6ab5064595cd0d8b4e26eTimo Sirainen};
c115c742f730e312d6b6ab5064595cd0d8b4e26eTimo Sirainen
c115c742f730e312d6b6ab5064595cd0d8b4e26eTimo Sirainenstruct mailbox_transaction_context *
c115c742f730e312d6b6ab5064595cd0d8b4e26eTimo Sirainenvirtual_transaction_get(struct mailbox_transaction_context *trans,
c115c742f730e312d6b6ab5064595cd0d8b4e26eTimo Sirainen struct mailbox *backend_box);
c115c742f730e312d6b6ab5064595cd0d8b4e26eTimo Sirainen
eb0816090cf5a549280ad783b9aa6fec199d36baTimo Sirainenstruct mailbox_transaction_context *
eb0816090cf5a549280ad783b9aa6fec199d36baTimo Sirainenvirtual_transaction_begin(struct mailbox *box,
c6ce2e251ac75fa650c7fbfa52150eae69386293Martti Rannanjärvi enum mailbox_transaction_flags flags,
c6ce2e251ac75fa650c7fbfa52150eae69386293Martti Rannanjärvi const char *reason);
eb0816090cf5a549280ad783b9aa6fec199d36baTimo Sirainenint virtual_transaction_commit(struct mailbox_transaction_context *t,
eb0816090cf5a549280ad783b9aa6fec199d36baTimo Sirainen struct mail_transaction_commit_changes *changes_r);
eb0816090cf5a549280ad783b9aa6fec199d36baTimo Sirainenvoid virtual_transaction_rollback(struct mailbox_transaction_context *t);
c115c742f730e312d6b6ab5064595cd0d8b4e26eTimo Sirainen
c115c742f730e312d6b6ab5064595cd0d8b4e26eTimo Sirainen#endif