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);
38 sub found_shared_internal_function($$);
39 sub function_external_calling_convention_in_module($$$);
40 sub function_internal_module($$);
41 sub is_function_stub_in_module($$$);
43 sub parse_api_file($$);
44 sub parse_spec_file($$);
47 $Exporter::ExportLevel++;
49 $Exporter::ExportLevel--;
51 if (defined($modules) && defined($win16api) && defined($win32api)) {
56 import modules qw($modules);
58 my @spec_files16 = $modules->allowed_spec_files16;
59 $win16api = 'winapi'->new("win16", \@spec_files16);
61 my @spec_files32 = $modules->allowed_spec_files32;
62 $win32api = 'winapi'->new("win32", \@spec_files32);
64 @winapis = ($win16api, $win32api);
66 for my $internal_name ($win32api->all_internal_functions) {
67 my $module16 = $win16api->function_internal_module($internal_name);
68 my $module32 = $win16api->function_internal_module($internal_name);
69 if(defined($module16) &&
70 !$win16api->is_function_stub_in_module($module16, $internal_name) &&
71 !$win32api->is_function_stub_in_module($module32, $internal_name))
73 $win16api->found_shared_internal_function($internal_name);
74 $win32api->found_shared_internal_function($internal_name);
82 my $class = ref($proto) || $proto;
84 bless ($self, $class);
86 my $name = \${$self->{NAME}};
87 my $function_forward = \%{$self->{FUNCTION_FORWARD}};
88 my $function_internal_name = \%{$self->{FUNCTION_INTERNAL_NAME}};
89 my $function_module = \%{$self->{FUNCTION_MODULE}};
92 my $refspec_files = shift;
94 foreach my $file (@$refspec_files) {
95 $self->parse_spec_file("$wine_dir/$file");
98 $self->parse_api_file("$$name.api");
100 foreach my $module (sort(keys(%$function_forward))) {
101 foreach my $external_name (sort(keys(%{$$function_forward{$module}}))) {
102 (my $forward_module, my $forward_external_name) = @{$$function_forward{$module}{$external_name}};
103 my $forward_internal_name = $$function_internal_name{$forward_external_name};
104 if(defined($forward_internal_name)) {
105 $$function_module{$forward_internal_name} .= " & $module";
121 sub parse_api_file($$) {
124 my $allowed_kind = \%{$self->{ALLOWED_KIND}};
125 my $allowed_modules = \%{$self->{ALLOWED_MODULES}};
126 my $allowed_modules_limited = \%{$self->{ALLOWED_MODULES_LIMITED}};
127 my $allowed_modules_unlimited = \%{$self->{ALLOWED_MODULES_UNLIMITED}};
128 my $translate_argument = \%{$self->{TRANSLATE_ARGUMENT}};
129 my $type_format = \%{$self->{TYPE_FORMAT}};
138 $output->lazy_progress("$file");
140 open(IN, "< $winapi_dir/$file") || die "$winapi_dir/$file: $!\n";
143 s/^\s*?(.*?)\s*$/$1/; # remove whitespace at begin and end of line
144 s/^(.*?)\s*#.*$/$1/; # remove comments
145 /^$/ && next; # skip empty lines
149 $module =~ s/\.dll$//; # FIXME: Kludge
150 } elsif(!$modules->is_allowed_module($module)) {
152 } elsif(s/^%(\S+)\s*//) {
157 $$allowed_kind{$kind} = 1;
160 } elsif(/^--format=(\".*?\"|\S*)/) {
162 $format =~ s/^\"(.*?)\"$/$1/;
165 if(!defined($format)) {
166 if($kind eq "long") {
167 $format = "%d|%u|%x|%X|";
168 $format .= "%hd|%hu|%hx|%hX|";
169 $format .= "%ld|%lu|%lx|%lX|";
170 $format .= "%04x|%04X|0x%04x|0x%04X|";
171 $format .= "%08x|%08X|0x%08x|0x%08X|";
172 $format .= "%08lx|%08lX|0x%08lx|0x%08lX";
173 } elsif($kind eq "longlong") {
175 } elsif($kind eq "ptr") {
177 } elsif($kind eq "segptr") {
179 } elsif($kind eq "str") {
181 } elsif($kind eq "wstr") {
183 } elsif($kind eq "word") {
184 $format = "%d|%u|%x|%X|";
185 $format .= "%hd|%hu|%hx|%hX|";
186 $format .= "%04x|%04X|0x%04x|0x%04X";
188 $format = "<unknown>";
191 } elsif(defined($kind)) {
194 if(defined($module)) {
195 if($$allowed_modules_unlimited{$type}) {
196 $output->write("$file: type ($type) already specified as an unlimited type\n");
197 } elsif(!$$allowed_modules{$type}{$module}) {
198 $$allowed_modules{$type}{$module} = 1;
199 $$allowed_modules_limited{$type} = 1;
201 $output->write("$file: type ($type) already specified\n");
204 $$allowed_modules_unlimited{$type} = 1;
207 $$allowed_modules_limited{$type} = 1;
209 if(defined($$translate_argument{$type}) && $$translate_argument{$type} ne $kind) {
210 $output->write("$file: type ($type) respecified as different kind ($kind != $$translate_argument{$type})\n");
212 $$translate_argument{$type} = $kind;
215 $$type_format{$module}{$type} = $format;
217 $output->write("$file: file must begin with %<type> statement\n");
224 sub parse_spec_file($$) {
227 my $function_internal_arguments = \%{$self->{FUNCTION_INTERNAL_ARGUMENTS}};
228 my $function_external_arguments = \%{$self->{FUNCTION_EXTERNAL_ARGUMENTS}};
229 my $function_internal_ordinal = \%{$self->{FUNCTION_INTERNAL_ORDINAL}};
230 my $function_external_ordinal = \%{$self->{FUNCTION_EXTERNAL_ORDINAL}};
231 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
232 my $function_external_calling_convention = \%{$self->{FUNCTION_EXTERNAL_CALLING_CONVENTION}};
233 my $function_internal_name = \%{$self->{FUNCTION_INTERNAL_NAME}};
234 my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}};
235 my $function_forward = \%{$self->{FUNCTION_FORWARD}};
236 my $function_internal_module = \%{$self->{FUNCTION_INTERNAL_MODULE}};
237 my $function_external_module = \%{$self->{FUNCTION_EXTERNAL_MODULE}};
238 my $function_wine_extension = \%{$self->{FUNCTION_WINE_EXTENSION}};
239 my $modules = \%{$self->{MODULES}};
240 my $module_files = \%{$self->{MODULE_FILES}};
241 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
248 my $wine_extension = 0;
250 $output->lazy_progress("$file");
253 $module =~ s/^.*?([^\/]*)\.spec$/$1/;
255 open(IN, "< $file") || die "$file: $!\n";
259 while($lookahead || defined($_ = <IN>)) {
262 if(s/^(.*?)\s*\#\s*(.*)\s*$/$1/) {
264 if ($comment =~ /^Wine/i) { # FIXME: Kludge
271 if(/^\d+|@/) { $header = 0; $lookahead = 1; }
277 (pascal|stdcall|cdecl|varargs)\s+
278 ((?:(?:-noname|-norelay|-i386|-ret16|-ret64|-register|-interrupt|-private)\s+)*)(\S+)\s*\(\s*(.*?)\s*\)\s*(\S*)$/x)
280 my $calling_convention = $2;
282 my $external_name = $4;
284 my $internal_name = $6;
290 $internal_name = $external_name if !$internal_name;
292 if($flags =~ /-noname/) {
293 # $external_name = "@";
296 if($flags =~ /(?:-register|-interrupt)/) {
297 if($arguments) { $arguments .= " "; }
299 $calling_convention .= " -register";
302 if ($internal_name =~ /^(.*?)\.(.*?)$/) {
303 my $forward_module = lc($1);
304 my $forward_name = $2;
307 $calling_convention .= " -forward";
309 $calling_convention = "forward";
312 $$function_forward{$module}{$external_name} = [$forward_module, $forward_name];
315 if($external_name ne "@") {
316 $$module_external_calling_convention{$module}{$external_name} = $calling_convention;
318 $$module_external_calling_convention{$module}{"\@$ordinal"} = $calling_convention;
320 if(!$$function_internal_name{$external_name}) {
321 $$function_internal_name{$external_name} = $internal_name;
323 $$function_internal_name{$external_name} .= " & $internal_name";
325 if(!$$function_external_name{$internal_name}) {
326 $$function_external_name{$internal_name} = $external_name;
328 $$function_external_name{$internal_name} .= " & $external_name";
330 $$function_internal_arguments{$internal_name} = $arguments;
331 $$function_external_arguments{$external_name} = $arguments;
332 if(!$$function_internal_ordinal{$internal_name}) {
333 $$function_internal_ordinal{$internal_name} = $ordinal;
335 $$function_internal_ordinal{$internal_name} .= " & $ordinal";
337 if(!$$function_external_ordinal{$external_name}) {
338 $$function_external_ordinal{$external_name} = $ordinal;
340 $$function_external_ordinal{$external_name} .= " & $ordinal";
342 $$function_internal_calling_convention{$internal_name} = $calling_convention;
343 $$function_external_calling_convention{$external_name} = $calling_convention;
344 if(!$$function_internal_module{$internal_name}) {
345 $$function_internal_module{$internal_name} = "$module";
347 $$function_internal_module{$internal_name} .= " & $module";
349 if(!$$function_external_module{$external_name}) {
350 $$function_external_module{$external_name} = "$module";
352 $$function_external_module{$external_name} .= " & $module";
354 $$function_wine_extension{$module}{$external_name} = $wine_extension;
356 if(0 && $options->spec_mismatch) {
357 if($external_name eq "@") {
358 if($internal_name !~ /^\U$module\E_$ordinal$/) {
359 $output->write("$file: $external_name: the internal name ($internal_name) mismatch\n");
362 my $name = $external_name;
368 $name2 =~ s/^(?:_|Rtl|k32|K32)//;
371 $name3 =~ s/^INT_Int[0-9a-f]{2}Handler$/BUILTIN_DefaultIntHandler/;
374 $name4 =~ s/^(VxDCall)\d$/$1/;
376 # FIXME: This special case is becuase of a very ugly kludge that should be fixed IMHO
378 $name5 =~ s/^(.*?16)_(.*?)$/$1_fn$2/;
380 if(uc($internal_name) ne uc($external_name) &&
381 $internal_name !~ /(\Q$name\E|\Q$name1\E|\Q$name2\E|\Q$name3\E|\Q$name4\E|\Q$name5\E)/)
383 $output->write("$file: $external_name: internal name ($internal_name) mismatch\n");
387 } elsif(/^(\d+|@)\s+stub(?:\s+(-noname|-norelay|-i386|-ret16|-ret64|-private))?\s+(\S+)$/) {
391 my $external_name = $3;
393 $flags = "" if !defined($flags);
395 if($flags =~ /-noname/) {
396 # $external_name = "@";
399 my $internal_name = $external_name;
401 if ($external_name ne "@") {
402 $$module_external_calling_convention{$module}{$external_name} = "stub";
404 $$module_external_calling_convention{$module}{"\@$ordinal"} = "stub";
406 if(!$$function_internal_name{$external_name}) {
407 $$function_internal_name{$external_name} = $internal_name;
409 $$function_internal_name{$external_name} .= " & $internal_name";
411 if(!$$function_external_name{$internal_name}) {
412 $$function_external_name{$internal_name} = $external_name;
414 $$function_external_name{$internal_name} .= " & $external_name";
416 if(!$$function_internal_ordinal{$internal_name}) {
417 $$function_internal_ordinal{$internal_name} = $ordinal;
419 $$function_internal_ordinal{$internal_name} .= " & $ordinal";
421 if(!$$function_external_ordinal{$external_name}) {
422 $$function_external_ordinal{$external_name} = $ordinal;
424 $$function_external_ordinal{$external_name} .= " & $ordinal";
426 if(!$$function_internal_module{$internal_name}) {
427 $$function_internal_module{$internal_name} = "$module";
428 } else { # if($$function_internal_module{$internal_name} !~ /$module/) {
429 $$function_internal_module{$internal_name} .= " & $module";
431 if(!$$function_external_module{$external_name}) {
432 $$function_external_module{$external_name} = "$module";
433 } else { # if($$function_external_module{$external_name} !~ /$module/) {
434 $$function_external_module{$external_name} .= " & $module";
436 } elsif(/^(\d+|@)\s+extern(?:\s+(?:-norelay|-i386|-ret16|-ret64))?\s+(\S+)\s*(\S*)$/) {
439 my $external_name = $2;
440 my $internal_name = $3;
442 $internal_name = $external_name if !$internal_name;
444 if ($external_name ne "@") {
445 $$module_external_calling_convention{$module}{$external_name} = "extern";
447 $$module_external_calling_convention{$module}{"\@$ordinal"} = "extern";
449 } elsif(/^(?:\d+|@)\s+(?:equate|variable)/) {
452 my $next_line = <IN>;
453 if(!defined($next_line) || $next_line =~ /^\s*\d|@/) {
454 die "$file: $.: syntax error: '$_'\n";
461 if(defined($ordinal)) {
462 if($ordinal ne "@" && $ordinals{$ordinal}) {
463 $output->write("$file: ordinal redefined: $_\n");
465 $ordinals{$ordinal}++;
470 $$modules{$module}++;
472 $$module_files{$module} = $file;
477 my $name = \${$self->{NAME}};
482 sub is_allowed_kind($$) {
484 my $allowed_kind = \%{$self->{ALLOWED_KIND}};
488 return $$allowed_kind{$kind};
497 my $allowed_kind = \%{$self->{ALLOWED_KIND}};
501 $$allowed_kind{$kind}++;
504 sub is_limited_type($$) {
506 my $allowed_modules_limited = \%{$self->{ALLOWED_MODULES_LIMITED}};
510 return $$allowed_modules_limited{$type};
513 sub is_allowed_type_in_module($$) {
515 my $allowed_modules = \%{$self->{ALLOWED_MODULES}};
516 my $allowed_modules_limited = \%{$self->{ALLOWED_MODULES_LIMITED}};
519 my @modules = split(/ \& /, shift);
521 if(!$$allowed_modules_limited{$type}) { return 1; }
523 foreach my $module (@modules) {
524 if($$allowed_modules{$type}{$module}) { return 1; }
530 sub allow_type_in_module($$) {
532 my $allowed_modules = \%{$self->{ALLOWED_MODULES}};
535 my @modules = split(/ \& /, shift);
537 foreach my $module (@modules) {
538 $$allowed_modules{$type}{$module}++;
542 sub type_used_in_module($$) {
544 my $used_modules = \%{$self->{USED_MODULES}};
547 my @modules = split(/ \& /, shift);
549 foreach my $module (@modules) {
550 $$used_modules{$type}{$module} = 1;
556 sub types_not_used($) {
558 my $used_modules = \%{$self->{USED_MODULES}};
559 my $allowed_modules = \%{$self->{ALLOWED_MODULES}};
562 foreach my $type (sort(keys(%$allowed_modules))) {
563 foreach my $module (sort(keys(%{$$allowed_modules{$type}}))) {
564 if(!$$used_modules{$type}{$module}) {
565 $$not_used{$module}{$type} = 1;
572 sub types_unlimited_used_in_modules($) {
575 my $used_modules = \%{$self->{USED_MODULES}};
576 my $allowed_modules = \%{$self->{ALLOWED_MODULES}};
577 my $allowed_modules_unlimited = \%{$self->{ALLOWED_MODULES_UNLIMITED}};
580 foreach my $type (sort(keys(%$allowed_modules_unlimited))) {
583 foreach my $module (sort(keys(%{$$used_modules{$type}}))) {
585 push @modules, $module;
588 foreach my $module (@modules) {
589 $$used_types{$type}{$module} = 1;
596 sub translate_argument($$) {
598 my $translate_argument = \%{$self->{TRANSLATE_ARGUMENT}};
602 return $$translate_argument{$type};
605 sub declare_argument($$$) {
607 my $translate_argument = \%{$self->{TRANSLATE_ARGUMENT}};
612 $$translate_argument{$type} = $kind;
615 sub all_declared_types($) {
617 my $translate_argument = \%{$self->{TRANSLATE_ARGUMENT}};
619 return sort(keys(%$translate_argument));
622 sub is_allowed_type_format($$$$) {
624 my $type_format = \%{$self->{TYPE_FORMAT}};
632 if(defined($module) && defined($type)) {
634 foreach (split(/ & /, $module)) {
635 if(defined($formats)) {
640 if(defined($$type_format{$_}{$type})) {
641 $formats .= $$type_format{$_}{$type};
646 if(defined($formats)) {
648 foreach (split(/\|/, $formats)) {
660 my $modules = \%{$self->{MODULES}};
662 return sort(keys(%$modules));
667 my $modules = \%{$self->{MODULES}};
671 return $$modules{$name};
674 sub module_file($$) {
679 my $module_files = \%{$self->{MODULE_FILES}};
681 return $$module_files{$module};
684 sub all_internal_functions($) {
686 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
688 return sort(keys(%$function_internal_calling_convention));
691 sub all_internal_functions_in_module($$) {
693 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
694 my $function_internal_module = \%{$self->{FUNCTION_INTERNAL_MODULE}};
699 foreach my $name (keys(%$function_internal_calling_convention)) {
700 if($$function_internal_module{$name} eq $module) {
708 sub all_external_functions($) {
710 my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}};
712 return sort(keys(%$function_external_name));
715 sub all_external_functions_in_module($$) {
717 my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}};
718 my $function_external_module = \%{$self->{FUNCTION_EXTERNAL_MODULE}};
723 foreach my $name (keys(%$function_external_name)) {
724 if($$function_external_module{$name} eq $module) {
732 sub all_functions_in_module($$) {
734 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
738 return sort(keys(%{$$module_external_calling_convention{$module}}));
741 sub all_broken_forwards($) {
743 my $function_forward = \%{$self->{FUNCTION_FORWARD}};
745 my @broken_forwards = ();
746 foreach my $module (sort(keys(%$function_forward))) {
747 foreach my $external_name (sort(keys(%{$$function_forward{$module}}))) {
748 (my $forward_module, my $forward_external_name) = @{$$function_forward{$module}{$external_name}};
750 my $forward_external_calling_convention =
751 $self->function_external_calling_convention_in_module($forward_module, $forward_external_name);
753 if(!defined($forward_external_calling_convention)) {
754 push @broken_forwards, [$module, $external_name, $forward_module, $forward_external_name];
758 return @broken_forwards;
762 sub function_internal_ordinal($$) {
764 my $function_internal_ordinal = \%{$self->{FUNCTION_INTERNAL_ORDINAL}};
768 return $$function_internal_ordinal{$name};
771 sub function_external_ordinal($$) {
773 my $function_external_ordinal = \%{$self->{FUNCTION_EXTERNAL_ORDINAL}};
777 return $$function_external_ordinal{$name};
780 sub function_internal_calling_convention($$) {
782 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
786 return $$function_internal_calling_convention{$name};
789 sub function_external_calling_convention($$) {
791 my $function_external_calling_convention = \%{$self->{FUNCTION_EXTERNAL_CALLING_CONVENTION}};
795 return $$function_external_calling_convention{$name};
798 sub function_external_calling_convention_in_module($$$) {
800 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
805 return $$module_external_calling_convention{$module}{$name};
808 sub function_internal_name($$) {
810 my $function_internal_name = \%{$self->{FUNCTION_INTERNAL_NAME}};
814 return $$function_internal_name{$name};
817 sub function_external_name($$) {
819 my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}};
823 return $$function_external_name{$name};
826 sub function_forward_final_destination($$$) {
829 my $function_forward = \%{$self->{FUNCTION_FORWARD}};
834 my $forward_module = $module;
835 my $forward_name = $name;
836 while(defined(my $forward = $$function_forward{$forward_module}{$forward_name})) {
837 ($forward_module, $forward_name) = @$forward;
840 return ($forward_module, $forward_name);
843 sub is_function($$) {
845 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
849 return $$function_internal_calling_convention{$name};
852 sub all_shared_internal_functions($$) {
854 my $function_shared = \%{$self->{FUNCTION_SHARED}};
856 return sort(keys(%$function_shared));
859 sub is_shared_internal_function($$) {
861 my $function_shared = \%{$self->{FUNCTION_SHARED}};
865 return $$function_shared{$name};
868 sub found_shared_internal_function($$) {
870 my $function_shared = \%{$self->{FUNCTION_SHARED}};
874 $$function_shared{$name} = 1;
877 sub function_internal_arguments($$) {
879 my $function_internal_arguments = \%{$self->{FUNCTION_INTERNAL_ARGUMENTS}};
883 return $$function_internal_arguments{$name};
886 sub function_external_arguments($$) {
888 my $function_external_arguments = \%{$self->{FUNCTION_EXTERNAL_ARGUMENTS}};
892 return $$function_external_arguments{$name};
895 sub function_internal_module($$) {
897 my $function_internal_module = \%{$self->{FUNCTION_INTERNAL_MODULE}};
901 return $$function_internal_module{$name};
904 sub function_external_module($$) {
906 my $function_external_module = \%{$self->{FUNCTION_EXTERNAL_MODULE}};
910 return $$function_external_module{$name};
913 sub function_wine_extension($$$) {
915 my $function_wine_extension = \%{$self->{FUNCTION_WINE_EXTENSION}};
920 return $$function_wine_extension{$module}{$name};
923 sub is_function_stub($$$) {
925 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
930 if($$module_external_calling_convention{$module}{$name} eq "stub") {
936 sub is_function_stub_in_module($$$) {
938 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
943 if(!defined($$module_external_calling_convention{$module}{$name})) {
946 return $$module_external_calling_convention{$module}{$name} eq "stub";
949 ########################################################################
953 sub _get_all_module_internal_ordinal($$) {
955 my $internal_name = shift;
960 my $name = $winapi->function_external_name($internal_name);
962 @name = split(/ & /, $name);
967 my $module = $winapi->function_internal_module($internal_name);
968 if(defined($module)) {
969 @module = split(/ & /, $module);
974 my $ordinal = $winapi->function_internal_ordinal($internal_name);
975 if(defined($ordinal)) {
976 @ordinal = split(/ & /, $ordinal);
983 while(defined($name = shift @name) &&
984 defined($module = shift @module) &&
985 defined($ordinal = shift @ordinal))
987 push @entries, [$name, $module, $ordinal];
993 sub get_all_module_internal_ordinal16($) {
994 return _get_all_module_internal_ordinal($win16api, $_[0]);
997 sub get_all_module_internal_ordinal32($) {
998 return _get_all_module_internal_ordinal($win32api, $_[0]);
1001 sub get_all_module_internal_ordinal($) {
1003 foreach my $winapi (@winapis) {
1004 push @entries, _get_all_module_internal_ordinal($winapi, $_[0]);
1010 sub _get_all_module_external_ordinal($$) {
1012 my $external_name = shift;
1017 my $name = $winapi->function_internal_name($external_name);
1018 if(defined($name)) {
1019 @name = split(/ & /, $name);
1024 my $module = $winapi->function_external_module($external_name);
1025 if(defined($module)) {
1026 @module = split(/ & /, $module);
1031 my $ordinal = $winapi->function_external_ordinal($external_name);
1032 if(defined($ordinal)) {
1033 @ordinal = split(/ & /, $ordinal);
1040 while(defined($name = shift @name) &&
1041 defined($module = shift @module) &&
1042 defined($ordinal = shift @ordinal))
1044 push @entries, [$name, $module, $ordinal];
1050 sub get_all_module_external_ordinal16($) {
1051 return _get_all_module_external_ordinal($win16api, $_[0]);
1054 sub get_all_module_external_ordinal32($) {
1055 return _get_all_module_external_ordinal($win32api, $_[0]);
1058 sub get_all_module_external_ordinal($) {
1060 foreach my $winapi (@winapis) {
1061 push @entries, _get_all_module_external_ordinal($winapi, $_[0]);