2 # Copyright 1999, 2000, 2001 Patrik Stridvall
4 # This library is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU Lesser General Public
6 # License as published by the Free Software Foundation; either
7 # version 2.1 of the License, or (at your option) any later version.
9 # This library is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # Lesser General Public License for more details.
14 # You should have received a copy of the GNU Lesser General Public
15 # License along with this library; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
28 @EXPORT_OK = qw($win16api $win32api @winapis);
30 use vars qw($win16api $win32api @winapis);
32 use config qw($current_dir $wine_dir $winapi_dir);
33 use options qw($options);
34 use output qw($output);
36 use vars qw($modules);
39 $Exporter::ExportLevel++;
40 &Exporter::import(@_);
41 $Exporter::ExportLevel--;
43 if (defined($modules) && defined($win16api) && defined($win32api)) {
48 import modules qw($modules);
50 my @spec_files16 = $modules->allowed_spec_files16;
51 $win16api = 'winapi'->new("win16", \@spec_files16);
53 my @spec_files32 = $modules->allowed_spec_files32;
54 $win32api = 'winapi'->new("win32", \@spec_files32);
56 @winapis = ($win16api, $win32api);
58 for my $internal_name ($win32api->all_internal_functions) {
59 my $module16 = $win16api->function_internal_module($internal_name);
60 my $module32 = $win16api->function_internal_module($internal_name);
61 if(defined($module16) &&
62 !$win16api->is_function_stub_in_module($module16, $internal_name) &&
63 !$win32api->is_function_stub_in_module($module32, $internal_name))
65 $win16api->found_shared_internal_function($internal_name);
66 $win32api->found_shared_internal_function($internal_name);
74 my $class = ref($proto) || $proto;
76 bless ($self, $class);
78 my $name = \${$self->{NAME}};
79 my $function_forward = \%{$self->{FUNCTION_FORWARD}};
80 my $function_internal_name = \%{$self->{FUNCTION_INTERNAL_NAME}};
81 my $function_module = \%{$self->{FUNCTION_MODULE}};
84 my $refspec_files = shift;
86 foreach my $file (@$refspec_files) {
87 $self->parse_spec_file("$wine_dir/$file");
90 $self->parse_api_file("$$name.api");
92 foreach my $module (sort(keys(%$function_forward))) {
93 foreach my $external_name (sort(keys(%{$$function_forward{$module}}))) {
94 (my $forward_module, my $forward_external_name) = @{$$function_forward{$module}{$external_name}};
95 my $forward_internal_name = $$function_internal_name{$forward_external_name};
96 if(defined($forward_internal_name)) {
97 $$function_module{$forward_internal_name} .= " & $module";
116 my $allowed_kind = \%{$self->{ALLOWED_KIND}};
117 my $allowed_modules = \%{$self->{ALLOWED_MODULES}};
118 my $allowed_modules_limited = \%{$self->{ALLOWED_MODULES_LIMITED}};
119 my $allowed_modules_unlimited = \%{$self->{ALLOWED_MODULES_UNLIMITED}};
120 my $translate_argument = \%{$self->{TRANSLATE_ARGUMENT}};
121 my $type_format = \%{$self->{TYPE_FORMAT}};
131 $output->lazy_progress("$file");
133 open(IN, "< $winapi_dir/$file") || die "$winapi_dir/$file: $!\n";
136 s/^\s*?(.*?)\s*$/$1/; # remove whitespace at begin and end of line
137 s/^(.*?)\s*#.*$/$1/; # remove comments
138 /^$/ && next; # skip empty lines
142 $module =~ s/\.dll$//; # FIXME: Kludge
143 } elsif(!$modules->is_allowed_module($module)) {
145 } elsif(s/^%(\S+)\s*//) {
151 $$allowed_kind{$kind} = 1;
154 } elsif(/^--extension/) {
156 } elsif(/^--format=(\".*?\"|\S*)/) {
158 $format =~ s/^\"(.*?)\"$/$1/;
161 if(!defined($format)) {
162 if($kind eq "long") {
163 $format = "%d|%u|%x|%X|";
164 $format .= "%hd|%hu|%hx|%hX|";
165 $format .= "%ld|%lu|%lx|%lX|";
166 $format .= "%04x|%04X|0x%04x|0x%04X|";
167 $format .= "%08x|%08X|0x%08x|0x%08X|";
168 $format .= "%08lx|%08lX|0x%08lx|0x%08lX";
169 } elsif($kind eq "longlong") {
171 } elsif($kind eq "ptr") {
173 } elsif($kind eq "segptr") {
175 } elsif($kind eq "str") {
177 } elsif($kind eq "wstr") {
179 } elsif($kind eq "word") {
180 $format = "%d|%u|%x|%X|";
181 $format .= "%hd|%hu|%hx|%hX|";
182 $format .= "%04x|%04X|0x%04x|0x%04X";
184 $format = "<unknown>";
187 } elsif(defined($kind)) {
190 if(defined($module)) {
191 if($$allowed_modules_unlimited{$type}) {
192 $output->write("$file: type ($type) already specificed as an unlimited type\n");
193 } elsif(!$$allowed_modules{$type}{$module}) {
194 $$allowed_modules{$type}{$module} = 1;
195 $$allowed_modules_limited{$type} = 1;
197 $output->write("$file: type ($type) already specificed\n");
200 $$allowed_modules_unlimited{$type} = 1;
203 $$allowed_modules_limited{$type} = 1;
205 if(defined($$translate_argument{$type}) && $$translate_argument{$type} ne $kind) {
206 $output->write("$file: type ($type) respecified as different kind ($kind != $$translate_argument{$type})\n");
208 $$translate_argument{$type} = $kind;
211 $$type_format{$module}{$type} = $format;
213 $output->write("$file: file must begin with %<type> statement\n");
220 sub parse_spec_file {
223 my $function_internal_arguments = \%{$self->{FUNCTION_INTERNAL_ARGUMENTS}};
224 my $function_external_arguments = \%{$self->{FUNCTION_EXTERNAL_ARGUMENTS}};
225 my $function_internal_ordinal = \%{$self->{FUNCTION_INTERNAL_ORDINAL}};
226 my $function_external_ordinal = \%{$self->{FUNCTION_EXTERNAL_ORDINAL}};
227 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
228 my $function_external_calling_convention = \%{$self->{FUNCTION_EXTERNAL_CALLING_CONVENTION}};
229 my $function_internal_name = \%{$self->{FUNCTION_INTERNAL_NAME}};
230 my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}};
231 my $function_forward = \%{$self->{FUNCTION_FORWARD}};
232 my $function_internal_module = \%{$self->{FUNCTION_INTERNAL_MODULE}};
233 my $function_external_module = \%{$self->{FUNCTION_EXTERNAL_MODULE}};
234 my $function_wine_extension = \%{$self->{FUNCTION_WINE_EXTENSION}};
235 my $modules = \%{$self->{MODULES}};
236 my $module_files = \%{$self->{MODULE_FILES}};
237 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
244 my $wine_extension = 0;
246 $output->lazy_progress("$file");
249 $module =~ s/^.*?([^\/]*)\.spec$/$1/;
251 open(IN, "< $file") || die "$file: $!\n";
255 while($lookahead || defined($_ = <IN>)) {
258 if(s/^(.*?)\s*\#\s*(.*)\s*$/$1/) {
260 if ($comment =~ /^Wine/) { # FIXME: Kludge
267 if(/^\d+|@/) { $header = 0; $lookahead = 1; }
273 (pascal|pascal16|stdcall|cdecl|varargs)\s+
274 ((?:(?:-noimport|-noname|-norelay|-i386|-ret64|-register|-interrupt)\s+)*)(\S+)\s*\(\s*(.*?)\s*\)\s*(\S+)$/x)
276 my $calling_convention = $2;
278 my $external_name = $4;
280 my $internal_name = $6;
286 if($flags =~ /-noname/) {
287 # $external_name = "@";
290 if($flags =~ /(?:-register|-interrupt)/) {
291 if($arguments) { $arguments .= " "; }
293 $calling_convention .= " -register";
296 if ($internal_name =~ /^(.*?)\.(.*?)$/) {
297 my $forward_module = $1;
298 my $forward_name = $2;
301 $calling_convention .= " -forward";
303 $calling_convention = "forward";
306 $$function_forward{$module}{$external_name} = [$forward_module, $forward_name];
309 if($external_name ne "@") {
310 $$module_external_calling_convention{$module}{$external_name} = $calling_convention;
312 $$module_external_calling_convention{$module}{"\@$ordinal"} = $calling_convention;
314 if(!$$function_internal_name{$external_name}) {
315 $$function_internal_name{$external_name} = $internal_name;
317 $$function_internal_name{$external_name} .= " & $internal_name";
319 if(!$$function_external_name{$internal_name}) {
320 $$function_external_name{$internal_name} = $external_name;
322 $$function_external_name{$internal_name} .= " & $external_name";
324 $$function_internal_arguments{$internal_name} = $arguments;
325 $$function_external_arguments{$external_name} = $arguments;
326 if(!$$function_internal_ordinal{$internal_name}) {
327 $$function_internal_ordinal{$internal_name} = $ordinal;
329 $$function_internal_ordinal{$internal_name} .= " & $ordinal";
331 if(!$$function_external_ordinal{$external_name}) {
332 $$function_external_ordinal{$external_name} = $ordinal;
334 $$function_external_ordinal{$external_name} .= " & $ordinal";
336 $$function_internal_calling_convention{$internal_name} = $calling_convention;
337 $$function_external_calling_convention{$external_name} = $calling_convention;
338 if(!$$function_internal_module{$internal_name}) {
339 $$function_internal_module{$internal_name} = "$module";
341 $$function_internal_module{$internal_name} .= " & $module";
343 if(!$$function_external_module{$external_name}) {
344 $$function_external_module{$external_name} = "$module";
346 $$function_external_module{$external_name} .= " & $module";
348 $$function_wine_extension{$module}{$external_name} = $wine_extension;
350 if(0 && $options->spec_mismatch) {
351 if($external_name eq "@") {
352 if($internal_name !~ /^\U$module\E_$ordinal$/) {
353 $output->write("$file: $external_name: the internal name ($internal_name) mismatch\n");
356 my $name = $external_name;
362 $name2 =~ s/^(?:_|Rtl|k32|K32)//;
365 $name3 =~ s/^INT_Int[0-9a-f]{2}Handler$/BUILTIN_DefaultIntHandler/;
368 $name4 =~ s/^(VxDCall)\d$/$1/;
370 # FIXME: This special case is becuase of a very ugly kludge that should be fixed IMHO
372 $name5 =~ s/^(.*?16)_(.*?)$/$1_fn$2/;
374 if(uc($internal_name) ne uc($external_name) &&
375 $internal_name !~ /(\Q$name\E|\Q$name1\E|\Q$name2\E|\Q$name3\E|\Q$name4\E|\Q$name5\E)/)
377 $output->write("$file: $external_name: internal name ($internal_name) mismatch\n");
381 } elsif(/^(\d+|@)\s+stub(?:\s+(-noimport|-noname|-norelay|-i386|-ret64))?\s+(\S+)$/) {
385 my $external_name = $3;
387 $flags = "" if !defined($flags);
389 if($flags =~ /-noname/) {
390 # $external_name = "@";
393 my $internal_name = $external_name;
395 if ($external_name ne "@") {
396 $$module_external_calling_convention{$module}{$external_name} = "stub";
398 $$module_external_calling_convention{$module}{"\@$ordinal"} = "stub";
400 if(!$$function_internal_name{$external_name}) {
401 $$function_internal_name{$external_name} = $internal_name;
403 $$function_internal_name{$external_name} .= " & $internal_name";
405 if(!$$function_external_name{$internal_name}) {
406 $$function_external_name{$internal_name} = $external_name;
408 $$function_external_name{$internal_name} .= " & $external_name";
410 if(!$$function_internal_ordinal{$internal_name}) {
411 $$function_internal_ordinal{$internal_name} = $ordinal;
413 $$function_internal_ordinal{$internal_name} .= " & $ordinal";
415 if(!$$function_external_ordinal{$external_name}) {
416 $$function_external_ordinal{$external_name} = $ordinal;
418 $$function_external_ordinal{$external_name} .= " & $ordinal";
420 if(!$$function_internal_module{$internal_name}) {
421 $$function_internal_module{$internal_name} = "$module";
422 } else { # if($$function_internal_module{$internal_name} !~ /$module/) {
423 $$function_internal_module{$internal_name} .= " & $module";
425 if(!$$function_external_module{$external_name}) {
426 $$function_external_module{$external_name} = "$module";
427 } else { # if($$function_external_module{$external_name} !~ /$module/) {
428 $$function_external_module{$external_name} .= " & $module";
430 } elsif(/^(\d+|@)\s+forward(?:\s+(?:-noimport|-norelay|-i386|-ret64))?\s+(\S+)\s+(\S+)\.(\S+)$/) {
433 my $external_name = $2;
434 my $forward_module = lc($3);
435 my $forward_name = $4;
437 if ($external_name ne "@") {
438 $$module_external_calling_convention{$module}{$external_name} = "forward";
440 $$module_external_calling_convention{$module}{"\@$ordinal"} = "forward";
442 $$function_forward{$module}{$external_name} = [$forward_module, $forward_name];
443 } elsif(/^(\d+|@)\s+extern\s+(\S+)\s+(\S+)$/) {
446 my $external_name = $2;
447 my $internal_name = $3;
449 if ($external_name ne "@") {
450 $$module_external_calling_convention{$module}{$external_name} = "extern";
452 $$module_external_calling_convention{$module}{"\@$ordinal"} = "extern";
454 } elsif(/^(\d+|@)\s+(equate|variable)/) {
457 my $next_line = <IN>;
458 if(!defined($next_line) || $next_line =~ /^\s*\d|@/) {
459 die "$file: $.: syntax error: '$_'\n";
466 if(defined($ordinal)) {
467 if($ordinal ne "@" && $ordinals{$ordinal}) {
468 $output->write("$file: ordinal redefined: $_\n");
470 $ordinals{$ordinal}++;
475 $$modules{$module}++;
477 $$module_files{$module} = $file;
482 my $name = \${$self->{NAME}};
487 sub is_allowed_kind {
489 my $allowed_kind = \%{$self->{ALLOWED_KIND}};
493 return $$allowed_kind{$kind};
502 my $allowed_kind = \%{$self->{ALLOWED_KIND}};
506 $$allowed_kind{$kind}++;
509 sub is_limited_type {
511 my $allowed_modules_limited = \%{$self->{ALLOWED_MODULES_LIMITED}};
515 return $$allowed_modules_limited{$type};
518 sub is_allowed_type_in_module {
520 my $allowed_modules = \%{$self->{ALLOWED_MODULES}};
521 my $allowed_modules_limited = \%{$self->{ALLOWED_MODULES_LIMITED}};
524 my @modules = split(/ \& /, shift);
526 if(!$$allowed_modules_limited{$type}) { return 1; }
528 foreach my $module (@modules) {
529 if($$allowed_modules{$type}{$module}) { return 1; }
535 sub allow_type_in_module {
537 my $allowed_modules = \%{$self->{ALLOWED_MODULES}};
540 my @modules = split(/ \& /, shift);
542 foreach my $module (@modules) {
543 $$allowed_modules{$type}{$module}++;
547 sub type_used_in_module {
549 my $used_modules = \%{$self->{USED_MODULES}};
552 my @modules = split(/ \& /, shift);
554 foreach my $module (@modules) {
555 $$used_modules{$type}{$module} = 1;
563 my $used_modules = \%{$self->{USED_MODULES}};
564 my $allowed_modules = \%{$self->{ALLOWED_MODULES}};
567 foreach my $type (sort(keys(%$allowed_modules))) {
568 foreach my $module (sort(keys(%{$$allowed_modules{$type}}))) {
569 if(!$$used_modules{$type}{$module}) {
570 $$not_used{$module}{$type} = 1;
577 sub types_unlimited_used_in_modules {
580 my $used_modules = \%{$self->{USED_MODULES}};
581 my $allowed_modules = \%{$self->{ALLOWED_MODULES}};
582 my $allowed_modules_unlimited = \%{$self->{ALLOWED_MODULES_UNLIMITED}};
585 foreach my $type (sort(keys(%$allowed_modules_unlimited))) {
588 foreach my $module (sort(keys(%{$$used_modules{$type}}))) {
590 push @modules, $module;
593 foreach my $module (@modules) {
594 $$used_types{$type}{$module} = 1;
601 sub translate_argument {
603 my $translate_argument = \%{$self->{TRANSLATE_ARGUMENT}};
607 return $$translate_argument{$type};
610 sub declare_argument {
612 my $translate_argument = \%{$self->{TRANSLATE_ARGUMENT}};
617 $$translate_argument{$type} = $kind;
620 sub all_declared_types {
622 my $translate_argument = \%{$self->{TRANSLATE_ARGUMENT}};
624 return sort(keys(%$translate_argument));
627 sub is_allowed_type_format {
629 my $type_format = \%{$self->{TYPE_FORMAT}};
637 if(defined($module) && defined($type)) {
639 foreach (split(/ & /, $module)) {
640 if(defined($formats)) {
645 if(defined($$type_format{$_}{$type})) {
646 $formats .= $$type_format{$_}{$type};
651 if(defined($formats)) {
653 foreach (split(/\|/, $formats)) {
665 my $modules = \%{$self->{MODULES}};
667 return sort(keys(%$modules));
672 my $modules = \%{$self->{MODULES}};
676 return $$modules{$name};
684 my $module_files = \%{$self->{MODULE_FILES}};
686 return $$module_files{$module};
689 sub all_internal_functions {
691 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
693 return sort(keys(%$function_internal_calling_convention));
696 sub all_internal_functions_in_module {
698 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
699 my $function_internal_module = \%{$self->{FUNCTION_INTERNAL_MODULE}};
704 foreach my $name (keys(%$function_internal_calling_convention)) {
705 if($$function_internal_module{$name} eq $module) {
713 sub all_external_functions {
715 my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}};
717 return sort(keys(%$function_external_name));
720 sub all_external_functions_in_module {
722 my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}};
723 my $function_external_module = \%{$self->{FUNCTION_EXTERNAL_MODULE}};
728 foreach my $name (keys(%$function_external_name)) {
729 if($$function_external_module{$name} eq $module) {
737 sub all_functions_in_module {
739 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
743 return sort(keys(%{$$module_external_calling_convention{$module}}));
746 sub all_broken_forwards {
748 my $function_forward = \%{$self->{FUNCTION_FORWARD}};
750 my @broken_forwards = ();
751 foreach my $module (sort(keys(%$function_forward))) {
752 foreach my $external_name (sort(keys(%{$$function_forward{$module}}))) {
753 (my $forward_module, my $forward_external_name) = @{$$function_forward{$module}{$external_name}};
755 my $forward_external_calling_convention =
756 $self->function_external_calling_convention_in_module($forward_module, $forward_external_name);
758 if(!defined($forward_external_calling_convention)) {
759 push @broken_forwards, [$module, $external_name, $forward_module, $forward_external_name];
763 return @broken_forwards;
767 sub function_internal_ordinal {
769 my $function_internal_ordinal = \%{$self->{FUNCTION_INTERNAL_ORDINAL}};
773 return $$function_internal_ordinal{$name};
776 sub function_external_ordinal {
778 my $function_external_ordinal = \%{$self->{FUNCTION_EXTERNAL_ORDINAL}};
782 return $$function_external_ordinal{$name};
785 sub function_internal_calling_convention {
787 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
791 return $$function_internal_calling_convention{$name};
794 sub function_external_calling_convention {
796 my $function_external_calling_convention = \%{$self->{FUNCTION_EXTERNAL_CALLING_CONVENTION}};
800 return $$function_external_calling_convention{$name};
803 sub function_external_calling_convention_in_module {
805 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
810 return $$module_external_calling_convention{$module}{$name};
813 sub function_internal_name {
815 my $function_internal_name = \%{$self->{FUNCTION_INTERNAL_NAME}};
819 return $$function_internal_name{$name};
822 sub function_external_name {
824 my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}};
828 return $$function_external_name{$name};
831 sub function_forward_final_destination {
834 my $function_forward = \%{$self->{FUNCTION_FORWARD}};
839 my $forward_module = $module;
840 my $forward_name = $name;
841 while(defined(my $forward = $$function_forward{$forward_module}{$forward_name})) {
842 ($forward_module, $forward_name) = @$forward;
845 return ($forward_module, $forward_name);
850 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
854 return $$function_internal_calling_convention{$name};
857 sub all_shared_internal_functions {
859 my $function_shared = \%{$self->{FUNCTION_SHARED}};
861 return sort(keys(%$function_shared));
864 sub is_shared_internal_function {
866 my $function_shared = \%{$self->{FUNCTION_SHARED}};
870 return $$function_shared{$name};
873 sub found_shared_internal_function {
875 my $function_shared = \%{$self->{FUNCTION_SHARED}};
879 $$function_shared{$name} = 1;
882 sub function_internal_arguments {
884 my $function_internal_arguments = \%{$self->{FUNCTION_INTERNAL_ARGUMENTS}};
888 return $$function_internal_arguments{$name};
891 sub function_external_arguments {
893 my $function_external_arguments = \%{$self->{FUNCTION_EXTERNAL_ARGUMENTS}};
897 return $$function_external_arguments{$name};
900 sub function_internal_module {
902 my $function_internal_module = \%{$self->{FUNCTION_INTERNAL_MODULE}};
906 return $$function_internal_module{$name};
909 sub function_external_module {
911 my $function_external_module = \%{$self->{FUNCTION_EXTERNAL_MODULE}};
915 return $$function_external_module{$name};
918 sub function_wine_extension {
920 my $function_wine_extension = \%{$self->{FUNCTION_WINE_EXTENSION}};
925 return $$function_wine_extension{$module}{$name};
928 sub is_function_stub {
930 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
931 my $modules = \%{$self->{MODULES}};
936 foreach my $module (keys(%$modules)) {
937 if($$module_external_calling_convention{$module}{$name} eq "stub") {
945 sub is_function_stub_in_module {
947 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
952 if(!defined($$module_external_calling_convention{$module}{$name})) {
955 return $$module_external_calling_convention{$module}{$name} eq "stub";
958 ########################################################################
962 sub _get_all_module_internal_ordinal {
964 my $internal_name = shift;
969 my $name = $winapi->function_external_name($internal_name);
971 @name = split(/ & /, $name);
976 my $module = $winapi->function_internal_module($internal_name);
977 if(defined($module)) {
978 @module = split(/ & /, $module);
983 my $ordinal = $winapi->function_internal_ordinal($internal_name);
984 if(defined($ordinal)) {
985 @ordinal = split(/ & /, $ordinal);
992 while(defined($name = shift @name) &&
993 defined($module = shift @module) &&
994 defined($ordinal = shift @ordinal))
996 push @entries, [$name, $module, $ordinal];
1002 sub get_all_module_internal_ordinal16 {
1003 return _get_all_module_internal_ordinal($win16api, @_);
1006 sub get_all_module_internal_ordinal32 {
1007 return _get_all_module_internal_ordinal($win32api, @_);
1010 sub get_all_module_internal_ordinal {
1012 foreach my $winapi (@winapis) {
1013 push @entries, _get_all_module_internal_ordinal($winapi, @_);
1019 sub _get_all_module_external_ordinal {
1021 my $external_name = shift;
1026 my $name = $winapi->function_internal_name($external_name);
1027 if(defined($name)) {
1028 @name = split(/ & /, $name);
1033 my $module = $winapi->function_external_module($external_name);
1034 if(defined($module)) {
1035 @module = split(/ & /, $module);
1040 my $ordinal = $winapi->function_external_ordinal($external_name);
1041 if(defined($ordinal)) {
1042 @ordinal = split(/ & /, $ordinal);
1049 while(defined($name = shift @name) &&
1050 defined($module = shift @module) &&
1051 defined($ordinal = shift @ordinal))
1053 push @entries, [$name, $module, $ordinal];
1059 sub get_all_module_external_ordinal16 {
1060 return _get_all_module_external_ordinal($win16api, @_);
1063 sub get_all_module_external_ordinal32 {
1064 return _get_all_module_external_ordinal($win32api, @_);
1067 sub get_all_module_external_ordinal {
1069 foreach my $winapi (@winapis) {
1070 push @entries, _get_all_module_external_ordinal($winapi, @_);