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
|
|
|
|
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
|
|
|
|
2002-11-11 20:55:11 +01:00
|
|
|
sub check_modules {
|
|
|
|
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};
|
|
|
|
if(!defined($function) && !$nativeapi->is_function($internal_name) &&
|
|
|
|
!($module eq "user" && $internal_name =~
|
|
|
|
/^(?:GlobalAddAtomA|GlobalDeleteAtom|GlobalFindAtomA|
|
|
|
|
GlobalGetAtomNameA|lstrcmpiA)$/x))
|
|
|
|
{
|
|
|
|
$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
|
|
|
|
2002-11-11 20:55:11 +01:00
|
|
|
sub check_all_modules {
|
|
|
|
my $include2info = shift;
|
2000-01-29 22:01:47 +01:00
|
|
|
|
2002-11-11 20:55:11 +01:00
|
|
|
&winapi_documentation::report_documentation;
|
|
|
|
|
|
|
|
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;
|