Lines Matching defs:parent

48  * XXXDCL Since parent pointers were added in again, I could remove all of the
79 #define PARENT(node) ((node)->parent)
133 * being wholly handled by parent pointers (which didn't exist, because
372 dns_rbtnode_t **root, *parent, *child, *current, *new_current;
416 parent = NULL;
442 parent = current;
446 parent = current;
484 parent = NULL;
549 if (parent != NULL) {
550 if (LEFT(parent) == current)
551 LEFT(parent) = new_current;
553 RIGHT(parent) = new_current;
779 * it's parent is the same as it's "up" pointer.
1256 * back up to its parent level. But what happens when "a" then gets deleted?
1277 dns_rbtnode_t *parent;
1305 * deleted. If the deleted node is the top level, parent will be set
1308 parent = find_up(node);
1315 dns_rbt_deletefromlevel(node, parent == NULL ? &rbt->root :
1316 &DOWN(parent));
1334 * Both cases exist when the deleted node's parent (the node
1336 * it has no data: parent != NULL && DATA(parent) == NULL.
1339 * DOWN(parent) == NULL. This case can only exist if the parent was
1340 * previously deleted -- and so now, apparently, the parent should go
1344 * The other case also involves a parent with no data, but with the
1346 * LEFT(DOWN(parent)) == NULL && RIGHT(DOWN(parent)) == NULL.
1348 * with the parent, but it's already been described why that can't be
1665 dns_rbtnode_t *child, *root, *parent, *grandparent;
1710 * XXXDCL could do away with separate parent and grandparent
1711 * variables. They are vestiges of the days before parent
1715 parent = PARENT(node);
1716 grandparent = PARENT(parent);
1718 if (parent == LEFT(grandparent)) {
1721 MAKE_BLACK(parent);
1726 if (node == RIGHT(parent)) {
1727 rotate_left(parent, &root);
1728 node = parent;
1729 parent = PARENT(node);
1730 grandparent = PARENT(parent);
1732 MAKE_BLACK(parent);
1739 MAKE_BLACK(parent);
1744 if (node == LEFT(parent)) {
1745 rotate_right(parent, &root);
1746 node = parent;
1747 parent = PARENT(node);
1748 grandparent = PARENT(parent);
1750 MAKE_BLACK(parent);
1770 dns_rbtnode_t *child, *sibling, *parent;
1776 * Verify that the parent history is (apparently) correct.
1866 * is the successor's original parent.
1872 * Node being deleted was successor's parent.
1891 * Remove the node by removing the links from its parent.
1916 parent = PARENT(delete);
1921 if (LEFT(parent) == child) {
1922 sibling = RIGHT(parent);
1926 MAKE_RED(parent);
1927 rotate_left(parent, rootp);
1928 sibling = RIGHT(parent);
1936 child = parent;
1944 sibling = RIGHT(parent);
1947 COLOR(sibling) = COLOR(parent);
1948 MAKE_BLACK(parent);
1951 rotate_left(parent, rootp);
1957 * Child is parent's right child.
1961 sibling = LEFT(parent);
1965 MAKE_RED(parent);
1966 rotate_right(parent, rootp);
1967 sibling = LEFT(parent);
1975 child = parent;
1982 sibling = LEFT(parent);
1985 COLOR(sibling) = COLOR(parent);
1986 MAKE_BLACK(parent);
1989 rotate_right(parent, rootp);
1994 parent = PARENT(child);
2064 dns_rbtnode_t *parent;
2094 parent = PARENT(node);
2096 PARENT(RIGHT(node)) = parent;
2097 if (parent != NULL) {
2098 if (LEFT(parent) == node)
2099 LEFT(parent) = RIGHT(node);
2100 else if (DOWN(parent) == node)
2101 DOWN(parent) = RIGHT(node);
2103 parent = RIGHT(node);
2107 node = parent;
2142 dns_rbt_printtree(dns_rbtnode_t *root, dns_rbtnode_t *parent, int depth) {
2148 if (parent) {
2150 dns_rbt_printnodename(parent);
2153 if ((! IS_ROOT(root) && PARENT(root) != parent) ||
2157 printf(" (BAD parent pointer! -> ");
2294 * the way there the link from parent to child is a right
2295 * link, then the parent is the previous node, at least