Don't just assume everything is a Dos Device, or mirc will not get any
[wine.git] / tools / winapi_check / winapi_global.pm
blob80d15bf2e2928822e403a9711771da5404e0ef1b
1 package winapi_global;
3 use strict;
5 sub check {
6 my $options = shift;
7 my $output = shift;
8 my $winapi = shift;
9 my $nativeapi = shift;
11 my $winver = $winapi->name;
13 if($options->argument) {
14 foreach my $type ($winapi->all_declared_types) {
15 if(!$winapi->type_found($type) && !$winapi->is_limited_type($type) && $type ne "CONTEXT86 *") {
16 $output->write("*.c: $winver: ");
17 $output->write("type ($type) not used\n");
22 if($options->declared) {
23 foreach my $name ($winapi->all_functions) {
24 if(!$winapi->function_found($name) && !$nativeapi->is_function($name)) {
25 my $module = $winapi->function_module($name);
26 $output->write("*.c: $module: $name: ");
27 $output->write("function declared but not implemented: " . $winapi->function_arguments($name) . "\n");
32 if($options->argument && $options->argument_forbidden) {
33 my $not_used = $winapi->types_not_used;
35 foreach my $module (sort(keys(%$not_used))) {
36 foreach my $type (sort(keys(%{$$not_used{$module}}))) {
37 $output->write("*.c: $module: type ($type) not used\n");
41 my $types_used = $winapi->types_unlimited_used_in_modules;
43 foreach my $type (sort(keys(%$types_used))) {
44 $output->write("*.c: type ($type) only used in module[s] (");
45 my $count = 0;
46 foreach my $module (sort(keys(%{$$types_used{$type}}))) {
47 if($count++) { $output->write(", "); }
48 $output->write("$module");
50 $output->write(")\n");