Mercurial > dovecot > core-2.2
annotate src/lib-storage/index/index-storage.h @ 9002:9d0037a997f4 HEAD
Initial commit for config rewrite.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 27 Jan 2009 18:21:53 -0500 |
parents | a9dd29e7dc4f |
children | 21d4363a3cf7 |
rev | line source |
---|---|
6410
e4eb71ae8e96
Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents:
6354
diff
changeset
|
1 #ifndef INDEX_STORAGE_H |
e4eb71ae8e96
Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents:
6354
diff
changeset
|
2 #define INDEX_STORAGE_H |
0 | 3 |
1978
6303ef092c5b
mbox code compiles again, but syncing is only partially implemented so
Timo Sirainen <tss@iki.fi>
parents:
1958
diff
changeset
|
4 #include "file-dotlock.h" |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
5 #include "mail-storage-private.h" |
4453
85fcdb478608
Beginnings of joining mail-storage API more closely to mail-index, so that
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4451
diff
changeset
|
6 #include "mail-index-private.h" |
0 | 7 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
8 /* Max. mmap()ed size for a message */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
9 #define MAIL_MMAP_BLOCK_SIZE (1024*256) |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
10 /* Block size when read()ing message. */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
11 #define MAIL_READ_BLOCK_SIZE (1024*8) |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
12 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
13 #define MAILBOX_FULL_SYNC_INTERVAL 5 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
14 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
15 enum mailbox_lock_notify_type { |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
16 MAILBOX_LOCK_NOTIFY_NONE, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
17 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
18 /* Mailbox is locked, will abort in secs_left */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
19 MAILBOX_LOCK_NOTIFY_MAILBOX_ABORT, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
20 /* Mailbox lock looks stale, will override in secs_left */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
21 MAILBOX_LOCK_NOTIFY_MAILBOX_OVERRIDE |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
22 }; |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
23 |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
764
diff
changeset
|
24 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
|
25 struct mailbox box; |
5570
1b7edfc77e9f
Map mailbox to mail_index_view, not to mail_index. Fixes crashes when the
Timo Sirainen <tss@iki.fi>
parents:
5468
diff
changeset
|
26 union mail_index_view_module_context view_module_ctx; |
5450
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5179
diff
changeset
|
27 |
5459
78eaf595359c
Removed struct index_storage abstraction. It's pointless.
Timo Sirainen <tss@iki.fi>
parents:
5450
diff
changeset
|
28 struct mail_storage *storage; |
450
925d6eb5f8be
MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents:
410
diff
changeset
|
29 |
903
fd8888f6f037
Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents:
764
diff
changeset
|
30 struct mail_index *index; |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
31 struct mail_index_view *view; |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
32 struct mail_cache *cache; |
3209
923ff19873d4
Major mail-storage API changes. It's now a bit cleaner and much more plugin
Timo Sirainen <tss@iki.fi>
parents:
3138
diff
changeset
|
33 struct mail_vfuncs *mail_vfuncs; |
600
3b44bc64afd4
mailbox_check_interval setting: Dovecot can notify client of new mail in
Timo Sirainen <tss@iki.fi>
parents:
570
diff
changeset
|
34 |
3279
b698ae839a18
Moved mbox/maildir-specific variables from struct index_mailbox to
Timo Sirainen <tss@iki.fi>
parents:
3260
diff
changeset
|
35 uint32_t md5hdr_ext_idx; |
b698ae839a18
Moved mbox/maildir-specific variables from struct index_mailbox to
Timo Sirainen <tss@iki.fi>
parents:
3260
diff
changeset
|
36 |
2322
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2317
diff
changeset
|
37 struct timeout *notify_to; |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2317
diff
changeset
|
38 struct index_notify_file *notify_files; |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2317
diff
changeset
|
39 struct index_notify_io *notify_ios; |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2317
diff
changeset
|
40 time_t notify_last_check, notify_last_sent; |
600
3b44bc64afd4
mailbox_check_interval setting: Dovecot can notify client of new mail in
Timo Sirainen <tss@iki.fi>
parents:
570
diff
changeset
|
41 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
42 time_t next_lock_notify; /* temporary */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
43 enum mailbox_lock_notify_type last_notify_type; |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
44 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
45 uint32_t commit_log_file_seq; |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
46 uoff_t commit_log_file_offset; |
450
925d6eb5f8be
MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents:
410
diff
changeset
|
47 |
4451
1a35d53c18fc
Array API redesigned to work using unions. It now provides type safety
Timo Sirainen <tss@iki.fi>
parents:
4303
diff
changeset
|
48 const ARRAY_TYPE(keywords) *keyword_names; |
2559
ad139af4ac12
Cache field indexes are cache file specific, not globals.
Timo Sirainen <tss@iki.fi>
parents:
2511
diff
changeset
|
49 struct mail_cache_field *cache_fields; |
3909
411f20e72a8f
Added mail_cache_min_mail_count setting.
Timo Sirainen <tss@iki.fi>
parents:
3863
diff
changeset
|
50 |
6037
d911d943438e
Recent flag handling rewrite. Still not perfect with maildir.
Timo Sirainen <tss@iki.fi>
parents:
5708
diff
changeset
|
51 ARRAY_TYPE(seq_range) recent_flags; |
d911d943438e
Recent flag handling rewrite. Still not perfect with maildir.
Timo Sirainen <tss@iki.fi>
parents:
5708
diff
changeset
|
52 uint32_t recent_flags_prev_uid; |
d911d943438e
Recent flag handling rewrite. Still not perfect with maildir.
Timo Sirainen <tss@iki.fi>
parents:
5708
diff
changeset
|
53 uint32_t recent_flags_count; |
3909
411f20e72a8f
Added mail_cache_min_mail_count setting.
Timo Sirainen <tss@iki.fi>
parents:
3863
diff
changeset
|
54 |
2322
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2317
diff
changeset
|
55 time_t sync_last_check; |
2317
0cf316c77b1b
Recent flags should be fully working now with maildir.
Timo Sirainen <tss@iki.fi>
parents:
2275
diff
changeset
|
56 |
8626
a9dd29e7dc4f
Cleaned up read-only mailbox handling. Fixes a bug with Maildir syncing.
Timo Sirainen <tss@iki.fi>
parents:
8477
diff
changeset
|
57 /* we've discovered there aren't enough permissions to modify mailbox */ |
a9dd29e7dc4f
Cleaned up read-only mailbox handling. Fixes a bug with Maildir syncing.
Timo Sirainen <tss@iki.fi>
parents:
8477
diff
changeset
|
58 unsigned int backend_readonly:1; |
2039
f0925b2271e1
Added pop3_mails_keep_recent option. Fixed recent assert crash.
Timo Sirainen <tss@iki.fi>
parents:
1987
diff
changeset
|
59 unsigned int keep_recent:1; |
4152
e2edd333c473
Added MAILBOX_OPEN_KEEP_LOCKED flag to mailbox opening and implemented it
Timo Sirainen <tss@iki.fi>
parents:
3912
diff
changeset
|
60 unsigned int keep_locked:1; |
450
925d6eb5f8be
MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents:
410
diff
changeset
|
61 unsigned int sent_diskspace_warning:1; |
1640
db14aa8e2b5c
API change for expunging messages. Not exactly what I wanted, but good
Timo Sirainen <tss@iki.fi>
parents:
1639
diff
changeset
|
62 unsigned int sent_readonly_flags_warning:1; |
2322
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2317
diff
changeset
|
63 unsigned int notify_pending:1; |
4848
967de900c73a
Mailbox list indexing and related changes. Currently works only with
Timo Sirainen <tss@iki.fi>
parents:
4808
diff
changeset
|
64 unsigned int move_to_memory:1; |
4918
2f9173e103fd
Added fsync_disable setting. Also added missing fsync()ing to dbox when
Timo Sirainen <tss@iki.fi>
parents:
4894
diff
changeset
|
65 unsigned int fsync_disable:1; |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
66 }; |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
67 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
68 struct index_transaction_context { |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
69 struct mailbox_transaction_context mailbox_ctx; |
4453
85fcdb478608
Beginnings of joining mail-storage API more closely to mail-index, so that
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4451
diff
changeset
|
70 struct mail_index_transaction_vfuncs super; |
85fcdb478608
Beginnings of joining mail-storage API more closely to mail-index, so that
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4451
diff
changeset
|
71 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
72 struct index_mailbox *ibox; |
4453
85fcdb478608
Beginnings of joining mail-storage API more closely to mail-index, so that
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4451
diff
changeset
|
73 enum mailbox_transaction_flags flags; |
6867
901467b1506e
Assert-crash if there are mails belonging to a transaction while it's being
Timo Sirainen <tss@iki.fi>
parents:
6771
diff
changeset
|
74 int mail_ref_count; |
2224
a816e2d88406
Added mail_index_transaction_get_updated_view() which can be used to access
Timo Sirainen <tss@iki.fi>
parents:
2206
diff
changeset
|
75 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
76 struct mail_index_transaction *trans; |
2224
a816e2d88406
Added mail_index_transaction_get_updated_view() which can be used to access
Timo Sirainen <tss@iki.fi>
parents:
2206
diff
changeset
|
77 struct mail_index_view *trans_view; |
a816e2d88406
Added mail_index_transaction_get_updated_view() which can be used to access
Timo Sirainen <tss@iki.fi>
parents:
2206
diff
changeset
|
78 struct mail_cache_view *cache_view; |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
79 struct mail_cache_transaction_ctx *cache_trans; |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
80 |
6267
3a1eed408cad
mailbox_transaction_commit_get_uids() now returns also UIDVALIDITY. It's the
Timo Sirainen <tss@iki.fi>
parents:
6038
diff
changeset
|
81 uint32_t *saved_uid_validity; |
5573
9805becea644
Fixed mailbox_transaction_commit_get_uids() to actually work and not just
Timo Sirainen <tss@iki.fi>
parents:
5572
diff
changeset
|
82 uint32_t *first_saved_uid, *last_saved_uid; |
5572
896845fbc4ed
Added mailbox_transaction_commit_get_uids() which returns the UID range for
Timo Sirainen <tss@iki.fi>
parents:
5570
diff
changeset
|
83 |
2275
c68a3c9f6d73
Cache file compression works now and compressed cache file is reopened.
Timo Sirainen <tss@iki.fi>
parents:
2242
diff
changeset
|
84 unsigned int cache_trans_failed:1; |
0 | 85 }; |
86 | |
3863
55df57c028d4
Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents:
3821
diff
changeset
|
87 void mail_storage_set_index_error(struct index_mailbox *ibox); |
1978
6303ef092c5b
mbox code compiles again, but syncing is only partially implemented so
Timo Sirainen <tss@iki.fi>
parents:
1958
diff
changeset
|
88 |
6303ef092c5b
mbox code compiles again, but syncing is only partially implemented so
Timo Sirainen <tss@iki.fi>
parents:
1958
diff
changeset
|
89 void index_storage_lock_notify(struct index_mailbox *ibox, |
6303ef092c5b
mbox code compiles again, but syncing is only partially implemented so
Timo Sirainen <tss@iki.fi>
parents:
1958
diff
changeset
|
90 enum mailbox_lock_notify_type notify_type, |
6303ef092c5b
mbox code compiles again, but syncing is only partially implemented so
Timo Sirainen <tss@iki.fi>
parents:
1958
diff
changeset
|
91 unsigned int secs_left); |
6303ef092c5b
mbox code compiles again, but syncing is only partially implemented so
Timo Sirainen <tss@iki.fi>
parents:
1958
diff
changeset
|
92 void index_storage_lock_notify_reset(struct index_mailbox *ibox); |
223
ca6967899c05
More cleanups. lib-storage should handle "out of disk space" conditions
Timo Sirainen <tss@iki.fi>
parents:
184
diff
changeset
|
93 |
1790
b101e678e7ac
Fixes memory/fd leaking with INDEX=MEMORY.
Timo Sirainen <tss@iki.fi>
parents:
1732
diff
changeset
|
94 struct mail_index * |
5618
5ea33dbddbae
Moved index directory creation code to index_storage_alloc().
Timo Sirainen <tss@iki.fi>
parents:
5573
diff
changeset
|
95 index_storage_alloc(struct mail_storage *storage, const char *name, |
5ea33dbddbae
Moved index directory creation code to index_storage_alloc().
Timo Sirainen <tss@iki.fi>
parents:
5573
diff
changeset
|
96 enum mailbox_open_flags flags, const char *prefix); |
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 void index_storage_unref(struct mail_index *index); |
1546
9c9ce9c71509
Close index files before deleting the mailbox.
Timo Sirainen <tss@iki.fi>
parents:
1429
diff
changeset
|
98 void index_storage_destroy_unrefed(void); |
7093
f0623745bd4c
libstorage.a shouldn't reference symbols in libstorage_index.a. Changed
Timo Sirainen <tss@iki.fi>
parents:
6867
diff
changeset
|
99 void index_storage_destroy(struct mail_storage *storage ATTR_UNUSED); |
450
925d6eb5f8be
MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents:
410
diff
changeset
|
100 |
5179
2f9ac504ee77
When using KEEP_LOCK, the mbox/uidlist file must be locked before index file
Timo Sirainen <tss@iki.fi>
parents:
5032
diff
changeset
|
101 void index_storage_mailbox_init(struct index_mailbox *ibox, const char *name, |
4894
24afafbfe47b
Make sure the mailbox is opened when transaction is started (fixes deliver).
Timo Sirainen <tss@iki.fi>
parents:
4876
diff
changeset
|
102 enum mailbox_open_flags flags, |
24afafbfe47b
Make sure the mailbox is opened when transaction is started (fixes deliver).
Timo Sirainen <tss@iki.fi>
parents:
4876
diff
changeset
|
103 bool move_to_memory); |
24afafbfe47b
Make sure the mailbox is opened when transaction is started (fixes deliver).
Timo Sirainen <tss@iki.fi>
parents:
4876
diff
changeset
|
104 void index_storage_mailbox_open(struct index_mailbox *ibox); |
7620 | 105 int index_storage_mailbox_enable(struct mailbox *box, |
106 enum mailbox_feature feature); | |
5466
8141168f86e1
cleaned up mailbox closing code
Timo Sirainen <tss@iki.fi>
parents:
5465
diff
changeset
|
107 int index_storage_mailbox_close(struct mailbox *box); |
0 | 108 |
3863
55df57c028d4
Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents:
3821
diff
changeset
|
109 bool index_storage_is_readonly(struct mailbox *box); |
55df57c028d4
Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents:
3821
diff
changeset
|
110 bool index_storage_allow_new_keywords(struct mailbox *box); |
55df57c028d4
Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents:
3821
diff
changeset
|
111 bool index_storage_is_inconsistent(struct mailbox *box); |
0 | 112 |
6354
8476d665530f
Changed mail_keywords creation APIs to take mailbox/index instead of
Timo Sirainen <tss@iki.fi>
parents:
6353
diff
changeset
|
113 int index_keywords_create(struct mailbox *box, const char *const keywords[], |
6353
23c9ac999578
mailbox_keywords_create() checks keyword validity now and returns failure if
Timo Sirainen <tss@iki.fi>
parents:
6279
diff
changeset
|
114 struct mail_keywords **keywords_r, bool skip_invalid); |
6354
8476d665530f
Changed mail_keywords creation APIs to take mailbox/index instead of
Timo Sirainen <tss@iki.fi>
parents:
6353
diff
changeset
|
115 void index_keywords_free(struct mail_keywords *keywords); |
8042
0e7a9547be83
Added mailbox_keyword_is_valid().
Timo Sirainen <tss@iki.fi>
parents:
8011
diff
changeset
|
116 bool index_keyword_is_valid(struct mailbox *box, const char *keyword, |
0e7a9547be83
Added mailbox_keyword_is_valid().
Timo Sirainen <tss@iki.fi>
parents:
8011
diff
changeset
|
117 const char **error_r); |
0 | 118 |
6037
d911d943438e
Recent flag handling rewrite. Still not perfect with maildir.
Timo Sirainen <tss@iki.fi>
parents:
5708
diff
changeset
|
119 void index_mailbox_set_recent_uid(struct index_mailbox *ibox, uint32_t uid); |
d911d943438e
Recent flag handling rewrite. Still not perfect with maildir.
Timo Sirainen <tss@iki.fi>
parents:
5708
diff
changeset
|
120 void index_mailbox_set_recent_seq(struct index_mailbox *ibox, |
d911d943438e
Recent flag handling rewrite. Still not perfect with maildir.
Timo Sirainen <tss@iki.fi>
parents:
5708
diff
changeset
|
121 struct mail_index_view *view, |
d911d943438e
Recent flag handling rewrite. Still not perfect with maildir.
Timo Sirainen <tss@iki.fi>
parents:
5708
diff
changeset
|
122 uint32_t seq1, uint32_t seq2); |
d911d943438e
Recent flag handling rewrite. Still not perfect with maildir.
Timo Sirainen <tss@iki.fi>
parents:
5708
diff
changeset
|
123 bool index_mailbox_is_recent(struct index_mailbox *ibox, uint32_t uid); |
6038
cadb5b7cd919
Fixes to recent handling. Now it should work properly.
Timo Sirainen <tss@iki.fi>
parents:
6037
diff
changeset
|
124 unsigned int index_mailbox_get_recent_count(struct index_mailbox *ibox); |
7463
d1bd08d468d0
Reset cached \Recent flags if UIDVALIDITY changes, because we were using
Timo Sirainen <tss@iki.fi>
parents:
7291
diff
changeset
|
125 void index_mailbox_reset_uidvalidity(struct index_mailbox *ibox); |
325
ba058497efa9
Send RECENT after all EXISTS replies. Check for new mail in mailbox after
Timo Sirainen <tss@iki.fi>
parents:
296
diff
changeset
|
126 |
1730
8480f945e270
IDLE uses now IO_*_NOTIFY to get instant notifying of mails.
Timo Sirainen <tss@iki.fi>
parents:
1672
diff
changeset
|
127 void index_mailbox_check_add(struct index_mailbox *ibox, |
3534
a9be1824403b
New inotify code and notify API change. Patch by Johannes Berg
Timo Sirainen <tss@iki.fi>
parents:
3517
diff
changeset
|
128 const char *path); |
1172 | 129 void index_mailbox_check_remove_all(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
|
130 |
7291
db65d921b0e1
Check and update sync_last_check in one common function.
Timo Sirainen <tss@iki.fi>
parents:
7128
diff
changeset
|
131 bool index_mailbox_want_full_sync(struct index_mailbox *ibox, |
db65d921b0e1
Check and update sync_last_check in one common function.
Timo Sirainen <tss@iki.fi>
parents:
7128
diff
changeset
|
132 enum mailbox_sync_flags flags); |
2322
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2317
diff
changeset
|
133 struct mailbox_sync_context * |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2317
diff
changeset
|
134 index_mailbox_sync_init(struct mailbox *box, enum mailbox_sync_flags flags, |
3863
55df57c028d4
Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents:
3821
diff
changeset
|
135 bool failed); |
6279
f52e7d1402b5
mail_index_view_sync_next() and mailbox_sync_next() returns now bool.
Timo Sirainen <tss@iki.fi>
parents:
6275
diff
changeset
|
136 bool index_mailbox_sync_next(struct mailbox_sync_context *ctx, |
f52e7d1402b5
mail_index_view_sync_next() and mailbox_sync_next() returns now bool.
Timo Sirainen <tss@iki.fi>
parents:
6275
diff
changeset
|
137 struct mailbox_sync_rec *sync_rec_r); |
2322
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2317
diff
changeset
|
138 int index_mailbox_sync_deinit(struct mailbox_sync_context *ctx, |
4848
967de900c73a
Mailbox list indexing and related changes. Currently works only with
Timo Sirainen <tss@iki.fi>
parents:
4808
diff
changeset
|
139 enum mailbox_status_items status_items, |
2322
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2317
diff
changeset
|
140 struct mailbox_status *status_r); |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2317
diff
changeset
|
141 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
142 int index_storage_sync(struct mailbox *box, enum mailbox_sync_flags flags); |
7128
98788fdcc3a6
When syncing a mailbox, sync the view internally first completely and just
Timo Sirainen <tss@iki.fi>
parents:
7093
diff
changeset
|
143 enum mailbox_sync_type index_sync_type_convert(enum mail_index_sync_type type); |
6275
913b188f4dd4
Removed explicit locking from views and maps. They were already locked all
Timo Sirainen <tss@iki.fi>
parents:
6267
diff
changeset
|
144 void index_storage_get_status(struct mailbox *box, |
913b188f4dd4
Removed explicit locking from views and maps. They were already locked all
Timo Sirainen <tss@iki.fi>
parents:
6267
diff
changeset
|
145 enum mailbox_status_items items, |
913b188f4dd4
Removed explicit locking from views and maps. They were already locked all
Timo Sirainen <tss@iki.fi>
parents:
6267
diff
changeset
|
146 struct mailbox_status *status_r); |
7653
f8e902acfbae
Renamed mailbox_get_uids() to mailbox_get_seq_range().
Timo Sirainen <tss@iki.fi>
parents:
7642
diff
changeset
|
147 void index_storage_get_seq_range(struct mailbox *box, |
f8e902acfbae
Renamed mailbox_get_uids() to mailbox_get_seq_range().
Timo Sirainen <tss@iki.fi>
parents:
7642
diff
changeset
|
148 uint32_t uid1, uint32_t uid2, |
f8e902acfbae
Renamed mailbox_get_uids() to mailbox_get_seq_range().
Timo Sirainen <tss@iki.fi>
parents:
7642
diff
changeset
|
149 uint32_t *seq1_r, uint32_t *seq2_r); |
7654 | 150 void index_storage_get_uid_range(struct mailbox *box, |
151 const ARRAY_TYPE(seq_range) *seqs, | |
152 ARRAY_TYPE(seq_range) *uids); | |
7629 | 153 bool index_storage_get_expunged_uids(struct mailbox *box, uint64_t modseq, |
154 const ARRAY_TYPE(seq_range) *uids, | |
155 ARRAY_TYPE(seq_range) *expunged_uids); | |
988
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
939
diff
changeset
|
156 |
2327
7d02e2a7672d
Header caching redesigned. New design allows caching decisions per field, so
Timo Sirainen <tss@iki.fi>
parents:
2322
diff
changeset
|
157 struct mailbox_header_lookup_ctx * |
7d02e2a7672d
Header caching redesigned. New design allows caching decisions per field, so
Timo Sirainen <tss@iki.fi>
parents:
2322
diff
changeset
|
158 index_header_lookup_init(struct mailbox *box, const char *const headers[]); |
8011
2d902d1f8bea
struct mailbox_header_lookup_ctx can now be referenced/unreferenced so it
Timo Sirainen <tss@iki.fi>
parents:
7913
diff
changeset
|
159 void index_header_lookup_ref(struct mailbox_header_lookup_ctx *ctx); |
2d902d1f8bea
struct mailbox_header_lookup_ctx can now be referenced/unreferenced so it
Timo Sirainen <tss@iki.fi>
parents:
7913
diff
changeset
|
160 void index_header_lookup_unref(struct mailbox_header_lookup_ctx *ctx); |
2327
7d02e2a7672d
Header caching redesigned. New design allows caching decisions per field, so
Timo Sirainen <tss@iki.fi>
parents:
2322
diff
changeset
|
161 |
988
8028c4dcf38f
mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents:
939
diff
changeset
|
162 struct mail_search_context * |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
163 index_storage_search_init(struct mailbox_transaction_context *t, |
7642
077bb84e9e77
Make mail_search_args an independent structure that can be used for multiple
Timo Sirainen <tss@iki.fi>
parents:
7629
diff
changeset
|
164 struct mail_search_args *args, |
3209
923ff19873d4
Major mail-storage API changes. It's now a bit cleaner and much more plugin
Timo Sirainen <tss@iki.fi>
parents:
3138
diff
changeset
|
165 const enum mail_sort_type *sort_program); |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
166 int index_storage_search_deinit(struct mail_search_context *ctx); |
3209
923ff19873d4
Major mail-storage API changes. It's now a bit cleaner and much more plugin
Timo Sirainen <tss@iki.fi>
parents:
3138
diff
changeset
|
167 int index_storage_search_next(struct mail_search_context *ctx, |
923ff19873d4
Major mail-storage API changes. It's now a bit cleaner and much more plugin
Timo Sirainen <tss@iki.fi>
parents:
3138
diff
changeset
|
168 struct mail *mail); |
4939
ff2272c228cc
Dovecot is now able to execute multiple commands at the same time.
Timo Sirainen <tss@iki.fi>
parents:
4918
diff
changeset
|
169 int index_storage_search_next_nonblock(struct mail_search_context *ctx, |
ff2272c228cc
Dovecot is now able to execute multiple commands at the same time.
Timo Sirainen <tss@iki.fi>
parents:
4918
diff
changeset
|
170 struct mail *mail, bool *tryagain_r); |
8477
c033b3e2d9b6
mail_storage.search_next_update_seq returns now bool. It was never failing.
Timo Sirainen <tss@iki.fi>
parents:
8428
diff
changeset
|
171 bool index_storage_search_next_update_seq(struct mail_search_context *ctx); |
0 | 172 |
2224
a816e2d88406
Added mail_index_transaction_get_updated_view() which can be used to access
Timo Sirainen <tss@iki.fi>
parents:
2206
diff
changeset
|
173 void index_transaction_init(struct index_transaction_context *t, |
4453
85fcdb478608
Beginnings of joining mail-storage API more closely to mail-index, so that
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4451
diff
changeset
|
174 struct index_mailbox *ibox); |
85fcdb478608
Beginnings of joining mail-storage API more closely to mail-index, so that
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4451
diff
changeset
|
175 int index_transaction_finish_commit(struct index_transaction_context *t, |
85fcdb478608
Beginnings of joining mail-storage API more closely to mail-index, so that
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4451
diff
changeset
|
176 uint32_t *log_file_seq_r, |
85fcdb478608
Beginnings of joining mail-storage API more closely to mail-index, so that
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4451
diff
changeset
|
177 uoff_t *log_file_offset_r); |
85fcdb478608
Beginnings of joining mail-storage API more closely to mail-index, so that
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4451
diff
changeset
|
178 void index_transaction_finish_rollback(struct index_transaction_context *t); |
7913
e04513064165
CONDSTORE: STORE UNCHANGEDSINCE conflicts are now checked atomically.
Timo Sirainen <tss@iki.fi>
parents:
7798
diff
changeset
|
179 void index_transaction_set_max_modseq(struct mailbox_transaction_context *_t, |
e04513064165
CONDSTORE: STORE UNCHANGEDSINCE conflicts are now checked atomically.
Timo Sirainen <tss@iki.fi>
parents:
7798
diff
changeset
|
180 uint64_t max_modseq, |
e04513064165
CONDSTORE: STORE UNCHANGEDSINCE conflicts are now checked atomically.
Timo Sirainen <tss@iki.fi>
parents:
7798
diff
changeset
|
181 ARRAY_TYPE(seq_range) *seqs); |
4453
85fcdb478608
Beginnings of joining mail-storage API more closely to mail-index, so that
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4451
diff
changeset
|
182 |
85fcdb478608
Beginnings of joining mail-storage API more closely to mail-index, so that
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4451
diff
changeset
|
183 struct mailbox_transaction_context * |
85fcdb478608
Beginnings of joining mail-storage API more closely to mail-index, so that
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4451
diff
changeset
|
184 index_transaction_begin(struct mailbox *box, |
85fcdb478608
Beginnings of joining mail-storage API more closely to mail-index, so that
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4451
diff
changeset
|
185 enum mailbox_transaction_flags flags); |
85fcdb478608
Beginnings of joining mail-storage API more closely to mail-index, so that
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4451
diff
changeset
|
186 int index_transaction_commit(struct mailbox_transaction_context *t, |
6267
3a1eed408cad
mailbox_transaction_commit_get_uids() now returns also UIDVALIDITY. It's the
Timo Sirainen <tss@iki.fi>
parents:
6038
diff
changeset
|
187 uint32_t *uid_validity_r, |
5572
896845fbc4ed
Added mailbox_transaction_commit_get_uids() which returns the UID range for
Timo Sirainen <tss@iki.fi>
parents:
5570
diff
changeset
|
188 uint32_t *first_saved_uid_r, |
896845fbc4ed
Added mailbox_transaction_commit_get_uids() which returns the UID range for
Timo Sirainen <tss@iki.fi>
parents:
5570
diff
changeset
|
189 uint32_t *last_saved_uid_r); |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
1845
diff
changeset
|
190 void index_transaction_rollback(struct mailbox_transaction_context *t); |
8077
6d51328896d6
Added the concept of Global UIDs that are preserved across copies.
Timo Sirainen <tss@iki.fi>
parents:
8043
diff
changeset
|
191 void index_save_context_free(struct mail_save_context *ctx); |
1638
e95c0e462591
API change for updating message flags.
Timo Sirainen <tss@iki.fi>
parents:
1637
diff
changeset
|
192 |
4451
1a35d53c18fc
Array API redesigned to work using unions. It now provides type safety
Timo Sirainen <tss@iki.fi>
parents:
4303
diff
changeset
|
193 bool index_keyword_array_cmp(const ARRAY_TYPE(keyword_indexes) *k1, |
1a35d53c18fc
Array API redesigned to work using unions. It now provides type safety
Timo Sirainen <tss@iki.fi>
parents:
4303
diff
changeset
|
194 const ARRAY_TYPE(keyword_indexes) *k2); |
3821
c8b2ed2c9961
We assumed that keyword index arrays were always sorted. This isn't always
Timo Sirainen <tss@iki.fi>
parents:
3534
diff
changeset
|
195 |
0 | 196 #endif |