Exemplo n.º 1
0
bool
tree_iterator_last(void* Iterator)
{
    ASSERT(Iterator != NULL);
    tree_iterator* iterator = Iterator;
    ASSERT(iterator->tree != NULL);
    if (iterator->tree->root) {
	iterator->node = tree_node_max(iterator->tree->root);
	return true;
    }
    return false;
}
Exemplo n.º 2
0
bool
tr_itor_last(tr_itor* itor)
{
    ASSERT(itor != NULL);

    if (itor->tree->root) {
	itor->node = tree_node_max(itor->tree->root);
	return true;
    } else {
	itor->node = NULL;
	return false;
    }
}
Exemplo n.º 3
0
void*
tree_node_prev(void* Node)
{
    tree_node* node = Node;
    ASSERT(node != NULL);
    if (node->llink) {
	return tree_node_max(node->llink);
    }
    tree_node* parent = node->parent;
    while (parent && parent->llink == node) {
	node = parent;
	parent = parent->parent;
    }
    return parent;
}