diff options
-rw-r--r-- | scripts/Targets.pm | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/scripts/Targets.pm b/scripts/Targets.pm index a8e3a0c..4f460a2 100644 --- a/scripts/Targets.pm +++ b/scripts/Targets.pm @@ -936,7 +936,7 @@ sub findConnections return ""; } - foreach my $child (@{ $self->getTargetChildren($target) }) + foreach my $child ($self->getAllTargetChildren($target)) { my $child_bus_type = $self->getBusType($child); if ($child_bus_type eq $bus_type) @@ -1244,6 +1244,27 @@ sub getTargetChildren return $target_ptr->{CHILDREN}; } +## returns an array of all child (including grandchildren) target names +sub getAllTargetChildren +{ + my $self = shift; + my $target = shift; + my @children; + + my $targets = $self->getTargetChildren($target); + if ($targets ne "") + { + for my $child (@$targets) + { + push @children, $child; + my @more = $self->getAllTargetChildren($child); + push @children, @more; + } + } + + return @children; +} + sub getEnumValue { my $self = shift; @@ -1556,6 +1577,11 @@ C<INDEX>. Returns an array of target strings representing all the children of target C<TARGET_STRING>. +=item getAllTargetChildren(C<TARGET_STRING>) + +Returns an array of target strings representing all the children of target +C<TARGET_STRING>, including grandchildren and below as well. + =item getEnumValue(C<ENUM_TYPE>,C<ENUM_NAME>) Returns the enum value of type C<ENUM_TYPE> and name C<ENUM_NAME>. The |