src/tree.c

changeset 918
ec1f2015ec79
parent 914
7da30512efc4
child 921
5a7aa9cf9c3a
equal deleted inserted replaced
917:ff8ad2c9e1bd 918:ec1f2015ec79
821 tree->root = root; 821 tree->root = root;
822 tree->size = cxTreeSubtreeSize(tree, root); 822 tree->size = cxTreeSubtreeSize(tree, root);
823 return tree; 823 return tree;
824 } 824 }
825 825
826 void cxTreeSetParent(
827 CxTree *tree,
828 void *parent,
829 void *child
830 ) {
831 size_t loc_parent = tree->loc_parent;
832 if (tree_parent(child) == NULL) {
833 tree->size++;
834 }
835 cx_tree_link(parent, child, cx_tree_node_layout(tree));
836 }
837
838 void cxTreeAddChildNode(
839 CxTree *tree,
840 void *parent,
841 void *child
842 ) {
843 cx_tree_link(parent, child, cx_tree_node_layout(tree));
844 tree->size++;
845 }
846
826 int cxTreeAddChild( 847 int cxTreeAddChild(
827 CxTree *tree, 848 CxTree *tree,
828 void *parent, 849 void *parent,
829 const void *data) { 850 const void *data) {
830 void *node = tree->node_create(data, tree); 851 void *node = tree->node_create(data, tree);

mercurial