1 #ifndef DSYNC_MAILBOX_H 2 #define DSYNC_MAILBOX_H 3 4 #include "mail-storage.h" 5 6 struct dsync_brain; 7 8 /* Mailbox that is going to be synced. Its name was already sent in the 9 mailbox tree. */ 10 struct dsync_mailbox { 11 guid_128_t mailbox_guid; 12 bool mailbox_lost; 13 bool mailbox_ignore; 14 bool have_guids, have_save_guids, have_only_guid128; 15 16 uint32_t uid_validity, uid_next, messages_count, first_recent_uid; 17 uint64_t highest_modseq, highest_pvt_modseq; 18 ARRAY_TYPE(mailbox_cache_field) cache_fields; 19 }; 20 21 struct dsync_mailbox_attribute { 22 enum mail_attribute_type type; 23 const char *key; 24 /* if both values are NULL = not looked up yet / deleted */ 25 const char *value; 26 struct istream *value_stream; 27 28 time_t last_change; /* 0 = unknown */ 29 uint64_t modseq; /* 0 = unknown */ 30 31 bool deleted; /* attribute is known to have been deleted */ 32 bool exported; /* internally used by exporting */ 33 }; 34 #define DSYNC_ATTR_HAS_VALUE(attr) \ 35 ((attr)->value != NULL || (attr)->value_stream != NULL) 36 37 void dsync_mailbox_attribute_dup(pool_t pool, 38 const struct dsync_mailbox_attribute *src, 39 struct dsync_mailbox_attribute *dest_r); 40 41 int dsync_mailbox_lock(struct dsync_brain *brain, struct mailbox *box, 42 struct file_lock **lock_r); 43 44 #endif 45