Implement DDisplay ()
[Data-Peek.git] / ppport.h
blob8af434b5150e508315be3714975521d08efea006
1 #if 0
2 <<'SKIP';
3 #endif
4 /*
5 ----------------------------------------------------------------------
7 ppport.h -- Perl/Pollution/Portability Version 3.14_01
9 Automatically created by Devel::PPPort running under perl 5.011000.
11 Do NOT edit this file directly! -- Edit PPPort_pm.PL and the
12 includes in parts/inc/ instead.
14 Use 'perldoc ppport.h' to view the documentation below.
16 ----------------------------------------------------------------------
18 SKIP
20 =pod
22 =head1 NAME
24 ppport.h - Perl/Pollution/Portability version 3.14_01
26 =head1 SYNOPSIS
28 perl ppport.h [options] [source files]
30 Searches current directory for files if no [source files] are given
32 --help show short help
34 --version show version
36 --patch=file write one patch file with changes
37 --copy=suffix write changed copies with suffix
38 --diff=program use diff program and options
40 --compat-version=version provide compatibility with Perl version
41 --cplusplus accept C++ comments
43 --quiet don't output anything except fatal errors
44 --nodiag don't show diagnostics
45 --nohints don't show hints
46 --nochanges don't suggest changes
47 --nofilter don't filter input files
49 --strip strip all script and doc functionality from
50 ppport.h
52 --list-provided list provided API
53 --list-unsupported list unsupported API
54 --api-info=name show Perl API portability information
56 =head1 COMPATIBILITY
58 This version of F<ppport.h> is designed to support operation with Perl
59 installations back to 5.003, and has been tested up to 5.10.0.
61 =head1 OPTIONS
63 =head2 --help
65 Display a brief usage summary.
67 =head2 --version
69 Display the version of F<ppport.h>.
71 =head2 --patch=I<file>
73 If this option is given, a single patch file will be created if
74 any changes are suggested. This requires a working diff program
75 to be installed on your system.
77 =head2 --copy=I<suffix>
79 If this option is given, a copy of each file will be saved with
80 the given suffix that contains the suggested changes. This does
81 not require any external programs. Note that this does not
82 automagially add a dot between the original filename and the
83 suffix. If you want the dot, you have to include it in the option
84 argument.
86 If neither C<--patch> or C<--copy> are given, the default is to
87 simply print the diffs for each file. This requires either
88 C<Text::Diff> or a C<diff> program to be installed.
90 =head2 --diff=I<program>
92 Manually set the diff program and options to use. The default
93 is to use C<Text::Diff>, when installed, and output unified
94 context diffs.
96 =head2 --compat-version=I<version>
98 Tell F<ppport.h> to check for compatibility with the given
99 Perl version. The default is to check for compatibility with Perl
100 version 5.003. You can use this option to reduce the output
101 of F<ppport.h> if you intend to be backward compatible only
102 down to a certain Perl version.
104 =head2 --cplusplus
106 Usually, F<ppport.h> will detect C++ style comments and
107 replace them with C style comments for portability reasons.
108 Using this option instructs F<ppport.h> to leave C++
109 comments untouched.
111 =head2 --quiet
113 Be quiet. Don't print anything except fatal errors.
115 =head2 --nodiag
117 Don't output any diagnostic messages. Only portability
118 alerts will be printed.
120 =head2 --nohints
122 Don't output any hints. Hints often contain useful portability
123 notes. Warnings will still be displayed.
125 =head2 --nochanges
127 Don't suggest any changes. Only give diagnostic output and hints
128 unless these are also deactivated.
130 =head2 --nofilter
132 Don't filter the list of input files. By default, files not looking
133 like source code (i.e. not *.xs, *.c, *.cc, *.cpp or *.h) are skipped.
135 =head2 --strip
137 Strip all script and documentation functionality from F<ppport.h>.
138 This reduces the size of F<ppport.h> dramatically and may be useful
139 if you want to include F<ppport.h> in smaller modules without
140 increasing their distribution size too much.
142 The stripped F<ppport.h> will have a C<--unstrip> option that allows
143 you to undo the stripping, but only if an appropriate C<Devel::PPPort>
144 module is installed.
146 =head2 --list-provided
148 Lists the API elements for which compatibility is provided by
149 F<ppport.h>. Also lists if it must be explicitly requested,
150 if it has dependencies, and if there are hints or warnings for it.
152 =head2 --list-unsupported
154 Lists the API elements that are known not to be supported by
155 F<ppport.h> and below which version of Perl they probably
156 won't be available or work.
158 =head2 --api-info=I<name>
160 Show portability information for API elements matching I<name>.
161 If I<name> is surrounded by slashes, it is interpreted as a regular
162 expression.
164 =head1 DESCRIPTION
166 In order for a Perl extension (XS) module to be as portable as possible
167 across differing versions of Perl itself, certain steps need to be taken.
169 =over 4
171 =item *
173 Including this header is the first major one. This alone will give you
174 access to a large part of the Perl API that hasn't been available in
175 earlier Perl releases. Use
177 perl ppport.h --list-provided
179 to see which API elements are provided by ppport.h.
181 =item *
183 You should avoid using deprecated parts of the API. For example, using
184 global Perl variables without the C<PL_> prefix is deprecated. Also,
185 some API functions used to have a C<perl_> prefix. Using this form is
186 also deprecated. You can safely use the supported API, as F<ppport.h>
187 will provide wrappers for older Perl versions.
189 =item *
191 If you use one of a few functions or variables that were not present in
192 earlier versions of Perl, and that can't be provided using a macro, you
193 have to explicitly request support for these functions by adding one or
194 more C<#define>s in your source code before the inclusion of F<ppport.h>.
196 These functions or variables will be marked C<explicit> in the list shown
197 by C<--list-provided>.
199 Depending on whether you module has a single or multiple files that
200 use such functions or variables, you want either C<static> or global
201 variants.
203 For a C<static> function or variable (used only in a single source
204 file), use:
206 #define NEED_function
207 #define NEED_variable
209 For a global function or variable (used in multiple source files),
210 use:
212 #define NEED_function_GLOBAL
213 #define NEED_variable_GLOBAL
215 Note that you mustn't have more than one global request for the
216 same function or variable in your project.
218 Function / Variable Static Request Global Request
219 -----------------------------------------------------------------------------------------
220 PL_signals NEED_PL_signals NEED_PL_signals_GLOBAL
221 eval_pv() NEED_eval_pv NEED_eval_pv_GLOBAL
222 grok_bin() NEED_grok_bin NEED_grok_bin_GLOBAL
223 grok_hex() NEED_grok_hex NEED_grok_hex_GLOBAL
224 grok_number() NEED_grok_number NEED_grok_number_GLOBAL
225 grok_numeric_radix() NEED_grok_numeric_radix NEED_grok_numeric_radix_GLOBAL
226 grok_oct() NEED_grok_oct NEED_grok_oct_GLOBAL
227 load_module() NEED_load_module NEED_load_module_GLOBAL
228 my_snprintf() NEED_my_snprintf NEED_my_snprintf_GLOBAL
229 my_strlcat() NEED_my_strlcat NEED_my_strlcat_GLOBAL
230 my_strlcpy() NEED_my_strlcpy NEED_my_strlcpy_GLOBAL
231 newCONSTSUB() NEED_newCONSTSUB NEED_newCONSTSUB_GLOBAL
232 newRV_noinc() NEED_newRV_noinc NEED_newRV_noinc_GLOBAL
233 newSVpvn_flags() NEED_newSVpvn_flags NEED_newSVpvn_flags_GLOBAL
234 newSVpvn_share() NEED_newSVpvn_share NEED_newSVpvn_share_GLOBAL
235 sv_2pv_flags() NEED_sv_2pv_flags NEED_sv_2pv_flags_GLOBAL
236 sv_2pvbyte() NEED_sv_2pvbyte NEED_sv_2pvbyte_GLOBAL
237 sv_catpvf_mg() NEED_sv_catpvf_mg NEED_sv_catpvf_mg_GLOBAL
238 sv_catpvf_mg_nocontext() NEED_sv_catpvf_mg_nocontext NEED_sv_catpvf_mg_nocontext_GLOBAL
239 sv_pvn_force_flags() NEED_sv_pvn_force_flags NEED_sv_pvn_force_flags_GLOBAL
240 sv_setpvf_mg() NEED_sv_setpvf_mg NEED_sv_setpvf_mg_GLOBAL
241 sv_setpvf_mg_nocontext() NEED_sv_setpvf_mg_nocontext NEED_sv_setpvf_mg_nocontext_GLOBAL
242 vload_module() NEED_vload_module NEED_vload_module_GLOBAL
243 vnewSVpvf() NEED_vnewSVpvf NEED_vnewSVpvf_GLOBAL
244 warner() NEED_warner NEED_warner_GLOBAL
246 To avoid namespace conflicts, you can change the namespace of the
247 explicitly exported functions / variables using the C<DPPP_NAMESPACE>
248 macro. Just C<#define> the macro before including C<ppport.h>:
250 #define DPPP_NAMESPACE MyOwnNamespace_
251 #include "ppport.h"
253 The default namespace is C<DPPP_>.
255 =back
257 The good thing is that most of the above can be checked by running
258 F<ppport.h> on your source code. See the next section for
259 details.
261 =head1 EXAMPLES
263 To verify whether F<ppport.h> is needed for your module, whether you
264 should make any changes to your code, and whether any special defines
265 should be used, F<ppport.h> can be run as a Perl script to check your
266 source code. Simply say:
268 perl ppport.h
270 The result will usually be a list of patches suggesting changes
271 that should at least be acceptable, if not necessarily the most
272 efficient solution, or a fix for all possible problems.
274 If you know that your XS module uses features only available in
275 newer Perl releases, if you're aware that it uses C++ comments,
276 and if you want all suggestions as a single patch file, you could
277 use something like this:
279 perl ppport.h --compat-version=5.6.0 --cplusplus --patch=test.diff
281 If you only want your code to be scanned without any suggestions
282 for changes, use:
284 perl ppport.h --nochanges
286 You can specify a different C<diff> program or options, using
287 the C<--diff> option:
289 perl ppport.h --diff='diff -C 10'
291 This would output context diffs with 10 lines of context.
293 If you want to create patched copies of your files instead, use:
295 perl ppport.h --copy=.new
297 To display portability information for the C<newSVpvn> function,
298 use:
300 perl ppport.h --api-info=newSVpvn
302 Since the argument to C<--api-info> can be a regular expression,
303 you can use
305 perl ppport.h --api-info=/_nomg$/
307 to display portability information for all C<_nomg> functions or
309 perl ppport.h --api-info=/./
311 to display information for all known API elements.
313 =head1 BUGS
315 If this version of F<ppport.h> is causing failure during
316 the compilation of this module, please check if newer versions
317 of either this module or C<Devel::PPPort> are available on CPAN
318 before sending a bug report.
320 If F<ppport.h> was generated using the latest version of
321 C<Devel::PPPort> and is causing failure of this module, please
322 file a bug report using the CPAN Request Tracker at L<http://rt.cpan.org/>.
324 Please include the following information:
326 =over 4
328 =item 1.
330 The complete output from running "perl -V"
332 =item 2.
334 This file.
336 =item 3.
338 The name and version of the module you were trying to build.
340 =item 4.
342 A full log of the build that failed.
344 =item 5.
346 Any other information that you think could be relevant.
348 =back
350 For the latest version of this code, please get the C<Devel::PPPort>
351 module from CPAN.
353 =head1 COPYRIGHT
355 Version 3.x, Copyright (c) 2004-2008, Marcus Holland-Moritz.
357 Version 2.x, Copyright (C) 2001, Paul Marquess.
359 Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
361 This program is free software; you can redistribute it and/or
362 modify it under the same terms as Perl itself.
364 =head1 SEE ALSO
366 See L<Devel::PPPort>.
368 =cut
370 use strict;
372 # Disable broken TRIE-optimization
373 BEGIN { eval '${^RE_TRIE_MAXBUF} = -1' if $] >= 5.009004 && $] <= 5.009005 }
375 my $VERSION = 3.14_01;
377 my %opt = (
378 quiet => 0,
379 diag => 1,
380 hints => 1,
381 changes => 1,
382 cplusplus => 0,
383 filter => 1,
384 strip => 0,
385 version => 0,
388 my($ppport) = $0 =~ /([\w.]+)$/;
389 my $LF = '(?:\r\n|[\r\n])'; # line feed
390 my $HS = "[ \t]"; # horizontal whitespace
392 # Never use C comments in this file!
393 my $ccs = '/'.'*';
394 my $cce = '*'.'/';
395 my $rccs = quotemeta $ccs;
396 my $rcce = quotemeta $cce;
398 eval {
399 require Getopt::Long;
400 Getopt::Long::GetOptions(\%opt, qw(
401 help quiet diag! filter! hints! changes! cplusplus strip version
402 patch=s copy=s diff=s compat-version=s
403 list-provided list-unsupported api-info=s
404 )) or usage();
407 if ($@ and grep /^-/, @ARGV) {
408 usage() if "@ARGV" =~ /^--?h(?:elp)?$/;
409 die "Getopt::Long not found. Please don't use any options.\n";
412 if ($opt{version}) {
413 print "This is $0 $VERSION.\n";
414 exit 0;
417 usage() if $opt{help};
418 strip() if $opt{strip};
420 if (exists $opt{'compat-version'}) {
421 my($r,$v,$s) = eval { parse_version($opt{'compat-version'}) };
422 if ($@) {
423 die "Invalid version number format: '$opt{'compat-version'}'\n";
425 die "Only Perl 5 is supported\n" if $r != 5;
426 die "Invalid version number: $opt{'compat-version'}\n" if $v >= 1000 || $s >= 1000;
427 $opt{'compat-version'} = sprintf "%d.%03d%03d", $r, $v, $s;
429 else {
430 $opt{'compat-version'} = 5;
433 my %API = map { /^(\w+)\|([^|]*)\|([^|]*)\|(\w*)$/
434 ? ( $1 => {
435 ($2 ? ( base => $2 ) : ()),
436 ($3 ? ( todo => $3 ) : ()),
437 (index($4, 'v') >= 0 ? ( varargs => 1 ) : ()),
438 (index($4, 'p') >= 0 ? ( provided => 1 ) : ()),
439 (index($4, 'n') >= 0 ? ( nothxarg => 1 ) : ()),
441 : die "invalid spec: $_" } qw(
442 AvFILLp|5.004050||p
443 AvFILL|||
444 CLASS|||n
445 CX_CURPAD_SAVE|||
446 CX_CURPAD_SV|||
447 CopFILEAV|5.006000||p
448 CopFILEGV_set|5.006000||p
449 CopFILEGV|5.006000||p
450 CopFILESV|5.006000||p
451 CopFILE_set|5.006000||p
452 CopFILE|5.006000||p
453 CopSTASHPV_set|5.006000||p
454 CopSTASHPV|5.006000||p
455 CopSTASH_eq|5.006000||p
456 CopSTASH_set|5.006000||p
457 CopSTASH|5.006000||p
458 CopyD|5.009002||p
459 Copy|||
460 CvPADLIST|||
461 CvSTASH|||
462 CvWEAKOUTSIDE|||
463 DEFSV|5.004050||p
464 END_EXTERN_C|5.005000||p
465 ENTER|||
466 ERRSV|5.004050||p
467 EXTEND|||
468 EXTERN_C|5.005000||p
469 F0convert|||n
470 FREETMPS|||
471 GIMME_V||5.004000|n
472 GIMME|||n
473 GROK_NUMERIC_RADIX|5.007002||p
474 G_ARRAY|||
475 G_DISCARD|||
476 G_EVAL|||
477 G_NOARGS|||
478 G_SCALAR|||
479 G_VOID||5.004000|
480 GetVars|||
481 GvSV|||
482 Gv_AMupdate|||
483 HEf_SVKEY||5.004000|
484 HeHASH||5.004000|
485 HeKEY||5.004000|
486 HeKLEN||5.004000|
487 HePV||5.004000|
488 HeSVKEY_force||5.004000|
489 HeSVKEY_set||5.004000|
490 HeSVKEY||5.004000|
491 HeUTF8||5.011000|
492 HeVAL||5.004000|
493 HvNAME|||
494 INT2PTR|5.006000||p
495 IN_LOCALE_COMPILETIME|5.007002||p
496 IN_LOCALE_RUNTIME|5.007002||p
497 IN_LOCALE|5.007002||p
498 IN_PERL_COMPILETIME|5.008001||p
499 IS_NUMBER_GREATER_THAN_UV_MAX|5.007002||p
500 IS_NUMBER_INFINITY|5.007002||p
501 IS_NUMBER_IN_UV|5.007002||p
502 IS_NUMBER_NAN|5.007003||p
503 IS_NUMBER_NEG|5.007002||p
504 IS_NUMBER_NOT_INT|5.007002||p
505 IVSIZE|5.006000||p
506 IVTYPE|5.006000||p
507 IVdf|5.006000||p
508 LEAVE|||
509 LVRET|||
510 MARK|||
511 MULTICALL||5.011000|
512 MY_CXT_CLONE|5.009002||p
513 MY_CXT_INIT|5.007003||p
514 MY_CXT|5.007003||p
515 MoveD|5.009002||p
516 Move|||
517 NOOP|5.005000||p
518 NUM2PTR|5.006000||p
519 NVTYPE|5.006000||p
520 NVef|5.006001||p
521 NVff|5.006001||p
522 NVgf|5.006001||p
523 Newxc|5.009003||p
524 Newxz|5.009003||p
525 Newx|5.009003||p
526 Nullav|||
527 Nullch|||
528 Nullcv|||
529 Nullhv|||
530 Nullsv|||
531 ORIGMARK|||
532 PAD_BASE_SV|||
533 PAD_CLONE_VARS|||
534 PAD_COMPNAME_FLAGS|||
535 PAD_COMPNAME_GEN_set|||
536 PAD_COMPNAME_GEN|||
537 PAD_COMPNAME_OURSTASH|||
538 PAD_COMPNAME_PV|||
539 PAD_COMPNAME_TYPE|||
540 PAD_DUP|||
541 PAD_RESTORE_LOCAL|||
542 PAD_SAVE_LOCAL|||
543 PAD_SAVE_SETNULLPAD|||
544 PAD_SETSV|||
545 PAD_SET_CUR_NOSAVE|||
546 PAD_SET_CUR|||
547 PAD_SVl|||
548 PAD_SV|||
549 PERLIO_FUNCS_CAST|5.009003||p
550 PERLIO_FUNCS_DECL|5.009003||p
551 PERL_ABS|5.008001||p
552 PERL_BCDVERSION|5.011000||p
553 PERL_GCC_BRACE_GROUPS_FORBIDDEN|5.008001||p
554 PERL_HASH|5.004000||p
555 PERL_INT_MAX|5.004000||p
556 PERL_INT_MIN|5.004000||p
557 PERL_LONG_MAX|5.004000||p
558 PERL_LONG_MIN|5.004000||p
559 PERL_MAGIC_arylen|5.007002||p
560 PERL_MAGIC_backref|5.007002||p
561 PERL_MAGIC_bm|5.007002||p
562 PERL_MAGIC_collxfrm|5.007002||p
563 PERL_MAGIC_dbfile|5.007002||p
564 PERL_MAGIC_dbline|5.007002||p
565 PERL_MAGIC_defelem|5.007002||p
566 PERL_MAGIC_envelem|5.007002||p
567 PERL_MAGIC_env|5.007002||p
568 PERL_MAGIC_ext|5.007002||p
569 PERL_MAGIC_fm|5.007002||p
570 PERL_MAGIC_glob|5.011000||p
571 PERL_MAGIC_isaelem|5.007002||p
572 PERL_MAGIC_isa|5.007002||p
573 PERL_MAGIC_mutex|5.011000||p
574 PERL_MAGIC_nkeys|5.007002||p
575 PERL_MAGIC_overload_elem|5.007002||p
576 PERL_MAGIC_overload_table|5.007002||p
577 PERL_MAGIC_overload|5.007002||p
578 PERL_MAGIC_pos|5.007002||p
579 PERL_MAGIC_qr|5.007002||p
580 PERL_MAGIC_regdata|5.007002||p
581 PERL_MAGIC_regdatum|5.007002||p
582 PERL_MAGIC_regex_global|5.007002||p
583 PERL_MAGIC_shared_scalar|5.007003||p
584 PERL_MAGIC_shared|5.007003||p
585 PERL_MAGIC_sigelem|5.007002||p
586 PERL_MAGIC_sig|5.007002||p
587 PERL_MAGIC_substr|5.007002||p
588 PERL_MAGIC_sv|5.007002||p
589 PERL_MAGIC_taint|5.007002||p
590 PERL_MAGIC_tiedelem|5.007002||p
591 PERL_MAGIC_tiedscalar|5.007002||p
592 PERL_MAGIC_tied|5.007002||p
593 PERL_MAGIC_utf8|5.008001||p
594 PERL_MAGIC_uvar_elem|5.007003||p
595 PERL_MAGIC_uvar|5.007002||p
596 PERL_MAGIC_vec|5.007002||p
597 PERL_MAGIC_vstring|5.008001||p
598 PERL_QUAD_MAX|5.004000||p
599 PERL_QUAD_MIN|5.004000||p
600 PERL_REVISION|5.006000||p
601 PERL_SCAN_ALLOW_UNDERSCORES|5.007003||p
602 PERL_SCAN_DISALLOW_PREFIX|5.007003||p
603 PERL_SCAN_GREATER_THAN_UV_MAX|5.007003||p
604 PERL_SCAN_SILENT_ILLDIGIT|5.008001||p
605 PERL_SHORT_MAX|5.004000||p
606 PERL_SHORT_MIN|5.004000||p
607 PERL_SIGNALS_UNSAFE_FLAG|5.008001||p
608 PERL_SUBVERSION|5.006000||p
609 PERL_UCHAR_MAX|5.004000||p
610 PERL_UCHAR_MIN|5.004000||p
611 PERL_UINT_MAX|5.004000||p
612 PERL_UINT_MIN|5.004000||p
613 PERL_ULONG_MAX|5.004000||p
614 PERL_ULONG_MIN|5.004000||p
615 PERL_UNUSED_ARG|5.009003||p
616 PERL_UNUSED_CONTEXT|5.009004||p
617 PERL_UNUSED_DECL|5.007002||p
618 PERL_UNUSED_VAR|5.007002||p
619 PERL_UQUAD_MAX|5.004000||p
620 PERL_UQUAD_MIN|5.004000||p
621 PERL_USE_GCC_BRACE_GROUPS|5.009004||p
622 PERL_USHORT_MAX|5.004000||p
623 PERL_USHORT_MIN|5.004000||p
624 PERL_VERSION|5.006000||p
625 PL_DBsignal|5.005000||p
626 PL_DBsingle|||pn
627 PL_DBsub|||pn
628 PL_DBtrace|||pn
629 PL_Sv|5.005000||p
630 PL_compiling|5.004050||p
631 PL_copline|5.011000||p
632 PL_curcop|5.004050||p
633 PL_curstash|5.004050||p
634 PL_debstash|5.004050||p
635 PL_defgv|5.004050||p
636 PL_diehook|5.004050||p
637 PL_dirty|5.004050||p
638 PL_dowarn|||pn
639 PL_errgv|5.004050||p
640 PL_expect|5.011000||p
641 PL_hexdigit|5.005000||p
642 PL_hints|5.005000||p
643 PL_last_in_gv|||n
644 PL_laststatval|5.005000||p
645 PL_modglobal||5.005000|n
646 PL_na|5.004050||pn
647 PL_no_modify|5.006000||p
648 PL_ofs_sv|||n
649 PL_perl_destruct_level|5.004050||p
650 PL_perldb|5.004050||p
651 PL_ppaddr|5.006000||p
652 PL_rsfp_filters|5.004050||p
653 PL_rsfp|5.004050||p
654 PL_rs|||n
655 PL_signals|5.008001||p
656 PL_stack_base|5.004050||p
657 PL_stack_sp|5.004050||p
658 PL_statcache|5.005000||p
659 PL_stdingv|5.004050||p
660 PL_sv_arenaroot|5.004050||p
661 PL_sv_no|5.004050||pn
662 PL_sv_undef|5.004050||pn
663 PL_sv_yes|5.004050||pn
664 PL_tainted|5.004050||p
665 PL_tainting|5.004050||p
666 POP_MULTICALL||5.011000|
667 POPi|||n
668 POPl|||n
669 POPn|||n
670 POPpbytex||5.007001|n
671 POPpx||5.005030|n
672 POPp|||n
673 POPs|||n
674 PTR2IV|5.006000||p
675 PTR2NV|5.006000||p
676 PTR2UV|5.006000||p
677 PTR2ul|5.007001||p
678 PTRV|5.006000||p
679 PUSHMARK|||
680 PUSH_MULTICALL||5.011000|
681 PUSHi|||
682 PUSHmortal|5.009002||p
683 PUSHn|||
684 PUSHp|||
685 PUSHs|||
686 PUSHu|5.004000||p
687 PUTBACK|||
688 PerlIO_clearerr||5.007003|
689 PerlIO_close||5.007003|
690 PerlIO_context_layers||5.009004|
691 PerlIO_eof||5.007003|
692 PerlIO_error||5.007003|
693 PerlIO_fileno||5.007003|
694 PerlIO_fill||5.007003|
695 PerlIO_flush||5.007003|
696 PerlIO_get_base||5.007003|
697 PerlIO_get_bufsiz||5.007003|
698 PerlIO_get_cnt||5.007003|
699 PerlIO_get_ptr||5.007003|
700 PerlIO_read||5.007003|
701 PerlIO_seek||5.007003|
702 PerlIO_set_cnt||5.007003|
703 PerlIO_set_ptrcnt||5.007003|
704 PerlIO_setlinebuf||5.007003|
705 PerlIO_stderr||5.007003|
706 PerlIO_stdin||5.007003|
707 PerlIO_stdout||5.007003|
708 PerlIO_tell||5.007003|
709 PerlIO_unread||5.007003|
710 PerlIO_write||5.007003|
711 Perl_signbit||5.009005|n
712 PoisonFree|5.009004||p
713 PoisonNew|5.009004||p
714 PoisonWith|5.009004||p
715 Poison|5.008000||p
716 RETVAL|||n
717 Renewc|||
718 Renew|||
719 SAVECLEARSV|||
720 SAVECOMPPAD|||
721 SAVEPADSV|||
722 SAVETMPS|||
723 SAVE_DEFSV|5.004050||p
724 SPAGAIN|||
725 SP|||
726 START_EXTERN_C|5.005000||p
727 START_MY_CXT|5.007003||p
728 STMT_END|||p
729 STMT_START|||p
730 STR_WITH_LEN|5.009003||p
731 ST|||
732 SV_CONST_RETURN|5.009003||p
733 SV_COW_DROP_PV|5.008001||p
734 SV_COW_SHARED_HASH_KEYS|5.009005||p
735 SV_GMAGIC|5.007002||p
736 SV_HAS_TRAILING_NUL|5.009004||p
737 SV_IMMEDIATE_UNREF|5.007001||p
738 SV_MUTABLE_RETURN|5.009003||p
739 SV_NOSTEAL|5.009002||p
740 SV_SMAGIC|5.009003||p
741 SV_UTF8_NO_ENCODING|5.008001||p
742 SVf_UTF8|5.006000||p
743 SVf|5.006000||p
744 SVt_IV|||
745 SVt_NV|||
746 SVt_PVAV|||
747 SVt_PVCV|||
748 SVt_PVHV|||
749 SVt_PVMG|||
750 SVt_PV|||
751 Safefree|||
752 Slab_Alloc|||
753 Slab_Free|||
754 Slab_to_rw|||
755 StructCopy|||
756 SvCUR_set|||
757 SvCUR|||
758 SvEND|||
759 SvGAMAGIC||5.006001|
760 SvGETMAGIC|5.004050||p
761 SvGROW|||
762 SvIOK_UV||5.006000|
763 SvIOK_notUV||5.006000|
764 SvIOK_off|||
765 SvIOK_only_UV||5.006000|
766 SvIOK_only|||
767 SvIOK_on|||
768 SvIOKp|||
769 SvIOK|||
770 SvIVX|||
771 SvIV_nomg|5.009001||p
772 SvIV_set|||
773 SvIVx|||
774 SvIV|||
775 SvIsCOW_shared_hash||5.008003|
776 SvIsCOW||5.008003|
777 SvLEN_set|||
778 SvLEN|||
779 SvLOCK||5.007003|
780 SvMAGIC_set|5.009003||p
781 SvNIOK_off|||
782 SvNIOKp|||
783 SvNIOK|||
784 SvNOK_off|||
785 SvNOK_only|||
786 SvNOK_on|||
787 SvNOKp|||
788 SvNOK|||
789 SvNVX|||
790 SvNV_set|||
791 SvNVx|||
792 SvNV|||
793 SvOK|||
794 SvOOK_offset||5.011000|
795 SvOOK|||
796 SvPOK_off|||
797 SvPOK_only_UTF8||5.006000|
798 SvPOK_only|||
799 SvPOK_on|||
800 SvPOKp|||
801 SvPOK|||
802 SvPVX_const|5.009003||p
803 SvPVX_mutable|5.009003||p
804 SvPVX|||
805 SvPV_const|5.009003||p
806 SvPV_flags_const_nolen|5.009003||p
807 SvPV_flags_const|5.009003||p
808 SvPV_flags_mutable|5.009003||p
809 SvPV_flags|5.007002||p
810 SvPV_force_flags_mutable|5.009003||p
811 SvPV_force_flags_nolen|5.009003||p
812 SvPV_force_flags|5.007002||p
813 SvPV_force_mutable|5.009003||p
814 SvPV_force_nolen|5.009003||p
815 SvPV_force_nomg_nolen|5.009003||p
816 SvPV_force_nomg|5.007002||p
817 SvPV_force|||p
818 SvPV_mutable|5.009003||p
819 SvPV_nolen_const|5.009003||p
820 SvPV_nolen|5.006000||p
821 SvPV_nomg_const_nolen|5.009003||p
822 SvPV_nomg_const|5.009003||p
823 SvPV_nomg|5.007002||p
824 SvPV_set|||
825 SvPVbyte_force||5.009002|
826 SvPVbyte_nolen||5.006000|
827 SvPVbytex_force||5.006000|
828 SvPVbytex||5.006000|
829 SvPVbyte|5.006000||p
830 SvPVutf8_force||5.006000|
831 SvPVutf8_nolen||5.006000|
832 SvPVutf8x_force||5.006000|
833 SvPVutf8x||5.006000|
834 SvPVutf8||5.006000|
835 SvPVx|||
836 SvPV|||
837 SvREFCNT_dec|||
838 SvREFCNT_inc_NN|5.009004||p
839 SvREFCNT_inc_simple_NN|5.009004||p
840 SvREFCNT_inc_simple_void_NN|5.009004||p
841 SvREFCNT_inc_simple_void|5.009004||p
842 SvREFCNT_inc_simple|5.009004||p
843 SvREFCNT_inc_void_NN|5.009004||p
844 SvREFCNT_inc_void|5.009004||p
845 SvREFCNT_inc|||p
846 SvREFCNT|||
847 SvROK_off|||
848 SvROK_on|||
849 SvROK|||
850 SvRV_set|5.009003||p
851 SvRV|||
852 SvRXOK||5.009005|
853 SvRX||5.009005|
854 SvSETMAGIC|||
855 SvSHARED_HASH|5.009003||p
856 SvSHARE||5.007003|
857 SvSTASH_set|5.009003||p
858 SvSTASH|||
859 SvSetMagicSV_nosteal||5.004000|
860 SvSetMagicSV||5.004000|
861 SvSetSV_nosteal||5.004000|
862 SvSetSV|||
863 SvTAINTED_off||5.004000|
864 SvTAINTED_on||5.004000|
865 SvTAINTED||5.004000|
866 SvTAINT|||
867 SvTRUE|||
868 SvTYPE|||
869 SvUNLOCK||5.007003|
870 SvUOK|5.007001|5.006000|p
871 SvUPGRADE|||
872 SvUTF8_off||5.006000|
873 SvUTF8_on||5.006000|
874 SvUTF8||5.006000|
875 SvUVXx|5.004000||p
876 SvUVX|5.004000||p
877 SvUV_nomg|5.009001||p
878 SvUV_set|5.009003||p
879 SvUVx|5.004000||p
880 SvUV|5.004000||p
881 SvVOK||5.008001|
882 SvVSTRING_mg|5.009004||p
883 THIS|||n
884 UNDERBAR|5.009002||p
885 UTF8_MAXBYTES|5.009002||p
886 UVSIZE|5.006000||p
887 UVTYPE|5.006000||p
888 UVXf|5.007001||p
889 UVof|5.006000||p
890 UVuf|5.006000||p
891 UVxf|5.006000||p
892 WARN_ALL|5.006000||p
893 WARN_AMBIGUOUS|5.006000||p
894 WARN_ASSERTIONS|5.011000||p
895 WARN_BAREWORD|5.006000||p
896 WARN_CLOSED|5.006000||p
897 WARN_CLOSURE|5.006000||p
898 WARN_DEBUGGING|5.006000||p
899 WARN_DEPRECATED|5.006000||p
900 WARN_DIGIT|5.006000||p
901 WARN_EXEC|5.006000||p
902 WARN_EXITING|5.006000||p
903 WARN_GLOB|5.006000||p
904 WARN_INPLACE|5.006000||p
905 WARN_INTERNAL|5.006000||p
906 WARN_IO|5.006000||p
907 WARN_LAYER|5.008000||p
908 WARN_MALLOC|5.006000||p
909 WARN_MISC|5.006000||p
910 WARN_NEWLINE|5.006000||p
911 WARN_NUMERIC|5.006000||p
912 WARN_ONCE|5.006000||p
913 WARN_OVERFLOW|5.006000||p
914 WARN_PACK|5.006000||p
915 WARN_PARENTHESIS|5.006000||p
916 WARN_PIPE|5.006000||p
917 WARN_PORTABLE|5.006000||p
918 WARN_PRECEDENCE|5.006000||p
919 WARN_PRINTF|5.006000||p
920 WARN_PROTOTYPE|5.006000||p
921 WARN_QW|5.006000||p
922 WARN_RECURSION|5.006000||p
923 WARN_REDEFINE|5.006000||p
924 WARN_REGEXP|5.006000||p
925 WARN_RESERVED|5.006000||p
926 WARN_SEMICOLON|5.006000||p
927 WARN_SEVERE|5.006000||p
928 WARN_SIGNAL|5.006000||p
929 WARN_SUBSTR|5.006000||p
930 WARN_SYNTAX|5.006000||p
931 WARN_TAINT|5.006000||p
932 WARN_THREADS|5.008000||p
933 WARN_UNINITIALIZED|5.006000||p
934 WARN_UNOPENED|5.006000||p
935 WARN_UNPACK|5.006000||p
936 WARN_UNTIE|5.006000||p
937 WARN_UTF8|5.006000||p
938 WARN_VOID|5.006000||p
939 XCPT_CATCH|5.009002||p
940 XCPT_RETHROW|5.009002||p
941 XCPT_TRY_END|5.009002||p
942 XCPT_TRY_START|5.009002||p
943 XPUSHi|||
944 XPUSHmortal|5.009002||p
945 XPUSHn|||
946 XPUSHp|||
947 XPUSHs|||
948 XPUSHu|5.004000||p
949 XSRETURN_EMPTY|||
950 XSRETURN_IV|||
951 XSRETURN_NO|||
952 XSRETURN_NV|||
953 XSRETURN_PV|||
954 XSRETURN_UNDEF|||
955 XSRETURN_UV|5.008001||p
956 XSRETURN_YES|||
957 XSRETURN|||p
958 XST_mIV|||
959 XST_mNO|||
960 XST_mNV|||
961 XST_mPV|||
962 XST_mUNDEF|||
963 XST_mUV|5.008001||p
964 XST_mYES|||
965 XS_VERSION_BOOTCHECK|||
966 XS_VERSION|||
967 XSprePUSH|5.006000||p
968 XS|||
969 ZeroD|5.009002||p
970 Zero|||
971 _aMY_CXT|5.007003||p
972 _pMY_CXT|5.007003||p
973 aMY_CXT_|5.007003||p
974 aMY_CXT|5.007003||p
975 aTHXR_|5.011000||p
976 aTHXR|5.011000||p
977 aTHX_|5.006000||p
978 aTHX|5.006000||p
979 add_data|||n
980 addmad|||
981 allocmy|||
982 amagic_call|||
983 amagic_cmp_locale|||
984 amagic_cmp|||
985 amagic_i_ncmp|||
986 amagic_ncmp|||
987 any_dup|||
988 ao|||
989 append_elem|||
990 append_list|||
991 append_madprops|||
992 apply_attrs_my|||
993 apply_attrs_string||5.006001|
994 apply_attrs|||
995 apply|||
996 atfork_lock||5.007003|n
997 atfork_unlock||5.007003|n
998 av_arylen_p||5.009003|
999 av_clear|||
1000 av_create_and_push||5.009005|
1001 av_create_and_unshift_one||5.009005|
1002 av_delete||5.006000|
1003 av_exists||5.006000|
1004 av_extend|||
1005 av_fake|||
1006 av_fetch|||
1007 av_fill|||
1008 av_iter_p||5.011000|
1009 av_len|||
1010 av_make|||
1011 av_pop|||
1012 av_push|||
1013 av_reify|||
1014 av_shift|||
1015 av_store|||
1016 av_undef|||
1017 av_unshift|||
1018 ax|||n
1019 bad_type|||
1020 bind_match|||
1021 block_end|||
1022 block_gimme||5.004000|
1023 block_start|||
1024 boolSV|5.004000||p
1025 boot_core_PerlIO|||
1026 boot_core_UNIVERSAL|||
1027 boot_core_mro|||
1028 boot_core_xsutils|||
1029 bytes_from_utf8||5.007001|
1030 bytes_to_uni|||n
1031 bytes_to_utf8||5.006001|
1032 call_argv|5.006000||p
1033 call_atexit||5.006000|
1034 call_list||5.004000|
1035 call_method|5.006000||p
1036 call_pv|5.006000||p
1037 call_sv|5.006000||p
1038 calloc||5.007002|n
1039 cando|||
1040 cast_i32||5.006000|
1041 cast_iv||5.006000|
1042 cast_ulong||5.006000|
1043 cast_uv||5.006000|
1044 check_type_and_open|||
1045 check_uni|||
1046 checkcomma|||
1047 checkposixcc|||
1048 ckWARN|5.006000||p
1049 ck_anoncode|||
1050 ck_bitop|||
1051 ck_concat|||
1052 ck_defined|||
1053 ck_delete|||
1054 ck_die|||
1055 ck_each|||
1056 ck_eof|||
1057 ck_eval|||
1058 ck_exec|||
1059 ck_exists|||
1060 ck_exit|||
1061 ck_ftst|||
1062 ck_fun|||
1063 ck_glob|||
1064 ck_grep|||
1065 ck_index|||
1066 ck_join|||
1067 ck_lfun|||
1068 ck_listiob|||
1069 ck_match|||
1070 ck_method|||
1071 ck_null|||
1072 ck_open|||
1073 ck_readline|||
1074 ck_repeat|||
1075 ck_require|||
1076 ck_return|||
1077 ck_rfun|||
1078 ck_rvconst|||
1079 ck_sassign|||
1080 ck_select|||
1081 ck_shift|||
1082 ck_sort|||
1083 ck_spair|||
1084 ck_split|||
1085 ck_subr|||
1086 ck_substr|||
1087 ck_svconst|||
1088 ck_trunc|||
1089 ck_unpack|||
1090 ckwarn_d||5.009003|
1091 ckwarn||5.009003|
1092 cl_and|||n
1093 cl_anything|||n
1094 cl_init_zero|||n
1095 cl_init|||n
1096 cl_is_anything|||n
1097 cl_or|||n
1098 clear_placeholders|||
1099 closest_cop|||
1100 convert|||
1101 cop_free|||
1102 cr_textfilter|||
1103 create_eval_scope|||
1104 croak_nocontext|||vn
1105 croak_xs_usage||5.011000|
1106 croak|||v
1107 csighandler||5.009003|n
1108 curmad|||
1109 custom_op_desc||5.007003|
1110 custom_op_name||5.007003|
1111 cv_ckproto_len|||
1112 cv_ckproto|||
1113 cv_clone|||
1114 cv_const_sv||5.004000|
1115 cv_dump|||
1116 cv_undef|||
1117 cx_dump||5.005000|
1118 cx_dup|||
1119 cxinc|||
1120 dAXMARK|5.009003||p
1121 dAX|5.007002||p
1122 dITEMS|5.007002||p
1123 dMARK|||
1124 dMULTICALL||5.009003|
1125 dMY_CXT_SV|5.007003||p
1126 dMY_CXT|5.007003||p
1127 dNOOP|5.006000||p
1128 dORIGMARK|||
1129 dSP|||
1130 dTHR|5.004050||p
1131 dTHXR|5.011000||p
1132 dTHXa|5.006000||p
1133 dTHXoa|5.006000||p
1134 dTHX|5.006000||p
1135 dUNDERBAR|5.009002||p
1136 dVAR|5.009003||p
1137 dXCPT|5.009002||p
1138 dXSARGS|||
1139 dXSI32|||
1140 dXSTARG|5.006000||p
1141 deb_curcv|||
1142 deb_nocontext|||vn
1143 deb_stack_all|||
1144 deb_stack_n|||
1145 debop||5.005000|
1146 debprofdump||5.005000|
1147 debprof|||
1148 debstackptrs||5.007003|
1149 debstack||5.007003|
1150 debug_start_match|||
1151 deb||5.007003|v
1152 del_sv|||
1153 delete_eval_scope|||
1154 delimcpy||5.004000|
1155 deprecate_old|||
1156 deprecate|||
1157 despatch_signals||5.007001|
1158 destroy_matcher|||
1159 die_nocontext|||vn
1160 die_where|||
1161 die|||v
1162 dirp_dup|||
1163 div128|||
1164 djSP|||
1165 do_aexec5|||
1166 do_aexec|||
1167 do_aspawn|||
1168 do_binmode||5.004050|
1169 do_chomp|||
1170 do_chop|||
1171 do_close|||
1172 do_dump_pad|||
1173 do_eof|||
1174 do_exec3|||
1175 do_execfree|||
1176 do_exec|||
1177 do_gv_dump||5.006000|
1178 do_gvgv_dump||5.006000|
1179 do_hv_dump||5.006000|
1180 do_ipcctl|||
1181 do_ipcget|||
1182 do_join|||
1183 do_kv|||
1184 do_magic_dump||5.006000|
1185 do_msgrcv|||
1186 do_msgsnd|||
1187 do_oddball|||
1188 do_op_dump||5.006000|
1189 do_op_xmldump|||
1190 do_open9||5.006000|
1191 do_openn||5.007001|
1192 do_open||5.004000|
1193 do_pmop_dump||5.006000|
1194 do_pmop_xmldump|||
1195 do_print|||
1196 do_readline|||
1197 do_seek|||
1198 do_semop|||
1199 do_shmio|||
1200 do_smartmatch|||
1201 do_spawn_nowait|||
1202 do_spawn|||
1203 do_sprintf|||
1204 do_sv_dump||5.006000|
1205 do_sysseek|||
1206 do_tell|||
1207 do_trans_complex_utf8|||
1208 do_trans_complex|||
1209 do_trans_count_utf8|||
1210 do_trans_count|||
1211 do_trans_simple_utf8|||
1212 do_trans_simple|||
1213 do_trans|||
1214 do_vecget|||
1215 do_vecset|||
1216 do_vop|||
1217 docatch|||
1218 doeval|||
1219 dofile|||
1220 dofindlabel|||
1221 doform|||
1222 doing_taint||5.008001|n
1223 dooneliner|||
1224 doopen_pm|||
1225 doparseform|||
1226 dopoptoeval|||
1227 dopoptogiven|||
1228 dopoptolabel|||
1229 dopoptoloop|||
1230 dopoptosub_at|||
1231 dopoptowhen|||
1232 doref||5.009003|
1233 dounwind|||
1234 dowantarray|||
1235 dump_all||5.006000|
1236 dump_eval||5.006000|
1237 dump_exec_pos|||
1238 dump_fds|||
1239 dump_form||5.006000|
1240 dump_indent||5.006000|v
1241 dump_mstats|||
1242 dump_packsubs||5.006000|
1243 dump_sub||5.006000|
1244 dump_sv_child|||
1245 dump_trie_interim_list|||
1246 dump_trie_interim_table|||
1247 dump_trie|||
1248 dump_vindent||5.006000|
1249 dumpuntil|||
1250 dup_attrlist|||
1251 emulate_cop_io|||
1252 eval_pv|5.006000||p
1253 eval_sv|5.006000||p
1254 exec_failed|||
1255 expect_number|||
1256 fbm_compile||5.005000|
1257 fbm_instr||5.005000|
1258 fd_on_nosuid_fs|||
1259 feature_is_enabled|||
1260 fetch_cop_label||5.011000|
1261 filter_add|||
1262 filter_del|||
1263 filter_gets|||
1264 filter_read|||
1265 find_and_forget_pmops|||
1266 find_array_subscript|||
1267 find_beginning|||
1268 find_byclass|||
1269 find_hash_subscript|||
1270 find_in_my_stash|||
1271 find_runcv||5.008001|
1272 find_rundefsvoffset||5.009002|
1273 find_script|||
1274 find_uninit_var|||
1275 first_symbol|||n
1276 fold_constants|||
1277 forbid_setid|||
1278 force_ident|||
1279 force_list|||
1280 force_next|||
1281 force_version|||
1282 force_word|||
1283 forget_pmop|||
1284 form_nocontext|||vn
1285 form||5.004000|v
1286 fp_dup|||
1287 fprintf_nocontext|||vn
1288 free_global_struct|||
1289 free_tied_hv_pool|||
1290 free_tmps|||
1291 gen_constant_list|||
1292 get_arena|||
1293 get_aux_mg|||
1294 get_av|5.006000||p
1295 get_context||5.006000|n
1296 get_cvn_flags||5.009005|
1297 get_cv|5.006000||p
1298 get_db_sub|||
1299 get_debug_opts|||
1300 get_hash_seed|||
1301 get_hv|5.006000||p
1302 get_mstats|||
1303 get_no_modify|||
1304 get_num|||
1305 get_op_descs||5.005000|
1306 get_op_names||5.005000|
1307 get_opargs|||
1308 get_ppaddr||5.006000|
1309 get_re_arg|||
1310 get_sv|5.006000||p
1311 get_vtbl||5.005030|
1312 getcwd_sv||5.007002|
1313 getenv_len|||
1314 glob_2number|||
1315 glob_2pv|||
1316 glob_assign_glob|||
1317 glob_assign_ref|||
1318 gp_dup|||
1319 gp_free|||
1320 gp_ref|||
1321 grok_bin|5.007003||p
1322 grok_hex|5.007003||p
1323 grok_number|5.007002||p
1324 grok_numeric_radix|5.007002||p
1325 grok_oct|5.007003||p
1326 group_end|||
1327 gv_AVadd|||
1328 gv_HVadd|||
1329 gv_IOadd|||
1330 gv_SVadd|||
1331 gv_autoload4||5.004000|
1332 gv_check|||
1333 gv_const_sv||5.009003|
1334 gv_dump||5.006000|
1335 gv_efullname3||5.004000|
1336 gv_efullname4||5.006001|
1337 gv_efullname|||
1338 gv_ename|||
1339 gv_fetchfile_flags||5.009005|
1340 gv_fetchfile|||
1341 gv_fetchmeth_autoload||5.007003|
1342 gv_fetchmethod_autoload||5.004000|
1343 gv_fetchmethod_flags||5.011000|
1344 gv_fetchmethod|||
1345 gv_fetchmeth|||
1346 gv_fetchpvn_flags||5.009002|
1347 gv_fetchpv|||
1348 gv_fetchsv||5.009002|
1349 gv_fullname3||5.004000|
1350 gv_fullname4||5.006001|
1351 gv_fullname|||
1352 gv_get_super_pkg|||
1353 gv_handler||5.007001|
1354 gv_init_sv|||
1355 gv_init|||
1356 gv_name_set||5.009004|
1357 gv_stashpvn|5.004000||p
1358 gv_stashpvs||5.009003|
1359 gv_stashpv|||
1360 gv_stashsv|||
1361 he_dup|||
1362 hek_dup|||
1363 hfreeentries|||
1364 hsplit|||
1365 hv_assert||5.011000|
1366 hv_auxinit|||n
1367 hv_backreferences_p|||
1368 hv_clear_placeholders||5.009001|
1369 hv_clear|||
1370 hv_common_key_len||5.010000|
1371 hv_common||5.010000|
1372 hv_copy_hints_hv|||
1373 hv_delayfree_ent||5.004000|
1374 hv_delete_common|||
1375 hv_delete_ent||5.004000|
1376 hv_delete|||
1377 hv_eiter_p||5.009003|
1378 hv_eiter_set||5.009003|
1379 hv_exists_ent||5.004000|
1380 hv_exists|||
1381 hv_fetch_ent||5.004000|
1382 hv_fetchs|5.009003||p
1383 hv_fetch|||
1384 hv_free_ent||5.004000|
1385 hv_iterinit|||
1386 hv_iterkeysv||5.004000|
1387 hv_iterkey|||
1388 hv_iternext_flags||5.008000|
1389 hv_iternextsv|||
1390 hv_iternext|||
1391 hv_iterval|||
1392 hv_kill_backrefs|||
1393 hv_ksplit||5.004000|
1394 hv_magic_check|||n
1395 hv_magic|||
1396 hv_name_set||5.009003|
1397 hv_notallowed|||
1398 hv_placeholders_get||5.009003|
1399 hv_placeholders_p||5.009003|
1400 hv_placeholders_set||5.009003|
1401 hv_riter_p||5.009003|
1402 hv_riter_set||5.009003|
1403 hv_scalar||5.009001|
1404 hv_store_ent||5.004000|
1405 hv_store_flags||5.008000|
1406 hv_stores|5.009004||p
1407 hv_store|||
1408 hv_undef|||
1409 ibcmp_locale||5.004000|
1410 ibcmp_utf8||5.007003|
1411 ibcmp|||
1412 incline|||
1413 incpush_if_exists|||
1414 incpush|||
1415 ingroup|||
1416 init_argv_symbols|||
1417 init_debugger|||
1418 init_global_struct|||
1419 init_i18nl10n||5.006000|
1420 init_i18nl14n||5.006000|
1421 init_ids|||
1422 init_interp|||
1423 init_main_stash|||
1424 init_perllib|||
1425 init_postdump_symbols|||
1426 init_predump_symbols|||
1427 init_stacks||5.005000|
1428 init_tm||5.007002|
1429 instr|||
1430 intro_my|||
1431 intuit_method|||
1432 intuit_more|||
1433 invert|||
1434 io_close|||
1435 isALNUM|||
1436 isALPHA|||
1437 isDIGIT|||
1438 isLOWER|||
1439 isSPACE|||
1440 isUPPER|||
1441 is_an_int|||
1442 is_gv_magical_sv|||
1443 is_gv_magical|||
1444 is_handle_constructor|||n
1445 is_list_assignment|||
1446 is_lvalue_sub||5.007001|
1447 is_uni_alnum_lc||5.006000|
1448 is_uni_alnumc_lc||5.006000|
1449 is_uni_alnumc||5.006000|
1450 is_uni_alnum||5.006000|
1451 is_uni_alpha_lc||5.006000|
1452 is_uni_alpha||5.006000|
1453 is_uni_ascii_lc||5.006000|
1454 is_uni_ascii||5.006000|
1455 is_uni_cntrl_lc||5.006000|
1456 is_uni_cntrl||5.006000|
1457 is_uni_digit_lc||5.006000|
1458 is_uni_digit||5.006000|
1459 is_uni_graph_lc||5.006000|
1460 is_uni_graph||5.006000|
1461 is_uni_idfirst_lc||5.006000|
1462 is_uni_idfirst||5.006000|
1463 is_uni_lower_lc||5.006000|
1464 is_uni_lower||5.006000|
1465 is_uni_print_lc||5.006000|
1466 is_uni_print||5.006000|
1467 is_uni_punct_lc||5.006000|
1468 is_uni_punct||5.006000|
1469 is_uni_space_lc||5.006000|
1470 is_uni_space||5.006000|
1471 is_uni_upper_lc||5.006000|
1472 is_uni_upper||5.006000|
1473 is_uni_xdigit_lc||5.006000|
1474 is_uni_xdigit||5.006000|
1475 is_utf8_alnumc||5.006000|
1476 is_utf8_alnum||5.006000|
1477 is_utf8_alpha||5.006000|
1478 is_utf8_ascii||5.006000|
1479 is_utf8_char_slow|||n
1480 is_utf8_char||5.006000|
1481 is_utf8_cntrl||5.006000|
1482 is_utf8_common|||
1483 is_utf8_digit||5.006000|
1484 is_utf8_graph||5.006000|
1485 is_utf8_idcont||5.008000|
1486 is_utf8_idfirst||5.006000|
1487 is_utf8_lower||5.006000|
1488 is_utf8_mark||5.006000|
1489 is_utf8_print||5.006000|
1490 is_utf8_punct||5.006000|
1491 is_utf8_space||5.006000|
1492 is_utf8_string_loclen||5.009003|
1493 is_utf8_string_loc||5.008001|
1494 is_utf8_string||5.006001|
1495 is_utf8_upper||5.006000|
1496 is_utf8_xdigit||5.006000|
1497 isa_lookup|||
1498 items|||n
1499 ix|||n
1500 jmaybe|||
1501 join_exact|||
1502 keyword|||
1503 leave_scope|||
1504 lex_end|||
1505 lex_start|||
1506 linklist|||
1507 listkids|||
1508 list|||
1509 load_module_nocontext|||vn
1510 load_module|5.006000||pv
1511 localize|||
1512 looks_like_bool|||
1513 looks_like_number|||
1514 lop|||
1515 mPUSHi|5.009002||p
1516 mPUSHn|5.009002||p
1517 mPUSHp|5.009002||p
1518 mPUSHs|5.011000||p
1519 mPUSHu|5.009002||p
1520 mXPUSHi|5.009002||p
1521 mXPUSHn|5.009002||p
1522 mXPUSHp|5.009002||p
1523 mXPUSHs|5.011000||p
1524 mXPUSHu|5.009002||p
1525 mad_free|||
1526 madlex|||
1527 madparse|||
1528 magic_clear_all_env|||
1529 magic_clearenv|||
1530 magic_clearhint|||
1531 magic_clearisa|||
1532 magic_clearpack|||
1533 magic_clearsig|||
1534 magic_dump||5.006000|
1535 magic_existspack|||
1536 magic_freearylen_p|||
1537 magic_freeovrld|||
1538 magic_getarylen|||
1539 magic_getdefelem|||
1540 magic_getnkeys|||
1541 magic_getpack|||
1542 magic_getpos|||
1543 magic_getsig|||
1544 magic_getsubstr|||
1545 magic_gettaint|||
1546 magic_getuvar|||
1547 magic_getvec|||
1548 magic_get|||
1549 magic_killbackrefs|||
1550 magic_len|||
1551 magic_methcall|||
1552 magic_methpack|||
1553 magic_nextpack|||
1554 magic_regdata_cnt|||
1555 magic_regdatum_get|||
1556 magic_regdatum_set|||
1557 magic_scalarpack|||
1558 magic_set_all_env|||
1559 magic_setamagic|||
1560 magic_setarylen|||
1561 magic_setcollxfrm|||
1562 magic_setdbline|||
1563 magic_setdefelem|||
1564 magic_setenv|||
1565 magic_sethint|||
1566 magic_setisa|||
1567 magic_setmglob|||
1568 magic_setnkeys|||
1569 magic_setpack|||
1570 magic_setpos|||
1571 magic_setregexp|||
1572 magic_setsig|||
1573 magic_setsubstr|||
1574 magic_settaint|||
1575 magic_setutf8|||
1576 magic_setuvar|||
1577 magic_setvec|||
1578 magic_set|||
1579 magic_sizepack|||
1580 magic_wipepack|||
1581 magicname|||
1582 make_matcher|||
1583 make_trie_failtable|||
1584 make_trie|||
1585 malloc_good_size|||n
1586 malloced_size|||n
1587 malloc||5.007002|n
1588 markstack_grow|||
1589 matcher_matches_sv|||
1590 measure_struct|||
1591 memEQ|5.004000||p
1592 memNE|5.004000||p
1593 mem_collxfrm|||
1594 mess_alloc|||
1595 mess_nocontext|||vn
1596 mess||5.006000|v
1597 method_common|||
1598 mfree||5.007002|n
1599 mg_clear|||
1600 mg_copy|||
1601 mg_dup|||
1602 mg_find|||
1603 mg_free|||
1604 mg_get|||
1605 mg_length||5.005000|
1606 mg_localize|||
1607 mg_magical|||
1608 mg_set|||
1609 mg_size||5.005000|
1610 mini_mktime||5.007002|
1611 missingterm|||
1612 mode_from_discipline|||
1613 modkids|||
1614 mod|||
1615 more_bodies|||
1616 more_sv|||
1617 moreswitches|||
1618 mro_get_linear_isa_c3|||
1619 mro_get_linear_isa_dfs|||
1620 mro_get_linear_isa||5.009005|
1621 mro_isa_changed_in|||
1622 mro_meta_dup|||
1623 mro_meta_init|||
1624 mro_method_changed_in||5.009005|
1625 mul128|||
1626 mulexp10|||n
1627 my_atof2||5.007002|
1628 my_atof||5.006000|
1629 my_attrs|||
1630 my_bcopy|||n
1631 my_betoh16|||n
1632 my_betoh32|||n
1633 my_betoh64|||n
1634 my_betohi|||n
1635 my_betohl|||n
1636 my_betohs|||n
1637 my_bzero|||n
1638 my_chsize|||
1639 my_clearenv|||
1640 my_cxt_index|||
1641 my_cxt_init|||
1642 my_dirfd||5.009005|
1643 my_exit_jump|||
1644 my_exit|||
1645 my_failure_exit||5.004000|
1646 my_fflush_all||5.006000|
1647 my_fork||5.007003|n
1648 my_htobe16|||n
1649 my_htobe32|||n
1650 my_htobe64|||n
1651 my_htobei|||n
1652 my_htobel|||n
1653 my_htobes|||n
1654 my_htole16|||n
1655 my_htole32|||n
1656 my_htole64|||n
1657 my_htolei|||n
1658 my_htolel|||n
1659 my_htoles|||n
1660 my_htonl|||
1661 my_kid|||
1662 my_letoh16|||n
1663 my_letoh32|||n
1664 my_letoh64|||n
1665 my_letohi|||n
1666 my_letohl|||n
1667 my_letohs|||n
1668 my_lstat|||
1669 my_memcmp||5.004000|n
1670 my_memset|||n
1671 my_ntohl|||
1672 my_pclose||5.004000|
1673 my_popen_list||5.007001|
1674 my_popen||5.004000|
1675 my_setenv|||
1676 my_snprintf|5.009004||pvn
1677 my_socketpair||5.007003|n
1678 my_sprintf||5.009003|vn
1679 my_stat|||
1680 my_strftime||5.007002|
1681 my_strlcat|5.009004||pn
1682 my_strlcpy|5.009004||pn
1683 my_swabn|||n
1684 my_swap|||
1685 my_unexec|||
1686 my_vsnprintf||5.009004|n
1687 my|||
1688 need_utf8|||n
1689 newANONATTRSUB||5.006000|
1690 newANONHASH|||
1691 newANONLIST|||
1692 newANONSUB|||
1693 newASSIGNOP|||
1694 newATTRSUB||5.006000|
1695 newAVREF|||
1696 newAV|||
1697 newBINOP|||
1698 newCONDOP|||
1699 newCONSTSUB|5.004050||p
1700 newCVREF|||
1701 newDEFSVOP|||
1702 newFORM|||
1703 newFOROP|||
1704 newGIVENOP||5.009003|
1705 newGIVWHENOP|||
1706 newGP|||
1707 newGVOP|||
1708 newGVREF|||
1709 newGVgen|||
1710 newHVREF|||
1711 newHVhv||5.005000|
1712 newHV|||
1713 newIO|||
1714 newLISTOP|||
1715 newLOGOP|||
1716 newLOOPEX|||
1717 newLOOPOP|||
1718 newMADPROP|||
1719 newMADsv|||
1720 newMYSUB|||
1721 newNULLLIST|||
1722 newOP|||
1723 newPADOP|||
1724 newPMOP|||
1725 newPROG|||
1726 newPVOP|||
1727 newRANGE|||
1728 newRV_inc|5.004000||p
1729 newRV_noinc|5.004000||p
1730 newRV|||
1731 newSLICEOP|||
1732 newSTATEOP|||
1733 newSUB|||
1734 newSVOP|||
1735 newSVREF|||
1736 newSV_type||5.009005|
1737 newSVhek||5.009003|
1738 newSViv|||
1739 newSVnv|||
1740 newSVpvf_nocontext|||vn
1741 newSVpvf||5.004000|v
1742 newSVpvn_flags|5.011000||p
1743 newSVpvn_share|5.007001||p
1744 newSVpvn_utf8|5.011000||p
1745 newSVpvn|5.004050||p
1746 newSVpvs_flags|5.011000||p
1747 newSVpvs_share||5.009003|
1748 newSVpvs|5.009003||p
1749 newSVpv|||
1750 newSVrv|||
1751 newSVsv|||
1752 newSVuv|5.006000||p
1753 newSV|||
1754 newTOKEN|||
1755 newUNOP|||
1756 newWHENOP||5.009003|
1757 newWHILEOP||5.009003|
1758 newXS_flags||5.009004|
1759 newXSproto||5.006000|
1760 newXS||5.006000|
1761 new_collate||5.006000|
1762 new_constant|||
1763 new_ctype||5.006000|
1764 new_he|||
1765 new_logop|||
1766 new_numeric||5.006000|
1767 new_stackinfo||5.005000|
1768 new_version||5.009000|
1769 new_warnings_bitfield|||
1770 next_symbol|||
1771 nextargv|||
1772 nextchar|||
1773 ninstr|||
1774 no_bareword_allowed|||
1775 no_fh_allowed|||
1776 no_op|||
1777 not_a_number|||
1778 nothreadhook||5.008000|
1779 nuke_stacks|||
1780 num_overflow|||n
1781 offer_nice_chunk|||
1782 oopsAV|||
1783 oopsCV|||
1784 oopsHV|||
1785 op_clear|||
1786 op_const_sv|||
1787 op_dump||5.006000|
1788 op_free|||
1789 op_getmad_weak|||
1790 op_getmad|||
1791 op_null||5.007002|
1792 op_refcnt_dec|||
1793 op_refcnt_inc|||
1794 op_refcnt_lock||5.009002|
1795 op_refcnt_unlock||5.009002|
1796 op_xmldump|||
1797 open_script|||
1798 pMY_CXT_|5.007003||p
1799 pMY_CXT|5.007003||p
1800 pTHX_|5.006000||p
1801 pTHX|5.006000||p
1802 packWARN|5.007003||p
1803 pack_cat||5.007003|
1804 pack_rec|||
1805 package|||
1806 packlist||5.008001|
1807 pad_add_anon|||
1808 pad_add_name|||
1809 pad_alloc|||
1810 pad_block_start|||
1811 pad_check_dup|||
1812 pad_compname_type|||
1813 pad_findlex|||
1814 pad_findmy|||
1815 pad_fixup_inner_anons|||
1816 pad_free|||
1817 pad_leavemy|||
1818 pad_new|||
1819 pad_peg|||n
1820 pad_push|||
1821 pad_reset|||
1822 pad_setsv|||
1823 pad_sv||5.011000|
1824 pad_swipe|||
1825 pad_tidy|||
1826 pad_undef|||
1827 parse_body|||
1828 parse_unicode_opts|||
1829 parser_dup|||
1830 parser_free|||
1831 path_is_absolute|||n
1832 peep|||
1833 pending_Slabs_to_ro|||
1834 perl_alloc_using|||n
1835 perl_alloc|||n
1836 perl_clone_using|||n
1837 perl_clone|||n
1838 perl_construct|||n
1839 perl_destruct||5.007003|n
1840 perl_free|||n
1841 perl_parse||5.006000|n
1842 perl_run|||n
1843 pidgone|||
1844 pm_description|||
1845 pmflag|||
1846 pmop_dump||5.006000|
1847 pmop_xmldump|||
1848 pmruntime|||
1849 pmtrans|||
1850 pop_scope|||
1851 pregcomp||5.009005|
1852 pregexec|||
1853 pregfree2||5.011000|
1854 pregfree|||
1855 prepend_elem|||
1856 prepend_madprops|||
1857 printbuf|||
1858 printf_nocontext|||vn
1859 process_special_blocks|||
1860 ptr_table_clear||5.009005|
1861 ptr_table_fetch||5.009005|
1862 ptr_table_find|||n
1863 ptr_table_free||5.009005|
1864 ptr_table_new||5.009005|
1865 ptr_table_split||5.009005|
1866 ptr_table_store||5.009005|
1867 push_scope|||
1868 put_byte|||
1869 pv_display||5.006000|
1870 pv_escape||5.009004|
1871 pv_pretty||5.009004|
1872 pv_uni_display||5.007003|
1873 qerror|||
1874 qsortsvu|||
1875 re_compile||5.009005|
1876 re_croak2|||
1877 re_dup_guts|||
1878 re_intuit_start||5.009005|
1879 re_intuit_string||5.006000|
1880 readpipe_override|||
1881 realloc||5.007002|n
1882 reentrant_free|||
1883 reentrant_init|||
1884 reentrant_retry|||vn
1885 reentrant_size|||
1886 ref_array_or_hash|||
1887 refcounted_he_chain_2hv|||
1888 refcounted_he_fetch|||
1889 refcounted_he_free|||
1890 refcounted_he_new_common|||
1891 refcounted_he_new|||
1892 refcounted_he_value|||
1893 refkids|||
1894 refto|||
1895 ref||5.011000|
1896 reg_check_named_buff_matched|||
1897 reg_named_buff_all||5.009005|
1898 reg_named_buff_exists||5.009005|
1899 reg_named_buff_fetch||5.009005|
1900 reg_named_buff_firstkey||5.009005|
1901 reg_named_buff_iter|||
1902 reg_named_buff_nextkey||5.009005|
1903 reg_named_buff_scalar||5.009005|
1904 reg_named_buff|||
1905 reg_namedseq|||
1906 reg_node|||
1907 reg_numbered_buff_fetch|||
1908 reg_numbered_buff_length|||
1909 reg_numbered_buff_store|||
1910 reg_qr_package|||
1911 reg_recode|||
1912 reg_scan_name|||
1913 reg_skipcomment|||
1914 reg_temp_copy|||
1915 reganode|||
1916 regatom|||
1917 regbranch|||
1918 regclass_swash||5.009004|
1919 regclass|||
1920 regcppop|||
1921 regcppush|||
1922 regcurly|||n
1923 regdump_extflags|||
1924 regdump||5.005000|
1925 regdupe_internal|||
1926 regexec_flags||5.005000|
1927 regfree_internal||5.009005|
1928 reghop3|||n
1929 reghop4|||n
1930 reghopmaybe3|||n
1931 reginclass|||
1932 reginitcolors||5.006000|
1933 reginsert|||
1934 regmatch|||
1935 regnext||5.005000|
1936 regpiece|||
1937 regpposixcc|||
1938 regprop|||
1939 regrepeat|||
1940 regtail_study|||
1941 regtail|||
1942 regtry|||
1943 reguni|||
1944 regwhite|||n
1945 reg|||
1946 repeatcpy|||
1947 report_evil_fh|||
1948 report_uninit|||
1949 require_pv||5.006000|
1950 require_tie_mod|||
1951 restore_magic|||
1952 rninstr|||
1953 rsignal_restore|||
1954 rsignal_save|||
1955 rsignal_state||5.004000|
1956 rsignal||5.004000|
1957 run_body|||
1958 run_user_filter|||
1959 runops_debug||5.005000|
1960 runops_standard||5.005000|
1961 rvpv_dup|||
1962 rxres_free|||
1963 rxres_restore|||
1964 rxres_save|||
1965 safesyscalloc||5.006000|n
1966 safesysfree||5.006000|n
1967 safesysmalloc||5.006000|n
1968 safesysrealloc||5.006000|n
1969 same_dirent|||
1970 save_I16||5.004000|
1971 save_I32|||
1972 save_I8||5.006000|
1973 save_aelem||5.004050|
1974 save_alloc||5.006000|
1975 save_aptr|||
1976 save_ary|||
1977 save_bool||5.008001|
1978 save_clearsv|||
1979 save_delete|||
1980 save_destructor_x||5.006000|
1981 save_destructor||5.006000|
1982 save_freeop|||
1983 save_freepv|||
1984 save_freesv|||
1985 save_generic_pvref||5.006001|
1986 save_generic_svref||5.005030|
1987 save_gp||5.004000|
1988 save_hash|||
1989 save_hek_flags|||n
1990 save_helem||5.004050|
1991 save_hptr|||
1992 save_int|||
1993 save_item|||
1994 save_iv||5.005000|
1995 save_lines|||
1996 save_list|||
1997 save_long|||
1998 save_magic|||
1999 save_mortalizesv||5.007001|
2000 save_nogv|||
2001 save_op|||
2002 save_padsv_and_mortalize||5.011000|
2003 save_pptr|||
2004 save_re_context||5.006000|
2005 save_scalar_at|||
2006 save_scalar|||
2007 save_set_svflags||5.009000|
2008 save_shared_pvref||5.007003|
2009 save_sptr|||
2010 save_svref|||
2011 save_vptr||5.006000|
2012 savepvn|||
2013 savepvs||5.009003|
2014 savepv|||
2015 savesharedpvn||5.009005|
2016 savesharedpv||5.007003|
2017 savestack_grow_cnt||5.008001|
2018 savestack_grow|||
2019 savesvpv||5.009002|
2020 sawparens|||
2021 scalar_mod_type|||n
2022 scalarboolean|||
2023 scalarkids|||
2024 scalarseq|||
2025 scalarvoid|||
2026 scalar|||
2027 scan_bin||5.006000|
2028 scan_commit|||
2029 scan_const|||
2030 scan_formline|||
2031 scan_heredoc|||
2032 scan_hex|||
2033 scan_ident|||
2034 scan_inputsymbol|||
2035 scan_num||5.007001|
2036 scan_oct|||
2037 scan_pat|||
2038 scan_str|||
2039 scan_subst|||
2040 scan_trans|||
2041 scan_version||5.009001|
2042 scan_vstring||5.009005|
2043 scan_word|||
2044 scope|||
2045 screaminstr||5.005000|
2046 seed||5.008001|
2047 sequence_num|||
2048 sequence_tail|||
2049 sequence|||
2050 set_context||5.006000|n
2051 set_numeric_local||5.006000|
2052 set_numeric_radix||5.006000|
2053 set_numeric_standard||5.006000|
2054 setdefout|||
2055 setenv_getix|||
2056 share_hek_flags|||
2057 share_hek||5.004000|
2058 si_dup|||
2059 sighandler|||n
2060 simplify_sort|||
2061 skipspace0|||
2062 skipspace1|||
2063 skipspace2|||
2064 skipspace|||
2065 softref2xv|||
2066 sortcv_stacked|||
2067 sortcv_xsub|||
2068 sortcv|||
2069 sortsv_flags||5.009003|
2070 sortsv||5.007003|
2071 space_join_names_mortal|||
2072 ss_dup|||
2073 stack_grow|||
2074 start_force|||
2075 start_glob|||
2076 start_subparse||5.004000|
2077 stashpv_hvname_match||5.011000|
2078 stdize_locale|||
2079 store_cop_label|||
2080 strEQ|||
2081 strGE|||
2082 strGT|||
2083 strLE|||
2084 strLT|||
2085 strNE|||
2086 str_to_version||5.006000|
2087 strip_return|||
2088 strnEQ|||
2089 strnNE|||
2090 study_chunk|||
2091 sub_crush_depth|||
2092 sublex_done|||
2093 sublex_push|||
2094 sublex_start|||
2095 sv_2bool|||
2096 sv_2cv|||
2097 sv_2io|||
2098 sv_2iuv_common|||
2099 sv_2iuv_non_preserve|||
2100 sv_2iv_flags||5.009001|
2101 sv_2iv|||
2102 sv_2mortal|||
2103 sv_2num|||
2104 sv_2nv|||
2105 sv_2pv_flags|5.007002||p
2106 sv_2pv_nolen|5.006000||p
2107 sv_2pvbyte_nolen|5.006000||p
2108 sv_2pvbyte|5.006000||p
2109 sv_2pvutf8_nolen||5.006000|
2110 sv_2pvutf8||5.006000|
2111 sv_2pv|||
2112 sv_2uv_flags||5.009001|
2113 sv_2uv|5.004000||p
2114 sv_add_arena|||
2115 sv_add_backref|||
2116 sv_backoff|||
2117 sv_bless|||
2118 sv_cat_decode||5.008001|
2119 sv_catpv_mg|5.004050||p
2120 sv_catpvf_mg_nocontext|||pvn
2121 sv_catpvf_mg|5.006000|5.004000|pv
2122 sv_catpvf_nocontext|||vn
2123 sv_catpvf||5.004000|v
2124 sv_catpvn_flags||5.007002|
2125 sv_catpvn_mg|5.004050||p
2126 sv_catpvn_nomg|5.007002||p
2127 sv_catpvn|||
2128 sv_catpvs|5.009003||p
2129 sv_catpv|||
2130 sv_catsv_flags||5.007002|
2131 sv_catsv_mg|5.004050||p
2132 sv_catsv_nomg|5.007002||p
2133 sv_catsv|||
2134 sv_catxmlpvn|||
2135 sv_catxmlsv|||
2136 sv_chop|||
2137 sv_clean_all|||
2138 sv_clean_objs|||
2139 sv_clear|||
2140 sv_cmp_locale||5.004000|
2141 sv_cmp|||
2142 sv_collxfrm|||
2143 sv_compile_2op||5.008001|
2144 sv_copypv||5.007003|
2145 sv_dec|||
2146 sv_del_backref|||
2147 sv_derived_from||5.004000|
2148 sv_destroyable||5.010000|
2149 sv_does||5.009004|
2150 sv_dump|||
2151 sv_dup|||
2152 sv_eq|||
2153 sv_exp_grow|||
2154 sv_force_normal_flags||5.007001|
2155 sv_force_normal||5.006000|
2156 sv_free2|||
2157 sv_free_arenas|||
2158 sv_free|||
2159 sv_gets||5.004000|
2160 sv_grow|||
2161 sv_i_ncmp|||
2162 sv_inc|||
2163 sv_insert_flags||5.011000|
2164 sv_insert|||
2165 sv_isa|||
2166 sv_isobject|||
2167 sv_iv||5.005000|
2168 sv_kill_backrefs|||
2169 sv_len_utf8||5.006000|
2170 sv_len|||
2171 sv_magic_portable|5.011000|5.004000|p
2172 sv_magicext||5.007003|
2173 sv_magic|||
2174 sv_mortalcopy|||
2175 sv_ncmp|||
2176 sv_newmortal|||
2177 sv_newref|||
2178 sv_nolocking||5.007003|
2179 sv_nosharing||5.007003|
2180 sv_nounlocking|||
2181 sv_nv||5.005000|
2182 sv_peek||5.005000|
2183 sv_pos_b2u_midway|||
2184 sv_pos_b2u||5.006000|
2185 sv_pos_u2b_cached|||
2186 sv_pos_u2b_forwards|||n
2187 sv_pos_u2b_midway|||n
2188 sv_pos_u2b||5.006000|
2189 sv_pvbyten_force||5.006000|
2190 sv_pvbyten||5.006000|
2191 sv_pvbyte||5.006000|
2192 sv_pvn_force_flags|5.007002||p
2193 sv_pvn_force|||
2194 sv_pvn_nomg|5.007003|5.005000|p
2195 sv_pvn||5.005000|
2196 sv_pvutf8n_force||5.006000|
2197 sv_pvutf8n||5.006000|
2198 sv_pvutf8||5.006000|
2199 sv_pv||5.006000|
2200 sv_recode_to_utf8||5.007003|
2201 sv_reftype|||
2202 sv_release_COW|||
2203 sv_replace|||
2204 sv_report_used|||
2205 sv_reset|||
2206 sv_rvweaken||5.006000|
2207 sv_setiv_mg|5.004050||p
2208 sv_setiv|||
2209 sv_setnv_mg|5.006000||p
2210 sv_setnv|||
2211 sv_setpv_mg|5.004050||p
2212 sv_setpvf_mg_nocontext|||pvn
2213 sv_setpvf_mg|5.006000|5.004000|pv
2214 sv_setpvf_nocontext|||vn
2215 sv_setpvf||5.004000|v
2216 sv_setpviv_mg||5.008001|
2217 sv_setpviv||5.008001|
2218 sv_setpvn_mg|5.004050||p
2219 sv_setpvn|||
2220 sv_setpvs|5.009004||p
2221 sv_setpv|||
2222 sv_setref_iv|||
2223 sv_setref_nv|||
2224 sv_setref_pvn|||
2225 sv_setref_pv|||
2226 sv_setref_uv||5.007001|
2227 sv_setsv_cow|||
2228 sv_setsv_flags||5.007002|
2229 sv_setsv_mg|5.004050||p
2230 sv_setsv_nomg|5.007002||p
2231 sv_setsv|||
2232 sv_setuv_mg|5.004050||p
2233 sv_setuv|5.004000||p
2234 sv_tainted||5.004000|
2235 sv_taint||5.004000|
2236 sv_true||5.005000|
2237 sv_unglob|||
2238 sv_uni_display||5.007003|
2239 sv_unmagic|||
2240 sv_unref_flags||5.007001|
2241 sv_unref|||
2242 sv_untaint||5.004000|
2243 sv_upgrade|||
2244 sv_usepvn_flags||5.009004|
2245 sv_usepvn_mg|5.004050||p
2246 sv_usepvn|||
2247 sv_utf8_decode||5.006000|
2248 sv_utf8_downgrade||5.006000|
2249 sv_utf8_encode||5.006000|
2250 sv_utf8_upgrade_flags||5.007002|
2251 sv_utf8_upgrade||5.007001|
2252 sv_uv|5.005000||p
2253 sv_vcatpvf_mg|5.006000|5.004000|p
2254 sv_vcatpvfn||5.004000|
2255 sv_vcatpvf|5.006000|5.004000|p
2256 sv_vsetpvf_mg|5.006000|5.004000|p
2257 sv_vsetpvfn||5.004000|
2258 sv_vsetpvf|5.006000|5.004000|p
2259 sv_xmlpeek|||
2260 svtype|||
2261 swallow_bom|||
2262 swap_match_buff|||
2263 swash_fetch||5.007002|
2264 swash_get|||
2265 swash_init||5.006000|
2266 sys_init3||5.010000|n
2267 sys_init||5.010000|n
2268 sys_intern_clear|||
2269 sys_intern_dup|||
2270 sys_intern_init|||
2271 sys_term||5.010000|n
2272 taint_env|||
2273 taint_proper|||
2274 tmps_grow||5.006000|
2275 toLOWER|||
2276 toUPPER|||
2277 to_byte_substr|||
2278 to_uni_fold||5.007003|
2279 to_uni_lower_lc||5.006000|
2280 to_uni_lower||5.007003|
2281 to_uni_title_lc||5.006000|
2282 to_uni_title||5.007003|
2283 to_uni_upper_lc||5.006000|
2284 to_uni_upper||5.007003|
2285 to_utf8_case||5.007003|
2286 to_utf8_fold||5.007003|
2287 to_utf8_lower||5.007003|
2288 to_utf8_substr|||
2289 to_utf8_title||5.007003|
2290 to_utf8_upper||5.007003|
2291 token_free|||
2292 token_getmad|||
2293 tokenize_use|||
2294 tokeq|||
2295 tokereport|||
2296 too_few_arguments|||
2297 too_many_arguments|||
2298 uiv_2buf|||n
2299 unlnk|||
2300 unpack_rec|||
2301 unpack_str||5.007003|
2302 unpackstring||5.008001|
2303 unshare_hek_or_pvn|||
2304 unshare_hek|||
2305 unsharepvn||5.004000|
2306 unwind_handler_stack|||
2307 update_debugger_info|||
2308 upg_version||5.009005|
2309 usage|||
2310 utf16_to_utf8_reversed||5.006001|
2311 utf16_to_utf8||5.006001|
2312 utf8_distance||5.006000|
2313 utf8_hop||5.006000|
2314 utf8_length||5.007001|
2315 utf8_mg_pos_cache_update|||
2316 utf8_to_bytes||5.006001|
2317 utf8_to_uvchr||5.007001|
2318 utf8_to_uvuni||5.007001|
2319 utf8n_to_uvchr|||
2320 utf8n_to_uvuni||5.007001|
2321 utilize|||
2322 uvchr_to_utf8_flags||5.007003|
2323 uvchr_to_utf8|||
2324 uvuni_to_utf8_flags||5.007003|
2325 uvuni_to_utf8||5.007001|
2326 validate_suid|||
2327 varname|||
2328 vcmp||5.009000|
2329 vcroak||5.006000|
2330 vdeb||5.007003|
2331 vdie_common|||
2332 vdie_croak_common|||
2333 vdie|||
2334 vform||5.006000|
2335 visit|||
2336 vivify_defelem|||
2337 vivify_ref|||
2338 vload_module|5.006000||p
2339 vmess||5.006000|
2340 vnewSVpvf|5.006000|5.004000|p
2341 vnormal||5.009002|
2342 vnumify||5.009000|
2343 vstringify||5.009000|
2344 vverify||5.009003|
2345 vwarner||5.006000|
2346 vwarn||5.006000|
2347 wait4pid|||
2348 warn_nocontext|||vn
2349 warner_nocontext|||vn
2350 warner|5.006000|5.004000|pv
2351 warn|||v
2352 watch|||
2353 whichsig|||
2354 write_no_mem|||
2355 write_to_stderr|||
2356 xmldump_all|||
2357 xmldump_attr|||
2358 xmldump_eval|||
2359 xmldump_form|||
2360 xmldump_indent|||v
2361 xmldump_packsubs|||
2362 xmldump_sub|||
2363 xmldump_vindent|||
2364 yyerror|||
2365 yylex|||
2366 yyparse|||
2367 yywarn|||
2370 if (exists $opt{'list-unsupported'}) {
2371 my $f;
2372 for $f (sort { lc $a cmp lc $b } keys %API) {
2373 next unless $API{$f}{todo};
2374 print "$f ", '.'x(40-length($f)), " ", format_version($API{$f}{todo}), "\n";
2376 exit 0;
2379 # Scan for possible replacement candidates
2381 my(%replace, %need, %hints, %warnings, %depends);
2382 my $replace = 0;
2383 my($hint, $define, $function);
2385 sub find_api
2387 my $code = shift;
2388 $code =~ s{
2389 / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]*)
2390 | "[^"\\]*(?:\\.[^"\\]*)*"
2391 | '[^'\\]*(?:\\.[^'\\]*)*' }{}egsx;
2392 grep { exists $API{$_} } $code =~ /(\w+)/mg;
2395 while (<DATA>) {
2396 if ($hint) {
2397 my $h = $hint->[0] eq 'Hint' ? \%hints : \%warnings;
2398 if (m{^\s*\*\s(.*?)\s*$}) {
2399 for (@{$hint->[1]}) {
2400 $h->{$_} ||= ''; # suppress warning with older perls
2401 $h->{$_} .= "$1\n";
2404 else { undef $hint }
2407 $hint = [$1, [split /,?\s+/, $2]]
2408 if m{^\s*$rccs\s+(Hint|Warning):\s+(\w+(?:,?\s+\w+)*)\s*$};
2410 if ($define) {
2411 if ($define->[1] =~ /\\$/) {
2412 $define->[1] .= $_;
2414 else {
2415 if (exists $API{$define->[0]} && $define->[1] !~ /^DPPP_\(/) {
2416 my @n = find_api($define->[1]);
2417 push @{$depends{$define->[0]}}, @n if @n
2419 undef $define;
2423 $define = [$1, $2] if m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(.*)};
2425 if ($function) {
2426 if (/^}/) {
2427 if (exists $API{$function->[0]}) {
2428 my @n = find_api($function->[1]);
2429 push @{$depends{$function->[0]}}, @n if @n
2431 undef $function;
2433 else {
2434 $function->[1] .= $_;
2438 $function = [$1, ''] if m{^DPPP_\(my_(\w+)\)};
2440 $replace = $1 if m{^\s*$rccs\s+Replace:\s+(\d+)\s+$rcce\s*$};
2441 $replace{$2} = $1 if $replace and m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(\w+)};
2442 $replace{$2} = $1 if m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(\w+).*$rccs\s+Replace\s+$rcce};
2443 $replace{$1} = $2 if m{^\s*$rccs\s+Replace (\w+) with (\w+)\s+$rcce\s*$};
2445 if (m{^\s*$rccs\s+(\w+)\s+depends\s+on\s+(\w+(\s*,\s*\w+)*)\s+$rcce\s*$}) {
2446 push @{$depends{$1}}, map { s/\s+//g; $_ } split /,/, $2;
2449 $need{$1} = 1 if m{^#if\s+defined\(NEED_(\w+)(?:_GLOBAL)?\)};
2452 for (values %depends) {
2453 my %s;
2454 $_ = [sort grep !$s{$_}++, @$_];
2457 if (exists $opt{'api-info'}) {
2458 my $f;
2459 my $count = 0;
2460 my $match = $opt{'api-info'} =~ m!^/(.*)/$! ? $1 : "^\Q$opt{'api-info'}\E\$";
2461 for $f (sort { lc $a cmp lc $b } keys %API) {
2462 next unless $f =~ /$match/;
2463 print "\n=== $f ===\n\n";
2464 my $info = 0;
2465 if ($API{$f}{base} || $API{$f}{todo}) {
2466 my $base = format_version($API{$f}{base} || $API{$f}{todo});
2467 print "Supported at least starting from perl-$base.\n";
2468 $info++;
2470 if ($API{$f}{provided}) {
2471 my $todo = $API{$f}{todo} ? format_version($API{$f}{todo}) : "5.003";
2472 print "Support by $ppport provided back to perl-$todo.\n";
2473 print "Support needs to be explicitly requested by NEED_$f.\n" if exists $need{$f};
2474 print "Depends on: ", join(', ', @{$depends{$f}}), ".\n" if exists $depends{$f};
2475 print "\n$hints{$f}" if exists $hints{$f};
2476 print "\nWARNING:\n$warnings{$f}" if exists $warnings{$f};
2477 $info++;
2479 print "No portability information available.\n" unless $info;
2480 $count++;
2482 $count or print "Found no API matching '$opt{'api-info'}'.";
2483 print "\n";
2484 exit 0;
2487 if (exists $opt{'list-provided'}) {
2488 my $f;
2489 for $f (sort { lc $a cmp lc $b } keys %API) {
2490 next unless $API{$f}{provided};
2491 my @flags;
2492 push @flags, 'explicit' if exists $need{$f};
2493 push @flags, 'depend' if exists $depends{$f};
2494 push @flags, 'hint' if exists $hints{$f};
2495 push @flags, 'warning' if exists $warnings{$f};
2496 my $flags = @flags ? ' ['.join(', ', @flags).']' : '';
2497 print "$f$flags\n";
2499 exit 0;
2502 my @files;
2503 my @srcext = qw( .xs .c .h .cc .cpp -c.inc -xs.inc );
2504 my $srcext = join '|', map { quotemeta $_ } @srcext;
2506 if (@ARGV) {
2507 my %seen;
2508 for (@ARGV) {
2509 if (-e) {
2510 if (-f) {
2511 push @files, $_ unless $seen{$_}++;
2513 else { warn "'$_' is not a file.\n" }
2515 else {
2516 my @new = grep { -f } glob $_
2517 or warn "'$_' does not exist.\n";
2518 push @files, grep { !$seen{$_}++ } @new;
2522 else {
2523 eval {
2524 require File::Find;
2525 File::Find::find(sub {
2526 $File::Find::name =~ /($srcext)$/i
2527 and push @files, $File::Find::name;
2528 }, '.');
2530 if ($@) {
2531 @files = map { glob "*$_" } @srcext;
2535 if (!@ARGV || $opt{filter}) {
2536 my(@in, @out);
2537 my %xsc = map { /(.*)\.xs$/ ? ("$1.c" => 1, "$1.cc" => 1) : () } @files;
2538 for (@files) {
2539 my $out = exists $xsc{$_} || /\b\Q$ppport\E$/i || !/($srcext)$/i;
2540 push @{ $out ? \@out : \@in }, $_;
2542 if (@ARGV && @out) {
2543 warning("Skipping the following files (use --nofilter to avoid this):\n| ", join "\n| ", @out);
2545 @files = @in;
2548 die "No input files given!\n" unless @files;
2550 my(%files, %global, %revreplace);
2551 %revreplace = reverse %replace;
2552 my $filename;
2553 my $patch_opened = 0;
2555 for $filename (@files) {
2556 unless (open IN, "<$filename") {
2557 warn "Unable to read from $filename: $!\n";
2558 next;
2561 info("Scanning $filename ...");
2563 my $c = do { local $/; <IN> };
2564 close IN;
2566 my %file = (orig => $c, changes => 0);
2568 # Temporarily remove C/XS comments and strings from the code
2569 my @ccom;
2571 $c =~ s{
2572 ( ^$HS*\#$HS*include\b[^\r\n]+\b(?:\Q$ppport\E|XSUB\.h)\b[^\r\n]*
2573 | ^$HS*\#$HS*(?:define|elif|if(?:def)?)\b[^\r\n]* )
2574 | ( ^$HS*\#[^\r\n]*
2575 | "[^"\\]*(?:\\.[^"\\]*)*"
2576 | '[^'\\]*(?:\\.[^'\\]*)*'
2577 | / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]* ) )
2578 }{ defined $2 and push @ccom, $2;
2579 defined $1 ? $1 : "$ccs$#ccom$cce" }mgsex;
2581 $file{ccom} = \@ccom;
2582 $file{code} = $c;
2583 $file{has_inc_ppport} = $c =~ /^$HS*#$HS*include[^\r\n]+\b\Q$ppport\E\b/m;
2585 my $func;
2587 for $func (keys %API) {
2588 my $match = $func;
2589 $match .= "|$revreplace{$func}" if exists $revreplace{$func};
2590 if ($c =~ /\b(?:Perl_)?($match)\b/) {
2591 $file{uses_replace}{$1}++ if exists $revreplace{$func} && $1 eq $revreplace{$func};
2592 $file{uses_Perl}{$func}++ if $c =~ /\bPerl_$func\b/;
2593 if (exists $API{$func}{provided}) {
2594 $file{uses_provided}{$func}++;
2595 if (!exists $API{$func}{base} || $API{$func}{base} > $opt{'compat-version'}) {
2596 $file{uses}{$func}++;
2597 my @deps = rec_depend($func);
2598 if (@deps) {
2599 $file{uses_deps}{$func} = \@deps;
2600 for (@deps) {
2601 $file{uses}{$_} = 0 unless exists $file{uses}{$_};
2604 for ($func, @deps) {
2605 $file{needs}{$_} = 'static' if exists $need{$_};
2609 if (exists $API{$func}{todo} && $API{$func}{todo} > $opt{'compat-version'}) {
2610 if ($c =~ /\b$func\b/) {
2611 $file{uses_todo}{$func}++;
2617 while ($c =~ /^$HS*#$HS*define$HS+(NEED_(\w+?)(_GLOBAL)?)\b/mg) {
2618 if (exists $need{$2}) {
2619 $file{defined $3 ? 'needed_global' : 'needed_static'}{$2}++;
2621 else { warning("Possibly wrong #define $1 in $filename") }
2624 for (qw(uses needs uses_todo needed_global needed_static)) {
2625 for $func (keys %{$file{$_}}) {
2626 push @{$global{$_}{$func}}, $filename;
2630 $files{$filename} = \%file;
2633 # Globally resolve NEED_'s
2634 my $need;
2635 for $need (keys %{$global{needs}}) {
2636 if (@{$global{needs}{$need}} > 1) {
2637 my @targets = @{$global{needs}{$need}};
2638 my @t = grep $files{$_}{needed_global}{$need}, @targets;
2639 @targets = @t if @t;
2640 @t = grep /\.xs$/i, @targets;
2641 @targets = @t if @t;
2642 my $target = shift @targets;
2643 $files{$target}{needs}{$need} = 'global';
2644 for (@{$global{needs}{$need}}) {
2645 $files{$_}{needs}{$need} = 'extern' if $_ ne $target;
2650 for $filename (@files) {
2651 exists $files{$filename} or next;
2653 info("=== Analyzing $filename ===");
2655 my %file = %{$files{$filename}};
2656 my $func;
2657 my $c = $file{code};
2658 my $warnings = 0;
2660 for $func (sort keys %{$file{uses_Perl}}) {
2661 if ($API{$func}{varargs}) {
2662 unless ($API{$func}{nothxarg}) {
2663 my $changes = ($c =~ s{\b(Perl_$func\s*\(\s*)(?!aTHX_?)(\)|[^\s)]*\))}
2664 { $1 . ($2 eq ')' ? 'aTHX' : 'aTHX_ ') . $2 }ge);
2665 if ($changes) {
2666 warning("Doesn't pass interpreter argument aTHX to Perl_$func");
2667 $file{changes} += $changes;
2671 else {
2672 warning("Uses Perl_$func instead of $func");
2673 $file{changes} += ($c =~ s{\bPerl_$func(\s*)\((\s*aTHX_?)?\s*}
2674 {$func$1(}g);
2678 for $func (sort keys %{$file{uses_replace}}) {
2679 warning("Uses $func instead of $replace{$func}");
2680 $file{changes} += ($c =~ s/\b$func\b/$replace{$func}/g);
2683 for $func (sort keys %{$file{uses_provided}}) {
2684 if ($file{uses}{$func}) {
2685 if (exists $file{uses_deps}{$func}) {
2686 diag("Uses $func, which depends on ", join(', ', @{$file{uses_deps}{$func}}));
2688 else {
2689 diag("Uses $func");
2692 $warnings += hint($func);
2695 unless ($opt{quiet}) {
2696 for $func (sort keys %{$file{uses_todo}}) {
2697 print "*** WARNING: Uses $func, which may not be portable below perl ",
2698 format_version($API{$func}{todo}), ", even with '$ppport'\n";
2699 $warnings++;
2703 for $func (sort keys %{$file{needed_static}}) {
2704 my $message = '';
2705 if (not exists $file{uses}{$func}) {
2706 $message = "No need to define NEED_$func if $func is never used";
2708 elsif (exists $file{needs}{$func} && $file{needs}{$func} ne 'static') {
2709 $message = "No need to define NEED_$func when already needed globally";
2711 if ($message) {
2712 diag($message);
2713 $file{changes} += ($c =~ s/^$HS*#$HS*define$HS+NEED_$func\b.*$LF//mg);
2717 for $func (sort keys %{$file{needed_global}}) {
2718 my $message = '';
2719 if (not exists $global{uses}{$func}) {
2720 $message = "No need to define NEED_${func}_GLOBAL if $func is never used";
2722 elsif (exists $file{needs}{$func}) {
2723 if ($file{needs}{$func} eq 'extern') {
2724 $message = "No need to define NEED_${func}_GLOBAL when already needed globally";
2726 elsif ($file{needs}{$func} eq 'static') {
2727 $message = "No need to define NEED_${func}_GLOBAL when only used in this file";
2730 if ($message) {
2731 diag($message);
2732 $file{changes} += ($c =~ s/^$HS*#$HS*define$HS+NEED_${func}_GLOBAL\b.*$LF//mg);
2736 $file{needs_inc_ppport} = keys %{$file{uses}};
2738 if ($file{needs_inc_ppport}) {
2739 my $pp = '';
2741 for $func (sort keys %{$file{needs}}) {
2742 my $type = $file{needs}{$func};
2743 next if $type eq 'extern';
2744 my $suffix = $type eq 'global' ? '_GLOBAL' : '';
2745 unless (exists $file{"needed_$type"}{$func}) {
2746 if ($type eq 'global') {
2747 diag("Files [@{$global{needs}{$func}}] need $func, adding global request");
2749 else {
2750 diag("File needs $func, adding static request");
2752 $pp .= "#define NEED_$func$suffix\n";
2756 if ($pp && ($c =~ s/^(?=$HS*#$HS*define$HS+NEED_\w+)/$pp/m)) {
2757 $pp = '';
2758 $file{changes}++;
2761 unless ($file{has_inc_ppport}) {
2762 diag("Needs to include '$ppport'");
2763 $pp .= qq(#include "$ppport"\n)
2766 if ($pp) {
2767 $file{changes} += ($c =~ s/^($HS*#$HS*define$HS+NEED_\w+.*?)^/$1$pp/ms)
2768 || ($c =~ s/^(?=$HS*#$HS*include.*\Q$ppport\E)/$pp/m)
2769 || ($c =~ s/^($HS*#$HS*include.*XSUB.*\s*?)^/$1$pp/m)
2770 || ($c =~ s/^/$pp/);
2773 else {
2774 if ($file{has_inc_ppport}) {
2775 diag("No need to include '$ppport'");
2776 $file{changes} += ($c =~ s/^$HS*?#$HS*include.*\Q$ppport\E.*?$LF//m);
2780 # put back in our C comments
2781 my $ix;
2782 my $cppc = 0;
2783 my @ccom = @{$file{ccom}};
2784 for $ix (0 .. $#ccom) {
2785 if (!$opt{cplusplus} && $ccom[$ix] =~ s!^//!!) {
2786 $cppc++;
2787 $file{changes} += $c =~ s/$rccs$ix$rcce/$ccs$ccom[$ix] $cce/;
2789 else {
2790 $c =~ s/$rccs$ix$rcce/$ccom[$ix]/;
2794 if ($cppc) {
2795 my $s = $cppc != 1 ? 's' : '';
2796 warning("Uses $cppc C++ style comment$s, which is not portable");
2799 my $s = $warnings != 1 ? 's' : '';
2800 my $warn = $warnings ? " ($warnings warning$s)" : '';
2801 info("Analysis completed$warn");
2803 if ($file{changes}) {
2804 if (exists $opt{copy}) {
2805 my $newfile = "$filename$opt{copy}";
2806 if (-e $newfile) {
2807 error("'$newfile' already exists, refusing to write copy of '$filename'");
2809 else {
2810 local *F;
2811 if (open F, ">$newfile") {
2812 info("Writing copy of '$filename' with changes to '$newfile'");
2813 print F $c;
2814 close F;
2816 else {
2817 error("Cannot open '$newfile' for writing: $!");
2821 elsif (exists $opt{patch} || $opt{changes}) {
2822 if (exists $opt{patch}) {
2823 unless ($patch_opened) {
2824 if (open PATCH, ">$opt{patch}") {
2825 $patch_opened = 1;
2827 else {
2828 error("Cannot open '$opt{patch}' for writing: $!");
2829 delete $opt{patch};
2830 $opt{changes} = 1;
2831 goto fallback;
2834 mydiff(\*PATCH, $filename, $c);
2836 else {
2837 fallback:
2838 info("Suggested changes:");
2839 mydiff(\*STDOUT, $filename, $c);
2842 else {
2843 my $s = $file{changes} == 1 ? '' : 's';
2844 info("$file{changes} potentially required change$s detected");
2847 else {
2848 info("Looks good");
2852 close PATCH if $patch_opened;
2854 exit 0;
2857 sub try_use { eval "use @_;"; return $@ eq '' }
2859 sub mydiff
2861 local *F = shift;
2862 my($file, $str) = @_;
2863 my $diff;
2865 if (exists $opt{diff}) {
2866 $diff = run_diff($opt{diff}, $file, $str);
2869 if (!defined $diff and try_use('Text::Diff')) {
2870 $diff = Text::Diff::diff($file, \$str, { STYLE => 'Unified' });
2871 $diff = <<HEADER . $diff;
2872 --- $file
2873 +++ $file.patched
2874 HEADER
2877 if (!defined $diff) {
2878 $diff = run_diff('diff -u', $file, $str);
2881 if (!defined $diff) {
2882 $diff = run_diff('diff', $file, $str);
2885 if (!defined $diff) {
2886 error("Cannot generate a diff. Please install Text::Diff or use --copy.");
2887 return;
2890 print F $diff;
2893 sub run_diff
2895 my($prog, $file, $str) = @_;
2896 my $tmp = 'dppptemp';
2897 my $suf = 'aaa';
2898 my $diff = '';
2899 local *F;
2901 while (-e "$tmp.$suf") { $suf++ }
2902 $tmp = "$tmp.$suf";
2904 if (open F, ">$tmp") {
2905 print F $str;
2906 close F;
2908 if (open F, "$prog $file $tmp |") {
2909 while (<F>) {
2910 s/\Q$tmp\E/$file.patched/;
2911 $diff .= $_;
2913 close F;
2914 unlink $tmp;
2915 return $diff;
2918 unlink $tmp;
2920 else {
2921 error("Cannot open '$tmp' for writing: $!");
2924 return undef;
2927 sub rec_depend
2929 my($func, $seen) = @_;
2930 return () unless exists $depends{$func};
2931 $seen = {%{$seen||{}}};
2932 return () if $seen->{$func}++;
2933 my %s;
2934 grep !$s{$_}++, map { ($_, rec_depend($_, $seen)) } @{$depends{$func}};
2937 sub parse_version
2939 my $ver = shift;
2941 if ($ver =~ /^(\d+)\.(\d+)\.(\d+)$/) {
2942 return ($1, $2, $3);
2944 elsif ($ver !~ /^\d+\.[\d_]+$/) {
2945 die "cannot parse version '$ver'\n";
2948 $ver =~ s/_//g;
2949 $ver =~ s/$/000000/;
2951 my($r,$v,$s) = $ver =~ /(\d+)\.(\d{3})(\d{3})/;
2953 $v = int $v;
2954 $s = int $s;
2956 if ($r < 5 || ($r == 5 && $v < 6)) {
2957 if ($s % 10) {
2958 die "cannot parse version '$ver'\n";
2962 return ($r, $v, $s);
2965 sub format_version
2967 my $ver = shift;
2969 $ver =~ s/$/000000/;
2970 my($r,$v,$s) = $ver =~ /(\d+)\.(\d{3})(\d{3})/;
2972 $v = int $v;
2973 $s = int $s;
2975 if ($r < 5 || ($r == 5 && $v < 6)) {
2976 if ($s % 10) {
2977 die "invalid version '$ver'\n";
2979 $s /= 10;
2981 $ver = sprintf "%d.%03d", $r, $v;
2982 $s > 0 and $ver .= sprintf "_%02d", $s;
2984 return $ver;
2987 return sprintf "%d.%d.%d", $r, $v, $s;
2990 sub info
2992 $opt{quiet} and return;
2993 print @_, "\n";
2996 sub diag
2998 $opt{quiet} and return;
2999 $opt{diag} and print @_, "\n";
3002 sub warning
3004 $opt{quiet} and return;
3005 print "*** ", @_, "\n";
3008 sub error
3010 print "*** ERROR: ", @_, "\n";
3013 my %given_hints;
3014 my %given_warnings;
3015 sub hint
3017 $opt{quiet} and return;
3018 my $func = shift;
3019 my $rv = 0;
3020 if (exists $warnings{$func} && !$given_warnings{$func}++) {
3021 my $warn = $warnings{$func};
3022 $warn =~ s!^!*** !mg;
3023 print "*** WARNING: $func\n", $warn;
3024 $rv++;
3026 if ($opt{hints} && exists $hints{$func} && !$given_hints{$func}++) {
3027 my $hint = $hints{$func};
3028 $hint =~ s/^/ /mg;
3029 print " --- hint for $func ---\n", $hint;
3031 $rv;
3034 sub usage
3036 my($usage) = do { local(@ARGV,$/)=($0); <> } =~ /^=head\d$HS+SYNOPSIS\s*^(.*?)\s*^=/ms;
3037 my %M = ( 'I' => '*' );
3038 $usage =~ s/^\s*perl\s+\S+/$^X $0/;
3039 $usage =~ s/([A-Z])<([^>]+)>/$M{$1}$2$M{$1}/g;
3041 print <<ENDUSAGE;
3043 Usage: $usage
3045 See perldoc $0 for details.
3047 ENDUSAGE
3049 exit 2;
3052 sub strip
3054 my $self = do { local(@ARGV,$/)=($0); <> };
3055 my($copy) = $self =~ /^=head\d\s+COPYRIGHT\s*^(.*?)^=\w+/ms;
3056 $copy =~ s/^(?=\S+)/ /gms;
3057 $self =~ s/^$HS+Do NOT edit.*?(?=^-)/$copy/ms;
3058 $self =~ s/^SKIP.*(?=^__DATA__)/SKIP
3059 if (\@ARGV && \$ARGV[0] eq '--unstrip') {
3060 eval { require Devel::PPPort };
3061 \$@ and die "Cannot require Devel::PPPort, please install.\\n";
3062 if (\$Devel::PPPort::VERSION < $VERSION) {
3063 die "$0 was originally generated with Devel::PPPort $VERSION.\\n"
3064 . "Your Devel::PPPort is only version \$Devel::PPPort::VERSION.\\n"
3065 . "Please install a newer version, or --unstrip will not work.\\n";
3067 Devel::PPPort::WriteFile(\$0);
3068 exit 0;
3070 print <<END;
3072 Sorry, but this is a stripped version of \$0.
3074 To be able to use its original script and doc functionality,
3075 please try to regenerate this file using:
3077 \$^X \$0 --unstrip
3080 /ms;
3081 my($pl, $c) = $self =~ /(.*^__DATA__)(.*)/ms;
3082 $c =~ s{
3083 / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]*)
3084 | ( "[^"\\]*(?:\\.[^"\\]*)*"
3085 | '[^'\\]*(?:\\.[^'\\]*)*' )
3086 | ($HS+) }{ defined $2 ? ' ' : ($1 || '') }gsex;
3087 $c =~ s!\s+$!!mg;
3088 $c =~ s!^$LF!!mg;
3089 $c =~ s!^\s*#\s*!#!mg;
3090 $c =~ s!^\s+!!mg;
3092 open OUT, ">$0" or die "cannot strip $0: $!\n";
3093 print OUT "$pl$c\n";
3095 exit 0;
3098 __DATA__
3101 #ifndef _P_P_PORTABILITY_H_
3102 #define _P_P_PORTABILITY_H_
3104 #ifndef DPPP_NAMESPACE
3105 # define DPPP_NAMESPACE DPPP_
3106 #endif
3108 #define DPPP_CAT2(x,y) CAT2(x,y)
3109 #define DPPP_(name) DPPP_CAT2(DPPP_NAMESPACE, name)
3111 #ifndef PERL_REVISION
3112 # if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
3113 # define PERL_PATCHLEVEL_H_IMPLICIT
3114 # include <patchlevel.h>
3115 # endif
3116 # if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
3117 # include <could_not_find_Perl_patchlevel.h>
3118 # endif
3119 # ifndef PERL_REVISION
3120 # define PERL_REVISION (5)
3121 /* Replace: 1 */
3122 # define PERL_VERSION PATCHLEVEL
3123 # define PERL_SUBVERSION SUBVERSION
3124 /* Replace PERL_PATCHLEVEL with PERL_VERSION */
3125 /* Replace: 0 */
3126 # endif
3127 #endif
3129 #define _dpppDEC2BCD(dec) ((((dec)/100)<<8)|((((dec)%100)/10)<<4)|((dec)%10))
3130 #define PERL_BCDVERSION ((_dpppDEC2BCD(PERL_REVISION)<<24)|(_dpppDEC2BCD(PERL_VERSION)<<12)|_dpppDEC2BCD(PERL_SUBVERSION))
3132 /* It is very unlikely that anyone will try to use this with Perl 6
3133 (or greater), but who knows.
3135 #if PERL_REVISION != 5
3136 # error ppport.h only works with Perl version 5
3137 #endif /* PERL_REVISION != 5 */
3139 #ifdef I_LIMITS
3140 # include <limits.h>
3141 #endif
3143 #ifndef PERL_UCHAR_MIN
3144 # define PERL_UCHAR_MIN ((unsigned char)0)
3145 #endif
3147 #ifndef PERL_UCHAR_MAX
3148 # ifdef UCHAR_MAX
3149 # define PERL_UCHAR_MAX ((unsigned char)UCHAR_MAX)
3150 # else
3151 # ifdef MAXUCHAR
3152 # define PERL_UCHAR_MAX ((unsigned char)MAXUCHAR)
3153 # else
3154 # define PERL_UCHAR_MAX ((unsigned char)~(unsigned)0)
3155 # endif
3156 # endif
3157 #endif
3159 #ifndef PERL_USHORT_MIN
3160 # define PERL_USHORT_MIN ((unsigned short)0)
3161 #endif
3163 #ifndef PERL_USHORT_MAX
3164 # ifdef USHORT_MAX
3165 # define PERL_USHORT_MAX ((unsigned short)USHORT_MAX)
3166 # else
3167 # ifdef MAXUSHORT
3168 # define PERL_USHORT_MAX ((unsigned short)MAXUSHORT)
3169 # else
3170 # ifdef USHRT_MAX
3171 # define PERL_USHORT_MAX ((unsigned short)USHRT_MAX)
3172 # else
3173 # define PERL_USHORT_MAX ((unsigned short)~(unsigned)0)
3174 # endif
3175 # endif
3176 # endif
3177 #endif
3179 #ifndef PERL_SHORT_MAX
3180 # ifdef SHORT_MAX
3181 # define PERL_SHORT_MAX ((short)SHORT_MAX)
3182 # else
3183 # ifdef MAXSHORT /* Often used in <values.h> */
3184 # define PERL_SHORT_MAX ((short)MAXSHORT)
3185 # else
3186 # ifdef SHRT_MAX
3187 # define PERL_SHORT_MAX ((short)SHRT_MAX)
3188 # else
3189 # define PERL_SHORT_MAX ((short) (PERL_USHORT_MAX >> 1))
3190 # endif
3191 # endif
3192 # endif
3193 #endif
3195 #ifndef PERL_SHORT_MIN
3196 # ifdef SHORT_MIN
3197 # define PERL_SHORT_MIN ((short)SHORT_MIN)
3198 # else
3199 # ifdef MINSHORT
3200 # define PERL_SHORT_MIN ((short)MINSHORT)
3201 # else
3202 # ifdef SHRT_MIN
3203 # define PERL_SHORT_MIN ((short)SHRT_MIN)
3204 # else
3205 # define PERL_SHORT_MIN (-PERL_SHORT_MAX - ((3 & -1) == 3))
3206 # endif
3207 # endif
3208 # endif
3209 #endif
3211 #ifndef PERL_UINT_MAX
3212 # ifdef UINT_MAX
3213 # define PERL_UINT_MAX ((unsigned int)UINT_MAX)
3214 # else
3215 # ifdef MAXUINT
3216 # define PERL_UINT_MAX ((unsigned int)MAXUINT)
3217 # else
3218 # define PERL_UINT_MAX (~(unsigned int)0)
3219 # endif
3220 # endif
3221 #endif
3223 #ifndef PERL_UINT_MIN
3224 # define PERL_UINT_MIN ((unsigned int)0)
3225 #endif
3227 #ifndef PERL_INT_MAX
3228 # ifdef INT_MAX
3229 # define PERL_INT_MAX ((int)INT_MAX)
3230 # else
3231 # ifdef MAXINT /* Often used in <values.h> */
3232 # define PERL_INT_MAX ((int)MAXINT)
3233 # else
3234 # define PERL_INT_MAX ((int)(PERL_UINT_MAX >> 1))
3235 # endif
3236 # endif
3237 #endif
3239 #ifndef PERL_INT_MIN
3240 # ifdef INT_MIN
3241 # define PERL_INT_MIN ((int)INT_MIN)
3242 # else
3243 # ifdef MININT
3244 # define PERL_INT_MIN ((int)MININT)
3245 # else
3246 # define PERL_INT_MIN (-PERL_INT_MAX - ((3 & -1) == 3))
3247 # endif
3248 # endif
3249 #endif
3251 #ifndef PERL_ULONG_MAX
3252 # ifdef ULONG_MAX
3253 # define PERL_ULONG_MAX ((unsigned long)ULONG_MAX)
3254 # else
3255 # ifdef MAXULONG
3256 # define PERL_ULONG_MAX ((unsigned long)MAXULONG)
3257 # else
3258 # define PERL_ULONG_MAX (~(unsigned long)0)
3259 # endif
3260 # endif
3261 #endif
3263 #ifndef PERL_ULONG_MIN
3264 # define PERL_ULONG_MIN ((unsigned long)0L)
3265 #endif
3267 #ifndef PERL_LONG_MAX
3268 # ifdef LONG_MAX
3269 # define PERL_LONG_MAX ((long)LONG_MAX)
3270 # else
3271 # ifdef MAXLONG
3272 # define PERL_LONG_MAX ((long)MAXLONG)
3273 # else
3274 # define PERL_LONG_MAX ((long) (PERL_ULONG_MAX >> 1))
3275 # endif
3276 # endif
3277 #endif
3279 #ifndef PERL_LONG_MIN
3280 # ifdef LONG_MIN
3281 # define PERL_LONG_MIN ((long)LONG_MIN)
3282 # else
3283 # ifdef MINLONG
3284 # define PERL_LONG_MIN ((long)MINLONG)
3285 # else
3286 # define PERL_LONG_MIN (-PERL_LONG_MAX - ((3 & -1) == 3))
3287 # endif
3288 # endif
3289 #endif
3291 #if defined(HAS_QUAD) && (defined(convex) || defined(uts))
3292 # ifndef PERL_UQUAD_MAX
3293 # ifdef ULONGLONG_MAX
3294 # define PERL_UQUAD_MAX ((unsigned long long)ULONGLONG_MAX)
3295 # else
3296 # ifdef MAXULONGLONG
3297 # define PERL_UQUAD_MAX ((unsigned long long)MAXULONGLONG)
3298 # else
3299 # define PERL_UQUAD_MAX (~(unsigned long long)0)
3300 # endif
3301 # endif
3302 # endif
3304 # ifndef PERL_UQUAD_MIN
3305 # define PERL_UQUAD_MIN ((unsigned long long)0L)
3306 # endif
3308 # ifndef PERL_QUAD_MAX
3309 # ifdef LONGLONG_MAX
3310 # define PERL_QUAD_MAX ((long long)LONGLONG_MAX)
3311 # else
3312 # ifdef MAXLONGLONG
3313 # define PERL_QUAD_MAX ((long long)MAXLONGLONG)
3314 # else
3315 # define PERL_QUAD_MAX ((long long) (PERL_UQUAD_MAX >> 1))
3316 # endif
3317 # endif
3318 # endif
3320 # ifndef PERL_QUAD_MIN
3321 # ifdef LONGLONG_MIN
3322 # define PERL_QUAD_MIN ((long long)LONGLONG_MIN)
3323 # else
3324 # ifdef MINLONGLONG
3325 # define PERL_QUAD_MIN ((long long)MINLONGLONG)
3326 # else
3327 # define PERL_QUAD_MIN (-PERL_QUAD_MAX - ((3 & -1) == 3))
3328 # endif
3329 # endif
3330 # endif
3331 #endif
3333 /* This is based on code from 5.003 perl.h */
3334 #ifdef HAS_QUAD
3335 # ifdef cray
3336 #ifndef IVTYPE
3337 # define IVTYPE int
3338 #endif
3340 #ifndef IV_MIN
3341 # define IV_MIN PERL_INT_MIN
3342 #endif
3344 #ifndef IV_MAX
3345 # define IV_MAX PERL_INT_MAX
3346 #endif
3348 #ifndef UV_MIN
3349 # define UV_MIN PERL_UINT_MIN
3350 #endif
3352 #ifndef UV_MAX
3353 # define UV_MAX PERL_UINT_MAX
3354 #endif
3356 # ifdef INTSIZE
3357 #ifndef IVSIZE
3358 # define IVSIZE INTSIZE
3359 #endif
3361 # endif
3362 # else
3363 # if defined(convex) || defined(uts)
3364 #ifndef IVTYPE
3365 # define IVTYPE long long
3366 #endif
3368 #ifndef IV_MIN
3369 # define IV_MIN PERL_QUAD_MIN
3370 #endif
3372 #ifndef IV_MAX
3373 # define IV_MAX PERL_QUAD_MAX
3374 #endif
3376 #ifndef UV_MIN
3377 # define UV_MIN PERL_UQUAD_MIN
3378 #endif
3380 #ifndef UV_MAX
3381 # define UV_MAX PERL_UQUAD_MAX
3382 #endif
3384 # ifdef LONGLONGSIZE
3385 #ifndef IVSIZE
3386 # define IVSIZE LONGLONGSIZE
3387 #endif
3389 # endif
3390 # else
3391 #ifndef IVTYPE
3392 # define IVTYPE long
3393 #endif
3395 #ifndef IV_MIN
3396 # define IV_MIN PERL_LONG_MIN
3397 #endif
3399 #ifndef IV_MAX
3400 # define IV_MAX PERL_LONG_MAX
3401 #endif
3403 #ifndef UV_MIN
3404 # define UV_MIN PERL_ULONG_MIN
3405 #endif
3407 #ifndef UV_MAX
3408 # define UV_MAX PERL_ULONG_MAX
3409 #endif
3411 # ifdef LONGSIZE
3412 #ifndef IVSIZE
3413 # define IVSIZE LONGSIZE
3414 #endif
3416 # endif
3417 # endif
3418 # endif
3419 #ifndef IVSIZE
3420 # define IVSIZE 8
3421 #endif
3423 #ifndef PERL_QUAD_MIN
3424 # define PERL_QUAD_MIN IV_MIN
3425 #endif
3427 #ifndef PERL_QUAD_MAX
3428 # define PERL_QUAD_MAX IV_MAX
3429 #endif
3431 #ifndef PERL_UQUAD_MIN
3432 # define PERL_UQUAD_MIN UV_MIN
3433 #endif
3435 #ifndef PERL_UQUAD_MAX
3436 # define PERL_UQUAD_MAX UV_MAX
3437 #endif
3439 #else
3440 #ifndef IVTYPE
3441 # define IVTYPE long
3442 #endif
3444 #ifndef IV_MIN
3445 # define IV_MIN PERL_LONG_MIN
3446 #endif
3448 #ifndef IV_MAX
3449 # define IV_MAX PERL_LONG_MAX
3450 #endif
3452 #ifndef UV_MIN
3453 # define UV_MIN PERL_ULONG_MIN
3454 #endif
3456 #ifndef UV_MAX
3457 # define UV_MAX PERL_ULONG_MAX
3458 #endif
3460 #endif
3462 #ifndef IVSIZE
3463 # ifdef LONGSIZE
3464 # define IVSIZE LONGSIZE
3465 # else
3466 # define IVSIZE 4 /* A bold guess, but the best we can make. */
3467 # endif
3468 #endif
3469 #ifndef UVTYPE
3470 # define UVTYPE unsigned IVTYPE
3471 #endif
3473 #ifndef UVSIZE
3474 # define UVSIZE IVSIZE
3475 #endif
3476 #ifndef sv_setuv
3477 # define sv_setuv(sv, uv) \
3478 STMT_START { \
3479 UV TeMpUv = uv; \
3480 if (TeMpUv <= IV_MAX) \
3481 sv_setiv(sv, TeMpUv); \
3482 else \
3483 sv_setnv(sv, (double)TeMpUv); \
3484 } STMT_END
3485 #endif
3486 #ifndef newSVuv
3487 # define newSVuv(uv) ((uv) <= IV_MAX ? newSViv((IV)uv) : newSVnv((NV)uv))
3488 #endif
3489 #ifndef sv_2uv
3490 # define sv_2uv(sv) ((PL_Sv = (sv)), (UV) (SvNOK(PL_Sv) ? SvNV(PL_Sv) : sv_2nv(PL_Sv)))
3491 #endif
3493 #ifndef SvUVX
3494 # define SvUVX(sv) ((UV)SvIVX(sv))
3495 #endif
3497 #ifndef SvUVXx
3498 # define SvUVXx(sv) SvUVX(sv)
3499 #endif
3501 #ifndef SvUV
3502 # define SvUV(sv) (SvIOK(sv) ? SvUVX(sv) : sv_2uv(sv))
3503 #endif
3505 #ifndef SvUVx
3506 # define SvUVx(sv) ((PL_Sv = (sv)), SvUV(PL_Sv))
3507 #endif
3509 /* Hint: sv_uv
3510 * Always use the SvUVx() macro instead of sv_uv().
3512 #ifndef sv_uv
3513 # define sv_uv(sv) SvUVx(sv)
3514 #endif
3516 #if !defined(SvUOK) && defined(SvIOK_UV)
3517 # define SvUOK(sv) SvIOK_UV(sv)
3518 #endif
3519 #ifndef XST_mUV
3520 # define XST_mUV(i,v) (ST(i) = sv_2mortal(newSVuv(v)) )
3521 #endif
3523 #ifndef XSRETURN_UV
3524 # define XSRETURN_UV(v) STMT_START { XST_mUV(0,v); XSRETURN(1); } STMT_END
3525 #endif
3526 #ifndef PUSHu
3527 # define PUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); PUSHTARG; } STMT_END
3528 #endif
3530 #ifndef XPUSHu
3531 # define XPUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); XPUSHTARG; } STMT_END
3532 #endif
3534 #ifdef HAS_MEMCMP
3535 #ifndef memNE
3536 # define memNE(s1,s2,l) (memcmp(s1,s2,l))
3537 #endif
3539 #ifndef memEQ
3540 # define memEQ(s1,s2,l) (!memcmp(s1,s2,l))
3541 #endif
3543 #else
3544 #ifndef memNE
3545 # define memNE(s1,s2,l) (bcmp(s1,s2,l))
3546 #endif
3548 #ifndef memEQ
3549 # define memEQ(s1,s2,l) (!bcmp(s1,s2,l))
3550 #endif
3552 #endif
3553 #ifndef MoveD
3554 # define MoveD(s,d,n,t) memmove((char*)(d),(char*)(s), (n) * sizeof(t))
3555 #endif
3557 #ifndef CopyD
3558 # define CopyD(s,d,n,t) memcpy((char*)(d),(char*)(s), (n) * sizeof(t))
3559 #endif
3561 #ifdef HAS_MEMSET
3562 #ifndef ZeroD
3563 # define ZeroD(d,n,t) memzero((char*)(d), (n) * sizeof(t))
3564 #endif
3566 #else
3567 #ifndef ZeroD
3568 # define ZeroD(d,n,t) ((void)memzero((char*)(d), (n) * sizeof(t)), d)
3569 #endif
3571 #endif
3572 #ifndef PoisonWith
3573 # define PoisonWith(d,n,t,b) (void)memset((char*)(d), (U8)(b), (n) * sizeof(t))
3574 #endif
3576 #ifndef PoisonNew
3577 # define PoisonNew(d,n,t) PoisonWith(d,n,t,0xAB)
3578 #endif
3580 #ifndef PoisonFree
3581 # define PoisonFree(d,n,t) PoisonWith(d,n,t,0xEF)
3582 #endif
3584 #ifndef Poison
3585 # define Poison(d,n,t) PoisonFree(d,n,t)
3586 #endif
3587 #ifndef Newx
3588 # define Newx(v,n,t) New(0,v,n,t)
3589 #endif
3591 #ifndef Newxc
3592 # define Newxc(v,n,t,c) Newc(0,v,n,t,c)
3593 #endif
3595 #ifndef Newxz
3596 # define Newxz(v,n,t) Newz(0,v,n,t)
3597 #endif
3599 #ifndef PERL_UNUSED_DECL
3600 # ifdef HASATTRIBUTE
3601 # if (defined(__GNUC__) && defined(__cplusplus)) || defined(__INTEL_COMPILER)
3602 # define PERL_UNUSED_DECL
3603 # else
3604 # define PERL_UNUSED_DECL __attribute__((unused))
3605 # endif
3606 # else
3607 # define PERL_UNUSED_DECL
3608 # endif
3609 #endif
3611 #ifndef PERL_UNUSED_ARG
3612 # if defined(lint) && defined(S_SPLINT_S) /* www.splint.org */
3613 # include <note.h>
3614 # define PERL_UNUSED_ARG(x) NOTE(ARGUNUSED(x))
3615 # else
3616 # define PERL_UNUSED_ARG(x) ((void)x)
3617 # endif
3618 #endif
3620 #ifndef PERL_UNUSED_VAR
3621 # define PERL_UNUSED_VAR(x) ((void)x)
3622 #endif
3624 #ifndef PERL_UNUSED_CONTEXT
3625 # ifdef USE_ITHREADS
3626 # define PERL_UNUSED_CONTEXT PERL_UNUSED_ARG(my_perl)
3627 # else
3628 # define PERL_UNUSED_CONTEXT
3629 # endif
3630 #endif
3631 #ifndef NOOP
3632 # define NOOP /*EMPTY*/(void)0
3633 #endif
3635 #ifndef dNOOP
3636 # define dNOOP extern int /*@unused@*/ Perl___notused PERL_UNUSED_DECL
3637 #endif
3639 #ifndef NVTYPE
3640 # if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
3641 # define NVTYPE long double
3642 # else
3643 # define NVTYPE double
3644 # endif
3645 typedef NVTYPE NV;
3646 #endif
3648 #ifndef INT2PTR
3650 # if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
3651 # define PTRV UV
3652 # define INT2PTR(any,d) (any)(d)
3653 # else
3654 # if PTRSIZE == LONGSIZE
3655 # define PTRV unsigned long
3656 # else
3657 # define PTRV unsigned
3658 # endif
3659 # define INT2PTR(any,d) (any)(PTRV)(d)
3660 # endif
3662 # define NUM2PTR(any,d) (any)(PTRV)(d)
3663 # define PTR2IV(p) INT2PTR(IV,p)
3664 # define PTR2UV(p) INT2PTR(UV,p)
3665 # define PTR2NV(p) NUM2PTR(NV,p)
3667 # if PTRSIZE == LONGSIZE
3668 # define PTR2ul(p) (unsigned long)(p)
3669 # else
3670 # define PTR2ul(p) INT2PTR(unsigned long,p)
3671 # endif
3673 #endif /* !INT2PTR */
3675 #undef START_EXTERN_C
3676 #undef END_EXTERN_C
3677 #undef EXTERN_C
3678 #ifdef __cplusplus
3679 # define START_EXTERN_C extern "C" {
3680 # define END_EXTERN_C }
3681 # define EXTERN_C extern "C"
3682 #else
3683 # define START_EXTERN_C
3684 # define END_EXTERN_C
3685 # define EXTERN_C extern
3686 #endif
3688 #if defined(PERL_GCC_PEDANTIC)
3689 # ifndef PERL_GCC_BRACE_GROUPS_FORBIDDEN
3690 # define PERL_GCC_BRACE_GROUPS_FORBIDDEN
3691 # endif
3692 #endif
3694 #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) && !defined(__cplusplus)
3695 # ifndef PERL_USE_GCC_BRACE_GROUPS
3696 # define PERL_USE_GCC_BRACE_GROUPS
3697 # endif
3698 #endif
3700 #undef STMT_START
3701 #undef STMT_END
3702 #ifdef PERL_USE_GCC_BRACE_GROUPS
3703 # define STMT_START (void)( /* gcc supports ``({ STATEMENTS; })'' */
3704 # define STMT_END )
3705 #else
3706 # if defined(VOIDFLAGS) && (VOIDFLAGS) && (defined(sun) || defined(__sun__)) && !defined(__GNUC__)
3707 # define STMT_START if (1)
3708 # define STMT_END else (void)0
3709 # else
3710 # define STMT_START do
3711 # define STMT_END while (0)
3712 # endif
3713 #endif
3714 #ifndef boolSV
3715 # define boolSV(b) ((b) ? &PL_sv_yes : &PL_sv_no)
3716 #endif
3718 /* DEFSV appears first in 5.004_56 */
3719 #ifndef DEFSV
3720 # define DEFSV GvSV(PL_defgv)
3721 #endif
3723 #ifndef SAVE_DEFSV
3724 # define SAVE_DEFSV SAVESPTR(GvSV(PL_defgv))
3725 #endif
3727 /* Older perls (<=5.003) lack AvFILLp */
3728 #ifndef AvFILLp
3729 # define AvFILLp AvFILL
3730 #endif
3731 #ifndef ERRSV
3732 # define ERRSV get_sv("@",FALSE)
3733 #endif
3735 /* Hint: gv_stashpvn
3736 * This function's backport doesn't support the length parameter, but
3737 * rather ignores it. Portability can only be ensured if the length
3738 * parameter is used for speed reasons, but the length can always be
3739 * correctly computed from the string argument.
3741 #ifndef gv_stashpvn
3742 # define gv_stashpvn(str,len,create) gv_stashpv(str,create)
3743 #endif
3745 /* Replace: 1 */
3746 #ifndef get_cv
3747 # define get_cv perl_get_cv
3748 #endif
3750 #ifndef get_sv
3751 # define get_sv perl_get_sv
3752 #endif
3754 #ifndef get_av
3755 # define get_av perl_get_av
3756 #endif
3758 #ifndef get_hv
3759 # define get_hv perl_get_hv
3760 #endif
3762 /* Replace: 0 */
3763 #ifndef dUNDERBAR
3764 # define dUNDERBAR dNOOP
3765 #endif
3767 #ifndef UNDERBAR
3768 # define UNDERBAR DEFSV
3769 #endif
3770 #ifndef dAX
3771 # define dAX I32 ax = MARK - PL_stack_base + 1
3772 #endif
3774 #ifndef dITEMS
3775 # define dITEMS I32 items = SP - MARK
3776 #endif
3777 #ifndef dXSTARG
3778 # define dXSTARG SV * targ = sv_newmortal()
3779 #endif
3780 #ifndef dAXMARK
3781 # define dAXMARK I32 ax = POPMARK; \
3782 register SV ** const mark = PL_stack_base + ax++
3783 #endif
3784 #ifndef XSprePUSH
3785 # define XSprePUSH (sp = PL_stack_base + ax - 1)
3786 #endif
3788 #if (PERL_BCDVERSION < 0x5005000)
3789 # undef XSRETURN
3790 # define XSRETURN(off) \
3791 STMT_START { \
3792 PL_stack_sp = PL_stack_base + ax + ((off) - 1); \
3793 return; \
3794 } STMT_END
3795 #endif
3796 #ifndef PERL_ABS
3797 # define PERL_ABS(x) ((x) < 0 ? -(x) : (x))
3798 #endif
3799 #ifndef dVAR
3800 # define dVAR dNOOP
3801 #endif
3802 #ifndef SVf
3803 # define SVf "_"
3804 #endif
3805 #ifndef UTF8_MAXBYTES
3806 # define UTF8_MAXBYTES UTF8_MAXLEN
3807 #endif
3808 #ifndef PERL_HASH
3809 # define PERL_HASH(hash,str,len) \
3810 STMT_START { \
3811 const char *s_PeRlHaSh = str; \
3812 I32 i_PeRlHaSh = len; \
3813 U32 hash_PeRlHaSh = 0; \
3814 while (i_PeRlHaSh--) \
3815 hash_PeRlHaSh = hash_PeRlHaSh * 33 + *s_PeRlHaSh++; \
3816 (hash) = hash_PeRlHaSh; \
3817 } STMT_END
3818 #endif
3820 #ifndef PERLIO_FUNCS_DECL
3821 # ifdef PERLIO_FUNCS_CONST
3822 # define PERLIO_FUNCS_DECL(funcs) const PerlIO_funcs funcs
3823 # define PERLIO_FUNCS_CAST(funcs) (PerlIO_funcs*)(funcs)
3824 # else
3825 # define PERLIO_FUNCS_DECL(funcs) PerlIO_funcs funcs
3826 # define PERLIO_FUNCS_CAST(funcs) (funcs)
3827 # endif
3828 #endif
3830 #ifndef PERL_SIGNALS_UNSAFE_FLAG
3832 #define PERL_SIGNALS_UNSAFE_FLAG 0x0001
3834 #if (PERL_BCDVERSION < 0x5008000)
3835 # define D_PPP_PERL_SIGNALS_INIT PERL_SIGNALS_UNSAFE_FLAG
3836 #else
3837 # define D_PPP_PERL_SIGNALS_INIT 0
3838 #endif
3840 #if defined(NEED_PL_signals)
3841 static U32 DPPP_(my_PL_signals) = D_PPP_PERL_SIGNALS_INIT;
3842 #elif defined(NEED_PL_signals_GLOBAL)
3843 U32 DPPP_(my_PL_signals) = D_PPP_PERL_SIGNALS_INIT;
3844 #else
3845 extern U32 DPPP_(my_PL_signals);
3846 #endif
3847 #define PL_signals DPPP_(my_PL_signals)
3849 #endif
3851 /* Hint: PL_ppaddr
3852 * Calling an op via PL_ppaddr requires passing a context argument
3853 * for threaded builds. Since the context argument is different for
3854 * 5.005 perls, you can use aTHXR (supplied by ppport.h), which will
3855 * automatically be defined as the correct argument.
3858 #if (PERL_BCDVERSION <= 0x5005005)
3859 /* Replace: 1 */
3860 # define PL_ppaddr ppaddr
3861 # define PL_no_modify no_modify
3862 /* Replace: 0 */
3863 #endif
3865 #if (PERL_BCDVERSION <= 0x5004005)
3866 /* Replace: 1 */
3867 # define PL_DBsignal DBsignal
3868 # define PL_DBsingle DBsingle
3869 # define PL_DBsub DBsub
3870 # define PL_DBtrace DBtrace
3871 # define PL_Sv Sv
3872 # define PL_compiling compiling
3873 # define PL_copline copline
3874 # define PL_curcop curcop
3875 # define PL_curstash curstash
3876 # define PL_debstash debstash
3877 # define PL_defgv defgv
3878 # define PL_diehook diehook
3879 # define PL_dirty dirty
3880 # define PL_dowarn dowarn
3881 # define PL_errgv errgv
3882 # define PL_expect expect
3883 # define PL_hexdigit hexdigit
3884 # define PL_hints hints
3885 # define PL_laststatval laststatval
3886 # define PL_na na
3887 # define PL_perl_destruct_level perl_destruct_level
3888 # define PL_perldb perldb
3889 # define PL_rsfp_filters rsfp_filters
3890 # define PL_rsfp rsfp
3891 # define PL_stack_base stack_base
3892 # define PL_stack_sp stack_sp
3893 # define PL_statcache statcache
3894 # define PL_stdingv stdingv
3895 # define PL_sv_arenaroot sv_arenaroot
3896 # define PL_sv_no sv_no
3897 # define PL_sv_undef sv_undef
3898 # define PL_sv_yes sv_yes
3899 # define PL_tainted tainted
3900 # define PL_tainting tainting
3901 /* Replace: 0 */
3902 #endif
3904 /* Warning: PL_expect, PL_copline, PL_rsfp, PL_rsfp_filters
3905 * Do not use this variable. It is internal to the perl parser
3906 * and may change or even be removed in the future. Note that
3907 * as of perl 5.9.5 you cannot assign to this variable anymore.
3910 /* TODO: cannot assign to these vars; is it worth fixing? */
3911 #if (PERL_BCDVERSION >= 0x5009005)
3912 # define PL_expect (PL_parser ? PL_parser->expect : 0)
3913 # define PL_copline (PL_parser ? PL_parser->copline : 0)
3914 # define PL_rsfp (PL_parser ? PL_parser->rsfp : (PerlIO *) 0)
3915 # define PL_rsfp_filters (PL_parser ? PL_parser->rsfp_filters : (AV *) 0)
3916 #endif
3917 #ifndef dTHR
3918 # define dTHR dNOOP
3919 #endif
3920 #ifndef dTHX
3921 # define dTHX dNOOP
3922 #endif
3924 #ifndef dTHXa
3925 # define dTHXa(x) dNOOP
3926 #endif
3927 #ifndef pTHX
3928 # define pTHX void
3929 #endif
3931 #ifndef pTHX_
3932 # define pTHX_
3933 #endif
3935 #ifndef aTHX
3936 # define aTHX
3937 #endif
3939 #ifndef aTHX_
3940 # define aTHX_
3941 #endif
3943 #if (PERL_BCDVERSION < 0x5006000)
3944 # ifdef USE_THREADS
3945 # define aTHXR thr
3946 # define aTHXR_ thr,
3947 # else
3948 # define aTHXR
3949 # define aTHXR_
3950 # endif
3951 # define dTHXR dTHR
3952 #else
3953 # define aTHXR aTHX
3954 # define aTHXR_ aTHX_
3955 # define dTHXR dTHX
3956 #endif
3957 #ifndef dTHXoa
3958 # define dTHXoa(x) dTHXa(x)
3959 #endif
3960 #ifndef mPUSHs
3961 # define mPUSHs(s) PUSHs(sv_2mortal(s))
3962 #endif
3964 #ifndef PUSHmortal
3965 # define PUSHmortal PUSHs(sv_newmortal())
3966 #endif
3968 #ifndef mPUSHp
3969 # define mPUSHp(p,l) sv_setpvn(PUSHmortal, (p), (l))
3970 #endif
3972 #ifndef mPUSHn
3973 # define mPUSHn(n) sv_setnv(PUSHmortal, (NV)(n))
3974 #endif
3976 #ifndef mPUSHi
3977 # define mPUSHi(i) sv_setiv(PUSHmortal, (IV)(i))
3978 #endif
3980 #ifndef mPUSHu
3981 # define mPUSHu(u) sv_setuv(PUSHmortal, (UV)(u))
3982 #endif
3983 #ifndef mXPUSHs
3984 # define mXPUSHs(s) XPUSHs(sv_2mortal(s))
3985 #endif
3987 #ifndef XPUSHmortal
3988 # define XPUSHmortal XPUSHs(sv_newmortal())
3989 #endif
3991 #ifndef mXPUSHp
3992 # define mXPUSHp(p,l) STMT_START { EXTEND(sp,1); sv_setpvn(PUSHmortal, (p), (l)); } STMT_END
3993 #endif
3995 #ifndef mXPUSHn
3996 # define mXPUSHn(n) STMT_START { EXTEND(sp,1); sv_setnv(PUSHmortal, (NV)(n)); } STMT_END
3997 #endif
3999 #ifndef mXPUSHi
4000 # define mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT_END
4001 #endif
4003 #ifndef mXPUSHu
4004 # define mXPUSHu(u) STMT_START { EXTEND(sp,1); sv_setuv(PUSHmortal, (UV)(u)); } STMT_END
4005 #endif
4007 /* Replace: 1 */
4008 #ifndef call_sv
4009 # define call_sv perl_call_sv
4010 #endif
4012 #ifndef call_pv
4013 # define call_pv perl_call_pv
4014 #endif
4016 #ifndef call_argv
4017 # define call_argv perl_call_argv
4018 #endif
4020 #ifndef call_method
4021 # define call_method perl_call_method
4022 #endif
4023 #ifndef eval_sv
4024 # define eval_sv perl_eval_sv
4025 #endif
4026 #ifndef PERL_LOADMOD_DENY
4027 # define PERL_LOADMOD_DENY 0x1
4028 #endif
4030 #ifndef PERL_LOADMOD_NOIMPORT
4031 # define PERL_LOADMOD_NOIMPORT 0x2
4032 #endif
4034 #ifndef PERL_LOADMOD_IMPORT_OPS
4035 # define PERL_LOADMOD_IMPORT_OPS 0x4
4036 #endif
4038 /* Replace: 0 */
4040 /* Replace perl_eval_pv with eval_pv */
4042 #ifndef eval_pv
4043 #if defined(NEED_eval_pv)
4044 static SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error);
4045 static
4046 #else
4047 extern SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error);
4048 #endif
4050 #ifdef eval_pv
4051 # undef eval_pv
4052 #endif
4053 #define eval_pv(a,b) DPPP_(my_eval_pv)(aTHX_ a,b)
4054 #define Perl_eval_pv DPPP_(my_eval_pv)
4056 #if defined(NEED_eval_pv) || defined(NEED_eval_pv_GLOBAL)
4059 DPPP_(my_eval_pv)(char *p, I32 croak_on_error)
4061 dSP;
4062 SV* sv = newSVpv(p, 0);
4064 PUSHMARK(sp);
4065 eval_sv(sv, G_SCALAR);
4066 SvREFCNT_dec(sv);
4068 SPAGAIN;
4069 sv = POPs;
4070 PUTBACK;
4072 if (croak_on_error && SvTRUE(GvSV(errgv)))
4073 croak(SvPVx(GvSV(errgv), na));
4075 return sv;
4078 #endif
4079 #endif
4081 #ifndef vload_module
4082 #if defined(NEED_vload_module)
4083 static void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args);
4084 static
4085 #else
4086 extern void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args);
4087 #endif
4089 #ifdef vload_module
4090 # undef vload_module
4091 #endif
4092 #define vload_module(a,b,c,d) DPPP_(my_vload_module)(aTHX_ a,b,c,d)
4093 #define Perl_vload_module DPPP_(my_vload_module)
4095 #if defined(NEED_vload_module) || defined(NEED_vload_module_GLOBAL)
4097 void
4098 DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args)
4100 dTHR;
4101 dVAR;
4102 OP *veop, *imop;
4104 OP * const modname = newSVOP(OP_CONST, 0, name);
4105 /* 5.005 has a somewhat hacky force_normal that doesn't croak on
4106 SvREADONLY() if PL_compling is true. Current perls take care in
4107 ck_require() to correctly turn off SvREADONLY before calling
4108 force_normal_flags(). This seems a better fix than fudging PL_compling
4110 SvREADONLY_off(((SVOP*)modname)->op_sv);
4111 modname->op_private |= OPpCONST_BARE;
4112 if (ver) {
4113 veop = newSVOP(OP_CONST, 0, ver);
4115 else
4116 veop = NULL;
4117 if (flags & PERL_LOADMOD_NOIMPORT) {
4118 imop = sawparens(newNULLLIST());
4120 else if (flags & PERL_LOADMOD_IMPORT_OPS) {
4121 imop = va_arg(*args, OP*);
4123 else {
4124 SV *sv;
4125 imop = NULL;
4126 sv = va_arg(*args, SV*);
4127 while (sv) {
4128 imop = append_elem(OP_LIST, imop, newSVOP(OP_CONST, 0, sv));
4129 sv = va_arg(*args, SV*);
4133 const line_t ocopline = PL_copline;
4134 COP * const ocurcop = PL_curcop;
4135 const int oexpect = PL_expect;
4137 #if (PERL_BCDVERSION >= 0x5004000)
4138 utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(FALSE, 0),
4139 veop, modname, imop);
4140 #else
4141 utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(),
4142 modname, imop);
4143 #endif
4144 PL_expect = oexpect;
4145 PL_copline = ocopline;
4146 PL_curcop = ocurcop;
4150 #endif
4151 #endif
4153 #ifndef load_module
4154 #if defined(NEED_load_module)
4155 static void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...);
4156 static
4157 #else
4158 extern void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...);
4159 #endif
4161 #ifdef load_module
4162 # undef load_module
4163 #endif
4164 #define load_module DPPP_(my_load_module)
4165 #define Perl_load_module DPPP_(my_load_module)
4167 #if defined(NEED_load_module) || defined(NEED_load_module_GLOBAL)
4169 void
4170 DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...)
4172 va_list args;
4173 va_start(args, ver);
4174 vload_module(flags, name, ver, &args);
4175 va_end(args);
4178 #endif
4179 #endif
4180 #ifndef newRV_inc
4181 # define newRV_inc(sv) newRV(sv) /* Replace */
4182 #endif
4184 #ifndef newRV_noinc
4185 #if defined(NEED_newRV_noinc)
4186 static SV * DPPP_(my_newRV_noinc)(SV *sv);
4187 static
4188 #else
4189 extern SV * DPPP_(my_newRV_noinc)(SV *sv);
4190 #endif
4192 #ifdef newRV_noinc
4193 # undef newRV_noinc
4194 #endif
4195 #define newRV_noinc(a) DPPP_(my_newRV_noinc)(aTHX_ a)
4196 #define Perl_newRV_noinc DPPP_(my_newRV_noinc)
4198 #if defined(NEED_newRV_noinc) || defined(NEED_newRV_noinc_GLOBAL)
4199 SV *
4200 DPPP_(my_newRV_noinc)(SV *sv)
4202 SV *rv = (SV *)newRV(sv);
4203 SvREFCNT_dec(sv);
4204 return rv;
4206 #endif
4207 #endif
4209 /* Hint: newCONSTSUB
4210 * Returns a CV* as of perl-5.7.1. This return value is not supported
4211 * by Devel::PPPort.
4214 /* newCONSTSUB from IO.xs is in the core starting with 5.004_63 */
4215 #if (PERL_BCDVERSION < 0x5004063) && (PERL_BCDVERSION != 0x5004005)
4216 #if defined(NEED_newCONSTSUB)
4217 static void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv);
4218 static
4219 #else
4220 extern void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv);
4221 #endif
4223 #ifdef newCONSTSUB
4224 # undef newCONSTSUB
4225 #endif
4226 #define newCONSTSUB(a,b,c) DPPP_(my_newCONSTSUB)(aTHX_ a,b,c)
4227 #define Perl_newCONSTSUB DPPP_(my_newCONSTSUB)
4229 #if defined(NEED_newCONSTSUB) || defined(NEED_newCONSTSUB_GLOBAL)
4231 void
4232 DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv)
4234 U32 oldhints = PL_hints;
4235 HV *old_cop_stash = PL_curcop->cop_stash;
4236 HV *old_curstash = PL_curstash;
4237 line_t oldline = PL_curcop->cop_line;
4238 PL_curcop->cop_line = PL_copline;
4240 PL_hints &= ~HINT_BLOCK_SCOPE;
4241 if (stash)
4242 PL_curstash = PL_curcop->cop_stash = stash;
4244 newSUB(
4246 #if (PERL_BCDVERSION < 0x5003022)
4247 start_subparse(),
4248 #elif (PERL_BCDVERSION == 0x5003022)
4249 start_subparse(0),
4250 #else /* 5.003_23 onwards */
4251 start_subparse(FALSE, 0),
4252 #endif
4254 newSVOP(OP_CONST, 0, newSVpv((char *) name, 0)),
4255 newSVOP(OP_CONST, 0, &PL_sv_no), /* SvPV(&PL_sv_no) == "" -- GMB */
4256 newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv))
4259 PL_hints = oldhints;
4260 PL_curcop->cop_stash = old_cop_stash;
4261 PL_curstash = old_curstash;
4262 PL_curcop->cop_line = oldline;
4264 #endif
4265 #endif
4268 * Boilerplate macros for initializing and accessing interpreter-local
4269 * data from C. All statics in extensions should be reworked to use
4270 * this, if you want to make the extension thread-safe. See ext/re/re.xs
4271 * for an example of the use of these macros.
4273 * Code that uses these macros is responsible for the following:
4274 * 1. #define MY_CXT_KEY to a unique string, e.g. "DynaLoader_guts"
4275 * 2. Declare a typedef named my_cxt_t that is a structure that contains
4276 * all the data that needs to be interpreter-local.
4277 * 3. Use the START_MY_CXT macro after the declaration of my_cxt_t.
4278 * 4. Use the MY_CXT_INIT macro such that it is called exactly once
4279 * (typically put in the BOOT: section).
4280 * 5. Use the members of the my_cxt_t structure everywhere as
4281 * MY_CXT.member.
4282 * 6. Use the dMY_CXT macro (a declaration) in all the functions that
4283 * access MY_CXT.
4286 #if defined(MULTIPLICITY) || defined(PERL_OBJECT) || \
4287 defined(PERL_CAPI) || defined(PERL_IMPLICIT_CONTEXT)
4289 #ifndef START_MY_CXT
4291 /* This must appear in all extensions that define a my_cxt_t structure,
4292 * right after the definition (i.e. at file scope). The non-threads
4293 * case below uses it to declare the data as static. */
4294 #define START_MY_CXT
4296 #if (PERL_BCDVERSION < 0x5004068)
4297 /* Fetches the SV that keeps the per-interpreter data. */
4298 #define dMY_CXT_SV \
4299 SV *my_cxt_sv = get_sv(MY_CXT_KEY, FALSE)
4300 #else /* >= perl5.004_68 */
4301 #define dMY_CXT_SV \
4302 SV *my_cxt_sv = *hv_fetch(PL_modglobal, MY_CXT_KEY, \
4303 sizeof(MY_CXT_KEY)-1, TRUE)
4304 #endif /* < perl5.004_68 */
4306 /* This declaration should be used within all functions that use the
4307 * interpreter-local data. */
4308 #define dMY_CXT \
4309 dMY_CXT_SV; \
4310 my_cxt_t *my_cxtp = INT2PTR(my_cxt_t*,SvUV(my_cxt_sv))
4312 /* Creates and zeroes the per-interpreter data.
4313 * (We allocate my_cxtp in a Perl SV so that it will be released when
4314 * the interpreter goes away.) */
4315 #define MY_CXT_INIT \
4316 dMY_CXT_SV; \
4317 /* newSV() allocates one more than needed */ \
4318 my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
4319 Zero(my_cxtp, 1, my_cxt_t); \
4320 sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
4322 /* This macro must be used to access members of the my_cxt_t structure.
4323 * e.g. MYCXT.some_data */
4324 #define MY_CXT (*my_cxtp)
4326 /* Judicious use of these macros can reduce the number of times dMY_CXT
4327 * is used. Use is similar to pTHX, aTHX etc. */
4328 #define pMY_CXT my_cxt_t *my_cxtp
4329 #define pMY_CXT_ pMY_CXT,
4330 #define _pMY_CXT ,pMY_CXT
4331 #define aMY_CXT my_cxtp
4332 #define aMY_CXT_ aMY_CXT,
4333 #define _aMY_CXT ,aMY_CXT
4335 #endif /* START_MY_CXT */
4337 #ifndef MY_CXT_CLONE
4338 /* Clones the per-interpreter data. */
4339 #define MY_CXT_CLONE \
4340 dMY_CXT_SV; \
4341 my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
4342 Copy(INT2PTR(my_cxt_t*, SvUV(my_cxt_sv)), my_cxtp, 1, my_cxt_t);\
4343 sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
4344 #endif
4346 #else /* single interpreter */
4348 #ifndef START_MY_CXT
4350 #define START_MY_CXT static my_cxt_t my_cxt;
4351 #define dMY_CXT_SV dNOOP
4352 #define dMY_CXT dNOOP
4353 #define MY_CXT_INIT NOOP
4354 #define MY_CXT my_cxt
4356 #define pMY_CXT void
4357 #define pMY_CXT_
4358 #define _pMY_CXT
4359 #define aMY_CXT
4360 #define aMY_CXT_
4361 #define _aMY_CXT
4363 #endif /* START_MY_CXT */
4365 #ifndef MY_CXT_CLONE
4366 #define MY_CXT_CLONE NOOP
4367 #endif
4369 #endif
4371 #ifndef IVdf
4372 # if IVSIZE == LONGSIZE
4373 # define IVdf "ld"
4374 # define UVuf "lu"
4375 # define UVof "lo"
4376 # define UVxf "lx"
4377 # define UVXf "lX"
4378 # else
4379 # if IVSIZE == INTSIZE
4380 # define IVdf "d"
4381 # define UVuf "u"
4382 # define UVof "o"
4383 # define UVxf "x"
4384 # define UVXf "X"
4385 # endif
4386 # endif
4387 #endif
4389 #ifndef NVef
4390 # if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && \
4391 defined(PERL_PRIfldbl) && (PERL_BCDVERSION != 0x5006000)
4392 /* Not very likely, but let's try anyway. */
4393 # define NVef PERL_PRIeldbl
4394 # define NVff PERL_PRIfldbl
4395 # define NVgf PERL_PRIgldbl
4396 # else
4397 # define NVef "e"
4398 # define NVff "f"
4399 # define NVgf "g"
4400 # endif
4401 #endif
4403 #ifndef SvREFCNT_inc
4404 # ifdef PERL_USE_GCC_BRACE_GROUPS
4405 # define SvREFCNT_inc(sv) \
4406 ({ \
4407 SV * const _sv = (SV*)(sv); \
4408 if (_sv) \
4409 (SvREFCNT(_sv))++; \
4410 _sv; \
4412 # else
4413 # define SvREFCNT_inc(sv) \
4414 ((PL_Sv=(SV*)(sv)) ? (++(SvREFCNT(PL_Sv)),PL_Sv) : NULL)
4415 # endif
4416 #endif
4418 #ifndef SvREFCNT_inc_simple
4419 # ifdef PERL_USE_GCC_BRACE_GROUPS
4420 # define SvREFCNT_inc_simple(sv) \
4421 ({ \
4422 if (sv) \
4423 (SvREFCNT(sv))++; \
4424 (SV *)(sv); \
4426 # else
4427 # define SvREFCNT_inc_simple(sv) \
4428 ((sv) ? (SvREFCNT(sv)++,(SV*)(sv)) : NULL)
4429 # endif
4430 #endif
4432 #ifndef SvREFCNT_inc_NN
4433 # ifdef PERL_USE_GCC_BRACE_GROUPS
4434 # define SvREFCNT_inc_NN(sv) \
4435 ({ \
4436 SV * const _sv = (SV*)(sv); \
4437 SvREFCNT(_sv)++; \
4438 _sv; \
4440 # else
4441 # define SvREFCNT_inc_NN(sv) \
4442 (PL_Sv=(SV*)(sv),++(SvREFCNT(PL_Sv)),PL_Sv)
4443 # endif
4444 #endif
4446 #ifndef SvREFCNT_inc_void
4447 # ifdef PERL_USE_GCC_BRACE_GROUPS
4448 # define SvREFCNT_inc_void(sv) \
4449 ({ \
4450 SV * const _sv = (SV*)(sv); \
4451 if (_sv) \
4452 (void)(SvREFCNT(_sv)++); \
4454 # else
4455 # define SvREFCNT_inc_void(sv) \
4456 (void)((PL_Sv=(SV*)(sv)) ? ++(SvREFCNT(PL_Sv)) : 0)
4457 # endif
4458 #endif
4459 #ifndef SvREFCNT_inc_simple_void
4460 # define SvREFCNT_inc_simple_void(sv) STMT_START { if (sv) SvREFCNT(sv)++; } STMT_END
4461 #endif
4463 #ifndef SvREFCNT_inc_simple_NN
4464 # define SvREFCNT_inc_simple_NN(sv) (++SvREFCNT(sv), (SV*)(sv))
4465 #endif
4467 #ifndef SvREFCNT_inc_void_NN
4468 # define SvREFCNT_inc_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))
4469 #endif
4471 #ifndef SvREFCNT_inc_simple_void_NN
4472 # define SvREFCNT_inc_simple_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))
4473 #endif
4474 #ifndef newSVpvn
4475 # define newSVpvn(data,len) ((data) \
4476 ? ((len) ? newSVpv((data), (len)) : newSVpv("", 0)) \
4477 : newSV(0))
4478 #endif
4479 #ifndef newSVpvn_utf8
4480 # define newSVpvn_utf8(s, len, u) newSVpvn_flags((s), (len), (u) ? SVf_UTF8 : 0)
4481 #endif
4482 #ifndef SVf_UTF8
4483 # define SVf_UTF8 0
4484 #endif
4486 #ifndef newSVpvn_flags
4488 #if defined(NEED_newSVpvn_flags)
4489 static SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags);
4490 static
4491 #else
4492 extern SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags);
4493 #endif
4495 #ifdef newSVpvn_flags
4496 # undef newSVpvn_flags
4497 #endif
4498 #define newSVpvn_flags(a,b,c) DPPP_(my_newSVpvn_flags)(aTHX_ a,b,c)
4499 #define Perl_newSVpvn_flags DPPP_(my_newSVpvn_flags)
4501 #if defined(NEED_newSVpvn_flags) || defined(NEED_newSVpvn_flags_GLOBAL)
4503 SV *
4504 DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags)
4506 SV *sv = newSVpvn(s, len);
4507 SvFLAGS(sv) |= (flags & SVf_UTF8);
4508 return (flags & SVs_TEMP) ? sv_2mortal(sv) : sv;
4511 #endif
4513 #endif
4515 /* Backwards compatibility stuff... :-( */
4516 #if !defined(NEED_sv_2pv_flags) && defined(NEED_sv_2pv_nolen)
4517 # define NEED_sv_2pv_flags
4518 #endif
4519 #if !defined(NEED_sv_2pv_flags_GLOBAL) && defined(NEED_sv_2pv_nolen_GLOBAL)
4520 # define NEED_sv_2pv_flags_GLOBAL
4521 #endif
4523 /* Hint: sv_2pv_nolen
4524 * Use the SvPV_nolen() or SvPV_nolen_const() macros instead of sv_2pv_nolen().
4526 #ifndef sv_2pv_nolen
4527 # define sv_2pv_nolen(sv) SvPV_nolen(sv)
4528 #endif
4530 #ifdef SvPVbyte
4532 /* Hint: SvPVbyte
4533 * Does not work in perl-5.6.1, ppport.h implements a version
4534 * borrowed from perl-5.7.3.
4537 #if (PERL_BCDVERSION < 0x5007000)
4539 #if defined(NEED_sv_2pvbyte)
4540 static char * DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp);
4541 static
4542 #else
4543 extern char * DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp);
4544 #endif
4546 #ifdef sv_2pvbyte
4547 # undef sv_2pvbyte
4548 #endif
4549 #define sv_2pvbyte(a,b) DPPP_(my_sv_2pvbyte)(aTHX_ a,b)
4550 #define Perl_sv_2pvbyte DPPP_(my_sv_2pvbyte)
4552 #if defined(NEED_sv_2pvbyte) || defined(NEED_sv_2pvbyte_GLOBAL)
4554 char *
4555 DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp)
4557 sv_utf8_downgrade(sv,0);
4558 return SvPV(sv,*lp);
4561 #endif
4563 /* Hint: sv_2pvbyte
4564 * Use the SvPVbyte() macro instead of sv_2pvbyte().
4567 #undef SvPVbyte
4569 #define SvPVbyte(sv, lp) \
4570 ((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK) \
4571 ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pvbyte(sv, &lp))
4573 #endif
4575 #else
4577 # define SvPVbyte SvPV
4578 # define sv_2pvbyte sv_2pv
4580 #endif
4581 #ifndef sv_2pvbyte_nolen
4582 # define sv_2pvbyte_nolen(sv) sv_2pv_nolen(sv)
4583 #endif
4585 /* Hint: sv_pvn
4586 * Always use the SvPV() macro instead of sv_pvn().
4589 /* Hint: sv_pvn_force
4590 * Always use the SvPV_force() macro instead of sv_pvn_force().
4593 /* If these are undefined, they're not handled by the core anyway */
4594 #ifndef SV_IMMEDIATE_UNREF
4595 # define SV_IMMEDIATE_UNREF 0
4596 #endif
4598 #ifndef SV_GMAGIC
4599 # define SV_GMAGIC 0
4600 #endif
4602 #ifndef SV_COW_DROP_PV
4603 # define SV_COW_DROP_PV 0
4604 #endif
4606 #ifndef SV_UTF8_NO_ENCODING
4607 # define SV_UTF8_NO_ENCODING 0
4608 #endif
4610 #ifndef SV_NOSTEAL
4611 # define SV_NOSTEAL 0
4612 #endif
4614 #ifndef SV_CONST_RETURN
4615 # define SV_CONST_RETURN 0
4616 #endif
4618 #ifndef SV_MUTABLE_RETURN
4619 # define SV_MUTABLE_RETURN 0
4620 #endif
4622 #ifndef SV_SMAGIC
4623 # define SV_SMAGIC 0
4624 #endif
4626 #ifndef SV_HAS_TRAILING_NUL
4627 # define SV_HAS_TRAILING_NUL 0
4628 #endif
4630 #ifndef SV_COW_SHARED_HASH_KEYS
4631 # define SV_COW_SHARED_HASH_KEYS 0
4632 #endif
4634 #if (PERL_BCDVERSION < 0x5007002)
4636 #if defined(NEED_sv_2pv_flags)
4637 static char * DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
4638 static
4639 #else
4640 extern char * DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
4641 #endif
4643 #ifdef sv_2pv_flags
4644 # undef sv_2pv_flags
4645 #endif
4646 #define sv_2pv_flags(a,b,c) DPPP_(my_sv_2pv_flags)(aTHX_ a,b,c)
4647 #define Perl_sv_2pv_flags DPPP_(my_sv_2pv_flags)
4649 #if defined(NEED_sv_2pv_flags) || defined(NEED_sv_2pv_flags_GLOBAL)
4651 char *
4652 DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags)
4654 STRLEN n_a = (STRLEN) flags;
4655 return sv_2pv(sv, lp ? lp : &n_a);
4658 #endif
4660 #if defined(NEED_sv_pvn_force_flags)
4661 static char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
4662 static
4663 #else
4664 extern char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
4665 #endif
4667 #ifdef sv_pvn_force_flags
4668 # undef sv_pvn_force_flags
4669 #endif
4670 #define sv_pvn_force_flags(a,b,c) DPPP_(my_sv_pvn_force_flags)(aTHX_ a,b,c)
4671 #define Perl_sv_pvn_force_flags DPPP_(my_sv_pvn_force_flags)
4673 #if defined(NEED_sv_pvn_force_flags) || defined(NEED_sv_pvn_force_flags_GLOBAL)
4675 char *
4676 DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags)
4678 STRLEN n_a = (STRLEN) flags;
4679 return sv_pvn_force(sv, lp ? lp : &n_a);
4682 #endif
4684 #endif
4686 #if (PERL_BCDVERSION < 0x5008008) || ( (PERL_BCDVERSION >= 0x5009000) && (PERL_BCDVERSION < 0x5009003) )
4687 # define DPPP_SVPV_NOLEN_LP_ARG &PL_na
4688 #else
4689 # define DPPP_SVPV_NOLEN_LP_ARG 0
4690 #endif
4691 #ifndef SvPV_const
4692 # define SvPV_const(sv, lp) SvPV_flags_const(sv, lp, SV_GMAGIC)
4693 #endif
4695 #ifndef SvPV_mutable
4696 # define SvPV_mutable(sv, lp) SvPV_flags_mutable(sv, lp, SV_GMAGIC)
4697 #endif
4698 #ifndef SvPV_flags
4699 # define SvPV_flags(sv, lp, flags) \
4700 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
4701 ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pv_flags(sv, &lp, flags))
4702 #endif
4703 #ifndef SvPV_flags_const
4704 # define SvPV_flags_const(sv, lp, flags) \
4705 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
4706 ? ((lp = SvCUR(sv)), SvPVX_const(sv)) : \
4707 (const char*) sv_2pv_flags(sv, &lp, flags|SV_CONST_RETURN))
4708 #endif
4709 #ifndef SvPV_flags_const_nolen
4710 # define SvPV_flags_const_nolen(sv, flags) \
4711 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
4712 ? SvPVX_const(sv) : \
4713 (const char*) sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, flags|SV_CONST_RETURN))
4714 #endif
4715 #ifndef SvPV_flags_mutable
4716 # define SvPV_flags_mutable(sv, lp, flags) \
4717 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
4718 ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) : \
4719 sv_2pv_flags(sv, &lp, flags|SV_MUTABLE_RETURN))
4720 #endif
4721 #ifndef SvPV_force
4722 # define SvPV_force(sv, lp) SvPV_force_flags(sv, lp, SV_GMAGIC)
4723 #endif
4725 #ifndef SvPV_force_nolen
4726 # define SvPV_force_nolen(sv) SvPV_force_flags_nolen(sv, SV_GMAGIC)
4727 #endif
4729 #ifndef SvPV_force_mutable
4730 # define SvPV_force_mutable(sv, lp) SvPV_force_flags_mutable(sv, lp, SV_GMAGIC)
4731 #endif
4733 #ifndef SvPV_force_nomg
4734 # define SvPV_force_nomg(sv, lp) SvPV_force_flags(sv, lp, 0)
4735 #endif
4737 #ifndef SvPV_force_nomg_nolen
4738 # define SvPV_force_nomg_nolen(sv) SvPV_force_flags_nolen(sv, 0)
4739 #endif
4740 #ifndef SvPV_force_flags
4741 # define SvPV_force_flags(sv, lp, flags) \
4742 ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
4743 ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_pvn_force_flags(sv, &lp, flags))
4744 #endif
4745 #ifndef SvPV_force_flags_nolen
4746 # define SvPV_force_flags_nolen(sv, flags) \
4747 ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
4748 ? SvPVX(sv) : sv_pvn_force_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, flags))
4749 #endif
4750 #ifndef SvPV_force_flags_mutable
4751 # define SvPV_force_flags_mutable(sv, lp, flags) \
4752 ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
4753 ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) \
4754 : sv_pvn_force_flags(sv, &lp, flags|SV_MUTABLE_RETURN))
4755 #endif
4756 #ifndef SvPV_nolen
4757 # define SvPV_nolen(sv) \
4758 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
4759 ? SvPVX(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC))
4760 #endif
4761 #ifndef SvPV_nolen_const
4762 # define SvPV_nolen_const(sv) \
4763 ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
4764 ? SvPVX_const(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC|SV_CONST_RETURN))
4765 #endif
4766 #ifndef SvPV_nomg
4767 # define SvPV_nomg(sv, lp) SvPV_flags(sv, lp, 0)
4768 #endif
4770 #ifndef SvPV_nomg_const
4771 # define SvPV_nomg_const(sv, lp) SvPV_flags_const(sv, lp, 0)
4772 #endif
4774 #ifndef SvPV_nomg_const_nolen
4775 # define SvPV_nomg_const_nolen(sv) SvPV_flags_const_nolen(sv, 0)
4776 #endif
4777 #ifndef SvMAGIC_set
4778 # define SvMAGIC_set(sv, val) \
4779 STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
4780 (((XPVMG*) SvANY(sv))->xmg_magic = (val)); } STMT_END
4781 #endif
4783 #if (PERL_BCDVERSION < 0x5009003)
4784 #ifndef SvPVX_const
4785 # define SvPVX_const(sv) ((const char*) (0 + SvPVX(sv)))
4786 #endif
4788 #ifndef SvPVX_mutable
4789 # define SvPVX_mutable(sv) (0 + SvPVX(sv))
4790 #endif
4791 #ifndef SvRV_set
4792 # define SvRV_set(sv, val) \
4793 STMT_START { assert(SvTYPE(sv) >= SVt_RV); \
4794 (((XRV*) SvANY(sv))->xrv_rv = (val)); } STMT_END
4795 #endif
4797 #else
4798 #ifndef SvPVX_const
4799 # define SvPVX_const(sv) ((const char*)((sv)->sv_u.svu_pv))
4800 #endif
4802 #ifndef SvPVX_mutable
4803 # define SvPVX_mutable(sv) ((sv)->sv_u.svu_pv)
4804 #endif
4805 #ifndef SvRV_set
4806 # define SvRV_set(sv, val) \
4807 STMT_START { assert(SvTYPE(sv) >= SVt_RV); \
4808 ((sv)->sv_u.svu_rv = (val)); } STMT_END
4809 #endif
4811 #endif
4812 #ifndef SvSTASH_set
4813 # define SvSTASH_set(sv, val) \
4814 STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
4815 (((XPVMG*) SvANY(sv))->xmg_stash = (val)); } STMT_END
4816 #endif
4818 #if (PERL_BCDVERSION < 0x5004000)
4819 #ifndef SvUV_set
4820 # define SvUV_set(sv, val) \
4821 STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \
4822 (((XPVIV*) SvANY(sv))->xiv_iv = (IV) (val)); } STMT_END
4823 #endif
4825 #else
4826 #ifndef SvUV_set
4827 # define SvUV_set(sv, val) \
4828 STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \
4829 (((XPVUV*) SvANY(sv))->xuv_uv = (val)); } STMT_END
4830 #endif
4832 #endif
4834 #if (PERL_BCDVERSION >= 0x5004000) && !defined(vnewSVpvf)
4835 #if defined(NEED_vnewSVpvf)
4836 static SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args);
4837 static
4838 #else
4839 extern SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args);
4840 #endif
4842 #ifdef vnewSVpvf
4843 # undef vnewSVpvf
4844 #endif
4845 #define vnewSVpvf(a,b) DPPP_(my_vnewSVpvf)(aTHX_ a,b)
4846 #define Perl_vnewSVpvf DPPP_(my_vnewSVpvf)
4848 #if defined(NEED_vnewSVpvf) || defined(NEED_vnewSVpvf_GLOBAL)
4850 SV *
4851 DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args)
4853 register SV *sv = newSV(0);
4854 sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));
4855 return sv;
4858 #endif
4859 #endif
4861 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf)
4862 # define sv_vcatpvf(sv, pat, args) sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*))
4863 #endif
4865 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf)
4866 # define sv_vsetpvf(sv, pat, args) sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*))
4867 #endif
4869 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg)
4870 #if defined(NEED_sv_catpvf_mg)
4871 static void DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
4872 static
4873 #else
4874 extern void DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
4875 #endif
4877 #define Perl_sv_catpvf_mg DPPP_(my_sv_catpvf_mg)
4879 #if defined(NEED_sv_catpvf_mg) || defined(NEED_sv_catpvf_mg_GLOBAL)
4881 void
4882 DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...)
4884 va_list args;
4885 va_start(args, pat);
4886 sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
4887 SvSETMAGIC(sv);
4888 va_end(args);
4891 #endif
4892 #endif
4894 #ifdef PERL_IMPLICIT_CONTEXT
4895 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg_nocontext)
4896 #if defined(NEED_sv_catpvf_mg_nocontext)
4897 static void DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...);
4898 static
4899 #else
4900 extern void DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...);
4901 #endif
4903 #define sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext)
4904 #define Perl_sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext)
4906 #if defined(NEED_sv_catpvf_mg_nocontext) || defined(NEED_sv_catpvf_mg_nocontext_GLOBAL)
4908 void
4909 DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...)
4911 dTHX;
4912 va_list args;
4913 va_start(args, pat);
4914 sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
4915 SvSETMAGIC(sv);
4916 va_end(args);
4919 #endif
4920 #endif
4921 #endif
4923 /* sv_catpvf_mg depends on sv_catpvf_mg_nocontext */
4924 #ifndef sv_catpvf_mg
4925 # ifdef PERL_IMPLICIT_CONTEXT
4926 # define sv_catpvf_mg Perl_sv_catpvf_mg_nocontext
4927 # else
4928 # define sv_catpvf_mg Perl_sv_catpvf_mg
4929 # endif
4930 #endif
4932 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf_mg)
4933 # define sv_vcatpvf_mg(sv, pat, args) \
4934 STMT_START { \
4935 sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \
4936 SvSETMAGIC(sv); \
4937 } STMT_END
4938 #endif
4940 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg)
4941 #if defined(NEED_sv_setpvf_mg)
4942 static void DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
4943 static
4944 #else
4945 extern void DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
4946 #endif
4948 #define Perl_sv_setpvf_mg DPPP_(my_sv_setpvf_mg)
4950 #if defined(NEED_sv_setpvf_mg) || defined(NEED_sv_setpvf_mg_GLOBAL)
4952 void
4953 DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...)
4955 va_list args;
4956 va_start(args, pat);
4957 sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
4958 SvSETMAGIC(sv);
4959 va_end(args);
4962 #endif
4963 #endif
4965 #ifdef PERL_IMPLICIT_CONTEXT
4966 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg_nocontext)
4967 #if defined(NEED_sv_setpvf_mg_nocontext)
4968 static void DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...);
4969 static
4970 #else
4971 extern void DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...);
4972 #endif
4974 #define sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext)
4975 #define Perl_sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext)
4977 #if defined(NEED_sv_setpvf_mg_nocontext) || defined(NEED_sv_setpvf_mg_nocontext_GLOBAL)
4979 void
4980 DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...)
4982 dTHX;
4983 va_list args;
4984 va_start(args, pat);
4985 sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
4986 SvSETMAGIC(sv);
4987 va_end(args);
4990 #endif
4991 #endif
4992 #endif
4994 /* sv_setpvf_mg depends on sv_setpvf_mg_nocontext */
4995 #ifndef sv_setpvf_mg
4996 # ifdef PERL_IMPLICIT_CONTEXT
4997 # define sv_setpvf_mg Perl_sv_setpvf_mg_nocontext
4998 # else
4999 # define sv_setpvf_mg Perl_sv_setpvf_mg
5000 # endif
5001 #endif
5003 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf_mg)
5004 # define sv_vsetpvf_mg(sv, pat, args) \
5005 STMT_START { \
5006 sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \
5007 SvSETMAGIC(sv); \
5008 } STMT_END
5009 #endif
5011 #ifndef newSVpvn_share
5013 #if defined(NEED_newSVpvn_share)
5014 static SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash);
5015 static
5016 #else
5017 extern SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash);
5018 #endif
5020 #ifdef newSVpvn_share
5021 # undef newSVpvn_share
5022 #endif
5023 #define newSVpvn_share(a,b,c) DPPP_(my_newSVpvn_share)(aTHX_ a,b,c)
5024 #define Perl_newSVpvn_share DPPP_(my_newSVpvn_share)
5026 #if defined(NEED_newSVpvn_share) || defined(NEED_newSVpvn_share_GLOBAL)
5028 SV *
5029 DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash)
5031 SV *sv;
5032 if (len < 0)
5033 len = -len;
5034 if (!hash)
5035 PERL_HASH(hash, (char*) src, len);
5036 sv = newSVpvn((char *) src, len);
5037 sv_upgrade(sv, SVt_PVIV);
5038 SvIVX(sv) = hash;
5039 SvREADONLY_on(sv);
5040 SvPOK_on(sv);
5041 return sv;
5044 #endif
5046 #endif
5047 #ifndef SvSHARED_HASH
5048 # define SvSHARED_HASH(sv) (0 + SvUVX(sv))
5049 #endif
5050 #ifndef WARN_ALL
5051 # define WARN_ALL 0
5052 #endif
5054 #ifndef WARN_CLOSURE
5055 # define WARN_CLOSURE 1
5056 #endif
5058 #ifndef WARN_DEPRECATED
5059 # define WARN_DEPRECATED 2
5060 #endif
5062 #ifndef WARN_EXITING
5063 # define WARN_EXITING 3
5064 #endif
5066 #ifndef WARN_GLOB
5067 # define WARN_GLOB 4
5068 #endif
5070 #ifndef WARN_IO
5071 # define WARN_IO 5
5072 #endif
5074 #ifndef WARN_CLOSED
5075 # define WARN_CLOSED 6
5076 #endif
5078 #ifndef WARN_EXEC
5079 # define WARN_EXEC 7
5080 #endif
5082 #ifndef WARN_LAYER
5083 # define WARN_LAYER 8
5084 #endif
5086 #ifndef WARN_NEWLINE
5087 # define WARN_NEWLINE 9
5088 #endif
5090 #ifndef WARN_PIPE
5091 # define WARN_PIPE 10
5092 #endif
5094 #ifndef WARN_UNOPENED
5095 # define WARN_UNOPENED 11
5096 #endif
5098 #ifndef WARN_MISC
5099 # define WARN_MISC 12
5100 #endif
5102 #ifndef WARN_NUMERIC
5103 # define WARN_NUMERIC 13
5104 #endif
5106 #ifndef WARN_ONCE
5107 # define WARN_ONCE 14
5108 #endif
5110 #ifndef WARN_OVERFLOW
5111 # define WARN_OVERFLOW 15
5112 #endif
5114 #ifndef WARN_PACK
5115 # define WARN_PACK 16
5116 #endif
5118 #ifndef WARN_PORTABLE
5119 # define WARN_PORTABLE 17
5120 #endif
5122 #ifndef WARN_RECURSION
5123 # define WARN_RECURSION 18
5124 #endif
5126 #ifndef WARN_REDEFINE
5127 # define WARN_REDEFINE 19
5128 #endif
5130 #ifndef WARN_REGEXP
5131 # define WARN_REGEXP 20
5132 #endif
5134 #ifndef WARN_SEVERE
5135 # define WARN_SEVERE 21
5136 #endif
5138 #ifndef WARN_DEBUGGING
5139 # define WARN_DEBUGGING 22
5140 #endif
5142 #ifndef WARN_INPLACE
5143 # define WARN_INPLACE 23
5144 #endif
5146 #ifndef WARN_INTERNAL
5147 # define WARN_INTERNAL 24
5148 #endif
5150 #ifndef WARN_MALLOC
5151 # define WARN_MALLOC 25
5152 #endif
5154 #ifndef WARN_SIGNAL
5155 # define WARN_SIGNAL 26
5156 #endif
5158 #ifndef WARN_SUBSTR
5159 # define WARN_SUBSTR 27
5160 #endif
5162 #ifndef WARN_SYNTAX
5163 # define WARN_SYNTAX 28
5164 #endif
5166 #ifndef WARN_AMBIGUOUS
5167 # define WARN_AMBIGUOUS 29
5168 #endif
5170 #ifndef WARN_BAREWORD
5171 # define WARN_BAREWORD 30
5172 #endif
5174 #ifndef WARN_DIGIT
5175 # define WARN_DIGIT 31
5176 #endif
5178 #ifndef WARN_PARENTHESIS
5179 # define WARN_PARENTHESIS 32
5180 #endif
5182 #ifndef WARN_PRECEDENCE
5183 # define WARN_PRECEDENCE 33
5184 #endif
5186 #ifndef WARN_PRINTF
5187 # define WARN_PRINTF 34
5188 #endif
5190 #ifndef WARN_PROTOTYPE
5191 # define WARN_PROTOTYPE 35
5192 #endif
5194 #ifndef WARN_QW
5195 # define WARN_QW 36
5196 #endif
5198 #ifndef WARN_RESERVED
5199 # define WARN_RESERVED 37
5200 #endif
5202 #ifndef WARN_SEMICOLON
5203 # define WARN_SEMICOLON 38
5204 #endif
5206 #ifndef WARN_TAINT
5207 # define WARN_TAINT 39
5208 #endif
5210 #ifndef WARN_THREADS
5211 # define WARN_THREADS 40
5212 #endif
5214 #ifndef WARN_UNINITIALIZED
5215 # define WARN_UNINITIALIZED 41
5216 #endif
5218 #ifndef WARN_UNPACK
5219 # define WARN_UNPACK 42
5220 #endif
5222 #ifndef WARN_UNTIE
5223 # define WARN_UNTIE 43
5224 #endif
5226 #ifndef WARN_UTF8
5227 # define WARN_UTF8 44
5228 #endif
5230 #ifndef WARN_VOID
5231 # define WARN_VOID 45
5232 #endif
5234 #ifndef WARN_ASSERTIONS
5235 # define WARN_ASSERTIONS 46
5236 #endif
5237 #ifndef packWARN
5238 # define packWARN(a) (a)
5239 #endif
5241 #ifndef ckWARN
5242 # ifdef G_WARN_ON
5243 # define ckWARN(a) (PL_dowarn & G_WARN_ON)
5244 # else
5245 # define ckWARN(a) PL_dowarn
5246 # endif
5247 #endif
5249 #if (PERL_BCDVERSION >= 0x5004000) && !defined(warner)
5250 #if defined(NEED_warner)
5251 static void DPPP_(my_warner)(U32 err, const char *pat, ...);
5252 static
5253 #else
5254 extern void DPPP_(my_warner)(U32 err, const char *pat, ...);
5255 #endif
5257 #define Perl_warner DPPP_(my_warner)
5259 #if defined(NEED_warner) || defined(NEED_warner_GLOBAL)
5261 void
5262 DPPP_(my_warner)(U32 err, const char *pat, ...)
5264 SV *sv;
5265 va_list args;
5267 PERL_UNUSED_ARG(err);
5269 va_start(args, pat);
5270 sv = vnewSVpvf(pat, &args);
5271 va_end(args);
5272 sv_2mortal(sv);
5273 warn("%s", SvPV_nolen(sv));
5276 #define warner Perl_warner
5278 #define Perl_warner_nocontext Perl_warner
5280 #endif
5281 #endif
5283 /* concatenating with "" ensures that only literal strings are accepted as argument
5284 * note that STR_WITH_LEN() can't be used as argument to macros or functions that
5285 * under some configurations might be macros
5287 #ifndef STR_WITH_LEN
5288 # define STR_WITH_LEN(s) (s ""), (sizeof(s)-1)
5289 #endif
5290 #ifndef newSVpvs
5291 # define newSVpvs(str) newSVpvn(str "", sizeof(str) - 1)
5292 #endif
5294 #ifndef newSVpvs_flags
5295 # define newSVpvs_flags(str, flags) newSVpvn_flags(str "", sizeof(str) - 1, flags)
5296 #endif
5298 #ifndef sv_catpvs
5299 # define sv_catpvs(sv, str) sv_catpvn(sv, str "", sizeof(str) - 1)
5300 #endif
5302 #ifndef sv_setpvs
5303 # define sv_setpvs(sv, str) sv_setpvn(sv, str "", sizeof(str) - 1)
5304 #endif
5306 #ifndef hv_fetchs
5307 # define hv_fetchs(hv, key, lval) hv_fetch(hv, key "", sizeof(key) - 1, lval)
5308 #endif
5310 #ifndef hv_stores
5311 # define hv_stores(hv, key, val) hv_store(hv, key "", sizeof(key) - 1, val, 0)
5312 #endif
5313 #ifndef SvGETMAGIC
5314 # define SvGETMAGIC(x) STMT_START { if (SvGMAGICAL(x)) mg_get(x); } STMT_END
5315 #endif
5316 #ifndef PERL_MAGIC_sv
5317 # define PERL_MAGIC_sv '\0'
5318 #endif
5320 #ifndef PERL_MAGIC_overload
5321 # define PERL_MAGIC_overload 'A'
5322 #endif
5324 #ifndef PERL_MAGIC_overload_elem
5325 # define PERL_MAGIC_overload_elem 'a'
5326 #endif
5328 #ifndef PERL_MAGIC_overload_table
5329 # define PERL_MAGIC_overload_table 'c'
5330 #endif
5332 #ifndef PERL_MAGIC_bm
5333 # define PERL_MAGIC_bm 'B'
5334 #endif
5336 #ifndef PERL_MAGIC_regdata
5337 # define PERL_MAGIC_regdata 'D'
5338 #endif
5340 #ifndef PERL_MAGIC_regdatum
5341 # define PERL_MAGIC_regdatum 'd'
5342 #endif
5344 #ifndef PERL_MAGIC_env
5345 # define PERL_MAGIC_env 'E'
5346 #endif
5348 #ifndef PERL_MAGIC_envelem
5349 # define PERL_MAGIC_envelem 'e'
5350 #endif
5352 #ifndef PERL_MAGIC_fm
5353 # define PERL_MAGIC_fm 'f'
5354 #endif
5356 #ifndef PERL_MAGIC_regex_global
5357 # define PERL_MAGIC_regex_global 'g'
5358 #endif
5360 #ifndef PERL_MAGIC_isa
5361 # define PERL_MAGIC_isa 'I'
5362 #endif
5364 #ifndef PERL_MAGIC_isaelem
5365 # define PERL_MAGIC_isaelem 'i'
5366 #endif
5368 #ifndef PERL_MAGIC_nkeys
5369 # define PERL_MAGIC_nkeys 'k'
5370 #endif
5372 #ifndef PERL_MAGIC_dbfile
5373 # define PERL_MAGIC_dbfile 'L'
5374 #endif
5376 #ifndef PERL_MAGIC_dbline
5377 # define PERL_MAGIC_dbline 'l'
5378 #endif
5380 #ifndef PERL_MAGIC_mutex
5381 # define PERL_MAGIC_mutex 'm'
5382 #endif
5384 #ifndef PERL_MAGIC_shared
5385 # define PERL_MAGIC_shared 'N'
5386 #endif
5388 #ifndef PERL_MAGIC_shared_scalar
5389 # define PERL_MAGIC_shared_scalar 'n'
5390 #endif
5392 #ifndef PERL_MAGIC_collxfrm
5393 # define PERL_MAGIC_collxfrm 'o'
5394 #endif
5396 #ifndef PERL_MAGIC_tied
5397 # define PERL_MAGIC_tied 'P'
5398 #endif
5400 #ifndef PERL_MAGIC_tiedelem
5401 # define PERL_MAGIC_tiedelem 'p'
5402 #endif
5404 #ifndef PERL_MAGIC_tiedscalar
5405 # define PERL_MAGIC_tiedscalar 'q'
5406 #endif
5408 #ifndef PERL_MAGIC_qr
5409 # define PERL_MAGIC_qr 'r'
5410 #endif
5412 #ifndef PERL_MAGIC_sig
5413 # define PERL_MAGIC_sig 'S'
5414 #endif
5416 #ifndef PERL_MAGIC_sigelem
5417 # define PERL_MAGIC_sigelem 's'
5418 #endif
5420 #ifndef PERL_MAGIC_taint
5421 # define PERL_MAGIC_taint 't'
5422 #endif
5424 #ifndef PERL_MAGIC_uvar
5425 # define PERL_MAGIC_uvar 'U'
5426 #endif
5428 #ifndef PERL_MAGIC_uvar_elem
5429 # define PERL_MAGIC_uvar_elem 'u'
5430 #endif
5432 #ifndef PERL_MAGIC_vstring
5433 # define PERL_MAGIC_vstring 'V'
5434 #endif
5436 #ifndef PERL_MAGIC_vec
5437 # define PERL_MAGIC_vec 'v'
5438 #endif
5440 #ifndef PERL_MAGIC_utf8
5441 # define PERL_MAGIC_utf8 'w'
5442 #endif
5444 #ifndef PERL_MAGIC_substr
5445 # define PERL_MAGIC_substr 'x'
5446 #endif
5448 #ifndef PERL_MAGIC_defelem
5449 # define PERL_MAGIC_defelem 'y'
5450 #endif
5452 #ifndef PERL_MAGIC_glob
5453 # define PERL_MAGIC_glob '*'
5454 #endif
5456 #ifndef PERL_MAGIC_arylen
5457 # define PERL_MAGIC_arylen '#'
5458 #endif
5460 #ifndef PERL_MAGIC_pos
5461 # define PERL_MAGIC_pos '.'
5462 #endif
5464 #ifndef PERL_MAGIC_backref
5465 # define PERL_MAGIC_backref '<'
5466 #endif
5468 #ifndef PERL_MAGIC_ext
5469 # define PERL_MAGIC_ext '~'
5470 #endif
5472 /* That's the best we can do... */
5473 #ifndef sv_catpvn_nomg
5474 # define sv_catpvn_nomg sv_catpvn
5475 #endif
5477 #ifndef sv_catsv_nomg
5478 # define sv_catsv_nomg sv_catsv
5479 #endif
5481 #ifndef sv_setsv_nomg
5482 # define sv_setsv_nomg sv_setsv
5483 #endif
5485 #ifndef sv_pvn_nomg
5486 # define sv_pvn_nomg sv_pvn
5487 #endif
5489 #ifndef SvIV_nomg
5490 # define SvIV_nomg SvIV
5491 #endif
5493 #ifndef SvUV_nomg
5494 # define SvUV_nomg SvUV
5495 #endif
5497 #ifndef sv_catpv_mg
5498 # define sv_catpv_mg(sv, ptr) \
5499 STMT_START { \
5500 SV *TeMpSv = sv; \
5501 sv_catpv(TeMpSv,ptr); \
5502 SvSETMAGIC(TeMpSv); \
5503 } STMT_END
5504 #endif
5506 #ifndef sv_catpvn_mg
5507 # define sv_catpvn_mg(sv, ptr, len) \
5508 STMT_START { \
5509 SV *TeMpSv = sv; \
5510 sv_catpvn(TeMpSv,ptr,len); \
5511 SvSETMAGIC(TeMpSv); \
5512 } STMT_END
5513 #endif
5515 #ifndef sv_catsv_mg
5516 # define sv_catsv_mg(dsv, ssv) \
5517 STMT_START { \
5518 SV *TeMpSv = dsv; \
5519 sv_catsv(TeMpSv,ssv); \
5520 SvSETMAGIC(TeMpSv); \
5521 } STMT_END
5522 #endif
5524 #ifndef sv_setiv_mg
5525 # define sv_setiv_mg(sv, i) \
5526 STMT_START { \
5527 SV *TeMpSv = sv; \
5528 sv_setiv(TeMpSv,i); \
5529 SvSETMAGIC(TeMpSv); \
5530 } STMT_END
5531 #endif
5533 #ifndef sv_setnv_mg
5534 # define sv_setnv_mg(sv, num) \
5535 STMT_START { \
5536 SV *TeMpSv = sv; \
5537 sv_setnv(TeMpSv,num); \
5538 SvSETMAGIC(TeMpSv); \
5539 } STMT_END
5540 #endif
5542 #ifndef sv_setpv_mg
5543 # define sv_setpv_mg(sv, ptr) \
5544 STMT_START { \
5545 SV *TeMpSv = sv; \
5546 sv_setpv(TeMpSv,ptr); \
5547 SvSETMAGIC(TeMpSv); \
5548 } STMT_END
5549 #endif
5551 #ifndef sv_setpvn_mg
5552 # define sv_setpvn_mg(sv, ptr, len) \
5553 STMT_START { \
5554 SV *TeMpSv = sv; \
5555 sv_setpvn(TeMpSv,ptr,len); \
5556 SvSETMAGIC(TeMpSv); \
5557 } STMT_END
5558 #endif
5560 #ifndef sv_setsv_mg
5561 # define sv_setsv_mg(dsv, ssv) \
5562 STMT_START { \
5563 SV *TeMpSv = dsv; \
5564 sv_setsv(TeMpSv,ssv); \
5565 SvSETMAGIC(TeMpSv); \
5566 } STMT_END
5567 #endif
5569 #ifndef sv_setuv_mg
5570 # define sv_setuv_mg(sv, i) \
5571 STMT_START { \
5572 SV *TeMpSv = sv; \
5573 sv_setuv(TeMpSv,i); \
5574 SvSETMAGIC(TeMpSv); \
5575 } STMT_END
5576 #endif
5578 #ifndef sv_usepvn_mg
5579 # define sv_usepvn_mg(sv, ptr, len) \
5580 STMT_START { \
5581 SV *TeMpSv = sv; \
5582 sv_usepvn(TeMpSv,ptr,len); \
5583 SvSETMAGIC(TeMpSv); \
5584 } STMT_END
5585 #endif
5586 #ifndef SvVSTRING_mg
5587 # define SvVSTRING_mg(sv) (SvMAGICAL(sv) ? mg_find(sv, PERL_MAGIC_vstring) : NULL)
5588 #endif
5590 /* Hint: sv_magic_portable
5591 * This is a compatibility function that is only available with
5592 * Devel::PPPort. It is NOT in the perl core.
5593 * Its purpose is to mimic the 5.8.0 behaviour of sv_magic() when
5594 * it is being passed a name pointer with namlen == 0. In that
5595 * case, perl 5.8.0 and later store the pointer, not a copy of it.
5596 * The compatibility can be provided back to perl 5.004. With
5597 * earlier versions, the code will not compile.
5600 #if (PERL_BCDVERSION < 0x5004000)
5602 /* code that uses sv_magic_portable will not compile */
5604 #elif (PERL_BCDVERSION < 0x5008000)
5606 # define sv_magic_portable(sv, obj, how, name, namlen) \
5607 STMT_START { \
5608 SV *SvMp_sv = (sv); \
5609 char *SvMp_name = (char *) (name); \
5610 I32 SvMp_namlen = (namlen); \
5611 if (SvMp_name && SvMp_namlen == 0) \
5613 MAGIC *mg; \
5614 sv_magic(SvMp_sv, obj, how, 0, 0); \
5615 mg = SvMAGIC(SvMp_sv); \
5616 mg->mg_len = -42; /* XXX: this is the tricky part */ \
5617 mg->mg_ptr = SvMp_name; \
5619 else \
5621 sv_magic(SvMp_sv, obj, how, SvMp_name, SvMp_namlen); \
5623 } STMT_END
5625 #else
5627 # define sv_magic_portable(a, b, c, d, e) sv_magic(a, b, c, d, e)
5629 #endif
5631 #ifdef USE_ITHREADS
5632 #ifndef CopFILE
5633 # define CopFILE(c) ((c)->cop_file)
5634 #endif
5636 #ifndef CopFILEGV
5637 # define CopFILEGV(c) (CopFILE(c) ? gv_fetchfile(CopFILE(c)) : Nullgv)
5638 #endif
5640 #ifndef CopFILE_set
5641 # define CopFILE_set(c,pv) ((c)->cop_file = savepv(pv))
5642 #endif
5644 #ifndef CopFILESV
5645 # define CopFILESV(c) (CopFILE(c) ? GvSV(gv_fetchfile(CopFILE(c))) : Nullsv)
5646 #endif
5648 #ifndef CopFILEAV
5649 # define CopFILEAV(c) (CopFILE(c) ? GvAV(gv_fetchfile(CopFILE(c))) : Nullav)
5650 #endif
5652 #ifndef CopSTASHPV
5653 # define CopSTASHPV(c) ((c)->cop_stashpv)
5654 #endif
5656 #ifndef CopSTASHPV_set
5657 # define CopSTASHPV_set(c,pv) ((c)->cop_stashpv = ((pv) ? savepv(pv) : Nullch))
5658 #endif
5660 #ifndef CopSTASH
5661 # define CopSTASH(c) (CopSTASHPV(c) ? gv_stashpv(CopSTASHPV(c),GV_ADD) : Nullhv)
5662 #endif
5664 #ifndef CopSTASH_set
5665 # define CopSTASH_set(c,hv) CopSTASHPV_set(c, (hv) ? HvNAME(hv) : Nullch)
5666 #endif
5668 #ifndef CopSTASH_eq
5669 # define CopSTASH_eq(c,hv) ((hv) && (CopSTASHPV(c) == HvNAME(hv) \
5670 || (CopSTASHPV(c) && HvNAME(hv) \
5671 && strEQ(CopSTASHPV(c), HvNAME(hv)))))
5672 #endif
5674 #else
5675 #ifndef CopFILEGV
5676 # define CopFILEGV(c) ((c)->cop_filegv)
5677 #endif
5679 #ifndef CopFILEGV_set
5680 # define CopFILEGV_set(c,gv) ((c)->cop_filegv = (GV*)SvREFCNT_inc(gv))
5681 #endif
5683 #ifndef CopFILE_set
5684 # define CopFILE_set(c,pv) CopFILEGV_set((c), gv_fetchfile(pv))
5685 #endif
5687 #ifndef CopFILESV
5688 # define CopFILESV(c) (CopFILEGV(c) ? GvSV(CopFILEGV(c)) : Nullsv)
5689 #endif
5691 #ifndef CopFILEAV
5692 # define CopFILEAV(c) (CopFILEGV(c) ? GvAV(CopFILEGV(c)) : Nullav)
5693 #endif
5695 #ifndef CopFILE
5696 # define CopFILE(c) (CopFILESV(c) ? SvPVX(CopFILESV(c)) : Nullch)
5697 #endif
5699 #ifndef CopSTASH
5700 # define CopSTASH(c) ((c)->cop_stash)
5701 #endif
5703 #ifndef CopSTASH_set
5704 # define CopSTASH_set(c,hv) ((c)->cop_stash = (hv))
5705 #endif
5707 #ifndef CopSTASHPV
5708 # define CopSTASHPV(c) (CopSTASH(c) ? HvNAME(CopSTASH(c)) : Nullch)
5709 #endif
5711 #ifndef CopSTASHPV_set
5712 # define CopSTASHPV_set(c,pv) CopSTASH_set((c), gv_stashpv(pv,GV_ADD))
5713 #endif
5715 #ifndef CopSTASH_eq
5716 # define CopSTASH_eq(c,hv) (CopSTASH(c) == (hv))
5717 #endif
5719 #endif /* USE_ITHREADS */
5720 #ifndef IN_PERL_COMPILETIME
5721 # define IN_PERL_COMPILETIME (PL_curcop == &PL_compiling)
5722 #endif
5724 #ifndef IN_LOCALE_RUNTIME
5725 # define IN_LOCALE_RUNTIME (PL_curcop->op_private & HINT_LOCALE)
5726 #endif
5728 #ifndef IN_LOCALE_COMPILETIME
5729 # define IN_LOCALE_COMPILETIME (PL_hints & HINT_LOCALE)
5730 #endif
5732 #ifndef IN_LOCALE
5733 # define IN_LOCALE (IN_PERL_COMPILETIME ? IN_LOCALE_COMPILETIME : IN_LOCALE_RUNTIME)
5734 #endif
5735 #ifndef IS_NUMBER_IN_UV
5736 # define IS_NUMBER_IN_UV 0x01
5737 #endif
5739 #ifndef IS_NUMBER_GREATER_THAN_UV_MAX
5740 # define IS_NUMBER_GREATER_THAN_UV_MAX 0x02
5741 #endif
5743 #ifndef IS_NUMBER_NOT_INT
5744 # define IS_NUMBER_NOT_INT 0x04
5745 #endif
5747 #ifndef IS_NUMBER_NEG
5748 # define IS_NUMBER_NEG 0x08
5749 #endif
5751 #ifndef IS_NUMBER_INFINITY
5752 # define IS_NUMBER_INFINITY 0x10
5753 #endif
5755 #ifndef IS_NUMBER_NAN
5756 # define IS_NUMBER_NAN 0x20
5757 #endif
5758 #ifndef GROK_NUMERIC_RADIX
5759 # define GROK_NUMERIC_RADIX(sp, send) grok_numeric_radix(sp, send)
5760 #endif
5761 #ifndef PERL_SCAN_GREATER_THAN_UV_MAX
5762 # define PERL_SCAN_GREATER_THAN_UV_MAX 0x02
5763 #endif
5765 #ifndef PERL_SCAN_SILENT_ILLDIGIT
5766 # define PERL_SCAN_SILENT_ILLDIGIT 0x04
5767 #endif
5769 #ifndef PERL_SCAN_ALLOW_UNDERSCORES
5770 # define PERL_SCAN_ALLOW_UNDERSCORES 0x01
5771 #endif
5773 #ifndef PERL_SCAN_DISALLOW_PREFIX
5774 # define PERL_SCAN_DISALLOW_PREFIX 0x02
5775 #endif
5777 #ifndef grok_numeric_radix
5778 #if defined(NEED_grok_numeric_radix)
5779 static bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send);
5780 static
5781 #else
5782 extern bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send);
5783 #endif
5785 #ifdef grok_numeric_radix
5786 # undef grok_numeric_radix
5787 #endif
5788 #define grok_numeric_radix(a,b) DPPP_(my_grok_numeric_radix)(aTHX_ a,b)
5789 #define Perl_grok_numeric_radix DPPP_(my_grok_numeric_radix)
5791 #if defined(NEED_grok_numeric_radix) || defined(NEED_grok_numeric_radix_GLOBAL)
5792 bool
5793 DPPP_(my_grok_numeric_radix)(pTHX_ const char **sp, const char *send)
5795 #ifdef USE_LOCALE_NUMERIC
5796 #ifdef PL_numeric_radix_sv
5797 if (PL_numeric_radix_sv && IN_LOCALE) {
5798 STRLEN len;
5799 char* radix = SvPV(PL_numeric_radix_sv, len);
5800 if (*sp + len <= send && memEQ(*sp, radix, len)) {
5801 *sp += len;
5802 return TRUE;
5805 #else
5806 /* older perls don't have PL_numeric_radix_sv so the radix
5807 * must manually be requested from locale.h
5809 #include <locale.h>
5810 dTHR; /* needed for older threaded perls */
5811 struct lconv *lc = localeconv();
5812 char *radix = lc->decimal_point;
5813 if (radix && IN_LOCALE) {
5814 STRLEN len = strlen(radix);
5815 if (*sp + len <= send && memEQ(*sp, radix, len)) {
5816 *sp += len;
5817 return TRUE;
5820 #endif
5821 #endif /* USE_LOCALE_NUMERIC */
5822 /* always try "." if numeric radix didn't match because
5823 * we may have data from different locales mixed */
5824 if (*sp < send && **sp == '.') {
5825 ++*sp;
5826 return TRUE;
5828 return FALSE;
5830 #endif
5831 #endif
5833 #ifndef grok_number
5834 #if defined(NEED_grok_number)
5835 static int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep);
5836 static
5837 #else
5838 extern int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep);
5839 #endif
5841 #ifdef grok_number
5842 # undef grok_number
5843 #endif
5844 #define grok_number(a,b,c) DPPP_(my_grok_number)(aTHX_ a,b,c)
5845 #define Perl_grok_number DPPP_(my_grok_number)
5847 #if defined(NEED_grok_number) || defined(NEED_grok_number_GLOBAL)
5849 DPPP_(my_grok_number)(pTHX_ const char *pv, STRLEN len, UV *valuep)
5851 const char *s = pv;
5852 const char *send = pv + len;
5853 const UV max_div_10 = UV_MAX / 10;
5854 const char max_mod_10 = UV_MAX % 10;
5855 int numtype = 0;
5856 int sawinf = 0;
5857 int sawnan = 0;
5859 while (s < send && isSPACE(*s))
5860 s++;
5861 if (s == send) {
5862 return 0;
5863 } else if (*s == '-') {
5864 s++;
5865 numtype = IS_NUMBER_NEG;
5867 else if (*s == '+')
5868 s++;
5870 if (s == send)
5871 return 0;
5873 /* next must be digit or the radix separator or beginning of infinity */
5874 if (isDIGIT(*s)) {
5875 /* UVs are at least 32 bits, so the first 9 decimal digits cannot
5876 overflow. */
5877 UV value = *s - '0';
5878 /* This construction seems to be more optimiser friendly.
5879 (without it gcc does the isDIGIT test and the *s - '0' separately)
5880 With it gcc on arm is managing 6 instructions (6 cycles) per digit.
5881 In theory the optimiser could deduce how far to unroll the loop
5882 before checking for overflow. */
5883 if (++s < send) {
5884 int digit = *s - '0';
5885 if (digit >= 0 && digit <= 9) {
5886 value = value * 10 + digit;
5887 if (++s < send) {
5888 digit = *s - '0';
5889 if (digit >= 0 && digit <= 9) {
5890 value = value * 10 + digit;
5891 if (++s < send) {
5892 digit = *s - '0';
5893 if (digit >= 0 && digit <= 9) {
5894 value = value * 10 + digit;
5895 if (++s < send) {
5896 digit = *s - '0';
5897 if (digit >= 0 && digit <= 9) {
5898 value = value * 10 + digit;
5899 if (++s < send) {
5900 digit = *s - '0';
5901 if (digit >= 0 && digit <= 9) {
5902 value = value * 10 + digit;
5903 if (++s < send) {
5904 digit = *s - '0';
5905 if (digit >= 0 && digit <= 9) {
5906 value = value * 10 + digit;
5907 if (++s < send) {
5908 digit = *s - '0';
5909 if (digit >= 0 && digit <= 9) {
5910 value = value * 10 + digit;
5911 if (++s < send) {
5912 digit = *s - '0';
5913 if (digit >= 0 && digit <= 9) {
5914 value = value * 10 + digit;
5915 if (++s < send) {
5916 /* Now got 9 digits, so need to check
5917 each time for overflow. */
5918 digit = *s - '0';
5919 while (digit >= 0 && digit <= 9
5920 && (value < max_div_10
5921 || (value == max_div_10
5922 && digit <= max_mod_10))) {
5923 value = value * 10 + digit;
5924 if (++s < send)
5925 digit = *s - '0';
5926 else
5927 break;
5929 if (digit >= 0 && digit <= 9
5930 && (s < send)) {
5931 /* value overflowed.
5932 skip the remaining digits, don't
5933 worry about setting *valuep. */
5934 do {
5935 s++;
5936 } while (s < send && isDIGIT(*s));
5937 numtype |=
5938 IS_NUMBER_GREATER_THAN_UV_MAX;
5939 goto skip_value;
5958 numtype |= IS_NUMBER_IN_UV;
5959 if (valuep)
5960 *valuep = value;
5962 skip_value:
5963 if (GROK_NUMERIC_RADIX(&s, send)) {
5964 numtype |= IS_NUMBER_NOT_INT;
5965 while (s < send && isDIGIT(*s)) /* optional digits after the radix */
5966 s++;
5969 else if (GROK_NUMERIC_RADIX(&s, send)) {
5970 numtype |= IS_NUMBER_NOT_INT | IS_NUMBER_IN_UV; /* valuep assigned below */
5971 /* no digits before the radix means we need digits after it */
5972 if (s < send && isDIGIT(*s)) {
5973 do {
5974 s++;
5975 } while (s < send && isDIGIT(*s));
5976 if (valuep) {
5977 /* integer approximation is valid - it's 0. */
5978 *valuep = 0;
5981 else
5982 return 0;
5983 } else if (*s == 'I' || *s == 'i') {
5984 s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
5985 s++; if (s == send || (*s != 'F' && *s != 'f')) return 0;
5986 s++; if (s < send && (*s == 'I' || *s == 'i')) {
5987 s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
5988 s++; if (s == send || (*s != 'I' && *s != 'i')) return 0;
5989 s++; if (s == send || (*s != 'T' && *s != 't')) return 0;
5990 s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0;
5991 s++;
5993 sawinf = 1;
5994 } else if (*s == 'N' || *s == 'n') {
5995 /* XXX TODO: There are signaling NaNs and quiet NaNs. */
5996 s++; if (s == send || (*s != 'A' && *s != 'a')) return 0;
5997 s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
5998 s++;
5999 sawnan = 1;
6000 } else
6001 return 0;
6003 if (sawinf) {
6004 numtype &= IS_NUMBER_NEG; /* Keep track of sign */
6005 numtype |= IS_NUMBER_INFINITY | IS_NUMBER_NOT_INT;
6006 } else if (sawnan) {
6007 numtype &= IS_NUMBER_NEG; /* Keep track of sign */
6008 numtype |= IS_NUMBER_NAN | IS_NUMBER_NOT_INT;
6009 } else if (s < send) {
6010 /* we can have an optional exponent part */
6011 if (*s == 'e' || *s == 'E') {
6012 /* The only flag we keep is sign. Blow away any "it's UV" */
6013 numtype &= IS_NUMBER_NEG;
6014 numtype |= IS_NUMBER_NOT_INT;
6015 s++;
6016 if (s < send && (*s == '-' || *s == '+'))
6017 s++;
6018 if (s < send && isDIGIT(*s)) {
6019 do {
6020 s++;
6021 } while (s < send && isDIGIT(*s));
6023 else
6024 return 0;
6027 while (s < send && isSPACE(*s))
6028 s++;
6029 if (s >= send)
6030 return numtype;
6031 if (len == 10 && memEQ(pv, "0 but true", 10)) {
6032 if (valuep)
6033 *valuep = 0;
6034 return IS_NUMBER_IN_UV;
6036 return 0;
6038 #endif
6039 #endif
6042 * The grok_* routines have been modified to use warn() instead of
6043 * Perl_warner(). Also, 'hexdigit' was the former name of PL_hexdigit,
6044 * which is why the stack variable has been renamed to 'xdigit'.
6047 #ifndef grok_bin
6048 #if defined(NEED_grok_bin)
6049 static UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
6050 static
6051 #else
6052 extern UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
6053 #endif
6055 #ifdef grok_bin
6056 # undef grok_bin
6057 #endif
6058 #define grok_bin(a,b,c,d) DPPP_(my_grok_bin)(aTHX_ a,b,c,d)
6059 #define Perl_grok_bin DPPP_(my_grok_bin)
6061 #if defined(NEED_grok_bin) || defined(NEED_grok_bin_GLOBAL)
6063 DPPP_(my_grok_bin)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
6065 const char *s = start;
6066 STRLEN len = *len_p;
6067 UV value = 0;
6068 NV value_nv = 0;
6070 const UV max_div_2 = UV_MAX / 2;
6071 bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
6072 bool overflowed = FALSE;
6074 if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) {
6075 /* strip off leading b or 0b.
6076 for compatibility silently suffer "b" and "0b" as valid binary
6077 numbers. */
6078 if (len >= 1) {
6079 if (s[0] == 'b') {
6080 s++;
6081 len--;
6083 else if (len >= 2 && s[0] == '0' && s[1] == 'b') {
6084 s+=2;
6085 len-=2;
6090 for (; len-- && *s; s++) {
6091 char bit = *s;
6092 if (bit == '0' || bit == '1') {
6093 /* Write it in this wonky order with a goto to attempt to get the
6094 compiler to make the common case integer-only loop pretty tight.
6095 With gcc seems to be much straighter code than old scan_bin. */
6096 redo:
6097 if (!overflowed) {
6098 if (value <= max_div_2) {
6099 value = (value << 1) | (bit - '0');
6100 continue;
6102 /* Bah. We're just overflowed. */
6103 warn("Integer overflow in binary number");
6104 overflowed = TRUE;
6105 value_nv = (NV) value;
6107 value_nv *= 2.0;
6108 /* If an NV has not enough bits in its mantissa to
6109 * represent a UV this summing of small low-order numbers
6110 * is a waste of time (because the NV cannot preserve
6111 * the low-order bits anyway): we could just remember when
6112 * did we overflow and in the end just multiply value_nv by the
6113 * right amount. */
6114 value_nv += (NV)(bit - '0');
6115 continue;
6117 if (bit == '_' && len && allow_underscores && (bit = s[1])
6118 && (bit == '0' || bit == '1'))
6120 --len;
6121 ++s;
6122 goto redo;
6124 if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
6125 warn("Illegal binary digit '%c' ignored", *s);
6126 break;
6129 if ( ( overflowed && value_nv > 4294967295.0)
6130 #if UVSIZE > 4
6131 || (!overflowed && value > 0xffffffff )
6132 #endif
6134 warn("Binary number > 0b11111111111111111111111111111111 non-portable");
6136 *len_p = s - start;
6137 if (!overflowed) {
6138 *flags = 0;
6139 return value;
6141 *flags = PERL_SCAN_GREATER_THAN_UV_MAX;
6142 if (result)
6143 *result = value_nv;
6144 return UV_MAX;
6146 #endif
6147 #endif
6149 #ifndef grok_hex
6150 #if defined(NEED_grok_hex)
6151 static UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
6152 static
6153 #else
6154 extern UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
6155 #endif
6157 #ifdef grok_hex
6158 # undef grok_hex
6159 #endif
6160 #define grok_hex(a,b,c,d) DPPP_(my_grok_hex)(aTHX_ a,b,c,d)
6161 #define Perl_grok_hex DPPP_(my_grok_hex)
6163 #if defined(NEED_grok_hex) || defined(NEED_grok_hex_GLOBAL)
6165 DPPP_(my_grok_hex)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
6167 const char *s = start;
6168 STRLEN len = *len_p;
6169 UV value = 0;
6170 NV value_nv = 0;
6172 const UV max_div_16 = UV_MAX / 16;
6173 bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
6174 bool overflowed = FALSE;
6175 const char *xdigit;
6177 if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) {
6178 /* strip off leading x or 0x.
6179 for compatibility silently suffer "x" and "0x" as valid hex numbers.
6181 if (len >= 1) {
6182 if (s[0] == 'x') {
6183 s++;
6184 len--;
6186 else if (len >= 2 && s[0] == '0' && s[1] == 'x') {
6187 s+=2;
6188 len-=2;
6193 for (; len-- && *s; s++) {
6194 xdigit = strchr((char *) PL_hexdigit, *s);
6195 if (xdigit) {
6196 /* Write it in this wonky order with a goto to attempt to get the
6197 compiler to make the common case integer-only loop pretty tight.
6198 With gcc seems to be much straighter code than old scan_hex. */
6199 redo:
6200 if (!overflowed) {
6201 if (value <= max_div_16) {
6202 value = (value << 4) | ((xdigit - PL_hexdigit) & 15);
6203 continue;
6205 warn("Integer overflow in hexadecimal number");
6206 overflowed = TRUE;
6207 value_nv = (NV) value;
6209 value_nv *= 16.0;
6210 /* If an NV has not enough bits in its mantissa to
6211 * represent a UV this summing of small low-order numbers
6212 * is a waste of time (because the NV cannot preserve
6213 * the low-order bits anyway): we could just remember when
6214 * did we overflow and in the end just multiply value_nv by the
6215 * right amount of 16-tuples. */
6216 value_nv += (NV)((xdigit - PL_hexdigit) & 15);
6217 continue;
6219 if (*s == '_' && len && allow_underscores && s[1]
6220 && (xdigit = strchr((char *) PL_hexdigit, s[1])))
6222 --len;
6223 ++s;
6224 goto redo;
6226 if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
6227 warn("Illegal hexadecimal digit '%c' ignored", *s);
6228 break;
6231 if ( ( overflowed && value_nv > 4294967295.0)
6232 #if UVSIZE > 4
6233 || (!overflowed && value > 0xffffffff )
6234 #endif
6236 warn("Hexadecimal number > 0xffffffff non-portable");
6238 *len_p = s - start;
6239 if (!overflowed) {
6240 *flags = 0;
6241 return value;
6243 *flags = PERL_SCAN_GREATER_THAN_UV_MAX;
6244 if (result)
6245 *result = value_nv;
6246 return UV_MAX;
6248 #endif
6249 #endif
6251 #ifndef grok_oct
6252 #if defined(NEED_grok_oct)
6253 static UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
6254 static
6255 #else
6256 extern UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
6257 #endif
6259 #ifdef grok_oct
6260 # undef grok_oct
6261 #endif
6262 #define grok_oct(a,b,c,d) DPPP_(my_grok_oct)(aTHX_ a,b,c,d)
6263 #define Perl_grok_oct DPPP_(my_grok_oct)
6265 #if defined(NEED_grok_oct) || defined(NEED_grok_oct_GLOBAL)
6267 DPPP_(my_grok_oct)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
6269 const char *s = start;
6270 STRLEN len = *len_p;
6271 UV value = 0;
6272 NV value_nv = 0;
6274 const UV max_div_8 = UV_MAX / 8;
6275 bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
6276 bool overflowed = FALSE;
6278 for (; len-- && *s; s++) {
6279 /* gcc 2.95 optimiser not smart enough to figure that this subtraction
6280 out front allows slicker code. */
6281 int digit = *s - '0';
6282 if (digit >= 0 && digit <= 7) {
6283 /* Write it in this wonky order with a goto to attempt to get the
6284 compiler to make the common case integer-only loop pretty tight.
6286 redo:
6287 if (!overflowed) {
6288 if (value <= max_div_8) {
6289 value = (value << 3) | digit;
6290 continue;
6292 /* Bah. We're just overflowed. */
6293 warn("Integer overflow in octal number");
6294 overflowed = TRUE;
6295 value_nv = (NV) value;
6297 value_nv *= 8.0;
6298 /* If an NV has not enough bits in its mantissa to
6299 * represent a UV this summing of small low-order numbers
6300 * is a waste of time (because the NV cannot preserve
6301 * the low-order bits anyway): we could just remember when
6302 * did we overflow and in the end just multiply value_nv by the
6303 * right amount of 8-tuples. */
6304 value_nv += (NV)digit;
6305 continue;
6307 if (digit == ('_' - '0') && len && allow_underscores
6308 && (digit = s[1] - '0') && (digit >= 0 && digit <= 7))
6310 --len;
6311 ++s;
6312 goto redo;
6314 /* Allow \octal to work the DWIM way (that is, stop scanning
6315 * as soon as non-octal characters are seen, complain only iff
6316 * someone seems to want to use the digits eight and nine). */
6317 if (digit == 8 || digit == 9) {
6318 if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
6319 warn("Illegal octal digit '%c' ignored", *s);
6321 break;
6324 if ( ( overflowed && value_nv > 4294967295.0)
6325 #if UVSIZE > 4
6326 || (!overflowed && value > 0xffffffff )
6327 #endif
6329 warn("Octal number > 037777777777 non-portable");
6331 *len_p = s - start;
6332 if (!overflowed) {
6333 *flags = 0;
6334 return value;
6336 *flags = PERL_SCAN_GREATER_THAN_UV_MAX;
6337 if (result)
6338 *result = value_nv;
6339 return UV_MAX;
6341 #endif
6342 #endif
6344 #if !defined(my_snprintf)
6345 #if defined(NEED_my_snprintf)
6346 static int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...);
6347 static
6348 #else
6349 extern int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...);
6350 #endif
6352 #define my_snprintf DPPP_(my_my_snprintf)
6353 #define Perl_my_snprintf DPPP_(my_my_snprintf)
6355 #if defined(NEED_my_snprintf) || defined(NEED_my_snprintf_GLOBAL)
6358 DPPP_(my_my_snprintf)(char *buffer, const Size_t len, const char *format, ...)
6360 dTHX;
6361 int retval;
6362 va_list ap;
6363 va_start(ap, format);
6364 #ifdef HAS_VSNPRINTF
6365 retval = vsnprintf(buffer, len, format, ap);
6366 #else
6367 retval = vsprintf(buffer, format, ap);
6368 #endif
6369 va_end(ap);
6370 if (retval >= (int)len)
6371 Perl_croak(aTHX_ "panic: my_snprintf buffer overflow");
6372 return retval;
6375 #endif
6376 #endif
6378 #ifdef NO_XSLOCKS
6379 # ifdef dJMPENV
6380 # define dXCPT dJMPENV; int rEtV = 0
6381 # define XCPT_TRY_START JMPENV_PUSH(rEtV); if (rEtV == 0)
6382 # define XCPT_TRY_END JMPENV_POP;
6383 # define XCPT_CATCH if (rEtV != 0)
6384 # define XCPT_RETHROW JMPENV_JUMP(rEtV)
6385 # else
6386 # define dXCPT Sigjmp_buf oldTOP; int rEtV = 0
6387 # define XCPT_TRY_START Copy(top_env, oldTOP, 1, Sigjmp_buf); rEtV = Sigsetjmp(top_env, 1); if (rEtV == 0)
6388 # define XCPT_TRY_END Copy(oldTOP, top_env, 1, Sigjmp_buf);
6389 # define XCPT_CATCH if (rEtV != 0)
6390 # define XCPT_RETHROW Siglongjmp(top_env, rEtV)
6391 # endif
6392 #endif
6394 #if !defined(my_strlcat)
6395 #if defined(NEED_my_strlcat)
6396 static Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size);
6397 static
6398 #else
6399 extern Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size);
6400 #endif
6402 #define my_strlcat DPPP_(my_my_strlcat)
6403 #define Perl_my_strlcat DPPP_(my_my_strlcat)
6405 #if defined(NEED_my_strlcat) || defined(NEED_my_strlcat_GLOBAL)
6407 Size_t
6408 DPPP_(my_my_strlcat)(char *dst, const char *src, Size_t size)
6410 Size_t used, length, copy;
6412 used = strlen(dst);
6413 length = strlen(src);
6414 if (size > 0 && used < size - 1) {
6415 copy = (length >= size - used) ? size - used - 1 : length;
6416 memcpy(dst + used, src, copy);
6417 dst[used + copy] = '\0';
6419 return used + length;
6421 #endif
6422 #endif
6424 #if !defined(my_strlcpy)
6425 #if defined(NEED_my_strlcpy)
6426 static Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size);
6427 static
6428 #else
6429 extern Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size);
6430 #endif
6432 #define my_strlcpy DPPP_(my_my_strlcpy)
6433 #define Perl_my_strlcpy DPPP_(my_my_strlcpy)
6435 #if defined(NEED_my_strlcpy) || defined(NEED_my_strlcpy_GLOBAL)
6437 Size_t
6438 DPPP_(my_my_strlcpy)(char *dst, const char *src, Size_t size)
6440 Size_t length, copy;
6442 length = strlen(src);
6443 if (size > 0) {
6444 copy = (length >= size) ? size - 1 : length;
6445 memcpy(dst, src, copy);
6446 dst[copy] = '\0';
6448 return length;
6451 #endif
6452 #endif
6454 #endif /* _P_P_PORTABILITY_H_ */
6456 /* End of File ppport.h */