Index: tools/winapi/winapi.pm =================================================================== RCS file: /home/wine/wine/tools/winapi/winapi.pm,v retrieving revision 1.1 diff -u -r1.1 winapi.pm --- tools/winapi/winapi.pm 19 Jul 2002 00:31:05 -0000 1.1 +++ tools/winapi/winapi.pm 21 Jul 2002 10:33:35 -0000 @@ -212,12 +213,12 @@ my $function_external_calling_convention = \%{$self->{FUNCTION_EXTERNAL_CALLING_CONVENTION}}; my $function_internal_name = \%{$self->{FUNCTION_INTERNAL_NAME}}; my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}}; - my $function_stub = \%{$self->{FUNCTION_STUB}}; my $function_forward = \%{$self->{FUNCTION_FORWARD}}; my $function_internal_module = \%{$self->{FUNCTION_INTERNAL_MODULE}}; my $function_external_module = \%{$self->{FUNCTION_EXTERNAL_MODULE}}; my $modules = \%{$self->{MODULES}}; my $module_files = \%{$self->{MODULE_FILES}}; + my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}}; my $file = shift; $file =~ s%^\./%%; @@ -268,6 +266,11 @@ $arguments .= "ptr"; } + if ($external_name ne "@") { + $$module_external_calling_convention{$module}{$external_name}=$calling_convention; + } else { + $$module_external_calling_convention{$module}{"\@$ordinal"}=$calling_convention; + } if(!$$function_internal_name{$external_name}) { $$function_internal_name{$external_name} = $internal_name; } else { @@ -341,7 +344,11 @@ my $internal_name = $external_name; - $$function_stub{$module}{$external_name} = 1; + if ($external_name ne "@") { + $$module_external_calling_convention{$module}{$external_name}="stub"; + } else { + $$module_external_calling_convention{$module}{"\@$ordinal"}="stub"; + } if(!$$function_internal_name{$external_name}) { $$function_internal_name{$external_name} = $internal_name; } else { @@ -376,6 +386,11 @@ my $forward_module = lc($3); my $forward_name = $4; + if ($external_name ne "@") { + $$module_external_calling_convention{$module}{$external_name}="forward"; + } else { + $$module_external_calling_convention{$module}{"\@$1"}="forward"; + } $$function_forward{$external_name} = "$module:$forward_module.$forward_name"; } elsif(/^(\d+|@)\s+(equate|extern|variable)/) { # ignore @@ -641,20 +653,20 @@ sub all_external_functions { my $self = shift; - my $function_internal_name = \%{$self->{FUNCTION_INTERNAL_NAME}}; + my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}}; - return sort(keys(%$function_internal_name)); + return sort(keys(%$function_external_name)); } sub all_external_functions_in_module { my $self = shift; - my $function_internal_name = \%{$self->{FUNCTION_INTERNAL_NAME}}; + my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}}; my $function_external_module = \%{$self->{FUNCTION_EXTERNAL_MODULE}}; my $module = shift; my @names; - foreach my $name (keys(%$function_internal_name)) { + foreach my $name (keys(%$function_external_name)) { if($$function_external_module{$name} eq $module) { push @names, $name; } @@ -663,25 +675,13 @@ return sort(@names); } -sub all_functions_stub { +sub all_functions_in_module { my $self = shift; - my $function_stub = \%{$self->{FUNCTION_STUB}}; - my $modules = \%{$self->{MODULES}}; - - my @stubs = (); - foreach my $module (keys(%$modules)) { - push @stubs, keys(%{$$function_stub{$module}}); - } - return sort(@stubs); -} - -sub all_functions_stub_in_module { - my $self = shift; - my $function_stub = \%{$self->{FUNCTION_STUB}}; + my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}}; my $module = shift; - return sort(keys(%{$$function_stub{$module}})); + return sort(keys(%{$$module_external_calling_convention{$module}})); } sub function_internal_ordinal { @@ -720,6 +720,16 @@ return $$function_external_calling_convention{$name}; } +sub function_external_calling_convention_in_module { + my $self = shift; + my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}}; + + my $module = shift; + my $name = shift; + + return $$module_external_calling_convention{$module}{$name}; +} + sub function_internal_name { my $self = shift; my $function_internal_name = \%{$self->{FUNCTION_INTERNAL_NAME}}; @@ -810,14 +820,14 @@ sub is_function_stub { my $self = shift; - my $function_stub = \%{$self->{FUNCTION_STUB}}; + my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}}; my $modules = \%{$self->{MODULES}}; my $module = shift; my $name = shift; foreach my $module (keys(%$modules)) { - if($$function_stub{$module}{$name}) { + if($$module_external_calling_convention{$module}{$name} eq "stub") { return 1; } } @@ -827,13 +837,16 @@ sub is_function_stub_in_module { my $self = shift; - my $function_stub = \%{$self->{FUNCTION_STUB}}; + my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}}; my $module = shift; my $name = shift; - return $$function_stub{$module}{$name}; + if (!defined $$module_external_calling_convention{$module}{$name}) { + return 0; + } + return $$module_external_calling_convention{$module}{$name} eq "stub"; } ######################################################################## --- ../wine2/tools/winapi/winapi_extract Sun Jul 21 03:05:00 2002 +++ tools/winapi/winapi_extract Sun Jul 21 02:56:34 2002 @@ -391,15 +391,10 @@ if($type eq "win16" && !$options->win16) { next; } if($type eq "win32" && !$options->win32) { next; } - my %module_stub_count; - my %module_total_count; - - foreach my $internal_name ($winapi->all_internal_functions,$winapi->all_functions_stub) { - foreach my $module (split(/ \& /, $winapi->function_internal_module($internal_name))) { - if($winapi->is_function_stub_in_module($module, $internal_name)) { - $module_stub_count{$module}++; - } - $module_total_count{$module}++; + my %module_counts; + foreach my $module ($winapi->all_modules()) { + foreach my $external_name ($winapi->all_functions_in_module($module)) { + $module_counts{$module}{$winapi->function_external_calling_convention_in_module($module,$external_name)}++; } } @@ -410,18 +405,23 @@ } elsif($winapi->name eq "win32") { $pseudo_stubs = $module_pseudo_stub_count32{$module}; } + $pseudo_stubs = 0 if (!defined $pseudo_stubs); + + my $real_stubs = $module_counts{$module}{stub}; + $real_stubs = 0 if (!defined $real_stubs); - my $real_stubs = $module_stub_count{$module}; - my $total = $module_total_count{$module}; + my $forwards = $module_counts{$module}{forward}; + $forwards = 0 if (!defined $forwards); - if(!defined($real_stubs)) { $real_stubs = 0; } - if(!defined($pseudo_stubs)) { $pseudo_stubs = 0; } - if(!defined($total)) { $total = 0;} + my $total = 0; + foreach my $count (values %{$module_counts{$module}}) { + $total += $count; + } my $stubs = $real_stubs + $pseudo_stubs; $output->write("*.c: $module: "); - $output->write("$stubs of $total functions are stubs ($real_stubs real, $pseudo_stubs pseudo)\n"); + $output->write("$stubs of $total functions are stubs ($real_stubs real, $pseudo_stubs pseudo) and $forwards are forwards\n"); } } }