Commit | Line | Data |
---|---|---|
5f05dabc | 1 | #!/usr/bin/perl -w |
6294c161 DM |
2 | # |
3 | # Regenerate (overwriting only if changed): | |
4 | # | |
5 | # embed.h | |
6 | # embedvar.h | |
7 | # global.sym | |
8 | # perlapi.c | |
9 | # perlapi.h | |
10 | # proto.h | |
11 | # | |
12 | # from information stored in | |
13 | # | |
14 | # embed.fnc | |
15 | # intrpvar.h | |
16 | # perlvars.h | |
17 | # pp.sym (which has been generated by opcode.pl) | |
18 | # | |
19 | # plus from the values hardcoded into this script in @extvars. | |
20 | # | |
21 | # Accepts the standard regen_lib -q and -v args. | |
22 | # | |
23 | # This script is normally invoked from regen.pl. | |
e50aee73 | 24 | |
954c1994 GS |
25 | require 5.003; # keep this compatible, an old perl is all we may have before |
26 | # we build the new one | |
5f05dabc | 27 | |
88e01c9d AL |
28 | use strict; |
29 | ||
36bb303b NC |
30 | BEGIN { |
31 | # Get function prototypes | |
9ad884cb | 32 | require 'regen_lib.pl'; |
36bb303b NC |
33 | } |
34 | ||
88e01c9d AL |
35 | my $SPLINT = 0; # Turn true for experimental splint support http://www.splint.org |
36 | ||
cea2e8a9 | 37 | # |
346f75ff | 38 | # See database of global and static function prototypes in embed.fnc |
cea2e8a9 GS |
39 | # This is used to generate prototype headers under various configurations, |
40 | # export symbols lists for different platforms, and macros to provide an | |
41 | # implicit interpreter context argument. | |
42 | # | |
43 | ||
7f1be197 MB |
44 | sub do_not_edit ($) |
45 | { | |
46 | my $file = shift; | |
4373e329 | 47 | |
83706693 | 48 | my $years = '1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009'; |
4bb101f2 JH |
49 | |
50 | $years =~ s/1999,/1999,\n / if length $years > 40; | |
51 | ||
7f1be197 | 52 | my $warning = <<EOW; |
37442d52 | 53 | -*- buffer-read-only: t -*- |
7f1be197 MB |
54 | |
55 | $file | |
56 | ||
4bb101f2 | 57 | Copyright (C) $years, by Larry Wall and others |
7f1be197 MB |
58 | |
59 | You may distribute under the terms of either the GNU General Public | |
60 | License or the Artistic License, as specified in the README file. | |
61 | ||
62 | !!!!!!! DO NOT EDIT THIS FILE !!!!!!! | |
63 | This file is built by embed.pl from data in embed.fnc, embed.pl, | |
907b3e23 | 64 | pp.sym, intrpvar.h, and perlvars.h. |
7f1be197 MB |
65 | Any changes made here will be lost! |
66 | ||
67 | Edit those files and run 'make regen_headers' to effect changes. | |
68 | ||
69 | EOW | |
70 | ||
cfa0b873 AT |
71 | $warning .= <<EOW if $file eq 'perlapi.c'; |
72 | ||
73 | Up to the threshold of the door there mounted a flight of twenty-seven | |
74 | broad stairs, hewn by some unknown art of the same black stone. This | |
4ac71550 TC |
75 | was the only entrance to the tower; ... |
76 | ||
77 | [p.577 of _The Lord of the Rings_, III/x: "The Voice of Saruman"] | |
cfa0b873 AT |
78 | |
79 | ||
80 | EOW | |
81 | ||
7f1be197 | 82 | if ($file =~ m:\.[ch]$:) { |
0ea9712b MB |
83 | $warning =~ s:^: * :gm; |
84 | $warning =~ s: +$::gm; | |
85 | $warning =~ s: :/:; | |
86 | $warning =~ s:$:/:; | |
7f1be197 MB |
87 | } |
88 | else { | |
0ea9712b MB |
89 | $warning =~ s:^:# :gm; |
90 | $warning =~ s: +$::gm; | |
7f1be197 MB |
91 | } |
92 | $warning; | |
93 | } # do_not_edit | |
94 | ||
94bdecf9 | 95 | open IN, "embed.fnc" or die $!; |
cea2e8a9 GS |
96 | |
97 | # walk table providing an array of components in each line to | |
98 | # subroutine, printing the result | |
99 | sub walk_table (&@) { | |
100 | my $function = shift; | |
101 | my $filename = shift || '-'; | |
0ea9712b MB |
102 | my $leader = shift; |
103 | defined $leader or $leader = do_not_edit ($filename); | |
cea2e8a9 GS |
104 | my $trailer = shift; |
105 | my $F; | |
cea2e8a9 GS |
106 | if (ref $filename) { # filehandle |
107 | $F = $filename; | |
108 | } | |
109 | else { | |
b6b9a099 | 110 | # safer_unlink $filename if $filename ne '/dev/null'; |
424a4936 | 111 | $F = safer_open("$filename-new"); |
cea2e8a9 GS |
112 | } |
113 | print $F $leader if $leader; | |
94bdecf9 JH |
114 | seek IN, 0, 0; # so we may restart |
115 | while (<IN>) { | |
cea2e8a9 | 116 | chomp; |
1d7c1841 | 117 | next if /^:/; |
cea2e8a9 | 118 | while (s|\\$||) { |
94bdecf9 | 119 | $_ .= <IN>; |
cea2e8a9 GS |
120 | chomp; |
121 | } | |
23f1b5c3 | 122 | s/\s+$//; |
cea2e8a9 GS |
123 | my @args; |
124 | if (/^\s*(#|$)/) { | |
125 | @args = $_; | |
126 | } | |
127 | else { | |
128 | @args = split /\s*\|\s*/, $_; | |
129 | } | |
4373e329 AL |
130 | my @outs = &{$function}(@args); |
131 | print $F @outs; # $function->(@args) is not 5.003 | |
cea2e8a9 GS |
132 | } |
133 | print $F $trailer if $trailer; | |
36bb303b | 134 | unless (ref $filename) { |
08858ed2 | 135 | safer_close($F); |
424a4936 | 136 | rename_if_different("$filename-new", $filename); |
36bb303b | 137 | } |
cea2e8a9 GS |
138 | } |
139 | ||
140 | sub munge_c_files () { | |
141 | my $functions = {}; | |
142 | unless (@ARGV) { | |
4373e329 | 143 | warn "\@ARGV empty, nothing to do\n"; |
cea2e8a9 GS |
144 | return; |
145 | } | |
146 | walk_table { | |
147 | if (@_ > 1) { | |
148 | $functions->{$_[2]} = \@_ if $_[@_-1] =~ /\.\.\./; | |
149 | } | |
37442d52 | 150 | } '/dev/null', '', ''; |
cea2e8a9 GS |
151 | local $^I = '.bak'; |
152 | while (<>) { | |
cea2e8a9 GS |
153 | s{(\b(\w+)[ \t]*\([ \t]*(?!aTHX))} |
154 | { | |
155 | my $repl = $1; | |
156 | my $f = $2; | |
157 | if (exists $functions->{$f}) { | |
158 | $repl .= "aTHX_ "; | |
159 | warn("$ARGV:$.:$`#$repl#$'"); | |
160 | } | |
161 | $repl; | |
162 | }eg; | |
163 | print; | |
164 | close ARGV if eof; # restart $. | |
165 | } | |
166 | exit; | |
167 | } | |
168 | ||
169 | #munge_c_files(); | |
170 | ||
171 | # generate proto.h | |
0cb96387 GS |
172 | my $wrote_protected = 0; |
173 | ||
cea2e8a9 GS |
174 | sub write_protos { |
175 | my $ret = ""; | |
176 | if (@_ == 1) { | |
177 | my $arg = shift; | |
1d7c1841 | 178 | $ret .= "$arg\n"; |
cea2e8a9 GS |
179 | } |
180 | else { | |
7918f24d | 181 | my ($flags,$retval,$plain_func,@args) = @_; |
4373e329 AL |
182 | my @nonnull; |
183 | my $has_context = ( $flags !~ /n/ ); | |
88e01c9d AL |
184 | my $never_returns = ( $flags =~ /r/ ); |
185 | my $commented_out = ( $flags =~ /m/ ); | |
aa4ca557 | 186 | my $binarycompat = ( $flags =~ /b/ ); |
88e01c9d AL |
187 | my $is_malloc = ( $flags =~ /a/ ); |
188 | my $can_ignore = ( $flags !~ /R/ ) && !$is_malloc; | |
7918f24d NC |
189 | my @names_of_nn; |
190 | my $func; | |
88e01c9d AL |
191 | |
192 | my $splint_flags = ""; | |
193 | if ( $SPLINT && !$commented_out ) { | |
194 | $splint_flags .= '/*@noreturn@*/ ' if $never_returns; | |
195 | if ($can_ignore && ($retval ne 'void') && ($retval !~ /\*/)) { | |
196 | $retval .= " /*\@alt void\@*/"; | |
197 | } | |
198 | } | |
199 | ||
cea2e8a9 | 200 | if ($flags =~ /s/) { |
88e01c9d | 201 | $retval = "STATIC $splint_flags$retval"; |
7918f24d | 202 | $func = "S_$plain_func"; |
cea2e8a9 | 203 | } |
0cb96387 | 204 | else { |
88e01c9d | 205 | $retval = "PERL_CALLCONV $splint_flags$retval"; |
25b0f989 | 206 | if ($flags =~ /[bp]/) { |
7918f24d NC |
207 | $func = "Perl_$plain_func"; |
208 | } else { | |
209 | $func = $plain_func; | |
0cb96387 | 210 | } |
cea2e8a9 GS |
211 | } |
212 | $ret .= "$retval\t$func("; | |
4373e329 AL |
213 | if ( $has_context ) { |
214 | $ret .= @args ? "pTHX_ " : "pTHX"; | |
cea2e8a9 GS |
215 | } |
216 | if (@args) { | |
4373e329 AL |
217 | my $n; |
218 | for my $arg ( @args ) { | |
219 | ++$n; | |
7827dc65 AL |
220 | if ( $arg =~ /\*/ && $arg !~ /\b(NN|NULLOK)\b/ ) { |
221 | warn "$func: $arg needs NN or NULLOK\n"; | |
222 | our $unflagged_pointers; | |
223 | ++$unflagged_pointers; | |
224 | } | |
88e01c9d AL |
225 | my $nn = ( $arg =~ s/\s*\bNN\b\s+// ); |
226 | push( @nonnull, $n ) if $nn; | |
227 | ||
228 | my $nullok = ( $arg =~ s/\s*\bNULLOK\b\s+// ); # strip NULLOK with no effect | |
c48640ec AL |
229 | |
230 | # Make sure each arg has at least a type and a var name. | |
231 | # An arg of "int" is valid C, but want it to be "int foo". | |
232 | my $temp_arg = $arg; | |
233 | $temp_arg =~ s/\*//g; | |
234 | $temp_arg =~ s/\s*\bstruct\b\s*/ /g; | |
7918f24d NC |
235 | if ( ($temp_arg ne "...") |
236 | && ($temp_arg !~ /\w+\s+(\w+)(?:\[\d+\])?\s*$/) ) { | |
237 | warn "$func: $arg ($n) doesn't have a name\n"; | |
c48640ec | 238 | } |
88e01c9d AL |
239 | if ( $SPLINT && $nullok && !$commented_out ) { |
240 | $arg = '/*@null@*/ ' . $arg; | |
241 | } | |
aa4ca557 | 242 | if (defined $1 && $nn && !($commented_out && !$binarycompat)) { |
7918f24d NC |
243 | push @names_of_nn, $1; |
244 | } | |
4373e329 | 245 | } |
cea2e8a9 GS |
246 | $ret .= join ", ", @args; |
247 | } | |
248 | else { | |
4373e329 | 249 | $ret .= "void" if !$has_context; |
cea2e8a9 GS |
250 | } |
251 | $ret .= ")"; | |
f54cb97a AL |
252 | my @attrs; |
253 | if ( $flags =~ /r/ ) { | |
abb2c242 | 254 | push @attrs, "__attribute__noreturn__"; |
f54cb97a | 255 | } |
a5c26493 RGS |
256 | if ( $flags =~ /D/ ) { |
257 | push @attrs, "__attribute__deprecated__"; | |
258 | } | |
88e01c9d | 259 | if ( $is_malloc ) { |
abb2c242 | 260 | push @attrs, "__attribute__malloc__"; |
f54cb97a | 261 | } |
88e01c9d | 262 | if ( !$can_ignore ) { |
abb2c242 | 263 | push @attrs, "__attribute__warn_unused_result__"; |
f54cb97a AL |
264 | } |
265 | if ( $flags =~ /P/ ) { | |
abb2c242 | 266 | push @attrs, "__attribute__pure__"; |
f54cb97a | 267 | } |
1c846c1f | 268 | if( $flags =~ /f/ ) { |
cdfeb707 RB |
269 | my $prefix = $has_context ? 'pTHX_' : ''; |
270 | my $args = scalar @args; | |
271 | my $pat = $args - 1; | |
272 | my $macro = @nonnull && $nonnull[-1] == $pat | |
273 | ? '__attribute__format__' | |
274 | : '__attribute__format__null_ok__'; | |
275 | push @attrs, sprintf "%s(__printf__,%s%d,%s%d)", $macro, | |
276 | $prefix, $pat, $prefix, $args; | |
894356b3 | 277 | } |
4373e329 | 278 | if ( @nonnull ) { |
3d42dc86 | 279 | my @pos = map { $has_context ? "pTHX_$_" : $_ } @nonnull; |
abb2c242 | 280 | push @attrs, map { sprintf( "__attribute__nonnull__(%s)", $_ ) } @pos; |
f54cb97a AL |
281 | } |
282 | if ( @attrs ) { | |
283 | $ret .= "\n"; | |
284 | $ret .= join( "\n", map { "\t\t\t$_" } @attrs ); | |
4373e329 | 285 | } |
af3c7592 | 286 | $ret .= ";"; |
88e01c9d | 287 | $ret = "/* $ret */" if $commented_out; |
7918f24d NC |
288 | if (@names_of_nn) { |
289 | $ret .= "\n#define PERL_ARGS_ASSERT_\U$plain_func\E\t\\\n\t" | |
290 | . join '; ', map "assert($_)", @names_of_nn; | |
291 | } | |
f54cb97a | 292 | $ret .= @attrs ? "\n\n" : "\n"; |
cea2e8a9 GS |
293 | } |
294 | $ret; | |
295 | } | |
296 | ||
2b10efc6 NC |
297 | # generates global.sym (API export list) |
298 | { | |
299 | my %seen; | |
300 | sub write_global_sym { | |
301 | my $ret = ""; | |
302 | if (@_ > 1) { | |
303 | my ($flags,$retval,$func,@args) = @_; | |
304 | # If a function is defined twice, for example before and after an | |
305 | # #else, only process the flags on the first instance for global.sym | |
306 | return $ret if $seen{$func}++; | |
307 | if ($flags =~ /[AX]/ && $flags !~ /[xm]/ | |
308 | || $flags =~ /b/) { # public API, so export | |
309 | $func = "Perl_$func" if $flags =~ /[pbX]/; | |
310 | $ret = "$func\n"; | |
311 | } | |
312 | } | |
313 | $ret; | |
314 | } | |
cea2e8a9 GS |
315 | } |
316 | ||
2b10efc6 | 317 | |
7827dc65 | 318 | our $unflagged_pointers; |
37442d52 | 319 | walk_table(\&write_protos, "proto.h", undef, "/* ex: set ro: */\n"); |
7827dc65 | 320 | warn "$unflagged_pointers pointer arguments to clean up\n" if $unflagged_pointers; |
37442d52 | 321 | walk_table(\&write_global_sym, "global.sym", undef, "# ex: set ro:\n"); |
cea2e8a9 | 322 | |
709f4e38 GS |
323 | # XXX others that may need adding |
324 | # warnhook | |
325 | # hints | |
326 | # copline | |
84fee439 | 327 | my @extvars = qw(sv_undef sv_yes sv_no na dowarn |
4373e329 AL |
328 | curcop compiling |
329 | tainting tainted stack_base stack_sp sv_arenaroot | |
256a4781 | 330 | no_modify |
4373e329 AL |
331 | curstash DBsub DBsingle DBassertion debstash |
332 | rsfp | |
333 | stdingv | |
6b88bc9c GS |
334 | defgv |
335 | errgv | |
3070f6ec GS |
336 | rsfp_filters |
337 | perldb | |
709f4e38 GS |
338 | diehook |
339 | dirty | |
340 | perl_destruct_level | |
ac634a9a | 341 | ppaddr |
84fee439 NIS |
342 | ); |
343 | ||
5f05dabc | 344 | sub readsyms (\%$) { |
345 | my ($syms, $file) = @_; | |
5f05dabc | 346 | local (*FILE, $_); |
347 | open(FILE, "< $file") | |
348 | or die "embed.pl: Can't open $file: $!\n"; | |
349 | while (<FILE>) { | |
350 | s/[ \t]*#.*//; # Delete comments. | |
351 | if (/^\s*(\S+)\s*$/) { | |
22c35a8c | 352 | my $sym = $1; |
d1594dd0 | 353 | warn "duplicate symbol $sym while processing $file line $.\n" |
22c35a8c GS |
354 | if exists $$syms{$sym}; |
355 | $$syms{$sym} = 1; | |
5f05dabc | 356 | } |
357 | } | |
358 | close(FILE); | |
359 | } | |
360 | ||
cea2e8a9 GS |
361 | # Perl_pp_* and Perl_ck_* are in pp.sym |
362 | readsyms my %ppsym, 'pp.sym'; | |
5f05dabc | 363 | |
c6af7a1a GS |
364 | sub readvars(\%$$@) { |
365 | my ($syms, $file,$pre,$keep_pre) = @_; | |
d4cce5f1 NIS |
366 | local (*FILE, $_); |
367 | open(FILE, "< $file") | |
368 | or die "embed.pl: Can't open $file: $!\n"; | |
369 | while (<FILE>) { | |
370 | s/[ \t]*#.*//; # Delete comments. | |
27da23d5 | 371 | if (/PERLVARA?I?S?C?\($pre(\w+)/) { |
22c35a8c | 372 | my $sym = $1; |
c6af7a1a | 373 | $sym = $pre . $sym if $keep_pre; |
d1594dd0 | 374 | warn "duplicate symbol $sym while processing $file line $.\n" |
22c35a8c | 375 | if exists $$syms{$sym}; |
51371543 | 376 | $$syms{$sym} = $pre || 1; |
d4cce5f1 NIS |
377 | } |
378 | } | |
379 | close(FILE); | |
380 | } | |
381 | ||
382 | my %intrp; | |
88e01c9d | 383 | my %globvar; |
d4cce5f1 NIS |
384 | |
385 | readvars %intrp, 'intrpvar.h','I'; | |
22239a37 | 386 | readvars %globvar, 'perlvars.h','G'; |
d4cce5f1 | 387 | |
4543f4c0 | 388 | my $sym; |
d4cce5f1 | 389 | |
c6af7a1a GS |
390 | sub undefine ($) { |
391 | my ($sym) = @_; | |
392 | "#undef $sym\n"; | |
393 | } | |
394 | ||
5f05dabc | 395 | sub hide ($$) { |
396 | my ($from, $to) = @_; | |
397 | my $t = int(length($from) / 8); | |
398 | "#define $from" . "\t" x ($t < 3 ? 3 - $t : 1) . "$to\n"; | |
399 | } | |
c6af7a1a | 400 | |
6f4183fe | 401 | sub bincompat_var ($$) { |
51371543 | 402 | my ($pfx, $sym) = @_; |
acfe0abc | 403 | my $arg = ($pfx eq 'G' ? 'NULL' : 'aTHX'); |
c5be433b | 404 | undefine("PL_$sym") . hide("PL_$sym", "(*Perl_${pfx}${sym}_ptr($arg))"); |
c6af7a1a GS |
405 | } |
406 | ||
d4cce5f1 NIS |
407 | sub multon ($$$) { |
408 | my ($sym,$pre,$ptr) = @_; | |
3280af22 | 409 | hide("PL_$sym", "($ptr$pre$sym)"); |
5f05dabc | 410 | } |
54aff467 | 411 | |
d4cce5f1 NIS |
412 | sub multoff ($$) { |
413 | my ($sym,$pre) = @_; | |
533c011a | 414 | return hide("PL_$pre$sym", "PL_$sym"); |
5f05dabc | 415 | } |
416 | ||
424a4936 | 417 | my $em = safer_open('embed.h-new'); |
e50aee73 | 418 | |
424a4936 | 419 | print $em do_not_edit ("embed.h"), <<'END'; |
e50aee73 AD |
420 | |
421 | /* (Doing namespace management portably in C is really gross.) */ | |
422 | ||
d51482e4 JH |
423 | /* By defining PERL_NO_SHORT_NAMES (not done by default) the short forms |
424 | * (like warn instead of Perl_warn) for the API are not defined. | |
425 | * Not defining the short forms is a good thing for cleaner embedding. */ | |
426 | ||
427 | #ifndef PERL_NO_SHORT_NAMES | |
820c3be9 | 428 | |
22c35a8c | 429 | /* Hide global symbols */ |
5f05dabc | 430 | |
cea2e8a9 | 431 | #if !defined(PERL_IMPLICIT_CONTEXT) |
e50aee73 | 432 | |
e50aee73 AD |
433 | END |
434 | ||
da4ddda1 NC |
435 | # Try to elimiate lots of repeated |
436 | # #ifdef PERL_CORE | |
437 | # foo | |
438 | # #endif | |
439 | # #ifdef PERL_CORE | |
440 | # bar | |
441 | # #endif | |
442 | # by tracking state and merging foo and bar into one block. | |
443 | my $ifdef_state = ''; | |
444 | ||
cea2e8a9 GS |
445 | walk_table { |
446 | my $ret = ""; | |
da4ddda1 | 447 | my $new_ifdef_state = ''; |
cea2e8a9 GS |
448 | if (@_ == 1) { |
449 | my $arg = shift; | |
12a98ad5 | 450 | $ret .= "$arg\n" if $arg =~ /^#\s*(if|ifn?def|else|endif)\b/; |
cea2e8a9 GS |
451 | } |
452 | else { | |
453 | my ($flags,$retval,$func,@args) = @_; | |
af3c7592 | 454 | unless ($flags =~ /[om]/) { |
cea2e8a9 GS |
455 | if ($flags =~ /s/) { |
456 | $ret .= hide($func,"S_$func"); | |
457 | } | |
458 | elsif ($flags =~ /p/) { | |
459 | $ret .= hide($func,"Perl_$func"); | |
460 | } | |
461 | } | |
47e67c64 | 462 | if ($ret ne '' && $flags !~ /A/) { |
de37762f | 463 | if ($flags =~ /E/) { |
da4ddda1 NC |
464 | $new_ifdef_state |
465 | = "#if defined(PERL_CORE) || defined(PERL_EXT)\n"; | |
466 | } | |
467 | else { | |
468 | $new_ifdef_state = "#ifdef PERL_CORE\n"; | |
469 | } | |
470 | ||
471 | if ($new_ifdef_state ne $ifdef_state) { | |
472 | $ret = $new_ifdef_state . $ret; | |
de37762f HS |
473 | } |
474 | } | |
cea2e8a9 | 475 | } |
da4ddda1 NC |
476 | if ($ifdef_state && $new_ifdef_state ne $ifdef_state) { |
477 | # Close the old one ahead of opening the new one. | |
478 | $ret = "#endif\n$ret"; | |
479 | } | |
480 | # Remember the new state. | |
481 | $ifdef_state = $new_ifdef_state; | |
cea2e8a9 | 482 | $ret; |
424a4936 | 483 | } $em, ""; |
cea2e8a9 | 484 | |
da4ddda1 | 485 | if ($ifdef_state) { |
424a4936 | 486 | print $em "#endif\n"; |
da4ddda1 NC |
487 | } |
488 | ||
cea2e8a9 GS |
489 | for $sym (sort keys %ppsym) { |
490 | $sym =~ s/^Perl_//; | |
424a4936 | 491 | print $em hide($sym, "Perl_$sym"); |
cea2e8a9 GS |
492 | } |
493 | ||
424a4936 | 494 | print $em <<'END'; |
cea2e8a9 GS |
495 | |
496 | #else /* PERL_IMPLICIT_CONTEXT */ | |
497 | ||
498 | END | |
499 | ||
500 | my @az = ('a'..'z'); | |
501 | ||
da4ddda1 | 502 | $ifdef_state = ''; |
cea2e8a9 GS |
503 | walk_table { |
504 | my $ret = ""; | |
da4ddda1 | 505 | my $new_ifdef_state = ''; |
cea2e8a9 GS |
506 | if (@_ == 1) { |
507 | my $arg = shift; | |
12a98ad5 | 508 | $ret .= "$arg\n" if $arg =~ /^#\s*(if|ifn?def|else|endif)\b/; |
cea2e8a9 GS |
509 | } |
510 | else { | |
511 | my ($flags,$retval,$func,@args) = @_; | |
af3c7592 | 512 | unless ($flags =~ /[om]/) { |
cea2e8a9 GS |
513 | my $args = scalar @args; |
514 | if ($args and $args[$args-1] =~ /\.\.\./) { | |
515 | # we're out of luck for varargs functions under CPP | |
516 | } | |
517 | elsif ($flags =~ /n/) { | |
518 | if ($flags =~ /s/) { | |
519 | $ret .= hide($func,"S_$func"); | |
520 | } | |
521 | elsif ($flags =~ /p/) { | |
522 | $ret .= hide($func,"Perl_$func"); | |
523 | } | |
524 | } | |
525 | else { | |
526 | my $alist = join(",", @az[0..$args-1]); | |
527 | $ret = "#define $func($alist)"; | |
528 | my $t = int(length($ret) / 8); | |
529 | $ret .= "\t" x ($t < 4 ? 4 - $t : 1); | |
530 | if ($flags =~ /s/) { | |
531 | $ret .= "S_$func(aTHX"; | |
532 | } | |
533 | elsif ($flags =~ /p/) { | |
534 | $ret .= "Perl_$func(aTHX"; | |
535 | } | |
536 | $ret .= "_ " if $alist; | |
537 | $ret .= $alist . ")\n"; | |
538 | } | |
539 | } | |
da4ddda1 | 540 | unless ($flags =~ /A/) { |
de37762f | 541 | if ($flags =~ /E/) { |
da4ddda1 NC |
542 | $new_ifdef_state |
543 | = "#if defined(PERL_CORE) || defined(PERL_EXT)\n"; | |
544 | } | |
545 | else { | |
546 | $new_ifdef_state = "#ifdef PERL_CORE\n"; | |
547 | } | |
548 | ||
549 | if ($new_ifdef_state ne $ifdef_state) { | |
550 | $ret = $new_ifdef_state . $ret; | |
de37762f HS |
551 | } |
552 | } | |
cea2e8a9 | 553 | } |
da4ddda1 NC |
554 | if ($ifdef_state && $new_ifdef_state ne $ifdef_state) { |
555 | # Close the old one ahead of opening the new one. | |
556 | $ret = "#endif\n$ret"; | |
557 | } | |
558 | # Remember the new state. | |
559 | $ifdef_state = $new_ifdef_state; | |
cea2e8a9 | 560 | $ret; |
424a4936 | 561 | } $em, ""; |
cea2e8a9 | 562 | |
da4ddda1 | 563 | if ($ifdef_state) { |
424a4936 | 564 | print $em "#endif\n"; |
da4ddda1 NC |
565 | } |
566 | ||
cea2e8a9 GS |
567 | for $sym (sort keys %ppsym) { |
568 | $sym =~ s/^Perl_//; | |
569 | if ($sym =~ /^ck_/) { | |
424a4936 | 570 | print $em hide("$sym(a)", "Perl_$sym(aTHX_ a)"); |
cea2e8a9 GS |
571 | } |
572 | elsif ($sym =~ /^pp_/) { | |
424a4936 | 573 | print $em hide("$sym()", "Perl_$sym(aTHX)"); |
cea2e8a9 GS |
574 | } |
575 | else { | |
576 | warn "Illegal symbol '$sym' in pp.sym"; | |
577 | } | |
e50aee73 AD |
578 | } |
579 | ||
424a4936 | 580 | print $em <<'END'; |
e50aee73 | 581 | |
cea2e8a9 | 582 | #endif /* PERL_IMPLICIT_CONTEXT */ |
22c35a8c | 583 | |
d51482e4 | 584 | #endif /* #ifndef PERL_NO_SHORT_NAMES */ |
35209cc8 | 585 | |
22c35a8c GS |
586 | END |
587 | ||
424a4936 | 588 | print $em <<'END'; |
22c35a8c | 589 | |
cea2e8a9 GS |
590 | /* Compatibility stubs. Compile extensions with -DPERL_NOCOMPAT to |
591 | disable them. | |
592 | */ | |
593 | ||
538feb02 | 594 | #if !defined(PERL_CORE) |
5bc28da9 | 595 | # define sv_setptrobj(rv,ptr,name) sv_setref_iv(rv,name,PTR2IV(ptr)) |
a0714e2c | 596 | # define sv_setptrref(rv,ptr) sv_setref_iv(rv,NULL,PTR2IV(ptr)) |
538feb02 | 597 | #endif |
cea2e8a9 | 598 | |
08e5223a | 599 | #if !defined(PERL_CORE) && !defined(PERL_NOCOMPAT) |
cea2e8a9 GS |
600 | |
601 | /* Compatibility for various misnamed functions. All functions | |
602 | in the API that begin with "perl_" (not "Perl_") take an explicit | |
603 | interpreter context pointer. | |
604 | The following are not like that, but since they had a "perl_" | |
605 | prefix in previous versions, we provide compatibility macros. | |
606 | */ | |
65cec589 GS |
607 | # define perl_atexit(a,b) call_atexit(a,b) |
608 | # define perl_call_argv(a,b,c) call_argv(a,b,c) | |
609 | # define perl_call_pv(a,b) call_pv(a,b) | |
610 | # define perl_call_method(a,b) call_method(a,b) | |
611 | # define perl_call_sv(a,b) call_sv(a,b) | |
612 | # define perl_eval_sv(a,b) eval_sv(a,b) | |
613 | # define perl_eval_pv(a,b) eval_pv(a,b) | |
614 | # define perl_require_pv(a) require_pv(a) | |
615 | # define perl_get_sv(a,b) get_sv(a,b) | |
616 | # define perl_get_av(a,b) get_av(a,b) | |
617 | # define perl_get_hv(a,b) get_hv(a,b) | |
618 | # define perl_get_cv(a,b) get_cv(a,b) | |
619 | # define perl_init_i18nl10n(a) init_i18nl10n(a) | |
620 | # define perl_init_i18nl14n(a) init_i18nl14n(a) | |
621 | # define perl_new_ctype(a) new_ctype(a) | |
622 | # define perl_new_collate(a) new_collate(a) | |
623 | # define perl_new_numeric(a) new_numeric(a) | |
cea2e8a9 GS |
624 | |
625 | /* varargs functions can't be handled with CPP macros. :-( | |
626 | This provides a set of compatibility functions that don't take | |
627 | an extra argument but grab the context pointer using the macro | |
628 | dTHX. | |
629 | */ | |
d51482e4 | 630 | #if defined(PERL_IMPLICIT_CONTEXT) && !defined(PERL_NO_SHORT_NAMES) |
cea2e8a9 | 631 | # define croak Perl_croak_nocontext |
c5be433b | 632 | # define deb Perl_deb_nocontext |
cea2e8a9 GS |
633 | # define die Perl_die_nocontext |
634 | # define form Perl_form_nocontext | |
e4783991 | 635 | # define load_module Perl_load_module_nocontext |
5a844595 | 636 | # define mess Perl_mess_nocontext |
cea2e8a9 GS |
637 | # define newSVpvf Perl_newSVpvf_nocontext |
638 | # define sv_catpvf Perl_sv_catpvf_nocontext | |
639 | # define sv_setpvf Perl_sv_setpvf_nocontext | |
640 | # define warn Perl_warn_nocontext | |
c5be433b | 641 | # define warner Perl_warner_nocontext |
cea2e8a9 GS |
642 | # define sv_catpvf_mg Perl_sv_catpvf_mg_nocontext |
643 | # define sv_setpvf_mg Perl_sv_setpvf_mg_nocontext | |
644 | #endif | |
645 | ||
646 | #endif /* !defined(PERL_CORE) && !defined(PERL_NOCOMPAT) */ | |
647 | ||
648 | #if !defined(PERL_IMPLICIT_CONTEXT) | |
649 | /* undefined symbols, point them back at the usual ones */ | |
650 | # define Perl_croak_nocontext Perl_croak | |
651 | # define Perl_die_nocontext Perl_die | |
c5be433b | 652 | # define Perl_deb_nocontext Perl_deb |
cea2e8a9 | 653 | # define Perl_form_nocontext Perl_form |
e4783991 | 654 | # define Perl_load_module_nocontext Perl_load_module |
5a844595 | 655 | # define Perl_mess_nocontext Perl_mess |
c5be433b GS |
656 | # define Perl_newSVpvf_nocontext Perl_newSVpvf |
657 | # define Perl_sv_catpvf_nocontext Perl_sv_catpvf | |
658 | # define Perl_sv_setpvf_nocontext Perl_sv_setpvf | |
cea2e8a9 | 659 | # define Perl_warn_nocontext Perl_warn |
c5be433b | 660 | # define Perl_warner_nocontext Perl_warner |
cea2e8a9 GS |
661 | # define Perl_sv_catpvf_mg_nocontext Perl_sv_catpvf_mg |
662 | # define Perl_sv_setpvf_mg_nocontext Perl_sv_setpvf_mg | |
663 | #endif | |
db5cf5a9 | 664 | |
37442d52 | 665 | /* ex: set ro: */ |
d4cce5f1 NIS |
666 | END |
667 | ||
08858ed2 | 668 | safer_close($em); |
424a4936 | 669 | rename_if_different('embed.h-new', 'embed.h'); |
d4cce5f1 | 670 | |
424a4936 | 671 | $em = safer_open('embedvar.h-new'); |
d4cce5f1 | 672 | |
424a4936 | 673 | print $em do_not_edit ("embedvar.h"), <<'END'; |
d4cce5f1 NIS |
674 | |
675 | /* (Doing namespace management portably in C is really gross.) */ | |
676 | ||
54aff467 | 677 | /* |
3db8f154 MB |
678 | The following combinations of MULTIPLICITY and PERL_IMPLICIT_CONTEXT |
679 | are supported: | |
54aff467 GS |
680 | 1) none |
681 | 2) MULTIPLICITY # supported for compatibility | |
682 | 3) MULTIPLICITY && PERL_IMPLICIT_CONTEXT | |
54aff467 GS |
683 | |
684 | All other combinations of these flags are errors. | |
685 | ||
3db8f154 | 686 | only #3 is supported directly, while #2 is a special |
54aff467 GS |
687 | case of #3 (supported by redefining vTHX appropriately). |
688 | */ | |
cea2e8a9 | 689 | |
54aff467 | 690 | #if defined(MULTIPLICITY) |
3db8f154 | 691 | /* cases 2 and 3 above */ |
cea2e8a9 | 692 | |
54aff467 GS |
693 | # if defined(PERL_IMPLICIT_CONTEXT) |
694 | # define vTHX aTHX | |
695 | # else | |
696 | # define vTHX PERL_GET_INTERP | |
697 | # endif | |
cea2e8a9 | 698 | |
e50aee73 AD |
699 | END |
700 | ||
d4cce5f1 | 701 | for $sym (sort keys %intrp) { |
424a4936 | 702 | print $em multon($sym,'I','vTHX->'); |
d4cce5f1 NIS |
703 | } |
704 | ||
424a4936 | 705 | print $em <<'END'; |
d4cce5f1 | 706 | |
54aff467 | 707 | #else /* !MULTIPLICITY */ |
1d7c1841 | 708 | |
3db8f154 | 709 | /* case 1 above */ |
5f05dabc | 710 | |
56d28764 | 711 | END |
e50aee73 | 712 | |
d4cce5f1 | 713 | for $sym (sort keys %intrp) { |
424a4936 | 714 | print $em multoff($sym,'I'); |
d4cce5f1 NIS |
715 | } |
716 | ||
424a4936 | 717 | print $em <<'END'; |
d4cce5f1 | 718 | |
d4cce5f1 NIS |
719 | END |
720 | ||
424a4936 | 721 | print $em <<'END'; |
d4cce5f1 | 722 | |
54aff467 | 723 | #endif /* MULTIPLICITY */ |
d4cce5f1 | 724 | |
54aff467 | 725 | #if defined(PERL_GLOBAL_STRUCT) |
22239a37 NIS |
726 | |
727 | END | |
728 | ||
729 | for $sym (sort keys %globvar) { | |
424a4936 NC |
730 | print $em multon($sym, 'G','my_vars->'); |
731 | print $em multon("G$sym",'', 'my_vars->'); | |
22239a37 NIS |
732 | } |
733 | ||
424a4936 | 734 | print $em <<'END'; |
22239a37 NIS |
735 | |
736 | #else /* !PERL_GLOBAL_STRUCT */ | |
737 | ||
738 | END | |
739 | ||
740 | for $sym (sort keys %globvar) { | |
424a4936 | 741 | print $em multoff($sym,'G'); |
22239a37 NIS |
742 | } |
743 | ||
424a4936 | 744 | print $em <<'END'; |
22239a37 | 745 | |
22239a37 NIS |
746 | #endif /* PERL_GLOBAL_STRUCT */ |
747 | ||
37442d52 | 748 | /* ex: set ro: */ |
84fee439 NIS |
749 | END |
750 | ||
08858ed2 | 751 | safer_close($em); |
424a4936 | 752 | rename_if_different('embedvar.h-new', 'embedvar.h'); |
c6af7a1a | 753 | |
424a4936 NC |
754 | my $capi = safer_open('perlapi.c-new'); |
755 | my $capih = safer_open('perlapi.h-new'); | |
51371543 | 756 | |
424a4936 | 757 | print $capih do_not_edit ("perlapi.h"), <<'EOT'; |
51371543 | 758 | |
51371543 | 759 | /* declare accessor functions for Perl variables */ |
6f4183fe GS |
760 | #ifndef __perlapi_h__ |
761 | #define __perlapi_h__ | |
51371543 | 762 | |
acfe0abc | 763 | #if defined (MULTIPLICITY) |
c5be433b | 764 | |
51371543 GS |
765 | START_EXTERN_C |
766 | ||
767 | #undef PERLVAR | |
768 | #undef PERLVARA | |
769 | #undef PERLVARI | |
770 | #undef PERLVARIC | |
27da23d5 | 771 | #undef PERLVARISC |
acfe0abc | 772 | #define PERLVAR(v,t) EXTERN_C t* Perl_##v##_ptr(pTHX); |
51371543 | 773 | #define PERLVARA(v,n,t) typedef t PL_##v##_t[n]; \ |
acfe0abc | 774 | EXTERN_C PL_##v##_t* Perl_##v##_ptr(pTHX); |
51371543 | 775 | #define PERLVARI(v,t,i) PERLVAR(v,t) |
c5be433b | 776 | #define PERLVARIC(v,t,i) PERLVAR(v, const t) |
27da23d5 JH |
777 | #define PERLVARISC(v,i) typedef const char PL_##v##_t[sizeof(i)]; \ |
778 | EXTERN_C PL_##v##_t* Perl_##v##_ptr(pTHX); | |
51371543 | 779 | |
51371543 GS |
780 | #include "intrpvar.h" |
781 | #include "perlvars.h" | |
782 | ||
783 | #undef PERLVAR | |
784 | #undef PERLVARA | |
785 | #undef PERLVARI | |
786 | #undef PERLVARIC | |
27da23d5 JH |
787 | #undef PERLVARISC |
788 | ||
789 | #ifndef PERL_GLOBAL_STRUCT | |
790 | EXTERN_C Perl_ppaddr_t** Perl_Gppaddr_ptr(pTHX); | |
791 | EXTERN_C Perl_check_t** Perl_Gcheck_ptr(pTHX); | |
792 | EXTERN_C unsigned char** Perl_Gfold_locale_ptr(pTHX); | |
793 | #define Perl_ppaddr_ptr Perl_Gppaddr_ptr | |
794 | #define Perl_check_ptr Perl_Gcheck_ptr | |
795 | #define Perl_fold_locale_ptr Perl_Gfold_locale_ptr | |
796 | #endif | |
51371543 GS |
797 | |
798 | END_EXTERN_C | |
799 | ||
682fc664 | 800 | #if defined(PERL_CORE) |
6f4183fe | 801 | |
682fc664 GS |
802 | /* accessor functions for Perl variables (provide binary compatibility) */ |
803 | ||
804 | /* these need to be mentioned here, or most linkers won't put them in | |
805 | the perl executable */ | |
806 | ||
807 | #ifndef PERL_NO_FORCE_LINK | |
808 | ||
809 | START_EXTERN_C | |
810 | ||
811 | #ifndef DOINIT | |
27da23d5 | 812 | EXTCONST void * const PL_force_link_funcs[]; |
682fc664 | 813 | #else |
27da23d5 | 814 | EXTCONST void * const PL_force_link_funcs[] = { |
682fc664 GS |
815 | #undef PERLVAR |
816 | #undef PERLVARA | |
817 | #undef PERLVARI | |
818 | #undef PERLVARIC | |
ea1f607c | 819 | #define PERLVAR(v,t) (void*)Perl_##v##_ptr, |
682fc664 GS |
820 | #define PERLVARA(v,n,t) PERLVAR(v,t) |
821 | #define PERLVARI(v,t,i) PERLVAR(v,t) | |
822 | #define PERLVARIC(v,t,i) PERLVAR(v,t) | |
27da23d5 | 823 | #define PERLVARISC(v,i) PERLVAR(v,char) |
682fc664 | 824 | |
3c0f78ca JH |
825 | /* In Tru64 (__DEC && __osf__) the cc option -std1 causes that one |
826 | * cannot cast between void pointers and function pointers without | |
827 | * info level warnings. The PL_force_link_funcs[] would cause a few | |
828 | * hundred of those warnings. In code one can circumnavigate this by using | |
829 | * unions that overlay the different pointers, but in declarations one | |
830 | * cannot use this trick. Therefore we just disable the warning here | |
831 | * for the duration of the PL_force_link_funcs[] declaration. */ | |
832 | ||
833 | #if defined(__DECC) && defined(__osf__) | |
834 | #pragma message save | |
835 | #pragma message disable (nonstandcast) | |
836 | #endif | |
837 | ||
682fc664 GS |
838 | #include "intrpvar.h" |
839 | #include "perlvars.h" | |
840 | ||
3c0f78ca JH |
841 | #if defined(__DECC) && defined(__osf__) |
842 | #pragma message restore | |
843 | #endif | |
844 | ||
682fc664 GS |
845 | #undef PERLVAR |
846 | #undef PERLVARA | |
847 | #undef PERLVARI | |
848 | #undef PERLVARIC | |
27da23d5 | 849 | #undef PERLVARISC |
682fc664 GS |
850 | }; |
851 | #endif /* DOINIT */ | |
852 | ||
acfe0abc | 853 | END_EXTERN_C |
682fc664 GS |
854 | |
855 | #endif /* PERL_NO_FORCE_LINK */ | |
856 | ||
857 | #else /* !PERL_CORE */ | |
51371543 GS |
858 | |
859 | EOT | |
860 | ||
4543f4c0 | 861 | foreach $sym (sort keys %intrp) { |
424a4936 | 862 | print $capih bincompat_var('I',$sym); |
6f4183fe GS |
863 | } |
864 | ||
4543f4c0 | 865 | foreach $sym (sort keys %globvar) { |
424a4936 | 866 | print $capih bincompat_var('G',$sym); |
6f4183fe GS |
867 | } |
868 | ||
424a4936 | 869 | print $capih <<'EOT'; |
6f4183fe GS |
870 | |
871 | #endif /* !PERL_CORE */ | |
acfe0abc | 872 | #endif /* MULTIPLICITY */ |
6f4183fe GS |
873 | |
874 | #endif /* __perlapi_h__ */ | |
875 | ||
37442d52 | 876 | /* ex: set ro: */ |
6f4183fe | 877 | EOT |
08858ed2 | 878 | safer_close($capih); |
424a4936 | 879 | rename_if_different('perlapi.h-new', 'perlapi.h'); |
51371543 | 880 | |
424a4936 | 881 | print $capi do_not_edit ("perlapi.c"), <<'EOT'; |
51371543 GS |
882 | |
883 | #include "EXTERN.h" | |
884 | #include "perl.h" | |
885 | #include "perlapi.h" | |
886 | ||
acfe0abc | 887 | #if defined (MULTIPLICITY) |
51371543 GS |
888 | |
889 | /* accessor functions for Perl variables (provides binary compatibility) */ | |
890 | START_EXTERN_C | |
891 | ||
892 | #undef PERLVAR | |
893 | #undef PERLVARA | |
894 | #undef PERLVARI | |
895 | #undef PERLVARIC | |
27da23d5 | 896 | #undef PERLVARISC |
6f4183fe | 897 | |
6f4183fe | 898 | #define PERLVAR(v,t) t* Perl_##v##_ptr(pTHX) \ |
96a5add6 | 899 | { dVAR; PERL_UNUSED_CONTEXT; return &(aTHX->v); } |
6f4183fe | 900 | #define PERLVARA(v,n,t) PL_##v##_t* Perl_##v##_ptr(pTHX) \ |
96a5add6 | 901 | { dVAR; PERL_UNUSED_CONTEXT; return &(aTHX->v); } |
6f4183fe | 902 | |
51371543 | 903 | #define PERLVARI(v,t,i) PERLVAR(v,t) |
c5be433b | 904 | #define PERLVARIC(v,t,i) PERLVAR(v, const t) |
27da23d5 | 905 | #define PERLVARISC(v,i) PL_##v##_t* Perl_##v##_ptr(pTHX) \ |
96a5add6 | 906 | { dVAR; PERL_UNUSED_CONTEXT; return &(aTHX->v); } |
51371543 | 907 | |
51371543 | 908 | #include "intrpvar.h" |
c5be433b GS |
909 | |
910 | #undef PERLVAR | |
911 | #undef PERLVARA | |
acfe0abc | 912 | #define PERLVAR(v,t) t* Perl_##v##_ptr(pTHX) \ |
96a5add6 | 913 | { dVAR; PERL_UNUSED_CONTEXT; return &(PL_##v); } |
acfe0abc | 914 | #define PERLVARA(v,n,t) PL_##v##_t* Perl_##v##_ptr(pTHX) \ |
96a5add6 | 915 | { dVAR; PERL_UNUSED_CONTEXT; return &(PL_##v); } |
34f7a5fe | 916 | #undef PERLVARIC |
27da23d5 JH |
917 | #undef PERLVARISC |
918 | #define PERLVARIC(v,t,i) \ | |
919 | const t* Perl_##v##_ptr(pTHX) \ | |
96a5add6 | 920 | { PERL_UNUSED_CONTEXT; return (const t *)&(PL_##v); } |
27da23d5 | 921 | #define PERLVARISC(v,i) PL_##v##_t* Perl_##v##_ptr(pTHX) \ |
96a5add6 | 922 | { dVAR; PERL_UNUSED_CONTEXT; return &(PL_##v); } |
51371543 GS |
923 | #include "perlvars.h" |
924 | ||
925 | #undef PERLVAR | |
926 | #undef PERLVARA | |
927 | #undef PERLVARI | |
928 | #undef PERLVARIC | |
27da23d5 JH |
929 | #undef PERLVARISC |
930 | ||
931 | #ifndef PERL_GLOBAL_STRUCT | |
932 | /* A few evil special cases. Could probably macrofy this. */ | |
933 | #undef PL_ppaddr | |
934 | #undef PL_check | |
935 | #undef PL_fold_locale | |
936 | Perl_ppaddr_t** Perl_Gppaddr_ptr(pTHX) { | |
88e01c9d | 937 | static Perl_ppaddr_t* const ppaddr_ptr = PL_ppaddr; |
96a5add6 | 938 | PERL_UNUSED_CONTEXT; |
27da23d5 JH |
939 | return (Perl_ppaddr_t**)&ppaddr_ptr; |
940 | } | |
941 | Perl_check_t** Perl_Gcheck_ptr(pTHX) { | |
88e01c9d | 942 | static Perl_check_t* const check_ptr = PL_check; |
96a5add6 | 943 | PERL_UNUSED_CONTEXT; |
27da23d5 JH |
944 | return (Perl_check_t**)&check_ptr; |
945 | } | |
946 | unsigned char** Perl_Gfold_locale_ptr(pTHX) { | |
88e01c9d | 947 | static unsigned char* const fold_locale_ptr = PL_fold_locale; |
96a5add6 | 948 | PERL_UNUSED_CONTEXT; |
27da23d5 JH |
949 | return (unsigned char**)&fold_locale_ptr; |
950 | } | |
951 | #endif | |
51371543 | 952 | |
acfe0abc | 953 | END_EXTERN_C |
6f4183fe | 954 | |
acfe0abc | 955 | #endif /* MULTIPLICITY */ |
37442d52 RGS |
956 | |
957 | /* ex: set ro: */ | |
51371543 GS |
958 | EOT |
959 | ||
08858ed2 | 960 | safer_close($capi); |
424a4936 | 961 | rename_if_different('perlapi.c-new', 'perlapi.c'); |
acfe0abc | 962 | |
c5be433b | 963 | # functions that take va_list* for implementing vararg functions |
08cd8952 | 964 | # NOTE: makedef.pl must be updated if you add symbols to %vfuncs |
acfe0abc | 965 | # XXX %vfuncs currently unused |
c5be433b GS |
966 | my %vfuncs = qw( |
967 | Perl_croak Perl_vcroak | |
968 | Perl_warn Perl_vwarn | |
969 | Perl_warner Perl_vwarner | |
970 | Perl_die Perl_vdie | |
971 | Perl_form Perl_vform | |
e4783991 | 972 | Perl_load_module Perl_vload_module |
5a844595 | 973 | Perl_mess Perl_vmess |
c5be433b GS |
974 | Perl_deb Perl_vdeb |
975 | Perl_newSVpvf Perl_vnewSVpvf | |
976 | Perl_sv_setpvf Perl_sv_vsetpvf | |
977 | Perl_sv_setpvf_mg Perl_sv_vsetpvf_mg | |
978 | Perl_sv_catpvf Perl_sv_vcatpvf | |
979 | Perl_sv_catpvf_mg Perl_sv_vcatpvf_mg | |
980 | Perl_dump_indent Perl_dump_vindent | |
981 | Perl_default_protect Perl_vdefault_protect | |
982 | ); | |
1b6737cc AL |
983 | |
984 | # ex: set ts=8 sts=4 sw=4 noet: |