annotate src/lib-storage/index/index-storage.h @ 2322:aae574ed7f4c HEAD

Broke mailbox_sync() into iterator.
author Timo Sirainen <tss@iki.fi>
date Mon, 12 Jul 2004 14:35:50 +0300
parents 0cf316c77b1b
children 7d02e2a7672d
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"
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
6 #include "mail-index.h"
988
8028c4dcf38f mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents: 939
diff changeset
7 #include "index-mail.h"
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
8
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
9 /* Max. mmap()ed size for a message */
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
10 #define MAIL_MMAP_BLOCK_SIZE (1024*256)
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
11 /* Block size when read()ing message. */
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
12 #define MAIL_READ_BLOCK_SIZE (1024*8)
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
13
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
14 #define MAILBOX_FULL_SYNC_INTERVAL 5
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
15
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
16 enum mailbox_lock_notify_type {
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
17 MAILBOX_LOCK_NOTIFY_NONE,
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
18
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
19 /* 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
20 MAILBOX_LOCK_NOTIFY_MAILBOX_ABORT,
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
21 /* 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
22 MAILBOX_LOCK_NOTIFY_MAILBOX_OVERRIDE
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
23 };
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
24
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
25 struct index_storage {
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
26 struct mail_storage storage;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
27
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
28 char *dir; /* root directory */
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
29 char *index_dir;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
30 char *control_dir;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
31 char *inbox_path; /* INBOX location */
1987
3b1f8ed213ca maildir: don't use ".temp" prefix for temporary files, since in ~/Maildir they
Timo Sirainen <tss@iki.fi>
parents: 1978
diff changeset
32 char *temp_prefix; /* prefix for temporary files */
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
33
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
34 char *user; /* name of user accessing the storage */
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
35
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
36 struct mail_storage_callbacks *callbacks;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
37 void *callback_context;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
38 };
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
39
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
40 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
41 struct mailbox box;
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
42 struct index_storage *storage;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
43 char *path, *control_dir;
450
925d6eb5f8be MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents: 410
diff changeset
44
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
45 struct mail_index *index;
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
46 struct mail_index_view *view;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
47 struct mail_cache *cache;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
48 struct mail *mail_interface;
600
3b44bc64afd4 mailbox_check_interval setting: Dovecot can notify client of new mail in
Timo Sirainen <tss@iki.fi>
parents: 570
diff changeset
49
2131
44a6af356c45 forgot to commit
Timo Sirainen <tss@iki.fi>
parents: 2118
diff changeset
50 void (*mail_deinit)(struct index_mail *mail);
2317
0cf316c77b1b Recent flags should be fully working now with maildir.
Timo Sirainen <tss@iki.fi>
parents: 2275
diff changeset
51 int (*is_recent)(struct index_mailbox *ibox, uint32_t uid);
1947
777da553d1d3 Recent-flag should work now
Timo Sirainen <tss@iki.fi>
parents: 1915
diff changeset
52
2322
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
53 struct timeout *notify_to;
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
54 struct index_notify_file *notify_files;
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
55 struct index_notify_io *notify_ios;
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
56 time_t notify_last_check, notify_last_sent;
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
57 unsigned int min_notify_interval;
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
58 mailbox_notify_callback_t *notify_callback;
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
59 void *notify_context;
600
3b44bc64afd4 mailbox_check_interval setting: Dovecot can notify client of new mail in
Timo Sirainen <tss@iki.fi>
parents: 570
diff changeset
60
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
61 time_t next_lock_notify; /* temporary */
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
62 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
63
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
64 uint32_t commit_log_file_seq;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
65 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
66
2317
0cf316c77b1b Recent flags should be fully working now with maildir.
Timo Sirainen <tss@iki.fi>
parents: 2275
diff changeset
67 buffer_t *recent_flags;
0cf316c77b1b Recent flags should be fully working now with maildir.
Timo Sirainen <tss@iki.fi>
parents: 2275
diff changeset
68 uint32_t recent_flags_start_seq, recent_flags_count;
2322
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
69 uint32_t synced_recent_count;
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
70 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
71
1978
6303ef092c5b mbox code compiles again, but syncing is only partially implemented so
Timo Sirainen <tss@iki.fi>
parents: 1958
diff changeset
72 /* mbox: */
6303ef092c5b mbox code compiles again, but syncing is only partially implemented so
Timo Sirainen <tss@iki.fi>
parents: 1958
diff changeset
73 int mbox_fd;
6303ef092c5b mbox code compiles again, but syncing is only partially implemented so
Timo Sirainen <tss@iki.fi>
parents: 1958
diff changeset
74 struct istream *mbox_stream, *mbox_file_stream;
6303ef092c5b mbox code compiles again, but syncing is only partially implemented so
Timo Sirainen <tss@iki.fi>
parents: 1958
diff changeset
75 int mbox_lock_type;
6303ef092c5b mbox code compiles again, but syncing is only partially implemented so
Timo Sirainen <tss@iki.fi>
parents: 1958
diff changeset
76 dev_t mbox_dev;
6303ef092c5b mbox code compiles again, but syncing is only partially implemented so
Timo Sirainen <tss@iki.fi>
parents: 1958
diff changeset
77 ino_t mbox_ino;
2206
2157c6aab530 Allow dropping exclusive mbox locks to shared locks.
Timo Sirainen <tss@iki.fi>
parents: 2175
diff changeset
78 unsigned int mbox_excl_locks, mbox_shared_locks;
1978
6303ef092c5b mbox code compiles again, but syncing is only partially implemented so
Timo Sirainen <tss@iki.fi>
parents: 1958
diff changeset
79 struct dotlock mbox_dotlock;
2131
44a6af356c45 forgot to commit
Timo Sirainen <tss@iki.fi>
parents: 2118
diff changeset
80 unsigned int mbox_lock_id, mbox_mail_lock_id;
2149
b526decec0b8 EXAMINE/STATUS should also update metadata changes, they don't really open
Timo Sirainen <tss@iki.fi>
parents: 2131
diff changeset
81 int mbox_readonly;
1978
6303ef092c5b mbox code compiles again, but syncing is only partially implemented so
Timo Sirainen <tss@iki.fi>
parents: 1958
diff changeset
82
2242
5e2518377c0a Save MD5 sums of some headers for readonly mboxes and use them for syncing
Timo Sirainen <tss@iki.fi>
parents: 2225
diff changeset
83 uint32_t mbox_extra_idx, md5hdr_extra_idx;
1978
6303ef092c5b mbox code compiles again, but syncing is only partially implemented so
Timo Sirainen <tss@iki.fi>
parents: 1958
diff changeset
84
6303ef092c5b mbox code compiles again, but syncing is only partially implemented so
Timo Sirainen <tss@iki.fi>
parents: 1958
diff changeset
85 /* maildir sync: */
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
86 struct maildir_uidlist *uidlist;
1955
0f0128b4af5d More syncing changes
Timo Sirainen <tss@iki.fi>
parents: 1954
diff changeset
87 time_t last_new_mtime, last_cur_mtime, last_new_sync_time;
0f0128b4af5d More syncing changes
Timo Sirainen <tss@iki.fi>
parents: 1954
diff changeset
88 time_t dirty_cur_time;
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
89
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
90 mode_t mail_create_mode;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
91 unsigned int private_flags_mask;
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
92
1642
72c6e848f583 API changes: Don't keep variables in mailbox class.
Timo Sirainen <tss@iki.fi>
parents: 1640
diff changeset
93 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
94 unsigned int keep_recent:1;
2317
0cf316c77b1b Recent flags should be fully working now with maildir.
Timo Sirainen <tss@iki.fi>
parents: 2275
diff changeset
95 unsigned int recent_flags_synced:1;
450
925d6eb5f8be MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents: 410
diff changeset
96 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
97 unsigned int sent_readonly_flags_warning:1;
2322
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
98 unsigned int notify_pending:1;
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
99 unsigned int mail_read_mmaped:1;
2175
3e8597575e9f continuing maildir sync fix commit
Timo Sirainen <tss@iki.fi>
parents: 2149
diff changeset
100 unsigned int syncing_commit:1;
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
101 };
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
102
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
103 struct index_transaction_context {
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
104 struct mailbox_transaction_context mailbox_ctx;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
105 struct index_mailbox *ibox;
2224
a816e2d88406 Added mail_index_transaction_get_updated_view() which can be used to access
Timo Sirainen <tss@iki.fi>
parents: 2206
diff changeset
106
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
107 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
108 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
109 struct mail_cache_view *cache_view;
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
110 struct mail_cache_transaction_ctx *cache_trans;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
111
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
112 struct index_mail fetch_mail; /* for index_storage_fetch() */
2275
c68a3c9f6d73 Cache file compression works now and compressed cache file is reopened.
Timo Sirainen <tss@iki.fi>
parents: 2242
diff changeset
113 unsigned int cache_trans_failed:1;
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
114 };
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
115
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
116 int 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
117
6303ef092c5b mbox code compiles again, but syncing is only partially implemented so
Timo Sirainen <tss@iki.fi>
parents: 1958
diff changeset
118 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
119 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
120 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
121 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
122
1790
b101e678e7ac Fixes memory/fd leaking with INDEX=MEMORY.
Timo Sirainen <tss@iki.fi>
parents: 1732
diff changeset
123 struct mail_index *
2118
11febaee5e9b Save mbox offsets to index file using extra_records. Some other fixes.
Timo Sirainen <tss@iki.fi>
parents: 2062
diff changeset
124 index_storage_alloc(const char *index_dir, const char *mailbox_path,
11febaee5e9b Save mbox offsets to index file using extra_records. Some other fixes.
Timo Sirainen <tss@iki.fi>
parents: 2062
diff changeset
125 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
126 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
127 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
128
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
129 void index_storage_init(struct index_storage *storage);
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
130 void index_storage_deinit(struct index_storage *storage);
1600
993fe64a5e20 Destroy all unused indexes 10 seconds after use. Before we destroyed them
Timo Sirainen <tss@iki.fi>
parents: 1552
diff changeset
131
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
132 struct index_mailbox *
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
133 index_storage_mailbox_init(struct index_storage *storage, struct mailbox *box,
1600
993fe64a5e20 Destroy all unused indexes 10 seconds after use. Before we destroyed them
Timo Sirainen <tss@iki.fi>
parents: 1552
diff changeset
134 struct mail_index *index, const char *name,
1622
d22e03714d36 index_mmap_invalidate = yes now invalidate memory maps before accessing
Timo Sirainen <tss@iki.fi>
parents: 1600
diff changeset
135 enum mailbox_open_flags flags);
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
136 void index_storage_mailbox_free(struct mailbox *box);
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
137
1642
72c6e848f583 API changes: Don't keep variables in mailbox class.
Timo Sirainen <tss@iki.fi>
parents: 1640
diff changeset
138 int index_storage_is_readonly(struct mailbox *box);
1958
4dec6a3d79fd s/custom flags/keywords/
Timo Sirainen <tss@iki.fi>
parents: 1955
diff changeset
139 int index_storage_allow_new_keywords(struct mailbox *box);
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
140 int index_storage_is_inconsistent(struct mailbox *box);
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
141
1958
4dec6a3d79fd s/custom flags/keywords/
Timo Sirainen <tss@iki.fi>
parents: 1955
diff changeset
142 int index_mailbox_fix_keywords(struct index_mailbox *ibox,
4dec6a3d79fd s/custom flags/keywords/
Timo Sirainen <tss@iki.fi>
parents: 1955
diff changeset
143 enum mail_flags *flags,
4dec6a3d79fd s/custom flags/keywords/
Timo Sirainen <tss@iki.fi>
parents: 1955
diff changeset
144 const char *keywords[],
4dec6a3d79fd s/custom flags/keywords/
Timo Sirainen <tss@iki.fi>
parents: 1955
diff changeset
145 unsigned int keywords_count);
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
146
2317
0cf316c77b1b Recent flags should be fully working now with maildir.
Timo Sirainen <tss@iki.fi>
parents: 2275
diff changeset
147 void index_mailbox_set_recent(struct index_mailbox *ibox, uint32_t seq);
0cf316c77b1b Recent flags should be fully working now with maildir.
Timo Sirainen <tss@iki.fi>
parents: 2275
diff changeset
148 int index_mailbox_is_recent(struct index_mailbox *ibox, uint32_t seq);
0cf316c77b1b Recent flags should be fully working now with maildir.
Timo Sirainen <tss@iki.fi>
parents: 2275
diff changeset
149
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
150 unsigned int index_storage_get_recent_count(struct mail_index_view *view);
325
ba058497efa9 Send RECENT after all EXISTS replies. Check for new mail in mailbox after
Timo Sirainen <tss@iki.fi>
parents: 296
diff changeset
151
1730
8480f945e270 IDLE uses now IO_*_NOTIFY to get instant notifying of mails.
Timo Sirainen <tss@iki.fi>
parents: 1672
diff changeset
152 void index_mailbox_check_add(struct index_mailbox *ibox,
8480f945e270 IDLE uses now IO_*_NOTIFY to get instant notifying of mails.
Timo Sirainen <tss@iki.fi>
parents: 1672
diff changeset
153 const char *path, int dir);
1172
f7c273202dc3 Support for IDLE extension.
Timo Sirainen <tss@iki.fi>
parents: 1161
diff changeset
154 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
155
2322
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
156 struct mailbox_sync_context *
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
157 index_mailbox_sync_init(struct mailbox *box, enum mailbox_sync_flags flags,
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
158 int failed);
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
159 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
160 struct mailbox_sync_rec *sync_rec_r);
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
161 int index_mailbox_sync_deinit(struct mailbox_sync_context *ctx,
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
162 struct mailbox_status *status_r);
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
163
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
164 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
165
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
166 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
167 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
168 void *context);
2225
5947497c3e40 get_last_error() wasn't virtualizable
Timo Sirainen <tss@iki.fi>
parents: 2224
diff changeset
169 const char *index_storage_get_last_error(struct mail_storage *storage,
5947497c3e40 get_last_error() wasn't virtualizable
Timo Sirainen <tss@iki.fi>
parents: 2224
diff changeset
170 int *syntax_error_r);
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
171 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
172 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
173 struct mailbox_status *status);
2322
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
174 int index_storage_get_status_locked(struct index_mailbox *ibox,
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
175 enum mailbox_status_items items,
aae574ed7f4c Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents: 2317
diff changeset
176 struct mailbox_status *status_r);
988
8028c4dcf38f mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents: 939
diff changeset
177
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
178 struct mail *
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
179 index_storage_fetch(struct mailbox_transaction_context *t, uint32_t seq,
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
180 enum mail_fetch_field wanted_fields);
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
181 int index_storage_get_uids(struct mailbox *box, uint32_t uid1, uint32_t uid2,
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
182 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
183
8028c4dcf38f mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents: 939
diff changeset
184 int index_storage_search_get_sorting(struct mailbox *box,
8028c4dcf38f mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents: 939
diff changeset
185 enum mail_sort_type *sort_program);
8028c4dcf38f mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents: 939
diff changeset
186 struct mail_search_context *
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
187 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
188 const char *charset, struct mail_search_arg *args,
988
8028c4dcf38f mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents: 939
diff changeset
189 const enum mail_sort_type *sort_program,
8028c4dcf38f mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents: 939
diff changeset
190 enum mail_fetch_field wanted_fields,
8028c4dcf38f mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents: 939
diff changeset
191 const char *const wanted_headers[]);
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
192 int index_storage_search_deinit(struct mail_search_context *ctx);
988
8028c4dcf38f mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents: 939
diff changeset
193 struct mail *index_storage_search_next(struct mail_search_context *ctx);
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
194
2224
a816e2d88406 Added mail_index_transaction_get_updated_view() which can be used to access
Timo Sirainen <tss@iki.fi>
parents: 2206
diff changeset
195 void index_transaction_init(struct index_transaction_context *t,
a816e2d88406 Added mail_index_transaction_get_updated_view() which can be used to access
Timo Sirainen <tss@iki.fi>
parents: 2206
diff changeset
196 struct index_mailbox *ibox, int hide);
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
197 int index_transaction_commit(struct mailbox_transaction_context *t);
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
198 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
199
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
200 #endif