1 | # |
---|
2 | # Create the export list for perl. |
---|
3 | # |
---|
4 | # Needed by WIN32 and OS/2 for creating perl.dll, |
---|
5 | # and by AIX for creating libperl.a when -Dusershrplib is in effect, |
---|
6 | # and by MacOS Classic. |
---|
7 | # |
---|
8 | # reads global.sym, pp.sym, perlvars.h, intrpvar.h, thrdvar.h, config.h |
---|
9 | # On OS/2 reads miniperl.map and the previous version of perl5.def as well |
---|
10 | |
---|
11 | my $PLATFORM; |
---|
12 | my $CCTYPE; |
---|
13 | |
---|
14 | while (@ARGV) { |
---|
15 | my $flag = shift; |
---|
16 | if ($flag =~ s/^CC_FLAGS=/ /) { |
---|
17 | for my $fflag ($flag =~ /(?:^|\s)-D(\S+)/g) { |
---|
18 | $fflag .= '=1' unless $fflag =~ /^(\w+)=/; |
---|
19 | $define{$1} = $2 if $fflag =~ /^(\w+)=(.+)$/; |
---|
20 | } |
---|
21 | next; |
---|
22 | } |
---|
23 | $define{$1} = 1 if ($flag =~ /^-D(\w+)$/); |
---|
24 | $define{$1} = $2 if ($flag =~ /^-D(\w+)=(.+)$/); |
---|
25 | $CCTYPE = $1 if ($flag =~ /^CCTYPE=(\w+)$/); |
---|
26 | $PLATFORM = $1 if ($flag =~ /^PLATFORM=(\w+)$/); |
---|
27 | if ($PLATFORM eq 'netware') { |
---|
28 | $FILETYPE = $1 if ($flag =~ /^FILETYPE=(\w+)$/); |
---|
29 | } |
---|
30 | } |
---|
31 | |
---|
32 | my @PLATFORM = qw(aix win32 wince os2 MacOS netware); |
---|
33 | my %PLATFORM; |
---|
34 | @PLATFORM{@PLATFORM} = (); |
---|
35 | |
---|
36 | defined $PLATFORM || die "PLATFORM undefined, must be one of: @PLATFORM\n"; |
---|
37 | exists $PLATFORM{$PLATFORM} || die "PLATFORM must be one of: @PLATFORM\n"; |
---|
38 | |
---|
39 | my %exportperlmalloc = |
---|
40 | ( |
---|
41 | Perl_malloc => "malloc", |
---|
42 | Perl_mfree => "free", |
---|
43 | Perl_realloc => "realloc", |
---|
44 | Perl_calloc => "calloc", |
---|
45 | ); |
---|
46 | |
---|
47 | my $exportperlmalloc = $PLATFORM eq 'os2'; |
---|
48 | |
---|
49 | my $config_sh = "config.sh"; |
---|
50 | my $config_h = "config.h"; |
---|
51 | my $thrdvar_h = "thrdvar.h"; |
---|
52 | my $intrpvar_h = "intrpvar.h"; |
---|
53 | my $perlvars_h = "perlvars.h"; |
---|
54 | my $global_sym = "global.sym"; |
---|
55 | my $pp_sym = "pp.sym"; |
---|
56 | my $globvar_sym = "globvar.sym"; |
---|
57 | my $perlio_sym = "perlio.sym"; |
---|
58 | |
---|
59 | if ($PLATFORM eq 'aix') { |
---|
60 | # Nothing for now. |
---|
61 | } |
---|
62 | elsif ($PLATFORM =~ /^win(?:32|ce)$/ || $PLATFORM eq 'netware') { |
---|
63 | $CCTYPE = "MSVC" unless defined $CCTYPE; |
---|
64 | foreach ($thrdvar_h, $intrpvar_h, $perlvars_h, $global_sym, |
---|
65 | $pp_sym, $globvar_sym, $perlio_sym) { |
---|
66 | s!^!..\\!; |
---|
67 | } |
---|
68 | } |
---|
69 | elsif ($PLATFORM eq 'MacOS') { |
---|
70 | foreach ($thrdvar_h, $intrpvar_h, $perlvars_h, $global_sym, |
---|
71 | $pp_sym, $globvar_sym, $perlio_sym) { |
---|
72 | s!^!::!; |
---|
73 | } |
---|
74 | } |
---|
75 | |
---|
76 | unless ($PLATFORM eq 'win32' || $PLATFORM eq 'wince' || $PLATFORM eq 'MacOS' || $PLATFORM eq 'netware') { |
---|
77 | open(CFG,$config_sh) || die "Cannot open $config_sh: $!\n"; |
---|
78 | while (<CFG>) { |
---|
79 | if (/^(?:ccflags|optimize)='(.+)'$/) { |
---|
80 | $_ = $1; |
---|
81 | $define{$1} = 1 while /-D(\w+)/g; |
---|
82 | } |
---|
83 | if ($PLATFORM eq 'os2') { |
---|
84 | $CONFIG_ARGS = $1 if /^config_args='(.+)'$/; |
---|
85 | $ARCHNAME = $1 if /^archname='(.+)'$/; |
---|
86 | $PATCHLEVEL = $1 if /^perl_patchlevel='(.+)'$/; |
---|
87 | } |
---|
88 | } |
---|
89 | close(CFG); |
---|
90 | } |
---|
91 | |
---|
92 | open(CFG,$config_h) || die "Cannot open $config_h: $!\n"; |
---|
93 | while (<CFG>) { |
---|
94 | $define{$1} = 1 if /^\s*#\s*define\s+(MYMALLOC)\b/; |
---|
95 | $define{$1} = 1 if /^\s*#\s*define\s+(MULTIPLICITY)\b/; |
---|
96 | $define{$1} = 1 if /^\s*#\s*define\s+(PERL_\w+)\b/; |
---|
97 | $define{$1} = 1 if /^\s*#\s*define\s+(USE_\w+)\b/; |
---|
98 | } |
---|
99 | close(CFG); |
---|
100 | |
---|
101 | # perl.h logic duplication begins |
---|
102 | |
---|
103 | if ($define{PERL_IMPLICIT_SYS}) { |
---|
104 | $define{PL_OP_SLAB_ALLOC} = 1; |
---|
105 | } |
---|
106 | |
---|
107 | if ($define{USE_ITHREADS}) { |
---|
108 | if (!$define{MULTIPLICITY}) { |
---|
109 | $define{MULTIPLICITY} = 1; |
---|
110 | } |
---|
111 | } |
---|
112 | |
---|
113 | $define{PERL_IMPLICIT_CONTEXT} ||= |
---|
114 | $define{USE_ITHREADS} || |
---|
115 | $define{USE_5005THREADS} || |
---|
116 | $define{MULTIPLICITY} ; |
---|
117 | |
---|
118 | if ($define{USE_ITHREADS} && $PLATFORM ne 'win32' && $^O ne 'darwin') { |
---|
119 | $define{USE_REENTRANT_API} = 1; |
---|
120 | } |
---|
121 | |
---|
122 | # perl.h logic duplication ends |
---|
123 | |
---|
124 | my $sym_ord = 0; |
---|
125 | |
---|
126 | if ($PLATFORM =~ /^win(?:32|ce)$/) { |
---|
127 | warn join(' ',keys %define)."\n"; |
---|
128 | ($dll = ($define{PERL_DLL} || "perl58")) =~ s/\.dll$//i; |
---|
129 | print "LIBRARY $dll\n"; |
---|
130 | print "DESCRIPTION 'Perl interpreter'\n"; |
---|
131 | print "EXPORTS\n"; |
---|
132 | if ($define{PERL_IMPLICIT_SYS}) { |
---|
133 | output_symbol("perl_get_host_info"); |
---|
134 | output_symbol("perl_alloc_override"); |
---|
135 | } |
---|
136 | if ($define{USE_ITHREADS} and $define{PERL_IMPLICIT_SYS}) { |
---|
137 | output_symbol("perl_clone_host"); |
---|
138 | } |
---|
139 | } |
---|
140 | elsif ($PLATFORM eq 'os2') { |
---|
141 | if (open my $fh, '<', 'perl5.def') { |
---|
142 | while (<$fh>) { |
---|
143 | last if /^\s*EXPORTS\b/; |
---|
144 | } |
---|
145 | while (<$fh>) { |
---|
146 | $ordinal{$1} = $2 if /^\s*"(\w+)"\s*(?:=\s*"\w+"\s*)?\@(\d+)\s*$/; |
---|
147 | # This allows skipping ordinals which were used in older versions |
---|
148 | $sym_ord = $1 if /^\s*;\s*LAST_ORDINAL\s*=\s*(\d+)\s*$/; |
---|
149 | } |
---|
150 | $sym_ord < $_ and $sym_ord = $_ for values %ordinal; # Take the max |
---|
151 | } |
---|
152 | ($v = $]) =~ s/(\d\.\d\d\d)(\d\d)$/$1_$2/; |
---|
153 | $v .= '-thread' if $ARCHNAME =~ /-thread/; |
---|
154 | ($dll = $define{PERL_DLL}) =~ s/\.dll$//i; |
---|
155 | $v .= "\@$PATCHLEVEL" if $PATCHLEVEL; |
---|
156 | $d = "DESCRIPTION '\@#perl5-porters\@perl.org:$v#\@ Perl interpreter, configured as $CONFIG_ARGS'"; |
---|
157 | $d = substr($d, 0, 249) . "...'" if length $d > 253; |
---|
158 | print <<"---EOP---"; |
---|
159 | LIBRARY '$dll' INITINSTANCE TERMINSTANCE |
---|
160 | $d |
---|
161 | STACKSIZE 32768 |
---|
162 | CODE LOADONCALL |
---|
163 | DATA LOADONCALL NONSHARED MULTIPLE |
---|
164 | EXPORTS |
---|
165 | ---EOP--- |
---|
166 | } |
---|
167 | elsif ($PLATFORM eq 'aix') { |
---|
168 | $OSVER = `uname -v`; |
---|
169 | chop $OSVER; |
---|
170 | $OSREL = `uname -r`; |
---|
171 | chop $OSREL; |
---|
172 | if ($OSVER > 4 || ($OSVER == 4 && $OSREL >= 3)) { |
---|
173 | print "#! ..\n"; |
---|
174 | } else { |
---|
175 | print "#!\n"; |
---|
176 | } |
---|
177 | } |
---|
178 | elsif ($PLATFORM eq 'netware') { |
---|
179 | if ($FILETYPE eq 'def') { |
---|
180 | print "LIBRARY perl58\n"; |
---|
181 | print "DESCRIPTION 'Perl interpreter for NetWare'\n"; |
---|
182 | print "EXPORTS\n"; |
---|
183 | } |
---|
184 | if ($define{PERL_IMPLICIT_SYS}) { |
---|
185 | output_symbol("perl_get_host_info"); |
---|
186 | output_symbol("perl_alloc_override"); |
---|
187 | output_symbol("perl_clone_host"); |
---|
188 | } |
---|
189 | } |
---|
190 | |
---|
191 | my %skip; |
---|
192 | my %export; |
---|
193 | |
---|
194 | sub skip_symbols { |
---|
195 | my $list = shift; |
---|
196 | foreach my $symbol (@$list) { |
---|
197 | $skip{$symbol} = 1; |
---|
198 | } |
---|
199 | } |
---|
200 | |
---|
201 | sub emit_symbols { |
---|
202 | my $list = shift; |
---|
203 | foreach my $symbol (@$list) { |
---|
204 | my $skipsym = $symbol; |
---|
205 | # XXX hack |
---|
206 | if ($define{MULTIPLICITY}) { |
---|
207 | $skipsym =~ s/^Perl_[GIT](\w+)_ptr$/PL_$1/; |
---|
208 | } |
---|
209 | emit_symbol($symbol) unless exists $skip{$skipsym}; |
---|
210 | } |
---|
211 | } |
---|
212 | |
---|
213 | if ($PLATFORM eq 'win32') { |
---|
214 | skip_symbols [qw( |
---|
215 | PL_statusvalue_vms |
---|
216 | PL_archpat_auto |
---|
217 | PL_cryptseen |
---|
218 | PL_DBcv |
---|
219 | PL_generation |
---|
220 | PL_lastgotoprobe |
---|
221 | PL_linestart |
---|
222 | PL_modcount |
---|
223 | PL_pending_ident |
---|
224 | PL_sortcxix |
---|
225 | PL_sublex_info |
---|
226 | PL_timesbuf |
---|
227 | main |
---|
228 | Perl_ErrorNo |
---|
229 | Perl_GetVars |
---|
230 | Perl_do_exec3 |
---|
231 | Perl_do_ipcctl |
---|
232 | Perl_do_ipcget |
---|
233 | Perl_do_msgrcv |
---|
234 | Perl_do_msgsnd |
---|
235 | Perl_do_semop |
---|
236 | Perl_do_shmio |
---|
237 | Perl_dump_fds |
---|
238 | Perl_init_thread_intern |
---|
239 | Perl_my_bzero |
---|
240 | Perl_my_bcopy |
---|
241 | Perl_my_htonl |
---|
242 | Perl_my_ntohl |
---|
243 | Perl_my_swap |
---|
244 | Perl_my_chsize |
---|
245 | Perl_same_dirent |
---|
246 | Perl_setenv_getix |
---|
247 | Perl_unlnk |
---|
248 | Perl_watch |
---|
249 | Perl_safexcalloc |
---|
250 | Perl_safexmalloc |
---|
251 | Perl_safexfree |
---|
252 | Perl_safexrealloc |
---|
253 | Perl_my_memcmp |
---|
254 | Perl_my_memset |
---|
255 | PL_cshlen |
---|
256 | PL_cshname |
---|
257 | PL_opsave |
---|
258 | Perl_do_exec |
---|
259 | Perl_getenv_len |
---|
260 | Perl_my_pclose |
---|
261 | Perl_my_popen |
---|
262 | )]; |
---|
263 | } |
---|
264 | else { |
---|
265 | skip_symbols [qw( |
---|
266 | Perl_do_spawn |
---|
267 | Perl_do_spawn_nowait |
---|
268 | Perl_do_aspawn |
---|
269 | )]; |
---|
270 | } |
---|
271 | if ($PLATFORM eq 'wince') { |
---|
272 | skip_symbols [qw( |
---|
273 | PL_statusvalue_vms |
---|
274 | PL_archpat_auto |
---|
275 | PL_cryptseen |
---|
276 | PL_DBcv |
---|
277 | PL_generation |
---|
278 | PL_lastgotoprobe |
---|
279 | PL_linestart |
---|
280 | PL_modcount |
---|
281 | PL_pending_ident |
---|
282 | PL_sortcxix |
---|
283 | PL_sublex_info |
---|
284 | PL_timesbuf |
---|
285 | PL_collation_ix |
---|
286 | PL_collation_name |
---|
287 | PL_collation_standard |
---|
288 | PL_collxfrm_base |
---|
289 | PL_collxfrm_mult |
---|
290 | PL_numeric_compat1 |
---|
291 | PL_numeric_local |
---|
292 | PL_numeric_name |
---|
293 | PL_numeric_radix_sv |
---|
294 | PL_numeric_standard |
---|
295 | PL_vtbl_collxfrm |
---|
296 | Perl_sv_collxfrm |
---|
297 | setgid |
---|
298 | setuid |
---|
299 | win32_free_childdir |
---|
300 | win32_free_childenv |
---|
301 | win32_get_childdir |
---|
302 | win32_get_childenv |
---|
303 | win32_spawnvp |
---|
304 | main |
---|
305 | Perl_ErrorNo |
---|
306 | Perl_GetVars |
---|
307 | Perl_do_exec3 |
---|
308 | Perl_do_ipcctl |
---|
309 | Perl_do_ipcget |
---|
310 | Perl_do_msgrcv |
---|
311 | Perl_do_msgsnd |
---|
312 | Perl_do_semop |
---|
313 | Perl_do_shmio |
---|
314 | Perl_dump_fds |
---|
315 | Perl_init_thread_intern |
---|
316 | Perl_my_bzero |
---|
317 | Perl_my_bcopy |
---|
318 | Perl_my_htonl |
---|
319 | Perl_my_ntohl |
---|
320 | Perl_my_swap |
---|
321 | Perl_my_chsize |
---|
322 | Perl_same_dirent |
---|
323 | Perl_setenv_getix |
---|
324 | Perl_unlnk |
---|
325 | Perl_watch |
---|
326 | Perl_safexcalloc |
---|
327 | Perl_safexmalloc |
---|
328 | Perl_safexfree |
---|
329 | Perl_safexrealloc |
---|
330 | Perl_my_memcmp |
---|
331 | Perl_my_memset |
---|
332 | PL_cshlen |
---|
333 | PL_cshname |
---|
334 | PL_opsave |
---|
335 | Perl_do_exec |
---|
336 | Perl_getenv_len |
---|
337 | Perl_my_pclose |
---|
338 | Perl_my_popen |
---|
339 | )]; |
---|
340 | } |
---|
341 | elsif ($PLATFORM eq 'aix') { |
---|
342 | skip_symbols([qw( |
---|
343 | Perl_dump_fds |
---|
344 | Perl_ErrorNo |
---|
345 | Perl_GetVars |
---|
346 | Perl_my_bcopy |
---|
347 | Perl_my_bzero |
---|
348 | Perl_my_chsize |
---|
349 | Perl_my_htonl |
---|
350 | Perl_my_memcmp |
---|
351 | Perl_my_memset |
---|
352 | Perl_my_ntohl |
---|
353 | Perl_my_swap |
---|
354 | Perl_safexcalloc |
---|
355 | Perl_safexfree |
---|
356 | Perl_safexmalloc |
---|
357 | Perl_safexrealloc |
---|
358 | Perl_same_dirent |
---|
359 | Perl_unlnk |
---|
360 | Perl_sys_intern_clear |
---|
361 | Perl_sys_intern_dup |
---|
362 | Perl_sys_intern_init |
---|
363 | PL_cryptseen |
---|
364 | PL_opsave |
---|
365 | PL_statusvalue_vms |
---|
366 | PL_sys_intern |
---|
367 | )]); |
---|
368 | } |
---|
369 | elsif ($PLATFORM eq 'os2') { |
---|
370 | emit_symbols([qw( |
---|
371 | ctermid |
---|
372 | get_sysinfo |
---|
373 | Perl_OS2_init |
---|
374 | Perl_OS2_init3 |
---|
375 | Perl_OS2_term |
---|
376 | OS2_Perl_data |
---|
377 | dlopen |
---|
378 | dlsym |
---|
379 | dlerror |
---|
380 | dlclose |
---|
381 | dup2 |
---|
382 | dup |
---|
383 | my_tmpfile |
---|
384 | my_tmpnam |
---|
385 | my_flock |
---|
386 | my_rmdir |
---|
387 | my_mkdir |
---|
388 | my_getpwuid |
---|
389 | my_getpwnam |
---|
390 | my_getpwent |
---|
391 | my_setpwent |
---|
392 | my_endpwent |
---|
393 | fork_with_resources |
---|
394 | croak_with_os2error |
---|
395 | setgrent |
---|
396 | endgrent |
---|
397 | getgrent |
---|
398 | malloc_mutex |
---|
399 | threads_mutex |
---|
400 | nthreads |
---|
401 | nthreads_cond |
---|
402 | os2_cond_wait |
---|
403 | os2_stat |
---|
404 | os2_execname |
---|
405 | async_mssleep |
---|
406 | msCounter |
---|
407 | InfoTable |
---|
408 | pthread_join |
---|
409 | pthread_create |
---|
410 | pthread_detach |
---|
411 | XS_Cwd_change_drive |
---|
412 | XS_Cwd_current_drive |
---|
413 | XS_Cwd_extLibpath |
---|
414 | XS_Cwd_extLibpath_set |
---|
415 | XS_Cwd_sys_abspath |
---|
416 | XS_Cwd_sys_chdir |
---|
417 | XS_Cwd_sys_cwd |
---|
418 | XS_Cwd_sys_is_absolute |
---|
419 | XS_Cwd_sys_is_relative |
---|
420 | XS_Cwd_sys_is_rooted |
---|
421 | XS_DynaLoader_mod2fname |
---|
422 | XS_File__Copy_syscopy |
---|
423 | Perl_Register_MQ |
---|
424 | Perl_Deregister_MQ |
---|
425 | Perl_Serve_Messages |
---|
426 | Perl_Process_Messages |
---|
427 | init_PMWIN_entries |
---|
428 | PMWIN_entries |
---|
429 | Perl_hab_GET |
---|
430 | loadByOrdinal |
---|
431 | pExtFCN |
---|
432 | os2error |
---|
433 | ResetWinError |
---|
434 | CroakWinError |
---|
435 | PL_do_undump |
---|
436 | )]); |
---|
437 | emit_symbols([qw(os2_cond_wait |
---|
438 | pthread_join |
---|
439 | pthread_create |
---|
440 | pthread_detach |
---|
441 | )]) |
---|
442 | if $define{'USE_5005THREADS'} or $define{'USE_ITHREADS'}; |
---|
443 | } |
---|
444 | elsif ($PLATFORM eq 'MacOS') { |
---|
445 | skip_symbols [qw( |
---|
446 | Perl_GetVars |
---|
447 | PL_cryptseen |
---|
448 | PL_cshlen |
---|
449 | PL_cshname |
---|
450 | PL_statusvalue_vms |
---|
451 | PL_sys_intern |
---|
452 | PL_opsave |
---|
453 | PL_timesbuf |
---|
454 | Perl_dump_fds |
---|
455 | Perl_my_bcopy |
---|
456 | Perl_my_bzero |
---|
457 | Perl_my_chsize |
---|
458 | Perl_my_htonl |
---|
459 | Perl_my_memcmp |
---|
460 | Perl_my_memset |
---|
461 | Perl_my_ntohl |
---|
462 | Perl_my_swap |
---|
463 | Perl_safexcalloc |
---|
464 | Perl_safexfree |
---|
465 | Perl_safexmalloc |
---|
466 | Perl_safexrealloc |
---|
467 | Perl_unlnk |
---|
468 | Perl_sys_intern_clear |
---|
469 | Perl_sys_intern_init |
---|
470 | )]; |
---|
471 | } |
---|
472 | elsif ($PLATFORM eq 'netware') { |
---|
473 | skip_symbols [qw( |
---|
474 | PL_statusvalue_vms |
---|
475 | PL_archpat_auto |
---|
476 | PL_cryptseen |
---|
477 | PL_DBcv |
---|
478 | PL_generation |
---|
479 | PL_lastgotoprobe |
---|
480 | PL_linestart |
---|
481 | PL_modcount |
---|
482 | PL_pending_ident |
---|
483 | PL_sortcxix |
---|
484 | PL_sublex_info |
---|
485 | PL_timesbuf |
---|
486 | main |
---|
487 | Perl_ErrorNo |
---|
488 | Perl_GetVars |
---|
489 | Perl_do_exec3 |
---|
490 | Perl_do_ipcctl |
---|
491 | Perl_do_ipcget |
---|
492 | Perl_do_msgrcv |
---|
493 | Perl_do_msgsnd |
---|
494 | Perl_do_semop |
---|
495 | Perl_do_shmio |
---|
496 | Perl_dump_fds |
---|
497 | Perl_init_thread_intern |
---|
498 | Perl_my_bzero |
---|
499 | Perl_my_htonl |
---|
500 | Perl_my_ntohl |
---|
501 | Perl_my_swap |
---|
502 | Perl_my_chsize |
---|
503 | Perl_same_dirent |
---|
504 | Perl_setenv_getix |
---|
505 | Perl_unlnk |
---|
506 | Perl_watch |
---|
507 | Perl_safexcalloc |
---|
508 | Perl_safexmalloc |
---|
509 | Perl_safexfree |
---|
510 | Perl_safexrealloc |
---|
511 | Perl_my_memcmp |
---|
512 | Perl_my_memset |
---|
513 | PL_cshlen |
---|
514 | PL_cshname |
---|
515 | PL_opsave |
---|
516 | Perl_do_exec |
---|
517 | Perl_getenv_len |
---|
518 | Perl_my_pclose |
---|
519 | Perl_my_popen |
---|
520 | Perl_sys_intern_init |
---|
521 | Perl_sys_intern_dup |
---|
522 | Perl_sys_intern_clear |
---|
523 | Perl_my_bcopy |
---|
524 | Perl_PerlIO_write |
---|
525 | Perl_PerlIO_unread |
---|
526 | Perl_PerlIO_tell |
---|
527 | Perl_PerlIO_stdout |
---|
528 | Perl_PerlIO_stdin |
---|
529 | Perl_PerlIO_stderr |
---|
530 | Perl_PerlIO_setlinebuf |
---|
531 | Perl_PerlIO_set_ptrcnt |
---|
532 | Perl_PerlIO_set_cnt |
---|
533 | Perl_PerlIO_seek |
---|
534 | Perl_PerlIO_read |
---|
535 | Perl_PerlIO_get_ptr |
---|
536 | Perl_PerlIO_get_cnt |
---|
537 | Perl_PerlIO_get_bufsiz |
---|
538 | Perl_PerlIO_get_base |
---|
539 | Perl_PerlIO_flush |
---|
540 | Perl_PerlIO_fill |
---|
541 | Perl_PerlIO_fileno |
---|
542 | Perl_PerlIO_error |
---|
543 | Perl_PerlIO_eof |
---|
544 | Perl_PerlIO_close |
---|
545 | Perl_PerlIO_clearerr |
---|
546 | PerlIO_perlio |
---|
547 | )]; |
---|
548 | } |
---|
549 | |
---|
550 | unless ($define{'DEBUGGING'}) { |
---|
551 | skip_symbols [qw( |
---|
552 | Perl_deb_growlevel |
---|
553 | Perl_debop |
---|
554 | Perl_debprofdump |
---|
555 | Perl_debstack |
---|
556 | Perl_debstackptrs |
---|
557 | Perl_sv_peek |
---|
558 | PL_block_type |
---|
559 | PL_watchaddr |
---|
560 | PL_watchok |
---|
561 | )]; |
---|
562 | } |
---|
563 | |
---|
564 | if ($define{'PERL_IMPLICIT_SYS'}) { |
---|
565 | skip_symbols [qw( |
---|
566 | Perl_getenv_len |
---|
567 | Perl_my_popen |
---|
568 | Perl_my_pclose |
---|
569 | )]; |
---|
570 | } |
---|
571 | else { |
---|
572 | skip_symbols [qw( |
---|
573 | PL_Mem |
---|
574 | PL_MemShared |
---|
575 | PL_MemParse |
---|
576 | PL_Env |
---|
577 | PL_StdIO |
---|
578 | PL_LIO |
---|
579 | PL_Dir |
---|
580 | PL_Sock |
---|
581 | PL_Proc |
---|
582 | )]; |
---|
583 | } |
---|
584 | |
---|
585 | unless ($define{'PERL_FLEXIBLE_EXCEPTIONS'}) { |
---|
586 | skip_symbols [qw( |
---|
587 | PL_protect |
---|
588 | Perl_default_protect |
---|
589 | Perl_vdefault_protect |
---|
590 | )]; |
---|
591 | } |
---|
592 | |
---|
593 | unless ($define{'USE_REENTRANT_API'}) { |
---|
594 | skip_symbols [qw( |
---|
595 | PL_reentrant_buffer |
---|
596 | )]; |
---|
597 | } |
---|
598 | |
---|
599 | if ($define{'MYMALLOC'}) { |
---|
600 | emit_symbols [qw( |
---|
601 | Perl_dump_mstats |
---|
602 | Perl_get_mstats |
---|
603 | Perl_strdup |
---|
604 | Perl_putenv |
---|
605 | MallocCfg_ptr |
---|
606 | MallocCfgP_ptr |
---|
607 | )]; |
---|
608 | if ($define{'USE_5005THREADS'} || $define{'USE_ITHREADS'}) { |
---|
609 | emit_symbols [qw( |
---|
610 | PL_malloc_mutex |
---|
611 | )]; |
---|
612 | } |
---|
613 | else { |
---|
614 | skip_symbols [qw( |
---|
615 | PL_malloc_mutex |
---|
616 | )]; |
---|
617 | } |
---|
618 | } |
---|
619 | else { |
---|
620 | skip_symbols [qw( |
---|
621 | PL_malloc_mutex |
---|
622 | Perl_dump_mstats |
---|
623 | Perl_get_mstats |
---|
624 | Perl_malloced_size |
---|
625 | MallocCfg_ptr |
---|
626 | MallocCfgP_ptr |
---|
627 | )]; |
---|
628 | } |
---|
629 | |
---|
630 | unless ($define{'USE_5005THREADS'} || $define{'USE_ITHREADS'}) { |
---|
631 | skip_symbols [qw( |
---|
632 | PL_thr_key |
---|
633 | )]; |
---|
634 | } |
---|
635 | |
---|
636 | unless ($define{'USE_5005THREADS'}) { |
---|
637 | skip_symbols [qw( |
---|
638 | PL_sv_mutex |
---|
639 | PL_strtab_mutex |
---|
640 | PL_svref_mutex |
---|
641 | PL_cred_mutex |
---|
642 | PL_eval_mutex |
---|
643 | PL_fdpid_mutex |
---|
644 | PL_sv_lock_mutex |
---|
645 | PL_eval_cond |
---|
646 | PL_eval_owner |
---|
647 | PL_threads_mutex |
---|
648 | PL_nthreads |
---|
649 | PL_nthreads_cond |
---|
650 | PL_threadnum |
---|
651 | PL_threadsv_names |
---|
652 | PL_thrsv |
---|
653 | PL_vtbl_mutex |
---|
654 | Perl_condpair_magic |
---|
655 | Perl_new_struct_thread |
---|
656 | Perl_per_thread_magicals |
---|
657 | Perl_thread_create |
---|
658 | Perl_find_threadsv |
---|
659 | Perl_unlock_condpair |
---|
660 | Perl_magic_mutexfree |
---|
661 | Perl_sv_lock |
---|
662 | )]; |
---|
663 | } |
---|
664 | |
---|
665 | unless ($define{'USE_ITHREADS'}) { |
---|
666 | skip_symbols [qw( |
---|
667 | PL_ptr_table |
---|
668 | PL_op_mutex |
---|
669 | PL_regex_pad |
---|
670 | PL_regex_padav |
---|
671 | PL_sharedsv_space |
---|
672 | PL_sharedsv_space_mutex |
---|
673 | PL_dollarzero_mutex |
---|
674 | Perl_dirp_dup |
---|
675 | Perl_cx_dup |
---|
676 | Perl_si_dup |
---|
677 | Perl_any_dup |
---|
678 | Perl_ss_dup |
---|
679 | Perl_fp_dup |
---|
680 | Perl_gp_dup |
---|
681 | Perl_he_dup |
---|
682 | Perl_mg_dup |
---|
683 | Perl_re_dup |
---|
684 | Perl_sv_dup |
---|
685 | Perl_sys_intern_dup |
---|
686 | Perl_ptr_table_clear |
---|
687 | Perl_ptr_table_fetch |
---|
688 | Perl_ptr_table_free |
---|
689 | Perl_ptr_table_new |
---|
690 | Perl_ptr_table_clear |
---|
691 | Perl_ptr_table_free |
---|
692 | Perl_ptr_table_split |
---|
693 | Perl_ptr_table_store |
---|
694 | perl_clone |
---|
695 | perl_clone_using |
---|
696 | Perl_sharedsv_find |
---|
697 | Perl_sharedsv_init |
---|
698 | Perl_sharedsv_lock |
---|
699 | Perl_sharedsv_new |
---|
700 | Perl_sharedsv_thrcnt_dec |
---|
701 | Perl_sharedsv_thrcnt_inc |
---|
702 | Perl_sharedsv_unlock |
---|
703 | )]; |
---|
704 | } |
---|
705 | |
---|
706 | unless ($define{'PERL_IMPLICIT_CONTEXT'}) { |
---|
707 | skip_symbols [qw( |
---|
708 | Perl_croak_nocontext |
---|
709 | Perl_die_nocontext |
---|
710 | Perl_deb_nocontext |
---|
711 | Perl_form_nocontext |
---|
712 | Perl_load_module_nocontext |
---|
713 | Perl_mess_nocontext |
---|
714 | Perl_warn_nocontext |
---|
715 | Perl_warner_nocontext |
---|
716 | Perl_newSVpvf_nocontext |
---|
717 | Perl_sv_catpvf_nocontext |
---|
718 | Perl_sv_setpvf_nocontext |
---|
719 | Perl_sv_catpvf_mg_nocontext |
---|
720 | Perl_sv_setpvf_mg_nocontext |
---|
721 | )]; |
---|
722 | } |
---|
723 | |
---|
724 | unless ($define{'PERL_IMPLICIT_SYS'}) { |
---|
725 | skip_symbols [qw( |
---|
726 | perl_alloc_using |
---|
727 | perl_clone_using |
---|
728 | )]; |
---|
729 | } |
---|
730 | |
---|
731 | unless ($define{'FAKE_THREADS'}) { |
---|
732 | skip_symbols [qw(PL_curthr)]; |
---|
733 | } |
---|
734 | |
---|
735 | unless ($define{'PL_OP_SLAB_ALLOC'}) { |
---|
736 | skip_symbols [qw( |
---|
737 | PL_OpPtr |
---|
738 | PL_OpSlab |
---|
739 | PL_OpSpace |
---|
740 | Perl_Slab_Alloc |
---|
741 | Perl_Slab_Free |
---|
742 | )]; |
---|
743 | } |
---|
744 | |
---|
745 | unless ($define{'THREADS_HAVE_PIDS'}) { |
---|
746 | skip_symbols [qw(PL_ppid)]; |
---|
747 | } |
---|
748 | |
---|
749 | sub readvar { |
---|
750 | my $file = shift; |
---|
751 | my $proc = shift || sub { "PL_$_[2]" }; |
---|
752 | open(VARS,$file) || die "Cannot open $file: $!\n"; |
---|
753 | my @syms; |
---|
754 | while (<VARS>) { |
---|
755 | # All symbols have a Perl_ prefix because that's what embed.h |
---|
756 | # sticks in front of them. |
---|
757 | push(@syms, &$proc($1,$2,$3)) if (/\bPERLVAR(A?I?C?)\(([IGT])(\w+)/); |
---|
758 | } |
---|
759 | close(VARS); |
---|
760 | return \@syms; |
---|
761 | } |
---|
762 | |
---|
763 | if ($define{'USE_5005THREADS'}) { |
---|
764 | my $thrd = readvar($thrdvar_h); |
---|
765 | skip_symbols $thrd; |
---|
766 | } |
---|
767 | |
---|
768 | if ($define{'PERL_GLOBAL_STRUCT'}) { |
---|
769 | my $global = readvar($perlvars_h); |
---|
770 | skip_symbols $global; |
---|
771 | emit_symbol('Perl_GetVars'); |
---|
772 | emit_symbols [qw(PL_Vars PL_VarsPtr)] unless $CCTYPE eq 'GCC'; |
---|
773 | } |
---|
774 | |
---|
775 | # functions from *.sym files |
---|
776 | |
---|
777 | my @syms = ($global_sym, $globvar_sym); # $pp_sym is not part of the API |
---|
778 | |
---|
779 | # Symbols that are the public face of the PerlIO layers implementation |
---|
780 | # These are in _addition to_ the public face of the abstraction |
---|
781 | # and need to be exported to allow XS modules to implement layers |
---|
782 | my @layer_syms = qw( |
---|
783 | PerlIOBase_binmode |
---|
784 | PerlIOBase_clearerr |
---|
785 | PerlIOBase_close |
---|
786 | PerlIOBase_dup |
---|
787 | PerlIOBase_eof |
---|
788 | PerlIOBase_error |
---|
789 | PerlIOBase_fileno |
---|
790 | PerlIOBase_noop_fail |
---|
791 | PerlIOBase_noop_ok |
---|
792 | PerlIOBase_popped |
---|
793 | PerlIOBase_pushed |
---|
794 | PerlIOBase_read |
---|
795 | PerlIOBase_setlinebuf |
---|
796 | PerlIOBase_unread |
---|
797 | PerlIOBuf_bufsiz |
---|
798 | PerlIOBuf_close |
---|
799 | PerlIOBuf_dup |
---|
800 | PerlIOBuf_fill |
---|
801 | PerlIOBuf_flush |
---|
802 | PerlIOBuf_get_base |
---|
803 | PerlIOBuf_get_cnt |
---|
804 | PerlIOBuf_get_ptr |
---|
805 | PerlIOBuf_open |
---|
806 | PerlIOBuf_popped |
---|
807 | PerlIOBuf_pushed |
---|
808 | PerlIOBuf_read |
---|
809 | PerlIOBuf_seek |
---|
810 | PerlIOBuf_set_ptrcnt |
---|
811 | PerlIOBuf_tell |
---|
812 | PerlIOBuf_unread |
---|
813 | PerlIOBuf_write |
---|
814 | PerlIO_allocate |
---|
815 | PerlIO_apply_layera |
---|
816 | PerlIO_apply_layers |
---|
817 | PerlIO_arg_fetch |
---|
818 | PerlIO_debug |
---|
819 | PerlIO_define_layer |
---|
820 | PerlIO_isutf8 |
---|
821 | PerlIO_layer_fetch |
---|
822 | PerlIO_list_free |
---|
823 | PerlIO_modestr |
---|
824 | PerlIO_parse_layers |
---|
825 | PerlIO_pending |
---|
826 | PerlIO_perlio |
---|
827 | PerlIO_pop |
---|
828 | PerlIO_push |
---|
829 | PerlIO_sv_dup |
---|
830 | Perl_PerlIO_clearerr |
---|
831 | Perl_PerlIO_close |
---|
832 | Perl_PerlIO_eof |
---|
833 | Perl_PerlIO_error |
---|
834 | Perl_PerlIO_fileno |
---|
835 | Perl_PerlIO_fill |
---|
836 | Perl_PerlIO_flush |
---|
837 | Perl_PerlIO_get_base |
---|
838 | Perl_PerlIO_get_bufsiz |
---|
839 | Perl_PerlIO_get_cnt |
---|
840 | Perl_PerlIO_get_ptr |
---|
841 | Perl_PerlIO_read |
---|
842 | Perl_PerlIO_seek |
---|
843 | Perl_PerlIO_set_cnt |
---|
844 | Perl_PerlIO_set_ptrcnt |
---|
845 | Perl_PerlIO_setlinebuf |
---|
846 | Perl_PerlIO_stderr |
---|
847 | Perl_PerlIO_stdin |
---|
848 | Perl_PerlIO_stdout |
---|
849 | Perl_PerlIO_tell |
---|
850 | Perl_PerlIO_unread |
---|
851 | Perl_PerlIO_write |
---|
852 | ); |
---|
853 | if ($PLATFORM eq 'netware') { |
---|
854 | push(@layer_syms,'PL_def_layerlist','PL_known_layers','PL_perlio'); |
---|
855 | } |
---|
856 | |
---|
857 | if ($define{'USE_PERLIO'}) { |
---|
858 | # Export the symols that make up the PerlIO abstraction, regardless |
---|
859 | # of its implementation - read from a file |
---|
860 | push @syms, $perlio_sym; |
---|
861 | |
---|
862 | # This part is then dependent on how the abstraction is implemented |
---|
863 | if ($define{'USE_SFIO'}) { |
---|
864 | # Old legacy non-stdio "PerlIO" |
---|
865 | skip_symbols \@layer_syms; |
---|
866 | # SFIO defines most of the PerlIO routines as macros |
---|
867 | # So undo most of what $perlio_sym has just done - d'oh ! |
---|
868 | # Perhaps it would be better to list the ones which do exist |
---|
869 | # And emit them |
---|
870 | skip_symbols [qw( |
---|
871 | PerlIO_canset_cnt |
---|
872 | PerlIO_clearerr |
---|
873 | PerlIO_close |
---|
874 | PerlIO_eof |
---|
875 | PerlIO_error |
---|
876 | PerlIO_exportFILE |
---|
877 | PerlIO_fast_gets |
---|
878 | PerlIO_fdopen |
---|
879 | PerlIO_fileno |
---|
880 | PerlIO_findFILE |
---|
881 | PerlIO_flush |
---|
882 | PerlIO_get_base |
---|
883 | PerlIO_get_bufsiz |
---|
884 | PerlIO_get_cnt |
---|
885 | PerlIO_get_ptr |
---|
886 | PerlIO_getc |
---|
887 | PerlIO_getname |
---|
888 | PerlIO_has_base |
---|
889 | PerlIO_has_cntptr |
---|
890 | PerlIO_importFILE |
---|
891 | PerlIO_open |
---|
892 | PerlIO_printf |
---|
893 | PerlIO_putc |
---|
894 | PerlIO_puts |
---|
895 | PerlIO_read |
---|
896 | PerlIO_releaseFILE |
---|
897 | PerlIO_reopen |
---|
898 | PerlIO_rewind |
---|
899 | PerlIO_seek |
---|
900 | PerlIO_set_cnt |
---|
901 | PerlIO_set_ptrcnt |
---|
902 | PerlIO_setlinebuf |
---|
903 | PerlIO_sprintf |
---|
904 | PerlIO_stderr |
---|
905 | PerlIO_stdin |
---|
906 | PerlIO_stdout |
---|
907 | PerlIO_stdoutf |
---|
908 | PerlIO_tell |
---|
909 | PerlIO_ungetc |
---|
910 | PerlIO_vprintf |
---|
911 | PerlIO_write |
---|
912 | PerlIO_perlio |
---|
913 | Perl_PerlIO_clearerr |
---|
914 | Perl_PerlIO_close |
---|
915 | Perl_PerlIO_eof |
---|
916 | Perl_PerlIO_error |
---|
917 | Perl_PerlIO_fileno |
---|
918 | Perl_PerlIO_fill |
---|
919 | Perl_PerlIO_flush |
---|
920 | Perl_PerlIO_get_base |
---|
921 | Perl_PerlIO_get_bufsiz |
---|
922 | Perl_PerlIO_get_cnt |
---|
923 | Perl_PerlIO_get_ptr |
---|
924 | Perl_PerlIO_read |
---|
925 | Perl_PerlIO_seek |
---|
926 | Perl_PerlIO_set_cnt |
---|
927 | Perl_PerlIO_set_ptrcnt |
---|
928 | Perl_PerlIO_setlinebuf |
---|
929 | Perl_PerlIO_stderr |
---|
930 | Perl_PerlIO_stdin |
---|
931 | Perl_PerlIO_stdout |
---|
932 | Perl_PerlIO_tell |
---|
933 | Perl_PerlIO_unread |
---|
934 | Perl_PerlIO_write |
---|
935 | PL_def_layerlist |
---|
936 | PL_known_layers |
---|
937 | PL_perlio |
---|
938 | )]; |
---|
939 | } |
---|
940 | else { |
---|
941 | # PerlIO with layers - export implementation |
---|
942 | emit_symbols \@layer_syms; |
---|
943 | } |
---|
944 | } else { |
---|
945 | # -Uuseperlio |
---|
946 | # Skip the PerlIO layer symbols - although |
---|
947 | # nothing should have exported them any way |
---|
948 | skip_symbols \@layer_syms; |
---|
949 | skip_symbols [qw(PL_def_layerlist PL_known_layers PL_perlio)]; |
---|
950 | |
---|
951 | # Also do NOT add abstraction symbols from $perlio_sym |
---|
952 | # abstraction is done as #define to stdio |
---|
953 | # Remaining remnants that _may_ be functions |
---|
954 | # are handled in <DATA> |
---|
955 | } |
---|
956 | |
---|
957 | for my $syms (@syms) { |
---|
958 | open (GLOBAL, "<$syms") || die "failed to open $syms: $!\n"; |
---|
959 | while (<GLOBAL>) { |
---|
960 | next if (!/^[A-Za-z]/); |
---|
961 | # Functions have a Perl_ prefix |
---|
962 | # Variables have a PL_ prefix |
---|
963 | chomp($_); |
---|
964 | my $symbol = ($syms =~ /var\.sym$/i ? "PL_" : ""); |
---|
965 | $symbol .= $_; |
---|
966 | emit_symbol($symbol) unless exists $skip{$symbol}; |
---|
967 | } |
---|
968 | close(GLOBAL); |
---|
969 | } |
---|
970 | |
---|
971 | # variables |
---|
972 | |
---|
973 | if ($define{'MULTIPLICITY'}) { |
---|
974 | for my $f ($perlvars_h, $intrpvar_h, $thrdvar_h) { |
---|
975 | my $glob = readvar($f, sub { "Perl_" . $_[1] . $_[2] . "_ptr" }); |
---|
976 | emit_symbols $glob; |
---|
977 | } |
---|
978 | # XXX AIX seems to want the perlvars.h symbols, for some reason |
---|
979 | if ($PLATFORM eq 'aix' or $PLATFORM eq 'os2') { # OS/2 needs PL_thr_key |
---|
980 | my $glob = readvar($perlvars_h); |
---|
981 | emit_symbols $glob; |
---|
982 | } |
---|
983 | } |
---|
984 | else { |
---|
985 | unless ($define{'PERL_GLOBAL_STRUCT'}) { |
---|
986 | my $glob = readvar($perlvars_h); |
---|
987 | emit_symbols $glob; |
---|
988 | } |
---|
989 | unless ($define{'MULTIPLICITY'}) { |
---|
990 | my $glob = readvar($intrpvar_h); |
---|
991 | emit_symbols $glob; |
---|
992 | } |
---|
993 | unless ($define{'MULTIPLICITY'} || $define{'USE_5005THREADS'}) { |
---|
994 | my $glob = readvar($thrdvar_h); |
---|
995 | emit_symbols $glob; |
---|
996 | } |
---|
997 | } |
---|
998 | |
---|
999 | sub try_symbol { |
---|
1000 | my $symbol = shift; |
---|
1001 | |
---|
1002 | return if $symbol !~ /^[A-Za-z_]/; |
---|
1003 | return if $symbol =~ /^\#/; |
---|
1004 | $symbol =~s/\r//g; |
---|
1005 | chomp($symbol); |
---|
1006 | return if exists $skip{$symbol}; |
---|
1007 | emit_symbol($symbol); |
---|
1008 | } |
---|
1009 | |
---|
1010 | while (<DATA>) { |
---|
1011 | try_symbol($_); |
---|
1012 | } |
---|
1013 | |
---|
1014 | if ($PLATFORM =~ /^win(?:32|ce)$/) { |
---|
1015 | foreach my $symbol (qw( |
---|
1016 | setuid |
---|
1017 | setgid |
---|
1018 | boot_DynaLoader |
---|
1019 | Perl_init_os_extras |
---|
1020 | Perl_thread_create |
---|
1021 | Perl_win32_init |
---|
1022 | Perl_win32_term |
---|
1023 | RunPerl |
---|
1024 | win32_async_check |
---|
1025 | win32_errno |
---|
1026 | win32_environ |
---|
1027 | win32_abort |
---|
1028 | win32_fstat |
---|
1029 | win32_stat |
---|
1030 | win32_pipe |
---|
1031 | win32_popen |
---|
1032 | win32_pclose |
---|
1033 | win32_rename |
---|
1034 | win32_setmode |
---|
1035 | win32_lseek |
---|
1036 | win32_tell |
---|
1037 | win32_dup |
---|
1038 | win32_dup2 |
---|
1039 | win32_open |
---|
1040 | win32_close |
---|
1041 | win32_eof |
---|
1042 | win32_read |
---|
1043 | win32_write |
---|
1044 | win32_spawnvp |
---|
1045 | win32_mkdir |
---|
1046 | win32_rmdir |
---|
1047 | win32_chdir |
---|
1048 | win32_flock |
---|
1049 | win32_execv |
---|
1050 | win32_execvp |
---|
1051 | win32_htons |
---|
1052 | win32_ntohs |
---|
1053 | win32_htonl |
---|
1054 | win32_ntohl |
---|
1055 | win32_inet_addr |
---|
1056 | win32_inet_ntoa |
---|
1057 | win32_socket |
---|
1058 | win32_bind |
---|
1059 | win32_listen |
---|
1060 | win32_accept |
---|
1061 | win32_connect |
---|
1062 | win32_send |
---|
1063 | win32_sendto |
---|
1064 | win32_recv |
---|
1065 | win32_recvfrom |
---|
1066 | win32_shutdown |
---|
1067 | win32_closesocket |
---|
1068 | win32_ioctlsocket |
---|
1069 | win32_setsockopt |
---|
1070 | win32_getsockopt |
---|
1071 | win32_getpeername |
---|
1072 | win32_getsockname |
---|
1073 | win32_gethostname |
---|
1074 | win32_gethostbyname |
---|
1075 | win32_gethostbyaddr |
---|
1076 | win32_getprotobyname |
---|
1077 | win32_getprotobynumber |
---|
1078 | win32_getservbyname |
---|
1079 | win32_getservbyport |
---|
1080 | win32_select |
---|
1081 | win32_endhostent |
---|
1082 | win32_endnetent |
---|
1083 | win32_endprotoent |
---|
1084 | win32_endservent |
---|
1085 | win32_getnetent |
---|
1086 | win32_getnetbyname |
---|
1087 | win32_getnetbyaddr |
---|
1088 | win32_getprotoent |
---|
1089 | win32_getservent |
---|
1090 | win32_sethostent |
---|
1091 | win32_setnetent |
---|
1092 | win32_setprotoent |
---|
1093 | win32_setservent |
---|
1094 | win32_getenv |
---|
1095 | win32_putenv |
---|
1096 | win32_perror |
---|
1097 | win32_malloc |
---|
1098 | win32_calloc |
---|
1099 | win32_realloc |
---|
1100 | win32_free |
---|
1101 | win32_sleep |
---|
1102 | win32_times |
---|
1103 | win32_access |
---|
1104 | win32_alarm |
---|
1105 | win32_chmod |
---|
1106 | win32_open_osfhandle |
---|
1107 | win32_get_osfhandle |
---|
1108 | win32_ioctl |
---|
1109 | win32_link |
---|
1110 | win32_unlink |
---|
1111 | win32_utime |
---|
1112 | win32_gettimeofday |
---|
1113 | win32_uname |
---|
1114 | win32_wait |
---|
1115 | win32_waitpid |
---|
1116 | win32_kill |
---|
1117 | win32_str_os_error |
---|
1118 | win32_opendir |
---|
1119 | win32_readdir |
---|
1120 | win32_telldir |
---|
1121 | win32_seekdir |
---|
1122 | win32_rewinddir |
---|
1123 | win32_closedir |
---|
1124 | win32_longpath |
---|
1125 | win32_os_id |
---|
1126 | win32_getpid |
---|
1127 | win32_crypt |
---|
1128 | win32_dynaload |
---|
1129 | win32_get_childenv |
---|
1130 | win32_free_childenv |
---|
1131 | win32_clearenv |
---|
1132 | win32_get_childdir |
---|
1133 | win32_free_childdir |
---|
1134 | win32_stdin |
---|
1135 | win32_stdout |
---|
1136 | win32_stderr |
---|
1137 | win32_ferror |
---|
1138 | win32_feof |
---|
1139 | win32_strerror |
---|
1140 | win32_fprintf |
---|
1141 | win32_printf |
---|
1142 | win32_vfprintf |
---|
1143 | win32_vprintf |
---|
1144 | win32_fread |
---|
1145 | win32_fwrite |
---|
1146 | win32_fopen |
---|
1147 | win32_fdopen |
---|
1148 | win32_freopen |
---|
1149 | win32_fclose |
---|
1150 | win32_fputs |
---|
1151 | win32_fputc |
---|
1152 | win32_ungetc |
---|
1153 | win32_getc |
---|
1154 | win32_fileno |
---|
1155 | win32_clearerr |
---|
1156 | win32_fflush |
---|
1157 | win32_ftell |
---|
1158 | win32_fseek |
---|
1159 | win32_fgetpos |
---|
1160 | win32_fsetpos |
---|
1161 | win32_rewind |
---|
1162 | win32_tmpfile |
---|
1163 | win32_setbuf |
---|
1164 | win32_setvbuf |
---|
1165 | win32_flushall |
---|
1166 | win32_fcloseall |
---|
1167 | win32_fgets |
---|
1168 | win32_gets |
---|
1169 | win32_fgetc |
---|
1170 | win32_putc |
---|
1171 | win32_puts |
---|
1172 | win32_getchar |
---|
1173 | win32_putchar |
---|
1174 | )) |
---|
1175 | { |
---|
1176 | try_symbol($symbol); |
---|
1177 | } |
---|
1178 | } |
---|
1179 | elsif ($PLATFORM eq 'os2') { |
---|
1180 | open MAP, 'miniperl.map' or die 'Cannot read miniperl.map'; |
---|
1181 | /^\s*[\da-f:]+\s+(\w+)/i and $mapped{$1}++ foreach <MAP>; |
---|
1182 | close MAP or die 'Cannot close miniperl.map'; |
---|
1183 | |
---|
1184 | @missing = grep { !exists $mapped{$_} } |
---|
1185 | keys %export; |
---|
1186 | @missing = grep { !exists $exportperlmalloc{$_} } @missing; |
---|
1187 | delete $export{$_} foreach @missing; |
---|
1188 | } |
---|
1189 | elsif ($PLATFORM eq 'MacOS') { |
---|
1190 | open MACSYMS, 'macperl.sym' or die 'Cannot read macperl.sym'; |
---|
1191 | |
---|
1192 | while (<MACSYMS>) { |
---|
1193 | try_symbol($_); |
---|
1194 | } |
---|
1195 | |
---|
1196 | close MACSYMS; |
---|
1197 | } |
---|
1198 | elsif ($PLATFORM eq 'netware') { |
---|
1199 | foreach my $symbol (qw( |
---|
1200 | boot_DynaLoader |
---|
1201 | Perl_init_os_extras |
---|
1202 | Perl_thread_create |
---|
1203 | Perl_nw5_init |
---|
1204 | RunPerl |
---|
1205 | AllocStdPerl |
---|
1206 | FreeStdPerl |
---|
1207 | do_spawn2 |
---|
1208 | do_aspawn |
---|
1209 | nw_uname |
---|
1210 | nw_stdin |
---|
1211 | nw_stdout |
---|
1212 | nw_stderr |
---|
1213 | nw_feof |
---|
1214 | nw_ferror |
---|
1215 | nw_fopen |
---|
1216 | nw_fclose |
---|
1217 | nw_clearerr |
---|
1218 | nw_getc |
---|
1219 | nw_fgets |
---|
1220 | nw_fputc |
---|
1221 | nw_fputs |
---|
1222 | nw_fflush |
---|
1223 | nw_ungetc |
---|
1224 | nw_fileno |
---|
1225 | nw_fdopen |
---|
1226 | nw_freopen |
---|
1227 | nw_fread |
---|
1228 | nw_fwrite |
---|
1229 | nw_setbuf |
---|
1230 | nw_setvbuf |
---|
1231 | nw_vfprintf |
---|
1232 | nw_ftell |
---|
1233 | nw_fseek |
---|
1234 | nw_rewind |
---|
1235 | nw_tmpfile |
---|
1236 | nw_fgetpos |
---|
1237 | nw_fsetpos |
---|
1238 | nw_dup |
---|
1239 | nw_access |
---|
1240 | nw_chmod |
---|
1241 | nw_chsize |
---|
1242 | nw_close |
---|
1243 | nw_dup2 |
---|
1244 | nw_flock |
---|
1245 | nw_isatty |
---|
1246 | nw_link |
---|
1247 | nw_lseek |
---|
1248 | nw_stat |
---|
1249 | nw_mktemp |
---|
1250 | nw_open |
---|
1251 | nw_read |
---|
1252 | nw_rename |
---|
1253 | nw_setmode |
---|
1254 | nw_unlink |
---|
1255 | nw_utime |
---|
1256 | nw_write |
---|
1257 | nw_chdir |
---|
1258 | nw_rmdir |
---|
1259 | nw_closedir |
---|
1260 | nw_opendir |
---|
1261 | nw_readdir |
---|
1262 | nw_rewinddir |
---|
1263 | nw_seekdir |
---|
1264 | nw_telldir |
---|
1265 | nw_htonl |
---|
1266 | nw_htons |
---|
1267 | nw_ntohl |
---|
1268 | nw_ntohs |
---|
1269 | nw_accept |
---|
1270 | nw_bind |
---|
1271 | nw_connect |
---|
1272 | nw_endhostent |
---|
1273 | nw_endnetent |
---|
1274 | nw_endprotoent |
---|
1275 | nw_endservent |
---|
1276 | nw_gethostbyaddr |
---|
1277 | nw_gethostbyname |
---|
1278 | nw_gethostent |
---|
1279 | nw_gethostname |
---|
1280 | nw_getnetbyaddr |
---|
1281 | nw_getnetbyname |
---|
1282 | nw_getnetent |
---|
1283 | nw_getpeername |
---|
1284 | nw_getprotobyname |
---|
1285 | nw_getprotobynumber |
---|
1286 | nw_getprotoent |
---|
1287 | nw_getservbyname |
---|
1288 | nw_getservbyport |
---|
1289 | nw_getservent |
---|
1290 | nw_getsockname |
---|
1291 | nw_getsockopt |
---|
1292 | nw_inet_addr |
---|
1293 | nw_listen |
---|
1294 | nw_socket |
---|
1295 | nw_recv |
---|
1296 | nw_recvfrom |
---|
1297 | nw_select |
---|
1298 | nw_send |
---|
1299 | nw_sendto |
---|
1300 | nw_sethostent |
---|
1301 | nw_setnetent |
---|
1302 | nw_setprotoent |
---|
1303 | nw_setservent |
---|
1304 | nw_setsockopt |
---|
1305 | nw_inet_ntoa |
---|
1306 | nw_shutdown |
---|
1307 | nw_crypt |
---|
1308 | nw_execvp |
---|
1309 | nw_kill |
---|
1310 | nw_Popen |
---|
1311 | nw_Pclose |
---|
1312 | nw_Pipe |
---|
1313 | nw_times |
---|
1314 | nw_waitpid |
---|
1315 | nw_getpid |
---|
1316 | nw_spawnvp |
---|
1317 | nw_os_id |
---|
1318 | nw_open_osfhandle |
---|
1319 | nw_get_osfhandle |
---|
1320 | nw_abort |
---|
1321 | nw_sleep |
---|
1322 | nw_wait |
---|
1323 | nw_dynaload |
---|
1324 | nw_strerror |
---|
1325 | fnFpSetMode |
---|
1326 | fnInsertHashListAddrs |
---|
1327 | fnGetHashListAddrs |
---|
1328 | Perl_deb |
---|
1329 | Perl_sv_setsv |
---|
1330 | Perl_sv_catsv |
---|
1331 | Perl_sv_catpvn |
---|
1332 | Perl_sv_2pv |
---|
1333 | nw_freeenviron |
---|
1334 | Remove_Thread_Ctx |
---|
1335 | )) |
---|
1336 | { |
---|
1337 | try_symbol($symbol); |
---|
1338 | } |
---|
1339 | } |
---|
1340 | |
---|
1341 | # Now all symbols should be defined because |
---|
1342 | # next we are going to output them. |
---|
1343 | |
---|
1344 | foreach my $symbol (sort keys %export) { |
---|
1345 | output_symbol($symbol); |
---|
1346 | } |
---|
1347 | |
---|
1348 | if ($PLATFORM eq 'os2') { |
---|
1349 | print <<EOP; |
---|
1350 | dll_perlmain=main |
---|
1351 | fill_extLibpath |
---|
1352 | dir_subst |
---|
1353 | Perl_OS2_handler_install |
---|
1354 | |
---|
1355 | ; LAST_ORDINAL=$sym_ord |
---|
1356 | EOP |
---|
1357 | } |
---|
1358 | |
---|
1359 | sub emit_symbol { |
---|
1360 | my $symbol = shift; |
---|
1361 | chomp($symbol); |
---|
1362 | $export{$symbol} = 1; |
---|
1363 | } |
---|
1364 | |
---|
1365 | sub output_symbol { |
---|
1366 | my $symbol = shift; |
---|
1367 | if ($PLATFORM =~ /^win(?:32|ce)$/) { |
---|
1368 | $symbol = "_$symbol" if $CCTYPE eq 'BORLAND'; |
---|
1369 | print "\t$symbol\n"; |
---|
1370 | # XXX: binary compatibility between compilers is an exercise |
---|
1371 | # in frustration :-( |
---|
1372 | # if ($CCTYPE eq "BORLAND") { |
---|
1373 | # # workaround Borland quirk by exporting both the straight |
---|
1374 | # # name and a name with leading underscore. Note the |
---|
1375 | # # alias *must* come after the symbol itself, if both |
---|
1376 | # # are to be exported. (Linker bug?) |
---|
1377 | # print "\t_$symbol\n"; |
---|
1378 | # print "\t$symbol = _$symbol\n"; |
---|
1379 | # } |
---|
1380 | # elsif ($CCTYPE eq 'GCC') { |
---|
1381 | # # Symbols have leading _ whole process is $%@"% slow |
---|
1382 | # # so skip aliases for now |
---|
1383 | # nprint "\t$symbol\n"; |
---|
1384 | # } |
---|
1385 | # else { |
---|
1386 | # # for binary coexistence, export both the symbol and |
---|
1387 | # # alias with leading underscore |
---|
1388 | # print "\t$symbol\n"; |
---|
1389 | # print "\t_$symbol = $symbol\n"; |
---|
1390 | # } |
---|
1391 | } |
---|
1392 | elsif ($PLATFORM eq 'os2') { |
---|
1393 | printf qq( %-31s \@%s\n), |
---|
1394 | qq("$symbol"), $ordinal{$symbol} || ++$sym_ord; |
---|
1395 | printf qq( %-31s \@%s\n), |
---|
1396 | qq("$exportperlmalloc{$symbol}" = "$symbol"), |
---|
1397 | $ordinal{$exportperlmalloc{$symbol}} || ++$sym_ord |
---|
1398 | if $exportperlmalloc and exists $exportperlmalloc{$symbol}; |
---|
1399 | } |
---|
1400 | elsif ($PLATFORM eq 'aix' || $PLATFORM eq 'MacOS') { |
---|
1401 | print "$symbol\n"; |
---|
1402 | } |
---|
1403 | elsif ($PLATFORM eq 'netware') { |
---|
1404 | print "\t$symbol,\n"; |
---|
1405 | } |
---|
1406 | } |
---|
1407 | |
---|
1408 | 1; |
---|
1409 | __DATA__ |
---|
1410 | # extra globals not included above. |
---|
1411 | Perl_cxinc |
---|
1412 | perl_alloc |
---|
1413 | perl_alloc_using |
---|
1414 | perl_clone |
---|
1415 | perl_clone_using |
---|
1416 | perl_construct |
---|
1417 | perl_destruct |
---|
1418 | perl_free |
---|
1419 | perl_parse |
---|
1420 | perl_run |
---|
1421 | # Oddities from PerlIO |
---|
1422 | PerlIO_binmode |
---|
1423 | PerlIO_getpos |
---|
1424 | PerlIO_init |
---|
1425 | PerlIO_setpos |
---|
1426 | PerlIO_sprintf |
---|
1427 | PerlIO_sv_dup |
---|
1428 | PerlIO_tmpfile |
---|
1429 | PerlIO_vsprintf |
---|
1430 | perlsio_binmode |
---|