Lines Matching refs:node

14 		 const struct mailbox_list_index_node *node, guid_128_t guid_r)
22 mailbox_list_index_node_get_path(node, ns_sep, str);
33 const struct mailbox_list_index_node *node, uint32_t *seq_r)
39 irec.name_id = node->name_id;
40 if (node->parent != NULL)
41 irec.parent_uid = node->parent->uid;
46 node_lookup_guid(ctx, node, irec.guid);
49 mail_index_append(ctx->trans, node->uid, &seq);
62 struct mailbox_list_index_node *node;
65 node = p_new(ctx->ilist->mailbox_pool,
67 node->flags = MAILBOX_LIST_INDEX_FLAG_NONEXISTENT |
71 node->name = dup_name = p_strdup(ctx->ilist->mailbox_pool, name);
72 node->name_id = ++ctx->ilist->highest_name_id;
73 node->uid = ctx->next_uid++;
76 node->parent = parent;
77 node->next = parent->children;
78 parent->children = node;
80 node->next = ctx->ilist->mailbox_tree;
81 ctx->ilist->mailbox_tree = node;
84 POINTER_CAST(node->uid), node);
86 POINTER_CAST(node->name_id), dup_name);
88 node_add_to_index(ctx, node, seq_r);
89 return node;
98 struct mailbox_list_index_node *node, *parent;
104 /* find the last node that exists in the path */
105 node = ctx->ilist->mailbox_tree; parent = NULL;
107 node = mailbox_list_index_node_find_sibling(node, path[i]);
108 if (node == NULL)
111 node->flags |= MAILBOX_LIST_INDEX_FLAG_SYNC_EXISTS;
112 parent = node;
113 node = node->children;
116 node = parent;
119 i_assert(node != NULL);
120 if (!mail_index_lookup_seq(ctx->view, node->uid, &seq))
121 i_panic("mailbox list index: lost uid=%u", node->uid);
126 node = mailbox_list_index_node_add(ctx, node, path[i],
132 *node_r = node;
138 const struct mailbox_list_index_node *node)
140 for (; node != NULL; node = node->next) {
141 if (node->children != NULL)
142 get_existing_name_ids(ids, node->children);
143 array_append(ids, &node->name_id, 1);
194 mailbox_list_index_node_clear_exists(struct mailbox_list_index_node *node)
196 while (node != NULL) {
197 if (node->children != NULL)
198 mailbox_list_index_node_clear_exists(node->children);
200 node->flags &= ~MAILBOX_LIST_INDEX_FLAG_SYNC_EXISTS;
201 node = node->next;
207 struct mailbox_list_index_node *node)
211 while (node != NULL) {
212 if (node->children != NULL)
213 sync_expunge_nonexistent(sync_ctx, node->children);
215 if ((node->flags & MAILBOX_LIST_INDEX_FLAG_SYNC_EXISTS) == 0) {
216 if (mail_index_lookup_seq(sync_ctx->view, node->uid,
219 mailbox_list_index_node_unlink(sync_ctx->ilist, node);
221 node = node->next;
297 struct mailbox_list_index_node *node;
331 &node, &created);
332 node->flags = flags | MAILBOX_LIST_INDEX_FLAG_SYNC_EXISTS;
372 struct mailbox_list_index_node *node)
379 if (!mail_index_lookup_seq(sync_ctx->view, node->uid, &seq))
382 if (node->corrupted_ext) {
389 irec.name_id = node->name_id;
390 irec.parent_uid = node->parent == NULL ? 0 : node->parent->uid;
393 node->corrupted_ext = FALSE;
395 if (node->corrupted_flags) {
397 (enum mail_flags)node->flags);
398 node->corrupted_flags = FALSE;
399 } else if ((node->flags & MAILBOX_LIST_INDEX_FLAG_CORRUPTED_NAME) != 0) {
408 struct mailbox_list_index_node *node)
410 for (; node != NULL; node = node->next) {
411 mailbox_list_index_sync_update_corrupted_node(sync_ctx, node);
412 mailbox_list_index_sync_update_corrupted_nodes(sync_ctx, node->children);
480 struct mailbox_list_index_node *node;
485 node = mailbox_list_index_lookup(sync_ctx->list, name);
486 if (node == NULL) {
491 if (!mail_index_lookup_seq(sync_ctx->view, node->uid, &seq))
492 i_panic("mailbox list index: lost uid=%u", node->uid);
495 node->flags = MAILBOX_LIST_INDEX_FLAG_NOSELECT;
497 (enum mail_flags)node->flags);
509 if (node->children != NULL) {
515 /* we can remove the entire node */
517 mailbox_list_index_node_unlink(sync_ctx->ilist, node);