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