- Minor API file update.

- Minor bug fixes.
- Added new option on --documentation-ordinal (off by default).
- Added new option on --documentation-pedantic (off by default).
This commit is contained in:
Patrik Stridvall 2000-12-21 21:05:52 +00:00 committed by Alexandre Julliard
parent eba8cee584
commit d72981946f
6 changed files with 62 additions and 6 deletions

View File

@ -21,6 +21,7 @@ BOOL16 *
COLORREF *
CONTEXT86 *
CURSORICONINFO *
DRAWSTATEPROC16
DWORD *
HHOOK *
INT16 *

View File

@ -32,6 +32,7 @@ LPCVOID
LPDWORD
LPSTRRET
LPVOID
REFIID
REFGUID
void *

View File

@ -229,6 +229,7 @@ sub parse_spec_file {
my $options = \${$self->{OPTIONS}};
my $output = \${$self->{OUTPUT}};
my $function_arguments = \%{$self->{FUNCTION_ARGUMENTS}};
my $function_ordinal = \%{$self->{FUNCTION_ORDINAL}};
my $function_calling_convention = \%{$self->{FUNCTION_CALLING_CONVENTION}};
my $function_internal_name = \%{$self->{FUNCTION_INTERNAL_NAME}};
my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}};
@ -283,6 +284,7 @@ sub parse_spec_file {
$$function_internal_name{$external_name} = $internal_name;
$$function_external_name{$internal_name} = $external_name;
$$function_arguments{$internal_name} = $arguments;
$$function_ordinal{$internal_name} = $ordinal;
$$function_calling_convention{$internal_name} = $calling_convention;
if(!$$function_module{$internal_name}) {
$$function_module{$internal_name} = "$module";
@ -333,7 +335,11 @@ sub parse_spec_file {
my $internal_name;
if($type eq "win16") {
$internal_name = $external_name . "16";
if($external_name =~ /\d$/) {
$internal_name = $external_name . "_16";
} else {
$internal_name = $external_name . "16";
}
} else {
$internal_name = $external_name;
}
@ -616,6 +622,15 @@ sub all_functions_found {
return sort(keys(%$function_found));
}
sub function_ordinal {
my $self = shift;
my $function_ordinal = \%{$self->{FUNCTION_ORDINAL}};
my $name = shift;
return $$function_ordinal{$name};
}
sub function_calling_convention {
my $self = shift;
my $function_calling_convention = \%{$self->{FUNCTION_CALLING_CONVENTION}};

View File

@ -494,7 +494,46 @@ foreach my $file ($options->c_files) {
}
if($documentation !~ /\b(\Q$external_name\E|$internal_name|$name1|$name2)\b/) {
$output->write("documentation: \\\n$documentation\n");
$output->write("documentation: wrong or missing name \\\n$documentation\n");
}
if($options->documentation_ordinal) {
if(defined($module16)) {
my $ordinal16 = $win16api->function_ordinal($internal_name);
if(!defined($ordinal16)) {
$output->write("function have no ordinal\n");
} else {
my @uc_modules16 = split(/\s*\&\s*/, uc($module16));
foreach my $uc_module16 (@uc_modules16) {
if($documentation !~ /\b$uc_module16\.\Q$ordinal16\E/) {
$output->write("documentation: wrong or missing ordinal " .
"expected (\U$module16\E.$ordinal16)\\\n$documentation\n");
}
}
}
}
if(defined($module32)) {
my $ordinal32 = $win32api->function_ordinal($internal_name);
if(!defined($ordinal32)) {
$output->write("function have no ordinal\n");
} else {
my @uc_modules32 = split(/\s*\&\s*/, uc($module32));
foreach my $uc_module32 (@uc_modules32) {
if($documentation !~ /\b$uc_module32\.\Q$ordinal32\E/) {
$output->write("documentation: wrong or missing ordinal " .
"expected (\U$module32\E.$ordinal32)\\\n$documentation\n");
}
}
}
}
}
if($options->documentation_pedantic) {
if($documentation !~ /^ \*\t\t\w+(?: \(\w+\.(?:\@|\d+)\))+/m) {
$output->write("documentation: pedantic check failed \\\n$documentation\n");
}
}
if($options->documentation_width) {

View File

@ -17,9 +17,7 @@ sub check_function {
my $module = $winapi->function_module($internal_name);
if($winapi->name eq "win16") {
my $name16 = $internal_name;
$name16 =~ s/16$//;
if($name16 ne $internal_name && $winapi->function_stub($name16)) {
if($winapi->function_stub($internal_name)) {
if($options->implemented) {
$output->write("function implemented but declared as stub in .spec file\n");
}

View File

@ -72,13 +72,15 @@ my %options = (
},
"debug-messages" => { default => 0, parent => "statements", description => "check for debug messages inconsistances" },
"documentation" => { default => 1, parent => "local", description => "check for documentation inconsistances\n" },
"documentation-pedantic" => { default => 0, parent => "documentation", description => "be pendantic when checking for documentation inconsistances\n" },
"documentation-width" => { default => 0, parent => "documentation", description => "check for documentation width inconsistances\n" },
"documentation-arguments" => { default => 1, parent => "documentation", description => "check for arguments documentation inconsistances\n" },
"documentation-ordinal" => { default => 0, parent => "documentation", description => "check for ordinal documentation inconsistances\n" },
"prototype" => { default => 0, parent => ["local", "headers"], description => "prototype checking" },
"global" => { default => 1, description => "global checking" },
"declared" => { default => 1, parent => "global", description => "declared checking" },
"implemented" => { default => 1, parent => "local", description => "implemented checking" },
"implemented" => { default => 0, parent => "local", description => "implemented checking" },
"implemented-win32" => { default => 0, parent => "implemented", description => "implemented as win32 checking" },
"include" => { default => 1, parent => "global", description => "include checking" },
"headers" => { default => 0, parent => "global", description => "headers checking" },