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}};
139 $output->lazy_progress("$file");
141 open(IN, "< $winapi_dir/$file") || die "$winapi_dir/$file: $!\n";
144 s/^\s*?(.*?)\s*$/$1/; # remove whitespace at begin and end of line
145 s/^(.*?)\s*#.*$/$1/; # remove comments
146 /^$/ && next; # skip empty lines
150 $module =~ s/\.dll$//; # FIXME: Kludge
151 } elsif(!$modules->is_allowed_module($module)) {
153 } elsif(s/^%(\S+)\s*//) {
159 $$allowed_kind{$kind} = 1;
162 } elsif(/^--extension/) {
164 } elsif(/^--format=(\".*?\"|\S*)/) {
166 $format =~ s/^\"(.*?)\"$/$1/;
169 if(!defined($format)) {
170 if($kind eq "long") {
171 $format = "%d|%u|%x|%X|";
172 $format .= "%hd|%hu|%hx|%hX|";
173 $format .= "%ld|%lu|%lx|%lX|";
174 $format .= "%04x|%04X|0x%04x|0x%04X|";
175 $format .= "%08x|%08X|0x%08x|0x%08X|";
176 $format .= "%08lx|%08lX|0x%08lx|0x%08lX";
177 } elsif($kind eq "longlong") {
179 } elsif($kind eq "ptr") {
181 } elsif($kind eq "segptr") {
183 } elsif($kind eq "str") {
185 } elsif($kind eq "wstr") {
187 } elsif($kind eq "word") {
188 $format = "%d|%u|%x|%X|";
189 $format .= "%hd|%hu|%hx|%hX|";
190 $format .= "%04x|%04X|0x%04x|0x%04X";
192 $format = "<unknown>";
195 } elsif(defined($kind)) {
198 if(defined($module)) {
199 if($$allowed_modules_unlimited{$type}) {
200 $output->write("$file: type ($type) already specified as an unlimited type\n");
201 } elsif(!$$allowed_modules{$type}{$module}) {
202 $$allowed_modules{$type}{$module} = 1;
203 $$allowed_modules_limited{$type} = 1;
205 $output->write("$file: type ($type) already specified\n");
208 $$allowed_modules_unlimited{$type} = 1;
211 $$allowed_modules_limited{$type} = 1;
213 if(defined($$translate_argument{$type}) && $$translate_argument{$type} ne $kind) {
214 $output->write("$file: type ($type) respecified as different kind ($kind != $$translate_argument{$type})\n");
216 $$translate_argument{$type} = $kind;
219 $$type_format{$module}{$type} = $format;
221 $output->write("$file: file must begin with %<type> statement\n");
228 sub parse_spec_file($$) {
231 my $function_internal_arguments = \%{$self->{FUNCTION_INTERNAL_ARGUMENTS}};
232 my $function_external_arguments = \%{$self->{FUNCTION_EXTERNAL_ARGUMENTS}};
233 my $function_internal_ordinal = \%{$self->{FUNCTION_INTERNAL_ORDINAL}};
234 my $function_external_ordinal = \%{$self->{FUNCTION_EXTERNAL_ORDINAL}};
235 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
236 my $function_external_calling_convention = \%{$self->{FUNCTION_EXTERNAL_CALLING_CONVENTION}};
237 my $function_internal_name = \%{$self->{FUNCTION_INTERNAL_NAME}};
238 my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}};
239 my $function_forward = \%{$self->{FUNCTION_FORWARD}};
240 my $function_internal_module = \%{$self->{FUNCTION_INTERNAL_MODULE}};
241 my $function_external_module = \%{$self->{FUNCTION_EXTERNAL_MODULE}};
242 my $function_wine_extension = \%{$self->{FUNCTION_WINE_EXTENSION}};
243 my $modules = \%{$self->{MODULES}};
244 my $module_files = \%{$self->{MODULE_FILES}};
245 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
252 my $wine_extension = 0;
254 $output->lazy_progress("$file");
257 $module =~ s/^.*?([^\/]*)\.spec$/$1/;
259 open(IN, "< $file") || die "$file: $!\n";
263 while($lookahead || defined($_ = <IN>)) {
266 if(s/^(.*?)\s*\#\s*(.*)\s*$/$1/) {
268 if ($comment =~ /^Wine/i) { # FIXME: Kludge
275 if(/^\d+|@/) { $header = 0; $lookahead = 1; }
281 (pascal|stdcall|cdecl|varargs)\s+
282 ((?:(?:-noname|-norelay|-i386|-ret16|-ret64|-register|-interrupt|-private)\s+)*)(\S+)\s*\(\s*(.*?)\s*\)\s*(\S*)$/x)
284 my $calling_convention = $2;
286 my $external_name = $4;
288 my $internal_name = $6;
294 $internal_name = $external_name if !$internal_name;
296 if($flags =~ /-noname/) {
297 # $external_name = "@";
300 if($flags =~ /(?:-register|-interrupt)/) {
301 if($arguments) { $arguments .= " "; }
303 $calling_convention .= " -register";
306 if ($internal_name =~ /^(.*?)\.(.*?)$/) {
307 my $forward_module = lc($1);
308 my $forward_name = $2;
311 $calling_convention .= " -forward";
313 $calling_convention = "forward";
316 $$function_forward{$module}{$external_name} = [$forward_module, $forward_name];
319 if($external_name ne "@") {
320 $$module_external_calling_convention{$module}{$external_name} = $calling_convention;
322 $$module_external_calling_convention{$module}{"\@$ordinal"} = $calling_convention;
324 if(!$$function_internal_name{$external_name}) {
325 $$function_internal_name{$external_name} = $internal_name;
327 $$function_internal_name{$external_name} .= " & $internal_name";
329 if(!$$function_external_name{$internal_name}) {
330 $$function_external_name{$internal_name} = $external_name;
332 $$function_external_name{$internal_name} .= " & $external_name";
334 $$function_internal_arguments{$internal_name} = $arguments;
335 $$function_external_arguments{$external_name} = $arguments;
336 if(!$$function_internal_ordinal{$internal_name}) {
337 $$function_internal_ordinal{$internal_name} = $ordinal;
339 $$function_internal_ordinal{$internal_name} .= " & $ordinal";
341 if(!$$function_external_ordinal{$external_name}) {
342 $$function_external_ordinal{$external_name} = $ordinal;
344 $$function_external_ordinal{$external_name} .= " & $ordinal";
346 $$function_internal_calling_convention{$internal_name} = $calling_convention;
347 $$function_external_calling_convention{$external_name} = $calling_convention;
348 if(!$$function_internal_module{$internal_name}) {
349 $$function_internal_module{$internal_name} = "$module";
351 $$function_internal_module{$internal_name} .= " & $module";
353 if(!$$function_external_module{$external_name}) {
354 $$function_external_module{$external_name} = "$module";
356 $$function_external_module{$external_name} .= " & $module";
358 $$function_wine_extension{$module}{$external_name} = $wine_extension;
360 if(0 && $options->spec_mismatch) {
361 if($external_name eq "@") {
362 if($internal_name !~ /^\U$module\E_$ordinal$/) {
363 $output->write("$file: $external_name: the internal name ($internal_name) mismatch\n");
366 my $name = $external_name;
372 $name2 =~ s/^(?:_|Rtl|k32|K32)//;
375 $name3 =~ s/^INT_Int[0-9a-f]{2}Handler$/BUILTIN_DefaultIntHandler/;
378 $name4 =~ s/^(VxDCall)\d$/$1/;
380 # FIXME: This special case is becuase of a very ugly kludge that should be fixed IMHO
382 $name5 =~ s/^(.*?16)_(.*?)$/$1_fn$2/;
384 if(uc($internal_name) ne uc($external_name) &&
385 $internal_name !~ /(\Q$name\E|\Q$name1\E|\Q$name2\E|\Q$name3\E|\Q$name4\E|\Q$name5\E)/)
387 $output->write("$file: $external_name: internal name ($internal_name) mismatch\n");
391 } elsif(/^(\d+|@)\s+stub(?:\s+(-noname|-norelay|-i386|-ret16|-ret64|-private))?\s+(\S+)$/) {
395 my $external_name = $3;
397 $flags = "" if !defined($flags);
399 if($flags =~ /-noname/) {
400 # $external_name = "@";
403 my $internal_name = $external_name;
405 if ($external_name ne "@") {
406 $$module_external_calling_convention{$module}{$external_name} = "stub";
408 $$module_external_calling_convention{$module}{"\@$ordinal"} = "stub";
410 if(!$$function_internal_name{$external_name}) {
411 $$function_internal_name{$external_name} = $internal_name;
413 $$function_internal_name{$external_name} .= " & $internal_name";
415 if(!$$function_external_name{$internal_name}) {
416 $$function_external_name{$internal_name} = $external_name;
418 $$function_external_name{$internal_name} .= " & $external_name";
420 if(!$$function_internal_ordinal{$internal_name}) {
421 $$function_internal_ordinal{$internal_name} = $ordinal;
423 $$function_internal_ordinal{$internal_name} .= " & $ordinal";
425 if(!$$function_external_ordinal{$external_name}) {
426 $$function_external_ordinal{$external_name} = $ordinal;
428 $$function_external_ordinal{$external_name} .= " & $ordinal";
430 if(!$$function_internal_module{$internal_name}) {
431 $$function_internal_module{$internal_name} = "$module";
432 } else { # if($$function_internal_module{$internal_name} !~ /$module/) {
433 $$function_internal_module{$internal_name} .= " & $module";
435 if(!$$function_external_module{$external_name}) {
436 $$function_external_module{$external_name} = "$module";
437 } else { # if($$function_external_module{$external_name} !~ /$module/) {
438 $$function_external_module{$external_name} .= " & $module";
440 } elsif(/^(\d+|@)\s+extern(?:\s+(?:-norelay|-i386|-ret16|-ret64))?\s+(\S+)\s*(\S*)$/) {
443 my $external_name = $2;
444 my $internal_name = $3;
446 $internal_name = $external_name if !$internal_name;
448 if ($external_name ne "@") {
449 $$module_external_calling_convention{$module}{$external_name} = "extern";
451 $$module_external_calling_convention{$module}{"\@$ordinal"} = "extern";
453 } elsif(/^(?:\d+|@)\s+(?:equate|variable)/) {
456 my $next_line = <IN>;
457 if(!defined($next_line) || $next_line =~ /^\s*\d|@/) {
458 die "$file: $.: syntax error: '$_'\n";
465 if(defined($ordinal)) {
466 if($ordinal ne "@" && $ordinals{$ordinal}) {
467 $output->write("$file: ordinal redefined: $_\n");
469 $ordinals{$ordinal}++;
474 $$modules{$module}++;
476 $$module_files{$module} = $file;
481 my $name = \${$self->{NAME}};
486 sub is_allowed_kind($$) {
488 my $allowed_kind = \%{$self->{ALLOWED_KIND}};
492 return $$allowed_kind{$kind};
501 my $allowed_kind = \%{$self->{ALLOWED_KIND}};
505 $$allowed_kind{$kind}++;
508 sub is_limited_type($$) {
510 my $allowed_modules_limited = \%{$self->{ALLOWED_MODULES_LIMITED}};
514 return $$allowed_modules_limited{$type};
517 sub is_allowed_type_in_module($$) {
519 my $allowed_modules = \%{$self->{ALLOWED_MODULES}};
520 my $allowed_modules_limited = \%{$self->{ALLOWED_MODULES_LIMITED}};
523 my @modules = split(/ \& /, shift);
525 if(!$$allowed_modules_limited{$type}) { return 1; }
527 foreach my $module (@modules) {
528 if($$allowed_modules{$type}{$module}) { return 1; }
534 sub allow_type_in_module($$) {
536 my $allowed_modules = \%{$self->{ALLOWED_MODULES}};
539 my @modules = split(/ \& /, shift);
541 foreach my $module (@modules) {
542 $$allowed_modules{$type}{$module}++;
546 sub type_used_in_module($$) {
548 my $used_modules = \%{$self->{USED_MODULES}};
551 my @modules = split(/ \& /, shift);
553 foreach my $module (@modules) {
554 $$used_modules{$type}{$module} = 1;
560 sub types_not_used($) {
562 my $used_modules = \%{$self->{USED_MODULES}};
563 my $allowed_modules = \%{$self->{ALLOWED_MODULES}};
566 foreach my $type (sort(keys(%$allowed_modules))) {
567 foreach my $module (sort(keys(%{$$allowed_modules{$type}}))) {
568 if(!$$used_modules{$type}{$module}) {
569 $$not_used{$module}{$type} = 1;
576 sub types_unlimited_used_in_modules($) {
579 my $used_modules = \%{$self->{USED_MODULES}};
580 my $allowed_modules = \%{$self->{ALLOWED_MODULES}};
581 my $allowed_modules_unlimited = \%{$self->{ALLOWED_MODULES_UNLIMITED}};
584 foreach my $type (sort(keys(%$allowed_modules_unlimited))) {
587 foreach my $module (sort(keys(%{$$used_modules{$type}}))) {
589 push @modules, $module;
592 foreach my $module (@modules) {
593 $$used_types{$type}{$module} = 1;
600 sub translate_argument($$) {
602 my $translate_argument = \%{$self->{TRANSLATE_ARGUMENT}};
606 return $$translate_argument{$type};
609 sub declare_argument($$$) {
611 my $translate_argument = \%{$self->{TRANSLATE_ARGUMENT}};
616 $$translate_argument{$type} = $kind;
619 sub all_declared_types($) {
621 my $translate_argument = \%{$self->{TRANSLATE_ARGUMENT}};
623 return sort(keys(%$translate_argument));
626 sub is_allowed_type_format($$$$) {
628 my $type_format = \%{$self->{TYPE_FORMAT}};
636 if(defined($module) && defined($type)) {
638 foreach (split(/ & /, $module)) {
639 if(defined($formats)) {
644 if(defined($$type_format{$_}{$type})) {
645 $formats .= $$type_format{$_}{$type};
650 if(defined($formats)) {
652 foreach (split(/\|/, $formats)) {
664 my $modules = \%{$self->{MODULES}};
666 return sort(keys(%$modules));
671 my $modules = \%{$self->{MODULES}};
675 return $$modules{$name};
678 sub module_file($$) {
683 my $module_files = \%{$self->{MODULE_FILES}};
685 return $$module_files{$module};
688 sub all_internal_functions($) {
690 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
692 return sort(keys(%$function_internal_calling_convention));
695 sub all_internal_functions_in_module($$) {
697 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
698 my $function_internal_module = \%{$self->{FUNCTION_INTERNAL_MODULE}};
703 foreach my $name (keys(%$function_internal_calling_convention)) {
704 if($$function_internal_module{$name} eq $module) {
712 sub all_external_functions($) {
714 my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}};
716 return sort(keys(%$function_external_name));
719 sub all_external_functions_in_module($$) {
721 my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}};
722 my $function_external_module = \%{$self->{FUNCTION_EXTERNAL_MODULE}};
727 foreach my $name (keys(%$function_external_name)) {
728 if($$function_external_module{$name} eq $module) {
736 sub all_functions_in_module($$) {
738 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
742 return sort(keys(%{$$module_external_calling_convention{$module}}));
745 sub all_broken_forwards($) {
747 my $function_forward = \%{$self->{FUNCTION_FORWARD}};
749 my @broken_forwards = ();
750 foreach my $module (sort(keys(%$function_forward))) {
751 foreach my $external_name (sort(keys(%{$$function_forward{$module}}))) {
752 (my $forward_module, my $forward_external_name) = @{$$function_forward{$module}{$external_name}};
754 my $forward_external_calling_convention =
755 $self->function_external_calling_convention_in_module($forward_module, $forward_external_name);
757 if(!defined($forward_external_calling_convention)) {
758 push @broken_forwards, [$module, $external_name, $forward_module, $forward_external_name];
762 return @broken_forwards;
766 sub function_internal_ordinal($$) {
768 my $function_internal_ordinal = \%{$self->{FUNCTION_INTERNAL_ORDINAL}};
772 return $$function_internal_ordinal{$name};
775 sub function_external_ordinal($$) {
777 my $function_external_ordinal = \%{$self->{FUNCTION_EXTERNAL_ORDINAL}};
781 return $$function_external_ordinal{$name};
784 sub function_internal_calling_convention($$) {
786 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
790 return $$function_internal_calling_convention{$name};
793 sub function_external_calling_convention($$) {
795 my $function_external_calling_convention = \%{$self->{FUNCTION_EXTERNAL_CALLING_CONVENTION}};
799 return $$function_external_calling_convention{$name};
802 sub function_external_calling_convention_in_module($$$) {
804 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
809 return $$module_external_calling_convention{$module}{$name};
812 sub function_internal_name($$) {
814 my $function_internal_name = \%{$self->{FUNCTION_INTERNAL_NAME}};
818 return $$function_internal_name{$name};
821 sub function_external_name($$) {
823 my $function_external_name = \%{$self->{FUNCTION_EXTERNAL_NAME}};
827 return $$function_external_name{$name};
830 sub function_forward_final_destination($$$) {
833 my $function_forward = \%{$self->{FUNCTION_FORWARD}};
838 my $forward_module = $module;
839 my $forward_name = $name;
840 while(defined(my $forward = $$function_forward{$forward_module}{$forward_name})) {
841 ($forward_module, $forward_name) = @$forward;
844 return ($forward_module, $forward_name);
847 sub is_function($$) {
849 my $function_internal_calling_convention = \%{$self->{FUNCTION_INTERNAL_CALLING_CONVENTION}};
853 return $$function_internal_calling_convention{$name};
856 sub all_shared_internal_functions($$) {
858 my $function_shared = \%{$self->{FUNCTION_SHARED}};
860 return sort(keys(%$function_shared));
863 sub is_shared_internal_function($$) {
865 my $function_shared = \%{$self->{FUNCTION_SHARED}};
869 return $$function_shared{$name};
872 sub found_shared_internal_function($$) {
874 my $function_shared = \%{$self->{FUNCTION_SHARED}};
878 $$function_shared{$name} = 1;
881 sub function_internal_arguments($$) {
883 my $function_internal_arguments = \%{$self->{FUNCTION_INTERNAL_ARGUMENTS}};
887 return $$function_internal_arguments{$name};
890 sub function_external_arguments($$) {
892 my $function_external_arguments = \%{$self->{FUNCTION_EXTERNAL_ARGUMENTS}};
896 return $$function_external_arguments{$name};
899 sub function_internal_module($$) {
901 my $function_internal_module = \%{$self->{FUNCTION_INTERNAL_MODULE}};
905 return $$function_internal_module{$name};
908 sub function_external_module($$) {
910 my $function_external_module = \%{$self->{FUNCTION_EXTERNAL_MODULE}};
914 return $$function_external_module{$name};
917 sub function_wine_extension($$$) {
919 my $function_wine_extension = \%{$self->{FUNCTION_WINE_EXTENSION}};
924 return $$function_wine_extension{$module}{$name};
927 sub is_function_stub($$$) {
929 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
934 if($$module_external_calling_convention{$module}{$name} eq "stub") {
940 sub is_function_stub_in_module($$$) {
942 my $module_external_calling_convention = \%{$self->{MODULE_EXTERNAL_CALLING_CONVENTION}};
947 if(!defined($$module_external_calling_convention{$module}{$name})) {
950 return $$module_external_calling_convention{$module}{$name} eq "stub";
953 ########################################################################
957 sub _get_all_module_internal_ordinal($$) {
959 my $internal_name = shift;
964 my $name = $winapi->function_external_name($internal_name);
966 @name = split(/ & /, $name);
971 my $module = $winapi->function_internal_module($internal_name);
972 if(defined($module)) {
973 @module = split(/ & /, $module);
978 my $ordinal = $winapi->function_internal_ordinal($internal_name);
979 if(defined($ordinal)) {
980 @ordinal = split(/ & /, $ordinal);
987 while(defined($name = shift @name) &&
988 defined($module = shift @module) &&
989 defined($ordinal = shift @ordinal))
991 push @entries, [$name, $module, $ordinal];
997 sub get_all_module_internal_ordinal16($) {
998 return _get_all_module_internal_ordinal($win16api, $_[0]);
1001 sub get_all_module_internal_ordinal32($) {
1002 return _get_all_module_internal_ordinal($win32api, $_[0]);
1005 sub get_all_module_internal_ordinal($) {
1007 foreach my $winapi (@winapis) {
1008 push @entries, _get_all_module_internal_ordinal($winapi, $_[0]);
1014 sub _get_all_module_external_ordinal($$) {
1016 my $external_name = shift;
1021 my $name = $winapi->function_internal_name($external_name);
1022 if(defined($name)) {
1023 @name = split(/ & /, $name);
1028 my $module = $winapi->function_external_module($external_name);
1029 if(defined($module)) {
1030 @module = split(/ & /, $module);
1035 my $ordinal = $winapi->function_external_ordinal($external_name);
1036 if(defined($ordinal)) {
1037 @ordinal = split(/ & /, $ordinal);
1044 while(defined($name = shift @name) &&
1045 defined($module = shift @module) &&
1046 defined($ordinal = shift @ordinal))
1048 push @entries, [$name, $module, $ordinal];
1054 sub get_all_module_external_ordinal16($) {
1055 return _get_all_module_external_ordinal($win16api, $_[0]);
1058 sub get_all_module_external_ordinal32($) {
1059 return _get_all_module_external_ordinal($win32api, $_[0]);
1062 sub get_all_module_external_ordinal($) {
1064 foreach my $winapi (@winapis) {
1065 push @entries, _get_all_module_external_ordinal($winapi, $_[0]);