This include file contains routines for storing and manipulating trees. All trees start at ROOT_NODE. ROOT_NODE is just a place holder, however, and does not have any data or list of children. All nodes except ROOT_NODE have data, a parent, and a list of children. A node is represented by the tree_node type, which is an index into the internal node sequence. It does allow ROOT_NODE, but not any invalid indices. Each node can have only one parent.
Creates a new node with the specified parent and returns its id.
Removes the node. Its id is now invalid, though it may be re-used by the allocator. Its children are also freed, and its id is removed from its parent's list of children.
Assigns node to parent. Automatically removes node from it's current parent's list of children, adds it to the new parent's list, and updates the node's parent field.
Returns the id of the parent of node.
Returns a sequence of the children of node.
Sets the data of node.
Returns the data associated with node.