6 my ($syms, $file) = @_;
10 or die "embed.pl: Can't open $file: $!\n";
12 s/[ \t]*#.*//; # Delete comments.
13 if (/^\s*(\S+)\s*$/) {
20 readsyms %global, 'global.sym';
21 readsyms %interp, 'interp.sym';
25 my $t = int(length($from) / 8);
26 "#define $from" . "\t" x ($t < 3 ? 3 - $t : 1) . "$to\n";
30 hide($sym, "Perl_$sym");
34 hide($sym, "(curinterp->I$sym)");
43 or die "Can't create embed.h: $!\n";
46 /* !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
47 This file is built by embed.pl from global.sym and interp.sym.
48 Any changes made here will be lost!
51 /* (Doing namespace management portably in C is really gross.) */
53 /* EMBED has no run-time penalty, but helps keep the Perl namespace
54 from colliding with that used by other libraries pulled in
55 by extensions or by embedding perl. Allow a cc -DNO_EMBED
56 override, however, to keep binary compatability with previous
63 /* Hide global symbols? */
69 for $sym (sort keys %global) {
78 /* Put interpreter-specific symbols into a struct? */
84 for $sym (sort keys %interp) {
85 print EM multon($sym);
90 #else /* !MULTIPLICITY */
94 for $sym (sort keys %interp) {
95 print EM multoff($sym);
100 /* Hide interpreter-specific symbols? */
106 for $sym (sort keys %interp) {
107 print EM embed($sym);
113 #endif /* MULTIPLICITY */