File: daVinvi_include.pl

package info (click to toggle)
cxref 1.6c-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 2,608 kB
  • ctags: 2,058
  • sloc: ansic: 18,218; yacc: 2,086; sh: 915; lex: 462; perl: 452; makefile: 418; lisp: 256; cpp: 188; python: 80
file content (58 lines) | stat: -rwxr-xr-x 1,153 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/sh
#
# Converts the cxref output files into a format that can be read into
# the DaVinci graph drawing program.
#
# (c) 1999 Andrew M. Bishop
#

exec perl -x $0 $*

#!perl

die "Usage: $0 cxref.include\n" if($#ARGV==-1);

open(INCLUDE,"<$ARGV[0]") || die "Cannot open $ARGV[0]\n";

%sysinclude=();

print "[\n";

while(<INCLUDE>)
  {
   chop;
   ($file,@includes)=split(/ /);

   if($file =~ /\.c$/)
       {
        print "l(\"$file\",n(\"\",[a(\"OBJECT\",\"$file\"),a(\"_GO\",\"ellipse\")],\n";
       }
   else
       {
        print "l(\"$file\",n(\"\",[a(\"OBJECT\",\"$file\")],\n";
       }

   print "\t[\n";
   foreach $include (@includes)
       {
        if($include =~ /^%(.+)$/)
            {
             print "\te(\"\",[],r(\"$1\")),\n";
            }
        else
            {
             $sysincludes{$include}=1;
             print "\te(\"\",[a(\"EDGEPATTERN\",\"dotted\")],r(\"<$include>\")),\n";
            }
       }
   print "\t]))\n,\n";
  }

foreach $include (keys(%sysincludes))
  {
   print "l(\"<$include>\",n(\"\",[a(\"OBJECT\",\"$include\"),a(\"COLOR\",\"#808080\")],[]))\n,\n";
  }

print "]\n";

close(INCLUDE);