annotate src/lib-storage/index/index-storage.h @ 939:24b64302f59c HEAD

index_storage_sync_and_lock() didn't set lock notify function.
author Timo Sirainen <tss@iki.fi>
date Fri, 10 Jan 2003 13:29:24 +0200
parents 4f697dde0fca
children 8028c4dcf38f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
1 #ifndef __INDEX_STORAGE_H
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
2 #define __INDEX_STORAGE_H
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
3
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
4 #include "mail-storage.h"
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
5 #include "mail-index.h"
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
6 #include "imap-message-cache.h"
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
7
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
8 struct index_mailbox {
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
9 struct mailbox box;
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
10
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
11 /* expunge messages marked as deleted, requires index to be
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
12 exclusively locked */
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
13 int (*expunge_locked)(struct index_mailbox *ibox, int notify);
450
925d6eb5f8be MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents: 410
diff changeset
14
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
15 struct mail_index *index;
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
16 struct imap_message_cache *cache;
600
3b44bc64afd4 mailbox_check_interval setting: Dovecot can notify client of new mail in
Timo Sirainen <tss@iki.fi>
parents: 570
diff changeset
17
3b44bc64afd4 mailbox_check_interval setting: Dovecot can notify client of new mail in
Timo Sirainen <tss@iki.fi>
parents: 570
diff changeset
18 char *check_path;
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
19 struct timeout *check_to;
600
3b44bc64afd4 mailbox_check_interval setting: Dovecot can notify client of new mail in
Timo Sirainen <tss@iki.fi>
parents: 570
diff changeset
20 time_t check_file_stamp;
3b44bc64afd4 mailbox_check_interval setting: Dovecot can notify client of new mail in
Timo Sirainen <tss@iki.fi>
parents: 570
diff changeset
21 time_t last_check;
3b44bc64afd4 mailbox_check_interval setting: Dovecot can notify client of new mail in
Timo Sirainen <tss@iki.fi>
parents: 570
diff changeset
22
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
23 unsigned int synced_messages_count;
450
925d6eb5f8be MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents: 410
diff changeset
24
674
b7aefd0d7611 Locking changes triggered a bit larger cleanup :) If we have to wait for a
Timo Sirainen <tss@iki.fi>
parents: 633
diff changeset
25 time_t next_lock_notify; /* temporary */
b7aefd0d7611 Locking changes triggered a bit larger cleanup :) If we have to wait for a
Timo Sirainen <tss@iki.fi>
parents: 633
diff changeset
26
450
925d6eb5f8be MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents: 410
diff changeset
27 unsigned int sent_diskspace_warning:1;
633
3814fc4f4135 COPYing inside same mailbox works now with mbox. Also fixed SAVE leaving
Timo Sirainen <tss@iki.fi>
parents: 600
diff changeset
28 unsigned int delay_save_unlocking:1; /* For COPYing inside mailbox */
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
29 };
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
30
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
31 extern struct imap_message_cache_iface index_msgcache_iface;
106
5fe3e04ca8d9 Added support for caching of MessagePart data. This is useful for fetching
Timo Sirainen <tss@iki.fi>
parents: 47
diff changeset
32
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
33 int mail_storage_set_index_error(struct index_mailbox *ibox);
939
24b64302f59c index_storage_sync_and_lock() didn't set lock notify function.
Timo Sirainen <tss@iki.fi>
parents: 924
diff changeset
34 void index_storage_init_lock_notify(struct index_mailbox *ibox);
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
35 int index_storage_lock(struct index_mailbox *ibox,
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
36 enum mail_lock_type lock_type);
223
ca6967899c05 More cleanups. lib-storage should handle "out of disk space" conditions
Timo Sirainen <tss@iki.fi>
parents: 184
diff changeset
37
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
38 void index_storage_add(struct mail_index *index);
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
39 struct mail_index *index_storage_lookup_ref(const char *path);
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
40 void index_storage_unref(struct mail_index *index);
450
925d6eb5f8be MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents: 410
diff changeset
41
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
42 struct index_mailbox *
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
43 index_storage_init(struct mail_storage *storage, struct mailbox *box,
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
44 struct mail_index *index, const char *name,
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
45 int readonly, int fast);
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
46 int index_storage_close(struct mailbox *box);
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
47
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
48 int index_storage_sync_and_lock(struct index_mailbox *ibox, int sync_size,
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
49 enum mail_lock_type data_lock_type);
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
50 int index_storage_sync_modifylog(struct index_mailbox *ibox, int hide_deleted);
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
51
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
52 int index_mailbox_fix_custom_flags(struct index_mailbox *ibox,
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
53 enum mail_flags *flags,
175
73bf05a1d862 Moved custom flags handling into lib-index.
Timo Sirainen <tss@iki.fi>
parents: 171
diff changeset
54 const char *custom_flags[]);
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
55
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
56 unsigned int index_storage_get_recent_count(struct mail_index *index);
325
ba058497efa9 Send RECENT after all EXISTS replies. Check for new mail in mailbox after
Timo Sirainen <tss@iki.fi>
parents: 296
diff changeset
57
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
58 int index_expunge_seek_first(struct index_mailbox *ibox, unsigned int *seq,
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
59 struct mail_index_record **rec);
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
60 int index_expunge_mail(struct index_mailbox *ibox,
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
61 struct mail_index_record *rec,
453
0f6fd6802265 Modify log now stores the changes in ranges, so store 1:100 doesn't
Timo Sirainen <tss@iki.fi>
parents: 450
diff changeset
62 unsigned int seq, int notify);
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
63
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
64 int index_storage_save(struct mail_storage *storage, const char *path,
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
65 struct istream *input, struct ostream *output,
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
66 uoff_t data_size);
106
5fe3e04ca8d9 Added support for caching of MessagePart data. This is useful for fetching
Timo Sirainen <tss@iki.fi>
parents: 47
diff changeset
67
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
68 int index_msgcache_open(struct imap_message_cache *cache,
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
69 struct mail_index *index, struct mail_index_record *rec,
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
70 enum imap_cache_field fields);
600
3b44bc64afd4 mailbox_check_interval setting: Dovecot can notify client of new mail in
Timo Sirainen <tss@iki.fi>
parents: 570
diff changeset
71
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
72 void index_mailbox_check_add(struct index_mailbox *ibox, const char *path);
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
73 void index_mailbox_check_remove(struct index_mailbox *ibox);
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
74
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
75 /* mailbox methods: */
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
76 void index_storage_set_callbacks(struct mail_storage *storage,
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
77 struct mail_storage_callbacks *callbacks,
674
b7aefd0d7611 Locking changes triggered a bit larger cleanup :) If we have to wait for a
Timo Sirainen <tss@iki.fi>
parents: 633
diff changeset
78 void *context);
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
79 int index_storage_copy(struct mailbox *box, struct mailbox *destbox,
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
80 const char *messageset, int uidset);
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
81 int index_storage_expunge(struct mailbox *box, int notify);
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
82 int index_storage_get_status(struct mailbox *box,
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
83 enum mailbox_status_items items,
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
84 struct mailbox_status *status);
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
85 int index_storage_sync(struct mailbox *box, int sync_expunges);
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
86 int index_storage_update_flags(struct mailbox *box, const char *messageset,
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
87 int uidset, enum mail_flags flags,
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
88 const char *custom_flags[],
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
89 enum modify_type modify_type, int notify,
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
90 int *all_found);
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
91 int index_storage_fetch(struct mailbox *box, struct mail_fetch_data *fetch_data,
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
92 struct ostream *output, int *all_found);
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
93 int index_storage_search(struct mailbox *box, const char *charset,
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
94 struct mail_search_arg *args,
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
95 enum mail_sort_type *sorting,
924
4f697dde0fca THREAD=REFERENCES implementation. Doesn't crash, but I'm not sure how
Timo Sirainen <tss@iki.fi>
parents: 903
diff changeset
96 enum mail_thread_type threading,
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
97 struct ostream *output, int uid_result);
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
98
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
99 #endif