comparison src/lib-index/mail-index.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 2f6e137cdc44
children 4dec6a3d79fd
comparison
equal deleted inserted replaced
1955:0f0128b4af5d 1956:d6941cd8afdc
32 MAIL_INDEX_COMPAT_LITTLE_ENDIAN = 0x01 32 MAIL_INDEX_COMPAT_LITTLE_ENDIAN = 0x01
33 }; 33 };
34 34
35 enum mail_index_header_flag { 35 enum mail_index_header_flag {
36 /* Index file is corrupted, reopen or recreate it. */ 36 /* Index file is corrupted, reopen or recreate it. */
37 MAIL_INDEX_HDR_FLAG_CORRUPTED = 0x0001 37 MAIL_INDEX_HDR_FLAG_CORRUPTED = 0x0001,
38 }; 38 MAIL_INDEX_HDR_FLAG_HAVE_DIRTY = 0x0002
39 39 };
40 enum mail_index_record_flag { 40
41 /* If binary flags are set, it's not checked whether mail is 41 enum mail_index_mail_flags {
42 missing CRs. So this flag may be set as an optimization for 42 MAIL_INDEX_MAIL_FLAG_DIRTY = 0x80
43 regular non-binary mails as well if it's known that it contains
44 valid CR+LF line breaks. */
45 MAIL_INDEX_FLAG_BINARY_HEADER = 0x0001,
46 MAIL_INDEX_FLAG_BINARY_BODY = 0x0002,
47
48 /* Mail header or body is known to contain NUL characters. */
49 MAIL_INDEX_FLAG_HAS_NULS = 0x0004,
50 /* Mail header or body is known to not contain NUL characters. */
51 MAIL_INDEX_FLAG_HAS_NO_NULS = 0x0008
52 }; 43 };
53 44
54 enum mail_index_error { 45 enum mail_index_error {
55 /* No errors */ 46 /* No errors */
56 MAIL_INDEX_ERROR_NONE, 47 MAIL_INDEX_ERROR_NONE,
202 /* Returns -1 if error, 0 if sync is finished, 1 if record was filled. */ 193 /* Returns -1 if error, 0 if sync is finished, 1 if record was filled. */
203 int mail_index_sync_next(struct mail_index_sync_ctx *ctx, 194 int mail_index_sync_next(struct mail_index_sync_ctx *ctx,
204 struct mail_index_sync_rec *sync_rec); 195 struct mail_index_sync_rec *sync_rec);
205 /* Returns 1 if there's more to sync, 0 if not. */ 196 /* Returns 1 if there's more to sync, 0 if not. */
206 int mail_index_sync_have_more(struct mail_index_sync_ctx *ctx); 197 int mail_index_sync_have_more(struct mail_index_sync_ctx *ctx);
198 /* Mark given message to be dirty, ie. we couldn't temporarily change the
199 message flags in storage. Dirty messages are tried to be synced again in
200 next sync. */
201 int mail_index_sync_set_dirty(struct mail_index_sync_ctx *ctx, uint32_t seq);
207 /* End synchronization by unlocking the index and closing the view. 202 /* End synchronization by unlocking the index and closing the view.
208 sync_stamp/sync_size in header is updated to given values. */ 203 sync_stamp/sync_size in header is updated to given values. */
209 int mail_index_sync_end(struct mail_index_sync_ctx *ctx, 204 int mail_index_sync_end(struct mail_index_sync_ctx *ctx,
210 uint32_t sync_stamp, uint64_t sync_size); 205 uint32_t sync_stamp, uint64_t sync_size);
211 206