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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, 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";
145 s/^\s*?(.*?)\s*$/$1/; # remove whitespace at begin and end of line
146 s/^(.*?)\s*#.*$/$1/; # remove comments
147 /^$/ && next; # skip empty lines
151 $module =~ s/\.dll$//; # FIXME: Kludge
152 } elsif(!$modules->is_allowed_module($module)) {
154 } elsif(s/^%(\S+)\s*//) {
159 $$allowed_kind{$kind} = 1;
162 } elsif(/^--format=(\".*?\"|\S*)/) {
164 $format =~ s/^\"(.*?)\"$/$1/;
167 if(!defined($format)) {
168 if($kind eq "long") {
169 $format = "%d|%u|%x|%X|";
170 $format .= "%hd|%hu|%hx|%hX|";
171 $format .= "%ld|%lu|%lx|%lX|";
172 $format .= "%04x|%04X|0x%04x|0x%04X|";
173 $format .= "%08x|%08X|0x%08x|0x%08X|";
174 $format .= "%08lx|%08lX|0x%08lx|0x%08lX";
175 } elsif($kind eq "longlong") {
177 } elsif($kind eq "ptr") {
179 } elsif($kind eq "segptr") {
181 } elsif($kind eq "str") {
183 } elsif($kind eq "wstr") {
185 } elsif($kind eq "word") {
186 $format = "%d|%u|%x|%X|";
187 $format .= "%hd|%hu|%hx|%hX|";
188 $format .= "%04x|%04X|0x%04x|0x%04X";
190 $format = "<unknown>";
193 } elsif(defined($kind)) {
195 if ($type =~ /^long\b/)
197 $output->write("$file:$linenum: type ($type) is not Win64 compatible\n");
200 if(defined($module)) {
201 if($$allowed_modules_unlimited{$type}) {
202 $output->write("$file:$linenum: type ($type) already specified as an unlimited type\n");
203 } elsif(!$$allowed_modules{$type}{$module}) {
204 $$allowed_modules{$type}{$module} = 1;
205 $$allowed_modules_limited{$type} = 1;
207 $output->write("$file:$linenum: type ($type) already specified\n");
210 $$allowed_modules_unlimited{$type} = 1;
213 $$allowed_modules_limited{$type} = 1;
215 if(defined($$translate_argument{$type}) && $$translate_argument{$type} ne $kind) {
216 $output->write("$file:$linenum: type ($type) respecified as different kind ($kind != $$translate_argument{$type})\n");
218 $$translate_argument{$type} = $kind;
221 $$type_format{$module}{$type} = $format;
223 $output->write("$file:$linenum: file must begin with %<type> statement\n");
230 sub parse_spec_file($$) {
233 my $function_internal_arguments = \%{$self->{FUNCTION_INTERNAL_ARGUMENTS}};
234 my $function_external_arguments = \%{$self->{FUNCTION_EXTERNAL_ARGUMENTS}};
235 my $function_internal_ordinal = \%{$self->{FUNCTION_INTERNAL_ORDINAL}};
236 my $function_external_ordinal = \%{$self->{FUNCTION_EXTERNAL_ORDINAL}};
237 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
238 my $function_external_calling_convention = \%{$self->{FUNCTION_EXTERNAL_CALLING_CONVENTION}};
239 my $function_internal_name = \%{$self->{FUNCTION_INTERNAL_NAME}};
240 my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}};
241 my $function_forward = \%{$self->{FUNCTION_FORWARD}};
242 my $function_internal_module = \%{$self->{FUNCTION_INTERNAL_MODULE}};
243 my $function_external_module = \%{$self->{FUNCTION_EXTERNAL_MODULE}};
244 my $function_wine_extension = \%{$self->{FUNCTION_WINE_EXTENSION}};
245 my $modules = \%{$self->{MODULES}};
246 my $module_files = \%{$self->{MODULE_FILES}};
247 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
254 my $wine_extension = 0;
256 $output->lazy_progress("$file");
259 $module =~ s/^.*?([^\/]*)\.spec$/$1/;
261 open(IN, "< $file") || die "$file: $!\n";
265 while($lookahead || defined($_ = <IN>)) {
268 if(s/^(.*?)\s*\#\s*(.*)\s*$/$1/) {
270 if ($comment =~ /^Wine/i) { # FIXME: Kludge
277 if(/^\d+|@/) { $header = 0; $lookahead = 1; }
283 (pascal|stdcall|cdecl|varargs)\s+
284 ((?:(?:-noname|-norelay|-i386|-ret16|-ret64|-register|-interrupt|-private)\s+)*)(\S+)\s*\(\s*(.*?)\s*\)\s*(\S*)$/x)
286 my $calling_convention = $2;
288 my $external_name = $4;
290 my $internal_name = $6;
296 $internal_name = $external_name if !$internal_name;
298 if($flags =~ /-noname/) {
299 # $external_name = "@";
302 if($flags =~ /(?:-register|-interrupt)/) {
303 if($arguments) { $arguments .= " "; }
305 $calling_convention .= " -register";
308 if ($internal_name =~ /^(.*?)\.(.*?)$/) {
309 my $forward_module = lc($1);
310 my $forward_name = $2;
313 $calling_convention .= " -forward";
315 $calling_convention = "forward";
318 $$function_forward{$module}{$external_name} = [$forward_module, $forward_name];
321 if($external_name ne "@") {
322 $$module_external_calling_convention{$module}{$external_name} = $calling_convention;
324 $$module_external_calling_convention{$module}{"\@$ordinal"} = $calling_convention;
326 if(!$$function_internal_name{$external_name}) {
327 $$function_internal_name{$external_name} = $internal_name;
329 $$function_internal_name{$external_name} .= " & $internal_name";
331 if(!$$function_external_name{$internal_name}) {
332 $$function_external_name{$internal_name} = $external_name;
334 $$function_external_name{$internal_name} .= " & $external_name";
336 $$function_internal_arguments{$internal_name} = $arguments;
337 $$function_external_arguments{$external_name} = $arguments;
338 if(!$$function_internal_ordinal{$internal_name}) {
339 $$function_internal_ordinal{$internal_name} = $ordinal;
341 $$function_internal_ordinal{$internal_name} .= " & $ordinal";
343 if(!$$function_external_ordinal{$external_name}) {
344 $$function_external_ordinal{$external_name} = $ordinal;
346 $$function_external_ordinal{$external_name} .= " & $ordinal";
348 $$function_internal_calling_convention{$internal_name} = $calling_convention;
349 $$function_external_calling_convention{$external_name} = $calling_convention;
350 if(!$$function_internal_module{$internal_name}) {
351 $$function_internal_module{$internal_name} = "$module";
353 $$function_internal_module{$internal_name} .= " & $module";
355 if(!$$function_external_module{$external_name}) {
356 $$function_external_module{$external_name} = "$module";
358 $$function_external_module{$external_name} .= " & $module";
360 $$function_wine_extension{$module}{$external_name} = $wine_extension;
362 if(0 && $options->spec_mismatch) {
363 if($external_name eq "@") {
364 if($internal_name !~ /^\U$module\E_$ordinal$/) {
365 $output->write("$file: $external_name: the internal name ($internal_name) mismatch\n");
368 my $name = $external_name;
374 $name2 =~ s/^(?:_|Rtl|k32|K32)//;
377 $name3 =~ s/^INT_Int[0-9a-f]{2}Handler$/BUILTIN_DefaultIntHandler/;
380 $name4 =~ s/^(VxDCall)\d$/$1/;
382 # FIXME: This special case is becuase of a very ugly kludge that should be fixed IMHO
384 $name5 =~ s/^(.*?16)_(.*?)$/$1_fn$2/;
386 if(uc($internal_name) ne uc($external_name) &&
387 $internal_name !~ /(\Q$name\E|\Q$name1\E|\Q$name2\E|\Q$name3\E|\Q$name4\E|\Q$name5\E)/)
389 $output->write("$file: $external_name: internal name ($internal_name) mismatch\n");
393 } elsif(/^(\d+|@)\s+stub(?:\s+(-noname|-norelay|-i386|-ret16|-ret64|-private))?\s+(\S+)$/) {
397 my $external_name = $3;
399 $flags = "" if !defined($flags);
401 if($flags =~ /-noname/) {
402 # $external_name = "@";
405 my $internal_name = $external_name;
407 if ($external_name ne "@") {
408 $$module_external_calling_convention{$module}{$external_name} = "stub";
410 $$module_external_calling_convention{$module}{"\@$ordinal"} = "stub";
412 if(!$$function_internal_name{$external_name}) {
413 $$function_internal_name{$external_name} = $internal_name;
415 $$function_internal_name{$external_name} .= " & $internal_name";
417 if(!$$function_external_name{$internal_name}) {
418 $$function_external_name{$internal_name} = $external_name;
420 $$function_external_name{$internal_name} .= " & $external_name";
422 if(!$$function_internal_ordinal{$internal_name}) {
423 $$function_internal_ordinal{$internal_name} = $ordinal;
425 $$function_internal_ordinal{$internal_name} .= " & $ordinal";
427 if(!$$function_external_ordinal{$external_name}) {
428 $$function_external_ordinal{$external_name} = $ordinal;
430 $$function_external_ordinal{$external_name} .= " & $ordinal";
432 if(!$$function_internal_module{$internal_name}) {
433 $$function_internal_module{$internal_name} = "$module";
434 } else { # if($$function_internal_module{$internal_name} !~ /$module/) {
435 $$function_internal_module{$internal_name} .= " & $module";
437 if(!$$function_external_module{$external_name}) {
438 $$function_external_module{$external_name} = "$module";
439 } else { # if($$function_external_module{$external_name} !~ /$module/) {
440 $$function_external_module{$external_name} .= " & $module";
442 } elsif(/^(\d+|@)\s+extern(?:\s+(?:-norelay|-i386|-ret16|-ret64))?\s+(\S+)\s*(\S*)$/) {
445 my $external_name = $2;
446 my $internal_name = $3;
448 $internal_name = $external_name if !$internal_name;
450 if ($external_name ne "@") {
451 $$module_external_calling_convention{$module}{$external_name} = "extern";
453 $$module_external_calling_convention{$module}{"\@$ordinal"} = "extern";
455 } elsif(/^(?:\d+|@)\s+(?:equate|variable)/) {
458 my $next_line = <IN>;
459 if(!defined($next_line) || $next_line =~ /^\s*\d|@/) {
460 die "$file: $.: syntax error: '$_'\n";
467 if(defined($ordinal)) {
468 if($ordinal ne "@" && $ordinals{$ordinal}) {
469 $output->write("$file: ordinal redefined: $_\n");
471 $ordinals{$ordinal}++;
476 $$modules{$module}++;
478 $$module_files{$module} = $file;
483 my $name = \${$self->{NAME}};
488 sub is_allowed_kind($$) {
490 my $allowed_kind = \%{$self->{ALLOWED_KIND}};
494 return $$allowed_kind{$kind};
503 my $allowed_kind = \%{$self->{ALLOWED_KIND}};
507 $$allowed_kind{$kind}++;
510 sub is_limited_type($$) {
512 my $allowed_modules_limited = \%{$self->{ALLOWED_MODULES_LIMITED}};
516 return $$allowed_modules_limited{$type};
519 sub is_allowed_type_in_module($$) {
521 my $allowed_modules = \%{$self->{ALLOWED_MODULES}};
522 my $allowed_modules_limited = \%{$self->{ALLOWED_MODULES_LIMITED}};
525 my @modules = split(/ \& /, shift);
527 if(!$$allowed_modules_limited{$type}) { return 1; }
529 foreach my $module (@modules) {
530 if($$allowed_modules{$type}{$module}) { return 1; }
536 sub allow_type_in_module($$) {
538 my $allowed_modules = \%{$self->{ALLOWED_MODULES}};
541 my @modules = split(/ \& /, shift);
543 foreach my $module (@modules) {
544 $$allowed_modules{$type}{$module}++;
548 sub type_used_in_module($$) {
550 my $used_modules = \%{$self->{USED_MODULES}};
553 my @modules = split(/ \& /, shift);
555 foreach my $module (@modules) {
556 $$used_modules{$type}{$module} = 1;
562 sub types_not_used($) {
564 my $used_modules = \%{$self->{USED_MODULES}};
565 my $allowed_modules = \%{$self->{ALLOWED_MODULES}};
568 foreach my $type (sort(keys(%$allowed_modules))) {
569 foreach my $module (sort(keys(%{$$allowed_modules{$type}}))) {
570 if(!$$used_modules{$type}{$module}) {
571 $$not_used{$module}{$type} = 1;
578 sub types_unlimited_used_in_modules($) {
581 my $used_modules = \%{$self->{USED_MODULES}};
582 my $allowed_modules = \%{$self->{ALLOWED_MODULES}};
583 my $allowed_modules_unlimited = \%{$self->{ALLOWED_MODULES_UNLIMITED}};
586 foreach my $type (sort(keys(%$allowed_modules_unlimited))) {
589 foreach my $module (sort(keys(%{$$used_modules{$type}}))) {
591 push @modules, $module;
594 foreach my $module (@modules) {
595 $$used_types{$type}{$module} = 1;
602 sub translate_argument($$) {
604 my $translate_argument = \%{$self->{TRANSLATE_ARGUMENT}};
608 return $$translate_argument{$type};
611 sub declare_argument($$$) {
613 my $translate_argument = \%{$self->{TRANSLATE_ARGUMENT}};
618 $$translate_argument{$type} = $kind;
621 sub all_declared_types($) {
623 my $translate_argument = \%{$self->{TRANSLATE_ARGUMENT}};
625 return sort(keys(%$translate_argument));
628 sub is_allowed_type_format($$$$) {
630 my $type_format = \%{$self->{TYPE_FORMAT}};
638 if(defined($module) && defined($type)) {
640 foreach (split(/ & /, $module)) {
641 if(defined($formats)) {
646 if(defined($$type_format{$_}{$type})) {
647 $formats .= $$type_format{$_}{$type};
652 if(defined($formats)) {
654 foreach (split(/\|/, $formats)) {
666 my $modules = \%{$self->{MODULES}};
668 return sort(keys(%$modules));
673 my $modules = \%{$self->{MODULES}};
677 return $$modules{$name};
680 sub module_file($$) {
685 my $module_files = \%{$self->{MODULE_FILES}};
687 return $$module_files{$module};
690 sub all_internal_functions($) {
692 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
694 return sort(keys(%$function_internal_calling_convention));
697 sub all_internal_functions_in_module($$) {
699 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
700 my $function_internal_module = \%{$self->{FUNCTION_INTERNAL_MODULE}};
705 foreach my $name (keys(%$function_internal_calling_convention)) {
706 if($$function_internal_module{$name} eq $module) {
714 sub all_external_functions($) {
716 my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}};
718 return sort(keys(%$function_external_name));
721 sub all_external_functions_in_module($$) {
723 my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}};
724 my $function_external_module = \%{$self->{FUNCTION_EXTERNAL_MODULE}};
729 foreach my $name (keys(%$function_external_name)) {
730 if($$function_external_module{$name} eq $module) {
738 sub all_functions_in_module($$) {
740 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
744 return sort(keys(%{$$module_external_calling_convention{$module}}));
747 sub all_broken_forwards($) {
749 my $function_forward = \%{$self->{FUNCTION_FORWARD}};
751 my @broken_forwards = ();
752 foreach my $module (sort(keys(%$function_forward))) {
753 foreach my $external_name (sort(keys(%{$$function_forward{$module}}))) {
754 (my $forward_module, my $forward_external_name) = @{$$function_forward{$module}{$external_name}};
756 my $forward_external_calling_convention =
757 $self->function_external_calling_convention_in_module($forward_module, $forward_external_name);
759 if(!defined($forward_external_calling_convention)) {
760 push @broken_forwards, [$module, $external_name, $forward_module, $forward_external_name];
764 return @broken_forwards;
768 sub function_internal_ordinal($$) {
770 my $function_internal_ordinal = \%{$self->{FUNCTION_INTERNAL_ORDINAL}};
774 return $$function_internal_ordinal{$name};
777 sub function_external_ordinal($$) {
779 my $function_external_ordinal = \%{$self->{FUNCTION_EXTERNAL_ORDINAL}};
783 return $$function_external_ordinal{$name};
786 sub function_internal_calling_convention($$) {
788 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
792 return $$function_internal_calling_convention{$name};
795 sub function_external_calling_convention($$) {
797 my $function_external_calling_convention = \%{$self->{FUNCTION_EXTERNAL_CALLING_CONVENTION}};
801 return $$function_external_calling_convention{$name};
804 sub function_external_calling_convention_in_module($$$) {
806 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
811 return $$module_external_calling_convention{$module}{$name};
814 sub function_internal_name($$) {
816 my $function_internal_name = \%{$self->{FUNCTION_INTERNAL_NAME}};
820 return $$function_internal_name{$name};
823 sub function_external_name($$) {
825 my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}};
829 return $$function_external_name{$name};
832 sub function_forward_final_destination($$$) {
835 my $function_forward = \%{$self->{FUNCTION_FORWARD}};
840 my $forward_module = $module;
841 my $forward_name = $name;
842 while(defined(my $forward = $$function_forward{$forward_module}{$forward_name})) {
843 ($forward_module, $forward_name) = @$forward;
846 return ($forward_module, $forward_name);
849 sub is_function($$) {
851 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
855 return $$function_internal_calling_convention{$name};
858 sub all_shared_internal_functions($$) {
860 my $function_shared = \%{$self->{FUNCTION_SHARED}};
862 return sort(keys(%$function_shared));
865 sub is_shared_internal_function($$) {
867 my $function_shared = \%{$self->{FUNCTION_SHARED}};
871 return $$function_shared{$name};
874 sub found_shared_internal_function($$) {
876 my $function_shared = \%{$self->{FUNCTION_SHARED}};
880 $$function_shared{$name} = 1;
883 sub function_internal_arguments($$) {
885 my $function_internal_arguments = \%{$self->{FUNCTION_INTERNAL_ARGUMENTS}};
889 return $$function_internal_arguments{$name};
892 sub function_external_arguments($$) {
894 my $function_external_arguments = \%{$self->{FUNCTION_EXTERNAL_ARGUMENTS}};
898 return $$function_external_arguments{$name};
901 sub function_internal_module($$) {
903 my $function_internal_module = \%{$self->{FUNCTION_INTERNAL_MODULE}};
907 return $$function_internal_module{$name};
910 sub function_external_module($$) {
912 my $function_external_module = \%{$self->{FUNCTION_EXTERNAL_MODULE}};
916 return $$function_external_module{$name};
919 sub function_wine_extension($$$) {
921 my $function_wine_extension = \%{$self->{FUNCTION_WINE_EXTENSION}};
926 return $$function_wine_extension{$module}{$name};
929 sub is_function_stub($$$) {
931 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
936 if($$module_external_calling_convention{$module}{$name} eq "stub") {
942 sub is_function_stub_in_module($$$) {
944 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
949 if(!defined($$module_external_calling_convention{$module}{$name})) {
952 return $$module_external_calling_convention{$module}{$name} eq "stub";
955 ########################################################################
959 sub _get_all_module_internal_ordinal($$) {
961 my $internal_name = shift;
966 my $name = $winapi->function_external_name($internal_name);
968 @name = split(/ & /, $name);
973 my $module = $winapi->function_internal_module($internal_name);
974 if(defined($module)) {
975 @module = split(/ & /, $module);
980 my $ordinal = $winapi->function_internal_ordinal($internal_name);
981 if(defined($ordinal)) {
982 @ordinal = split(/ & /, $ordinal);
989 while(defined($name = shift @name) &&
990 defined($module = shift @module) &&
991 defined($ordinal = shift @ordinal))
993 push @entries, [$name, $module, $ordinal];
999 sub get_all_module_internal_ordinal16($) {
1000 return _get_all_module_internal_ordinal($win16api, $_[0]);
1003 sub get_all_module_internal_ordinal32($) {
1004 return _get_all_module_internal_ordinal($win32api, $_[0]);
1007 sub get_all_module_internal_ordinal($) {
1009 foreach my $winapi (@winapis) {
1010 push @entries, _get_all_module_internal_ordinal($winapi, $_[0]);
1016 sub _get_all_module_external_ordinal($$) {
1018 my $external_name = shift;
1023 my $name = $winapi->function_internal_name($external_name);
1024 if(defined($name)) {
1025 @name = split(/ & /, $name);
1030 my $module = $winapi->function_external_module($external_name);
1031 if(defined($module)) {
1032 @module = split(/ & /, $module);
1037 my $ordinal = $winapi->function_external_ordinal($external_name);
1038 if(defined($ordinal)) {
1039 @ordinal = split(/ & /, $ordinal);
1046 while(defined($name = shift @name) &&
1047 defined($module = shift @module) &&
1048 defined($ordinal = shift @ordinal))
1050 push @entries, [$name, $module, $ordinal];
1056 sub get_all_module_external_ordinal16($) {
1057 return _get_all_module_external_ordinal($win16api, $_[0]);
1060 sub get_all_module_external_ordinal32($) {
1061 return _get_all_module_external_ordinal($win32api, $_[0]);
1064 sub get_all_module_external_ordinal($) {
1066 foreach my $winapi (@winapis) {
1067 push @entries, _get_all_module_external_ordinal($winapi, $_[0]);