annotate src/lib-storage/index/index-storage.h @ 2206:2157c6aab530 HEAD

Allow dropping exclusive mbox locks to shared locks.
author Timo Sirainen <tss@iki.fi>
date Sun, 20 Jun 2004 14:17:53 +0300
parents 3e8597575e9f
children a816e2d88406
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
1172
f7c273202dc3 Support for IDLE extension.
Timo Sirainen <tss@iki.fi>
parents: 1161
diff changeset
25 struct index_autosync_file {
f7c273202dc3 Support for IDLE extension.
Timo Sirainen <tss@iki.fi>
parents: 1161
diff changeset
26 struct index_autosync_file *next;
f7c273202dc3 Support for IDLE extension.
Timo Sirainen <tss@iki.fi>
parents: 1161
diff changeset
27
f7c273202dc3 Support for IDLE extension.
Timo Sirainen <tss@iki.fi>
parents: 1161
diff changeset
28 char *path;
f7c273202dc3 Support for IDLE extension.
Timo Sirainen <tss@iki.fi>
parents: 1161
diff changeset
29 time_t last_stamp;
f7c273202dc3 Support for IDLE extension.
Timo Sirainen <tss@iki.fi>
parents: 1161
diff changeset
30 };
f7c273202dc3 Support for IDLE extension.
Timo Sirainen <tss@iki.fi>
parents: 1161
diff changeset
31
1730
8480f945e270 IDLE uses now IO_*_NOTIFY to get instant notifying of mails.
Timo Sirainen <tss@iki.fi>
parents: 1672
diff changeset
32 struct index_autosync_io {
8480f945e270 IDLE uses now IO_*_NOTIFY to get instant notifying of mails.
Timo Sirainen <tss@iki.fi>
parents: 1672
diff changeset
33 struct index_autosync_io *next;
8480f945e270 IDLE uses now IO_*_NOTIFY to get instant notifying of mails.
Timo Sirainen <tss@iki.fi>
parents: 1672
diff changeset
34 struct io *io;
8480f945e270 IDLE uses now IO_*_NOTIFY to get instant notifying of mails.
Timo Sirainen <tss@iki.fi>
parents: 1672
diff changeset
35 int fd;
8480f945e270 IDLE uses now IO_*_NOTIFY to get instant notifying of mails.
Timo Sirainen <tss@iki.fi>
parents: 1672
diff changeset
36 };
8480f945e270 IDLE uses now IO_*_NOTIFY to get instant notifying of mails.
Timo Sirainen <tss@iki.fi>
parents: 1672
diff changeset
37
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
38 struct index_storage {
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
39 struct mail_storage storage;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
40
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
41 char *dir; /* root directory */
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
42 char *index_dir;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
43 char *control_dir;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
44 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
45 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
46
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
47 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
48
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
49 struct mail_storage_callbacks *callbacks;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
50 void *callback_context;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
51 };
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
52
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
53 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
54 struct mailbox box;
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
55 struct index_storage *storage;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
56 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
57
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
58 struct mail_index *index;
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
59 struct mail_index_view *view;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
60 struct mail_cache *cache;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
61 struct mail_cache_view *cache_view;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
62 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
63
1947
777da553d1d3 Recent-flag should work now
Timo Sirainen <tss@iki.fi>
parents: 1915
diff changeset
64 uint32_t (*get_recent_count)(struct index_mailbox *ibox);
2131
44a6af356c45 forgot to commit
Timo Sirainen <tss@iki.fi>
parents: 2118
diff changeset
65 void (*mail_deinit)(struct index_mail *mail);
2062
397ce1dbc593 Send recent counter changes when it actually changes.
Timo Sirainen <tss@iki.fi>
parents: 2039
diff changeset
66 unsigned int last_recent_count;
1947
777da553d1d3 Recent-flag should work now
Timo Sirainen <tss@iki.fi>
parents: 1915
diff changeset
67
1172
f7c273202dc3 Support for IDLE extension.
Timo Sirainen <tss@iki.fi>
parents: 1161
diff changeset
68 struct timeout *autosync_to;
1730
8480f945e270 IDLE uses now IO_*_NOTIFY to get instant notifying of mails.
Timo Sirainen <tss@iki.fi>
parents: 1672
diff changeset
69 struct index_autosync_file *autosync_files;
8480f945e270 IDLE uses now IO_*_NOTIFY to get instant notifying of mails.
Timo Sirainen <tss@iki.fi>
parents: 1672
diff changeset
70 struct index_autosync_io *autosync_ios;
8480f945e270 IDLE uses now IO_*_NOTIFY to get instant notifying of mails.
Timo Sirainen <tss@iki.fi>
parents: 1672
diff changeset
71 enum mailbox_sync_flags autosync_flags;
1732
9f89edcfc043 IDLE fixes..
Timo Sirainen <tss@iki.fi>
parents: 1730
diff changeset
72 time_t sync_last_check, sync_last_notify;
1172
f7c273202dc3 Support for IDLE extension.
Timo Sirainen <tss@iki.fi>
parents: 1161
diff changeset
73 unsigned int min_newmail_notify_interval;
600
3b44bc64afd4 mailbox_check_interval setting: Dovecot can notify client of new mail in
Timo Sirainen <tss@iki.fi>
parents: 570
diff changeset
74
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
75 time_t next_lock_notify; /* temporary */
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
76 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
77
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
78 uint32_t commit_log_file_seq;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
79 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
80
1978
6303ef092c5b mbox code compiles again, but syncing is only partially implemented so
Timo Sirainen <tss@iki.fi>
parents: 1958
diff changeset
81 /* mbox: */
6303ef092c5b mbox code compiles again, but syncing is only partially implemented so
Timo Sirainen <tss@iki.fi>
parents: 1958
diff changeset
82 int mbox_fd;
6303ef092c5b mbox code compiles again, but syncing is only partially implemented so
Timo Sirainen <tss@iki.fi>
parents: 1958
diff changeset
83 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
84 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
85 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
86 ino_t mbox_ino;
2206
2157c6aab530 Allow dropping exclusive mbox locks to shared locks.
Timo Sirainen <tss@iki.fi>
parents: 2175
diff changeset
87 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
88 struct dotlock mbox_dotlock;
2131
44a6af356c45 forgot to commit
Timo Sirainen <tss@iki.fi>
parents: 2118
diff changeset
89 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
90 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
91
2118
11febaee5e9b Save mbox offsets to index file using extra_records. Some other fixes.
Timo Sirainen <tss@iki.fi>
parents: 2062
diff changeset
92 uint32_t mbox_extra_idx;
1978
6303ef092c5b mbox code compiles again, but syncing is only partially implemented so
Timo Sirainen <tss@iki.fi>
parents: 1958
diff changeset
93
6303ef092c5b mbox code compiles again, but syncing is only partially implemented so
Timo Sirainen <tss@iki.fi>
parents: 1958
diff changeset
94 /* maildir sync: */
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
95 struct maildir_uidlist *uidlist;
1955
0f0128b4af5d More syncing changes
Timo Sirainen <tss@iki.fi>
parents: 1954
diff changeset
96 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
97 time_t dirty_cur_time;
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
98
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
99 mode_t mail_create_mode;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
100 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
101
1642
72c6e848f583 API changes: Don't keep variables in mailbox class.
Timo Sirainen <tss@iki.fi>
parents: 1640
diff changeset
102 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
103 unsigned int keep_recent:1;
450
925d6eb5f8be MailStorage interface change. We now let storage call several sync-functions
Timo Sirainen <tss@iki.fi>
parents: 410
diff changeset
104 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
105 unsigned int sent_readonly_flags_warning:1;
1730
8480f945e270 IDLE uses now IO_*_NOTIFY to get instant notifying of mails.
Timo Sirainen <tss@iki.fi>
parents: 1672
diff changeset
106 unsigned int autosync_pending:1;
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
107 unsigned int mail_read_mmaped:1;
2062
397ce1dbc593 Send recent counter changes when it actually changes.
Timo Sirainen <tss@iki.fi>
parents: 2039
diff changeset
108 unsigned int last_recent_count_initialized:1;
2175
3e8597575e9f continuing maildir sync fix commit
Timo Sirainen <tss@iki.fi>
parents: 2149
diff changeset
109 unsigned int syncing_commit:1;
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
110 };
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_transaction_context {
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
113 struct mailbox_transaction_context mailbox_ctx;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
114 struct index_mailbox *ibox;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
115 struct mail_index_transaction *trans;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
116 struct mail_cache_transaction_ctx *cache_trans;
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
117
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
118 struct index_mail fetch_mail; /* for index_storage_fetch() */
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
119 };
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
120
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
121 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
122
6303ef092c5b mbox code compiles again, but syncing is only partially implemented so
Timo Sirainen <tss@iki.fi>
parents: 1958
diff changeset
123 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
124 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
125 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
126 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
127
1790
b101e678e7ac Fixes memory/fd leaking with INDEX=MEMORY.
Timo Sirainen <tss@iki.fi>
parents: 1732
diff changeset
128 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
129 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
130 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
131 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
132 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
133
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
134 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
135 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
136
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
137 struct index_mailbox *
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
138 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
139 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
140 enum mailbox_open_flags flags);
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
141 void index_storage_mailbox_free(struct mailbox *box);
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
142
1642
72c6e848f583 API changes: Don't keep variables in mailbox class.
Timo Sirainen <tss@iki.fi>
parents: 1640
diff changeset
143 int index_storage_is_readonly(struct mailbox *box);
1958
4dec6a3d79fd s/custom flags/keywords/
Timo Sirainen <tss@iki.fi>
parents: 1955
diff changeset
144 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
145 int index_storage_is_inconsistent(struct mailbox *box);
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
146
1958
4dec6a3d79fd s/custom flags/keywords/
Timo Sirainen <tss@iki.fi>
parents: 1955
diff changeset
147 int index_mailbox_fix_keywords(struct index_mailbox *ibox,
4dec6a3d79fd s/custom flags/keywords/
Timo Sirainen <tss@iki.fi>
parents: 1955
diff changeset
148 enum mail_flags *flags,
4dec6a3d79fd s/custom flags/keywords/
Timo Sirainen <tss@iki.fi>
parents: 1955
diff changeset
149 const char *keywords[],
4dec6a3d79fd s/custom flags/keywords/
Timo Sirainen <tss@iki.fi>
parents: 1955
diff changeset
150 unsigned int keywords_count);
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
151
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
152 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
153
1730
8480f945e270 IDLE uses now IO_*_NOTIFY to get instant notifying of mails.
Timo Sirainen <tss@iki.fi>
parents: 1672
diff changeset
154 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
155 const char *path, int dir);
1172
f7c273202dc3 Support for IDLE extension.
Timo Sirainen <tss@iki.fi>
parents: 1161
diff changeset
156 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
157
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
158 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
159
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
160 /* mailbox methods: */
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
161 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
162 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
163 void *context);
903
fd8888f6f037 Naming style changes, finally got tired of most of the typedefs. Also the
Timo Sirainen <tss@iki.fi>
parents: 764
diff changeset
164 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
165 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
166 struct mailbox_status *status);
988
8028c4dcf38f mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents: 939
diff changeset
167
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
168 struct mail *
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
169 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
170 enum mail_fetch_field wanted_fields);
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
171 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
172 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
173
8028c4dcf38f mail-storage.h interface changes, affects pretty much everything.
Timo Sirainen <tss@iki.fi>
parents: 939
diff changeset
174 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
175 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
176 struct mail_search_context *
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
177 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
178 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
179 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
180 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
181 const char *const wanted_headers[]);
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
182 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
183 struct mail *index_storage_search_next(struct mail_search_context *ctx);
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
184
1915
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
185 struct mailbox_transaction_context *
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
186 index_transaction_begin(struct mailbox *box);
79790750c349 importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents: 1845
diff changeset
187 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
188 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
189
0
3b1985cbc908 Initial revision
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
190 #endif