Home | History | Annotate | Download | only in lib

Lines Matching refs:cur

174 	struct prio_tree_node *cur, *res = node;
185 cur = root->prio_tree_node;
189 get_index(cur, &r_index, &h_index);
192 return cur;
197 node = prio_tree_replace(root, cur, node);
198 cur = tmp;
214 if (prio_tree_right_empty(cur)) {
216 cur->right = node;
217 node->parent = cur;
220 cur = cur->right;
222 if (prio_tree_left_empty(cur)) {
224 cur->left = node;
225 node->parent = cur;
228 cur = cur->left;
250 struct prio_tree_node *cur;
253 cur = node;
255 while (!prio_tree_left_empty(cur) || !prio_tree_right_empty(cur)) {
256 if (!prio_tree_left_empty(cur))
257 get_index(cur->left, &r_index, &h_index_left);
259 cur = cur->right;
263 if (!prio_tree_right_empty(cur))
264 get_index(cur->right, &r_index, &h_index_right);
266 cur = cur->left;
272 cur = cur->left;
274 cur = cur->right;
277 if (prio_tree_root(cur)) {
278 assert(root->prio_tree_node == cur);
283 if (cur->parent->right == cur)
284 cur->parent->right = cur->parent;
286 cur->parent->left = cur->parent;
288 while (cur != node)
289 cur = prio_tree_replace(root, cur->parent, cur);
303 if (prio_tree_left_empty(iter->cur))
306 get_index(iter->cur->left, r_index, h_index);
309 iter->cur = iter->cur->left;
316 assert(prio_tree_left_empty(iter->cur));
317 assert(prio_tree_right_empty(iter->cur));
325 return iter->cur;
336 if (prio_tree_right_empty(iter->cur))
347 get_index(iter->cur->right, r_index, h_index);
350 iter->cur = iter->cur->right;
358 assert(prio_tree_left_empty(iter->cur));
359 assert(prio_tree_right_empty(iter->cur));
367 return iter->cur;
375 iter->cur = iter->cur->parent;
386 return iter->cur;
419 iter->cur = root->prio_tree_node;
423 return iter->cur;
445 if (iter->cur == NULL)
451 return iter->cur;
454 while (!prio_tree_root(iter->cur) &&
455 iter->cur->parent->right == iter->cur)
458 if (prio_tree_root(iter->cur))
465 return iter->cur;