- Implemented stub statistics. Turned off by default. (Requested by Francois
Gouget).
- Implemented missing prototype checking. Turned off by default (Requested
by Dimitry Timoshkov).
- Implemented .spec file name sanity checking. Turned off by default.
- Implemented documentation width checking. Turned off by default.
- Minor bug fixes.
diff --git a/tools/winapi_check/winapi_parser.pm b/tools/winapi_check/winapi_parser.pm
index e8b263c..2c21eb3 100644
--- a/tools/winapi_check/winapi_parser.pm
+++ b/tools/winapi_check/winapi_parser.pm
@@ -36,6 +36,7 @@
my %regs_entrypoints;
my @comments = ();
my $level = 0;
+ my $extern_c = 0;
my $again = 0;
my $lookahead = 0;
my $lookahead_count = 0;
@@ -55,7 +56,8 @@
$lookahead_count = 0;
}
$lookahead_count++;
- print " $level: $line\n" if $options->debug >= 2;
+ print " $level($lookahead_count): $line\n" if $options->debug >= 2;
+ print "*** $_\n" if $options->debug >= 3;
} else {
$lookahead_count = 0;
$again = 0;
@@ -88,11 +90,17 @@
} else {
&$preprocessor_found_callback($1, "");
}
- $again = 1;
next;
}
}
+ # Remove extern "C"
+ if(s/^\s*extern\s+"C"\s+\{//m) {
+ $extern_c = 1;
+ $again = 1;
+ next;
+ }
+
my $documentation;
{
my $n = $#comments;
@@ -157,6 +165,10 @@
$line .= "}" if $level > 1;
print "-1: \}$_\n" if $options->debug >= 2;
$level--;
+ if($level == -1 && $extern_c) {
+ $extern_c = 0;
+ $level = 0;
+ }
}
if($line !~ /^\s*$/) {
@@ -166,7 +178,7 @@
if($function && $level == 0) {
&$function_end;
}
- next;
+ next;
} elsif(/(extern\s+|static\s+)?((struct\s+|union\s+|enum\s+)?\w+((\s*\*)+\s*|\s+))((__cdecl|__stdcall|VFWAPIV|VFWAPI|WINAPIV|WINAPI)\s+)?(\w+(\(\w+\))?)\s*\(([^\)]*)\)\s*(\{|\;)/s) {
$_ = $'; $again = 1;
@@ -300,6 +312,8 @@
$_ = $'; $again = 1;
} elsif(/;/s) {
$_ = $'; $again = 1;
+ } elsif(/extern\s+"C"\s+{/s) {
+ $_ = $'; $again = 1;
} elsif(/\{/s) {
$_ = $'; $again = 1;
print "+1: $_\n" if $options->debug >= 2;