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
|
2006-05-18 14:49:52 +02:00
|
|
|
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2002-03-10 00:29:33 +01:00
|
|
|
#
|
|
|
|
|
1999-09-23 17:14:20 +02:00
|
|
|
package winapi_global;
|
|
|
|
|
|
|
|
use strict;
|
2020-07-22 00:10:10 +02:00
|
|
|
use warnings 'all';
|
2001-07-24 01:20:56 +02:00
|
|
|
|
2002-11-11 20:55:11 +01:00
|
|
|
use modules qw($modules);
|
2001-07-24 01:20:56 +02:00
|
|
|
use nativeapi qw($nativeapi);
|
|
|
|
use options qw($options);
|
|
|
|
use output qw($output);
|
2002-11-11 20:55:11 +01:00
|
|
|
use winapi qw(@winapis);
|
2001-07-24 01:20:56 +02:00
|
|
|
|
2004-10-07 20:53:56 +02:00
|
|
|
sub check_modules($$) {
|
2002-11-11 20:55:11 +01:00
|
|
|
my $complete_module = shift;
|
|
|
|
my $module2functions = shift;
|
2001-07-24 01:20:56 +02:00
|
|
|
|
2002-11-11 20:55:11 +01:00
|
|
|
my @complete_modules = sort(keys(%$complete_module));
|
2001-07-24 01:20:56 +02:00
|
|
|
|
2002-11-11 20:55:11 +01:00
|
|
|
if($options->declared) {
|
|
|
|
foreach my $module (@complete_modules) {
|
|
|
|
foreach my $winapi (@winapis) {
|
|
|
|
if(!$winapi->is_module($module)) { next; }
|
|
|
|
my $functions = $$module2functions{$module};
|
|
|
|
foreach my $internal_name ($winapi->all_internal_functions_in_module($module)) {
|
2003-08-08 23:04:17 +02:00
|
|
|
next if $internal_name =~ /\./;
|
2002-11-11 20:55:11 +01:00
|
|
|
my $function = $functions->{$internal_name};
|
2006-01-04 14:49:22 +01:00
|
|
|
if(!defined($function) && !$nativeapi->is_function($internal_name))
|
2002-11-11 20:55:11 +01:00
|
|
|
{
|
|
|
|
$output->write("*.c: $module: $internal_name: " .
|
|
|
|
"function declared but not implemented or declared external\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2001-07-24 01:20:56 +02:00
|
|
|
}
|
1999-09-23 17:14:20 +02:00
|
|
|
|
2002-11-11 20:55:11 +01:00
|
|
|
if($options->argument && $options->argument_forbidden) {
|
|
|
|
foreach my $winapi (@winapis) {
|
|
|
|
my $types_not_used = $winapi->types_not_used;
|
|
|
|
foreach my $module (sort(keys(%$types_not_used))) {
|
|
|
|
if(!$$complete_module{$module}) { next; }
|
|
|
|
foreach my $type (sort(keys(%{$$types_not_used{$module}}))) {
|
|
|
|
$output->write("*.c: $module: type ($type) not used\n");
|
|
|
|
}
|
1999-09-23 17:14:20 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2002-11-11 20:55:11 +01:00
|
|
|
}
|
1999-09-23 17:14:20 +02:00
|
|
|
|
2004-10-07 20:53:56 +02:00
|
|
|
sub check_all_modules($) {
|
2002-11-11 20:55:11 +01:00
|
|
|
my $include2info = shift;
|
2000-01-29 22:01:47 +01:00
|
|
|
|
2004-10-07 20:53:56 +02:00
|
|
|
winapi_documentation::report_documentation();
|
|
|
|
|
2002-11-11 20:55:11 +01:00
|
|
|
if($options->headers_unused && $options->include) {
|
|
|
|
foreach my $name (sort(keys(%$include2info))) {
|
|
|
|
if(!$$include2info{$name}{used}) {
|
|
|
|
$output->write("*.c: $name: include file is never used\n");
|
2000-01-29 22:01:47 +01:00
|
|
|
}
|
|
|
|
}
|
1999-09-23 17:14:20 +02:00
|
|
|
}
|
2002-11-11 20:55:11 +01:00
|
|
|
|
|
|
|
$modules->global_report;
|
|
|
|
$nativeapi->global_report;
|
1999-09-23 17:14:20 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
1;
|