3 # Converts the cxref output files into a format that can be read into
4 # the DaVinci graph drawing program.
6 # (c) 1999 Andrew M. Bishop
13 die
"Usage: $0 cxref.include\n" if($#ARGV==-1);
15 open
(FUNCTION
,"<$ARGV[0]") || die
"Cannot open $ARGV[0]\n";
24 ($file,$function,$scope,@calls
)=split(/ /);
26 $localfunctions{$function}=1;
28 $function{$function}="$file:$function";
35 open
(FUNCTION
,"<$ARGV[0]") || die
"Cannot open $ARGV[0]\n";
40 ($file,$function,$scope,@calls
)=split(/ /);
44 print
"l(\"$file:$function\",n(\"\",[a(\"OBJECT\",\"$function\")],\n";
48 print
"l(\"$file:$function\",n(\"\",[a(\"OBJECT\",\"$function\")],\n";
52 foreach
$call (@calls
)
54 next
if($call =~
/\
&/);
56 if($call =~
/^
%(.
+)$
/)
58 print
"\te(\"\",[],r(\"$file:$1\")),\n";
60 elsif
($function{$call})
62 print
"\te(\"\",[],r(\"$function{$call}\")),\n";
66 print
"\te(\"\",[],r(\"$call\")),\n";
67 $sysfunctions{$call}=1;
73 foreach
$function (keys
(%sysfunctions
))
75 print
"l(\"$function\",n(\"\",[a(\"OBJECT\",\"$function\"),a(\"COLOR\",\"#808080\")],[]))\n,\n";