This can be used for caching struct mailbox pointers and checking later if
two struct mailboxes + their generation sequences match. If they do, it's
the same struct mailbox.
enum mailbox_flags flags,
const char *index_prefix)
{
+ static unsigned int mailbox_generation_sequence = 0;
struct index_mailbox_context *ibox;
i_assert(vname != NULL);
+ box->generation_sequence = ++mailbox_generation_sequence;
box->vname = p_strdup(box->pool, vname);
box->name = p_strdup(box->pool,
mailbox_list_get_storage_name(box->list, vname));
mailbox_notify_callback_t *notify_callback;
void *notify_context;
+ /* Increased by one for each new struct mailbox. */
+ unsigned int generation_sequence;
+
/* Saved search results */
ARRAY_DEFINE(search_results, struct mail_search_result *);