Mercurial > dovecot > core-2.2
annotate src/lib-storage/index/index-storage.h @ 600:3b44bc64afd4 HEAD
mailbox_check_interval setting: Dovecot can notify client of new mail in
selected mailbox soon after it's received. This setting specifies the
minimum interval in seconds between new mail notifications to client -
internally they may be checked more or less often. Setting this to 0
disables the checking.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 12 Nov 2002 07:27:30 +0200 |
parents | 2626acd3c6f4 |
children | 3814fc4f4135 |
rev | line source |
---|---|
0 | 1 #ifndef __INDEX_STORAGE_H |
2 #define __INDEX_STORAGE_H | |
3 | |
4 #include "mail-storage.h" | |
5 #include "mail-index.h" | |
6 #include "imap-message-cache.h" | |
7 | |
8 typedef struct _IndexMailbox IndexMailbox; | |
9 | |
10 struct _IndexMailbox { | |
11 Mailbox box; | |
12 | |
13 /* expunge messages marked as deleted, requires index to be | |
14 exclusively locked */ | |
450
925d6eb5f8be
MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents:
410
diff
changeset
|
15 int (*expunge_locked)(IndexMailbox *ibox, int notify); |
925d6eb5f8be
MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents:
410
diff
changeset
|
16 |
925d6eb5f8be
MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents:
410
diff
changeset
|
17 MailboxSyncCallbacks sync_callbacks; |
925d6eb5f8be
MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents:
410
diff
changeset
|
18 void *sync_context; |
0 | 19 |
20 MailIndex *index; | |
21 ImapMessageCache *cache; | |
600
3b44bc64afd4
mailbox_check_interval setting: Dovecot can notify client of new mail in
Timo Sirainen <tss@iki.fi>
parents:
570
diff
changeset
|
22 |
3b44bc64afd4
mailbox_check_interval setting: Dovecot can notify client of new mail in
Timo Sirainen <tss@iki.fi>
parents:
570
diff
changeset
|
23 char *check_path; |
3b44bc64afd4
mailbox_check_interval setting: Dovecot can notify client of new mail in
Timo Sirainen <tss@iki.fi>
parents:
570
diff
changeset
|
24 Timeout check_to; |
3b44bc64afd4
mailbox_check_interval setting: Dovecot can notify client of new mail in
Timo Sirainen <tss@iki.fi>
parents:
570
diff
changeset
|
25 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
|
26 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
|
27 |
0 | 28 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
|
29 |
925d6eb5f8be
MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents:
410
diff
changeset
|
30 unsigned int sent_diskspace_warning:1; |
0 | 31 }; |
32 | |
106
5fe3e04ca8d9
Added support for caching of MessagePart data. This is useful for fetching
Timo Sirainen <tss@iki.fi>
parents:
47
diff
changeset
|
33 extern ImapMessageCacheIface index_msgcache_iface; |
5fe3e04ca8d9
Added support for caching of MessagePart data. This is useful for fetching
Timo Sirainen <tss@iki.fi>
parents:
47
diff
changeset
|
34 |
223
ca6967899c05
More cleanups. lib-storage should handle "out of disk space" conditions
Timo Sirainen <tss@iki.fi>
parents:
184
diff
changeset
|
35 int mail_storage_set_index_error(IndexMailbox *ibox); |
ca6967899c05
More cleanups. lib-storage should handle "out of disk space" conditions
Timo Sirainen <tss@iki.fi>
parents:
184
diff
changeset
|
36 |
450
925d6eb5f8be
MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents:
410
diff
changeset
|
37 void index_storage_add(MailIndex *index); |
925d6eb5f8be
MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents:
410
diff
changeset
|
38 MailIndex *index_storage_lookup_ref(const char *path); |
925d6eb5f8be
MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents:
410
diff
changeset
|
39 void index_storage_unref(MailIndex *index); |
925d6eb5f8be
MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents:
410
diff
changeset
|
40 |
0 | 41 IndexMailbox *index_storage_init(MailStorage *storage, Mailbox *box, |
42 MailIndex *index, const char *name, | |
296
d66aa1f1fb2d
Added fast-flag for mailbox opening, which doesn't do any index compressing
Timo Sirainen <tss@iki.fi>
parents:
223
diff
changeset
|
43 int readonly, int fast); |
559
c834e77b624c
Mostly mbox locking/syncing fixes. Still some problems though.
Timo Sirainen <tss@iki.fi>
parents:
525
diff
changeset
|
44 int index_storage_close(Mailbox *box); |
0 | 45 |
559
c834e77b624c
Mostly mbox locking/syncing fixes. Still some problems though.
Timo Sirainen <tss@iki.fi>
parents:
525
diff
changeset
|
46 int index_storage_sync_and_lock(IndexMailbox *ibox, int sync_size, |
570
2626acd3c6f4
And more locking/syncing fixes. Now it's finally beginning to look sane
Timo Sirainen <tss@iki.fi>
parents:
568
diff
changeset
|
47 MailLockType data_lock_type); |
455
d5e5aef2d2c7
When doing EXPUNGE, if there's been external flag changes in messages we're
Timo Sirainen <tss@iki.fi>
parents:
453
diff
changeset
|
48 int index_storage_sync_modifylog(IndexMailbox *ibox, int hide_deleted); |
0 | 49 |
50 int index_mailbox_fix_custom_flags(IndexMailbox *ibox, MailFlags *flags, | |
175
73bf05a1d862
Moved custom flags handling into lib-index.
Timo Sirainen <tss@iki.fi>
parents:
171
diff
changeset
|
51 const char *custom_flags[]); |
0 | 52 |
325
ba058497efa9
Send RECENT after all EXISTS replies. Check for new mail in mailbox after
Timo Sirainen <tss@iki.fi>
parents:
296
diff
changeset
|
53 unsigned int index_storage_get_recent_count(MailIndex *index); |
ba058497efa9
Send RECENT after all EXISTS replies. Check for new mail in mailbox after
Timo Sirainen <tss@iki.fi>
parents:
296
diff
changeset
|
54 |
142
524e78f870a2
index_expunge_seek_first() now separates between "not found" and "failure".
Timo Sirainen <tss@iki.fi>
parents:
106
diff
changeset
|
55 int index_expunge_seek_first(IndexMailbox *ibox, unsigned int *seq, |
524e78f870a2
index_expunge_seek_first() now separates between "not found" and "failure".
Timo Sirainen <tss@iki.fi>
parents:
106
diff
changeset
|
56 MailIndexRecord **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
|
57 int index_expunge_mail(IndexMailbox *ibox, MailIndexRecord *rec, |
0f6fd6802265
Modify log now stores the changes in ranges, so store 1:100 doesn't
Timo Sirainen <tss@iki.fi>
parents:
450
diff
changeset
|
58 unsigned int seq, int notify); |
0 | 59 |
472
2fa0bfb65268
Added setting mail_save_crlf. Few other settings cleanups.
Timo Sirainen <tss@iki.fi>
parents:
455
diff
changeset
|
60 int index_storage_save(MailStorage *storage, const char *path, |
2fa0bfb65268
Added setting mail_save_crlf. Few other settings cleanups.
Timo Sirainen <tss@iki.fi>
parents:
455
diff
changeset
|
61 IBuffer *inbuf, OBuffer *outbuf, uoff_t data_size); |
0 | 62 |
525
2cb2e0a3423b
Moved several fields from .imap.index file to .imap.index.data file. Fixed
Timo Sirainen <tss@iki.fi>
parents:
472
diff
changeset
|
63 int index_msgcache_open(ImapMessageCache *cache, MailIndex *index, |
2cb2e0a3423b
Moved several fields from .imap.index file to .imap.index.data file. Fixed
Timo Sirainen <tss@iki.fi>
parents:
472
diff
changeset
|
64 MailIndexRecord *rec, ImapCacheField fields); |
106
5fe3e04ca8d9
Added support for caching of MessagePart data. This is useful for fetching
Timo Sirainen <tss@iki.fi>
parents:
47
diff
changeset
|
65 |
600
3b44bc64afd4
mailbox_check_interval setting: Dovecot can notify client of new mail in
Timo Sirainen <tss@iki.fi>
parents:
570
diff
changeset
|
66 void index_mailbox_check_add(IndexMailbox *ibox, const char *path); |
3b44bc64afd4
mailbox_check_interval setting: Dovecot can notify client of new mail in
Timo Sirainen <tss@iki.fi>
parents:
570
diff
changeset
|
67 void index_mailbox_check_remove(IndexMailbox *ibox); |
3b44bc64afd4
mailbox_check_interval setting: Dovecot can notify client of new mail in
Timo Sirainen <tss@iki.fi>
parents:
570
diff
changeset
|
68 |
0 | 69 /* Mailbox methods: */ |
450
925d6eb5f8be
MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents:
410
diff
changeset
|
70 void index_storage_set_sync_callbacks(Mailbox *box, |
925d6eb5f8be
MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents:
410
diff
changeset
|
71 MailboxSyncCallbacks *callbacks, |
925d6eb5f8be
MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents:
410
diff
changeset
|
72 void *context); |
0 | 73 int index_storage_copy(Mailbox *box, Mailbox *destbox, |
74 const char *messageset, int uidset); | |
450
925d6eb5f8be
MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents:
410
diff
changeset
|
75 int index_storage_expunge(Mailbox *box, int notify); |
0 | 76 int index_storage_get_status(Mailbox *box, MailboxStatusItems items, |
77 MailboxStatus *status); | |
450
925d6eb5f8be
MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents:
410
diff
changeset
|
78 int index_storage_sync(Mailbox *box, int sync_expunges); |
0 | 79 int index_storage_update_flags(Mailbox *box, const char *messageset, int uidset, |
80 MailFlags flags, const char *custom_flags[], | |
450
925d6eb5f8be
MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents:
410
diff
changeset
|
81 ModifyType modify_type, int notify, |
0 | 82 int *all_found); |
83 int index_storage_fetch(Mailbox *box, MailFetchData *fetch_data, | |
410
1f0e7229ee58
Split IOBuffer into mmaped IBuffer, file IBuffer, memory data IBuffer and
Timo Sirainen <tss@iki.fi>
parents:
325
diff
changeset
|
84 OBuffer *outbuf, int *all_found); |
568
f2aa58c2afd0
SEARCH CHARSET support. Currently we do it through iconv() and only ASCII
Timo Sirainen <tss@iki.fi>
parents:
559
diff
changeset
|
85 int index_storage_search(Mailbox *box, const char *charset, MailSearchArg *args, |
410
1f0e7229ee58
Split IOBuffer into mmaped IBuffer, file IBuffer, memory data IBuffer and
Timo Sirainen <tss@iki.fi>
parents:
325
diff
changeset
|
86 OBuffer *outbuf, int uid_result); |
0 | 87 |
88 #endif |