1999-09-23 17:14:20 +02:00
|
|
|
package winapi_global;
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
|
|
|
|
sub check {
|
|
|
|
my $options = shift;
|
1999-10-31 03:08:38 +01:00
|
|
|
my $output = shift;
|
1999-09-23 17:14:20 +02:00
|
|
|
my $winapi = shift;
|
|
|
|
my $nativeapi = shift;
|
|
|
|
|
|
|
|
my $winver = $winapi->name;
|
|
|
|
|
|
|
|
if($options->argument) {
|
|
|
|
foreach my $type ($winapi->all_declared_types) {
|
1999-10-31 03:08:38 +01:00
|
|
|
if(!$winapi->type_found($type) && !$winapi->is_limited_type($type) && $type ne "CONTEXT86 *") {
|
|
|
|
$output->write("*.c: $winver: ");
|
|
|
|
$output->write("type ($type) not used\n");
|
1999-09-23 17:14:20 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if($options->declared) {
|
|
|
|
foreach my $name ($winapi->all_functions) {
|
|
|
|
if(!$winapi->function_found($name) && !$nativeapi->is_function($name)) {
|
1999-10-24 23:45:39 +02:00
|
|
|
my $module = $winapi->function_module($name);
|
1999-10-31 03:08:38 +01:00
|
|
|
$output->write("*.c: $module: $name: ");
|
|
|
|
$output->write("function declared but not implemented: " . $winapi->function_arguments($name) . "\n");
|
1999-09-23 17:14:20 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-04-15 22:39:55 +02:00
|
|
|
if($options->argument && $options->argument_forbidden) {
|
1999-10-24 23:45:39 +02:00
|
|
|
my $not_used = $winapi->types_not_used;
|
|
|
|
|
|
|
|
foreach my $module (sort(keys(%$not_used))) {
|
|
|
|
foreach my $type (sort(keys(%{$$not_used{$module}}))) {
|
2000-01-29 22:01:47 +01:00
|
|
|
$output->write("*.c: $module: type ($type) not used\n");
|
1999-09-23 17:14:20 +02:00
|
|
|
}
|
2000-01-29 22:01:47 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
my $types_used = $winapi->types_unlimited_used_in_modules;
|
|
|
|
|
|
|
|
foreach my $type (sort(keys(%$types_used))) {
|
|
|
|
$output->write("*.c: type ($type) only used in module[s] (");
|
|
|
|
my $count = 0;
|
|
|
|
foreach my $module (sort(keys(%{$$types_used{$type}}))) {
|
|
|
|
if($count++) { $output->write(", "); }
|
|
|
|
$output->write("$module");
|
|
|
|
}
|
|
|
|
$output->write(")\n");
|
|
|
|
}
|
1999-09-23 17:14:20 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|
|
|
|
|