comparison src/lib-index/mail-cache.h @ 1956:d6941cd8afdc HEAD

Added support for setting dirty flags for messages (TODO: undirty..) s/mail_index_record_flag/mail_cache_record_flag/
author Timo Sirainen <tss@iki.fi>
date Sun, 02 May 2004 22:24:35 +0300
parents 79790750c349
children 97bb7b127617
comparison
equal deleted inserted replaced
1955:0f0128b4af5d 1956:d6941cd8afdc
8 #define MAIL_CACHE_HEADERS_COUNT 4 8 #define MAIL_CACHE_HEADERS_COUNT 4
9 9
10 struct mail_cache; 10 struct mail_cache;
11 struct mail_cache_view; 11 struct mail_cache_view;
12 struct mail_cache_transaction_ctx; 12 struct mail_cache_transaction_ctx;
13
14 enum mail_cache_record_flag {
15 /* If binary flags are set, it's not checked whether mail is
16 missing CRs. So this flag may be set as an optimization for
17 regular non-binary mails as well if it's known that it contains
18 valid CR+LF line breaks. */
19 MAIL_INDEX_FLAG_BINARY_HEADER = 0x0001,
20 MAIL_INDEX_FLAG_BINARY_BODY = 0x0002,
21
22 /* Mail header or body is known to contain NUL characters. */
23 MAIL_INDEX_FLAG_HAS_NULS = 0x0004,
24 /* Mail header or body is known to not contain NUL characters. */
25 MAIL_INDEX_FLAG_HAS_NO_NULS = 0x0008
26 };
13 27
14 enum mail_cache_field { 28 enum mail_cache_field {
15 /* fixed size fields */ 29 /* fixed size fields */
16 MAIL_CACHE_INDEX_FLAGS = 0x00000001, 30 MAIL_CACHE_INDEX_FLAGS = 0x00000001,
17 MAIL_CACHE_LOCATION_OFFSET = 0x00000002, 31 MAIL_CACHE_LOCATION_OFFSET = 0x00000002,
142 156
143 /* Mark given fields as missing, ie. they should be cached when possible. */ 157 /* Mark given fields as missing, ie. they should be cached when possible. */
144 void mail_cache_mark_missing(struct mail_cache_view *view, 158 void mail_cache_mark_missing(struct mail_cache_view *view,
145 enum mail_cache_field fields); 159 enum mail_cache_field fields);
146 160
147 /* Return index flags. */ 161 /* Return record flags. */
148 enum mail_index_record_flag 162 enum mail_cache_record_flag
149 mail_cache_get_index_flags(struct mail_cache_view *view, uint32_t seq); 163 mail_cache_get_record_flags(struct mail_cache_view *view, uint32_t seq);
150 164
151 /* Update index flags. The cache file must be locked and the flags must be 165 /* Update record flags. The cache file must be locked and the flags must be
152 already inserted to the record. */ 166 already inserted to the record. */
153 int mail_cache_update_index_flags(struct mail_cache_view *view, uint32_t seq, 167 int mail_cache_update_record_flags(struct mail_cache_view *view, uint32_t seq,
154 enum mail_index_record_flag flags); 168 enum mail_cache_record_flag flags);
155 169
156 /* Update location offset. External locking is assumed to take care of locking 170 /* Update location offset. External locking is assumed to take care of locking
157 readers out to prevent race conditions. */ 171 readers out to prevent race conditions. */
158 int mail_cache_update_location_offset(struct mail_cache_view *view, 172 int mail_cache_update_location_offset(struct mail_cache_view *view,
159 uint32_t seq, uoff_t offset); 173 uint32_t seq, uoff_t offset);