return node;
}
+/* Fill memory pointed at via NODES with all nodes of TREE in the
+ given ORDER.
+
+ The size of NODES must be sufficiently large.
+ */
+
+void
+interval_tree_nodes (struct interval_tree *tree,
+ struct interval_node **nodes,
+ enum interval_tree_order order)
+{
+ struct interval_node *node;
+
+ interval_tree_iter_start (tree, PTRDIFF_MIN, PTRDIFF_MAX, order);
+ while ((node = interval_tree_iter_next (tree)))
+ {
+ *nodes = node;
+ ++nodes;
+ }
+ interval_tree_iter_finish (tree);
+}
+
/* Start a generator iterating all intervals in [BEGIN,END) in the
given ORDER. Only one iterator per tree can be running at any
time.
struct interval_node *interval_tree_iter_next(struct interval_tree *);
void interval_tree_insert_gap(struct interval_tree *, ptrdiff_t, ptrdiff_t);
void interval_tree_delete_gap(struct interval_tree *, ptrdiff_t, ptrdiff_t);
+void interval_tree_nodes (struct interval_tree *tree, struct interval_node **nodes, enum interval_tree_order order);
#endif