summaryrefslogtreecommitdiffstats
path: root/filter/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'filter/tree.c')
-rw-r--r--filter/tree.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/filter/tree.c b/filter/tree.c
index 43888f0..5e57bb7 100644
--- a/filter/tree.c
+++ b/filter/tree.c
@@ -123,3 +123,23 @@ f_new_tree(void)
ret->data = NULL;
return ret;
}
+
+int
+same_tree(struct f_tree *t1, struct f_tree *t2)
+{
+ if ((!!t1) != (!!t2))
+ return 0;
+ if (!t1)
+ return 1;
+ if (val_compare(t1->from, t2->from))
+ return 0;
+ if (val_compare(t1->to, t2->to))
+ return 0;
+ if (!same_tree(t1->left, t2->left))
+ return 0;
+ if (!same_tree(t1->right, t2->right))
+ return 0;
+ if (!i_same(t1->data, t2->data))
+ return 0;
+ return 1;
+}