7 die
"Usage: $0 <filename>\n" if($#ARGV==-1);
11 push
(@files
,$argv) if(-f $argv);
12 push
(@args
,$argv) if(! -f $argv);
15 $args=join(" ",@args
);
17 foreach
$file (@files
)
19 open
(CXREF
,"cxref $args $file -raw |") || die
"Cannot run cxref on $file\n";
32 if(m
/^FUNCTION
: ([a-z0-9A-Z_\$
]+) \
[([a-zA-Z
]+)\
]$
/)
35 $functype="static " if($2 eq
"Local");
38 $comment=1 if($function && m
/^
<<<$
/);
39 $comment=0 if($function && m
/^
>>>$
/);
41 $functype.
=substr
($1,0,length
($1)-length($funcname)-1) if($function && m
/^Type
: ([^
<]+)( <|
\n)/);
42 push
(@funcargs
,$1) if($function && m
/^Arguments
: ([^
<]+)( <|
\n)/);
44 if(!$comment && $function && (m
/^$
/ || m
/^
-+$
/))
46 push
(@funcargs
,"void") if($#funcargs==-1);
48 $f="$functype $funcname(".
join(",",@funcargs
).
");";
50 push
(@
local,$f) if($functype =~ m
/static
/);
51 push
(@global
,$f) if($functype !~ m
/static
/);
64 print
"\n /* local functions in $file */\n\n";
71 print
"\n /* global functions in $file */\n\n";