Mercurial > dovecot > original-hg > dovecot-1.2
view src/lib-storage/index/index-storage.h @ 988:8028c4dcf38f HEAD
mail-storage.h interface changes, affects pretty much everything.
FETCH, SEARCH, SORT and THREAD handling were pretty much moved from
lib-storage/ to imap/ so adding non-index storages would be much easier now.
Also POP3 server can now be easily implemented with lib-storage.
Not too well tested, and at least one major problem: partial fetching is
_slow_.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 20 Jan 2003 16:52:51 +0200 |
parents | 24b64302f59c |
children | 40a327d356de |
line wrap: on
line source
#ifndef __INDEX_STORAGE_H #define __INDEX_STORAGE_H #include "mail-storage.h" #include "mail-index.h" #include "index-mail.h" struct index_mailbox { struct mailbox box; /* expunge messages marked as deleted, requires index to be exclusively locked */ int (*expunge_locked)(struct index_mailbox *ibox, int notify); struct mail_index *index; char *check_path; struct timeout *check_to; time_t check_file_stamp; time_t last_check; struct index_mail fetch_mail; /* fetch_uid() or fetch_seq() */ unsigned int synced_messages_count; time_t next_lock_notify; /* temporary */ unsigned int sent_diskspace_warning:1; unsigned int delay_save_unlocking:1; /* For COPYing inside mailbox */ }; int mail_storage_set_index_error(struct index_mailbox *ibox); void index_storage_init_lock_notify(struct index_mailbox *ibox); int index_storage_lock(struct index_mailbox *ibox, enum mail_lock_type lock_type); void index_storage_add(struct mail_index *index); struct mail_index *index_storage_lookup_ref(const char *path); void index_storage_unref(struct mail_index *index); struct index_mailbox * index_storage_init(struct mail_storage *storage, struct mailbox *box, struct mail_index *index, const char *name, int readonly, int fast); int index_storage_close(struct mailbox *box); int index_storage_sync_and_lock(struct index_mailbox *ibox, int sync_size, enum mail_lock_type data_lock_type); int index_storage_sync_modifylog(struct index_mailbox *ibox, int hide_deleted); int index_mailbox_fix_custom_flags(struct index_mailbox *ibox, enum mail_flags *flags, const char *custom_flags[], unsigned int custom_flags_count); unsigned int index_storage_get_recent_count(struct mail_index *index); int index_expunge_seek_first(struct index_mailbox *ibox, unsigned int *seq, struct mail_index_record **rec); int index_expunge_mail(struct index_mailbox *ibox, struct mail_index_record *rec, unsigned int seq, int notify); int index_storage_save(struct mail_storage *storage, const char *path, struct istream *input, struct ostream *output, uoff_t data_size); void index_mailbox_check_add(struct index_mailbox *ibox, const char *path); void index_mailbox_check_remove(struct index_mailbox *ibox); /* mailbox methods: */ void index_storage_set_callbacks(struct mail_storage *storage, struct mail_storage_callbacks *callbacks, void *context); int index_storage_copy(struct mailbox *box, struct mailbox *destbox, const char *messageset, int uidset); int index_storage_expunge(struct mailbox *box, int notify); int index_storage_get_status(struct mailbox *box, enum mailbox_status_items items, struct mailbox_status *status); int index_storage_sync(struct mailbox *box, int sync_expunges); int index_storage_update_flags(struct mailbox *box, const char *messageset, int uidset, const struct mail_full_flags *flags, enum modify_type modify_type, int notify, int *all_found); struct mail_fetch_context * index_storage_fetch_init(struct mailbox *box, enum mail_fetch_field wanted_fields, int *update_seen, const char *messageset, int uidset); int index_storage_fetch_deinit(struct mail_fetch_context *ctx, int *all_found); struct mail *index_storage_fetch_next(struct mail_fetch_context *ctx); struct mail *index_storage_fetch_uid(struct mailbox *box, unsigned int uid, enum mail_fetch_field wanted_fields); struct mail *index_storage_fetch_seq(struct mailbox *box, unsigned int seq, enum mail_fetch_field wanted_fields); int index_storage_search_get_sorting(struct mailbox *box, enum mail_sort_type *sort_program); struct mail_search_context * index_storage_search_init(struct mailbox *box, const char *charset, struct mail_search_arg *args, const enum mail_sort_type *sort_program, enum mail_fetch_field wanted_fields, const char *const wanted_headers[]); int index_storage_search_deinit(struct mail_search_context *ctx); struct mail *index_storage_search_next(struct mail_search_context *ctx); #endif