annotate src/lib-storage/index/index-storage.h @ 6275:913b188f4dd4 HEAD

Removed explicit locking from views and maps. They were already locked all the time when they were used. Because of this change several functions can no longer fail, so they were changed to return void, and a lot of pointless error handling was removed.
author Timo Sirainen <tss@iki.fi>
date Sun, 12 Aug 2007 16:43:05 +0300
parents 3a1eed408cad
children f52e7d1402b5
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
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
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
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;
4548
2eb8af6f1285 Added MAILBOX_OPEN_MBOX_ONE_MSG_ONLY flag for mailbox_open() which makes it
Timo Sirainen <tss@iki.fi>
parents: 4453
diff changeset
29 enum mailbox_open_flags open_flags;
450
925d6eb5f8be MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents: 410
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 struct mail_index *index;
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
32 struct mail_index_view *view;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
33 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
34 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
35
3279
b698ae839a18 Moved mbox/maildir-specific variables from struct index_mailbox to
Timo Sirainen <tss@iki.fi>
parents: 3260
diff changeset
36 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
37
2322
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
38 struct timeout *notify_to;
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
39 struct index_notify_file *notify_files;
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
40 struct index_notify_io *notify_ios;
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
41 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
42
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
43 time_t next_lock_notify; /* temporary */
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
44 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
45
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
46 uint32_t commit_log_file_seq;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
47 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
48
4451
1a35d53c18fc Array API redesigned to work using unions. It now provides type safety
Timo Sirainen <tss@iki.fi>
parents: 4303
diff changeset
49 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
50 struct mail_cache_field *cache_fields;
3909
411f20e72a8f Added mail_cache_min_mail_count setting.
Timo Sirainen <tss@iki.fi>
parents: 3863
diff changeset
51 unsigned int mail_cache_min_mail_count;
411f20e72a8f Added mail_cache_min_mail_count setting.
Timo Sirainen <tss@iki.fi>
parents: 3863
diff changeset
52
6037
d911d943438e Recent flag handling rewrite. Still not perfect with maildir.
Timo Sirainen <tss@iki.fi>
parents: 5708
diff changeset
53 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
54 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
55 uint32_t recent_flags_count;
3909
411f20e72a8f Added mail_cache_min_mail_count setting.
Timo Sirainen <tss@iki.fi>
parents: 3863
diff changeset
56
2322
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
57 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
58
1642
72c6e848f583 API changes: Don't keep variables in mailbox class.
Timo Sirainen <tss@iki.fi>
parents: 1640
diff changeset
59 unsigned int readonly:1;
2039
f0925b2271e1 Added pop3_mails_keep_recent option. Fixed recent assert crash.
Timo Sirainen <tss@iki.fi>
parents: 1987
diff changeset
60 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
61 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
62 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
63 unsigned int sent_readonly_flags_warning:1;
2322
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
64 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
65 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
66 unsigned int fsync_disable:1;
5708
7420a96ebc8f If new/ directory is lost when syncing, assume the mailbox was deleted and
Timo Sirainen <tss@iki.fi>
parents: 5618
diff changeset
67 unsigned int mailbox_deleted:1;
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
68 };
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
69
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
70 struct index_transaction_context {
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
71 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
72 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
73
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
74 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
75 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
76 enum mailbox_sync_flags commit_flags;
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
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
78 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
79 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
80 struct mail_cache_view *cache_view;
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
81 struct mail_cache_transaction_ctx *cache_trans;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
82
6267
3a1eed408cad mailbox_transaction_commit_get_uids() now returns also UIDVALIDITY. It's the
Timo Sirainen <tss@iki.fi>
parents: 6038
diff changeset
83 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
84 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
85
2275
c68a3c9f6d73 Cache file compression works now and compressed cache file is reopened.
Timo Sirainen <tss@iki.fi>
parents: 2242
diff changeset
86 unsigned int cache_trans_failed:1;
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
87 };
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
88
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
89 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
90
6303ef092c5b mbox code compiles again, but syncing is only partially implemented so
Timo Sirainen <tss@iki.fi>
parents: 1958
diff changeset
91 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
92 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
93 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
94 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
95
1790
b101e678e7ac Fixes memory/fd leaking with INDEX=MEMORY.
Timo Sirainen <tss@iki.fi>
parents: 1732
diff changeset
96 struct mail_index *
5618
5ea33dbddbae Moved index directory creation code to index_storage_alloc().
Timo Sirainen <tss@iki.fi>
parents: 5573
diff changeset
97 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
98 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
99 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
100 void index_storage_destroy_unrefed(void);
450
925d6eb5f8be MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents: 410
diff changeset
101
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
102 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
103 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
104 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
105 void index_storage_mailbox_open(struct index_mailbox *ibox);
5466
8141168f86e1 cleaned up mailbox closing code
Timo Sirainen <tss@iki.fi>
parents: 5465
diff changeset
106 int index_storage_mailbox_close(struct mailbox *box);
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
107
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
108 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
109 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
110 bool index_storage_is_inconsistent(struct mailbox *box);
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
111
3016
61c8d205d887 Initial support for keywords. Syncing to mbox/maildir doesn't work yet.
Timo Sirainen <tss@iki.fi>
parents: 2987
diff changeset
112 struct mail_keywords *
61c8d205d887 Initial support for keywords. Syncing to mbox/maildir doesn't work yet.
Timo Sirainen <tss@iki.fi>
parents: 2987
diff changeset
113 index_keywords_create(struct mailbox_transaction_context *t,
61c8d205d887 Initial support for keywords. Syncing to mbox/maildir doesn't work yet.
Timo Sirainen <tss@iki.fi>
parents: 2987
diff changeset
114 const char *const keywords[]);
3138
fbe844061fe2 Internal changes in how keywords are handled. struct mail_keywords isn't
Timo Sirainen <tss@iki.fi>
parents: 3106
diff changeset
115 void index_keywords_free(struct mailbox_transaction_context *t,
fbe844061fe2 Internal changes in how keywords are handled. struct mail_keywords isn't
Timo Sirainen <tss@iki.fi>
parents: 3106
diff changeset
116 struct mail_keywords *keywords);
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
117
6037
d911d943438e Recent flag handling rewrite. Still not perfect with maildir.
Timo Sirainen <tss@iki.fi>
parents: 5708
diff changeset
118 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
119 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
120 struct mail_index_view *view,
d911d943438e Recent flag handling rewrite. Still not perfect with maildir.
Timo Sirainen <tss@iki.fi>
parents: 5708
diff changeset
121 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
122 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
123 unsigned int index_mailbox_get_recent_count(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
124
1730
8480f945e270 IDLE uses now IO_*_NOTIFY to get instant notifying of mails.
Timo Sirainen <tss@iki.fi>
parents: 1672
diff changeset
125 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
126 const char *path);
1172
f7c273202dc3 Support for IDLE extension.
Timo Sirainen <tss@iki.fi>
parents: 1161
diff changeset
127 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
128
2322
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
129 struct mailbox_sync_context *
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
130 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
131 bool failed);
2322
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
132 int index_mailbox_sync_next(struct mailbox_sync_context *ctx,
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
133 struct mailbox_sync_rec *sync_rec_r);
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
134 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
135 enum mailbox_status_items status_items,
2322
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
136 struct mailbox_status *status_r);
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
137
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
138 int index_storage_sync(struct mailbox *box, enum mailbox_sync_flags flags);
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
139
6275
913b188f4dd4 Removed explicit locking from views and maps. They were already locked all
Timo Sirainen <tss@iki.fi>
parents: 6267
diff changeset
140 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
141 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
142 struct mailbox_status *status_r);
913b188f4dd4 Removed explicit locking from views and maps. They were already locked all
Timo Sirainen <tss@iki.fi>
parents: 6267
diff changeset
143 void index_storage_get_uids(struct mailbox *box, uint32_t uid1, uint32_t uid2,
913b188f4dd4 Removed explicit locking from views and maps. They were already locked all
Timo Sirainen <tss@iki.fi>
parents: 6267
diff changeset
144 uint32_t *seq1_r, uint32_t *seq2_r);
988
8028c4dcf38f mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents: 939
diff changeset
145
2327
7d02e2a7672d Header caching redesigned. New design allows caching decisions per field, so
Timo Sirainen <tss@iki.fi>
parents: 2322
diff changeset
146 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
147 index_header_lookup_init(struct mailbox *box, const char *const headers[]);
7d02e2a7672d Header caching redesigned. New design allows caching decisions per field, so
Timo Sirainen <tss@iki.fi>
parents: 2322
diff changeset
148 void index_header_lookup_deinit(struct mailbox_header_lookup_ctx *ctx);
7d02e2a7672d Header caching redesigned. New design allows caching decisions per field, so
Timo Sirainen <tss@iki.fi>
parents: 2322
diff changeset
149
988
8028c4dcf38f mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents: 939
diff changeset
150 struct mail_search_context *
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
151 index_storage_search_init(struct mailbox_transaction_context *t,
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
152 const char *charset, struct mail_search_arg *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
153 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
154 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
155 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
156 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
157 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
158 struct mail *mail, bool *tryagain_r);
4196
6ac0d63b297f Optimized searching a bit for cases where we can restrict search range by
Timo Sirainen <tss@iki.fi>
parents: 4152
diff changeset
159 int index_storage_search_next_update_seq(struct mail_search_context *ctx);
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
160
2224
a816e2d88406 Added mail_index_transaction_get_updated_view() which can be used to access
Timo Sirainen <tss@iki.fi>
parents: 2206
diff changeset
161 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
162 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
163 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
164 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
165 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
166 void index_transaction_finish_rollback(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
167
85fcdb478608 Beginnings of joining mail-storage API more closely to mail-index, so that
Timo Sirainen <timo.sirainen@movial.fi>
parents: 4451
diff changeset
168 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
169 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
170 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
171 int index_transaction_commit(struct mailbox_transaction_context *t,
5572
896845fbc4ed Added mailbox_transaction_commit_get_uids() which returns the UID range for
Timo Sirainen <tss@iki.fi>
parents: 5570
diff changeset
172 enum mailbox_sync_flags flags,
6267
3a1eed408cad mailbox_transaction_commit_get_uids() now returns also UIDVALIDITY. It's the
Timo Sirainen <tss@iki.fi>
parents: 6038
diff changeset
173 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
174 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
175 uint32_t *last_saved_uid_r);
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
176 void index_transaction_rollback(struct mailbox_transaction_context *t);
1638
e95c0e462591 API change for updating message flags.
Timo Sirainen <tss@iki.fi>
parents: 1637
diff changeset
177
4451
1a35d53c18fc Array API redesigned to work using unions. It now provides type safety
Timo Sirainen <tss@iki.fi>
parents: 4303
diff changeset
178 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
179 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
180
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
181 #endif