c25356d5978632df6203437e1953bcb29e0c736fTimo Sirainen#ifndef CYDIR_STORAGE_H
c25356d5978632df6203437e1953bcb29e0c736fTimo Sirainen#define CYDIR_STORAGE_H
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen#include "index-storage.h"
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen#define CYDIR_STORAGE_NAME "cydir"
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen#define CYDIR_SUBSCRIPTION_FILE_NAME "subscriptions."
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainenstruct cydir_storage {
ccc895c0358108d2304239063e940b7d75f364abTimo Sirainen struct mail_storage storage;
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen};
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainenstruct cydir_mailbox {
d22301419109ed4a38351715e6760011421dadecTimo Sirainen struct mailbox box;
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen struct cydir_storage *storage;
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen};
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen
a97fdf205b182250b0fe56c0f6f418bc22fb09a3Josef 'Jeff' Sipek#define CYDIR_STORAGE(s) container_of(s, struct cydir_storage, storage)
a97fdf205b182250b0fe56c0f6f418bc22fb09a3Josef 'Jeff' Sipek#define CYDIR_MAILBOX(s) container_of(s, struct cydir_mailbox, box)
a97fdf205b182250b0fe56c0f6f418bc22fb09a3Josef 'Jeff' Sipek
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainenextern struct mail_vfuncs cydir_mail_vfuncs;
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen
e3aeeb634245e80d4f643f8d2eea11d6b72336d8Timo Sirainenstruct mail_save_context *
e3aeeb634245e80d4f643f8d2eea11d6b72336d8Timo Sirainencydir_save_alloc(struct mailbox_transaction_context *_t);
e3aeeb634245e80d4f643f8d2eea11d6b72336d8Timo Sirainenint cydir_save_begin(struct mail_save_context *ctx, struct istream *input);
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainenint cydir_save_continue(struct mail_save_context *ctx);
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainenint cydir_save_finish(struct mail_save_context *ctx);
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainenvoid cydir_save_cancel(struct mail_save_context *ctx);
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen
eb0816090cf5a549280ad783b9aa6fec199d36baTimo Sirainenint cydir_transaction_save_commit_pre(struct mail_save_context *ctx);
9f19a50d5966643c4d1c5ca06868ac2ad31bc4d5Timo Sirainenvoid cydir_transaction_save_commit_post(struct mail_save_context *ctx,
9f19a50d5966643c4d1c5ca06868ac2ad31bc4d5Timo Sirainen struct mail_index_transaction_commit_result *result);
eb0816090cf5a549280ad783b9aa6fec199d36baTimo Sirainenvoid cydir_transaction_save_rollback(struct mail_save_context *ctx);
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen
c6a57378d3c54988f525f81e19c0c5d132a0770dTimo Sirainen#endif