summaryrefslogtreecommitdiff
path: root/filter/tree.c
diff options
context:
space:
mode:
authorPavel Machek <pavel@ucw.cz>2000-01-31 17:44:22 +0000
committerPavel Machek <pavel@ucw.cz>2000-01-31 17:44:22 +0000
commit9a4037d40891321a2f091cb1f1003bb1ee725136 (patch)
tree7ddba4047d6d2ae106994787e3aaff8ef91f423f /filter/tree.c
parent70844a6a46305080d7ada79936fb272beb411cf4 (diff)
filter_same() implemented. Don't bet on it, yet.
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 43888f0b..5e57bb73 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;
+}