Lines Matching defs:nil
281 the sentinel nil node, and root->parent->left points back to root */
325 static void free_nodes(dict_t *dict, dnode_t *node, dnode_t *nil)
327 if (node == nil)
329 free_nodes(dict, node->left, nil);
330 free_nodes(dict, node->right, nil);
341 static int verify_dict_has_node(dnode_t *nil, dnode_t *root, dnode_t *node)
343 if (root != nil) {
345 || verify_dict_has_node(nil, root->left, node)
346 || verify_dict_has_node(nil, root->right, node);
369 dnode_t *nil = dict_nil(dict), *root = dict_root(dict);
370 free_nodes(dict, root, nil);
397 * a pointer that dictionary's nil sentinel node), otherwise a pointer to the
404 dnode_t *nil = dict_nil(dict);
410 while (root != nil) {
423 while (root != nil && dict->compare(key, root->key))
425 } while (root != nil);
444 dnode_t *where = dict_root(dict), *nil = dict_nil(dict);
445 dnode_t *parent = nil, *uncle, *grandpa;
452 while (where != nil) {
463 assert (where == nil);
471 node->left = nil;
472 node->right = nil;
561 dnode_t *nil = dict_nil(dict), *root = dict_root(dict), *left;
563 if (root != nil)
564 while ((left = root->left) != nil)
567 return (root == nil) ? NULL : root;
574 * the nil node.
579 dnode_t *nil = dict_nil(dict), *parent, *left;
581 if (curr->right != nil) {
583 while ((left = curr->left) != nil)
590 while (parent != nil && curr == parent->right) {
595 return (parent == nil) ? NULL : parent;