- API files update

- Minor bug fixes.
- Added new option --cross-call-unicode-ascii for checking illegal
  Unicode to ASCII calls.
This commit is contained in:
Patrik Stridvall 2000-04-29 14:24:11 +00:00 committed by Alexandre Julliard
parent fbc15b1768
commit 5dadbf3289
6 changed files with 78 additions and 36 deletions

View File

@ -1,7 +1,6 @@
%long
BOOL
BYTE
COLORREF
DWORD
HANDLE
@ -11,13 +10,12 @@ HGLOBAL
HMENU
HICON
HINSTANCE
HIMAGELIST
HKEY
HMODULE
HRESULT
HWND
INT
LONG
LPARAM
LRESULT
UINT
ULONG
@ -25,6 +23,7 @@ WCHAR
WORD
WPARAM
%long # --forbidden
int
@ -36,7 +35,7 @@ DLLVERSIONINFO *
DWORD *
HICON *
HIMAGELIST *
IDropTarget *
HWND *
IShellFolder **
IStream *
IUnknown *
@ -45,8 +44,14 @@ LPBYTE
LPCITEMIDLIST
LPCITEMIDLIST *
LPCNOTIFYREGISTER
LPCRECT
LPCSHELLFOLDERVIEWINFO
LPCVOID
LPCVOID *
LPDATAOBJECT
LPDRAWITEMSTRUCT
LPDROPSOURCE
LPDROPTARGET
LPDWORD
LPFNCREATEINSTANCE
LPFNFMCALLBACK
@ -56,12 +61,13 @@ LPITEMIDLIST *
LPMALLOC *
LPMEASUREITEMSTRUCT
LPNOTIFYREGISTER
LPPOINT
LPSECURITY_ATTRIBUTES
LPSHELLEXECUTEINFOA
LPSHELLEXECUTEINFOW
LPSHELLFLAGSTATE
LPSHELLFOLDER
LPSHELLVIEWDATA
LPSHELLVIEW *
LPSHFILEOPSTRUCTA
LPSHFILEOPSTRUCTW
LPSTRRET
@ -73,6 +79,7 @@ LPVOID *
LPWORD
LPWSTR *
PAPPBARDATA
PLONG
PNOTIFYICONDATAA
PNOTIFYICONDATAW
POINT *

View File

@ -1,7 +1,6 @@
%long
BOOL
BYTE
DWORD
INT
LONG
@ -31,6 +30,7 @@ LPSTR
%void
VOID
void
%wstr

View File

@ -54,14 +54,18 @@ if(length($wine_dir) != 1) {
$current_dir =~ s/\/.$//;
}
my $options = winapi_options->new(\@ARGV, $wine_dir);
if($options->help) {
my $output = 'output'->new;
my $options = winapi_options->new($output, \@ARGV, $wine_dir);
if(!defined($options)) {
$output->write("usage: winapi_check [--help] [<files>]\n");
exit 1;
} elsif($options->help) {
$options->show_help;
exit;
}
my $output = 'output'->new;
my $modules = 'modules'->new($options, $output, $wine_dir, $current_dir, "$winapi_check_dir/modules.dat");
my $win16api = 'winapi'->new($options, $output, "win16", "$winapi_check_dir/win16");
@ -514,10 +518,7 @@ foreach my $file ($options->c_files) {
if($nativeapi->is_conditional_header($header)) {
if(!$preprocessor->is_def($macro)) {
if($macro =~ /^HAVE_X11/) {
if(!$preprocessor->is_undef("X_DISPLAY_MISSING")) {
$output->write("$file: #$directive $argument: is a conditional include, " .
"but is not protected\n");
}
# Do nothing X Windows is handled differently
} elsif($macro =~ /^HAVE_(.*?)_H$/) {
if($header ne "alloca.h" && !$preprocessor->is_def("STATFS_DEFINED_BY_$1")) {
$output->write("$file: #$directive $argument: is a conditional include, " .

View File

@ -185,18 +185,31 @@ sub check_file {
my @called_names = $$functions{$name}->called_function_names;
my @called_by_names = $$functions{$name}->called_by_function_names;
my $module = $$functions{$name}->module;
my $module16 = $$functions{$name}->module16;
my $module32 = $$functions{$name}->module32;
if($#called_names >= 0 && (defined($module16) || defined($module32)) ) {
for my $called_name (@called_names) {
my $called_module16 = $$functions{$called_name}->module16;
my $called_module32 = $$functions{$called_name}->module32;
if(defined($module32) &&
defined($called_module16) && !defined($called_module32) &&
$name ne $called_name)
{
$output->write("$file: $module: $name: illegal call to $called_name (Win16)\n");
if($options->cross_call_win32_win16) {
my $module16 = $$functions{$name}->module16;
my $module32 = $$functions{$name}->module32;
if($#called_names >= 0 && (defined($module16) || defined($module32)) ) {
for my $called_name (@called_names) {
my $called_module16 = $$functions{$called_name}->module16;
my $called_module32 = $$functions{$called_name}->module32;
if(defined($module32) &&
defined($called_module16) && !defined($called_module32) &&
$name ne $called_name)
{
$output->write("$file: $module: $name: illegal call to $called_name (Win32 -> Win16)\n");
}
}
}
}
if($options->cross_call_unicode_ascii) {
if($name =~ /W$/) {
for my $called_name (@called_names) {
if($called_name =~ /A$/) {
$output->write("$file: $module: $name: illegal call to $called_name (Unicode -> ASCII)\n");
}
}
}
}

View File

@ -61,6 +61,12 @@ my %options = (
"calling-convention" => { default => 0, parent => "local", description => "calling convention checking" },
"misplaced" => { default => 1, parent => "local", description => "check for misplaced functions" },
"cross-call" => { default => 0, parent => "local", description => "check for cross calling functions" },
"cross-call-win32-win16" => {
default => 0, parent => "cross-call", description => "check for cross calls between win32 and win16"
},
"cross-call-unicode-ascii" => {
default => 0, parent => "cross-call", description => "check for cross calls between Unicode and ASCII"
},
"documentation" => { default => 1, parent => "local", description => "check for documentation inconsistances\n" },
"documentation-width" => { default => 0, parent => "documentation", description => "check for documentation width inconsistances\n" },
@ -85,8 +91,10 @@ sub new {
my $self = {};
bless ($self, $class);
my $output = \${$self->{OUTPUT}};
$$output = shift;
my $refarguments = shift;
my @ARGV = @$refarguments;
my $wine_dir = shift;
$self->options_set("default");
@ -96,7 +104,13 @@ sub new {
my $module = \${$self->{MODULE}};
my $global = \${$self->{GLOBAL}};
while(defined($_ = shift @ARGV)) {
if($wine_dir eq ".") {
$$global = 1;
} else {
$$global = 0;
}
while(defined($_ = shift @$refarguments)) {
if(/^--(all|none)$/) {
$self->options_set("$1");
next;
@ -121,8 +135,9 @@ sub new {
$name = $1;
$prefix = "no";
if(defined($value)) {
print STDERR "<internal>: options with prefix 'no' can't take parameters\n";
exit 1;
$$output->write("options with prefix 'no' can't take parameters\n");
return undef;
}
}
@ -174,10 +189,16 @@ sub new {
$$module = { active => 1, filter => 1, hash => \%names };
}
elsif(/^-(.*)$/) {
print STDERR "<internal>: unknown option: $&\n";
print STDERR "<internal>: usage: winapi-check [--help] [<files>]\n";
exit 1;
$$output->write("unknown option: $_\n");
return undef;
} else {
if(!-e $_) {
$$output->write("$_: no such file or directory\n");
return undef;
}
push @$c_files, $_;
}
}
@ -194,10 +215,10 @@ sub new {
@$c_files = sort(map {
s/^.\/(.*)$/$1/;
if(!/spec\.c$/) {
$_;
} else {
if(/glue\.c|spec\.c$/) {
();
} else {
$_;
}
} split(/\n/, `find $c_paths -name \\*.c`));

View File

@ -221,7 +221,7 @@ sub parse_c_file {
#print " " . ($n + 1) . ": '$argument'\n";
$argument =~ s/^(IN OUT(?=\s)|IN(?=\s)|OUT(?=\s)|\s*)\s*//;
$argument =~ s/^(const(?=\s)|CONST(?=\s)|\s*)\s*//;
if($argument =~ /^...$/) {
if($argument =~ /^\.\.\.$/) {
$argument = "...";
} elsif($argument =~ /^((struct\s+|union\s+|enum\s+)?\w+)\s*((\*\s*?)*)\s*/) {
$argument = "$1";