index-storage.h revision 01cbf4ac5d44137ab434791be7f838d98d0fcf3b
a64adf62fa33f2463a86f990217b0c9078531a40Timo Sirainen/* Max. mmap()ed size for a message */
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainen/* Block size when read()ing message. */
3ed2d0f6b5e67e2663d44489d9da3176823789a8Timo Sirainen /* Mailbox is locked, will abort in secs_left */
1a5573ebc32fae2fe576ec544e1781323c1db609Timo Sirainen /* Mailbox lock looks stale, will override in secs_left */
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen char *temp_prefix; /* prefix for temporary files */
1d2b188f0eedc3cab6e27ceac5425a037f38042eTimo Sirainen char *user; /* name of user accessing the storage */
563273bdac80393af63b9520cbf4d24cc0efd028Timo Sirainen uint32_t (*get_recent_count)(struct index_mailbox *ibox);
8b31f966d9688e07672ef1958dcbdb7686523c04Timo Sirainen enum mailbox_lock_notify_type last_notify_type;
d46a1e3f999dda802dc5137e883adcd7a6629cd3Timo Sirainen struct istream *mbox_stream, *mbox_file_stream;
563273bdac80393af63b9520cbf4d24cc0efd028Timo Sirainen /* maildir sync: */
306b3f41b05da642d87e7ca7a1496efce9f5902fTimo Sirainen time_t last_new_mtime, last_cur_mtime, last_new_sync_time;
97ae33602db7d5bc8eede82512a965d49ab8853bTimo Sirainen struct mailbox_transaction_context mailbox_ctx;
57a8c6a95e4bce3eeaba36985adb81c07dd683ffTimo Sirainen struct mail_cache_transaction_ctx *cache_trans;
afe1da042382720393eca6497253106e4eec75e0Timo Sirainen struct index_mail fetch_mail; /* for index_storage_fetch() */
afe1da042382720393eca6497253106e4eec75e0Timo Sirainenint mail_storage_set_index_error(struct index_mailbox *ibox);
fdc557286bc9f92c5f3bb49096ff6e2bcec0ea79Timo Sirainenvoid index_storage_lock_notify(struct index_mailbox *ibox,
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen unsigned int secs_left);
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenvoid index_storage_lock_notify_reset(struct index_mailbox *ibox);
420040a5930a2b497e79ff0b5f59ba4b764a5b39Timo Sirainenindex_storage_alloc(const char *index_dir, const char *mailbox_path,
420040a5930a2b497e79ff0b5f59ba4b764a5b39Timo Sirainen const char *prefix);
563273bdac80393af63b9520cbf4d24cc0efd028Timo Sirainenvoid index_storage_unref(struct mail_index *index);
420040a5930a2b497e79ff0b5f59ba4b764a5b39Timo Sirainenvoid index_storage_init(struct index_storage *storage);
eecb235c14b49c01774134ea593c266f2d2c2be1Timo Sirainenvoid index_storage_deinit(struct index_storage *storage);
7900eb30bac4a46b259522c58362884661483d7cJosef 'Jeff' Sipekindex_storage_mailbox_init(struct index_storage *storage, struct mailbox *box,
98c217499d578495e982ea6010ebff831e9669aeMartti Rannanjärvivoid index_storage_mailbox_free(struct mailbox *box);
98c217499d578495e982ea6010ebff831e9669aeMartti Rannanjärviint index_storage_is_readonly(struct mailbox *box);
ff7056842f14fd3b30a2d327dfab165b9d15dd30Timo Sirainenint index_storage_allow_new_keywords(struct mailbox *box);
ff7056842f14fd3b30a2d327dfab165b9d15dd30Timo Sirainenint index_storage_is_inconsistent(struct mailbox *box);
ff7056842f14fd3b30a2d327dfab165b9d15dd30Timo Sirainenint index_mailbox_fix_keywords(struct index_mailbox *ibox,
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainen const char *keywords[],
ccc895c0358108d2304239063e940b7d75f364abTimo Sirainenunsigned int index_storage_get_recent_count(struct mail_index_view *view);
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenvoid index_mailbox_check_add(struct index_mailbox *ibox,
c5ab90cfad9cc3e33bcb1baeb30ffc82a7b7053aTimo Sirainenvoid index_mailbox_check_remove_all(struct index_mailbox *ibox);
306b3f41b05da642d87e7ca7a1496efce9f5902fTimo Sirainenint index_storage_sync(struct mailbox *box, enum mailbox_sync_flags flags);
9fd2181788a61500641c66aec0f8c746b19bf830Timo Sirainen/* mailbox methods: */
9fd2181788a61500641c66aec0f8c746b19bf830Timo Sirainenvoid index_storage_set_callbacks(struct mail_storage *storage,
4ee00532a265bdfb38539d811fcd12d51210ac35Timo Sirainenint index_storage_get_status(struct mailbox *box,
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenindex_storage_fetch(struct mailbox_transaction_context *t, uint32_t seq,
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainenint index_storage_get_uids(struct mailbox *box, uint32_t uid1, uint32_t uid2,
b9f564d00b7a115f465ffd6840341c7b8f9bfc8aTimo Sirainenint index_storage_search_get_sorting(struct mailbox *box,
aa41b2e17912d6cad3151babea6a85dd88539d28Timo Sirainenindex_storage_search_init(struct mailbox_transaction_context *t,
aa41b2e17912d6cad3151babea6a85dd88539d28Timo Sirainen const char *charset, struct mail_search_arg *args,
aa41b2e17912d6cad3151babea6a85dd88539d28Timo Sirainen const char *const wanted_headers[]);
aa41b2e17912d6cad3151babea6a85dd88539d28Timo Sirainenint index_storage_search_deinit(struct mail_search_context *ctx);
aa41b2e17912d6cad3151babea6a85dd88539d28Timo Sirainenstruct mail *index_storage_search_next(struct mail_search_context *ctx);
aa41b2e17912d6cad3151babea6a85dd88539d28Timo Sirainenint index_transaction_commit(struct mailbox_transaction_context *t);