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 =~ /\blong\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; }
282 my $ARCHES="alpha|i386|powerpc|sparc|x86_64";
284 (pascal|stdcall|cdecl|varargs)\s+
285 ((?:(?:-arch=(?:$ARCHES)(?:,(?:$ARCHES))*|-noname|-norelay|-i386|-ret16|-ret64|-register|-interrupt|-private)\s+)*)(\S+)\s*\(\s*(.*?)\s*\)\s*(\S*)$/x)
287 my $calling_convention = $2;
289 my $external_name = $4;
291 my $internal_name = $6;
299 $internal_name = ($flags =~ /-register/ ? "__regs_" : "") . $external_name;
302 if($flags =~ /-noname/) {
303 # $external_name = "@";
306 if($flags =~ /(?:-register|-interrupt)/) {
307 if($arguments) { $arguments .= " "; }
309 $calling_convention .= " -register";
311 if($flags =~ /(?:-i386)/) {
312 $calling_convention .= " -i386";
315 if ($internal_name =~ /^(.*?)\.(.*?)$/) {
316 my $forward_module = lc($1);
317 my $forward_name = $2;
320 $calling_convention .= " -forward";
322 $calling_convention = "forward";
325 $$function_forward{$module}{$external_name} = [$forward_module, $forward_name];
328 if($external_name ne "@") {
329 $$module_external_calling_convention{$module}{$external_name} = $calling_convention;
331 $$module_external_calling_convention{$module}{"\@$ordinal"} = $calling_convention;
333 if(!$$function_internal_name{$external_name}) {
334 $$function_internal_name{$external_name} = $internal_name;
336 $$function_internal_name{$external_name} .= " & $internal_name";
338 if(!$$function_external_name{$internal_name}) {
339 $$function_external_name{$internal_name} = $external_name;
341 $$function_external_name{$internal_name} .= " & $external_name";
343 $$function_internal_arguments{$internal_name} = $arguments;
344 $$function_external_arguments{$external_name} = $arguments;
345 if(!$$function_internal_ordinal{$internal_name}) {
346 $$function_internal_ordinal{$internal_name} = $ordinal;
348 $$function_internal_ordinal{$internal_name} .= " & $ordinal";
350 if(!$$function_external_ordinal{$external_name}) {
351 $$function_external_ordinal{$external_name} = $ordinal;
353 $$function_external_ordinal{$external_name} .= " & $ordinal";
355 $$function_internal_calling_convention{$internal_name} = $calling_convention;
356 $$function_external_calling_convention{$external_name} = $calling_convention;
357 if(!$$function_internal_module{$internal_name}) {
358 $$function_internal_module{$internal_name} = "$module";
360 $$function_internal_module{$internal_name} .= " & $module";
362 if(!$$function_external_module{$external_name}) {
363 $$function_external_module{$external_name} = "$module";
365 $$function_external_module{$external_name} .= " & $module";
367 $$function_wine_extension{$module}{$external_name} = $wine_extension;
369 if(0 && $options->spec_mismatch) {
370 if($external_name eq "@") {
371 if($internal_name !~ /^\U$module\E_$ordinal$/) {
372 $output->write("$file: $external_name: the internal name ($internal_name) mismatch\n");
375 my $name = $external_name;
381 $name2 =~ s/^(?:_|Rtl|k32|K32)//;
384 $name3 =~ s/^INT_Int[0-9a-f]{2}Handler$/BUILTIN_DefaultIntHandler/;
387 $name4 =~ s/^(VxDCall)\d$/$1/;
389 # FIXME: This special case is because of a very ugly kludge that should be fixed IMHO
391 $name5 =~ s/^(.*?16)_(.*?)$/$1_fn$2/;
393 if(uc($internal_name) ne uc($external_name) &&
394 $internal_name !~ /(\Q$name\E|\Q$name1\E|\Q$name2\E|\Q$name3\E|\Q$name4\E|\Q$name5\E)/)
396 $output->write("$file: $external_name: internal name ($internal_name) mismatch\n");
400 } elsif(/^(\d+|@)\s+stub(?:\s+(-arch=(?:$ARCHES)(?:,(?:$ARCHES))*|-noname|-norelay|-i386|-ret16|-ret64|-private))?\s+(\S+)$/) {
404 my $external_name = $3;
406 $flags = "" if !defined($flags);
408 if($flags =~ /-noname/) {
409 # $external_name = "@";
412 my $internal_name = $external_name;
414 if ($external_name ne "@") {
415 $$module_external_calling_convention{$module}{$external_name} = "stub";
417 $$module_external_calling_convention{$module}{"\@$ordinal"} = "stub";
419 if(!$$function_internal_name{$external_name}) {
420 $$function_internal_name{$external_name} = $internal_name;
422 $$function_internal_name{$external_name} .= " & $internal_name";
424 if(!$$function_external_name{$internal_name}) {
425 $$function_external_name{$internal_name} = $external_name;
427 $$function_external_name{$internal_name} .= " & $external_name";
429 if(!$$function_internal_ordinal{$internal_name}) {
430 $$function_internal_ordinal{$internal_name} = $ordinal;
432 $$function_internal_ordinal{$internal_name} .= " & $ordinal";
434 if(!$$function_external_ordinal{$external_name}) {
435 $$function_external_ordinal{$external_name} = $ordinal;
437 $$function_external_ordinal{$external_name} .= " & $ordinal";
439 if(!$$function_internal_module{$internal_name}) {
440 $$function_internal_module{$internal_name} = "$module";
441 } else { # if($$function_internal_module{$internal_name} !~ /$module/) {
442 $$function_internal_module{$internal_name} .= " & $module";
444 if(!$$function_external_module{$external_name}) {
445 $$function_external_module{$external_name} = "$module";
446 } else { # if($$function_external_module{$external_name} !~ /$module/) {
447 $$function_external_module{$external_name} .= " & $module";
449 } elsif(/^(\d+|@)\s+extern(?:\s+(?:-norelay|-i386|-ret16|-ret64))?\s+(\S+)\s*(\S*)$/) {
452 my $external_name = $2;
453 my $internal_name = $3;
455 $internal_name = $external_name if !$internal_name;
457 if ($external_name ne "@") {
458 $$module_external_calling_convention{$module}{$external_name} = "extern";
460 $$module_external_calling_convention{$module}{"\@$ordinal"} = "extern";
462 } elsif(/^(?:\d+|@)\s+(?:equate|variable)/) {
465 my $next_line = <IN>;
466 if(!defined($next_line) || $next_line =~ /^\s*\d|@/) {
467 die "$file: $.: syntax error: '$_'\n";
474 if(defined($ordinal)) {
475 if($ordinal ne "@" && $ordinals{$ordinal}) {
476 $output->write("$file: ordinal redefined: $_\n");
478 $ordinals{$ordinal}++;
483 $$modules{$module}++;
485 $$module_files{$module} = $file;
490 my $name = \${$self->{NAME}};
495 sub is_allowed_kind($$) {
497 my $allowed_kind = \%{$self->{ALLOWED_KIND}};
501 return $$allowed_kind{$kind};
510 my $allowed_kind = \%{$self->{ALLOWED_KIND}};
514 $$allowed_kind{$kind}++;
517 sub is_limited_type($$) {
519 my $allowed_modules_limited = \%{$self->{ALLOWED_MODULES_LIMITED}};
523 return $$allowed_modules_limited{$type};
526 sub is_allowed_type_in_module($$) {
528 my $allowed_modules = \%{$self->{ALLOWED_MODULES}};
529 my $allowed_modules_limited = \%{$self->{ALLOWED_MODULES_LIMITED}};
532 my @modules = split(/ \& /, shift);
534 if(!$$allowed_modules_limited{$type}) { return 1; }
536 foreach my $module (@modules) {
537 if($$allowed_modules{$type}{$module}) { return 1; }
543 sub allow_type_in_module($$) {
545 my $allowed_modules = \%{$self->{ALLOWED_MODULES}};
548 my @modules = split(/ \& /, shift);
550 foreach my $module (@modules) {
551 $$allowed_modules{$type}{$module}++;
555 sub type_used_in_module($$) {
557 my $used_modules = \%{$self->{USED_MODULES}};
560 my @modules = split(/ \& /, shift);
562 foreach my $module (@modules) {
563 $$used_modules{$type}{$module} = 1;
569 sub types_not_used($) {
571 my $used_modules = \%{$self->{USED_MODULES}};
572 my $allowed_modules = \%{$self->{ALLOWED_MODULES}};
575 foreach my $type (sort(keys(%$allowed_modules))) {
576 foreach my $module (sort(keys(%{$$allowed_modules{$type}}))) {
577 if(!$$used_modules{$type}{$module}) {
578 $$not_used{$module}{$type} = 1;
585 sub types_unlimited_used_in_modules($) {
588 my $used_modules = \%{$self->{USED_MODULES}};
589 my $allowed_modules = \%{$self->{ALLOWED_MODULES}};
590 my $allowed_modules_unlimited = \%{$self->{ALLOWED_MODULES_UNLIMITED}};
593 foreach my $type (sort(keys(%$allowed_modules_unlimited))) {
596 foreach my $module (sort(keys(%{$$used_modules{$type}}))) {
598 push @modules, $module;
601 foreach my $module (@modules) {
602 $$used_types{$type}{$module} = 1;
609 sub translate_argument($$) {
611 my $translate_argument = \%{$self->{TRANSLATE_ARGUMENT}};
615 return $$translate_argument{$type};
618 sub declare_argument($$$) {
620 my $translate_argument = \%{$self->{TRANSLATE_ARGUMENT}};
625 $$translate_argument{$type} = $kind;
628 sub all_declared_types($) {
630 my $translate_argument = \%{$self->{TRANSLATE_ARGUMENT}};
632 return sort(keys(%$translate_argument));
635 sub is_allowed_type_format($$$$) {
637 my $type_format = \%{$self->{TYPE_FORMAT}};
645 if(defined($module) && defined($type)) {
647 foreach (split(/ & /, $module)) {
648 if(defined($formats)) {
653 if(defined($$type_format{$_}{$type})) {
654 $formats .= $$type_format{$_}{$type};
659 if(defined($formats)) {
661 foreach (split(/\|/, $formats)) {
673 my $modules = \%{$self->{MODULES}};
675 return sort(keys(%$modules));
680 my $modules = \%{$self->{MODULES}};
684 return $$modules{$name};
687 sub module_file($$) {
692 my $module_files = \%{$self->{MODULE_FILES}};
694 return $$module_files{$module};
697 sub all_internal_functions($) {
699 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
701 return sort(keys(%$function_internal_calling_convention));
704 sub all_internal_functions_in_module($$) {
706 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
707 my $function_internal_module = \%{$self->{FUNCTION_INTERNAL_MODULE}};
712 foreach my $name (keys(%$function_internal_calling_convention)) {
713 if($$function_internal_module{$name} eq $module) {
721 sub all_external_functions($) {
723 my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}};
725 return sort(keys(%$function_external_name));
728 sub all_external_functions_in_module($$) {
730 my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}};
731 my $function_external_module = \%{$self->{FUNCTION_EXTERNAL_MODULE}};
736 foreach my $name (keys(%$function_external_name)) {
737 if($$function_external_module{$name} eq $module) {
745 sub all_functions_in_module($$) {
747 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
751 return sort(keys(%{$$module_external_calling_convention{$module}}));
754 sub all_broken_forwards($) {
756 my $function_forward = \%{$self->{FUNCTION_FORWARD}};
758 my @broken_forwards = ();
759 foreach my $module (sort(keys(%$function_forward))) {
760 foreach my $external_name (sort(keys(%{$$function_forward{$module}}))) {
761 (my $forward_module, my $forward_external_name) = @{$$function_forward{$module}{$external_name}};
763 my $forward_external_calling_convention =
764 $self->function_external_calling_convention_in_module($forward_module, $forward_external_name);
766 if(!defined($forward_external_calling_convention)) {
767 push @broken_forwards, [$module, $external_name, $forward_module, $forward_external_name];
771 return @broken_forwards;
775 sub function_internal_ordinal($$) {
777 my $function_internal_ordinal = \%{$self->{FUNCTION_INTERNAL_ORDINAL}};
781 return $$function_internal_ordinal{$name};
784 sub function_external_ordinal($$) {
786 my $function_external_ordinal = \%{$self->{FUNCTION_EXTERNAL_ORDINAL}};
790 return $$function_external_ordinal{$name};
793 sub function_internal_calling_convention($$) {
795 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
799 return $$function_internal_calling_convention{$name};
802 sub function_external_calling_convention($$) {
804 my $function_external_calling_convention = \%{$self->{FUNCTION_EXTERNAL_CALLING_CONVENTION}};
808 return $$function_external_calling_convention{$name};
811 sub function_external_calling_convention_in_module($$$) {
813 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
818 return $$module_external_calling_convention{$module}{$name};
821 sub function_internal_name($$) {
823 my $function_internal_name = \%{$self->{FUNCTION_INTERNAL_NAME}};
827 return $$function_internal_name{$name};
830 sub function_external_name($$) {
832 my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}};
836 return $$function_external_name{$name};
839 sub function_forward_final_destination($$$) {
842 my $function_forward = \%{$self->{FUNCTION_FORWARD}};
847 my $forward_module = $module;
848 my $forward_name = $name;
849 while(defined(my $forward = $$function_forward{$forward_module}{$forward_name})) {
850 ($forward_module, $forward_name) = @$forward;
853 return ($forward_module, $forward_name);
856 sub is_function($$) {
858 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
862 return $$function_internal_calling_convention{$name};
865 sub all_shared_internal_functions($$) {
867 my $function_shared = \%{$self->{FUNCTION_SHARED}};
869 return sort(keys(%$function_shared));
872 sub is_shared_internal_function($$) {
874 my $function_shared = \%{$self->{FUNCTION_SHARED}};
878 return $$function_shared{$name};
881 sub found_shared_internal_function($$) {
883 my $function_shared = \%{$self->{FUNCTION_SHARED}};
887 $$function_shared{$name} = 1;
890 sub function_internal_arguments($$) {
892 my $function_internal_arguments = \%{$self->{FUNCTION_INTERNAL_ARGUMENTS}};
896 return $$function_internal_arguments{$name};
899 sub function_external_arguments($$) {
901 my $function_external_arguments = \%{$self->{FUNCTION_EXTERNAL_ARGUMENTS}};
905 return $$function_external_arguments{$name};
908 sub function_internal_module($$) {
910 my $function_internal_module = \%{$self->{FUNCTION_INTERNAL_MODULE}};
914 return $$function_internal_module{$name};
917 sub function_external_module($$) {
919 my $function_external_module = \%{$self->{FUNCTION_EXTERNAL_MODULE}};
923 return $$function_external_module{$name};
926 sub function_wine_extension($$$) {
928 my $function_wine_extension = \%{$self->{FUNCTION_WINE_EXTENSION}};
933 return $$function_wine_extension{$module}{$name};
936 sub is_function_stub($$$) {
938 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
943 if($$module_external_calling_convention{$module}{$name} eq "stub") {
949 sub is_function_stub_in_module($$$) {
951 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
956 if(!defined($$module_external_calling_convention{$module}{$name})) {
959 return $$module_external_calling_convention{$module}{$name} eq "stub";
962 ########################################################################
966 sub _get_all_module_internal_ordinal($$) {
968 my $internal_name = shift;
973 my $name = $winapi->function_external_name($internal_name);
975 @name = split(/ & /, $name);
980 my $module = $winapi->function_internal_module($internal_name);
981 if(defined($module)) {
982 @module = split(/ & /, $module);
987 my $ordinal = $winapi->function_internal_ordinal($internal_name);
988 if(defined($ordinal)) {
989 @ordinal = split(/ & /, $ordinal);
996 while(defined($name = shift @name) &&
997 defined($module = shift @module) &&
998 defined($ordinal = shift @ordinal))
1000 push @entries, [$name, $module, $ordinal];
1006 sub get_all_module_internal_ordinal16($) {
1007 return _get_all_module_internal_ordinal($win16api, $_[0]);
1010 sub get_all_module_internal_ordinal32($) {
1011 return _get_all_module_internal_ordinal($win32api, $_[0]);
1014 sub get_all_module_internal_ordinal($) {
1016 foreach my $winapi (@winapis) {
1017 push @entries, _get_all_module_internal_ordinal($winapi, $_[0]);
1023 sub _get_all_module_external_ordinal($$) {
1025 my $external_name = shift;
1030 my $name = $winapi->function_internal_name($external_name);
1031 if(defined($name)) {
1032 @name = split(/ & /, $name);
1037 my $module = $winapi->function_external_module($external_name);
1038 if(defined($module)) {
1039 @module = split(/ & /, $module);
1044 my $ordinal = $winapi->function_external_ordinal($external_name);
1045 if(defined($ordinal)) {
1046 @ordinal = split(/ & /, $ordinal);
1053 while(defined($name = shift @name) &&
1054 defined($module = shift @module) &&
1055 defined($ordinal = shift @ordinal))
1057 push @entries, [$name, $module, $ordinal];
1063 sub get_all_module_external_ordinal16($) {
1064 return _get_all_module_external_ordinal($win16api, $_[0]);
1067 sub get_all_module_external_ordinal32($) {
1068 return _get_all_module_external_ordinal($win32api, $_[0]);
1071 sub get_all_module_external_ordinal($) {
1073 foreach my $winapi (@winapis) {
1074 push @entries, _get_all_module_external_ordinal($winapi, $_[0]);