2002-03-10 00:29:33 +01:00
|
|
|
#
|
|
|
|
# Copyright 1999, 2000, 2001 Patrik Stridvall
|
|
|
|
#
|
|
|
|
# This library is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU Lesser General Public
|
|
|
|
# License as published by the Free Software Foundation; either
|
|
|
|
# version 2.1 of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This library is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
# Lesser General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Lesser General Public
|
|
|
|
# License along with this library; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
#
|
|
|
|
|
1999-09-23 17:14:20 +02:00
|
|
|
package winapi_global;
|
|
|
|
|
|
|
|
use strict;
|
2001-07-24 01:20:56 +02:00
|
|
|
|
|
|
|
use nativeapi qw($nativeapi);
|
|
|
|
use options qw($options);
|
|
|
|
use output qw($output);
|
|
|
|
use winapi qw($win16api $win32api @winapis);
|
|
|
|
|
1999-09-23 17:14:20 +02:00
|
|
|
sub check {
|
2001-07-24 01:20:56 +02:00
|
|
|
my $type_found = shift;
|
|
|
|
|
|
|
|
if($options->win16) {
|
|
|
|
_check($win16api, $type_found);
|
|
|
|
}
|
|
|
|
|
|
|
|
if($options->win32) {
|
|
|
|
_check($win32api, $type_found);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sub _check {
|
1999-09-23 17:14:20 +02:00
|
|
|
my $winapi = shift;
|
2001-07-18 22:09:12 +02:00
|
|
|
my $type_found = shift;
|
1999-09-23 17:14:20 +02:00
|
|
|
|
|
|
|
my $winver = $winapi->name;
|
|
|
|
|
|
|
|
if($options->argument) {
|
|
|
|
foreach my $type ($winapi->all_declared_types) {
|
2001-07-18 22:09:12 +02:00
|
|
|
if(!$$type_found{$type} && !$winapi->is_limited_type($type) && $type ne "CONTEXT86 *") {
|
1999-10-31 03:08:38 +01:00
|
|
|
$output->write("*.c: $winver: ");
|
|
|
|
$output->write("type ($type) not used\n");
|
1999-09-23 17:14:20 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-04-15 22:39:55 +02:00
|
|
|
if($options->argument && $options->argument_forbidden) {
|
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;
|
|
|
|
|