annotate src/doveadm/dsync/dsync-mailbox.h @ 16977:8a7ecddca4ad

dsync: Support syncing storages with 128bit GUIDs <-> string GUIDs.
author Timo Sirainen <tss@iki.fi>
date Sun, 17 Nov 2013 17:59:05 +0200
parents c6fee677172a
children 1f8b784712e1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14584
b2076acc3715 Initial version of dsync rewrite.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
1 #ifndef DSYNC_MAILBOX_H
b2076acc3715 Initial version of dsync rewrite.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
2 #define DSYNC_MAILBOX_H
b2076acc3715 Initial version of dsync rewrite.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
3
b2076acc3715 Initial version of dsync rewrite.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
4 #include "mail-storage.h"
b2076acc3715 Initial version of dsync rewrite.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
5
b2076acc3715 Initial version of dsync rewrite.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
6 /* Mailbox that is going to be synced. Its name was already sent in the
b2076acc3715 Initial version of dsync rewrite.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
7 mailbox tree. */
b2076acc3715 Initial version of dsync rewrite.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
8 struct dsync_mailbox {
b2076acc3715 Initial version of dsync rewrite.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
9 guid_128_t mailbox_guid;
b2076acc3715 Initial version of dsync rewrite.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
10 bool mailbox_lost;
16977
8a7ecddca4ad dsync: Support syncing storages with 128bit GUIDs <-> string GUIDs.
Timo Sirainen <tss@iki.fi>
parents: 16376
diff changeset
11 bool have_guids, have_save_guids, have_only_guid128;
14584
b2076acc3715 Initial version of dsync rewrite.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
12
b2076acc3715 Initial version of dsync rewrite.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
13 uint32_t uid_validity, uid_next, messages_count, first_recent_uid;
15496
5d90e2aa1ba8 dsync: Use private modseqs to support syncing private flags in shared mailboxes.
Timo Sirainen <tss@iki.fi>
parents: 14584
diff changeset
14 uint64_t highest_modseq, highest_pvt_modseq;
14584
b2076acc3715 Initial version of dsync rewrite.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
15 ARRAY_TYPE(mailbox_cache_field) cache_fields;
b2076acc3715 Initial version of dsync rewrite.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
16 };
b2076acc3715 Initial version of dsync rewrite.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
17
16025
c6082de4bf5b dsync: Added support for syncing mailbox attributes.
Timo Sirainen <tss@iki.fi>
parents: 15750
diff changeset
18 struct dsync_mailbox_attribute {
c6082de4bf5b dsync: Added support for syncing mailbox attributes.
Timo Sirainen <tss@iki.fi>
parents: 15750
diff changeset
19 enum mail_attribute_type type;
c6082de4bf5b dsync: Added support for syncing mailbox attributes.
Timo Sirainen <tss@iki.fi>
parents: 15750
diff changeset
20 const char *key;
16052
0e5a359b7b7f lib-storage: Mailbox attributes can now be accessed via istreams.
Timo Sirainen <tss@iki.fi>
parents: 16025
diff changeset
21 /* if both values are NULL = not looked up yet / deleted */
0e5a359b7b7f lib-storage: Mailbox attributes can now be accessed via istreams.
Timo Sirainen <tss@iki.fi>
parents: 16025
diff changeset
22 const char *value;
0e5a359b7b7f lib-storage: Mailbox attributes can now be accessed via istreams.
Timo Sirainen <tss@iki.fi>
parents: 16025
diff changeset
23 struct istream *value_stream;
16025
c6082de4bf5b dsync: Added support for syncing mailbox attributes.
Timo Sirainen <tss@iki.fi>
parents: 15750
diff changeset
24
c6082de4bf5b dsync: Added support for syncing mailbox attributes.
Timo Sirainen <tss@iki.fi>
parents: 15750
diff changeset
25 time_t last_change; /* 0 = unknown */
c6082de4bf5b dsync: Added support for syncing mailbox attributes.
Timo Sirainen <tss@iki.fi>
parents: 15750
diff changeset
26 uint64_t modseq; /* 0 = unknown */
c6082de4bf5b dsync: Added support for syncing mailbox attributes.
Timo Sirainen <tss@iki.fi>
parents: 15750
diff changeset
27
c6082de4bf5b dsync: Added support for syncing mailbox attributes.
Timo Sirainen <tss@iki.fi>
parents: 15750
diff changeset
28 bool deleted; /* attribute is known to have been deleted */
c6082de4bf5b dsync: Added support for syncing mailbox attributes.
Timo Sirainen <tss@iki.fi>
parents: 15750
diff changeset
29 bool exported; /* internally used by exporting */
c6082de4bf5b dsync: Added support for syncing mailbox attributes.
Timo Sirainen <tss@iki.fi>
parents: 15750
diff changeset
30 };
16052
0e5a359b7b7f lib-storage: Mailbox attributes can now be accessed via istreams.
Timo Sirainen <tss@iki.fi>
parents: 16025
diff changeset
31 #define DSYNC_ATTR_HAS_VALUE(attr) \
0e5a359b7b7f lib-storage: Mailbox attributes can now be accessed via istreams.
Timo Sirainen <tss@iki.fi>
parents: 16025
diff changeset
32 ((attr)->value != NULL || (attr)->value_stream != NULL)
16025
c6082de4bf5b dsync: Added support for syncing mailbox attributes.
Timo Sirainen <tss@iki.fi>
parents: 15750
diff changeset
33
c6082de4bf5b dsync: Added support for syncing mailbox attributes.
Timo Sirainen <tss@iki.fi>
parents: 15750
diff changeset
34 void dsync_mailbox_attribute_dup(pool_t pool,
c6082de4bf5b dsync: Added support for syncing mailbox attributes.
Timo Sirainen <tss@iki.fi>
parents: 15750
diff changeset
35 const struct dsync_mailbox_attribute *src,
c6082de4bf5b dsync: Added support for syncing mailbox attributes.
Timo Sirainen <tss@iki.fi>
parents: 15750
diff changeset
36 struct dsync_mailbox_attribute *dest_r);
c6082de4bf5b dsync: Added support for syncing mailbox attributes.
Timo Sirainen <tss@iki.fi>
parents: 15750
diff changeset
37
14584
b2076acc3715 Initial version of dsync rewrite.
Timo Sirainen <tss@iki.fi>
parents:
diff changeset
38 #endif