1 # This file is part of the graph-includes package
3 # (c) 2005 Yann Dirson <ydirson@altern.org>
4 # Distributed under version 2 of the GNU GPL.
6 package graphincludes
::project
::default;
7 use graphincludes
::project
;
8 our @ISA = qw(graphincludes::project);
14 $self = $class->SUPER::new
(@_);
16 bless ($self, $class);
18 $self->{IGNOREDDEPS
} = $self->ignored_deps();
19 $self->{IGNOREDEDGES
} = {}; # to be computed in getdeps
26 my ($file,$level) = @_;
27 $level = $main::minshow
unless defined $level;
29 $file =~ s/^$self->{PFXSTRIP}// if defined $self->{PFXSTRIP
};
32 } elsif ($level == 1) {
33 $file =~ s/\.[^.]*$//;
35 } elsif ($level == 2) {
36 if ($file =~ m!(.*)/.*!) {
39 return '<' . $self->filelabel($file, $level - 1) . '>';
57 my $lbl = $self->{IGNOREDEDGES
}->{$src}->{$dst};
60 return "color=gray,constraint=false,label=\"$lbl\"";
62 return $self->SUPER::special_edge
($src,$dst);
71 my ($dstpath, $strip, $srcpath) = @_;
72 join ('/', @
$srcpath[0..($#$srcpath-$strip)], @$dstpath);
76 my @srcpath = split (m
|/|, $ARGV);
77 if (m/^\s*#\s*include\s*"(.*)"/) {
78 my @dstpath = split (m
|/|, $1);
80 while ($dstpath[0] eq '..') { $strip++; shift @dstpath; }
81 while ($#srcpath >= $strip and
82 !defined $self->{NODEIDS
}->{$self->filelabel(fullpath
(\
@dstpath,$strip,\
@srcpath))})
84 my $dstfile = fullpath
(\
@dstpath,$strip,\
@srcpath);
85 if (grep { $_ eq $dstfile } @
{$self->{FILES
}}) {
86 my $orignode = $self->{NODEIDS
}->{$self->filelabel($ARGV)};
87 my $destnode = $self->{NODEIDS
}->{$self->filelabel($dstfile)};
88 if (defined $self->{IGNOREDDEPS
}->{$ARGV}->{$dstfile}) {
89 print STDERR
"ignoring $ARGV -> $dstfile\n" if $main::debug
;
90 $self->{IGNOREDEDGES
}->{$orignode}->{$destnode} =
91 $self->{IGNOREDDEPS
}->{$ARGV}->{$dstfile};
93 push (@
{$deps{$orignode}}, $destnode);
95 print STDERR
"ERROR: unknown file $dstfile referenced by $ARGV\n" if $main::verbose
>= 2;
97 } elsif (m/^\s*#\s*include\s*<(.*)>/) {
98 print STDERR
"Ignoring <$1> for now ($ARGV)\n" if $main::verbose
>= 2;