summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorgoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>1998-11-30 09:28:57 +0000
committergoodale <goodale@17b73243-c579-4c4c-a9d2-2d5706c11dac>1998-11-30 09:28:57 +0000
commitadb78bb339124dade1fa0511abd5bef4c9af375c (patch)
tree62a2c03a2c139d6973525f0746672b0e35a2dccc /lib
parent4673ea04eeb1562f8c6f0ed199bfaf67650e7e54 (diff)
Synchronsiing laptop with repository.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@30 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib')
-rw-r--r--lib/sbin/interface_parser.pl62
1 files changed, 62 insertions, 0 deletions
diff --git a/lib/sbin/interface_parser.pl b/lib/sbin/interface_parser.pl
index 9611563c..5fdf7904 100644
--- a/lib/sbin/interface_parser.pl
+++ b/lib/sbin/interface_parser.pl
@@ -83,11 +83,73 @@ sub cross_index_interface_data
$interface_data{"IMPLEMENTATIONS"} .= $implementations{"\U$implementation\E"} . " ";
&check_interface_consistency($implementation, %interface_data);
+
+ $interface_data{"IMPLEMENTATION \U$implementation\E ANCESTORS"} = &get_implementation_ancestors($implementation, %interface_data);
+
+ $interface_data{"IMPLEMENTATION \U$implementation\E FRIENDS"} = &get_implementation_friends($implementation, %interface_data);
+
}
+ return %interface_data;
+}
+
+sub get_implementation_friends
+{
+ local($implementation, %interface_data);
+ local($thorn);
+ local($friend, $friends);
+ local(%ancestors);
+
+ $interface_data{"IMPLEMENTATION \U$implementation\E THORNS"} =~ m:(\w+):;
+
+ $thorn = $1;
+
+ # Recurse. This needs to be made robust against loops.
+ foreach $ancestor (split(" ", $interface_data{"\U$thorn\E INHERITS"}))
+ {
+ $ancestors .= &get_implementation_ancestors($ancestor, %interface_data);
+ $ancestors .= "$ancestor ";
+ }
+ # Uniquify the list.
+ foreach $ancestor (split(" ", $ancestors))
+ {
+ $ancestors{"\U$ancestor\E"} = 1;
+ }
+
+ $ancestors = join(" ", %ancestors);
+
+ return $ancestors;
}
+sub get_implementation_ancestors
+{
+ local($implementation, %interface_data);
+ local($thorn);
+ local($ancestor, $ancestors);
+ local(%ancestors);
+
+ $interface_data{"IMPLEMENTATION \U$implementation\E THORNS"} =~ m:(\w+):;
+
+ $thorn = $1;
+
+ # Recurse. This needs to be made robust against loops.
+ foreach $ancestor (split(" ", $interface_data{"\U$thorn\E INHERITS"}))
+ {
+ $ancestors .= &get_implementation_ancestors($ancestor, %interface_data);
+ $ancestors .= "$ancestor ";
+ }
+
+ # Uniquify the list.
+ foreach $ancestor (split(" ", $ancestors))
+ {
+ $ancestors{"\U$ancestor\E"} = 1;
+ }
+
+ $ancestors = join(" ", %ancestors);
+
+ return $ancestors;
+}
sub check_interface_consistency
{