Minor API files update.
diff --git a/tools/winapi_check/modules.dat b/tools/winapi_check/modules.dat index 41f2d89..2207979 100644 --- a/tools/winapi_check/modules.dat +++ b/tools/winapi_check/modules.dat
@@ -58,7 +58,6 @@ graphics/metafiledrv graphics/win16drv graphics -memory objects % dlls/gdi/gdi32.spec @@ -91,7 +90,6 @@ dlls/kernel files -if1632 loader/ne loader memory @@ -299,6 +297,8 @@ % dlls/ttydrv/ttydrv.spec +dlls/ttydrv + % dlls/urlmon/urlmon.spec dlls/urlmon @@ -314,7 +314,7 @@ % dlls/user/keyboard.spec -memory +dlls/user windows % dlls/user/mouse.spec @@ -325,7 +325,6 @@ controls dlls/user -if1632 memory misc windows @@ -335,7 +334,6 @@ controls dlls/user loader -memory misc windows @@ -452,3 +450,6 @@ % dlls/x11drv/x11drv.spec +dlls/x11drv +graphics/x11drv +windows/x11drv
diff --git a/tools/winapi_check/nativeapi.pm b/tools/winapi_check/nativeapi.pm index 1c6e23a..023523a 100644 --- a/tools/winapi_check/nativeapi.pm +++ b/tools/winapi_check/nativeapi.pm
@@ -50,17 +50,32 @@ while($again || (defined($_ = <IN>))) { $again = 0; chomp; - if(/(.*)\\$/) { - my $line = <IN>; - if(defined($line)) { - $_ = $1 . " " . $line; + if(/^(.*?)\\$/) { + my $current = $1; + my $next = <IN>; + if(defined($next)) { + # remove trailing whitespace + $current =~ s/\s+$//; + + # remove leading whitespace + $next =~ s/^\s+//; + + $_ = $current . " " . $next; + $again = 1; next; } } + # remove leading and trailing whitespace s/^\s*(.*?)\s*$/$1/; + # skip emty lines + if(/^$/) { next; } + + # skip comments + if(/^dnl/) { next; } + if(/^AC_CHECK_HEADERS\(\s*(.*?)\)\s*$/) { my @arguments = split(/,/,$1); foreach my $name (split(/\s+/, $arguments[0])) { @@ -85,7 +100,13 @@ open(IN, "< $config_h_in_file"); local $/ = "\n"; while(<IN>) { - if(/^\#undef\s+(\S+)\s*$/) { + # remove leading and trailing whitespace + s/^\s*(.*?)\s*$/$1/; + + # skip emty lines + if(/^$/) { next; } + + if(/^\#undef\s+(\S+)$/) { $$conditionals{$1}++; } } @@ -112,6 +133,15 @@ return $$conditionals{$name}; } +sub found_conditional { + my $self = shift; + my $conditional_found = \%{$self->{CONDITIONAL_FOUND}}; + + my $name = shift; + + $$conditional_found{$name}++; +} + sub is_conditional_header { my $self = shift; my $conditional_headers = \%{$self->{CONDITIONAL_HEADERS}}; @@ -130,4 +160,25 @@ return $$conditional_functions{$name}; } +sub global_report { + my $self = shift; + + my $output = \${$self->{OUTPUT}}; + my $conditional_found = \%{$self->{CONDITIONAL_FOUND}}; + my $conditionals = \%{$self->{CONDITIONALS}}; + + my @messages; + foreach my $name (sort(keys(%$conditionals))) { + if($name =~ /^const|inline|size_t$/) { next; } + + if(0 && !$$conditional_found{$name}) { + push @messages, "config.h.in: conditional $name not used\n"; + } + } + + foreach my $message (sort(@messages)) { + $$output->write($message); + } +} + 1;
diff --git a/tools/winapi_check/win16/compobj.api b/tools/winapi_check/win16/compobj.api index cdabd57..cd5a8f4 100644 --- a/tools/winapi_check/win16/compobj.api +++ b/tools/winapi_check/win16/compobj.api
@@ -49,6 +49,5 @@ BOOL16 HINSTANCE16 HTASK16 -OLESTATUS INT16 WORD
diff --git a/tools/winapi_check/win32/ntdll.api b/tools/winapi_check/win32/ntdll.api index 9d72608..e1020b0 100644 --- a/tools/winapi_check/win32/ntdll.api +++ b/tools/winapi_check/win32/ntdll.api
@@ -46,6 +46,7 @@ CONTEXT86 * CRITICAL_SECTION * DWORD * +EXCEPTION_FRAME * EXCEPTION_RECORD * HANDLE * LPBYTE @@ -56,13 +57,12 @@ LPVOID LPVOID * LPWSTR * +OBJECT_ATTRIBUTES * PACE_HEADER PACE_HEADER * PACL PACL * -PANSI_STRING PBOOLEAN -PCHAR PDWORD PEXCEPTION_FRAME PEXCEPTION_RECORD @@ -90,7 +90,8 @@ PUNICODE_STRING PVOID PVOID * -PWCHAR +STRING * +UNICODE_STRING * VOID * struct _TEB * void *
diff --git a/tools/winapi_check/win32/ttydrv.api b/tools/winapi_check/win32/ttydrv.api new file mode 100644 index 0000000..271dc1d --- /dev/null +++ b/tools/winapi_check/win32/ttydrv.api
@@ -0,0 +1,36 @@ +%long + +BOOL +CHAR +DWORD +HANDLE +LONG +UINT +WORD + +%long # --forbidden + +INT16 +UINT16 +int + +%ptr + +BYTE * +KEYBOARD_CONFIG * +LPBYTE +LPDIDEVICEOBJECTDATA +LPDWORD +LPMOUSE_EVENT_PROC +LPVOID +struct tagCURSORICONINFO * +struct tagWND * + +%str + +LPCSTR +LPSTR + +%void + +void
diff --git a/tools/winapi_check/win32/x11drv.api b/tools/winapi_check/win32/x11drv.api new file mode 100644 index 0000000..bddcfad --- /dev/null +++ b/tools/winapi_check/win32/x11drv.api
@@ -0,0 +1,36 @@ +%long + +BOOL +CHAR +DWORD +HANDLE +LONG +UINT +WORD + +%long # --forbidden + +INT16 +UINT16 +int + +%ptr + +BYTE * +CURSORICONINFO * +KEYBOARD_CONFIG * +LPBYTE +LPDIDEVICEOBJECTDATA +LPDWORD +LPMOUSE_EVENT_PROC +LPVOID +WND * + +%str + +LPCSTR +LPSTR + +%void + +void
diff --git a/tools/winapi_check/winapi_check b/tools/winapi_check/winapi_check index 27f3d0a..39630ae 100755 --- a/tools/winapi_check/winapi_check +++ b/tools/winapi_check/winapi_check
@@ -509,6 +509,8 @@ my $found_conditional = sub { local $_ = shift; + $nativeapi->found_conditional($_); + if($options->config) { if($file_type ne "application") { if(!$nativeapi->is_conditional($_)) { @@ -702,4 +704,5 @@ winapi_global::check $options, $output, $win32api, $nativeapi if $options->win32; $modules->global_report; + $nativeapi->global_report; }
diff --git a/tools/winapi_check/winapi_parser.pm b/tools/winapi_check/winapi_parser.pm index 5a4749b..630ec8f 100644 --- a/tools/winapi_check/winapi_parser.pm +++ b/tools/winapi_check/winapi_parser.pm
@@ -279,10 +279,20 @@ my @arguments = ("HDC16"); &$function_begin($documentation, "", $2, "WINAPI", $3, \@arguments); &$function_end; - } elsif(/DC_(GET_VAL_32)\s*\(\s*(.*?)\s*,\s*(.*?)\s*,.*?\)/s) { + } elsif(/DC_(GET_VAL)\s*\(\s*(.*?)\s*,\s*(.*?)\s*,.*?\)/s) { $_ = $'; $again = 1; - my @arguments = ("HDC"); - &$function_begin($documentation, "", $2, "WINAPI", $3, \@arguments); + my $return16 = $3 . "16"; + my $return32 = $3; + my $name16 = $2 . "16"; + my $name32 = $2; + my @arguments16 = ("HDC16"); + my @arguments32 = ("HDC"); + + if($name16 eq "COLORREF16") { $name16 = "COLORREF"; } + + &$function_begin($documentation, "", $name16, "WINAPI", $return16, \@arguments16); + &$function_end; + &$function_begin($documentation, "", $name32, "WINAPI", $return32, \@arguments32); &$function_end; } elsif(/DC_(GET_VAL_EX)\s*\(\s*(.*?)\s*,\s*(.*?)\s*,\s*(.*?)\s*,\s*(.*?)\s*\)/s) { $_ = $'; $again = 1;