1
/* Copyright (C) 2004 Timo Sirainen */
5
#include "mail-index-private.h"
6
#include "mail-transaction-log.h"
7
#include "mail-transaction-util.h"
9
const struct mail_transaction_type_map mail_transaction_type_map[] = {
10
{ MAIL_TRANSACTION_APPEND, MAIL_INDEX_SYNC_TYPE_APPEND,
11
1 }, /* index-specific size, use 1 */
12
{ MAIL_TRANSACTION_EXPUNGE, MAIL_INDEX_SYNC_TYPE_EXPUNGE,
13
sizeof(struct mail_transaction_expunge) },
14
{ MAIL_TRANSACTION_FLAG_UPDATE, MAIL_INDEX_SYNC_TYPE_FLAGS,
15
sizeof(struct mail_transaction_flag_update) },
16
{ MAIL_TRANSACTION_HEADER_UPDATE, 0, 1 }, /* variable size, use 1 */
17
{ MAIL_TRANSACTION_EXT_INTRO, 0, 1 },
18
{ MAIL_TRANSACTION_EXT_RESET, 0,
19
sizeof(struct mail_transaction_ext_reset) },
20
{ MAIL_TRANSACTION_EXT_HDR_UPDATE, 0, 1 },
21
{ MAIL_TRANSACTION_EXT_REC_UPDATE, 0, 1 },
22
{ MAIL_TRANSACTION_KEYWORD_UPDATE,
23
MAIL_INDEX_SYNC_TYPE_KEYWORD_ADD |
24
MAIL_INDEX_SYNC_TYPE_KEYWORD_REMOVE, 1 },
25
{ MAIL_TRANSACTION_KEYWORD_RESET,
26
MAIL_INDEX_SYNC_TYPE_KEYWORD_RESET, 1 },
30
const struct mail_transaction_type_map *
31
mail_transaction_type_lookup(enum mail_transaction_type type)
35
for (i = 0; mail_transaction_type_map[i].type != 0; i++) {
36
if ((mail_transaction_type_map[i].type & type) != 0)
37
return &mail_transaction_type_map[i];
42
enum mail_transaction_type
43
mail_transaction_type_mask_get(enum mail_index_sync_type sync_type)
45
enum mail_transaction_type type = 0;
48
for (i = 0; mail_transaction_type_map[i].type != 0; i++) {
49
if ((mail_transaction_type_map[i].sync_type & sync_type) != 0)
50
type |= mail_transaction_type_map[i].type;