Make winapi_check understand the interface keyword.
diff --git a/tools/winapi/winapi_parser.pm b/tools/winapi/winapi_parser.pm
index 0f36c33..25e5320 100644
--- a/tools/winapi/winapi_parser.pm
+++ b/tools/winapi/winapi_parser.pm
@@ -140,7 +140,7 @@
my $names = shift;
foreach my $name (@$names) {
- if($type =~ /^(?:struct|enum)/) {
+ if($type =~ /^(?:enum|interface|struct|union)/) {
# $output->write("typedef $type {\n");
# $output->write("} $name;\n");
} else {
@@ -372,7 +372,7 @@
}
}
next;
- } elsif(/(extern\s+|static\s+)?((struct\s+|union\s+|enum\s+|signed\s+|unsigned\s+)?\w+((\s*\*)+\s*|\s+))
+ } elsif(/(extern\s+|static\s+)?((interface\s+|struct\s+|union\s+|enum\s+|signed\s+|unsigned\s+)?\w+((\s*\*)+\s*|\s+))
((__cdecl|__stdcall|__RPC_STUB|__RPC_USER|CDECL|NET_API_FUNCTION|RPC_ENTRY|VFWAPIV|VFWAPI|WINAPIV|WINAPI|CALLBACK)\s+)?
(\w+(\(\w+\))?)\s*\((.*?)\)\s*(\{|\;)/sx)
{
@@ -432,7 +432,7 @@
$argument_type = "...";
$argument_name = "...";
} elsif($argument =~ /^
- ((?:struct\s+|union\s+|enum\s+|register\s+|(?:signed\s+|unsigned\s+)
+ ((?:interface\s+|struct\s+|union\s+|enum\s+|register\s+|(?:signed\s+|unsigned\s+)
(?:short\s+(?=int)|long\s+(?=int))?)?(?:\w+|ElfW\(\w+\)|WS\(\w+\)))\s*
((?:__RPC_FAR|const|CONST|volatile)?\s*(?:\*\s*(?:__RPC_FAR|const|CONST|volatile)?\s*?)*)\s*
(\w*)\s*(\[\])?(?:\s+OPTIONAL)?$/x)
@@ -446,7 +446,7 @@
}
$argument_name = $3;
} elsif ($argument =~ /^
- ((?:struct\s+|union\s+|enum\s+|register\s+|(?:signed\s+|unsigned\s+)
+ ((?:interface\s+|struct\s+|union\s+|enum\s+|register\s+|(?:signed\s+|unsigned\s+)
(?:short\s+(?=int)|long\s+(?=int))?)?\w+)\s*
((?:const|volatile)?\s*(?:\*\s*(?:const|volatile)?\s*?)*)\s*
(?:__cdecl\s+|__stdcall\s+|__RPC_STUB\s+|__RPC_USER\s+|CALLBACK\s+|CDECL\s+|NET_API_FUNCTION\s+|RPC_ENTRY\s+|STDMETHODCALLTYPE\s+|VFWAPIV\s+|VFWAPI\s+|WINAPIV\s+|WINAPI\s+)?
@@ -465,7 +465,7 @@
$argument_type = "$return_type (*)($arguments)";
} elsif ($argument =~ /^
- ((?:struct\s+|union\s+|enum\s+|register\s+|(?:signed\s+|unsigned\s+)
+ ((?:interface\s+|struct\s+|union\s+|enum\s+|register\s+|(?:signed\s+|unsigned\s+)
(?:short\s+(?=int)|long\s+(?=int))?)?\w+)\s*
((?:const|volatile)?\s*(?:\*\s*(?:const|volatile)?\s*?)*)\s*
(\w+)\s*\[\s*(.*?)\s*\](?:\[\s*(.*?)\s*\])?$/x)
@@ -548,7 +548,7 @@
} elsif(/(DEFAULT|DECLARE)_DEBUG_CHANNEL\s*\((\S+)\)/s) {
$_ = $'; $again = 1;
push @$debug_channels, $1;
- } elsif(/typedef\s+(enum|struct|union)(?:\s+(\w+))?\s*\{/s) {
+ } elsif(/typedef\s+(enum|interface|struct|union)(?:\s+(\w+))?\s*\{/s) {
$_ = $'; $again = 1;
$level++;
my $type = $1;
@@ -557,7 +557,7 @@
}
&$type_begin($type);
} elsif(/typedef\s+
- ((?:const\s+|CONST\s+|enum\s+|long\s+|signed\s+|short\s+|struct\s+|union\s+|unsigned\s+|volatile\s+)*?)
+ ((?:const\s+|CONST\s+|enum\s+|interface\s+|long\s+|signed\s+|short\s+|struct\s+|union\s+|unsigned\s+|volatile\s+)*?)
(\w+)
(?:\s+const|\s+volatile)?
((?:\s*(?:(?:FAR|__RPC_FAR|TW_HUGE)?\s*)?\*+\s*|\s+)(?:volatile\s+|DECLSPEC_ALIGN\(\d+\)\s+)?\w+\s*(?:\[[^\]]*\])*
@@ -585,7 +585,7 @@
&$type_begin($type);
&$type_end([@names]);
} elsif(/typedef\s+
- (?:(?:const\s+|enum\s+|long\s+|signed\s+|short\s+|struct\s+|union\s+|unsigned\s+|volatile\s+)*?)
+ (?:(?:const\s+|enum\s+|interface\s+|long\s+|signed\s+|short\s+|struct\s+|union\s+|unsigned\s+|volatile\s+)*?)
(\w+(?:\s*\*+\s*)?)\s*
(?:(\w+)\s*)?
\((?:(\w+)\s*)?\s*(?:\*\s*(\w+)|_ATL_CATMAPFUNC)\s*\)\s*