Mercurial > dovecot > core-2.2
annotate src/lib-storage/mail-storage-private.h @ 5461:08b42ced91a6 HEAD
Removed mail_storage_create_with_data(). mail_storage_create() with
driver=NULL behaves the same way. Removed parameters from
mail_storage.create(), they're now put into the storage structure before
calling create().
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 30 Mar 2007 16:40:12 +0300 |
parents | 105e0cd21036 |
children | 163b48489bc6 |
rev | line source |
---|---|
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
1 #ifndef __MAIL_STORAGE_PRIVATE_H |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
2 #define __MAIL_STORAGE_PRIVATE_H |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
3 |
5450
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
4 #include "module-context.h" |
4876
f1d77064884c
Lock handling changes. Everything goes through file-lock API now and there's
Timo Sirainen <tss@iki.fi>
parents:
4853
diff
changeset
|
5 #include "file-lock.h" |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
6 #include "mail-storage.h" |
5450
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
7 #include "mail-index-private.h" |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
8 |
4848
967de900c73a
Mailbox list indexing and related changes. Currently works only with
Timo Sirainen <tss@iki.fi>
parents:
4822
diff
changeset
|
9 /* Called after mail storage has been created */ |
967de900c73a
Mailbox list indexing and related changes. Currently works only with
Timo Sirainen <tss@iki.fi>
parents:
4822
diff
changeset
|
10 extern void (*hook_mail_storage_created)(struct mail_storage *storage); |
4489
3d2be769d887
Added hook_mailbox_opened to make it easier to hook all mailbox opens.
Timo Sirainen <tss@iki.fi>
parents:
4455
diff
changeset
|
11 /* Called after mailbox has been opened */ |
3d2be769d887
Added hook_mailbox_opened to make it easier to hook all mailbox opens.
Timo Sirainen <tss@iki.fi>
parents:
4455
diff
changeset
|
12 extern void (*hook_mailbox_opened)(struct mailbox *box); |
3d2be769d887
Added hook_mailbox_opened to make it easier to hook all mailbox opens.
Timo Sirainen <tss@iki.fi>
parents:
4455
diff
changeset
|
13 |
5450
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
14 struct mail_storage_module_register { |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
15 unsigned int id; |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
16 }; |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
17 |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
18 struct mail_module_register { |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
19 unsigned int id; |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
20 }; |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
21 |
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
|
22 struct mail_storage_vfuncs { |
85fcdb478608
Beginnings of joining mail-storage API more closely to mail-index, so that
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4451
diff
changeset
|
23 void (*class_init)(void); |
85fcdb478608
Beginnings of joining mail-storage API more closely to mail-index, so that
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4451
diff
changeset
|
24 void (*class_deinit)(void); |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
25 |
5460
105e0cd21036
Added virtual mail_storage.alloc() function and changed create() to work
Timo Sirainen <tss@iki.fi>
parents:
5459
diff
changeset
|
26 struct mail_storage *(*alloc)(void); |
5461
08b42ced91a6
Removed mail_storage_create_with_data(). mail_storage_create() with
Timo Sirainen <tss@iki.fi>
parents:
5460
diff
changeset
|
27 int (*create)(struct mail_storage *storage, const char *data); |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
28 void (*destroy)(struct mail_storage *storage); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
29 |
3863
55df57c028d4
Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents:
3735
diff
changeset
|
30 bool (*autodetect)(const char *data, enum mail_storage_flags flags); |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
31 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
32 void (*set_callbacks)(struct mail_storage *storage, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
33 struct mail_storage_callbacks *callbacks, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
34 void *context); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
35 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
36 struct mailbox *(*mailbox_open)(struct mail_storage *storage, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
37 const char *name, |
3245
6491dab63e54
Added input stream parameter to mailbox_open(). With mbox it now allows
Timo Sirainen <tss@iki.fi>
parents:
3209
diff
changeset
|
38 struct istream *input, |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
39 enum mailbox_open_flags flags); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
40 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
41 int (*mailbox_create)(struct mail_storage *storage, const char *name, |
3863
55df57c028d4
Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents:
3735
diff
changeset
|
42 bool directory); |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
43 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
44 const char *(*get_last_error)(struct mail_storage *storage, |
3863
55df57c028d4
Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents:
3735
diff
changeset
|
45 bool *syntax_error_r, |
55df57c028d4
Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents:
3735
diff
changeset
|
46 bool *temporary_error_r); |
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
|
47 }; |
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
|
48 |
5450
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
49 union mail_storage_module_context { |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
50 struct mail_storage_vfuncs super; |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
51 struct mail_storage_module_register *reg; |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
52 }; |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
53 |
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
|
54 struct mail_storage { |
4822 | 55 const char *name; |
4808
93bc9770f938
Initial code for separation of mailbox accessing and directory layout
Timo Sirainen <tss@iki.fi>
parents:
4607
diff
changeset
|
56 bool mailbox_is_file; |
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
|
57 |
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
|
58 struct mail_storage_vfuncs v; |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
59 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
60 /* private: */ |
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
|
61 pool_t pool; |
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
|
62 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
63 char *error; |
4808
93bc9770f938
Initial code for separation of mailbox accessing and directory layout
Timo Sirainen <tss@iki.fi>
parents:
4607
diff
changeset
|
64 struct mailbox_list *list; |
5459
78eaf595359c
Removed struct index_storage abstraction. It's pointless.
Timo Sirainen <tss@iki.fi>
parents:
5450
diff
changeset
|
65 |
78eaf595359c
Removed struct index_storage abstraction. It's pointless.
Timo Sirainen <tss@iki.fi>
parents:
5450
diff
changeset
|
66 const char *user; /* name of user accessing the storage */ |
3033
146897976cfa
Added mail_debug setting. Moved full_filesystem_access from global variable
Timo Sirainen <tss@iki.fi>
parents:
3016
diff
changeset
|
67 enum mail_storage_flags flags; |
4876
f1d77064884c
Lock handling changes. Everything goes through file-lock API now and there's
Timo Sirainen <tss@iki.fi>
parents:
4853
diff
changeset
|
68 enum file_lock_method lock_method; |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
69 |
4949
a959d4208b54
Moved storage callbacks to struct mail_storage. If searching takes over 10
Timo Sirainen <tss@iki.fi>
parents:
4939
diff
changeset
|
70 struct mail_storage_callbacks *callbacks; |
a959d4208b54
Moved storage callbacks to struct mail_storage. If searching takes over 10
Timo Sirainen <tss@iki.fi>
parents:
4939
diff
changeset
|
71 void *callback_context; |
a959d4208b54
Moved storage callbacks to struct mail_storage. If searching takes over 10
Timo Sirainen <tss@iki.fi>
parents:
4939
diff
changeset
|
72 |
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
|
73 /* Module-specific contexts. See mail_storage_module_id. */ |
5450
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
74 ARRAY_DEFINE(module_contexts, union mail_storage_module_context *); |
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
|
75 |
3517
46bfbbcc3c54
Added separate "temporary error" flag for mail_storage_get_last_error().
Timo Sirainen <tss@iki.fi>
parents:
3260
diff
changeset
|
76 /* IMAP: Give a BAD reply instead of NO */ |
46bfbbcc3c54
Added separate "temporary error" flag for mail_storage_get_last_error().
Timo Sirainen <tss@iki.fi>
parents:
3260
diff
changeset
|
77 unsigned int syntax_error:1; |
46bfbbcc3c54
Added separate "temporary error" flag for mail_storage_get_last_error().
Timo Sirainen <tss@iki.fi>
parents:
3260
diff
changeset
|
78 /* Internal temporary error, as opposed to visible user errors like |
46bfbbcc3c54
Added separate "temporary error" flag for mail_storage_get_last_error().
Timo Sirainen <tss@iki.fi>
parents:
3260
diff
changeset
|
79 "permission denied" or "out of disk space" */ |
46bfbbcc3c54
Added separate "temporary error" flag for mail_storage_get_last_error().
Timo Sirainen <tss@iki.fi>
parents:
3260
diff
changeset
|
80 unsigned int temporary_error:1; |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
81 }; |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
82 |
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
|
83 struct mailbox_vfuncs { |
3863
55df57c028d4
Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents:
3735
diff
changeset
|
84 bool (*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:
3735
diff
changeset
|
85 bool (*allow_new_keywords)(struct mailbox *box); |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
86 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
87 int (*close)(struct mailbox *box); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
88 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
89 int (*get_status)(struct mailbox *box, enum mailbox_status_items items, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
90 struct mailbox_status *status); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
91 |
2322
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2225
diff
changeset
|
92 struct mailbox_sync_context * |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2225
diff
changeset
|
93 (*sync_init)(struct mailbox *box, |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2225
diff
changeset
|
94 enum mailbox_sync_flags flags); |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2225
diff
changeset
|
95 int (*sync_next)(struct mailbox_sync_context *ctx, |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2225
diff
changeset
|
96 struct mailbox_sync_rec *sync_rec_r); |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2225
diff
changeset
|
97 int (*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:
4822
diff
changeset
|
98 enum mailbox_status_items status_items, |
2322
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2225
diff
changeset
|
99 struct mailbox_status *status_r); |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2225
diff
changeset
|
100 |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2225
diff
changeset
|
101 void (*notify_changes)(struct mailbox *box, unsigned int min_interval, |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2225
diff
changeset
|
102 mailbox_notify_callback_t *callback, |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2225
diff
changeset
|
103 void *context); |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
104 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
105 struct mailbox_transaction_context * |
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
|
106 (*transaction_begin)(struct mailbox *box, |
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
|
107 enum mailbox_transaction_flags flags); |
2518
f8be7a5e273a
Added sync flags parameter to mailbox_transaction_commit(), so EXPUNGE can
Timo Sirainen <tss@iki.fi>
parents:
2446
diff
changeset
|
108 int (*transaction_commit)(struct mailbox_transaction_context *t, |
f8be7a5e273a
Added sync flags parameter to mailbox_transaction_commit(), so EXPUNGE can
Timo Sirainen <tss@iki.fi>
parents:
2446
diff
changeset
|
109 enum mailbox_sync_flags flags); |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
110 void (*transaction_rollback)(struct mailbox_transaction_context *t); |
79790750c349
importing new index code. mbox still broken.
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:
2518
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:
2518
diff
changeset
|
113 (*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:
2518
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:
3086
diff
changeset
|
115 void (*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:
3086
diff
changeset
|
116 struct mail_keywords *keywords); |
3016
61c8d205d887
Initial support for keywords. Syncing to mbox/maildir doesn't work yet.
Timo Sirainen <tss@iki.fi>
parents:
2518
diff
changeset
|
117 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
118 int (*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:
diff
changeset
|
119 uint32_t *seq1_r, uint32_t *seq2_r); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
120 |
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
|
121 struct mail * |
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
|
122 (*mail_alloc)(struct mailbox_transaction_context *t, |
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
|
123 enum mail_fetch_field wanted_fields, |
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
|
124 struct mailbox_header_lookup_ctx *wanted_headers); |
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
|
125 |
2327
7d02e2a7672d
Header caching redesigned. New design allows caching decisions per field, so
Timo Sirainen <tss@iki.fi>
parents:
2322
diff
changeset
|
126 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
|
127 (*header_lookup_init)(struct mailbox *box, |
7d02e2a7672d
Header caching redesigned. New design allows caching decisions per field, so
Timo Sirainen <tss@iki.fi>
parents:
2322
diff
changeset
|
128 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
|
129 void (*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
|
130 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
131 struct mail_search_context * |
2327
7d02e2a7672d
Header caching redesigned. New design allows caching decisions per field, so
Timo Sirainen <tss@iki.fi>
parents:
2322
diff
changeset
|
132 (*search_init)(struct mailbox_transaction_context *t, |
7d02e2a7672d
Header caching redesigned. New design allows caching decisions per field, so
Timo Sirainen <tss@iki.fi>
parents:
2322
diff
changeset
|
133 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
|
134 const enum mail_sort_type *sort_program); |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
135 int (*search_deinit)(struct mail_search_context *ctx); |
4939
ff2272c228cc
Dovecot is now able to execute multiple commands at the same time.
Timo Sirainen <tss@iki.fi>
parents:
4876
diff
changeset
|
136 int (*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:
4876
diff
changeset
|
137 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:
4076
diff
changeset
|
138 /* Internal search function which updates ctx->seq */ |
6ac0d63b297f
Optimized searching a bit for cases where we can restrict search range by
Timo Sirainen <tss@iki.fi>
parents:
4076
diff
changeset
|
139 int (*search_next_update_seq)(struct mail_search_context *ctx); |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
140 |
4044
da1d65e064f8
mailbox_save_init() supports now returning failure. Quota plugin now checks
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4041
diff
changeset
|
141 int (*save_init)(struct mailbox_transaction_context *t, |
da1d65e064f8
mailbox_save_init() supports now returning failure. Quota plugin now checks
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4041
diff
changeset
|
142 enum mail_flags flags, |
da1d65e064f8
mailbox_save_init() supports now returning failure. Quota plugin now checks
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4041
diff
changeset
|
143 struct mail_keywords *keywords, |
da1d65e064f8
mailbox_save_init() supports now returning failure. Quota plugin now checks
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4041
diff
changeset
|
144 time_t received_date, int timezone_offset, |
da1d65e064f8
mailbox_save_init() supports now returning failure. Quota plugin now checks
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4041
diff
changeset
|
145 const char *from_envelope, struct istream *input, |
4268
7112aad504ae
Changed mailbox_save_*() API a bit: Moved the struct mail *dest_mail to
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4196
diff
changeset
|
146 struct mail *dest_mail, |
7112aad504ae
Changed mailbox_save_*() API a bit: Moved the struct mail *dest_mail to
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4196
diff
changeset
|
147 struct mail_save_context **ctx_r); |
2446
47e1e05cede0
Changed mail saving API to be nonblocking.
Timo Sirainen <tss@iki.fi>
parents:
2350
diff
changeset
|
148 int (*save_continue)(struct mail_save_context *ctx); |
4268
7112aad504ae
Changed mailbox_save_*() API a bit: Moved the struct mail *dest_mail to
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4196
diff
changeset
|
149 int (*save_finish)(struct mail_save_context *ctx); |
2446
47e1e05cede0
Changed mail saving API to be nonblocking.
Timo Sirainen <tss@iki.fi>
parents:
2350
diff
changeset
|
150 void (*save_cancel)(struct mail_save_context *ctx); |
47e1e05cede0
Changed mail saving API to be nonblocking.
Timo Sirainen <tss@iki.fi>
parents:
2350
diff
changeset
|
151 |
2190
755ec9442a58
mailbox_save() and mailbox_copy() functions can now return the saved mail so
Timo Sirainen <tss@iki.fi>
parents:
1958
diff
changeset
|
152 int (*copy)(struct mailbox_transaction_context *t, struct mail *mail, |
3641
3de464cb604f
Added flags and keywords parameters to mailbox_copy() in case they're wanted
Timo Sirainen <tss@iki.fi>
parents:
3517
diff
changeset
|
153 enum mail_flags flags, struct mail_keywords *keywords, |
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
|
154 struct mail *dest_mail); |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
155 |
3863
55df57c028d4
Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents:
3735
diff
changeset
|
156 bool (*is_inconsistent)(struct mailbox *box); |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
157 }; |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
158 |
5450
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
159 union mailbox_module_context { |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
160 struct mailbox_vfuncs super; |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
161 struct mail_storage_module_register *reg; |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
162 }; |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
163 |
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
|
164 struct mailbox { |
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 char *name; |
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
|
166 struct mail_storage *storage; |
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 |
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 mailbox_vfuncs v; |
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
|
169 /* private: */ |
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
|
170 pool_t pool; |
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
|
171 |
4939
ff2272c228cc
Dovecot is now able to execute multiple commands at the same time.
Timo Sirainen <tss@iki.fi>
parents:
4876
diff
changeset
|
172 unsigned int transaction_count; |
ff2272c228cc
Dovecot is now able to execute multiple commands at the same time.
Timo Sirainen <tss@iki.fi>
parents:
4876
diff
changeset
|
173 |
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
|
174 /* Module-specific contexts. See mail_storage_module_id. */ |
5450
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
175 ARRAY_DEFINE(module_contexts, union mailbox_module_context *); |
4848
967de900c73a
Mailbox list indexing and related changes. Currently works only with
Timo Sirainen <tss@iki.fi>
parents:
4822
diff
changeset
|
176 |
967de900c73a
Mailbox list indexing and related changes. Currently works only with
Timo Sirainen <tss@iki.fi>
parents:
4822
diff
changeset
|
177 /* When FAST open flag is used, the mailbox isn't actually opened until |
967de900c73a
Mailbox list indexing and related changes. Currently works only with
Timo Sirainen <tss@iki.fi>
parents:
4822
diff
changeset
|
178 it's synced for the first time. */ |
967de900c73a
Mailbox list indexing and related changes. Currently works only with
Timo Sirainen <tss@iki.fi>
parents:
4822
diff
changeset
|
179 unsigned int opened:1; |
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
|
180 }; |
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
|
181 |
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
|
182 struct mail_vfuncs { |
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
|
183 void (*free)(struct mail *mail); |
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
|
184 int (*set_seq)(struct mail *mail, uint32_t seq); |
4274
bd519db7f6e5
Added mail_set_uid() to select a mail by UID.
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4268
diff
changeset
|
185 int (*set_uid)(struct mail *mail, uint32_t uid); |
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
|
186 |
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
|
187 enum mail_flags (*get_flags)(struct mail *mail); |
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
|
188 const char *const *(*get_keywords)(struct mail *mail); |
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
|
189 const struct message_part *(*get_parts)(struct mail *mail); |
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
|
190 |
4455
fce5140fbe0b
Added mail_get_save_date() and some cleanups.
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4453
diff
changeset
|
191 time_t (*get_date)(struct mail *mail, int *timezone); |
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
|
192 time_t (*get_received_date)(struct mail *mail); |
4455
fce5140fbe0b
Added mail_get_save_date() and some cleanups.
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4453
diff
changeset
|
193 time_t (*get_save_date)(struct mail *mail); |
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
|
194 uoff_t (*get_virtual_size)(struct mail *mail); |
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
|
195 uoff_t (*get_physical_size)(struct mail *mail); |
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
|
196 |
3248
ff47e78ad717
Renamed mail_get_header() to mail_get_first_header() and mail_gets_headers()
Timo Sirainen <tss@iki.fi>
parents:
3245
diff
changeset
|
197 const char *(*get_first_header)(struct mail *mail, const char *field); |
ff47e78ad717
Renamed mail_get_header() to mail_get_first_header() and mail_gets_headers()
Timo Sirainen <tss@iki.fi>
parents:
3245
diff
changeset
|
198 const char *const *(*get_headers)(struct mail *mail, const char *field); |
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
|
199 struct istream * |
3248
ff47e78ad717
Renamed mail_get_header() to mail_get_first_header() and mail_gets_headers()
Timo Sirainen <tss@iki.fi>
parents:
3245
diff
changeset
|
200 (*get_header_stream)(struct mail *mail, |
ff47e78ad717
Renamed mail_get_header() to mail_get_first_header() and mail_gets_headers()
Timo Sirainen <tss@iki.fi>
parents:
3245
diff
changeset
|
201 struct mailbox_header_lookup_ctx *headers); |
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
|
202 struct istream *(*get_stream)(struct mail *mail, |
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
|
203 struct message_size *hdr_size, |
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
|
204 struct message_size *body_size); |
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
|
205 |
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
|
206 const char *(*get_special)(struct mail *mail, |
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
|
207 enum mail_fetch_field field); |
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
|
208 |
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
|
209 int (*update_flags)(struct mail *mail, enum modify_type modify_type, |
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
|
210 enum mail_flags flags); |
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
|
211 int (*update_keywords)(struct mail *mail, enum modify_type modify_type, |
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
|
212 struct mail_keywords *keywords); |
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
|
213 |
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
|
214 int (*expunge)(struct mail *mail); |
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
|
215 }; |
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
|
216 |
5450
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
217 union mail_module_context { |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
218 struct mail_vfuncs super; |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
219 struct mail_module_register *reg; |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
220 }; |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
221 |
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
|
222 struct mail_private { |
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
|
223 struct mail mail; |
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
|
224 struct mail_vfuncs v; |
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
|
225 |
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
|
226 pool_t pool; |
5450
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
227 ARRAY_DEFINE(module_contexts, union mail_module_context *); |
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
|
228 }; |
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
|
229 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
230 struct mailbox_list_context { |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
231 struct mail_storage *storage; |
4076
7f48190f868f
Moved mailbox_list_flags to struct mailbox_list_context so plugins can see the flags more easily.
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4044
diff
changeset
|
232 enum mailbox_list_flags flags; |
4041
9d7420b0e1ef
Make life easier for plugins:
Timo Sirainen <timo.sirainen@movial.fi>
parents:
3863
diff
changeset
|
233 bool failed; |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
234 }; |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
235 |
5450
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
236 union mailbox_transaction_module_context { |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
237 struct mail_storage_module_register *reg; |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
238 }; |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
239 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
240 struct mailbox_transaction_context { |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
241 struct mailbox *box; |
5450
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
242 ARRAY_DEFINE(module_contexts, |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
243 union mailbox_transaction_module_context *); |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
244 }; |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
245 |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
246 union mail_search_module_context { |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
247 struct mail_storage_module_register *reg; |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
248 }; |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
249 |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
250 struct mail_search_context { |
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
|
251 struct mailbox_transaction_context *transaction; |
4607
71b3570946f8
Moved some search parameters to public struct mail_search_context and added
Timo Sirainen <tss@iki.fi>
parents:
4606
diff
changeset
|
252 |
71b3570946f8
Moved some search parameters to public struct mail_search_context and added
Timo Sirainen <tss@iki.fi>
parents:
4606
diff
changeset
|
253 char *charset; |
71b3570946f8
Moved some search parameters to public struct mail_search_context and added
Timo Sirainen <tss@iki.fi>
parents:
4606
diff
changeset
|
254 struct mail_search_arg *args; |
71b3570946f8
Moved some search parameters to public struct mail_search_context and added
Timo Sirainen <tss@iki.fi>
parents:
4606
diff
changeset
|
255 struct mail_search_sort_program *sort_program; |
71b3570946f8
Moved some search parameters to public struct mail_search_context and added
Timo Sirainen <tss@iki.fi>
parents:
4606
diff
changeset
|
256 |
4196
6ac0d63b297f
Optimized searching a bit for cases where we can restrict search range by
Timo Sirainen <tss@iki.fi>
parents:
4076
diff
changeset
|
257 uint32_t seq; |
5450
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
258 ARRAY_DEFINE(module_contexts, union mail_search_module_context *); |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
259 }; |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
260 |
2446
47e1e05cede0
Changed mail saving API to be nonblocking.
Timo Sirainen <tss@iki.fi>
parents:
2350
diff
changeset
|
261 struct mail_save_context { |
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
|
262 struct mailbox_transaction_context *transaction; |
4268
7112aad504ae
Changed mailbox_save_*() API a bit: Moved the struct mail *dest_mail to
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4196
diff
changeset
|
263 struct mail *dest_mail; |
2446
47e1e05cede0
Changed mail saving API to be nonblocking.
Timo Sirainen <tss@iki.fi>
parents:
2350
diff
changeset
|
264 }; |
47e1e05cede0
Changed mail saving API to be nonblocking.
Timo Sirainen <tss@iki.fi>
parents:
2350
diff
changeset
|
265 |
2322
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2225
diff
changeset
|
266 struct mailbox_sync_context { |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2225
diff
changeset
|
267 struct mailbox *box; |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2225
diff
changeset
|
268 }; |
aae574ed7f4c
Broke mailbox_sync() into iterator.
Timo Sirainen <tss@iki.fi>
parents:
2225
diff
changeset
|
269 |
2327
7d02e2a7672d
Header caching redesigned. New design allows caching decisions per field, so
Timo Sirainen <tss@iki.fi>
parents:
2322
diff
changeset
|
270 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
|
271 struct mailbox *box; |
7d02e2a7672d
Header caching redesigned. New design allows caching decisions per field, so
Timo Sirainen <tss@iki.fi>
parents:
2322
diff
changeset
|
272 }; |
7d02e2a7672d
Header caching redesigned. New design allows caching decisions per field, so
Timo Sirainen <tss@iki.fi>
parents:
2322
diff
changeset
|
273 |
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
|
274 /* Modules should use do "my_id = mail_storage_module_id++" and |
85fcdb478608
Beginnings of joining mail-storage API more closely to mail-index, so that
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4451
diff
changeset
|
275 use objects' module_contexts[id] for their own purposes. */ |
5450
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
276 extern struct mail_storage_module_register mail_storage_module_register; |
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
|
277 |
85fcdb478608
Beginnings of joining mail-storage API more closely to mail-index, so that
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4451
diff
changeset
|
278 /* Storage's module_id for mail_index. */ |
5450
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
279 extern struct mail_module_register mail_module_register; |
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
|
280 |
5450
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
281 #define MAIL_STORAGE_CONTEXT(obj) \ |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
282 MODULE_CONTEXT(obj, mail_storage_mail_index_module) |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
283 extern MODULE_CONTEXT_DEFINE(mail_storage_mail_index_module, |
7a6db5ec047d
Better type safety to module_contexts arrays. Already fixed some bugs.
Timo Sirainen <tss@iki.fi>
parents:
5448
diff
changeset
|
284 &mail_index_module_register); |
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
|
285 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
286 /* Set error message in storage. Critical errors are logged with i_error(), |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
287 but user sees only "internal error" message. */ |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
288 void mail_storage_clear_error(struct mail_storage *storage); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
289 void mail_storage_set_error(struct mail_storage *storage, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
290 const char *fmt, ...) __attr_format__(2, 3); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
291 void mail_storage_set_syntax_error(struct mail_storage *storage, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
292 const char *fmt, ...) __attr_format__(2, 3); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
293 void mail_storage_set_critical(struct mail_storage *storage, |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
294 const char *fmt, ...) __attr_format__(2, 3); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
295 void mail_storage_set_internal_error(struct mail_storage *storage); |
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
296 |
2225
5947497c3e40
get_last_error() wasn't virtualizable
Timo Sirainen <tss@iki.fi>
parents:
2190
diff
changeset
|
297 const char *mail_storage_class_get_last_error(struct mail_storage *storage, |
3863
55df57c028d4
Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents:
3735
diff
changeset
|
298 bool *syntax_error_r); |
4808
93bc9770f938
Initial code for separation of mailbox accessing and directory layout
Timo Sirainen <tss@iki.fi>
parents:
4607
diff
changeset
|
299 |
93bc9770f938
Initial code for separation of mailbox accessing and directory layout
Timo Sirainen <tss@iki.fi>
parents:
4607
diff
changeset
|
300 enum mailbox_list_flags |
93bc9770f938
Initial code for separation of mailbox accessing and directory layout
Timo Sirainen <tss@iki.fi>
parents:
4607
diff
changeset
|
301 mail_storage_get_list_flags(enum mail_storage_flags storage_flags); |
5448
beabd433cdae
Moved delete/rename operations to mailbox_list API. Fixed mbox/maildir to
Timo Sirainen <tss@iki.fi>
parents:
4949
diff
changeset
|
302 bool mail_storage_errno2str(const char **error_r); |
2225
5947497c3e40
get_last_error() wasn't virtualizable
Timo Sirainen <tss@iki.fi>
parents:
2190
diff
changeset
|
303 |
1915
79790750c349
importing new index code. mbox still broken.
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
304 #endif |