From 9a4037d40891321a2f091cb1f1003bb1ee725136 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Mon, 31 Jan 2000 17:44:22 +0000 Subject: filter_same() implemented. Don't bet on it, yet. --- filter/tree.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'filter/tree.c') 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; +} -- cgit v1.2.3