src/cx/tree.h

changeset 914
7da30512efc4
parent 913
72db8e42b95e
--- a/src/cx/tree.h	Sun Oct 06 13:37:05 2024 +0200
+++ b/src/cx/tree.h	Sun Oct 06 13:41:26 2024 +0200
@@ -841,19 +841,6 @@
             const void *subtree,
             const void *data
     );
-
-    /**
-     * Member function for creating an iterator for the tree.
-     */
-    CxTreeIterator (*iterator)(
-            struct cx_tree_s *tree,
-            bool visit_on_exit
-    );
-
-    /**
-     * Member function for creating a visitor for the tree.
-     */
-    CxTreeVisitor (*visitor)(struct cx_tree_s *tree);
 };
 
 /**
@@ -1113,7 +1100,10 @@
         CxTree *tree,
         bool visit_on_exit
 ) {
-    return tree->cl->iterator(tree, visit_on_exit);
+    return cx_tree_iterator(
+            tree->root, visit_on_exit,
+            tree->loc_children, tree->loc_next
+    );
 }
 
 /**
@@ -1125,7 +1115,9 @@
  */
 __attribute__((__nonnull__, __warn_unused_result__))
 static inline CxTreeVisitor cxTreeVisitor(CxTree *tree) {
-    return tree->cl->visitor(tree);
+    return cx_tree_visitor(
+            tree->root, tree->loc_children, tree->loc_next
+    );
 }
 
 /**

mercurial