my(%symtab)=();
-my($D);
-die if !GetOptions("d|debug+",\$D);
+my $D;
+my $opt_nm="nm";
+my $opt_headers=1;
+die if !GetOptions(
+ "d|debug+",\$D,
+ "nm=s" ,\$opt_nm,
+ "headers!",\$opt_headers,
+ );
sub defmiss
});
}
-open(NM,"-|",'find -name "*.o"|xargs nm -f posix --print-file-name --no-sort --line-numbers')
+open(NM,"-|",'find -name "*.o"|xargs -- '.$opt_nm.' -f posix --print-file-name --no-sort --line-numbers')
or die "Cannot get nm output: $!";
while (<NM>) {
chomp;
}
close NM;
-open(CTAGS,"-|",'find -name "*.h"|xargs ctags -f - --c-types=xp')
- or die "Cannot get ctags output: $!";
-while (<CTAGS>) {
- chomp;
- die "Line $. of ctags output not recognized: $_"
- # $1 $2 $3
- if !/^([^\t]*)\t([^\t]*)\t.*\t(\w)$/;
- storesym(
- "name"=>$1,
- "fn_c"=>$2,
- "type"=>"c$3",
- );
+if ($opt_headers) {
+ open(CTAGS,"-|",'find -name "*.h"|xargs ctags -f - --c-types=xp')
+ or die "Cannot get ctags output: $!";
+ while (<CTAGS>) {
+ chomp;
+ die "Line $. of ctags output not recognized: $_"
+ # $1 $2 $3
+ if !/^([^\t]*)\t([^\t]*)\t.*\t(\w)$/;
+ storesym(
+ "name"=>$1,
+ "fn_c"=>$2,
+ "type"=>"c$3",
+ );
+ }
+ close CTAGS;
}
-close CTAGS;
print Data::Dumper->Dump([\%symtab],["%symtab"]) if $D;
}
# >=1 n[:upper:]\U symbol && ==0 nU symbol => global singularity
- if (@{refendef($ref=$$typesref{"n+"})}>=1 && @{refendef($$typesref{"n-"})}==0) {
+ if (@{refendef($ref=$$typesref{"n+"})}>=1 && @{refendef($$typesref{"nU"})}==0) {
dumpsyms("global singularity",@{$ref});
}