Lines Matching refs:list
7 #include "mailbox-list-private.h"
15 int mailbox_guid_cache_find(struct mailbox_list *list,
21 if (!hash_table_is_created(list->guid_cache) ||
22 list->guid_cache_invalidated) {
23 mailbox_guid_cache_refresh(list);
24 rec = hash_table_lookup(list->guid_cache, guid_p);
26 rec = hash_table_lookup(list->guid_cache, guid_p);
27 if (rec == NULL && list->guid_cache_updated) {
28 mailbox_guid_cache_refresh(list);
29 rec = hash_table_lookup(list->guid_cache, guid_p);
34 return list->guid_cache_errors ? -1 : 0;
40 void mailbox_guid_cache_refresh(struct mailbox_list *list)
49 if (!hash_table_is_created(list->guid_cache)) {
50 list->guid_cache_pool =
52 hash_table_create(&list->guid_cache, list->guid_cache_pool, 0,
55 hash_table_clear(list->guid_cache, TRUE);
56 p_clear(list->guid_cache_pool);
58 list->guid_cache_invalidated = FALSE;
59 list->guid_cache_updated = FALSE;
60 list->guid_cache_errors = FALSE;
62 ctx = mailbox_list_iter_init(list, "*",
70 box = mailbox_alloc(list, info->vname, 0);
75 list->guid_cache_errors = TRUE;
76 } else if ((rec = hash_table_lookup(list->guid_cache,
82 rec = p_new(list->guid_cache_pool,
85 rec->vname = p_strdup(list->guid_cache_pool, info->vname);
87 hash_table_insert(list->guid_cache, guid_p, rec);
92 list->guid_cache_errors = TRUE;