Sub-Name-0.24-TRIAL
[p5sagit/Sub-Name.git] / ppport.h
1 #if 0
2 <<'SKIP';
3 #endif
4 /*
5 ----------------------------------------------------------------------
6
7     ppport.h -- Perl/Pollution/Portability Version 3.39
8
9     Automatically created by Devel::PPPort running under perl 5.027010.
10
11     Do NOT edit this file directly! -- Edit PPPort_pm.PL and the
12     includes in parts/inc/ instead.
13
14     Use 'perldoc ppport.h' to view the documentation below.
15
16 ----------------------------------------------------------------------
17
18 SKIP
19
20 =pod
21
22 =head1 NAME
23
24 ppport.h - Perl/Pollution/Portability version 3.39
25
26 =head1 SYNOPSIS
27
28   perl ppport.h [options] [source files]
29
30   Searches current directory for files if no [source files] are given
31
32   --help                      show short help
33
34   --version                   show version
35
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
39
40   --compat-version=version    provide compatibility with Perl version
41   --cplusplus                 accept C++ comments
42
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
48
49   --strip                     strip all script and doc functionality
50                               from ppport.h
51
52   --list-provided             list provided API
53   --list-unsupported          list unsupported API
54   --api-info=name             show Perl API portability information
55
56 =head1 COMPATIBILITY
57
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.20.
60
61 =head1 OPTIONS
62
63 =head2 --help
64
65 Display a brief usage summary.
66
67 =head2 --version
68
69 Display the version of F<ppport.h>.
70
71 =head2 --patch=I<file>
72
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.
76
77 =head2 --copy=I<suffix>
78
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 automagically 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.
85
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.
89
90 =head2 --diff=I<program>
91
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.
95
96 =head2 --compat-version=I<version>
97
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.
103
104 =head2 --cplusplus
105
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.
110
111 =head2 --quiet
112
113 Be quiet. Don't print anything except fatal errors.
114
115 =head2 --nodiag
116
117 Don't output any diagnostic messages. Only portability
118 alerts will be printed.
119
120 =head2 --nohints
121
122 Don't output any hints. Hints often contain useful portability
123 notes. Warnings will still be displayed.
124
125 =head2 --nochanges
126
127 Don't suggest any changes. Only give diagnostic output and hints
128 unless these are also deactivated.
129
130 =head2 --nofilter
131
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.
134
135 =head2 --strip
136
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.
141
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.
145
146 =head2 --list-provided
147
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.
151
152 =head2 --list-unsupported
153
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.
157
158 =head2 --api-info=I<name>
159
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.
163
164 =head1 DESCRIPTION
165
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.
168
169 =over 4
170
171 =item *
172
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
176
177     perl ppport.h --list-provided
178
179 to see which API elements are provided by ppport.h.
180
181 =item *
182
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.
188
189 =item *
190
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>.
195
196 These functions or variables will be marked C<explicit> in the list shown
197 by C<--list-provided>.
198
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.
202
203 For a C<static> function or variable (used only in a single source
204 file), use:
205
206     #define NEED_function
207     #define NEED_variable
208
209 For a global function or variable (used in multiple source files),
210 use:
211
212     #define NEED_function_GLOBAL
213     #define NEED_variable_GLOBAL
214
215 Note that you mustn't have more than one global request for the
216 same function or variable in your project.
217
218     Function / Variable       Static Request               Global Request
219     -----------------------------------------------------------------------------------------
220     PL_parser                 NEED_PL_parser               NEED_PL_parser_GLOBAL
221     PL_signals                NEED_PL_signals              NEED_PL_signals_GLOBAL
222     SvRX()                    NEED_SvRX                    NEED_SvRX_GLOBAL
223     caller_cx()               NEED_caller_cx               NEED_caller_cx_GLOBAL
224     croak_xs_usage()          NEED_croak_xs_usage          NEED_croak_xs_usage_GLOBAL
225     die_sv()                  NEED_die_sv                  NEED_die_sv_GLOBAL
226     eval_pv()                 NEED_eval_pv                 NEED_eval_pv_GLOBAL
227     grok_bin()                NEED_grok_bin                NEED_grok_bin_GLOBAL
228     grok_hex()                NEED_grok_hex                NEED_grok_hex_GLOBAL
229     grok_number()             NEED_grok_number             NEED_grok_number_GLOBAL
230     grok_numeric_radix()      NEED_grok_numeric_radix      NEED_grok_numeric_radix_GLOBAL
231     grok_oct()                NEED_grok_oct                NEED_grok_oct_GLOBAL
232     gv_fetchpvn_flags()       NEED_gv_fetchpvn_flags       NEED_gv_fetchpvn_flags_GLOBAL
233     load_module()             NEED_load_module             NEED_load_module_GLOBAL
234     mess()                    NEED_mess                    NEED_mess_GLOBAL
235     mess_nocontext()          NEED_mess_nocontext          NEED_mess_nocontext_GLOBAL
236     mess_sv()                 NEED_mess_sv                 NEED_mess_sv_GLOBAL
237     mg_findext()              NEED_mg_findext              NEED_mg_findext_GLOBAL
238     my_snprintf()             NEED_my_snprintf             NEED_my_snprintf_GLOBAL
239     my_sprintf()              NEED_my_sprintf              NEED_my_sprintf_GLOBAL
240     my_strlcat()              NEED_my_strlcat              NEED_my_strlcat_GLOBAL
241     my_strlcpy()              NEED_my_strlcpy              NEED_my_strlcpy_GLOBAL
242     newCONSTSUB()             NEED_newCONSTSUB             NEED_newCONSTSUB_GLOBAL
243     newRV_noinc()             NEED_newRV_noinc             NEED_newRV_noinc_GLOBAL
244     newSV_type()              NEED_newSV_type              NEED_newSV_type_GLOBAL
245     newSVpvn_flags()          NEED_newSVpvn_flags          NEED_newSVpvn_flags_GLOBAL
246     newSVpvn_share()          NEED_newSVpvn_share          NEED_newSVpvn_share_GLOBAL
247     pv_display()              NEED_pv_display              NEED_pv_display_GLOBAL
248     pv_escape()               NEED_pv_escape               NEED_pv_escape_GLOBAL
249     pv_pretty()               NEED_pv_pretty               NEED_pv_pretty_GLOBAL
250     sv_2pv_flags()            NEED_sv_2pv_flags            NEED_sv_2pv_flags_GLOBAL
251     sv_2pvbyte()              NEED_sv_2pvbyte              NEED_sv_2pvbyte_GLOBAL
252     sv_catpvf_mg()            NEED_sv_catpvf_mg            NEED_sv_catpvf_mg_GLOBAL
253     sv_catpvf_mg_nocontext()  NEED_sv_catpvf_mg_nocontext  NEED_sv_catpvf_mg_nocontext_GLOBAL
254     sv_pvn_force_flags()      NEED_sv_pvn_force_flags      NEED_sv_pvn_force_flags_GLOBAL
255     sv_setpvf_mg()            NEED_sv_setpvf_mg            NEED_sv_setpvf_mg_GLOBAL
256     sv_setpvf_mg_nocontext()  NEED_sv_setpvf_mg_nocontext  NEED_sv_setpvf_mg_nocontext_GLOBAL
257     sv_unmagicext()           NEED_sv_unmagicext           NEED_sv_unmagicext_GLOBAL
258     vload_module()            NEED_vload_module            NEED_vload_module_GLOBAL
259     vmess()                   NEED_vmess                   NEED_vmess_GLOBAL
260     vnewSVpvf()               NEED_vnewSVpvf               NEED_vnewSVpvf_GLOBAL
261     warner()                  NEED_warner                  NEED_warner_GLOBAL
262
263 To avoid namespace conflicts, you can change the namespace of the
264 explicitly exported functions / variables using the C<DPPP_NAMESPACE>
265 macro. Just C<#define> the macro before including C<ppport.h>:
266
267     #define DPPP_NAMESPACE MyOwnNamespace_
268     #include "ppport.h"
269
270 The default namespace is C<DPPP_>.
271
272 =back
273
274 The good thing is that most of the above can be checked by running
275 F<ppport.h> on your source code. See the next section for
276 details.
277
278 =head1 EXAMPLES
279
280 To verify whether F<ppport.h> is needed for your module, whether you
281 should make any changes to your code, and whether any special defines
282 should be used, F<ppport.h> can be run as a Perl script to check your
283 source code. Simply say:
284
285     perl ppport.h
286
287 The result will usually be a list of patches suggesting changes
288 that should at least be acceptable, if not necessarily the most
289 efficient solution, or a fix for all possible problems.
290
291 If you know that your XS module uses features only available in
292 newer Perl releases, if you're aware that it uses C++ comments,
293 and if you want all suggestions as a single patch file, you could
294 use something like this:
295
296     perl ppport.h --compat-version=5.6.0 --cplusplus --patch=test.diff
297
298 If you only want your code to be scanned without any suggestions
299 for changes, use:
300
301     perl ppport.h --nochanges
302
303 You can specify a different C<diff> program or options, using
304 the C<--diff> option:
305
306     perl ppport.h --diff='diff -C 10'
307
308 This would output context diffs with 10 lines of context.
309
310 If you want to create patched copies of your files instead, use:
311
312     perl ppport.h --copy=.new
313
314 To display portability information for the C<newSVpvn> function,
315 use:
316
317     perl ppport.h --api-info=newSVpvn
318
319 Since the argument to C<--api-info> can be a regular expression,
320 you can use
321
322     perl ppport.h --api-info=/_nomg$/
323
324 to display portability information for all C<_nomg> functions or
325
326     perl ppport.h --api-info=/./
327
328 to display information for all known API elements.
329
330 =head1 BUGS
331
332 If this version of F<ppport.h> is causing failure during
333 the compilation of this module, please check if newer versions
334 of either this module or C<Devel::PPPort> are available on CPAN
335 before sending a bug report.
336
337 If F<ppport.h> was generated using the latest version of
338 C<Devel::PPPort> and is causing failure of this module, please
339 file a bug report here: L<https://github.com/mhx/Devel-PPPort/issues/>
340
341 Please include the following information:
342
343 =over 4
344
345 =item 1.
346
347 The complete output from running "perl -V"
348
349 =item 2.
350
351 This file.
352
353 =item 3.
354
355 The name and version of the module you were trying to build.
356
357 =item 4.
358
359 A full log of the build that failed.
360
361 =item 5.
362
363 Any other information that you think could be relevant.
364
365 =back
366
367 For the latest version of this code, please get the C<Devel::PPPort>
368 module from CPAN.
369
370 =head1 COPYRIGHT
371
372 Version 3.x, Copyright (c) 2004-2013, Marcus Holland-Moritz.
373
374 Version 2.x, Copyright (C) 2001, Paul Marquess.
375
376 Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
377
378 This program is free software; you can redistribute it and/or
379 modify it under the same terms as Perl itself.
380
381 =head1 SEE ALSO
382
383 See L<Devel::PPPort>.
384
385 =cut
386
387 use strict;
388
389 # Disable broken TRIE-optimization
390 BEGIN { eval '${^RE_TRIE_MAXBUF} = -1' if $] >= 5.009004 && $] <= 5.009005 }
391
392 my $VERSION = 3.39;
393
394 my %opt = (
395   quiet     => 0,
396   diag      => 1,
397   hints     => 1,
398   changes   => 1,
399   cplusplus => 0,
400   filter    => 1,
401   strip     => 0,
402   version   => 0,
403 );
404
405 my($ppport) = $0 =~ /([\w.]+)$/;
406 my $LF = '(?:\r\n|[\r\n])';   # line feed
407 my $HS = "[ \t]";             # horizontal whitespace
408
409 # Never use C comments in this file!
410 my $ccs  = '/'.'*';
411 my $cce  = '*'.'/';
412 my $rccs = quotemeta $ccs;
413 my $rcce = quotemeta $cce;
414
415 eval {
416   require Getopt::Long;
417   Getopt::Long::GetOptions(\%opt, qw(
418     help quiet diag! filter! hints! changes! cplusplus strip version
419     patch=s copy=s diff=s compat-version=s
420     list-provided list-unsupported api-info=s
421   )) or usage();
422 };
423
424 if ($@ and grep /^-/, @ARGV) {
425   usage() if "@ARGV" =~ /^--?h(?:elp)?$/;
426   die "Getopt::Long not found. Please don't use any options.\n";
427 }
428
429 if ($opt{version}) {
430   print "This is $0 $VERSION.\n";
431   exit 0;
432 }
433
434 usage() if $opt{help};
435 strip() if $opt{strip};
436
437 if (exists $opt{'compat-version'}) {
438   my($r,$v,$s) = eval { parse_version($opt{'compat-version'}) };
439   if ($@) {
440     die "Invalid version number format: '$opt{'compat-version'}'\n";
441   }
442   die "Only Perl 5 is supported\n" if $r != 5;
443   die "Invalid version number: $opt{'compat-version'}\n" if $v >= 1000 || $s >= 1000;
444   $opt{'compat-version'} = sprintf "%d.%03d%03d", $r, $v, $s;
445 }
446 else {
447   $opt{'compat-version'} = 5;
448 }
449
450 my %API = map { /^(\w+)\|([^|]*)\|([^|]*)\|(\w*)$/
451                 ? ( $1 => {
452                       ($2                  ? ( base     => $2 ) : ()),
453                       ($3                  ? ( todo     => $3 ) : ()),
454                       (index($4, 'v') >= 0 ? ( varargs  => 1  ) : ()),
455                       (index($4, 'p') >= 0 ? ( provided => 1  ) : ()),
456                       (index($4, 'n') >= 0 ? ( nothxarg => 1  ) : ()),
457                     } )
458                 : die "invalid spec: $_" } qw(
459 ASCII_TO_NEED||5.007001|n
460 AvFILLp|5.004050||p
461 AvFILL|||
462 BhkDISABLE||5.024000|
463 BhkENABLE||5.024000|
464 BhkENTRY_set||5.024000|
465 BhkENTRY|||
466 BhkFLAGS|||
467 CALL_BLOCK_HOOKS|||
468 CLASS|||n
469 CPERLscope|5.005000||p
470 CX_CURPAD_SAVE|||
471 CX_CURPAD_SV|||
472 C_ARRAY_END|5.013002||p
473 C_ARRAY_LENGTH|5.008001||p
474 CopFILEAV|5.006000||p
475 CopFILEGV_set|5.006000||p
476 CopFILEGV|5.006000||p
477 CopFILESV|5.006000||p
478 CopFILE_set|5.006000||p
479 CopFILE|5.006000||p
480 CopSTASHPV_set|5.006000||p
481 CopSTASHPV|5.006000||p
482 CopSTASH_eq|5.006000||p
483 CopSTASH_set|5.006000||p
484 CopSTASH|5.006000||p
485 CopyD|5.009002|5.004050|p
486 Copy|||
487 CvPADLIST||5.008001|
488 CvSTASH|||
489 CvWEAKOUTSIDE|||
490 DECLARATION_FOR_LC_NUMERIC_MANIPULATION||5.021010|n
491 DEFSV_set|5.010001||p
492 DEFSV|5.004050||p
493 DO_UTF8||5.006000|
494 END_EXTERN_C|5.005000||p
495 ENTER|||
496 ERRSV|5.004050||p
497 EXTEND|||
498 EXTERN_C|5.005000||p
499 F0convert|||n
500 FREETMPS|||
501 GIMME_V||5.004000|n
502 GIMME|||n
503 GROK_NUMERIC_RADIX|5.007002||p
504 G_ARRAY|||
505 G_DISCARD|||
506 G_EVAL|||
507 G_METHOD|5.006001||p
508 G_NOARGS|||
509 G_SCALAR|||
510 G_VOID||5.004000|
511 GetVars|||
512 GvAV|||
513 GvCV|||
514 GvHV|||
515 GvSV|||
516 Gv_AMupdate||5.011000|
517 HEf_SVKEY|5.003070||p
518 HeHASH||5.003070|
519 HeKEY||5.003070|
520 HeKLEN||5.003070|
521 HePV||5.004000|
522 HeSVKEY_force||5.003070|
523 HeSVKEY_set||5.004000|
524 HeSVKEY||5.003070|
525 HeUTF8|5.010001|5.008000|p
526 HeVAL||5.003070|
527 HvENAMELEN||5.015004|
528 HvENAMEUTF8||5.015004|
529 HvENAME||5.013007|
530 HvNAMELEN_get|5.009003||p
531 HvNAMELEN||5.015004|
532 HvNAMEUTF8||5.015004|
533 HvNAME_get|5.009003||p
534 HvNAME|||
535 INT2PTR|5.006000||p
536 IN_LOCALE_COMPILETIME|5.007002||p
537 IN_LOCALE_RUNTIME|5.007002||p
538 IN_LOCALE|5.007002||p
539 IN_PERL_COMPILETIME|5.008001||p
540 IS_NUMBER_GREATER_THAN_UV_MAX|5.007002||p
541 IS_NUMBER_INFINITY|5.007002||p
542 IS_NUMBER_IN_UV|5.007002||p
543 IS_NUMBER_NAN|5.007003||p
544 IS_NUMBER_NEG|5.007002||p
545 IS_NUMBER_NOT_INT|5.007002||p
546 IVSIZE|5.006000||p
547 IVTYPE|5.006000||p
548 IVdf|5.006000||p
549 LEAVE|||
550 LINKLIST||5.013006|
551 LVRET|||
552 MARK|||
553 MULTICALL||5.024000|
554 MUTABLE_PTR|5.010001||p
555 MUTABLE_SV|5.010001||p
556 MY_CXT_CLONE|5.009002||p
557 MY_CXT_INIT|5.007003||p
558 MY_CXT|5.007003||p
559 MoveD|5.009002|5.004050|p
560 Move|||
561 NATIVE_TO_NEED||5.007001|n
562 NOOP|5.005000||p
563 NUM2PTR|5.006000||p
564 NVTYPE|5.006000||p
565 NVef|5.006001||p
566 NVff|5.006001||p
567 NVgf|5.006001||p
568 Newxc|5.009003||p
569 Newxz|5.009003||p
570 Newx|5.009003||p
571 Nullav|||
572 Nullch|||
573 Nullcv|||
574 Nullhv|||
575 Nullsv|||
576 OP_CLASS||5.013007|
577 OP_DESC||5.007003|
578 OP_NAME||5.007003|
579 OP_TYPE_IS_OR_WAS||5.019010|
580 OP_TYPE_IS||5.019007|
581 ORIGMARK|||
582 OpHAS_SIBLING|5.021007||p
583 OpLASTSIB_set|5.021011||p
584 OpMAYBESIB_set|5.021011||p
585 OpMORESIB_set|5.021011||p
586 OpSIBLING|5.021007||p
587 PAD_BASE_SV|||
588 PAD_CLONE_VARS|||
589 PAD_COMPNAME_FLAGS|||
590 PAD_COMPNAME_GEN_set|||
591 PAD_COMPNAME_GEN|||
592 PAD_COMPNAME_OURSTASH|||
593 PAD_COMPNAME_PV|||
594 PAD_COMPNAME_TYPE|||
595 PAD_RESTORE_LOCAL|||
596 PAD_SAVE_LOCAL|||
597 PAD_SAVE_SETNULLPAD|||
598 PAD_SETSV|||
599 PAD_SET_CUR_NOSAVE|||
600 PAD_SET_CUR|||
601 PAD_SVl|||
602 PAD_SV|||
603 PERLIO_FUNCS_CAST|5.009003||p
604 PERLIO_FUNCS_DECL|5.009003||p
605 PERL_ABS|5.008001||p
606 PERL_ARGS_ASSERT_CROAK_XS_USAGE|||p
607 PERL_BCDVERSION|5.024000||p
608 PERL_GCC_BRACE_GROUPS_FORBIDDEN|5.008001||p
609 PERL_HASH|5.003070||p
610 PERL_INT_MAX|5.003070||p
611 PERL_INT_MIN|5.003070||p
612 PERL_LONG_MAX|5.003070||p
613 PERL_LONG_MIN|5.003070||p
614 PERL_MAGIC_arylen|5.007002||p
615 PERL_MAGIC_backref|5.007002||p
616 PERL_MAGIC_bm|5.007002||p
617 PERL_MAGIC_collxfrm|5.007002||p
618 PERL_MAGIC_dbfile|5.007002||p
619 PERL_MAGIC_dbline|5.007002||p
620 PERL_MAGIC_defelem|5.007002||p
621 PERL_MAGIC_envelem|5.007002||p
622 PERL_MAGIC_env|5.007002||p
623 PERL_MAGIC_ext|5.007002||p
624 PERL_MAGIC_fm|5.007002||p
625 PERL_MAGIC_glob|5.024000||p
626 PERL_MAGIC_isaelem|5.007002||p
627 PERL_MAGIC_isa|5.007002||p
628 PERL_MAGIC_mutex|5.024000||p
629 PERL_MAGIC_nkeys|5.007002||p
630 PERL_MAGIC_overload_elem|5.024000||p
631 PERL_MAGIC_overload_table|5.007002||p
632 PERL_MAGIC_overload|5.024000||p
633 PERL_MAGIC_pos|5.007002||p
634 PERL_MAGIC_qr|5.007002||p
635 PERL_MAGIC_regdata|5.007002||p
636 PERL_MAGIC_regdatum|5.007002||p
637 PERL_MAGIC_regex_global|5.007002||p
638 PERL_MAGIC_shared_scalar|5.007003||p
639 PERL_MAGIC_shared|5.007003||p
640 PERL_MAGIC_sigelem|5.007002||p
641 PERL_MAGIC_sig|5.007002||p
642 PERL_MAGIC_substr|5.007002||p
643 PERL_MAGIC_sv|5.007002||p
644 PERL_MAGIC_taint|5.007002||p
645 PERL_MAGIC_tiedelem|5.007002||p
646 PERL_MAGIC_tiedscalar|5.007002||p
647 PERL_MAGIC_tied|5.007002||p
648 PERL_MAGIC_utf8|5.008001||p
649 PERL_MAGIC_uvar_elem|5.007003||p
650 PERL_MAGIC_uvar|5.007002||p
651 PERL_MAGIC_vec|5.007002||p
652 PERL_MAGIC_vstring|5.008001||p
653 PERL_PV_ESCAPE_ALL|5.009004||p
654 PERL_PV_ESCAPE_FIRSTCHAR|5.009004||p
655 PERL_PV_ESCAPE_NOBACKSLASH|5.009004||p
656 PERL_PV_ESCAPE_NOCLEAR|5.009004||p
657 PERL_PV_ESCAPE_QUOTE|5.009004||p
658 PERL_PV_ESCAPE_RE|5.009005||p
659 PERL_PV_ESCAPE_UNI_DETECT|5.009004||p
660 PERL_PV_ESCAPE_UNI|5.009004||p
661 PERL_PV_PRETTY_DUMP|5.009004||p
662 PERL_PV_PRETTY_ELLIPSES|5.010000||p
663 PERL_PV_PRETTY_LTGT|5.009004||p
664 PERL_PV_PRETTY_NOCLEAR|5.010000||p
665 PERL_PV_PRETTY_QUOTE|5.009004||p
666 PERL_PV_PRETTY_REGPROP|5.009004||p
667 PERL_QUAD_MAX|5.003070||p
668 PERL_QUAD_MIN|5.003070||p
669 PERL_REVISION|5.006000||p
670 PERL_SCAN_ALLOW_UNDERSCORES|5.007003||p
671 PERL_SCAN_DISALLOW_PREFIX|5.007003||p
672 PERL_SCAN_GREATER_THAN_UV_MAX|5.007003||p
673 PERL_SCAN_SILENT_ILLDIGIT|5.008001||p
674 PERL_SHORT_MAX|5.003070||p
675 PERL_SHORT_MIN|5.003070||p
676 PERL_SIGNALS_UNSAFE_FLAG|5.008001||p
677 PERL_SUBVERSION|5.006000||p
678 PERL_SYS_INIT3||5.006000|
679 PERL_SYS_INIT|||
680 PERL_SYS_TERM||5.024000|
681 PERL_UCHAR_MAX|5.003070||p
682 PERL_UCHAR_MIN|5.003070||p
683 PERL_UINT_MAX|5.003070||p
684 PERL_UINT_MIN|5.003070||p
685 PERL_ULONG_MAX|5.003070||p
686 PERL_ULONG_MIN|5.003070||p
687 PERL_UNUSED_ARG|5.009003||p
688 PERL_UNUSED_CONTEXT|5.009004||p
689 PERL_UNUSED_DECL|5.007002||p
690 PERL_UNUSED_RESULT|5.021001||p
691 PERL_UNUSED_VAR|5.007002||p
692 PERL_UQUAD_MAX|5.003070||p
693 PERL_UQUAD_MIN|5.003070||p
694 PERL_USE_GCC_BRACE_GROUPS|5.009004||p
695 PERL_USHORT_MAX|5.003070||p
696 PERL_USHORT_MIN|5.003070||p
697 PERL_VERSION|5.006000||p
698 PL_DBsignal|5.005000||p
699 PL_DBsingle|||pn
700 PL_DBsub|||pn
701 PL_DBtrace|||pn
702 PL_Sv|5.005000||p
703 PL_bufend|5.024000||p
704 PL_bufptr|5.024000||p
705 PL_check||5.006000|
706 PL_compiling|5.004050||p
707 PL_comppad_name||5.017004|
708 PL_comppad||5.008001|
709 PL_copline|5.024000||p
710 PL_curcop|5.004050||p
711 PL_curpad||5.005000|
712 PL_curstash|5.004050||p
713 PL_debstash|5.004050||p
714 PL_defgv|5.004050||p
715 PL_diehook|5.004050||p
716 PL_dirty|5.004050||p
717 PL_dowarn|||pn
718 PL_errgv|5.004050||p
719 PL_error_count|5.024000||p
720 PL_expect|5.024000||p
721 PL_hexdigit|5.005000||p
722 PL_hints|5.005000||p
723 PL_in_my_stash|5.024000||p
724 PL_in_my|5.024000||p
725 PL_keyword_plugin||5.011002|
726 PL_last_in_gv|||n
727 PL_laststatval|5.005000||p
728 PL_lex_state|5.024000||p
729 PL_lex_stuff|5.024000||p
730 PL_linestr|5.024000||p
731 PL_modglobal||5.005000|n
732 PL_na|5.004050||pn
733 PL_no_modify|5.006000||p
734 PL_ofsgv|||n
735 PL_opfreehook||5.011000|n
736 PL_parser|5.009005||p
737 PL_peepp||5.007003|n
738 PL_perl_destruct_level|5.004050||p
739 PL_perldb|5.004050||p
740 PL_ppaddr|5.006000||p
741 PL_rpeepp||5.013005|n
742 PL_rsfp_filters|5.024000||p
743 PL_rsfp|5.024000||p
744 PL_rs|||n
745 PL_signals|5.008001||p
746 PL_stack_base|5.004050||p
747 PL_stack_sp|5.004050||p
748 PL_statcache|5.005000||p
749 PL_stdingv|5.004050||p
750 PL_sv_arenaroot|5.004050||p
751 PL_sv_no|5.004050||pn
752 PL_sv_undef|5.004050||pn
753 PL_sv_yes|5.004050||pn
754 PL_tainted|5.004050||p
755 PL_tainting|5.004050||p
756 PL_tokenbuf|5.024000||p
757 POP_MULTICALL||5.024000|
758 POPi|||n
759 POPl|||n
760 POPn|||n
761 POPpbytex||5.007001|n
762 POPpx||5.005030|n
763 POPp|||n
764 POPs|||n
765 POPul||5.006000|n
766 POPu||5.004000|n
767 PTR2IV|5.006000||p
768 PTR2NV|5.006000||p
769 PTR2UV|5.006000||p
770 PTR2nat|5.009003||p
771 PTR2ul|5.007001||p
772 PTRV|5.006000||p
773 PUSHMARK|||
774 PUSH_MULTICALL||5.024000|
775 PUSHi|||
776 PUSHmortal|5.009002||p
777 PUSHn|||
778 PUSHp|||
779 PUSHs|||
780 PUSHu|5.004000||p
781 PUTBACK|||
782 PadARRAY||5.024000|
783 PadMAX||5.024000|
784 PadlistARRAY||5.024000|
785 PadlistMAX||5.024000|
786 PadlistNAMESARRAY||5.024000|
787 PadlistNAMESMAX||5.024000|
788 PadlistNAMES||5.024000|
789 PadlistREFCNT||5.017004|
790 PadnameIsOUR|||
791 PadnameIsSTATE|||
792 PadnameLEN||5.024000|
793 PadnameOURSTASH|||
794 PadnameOUTER|||
795 PadnamePV||5.024000|
796 PadnameREFCNT_dec||5.024000|
797 PadnameREFCNT||5.024000|
798 PadnameSV||5.024000|
799 PadnameTYPE|||
800 PadnameUTF8||5.021007|
801 PadnamelistARRAY||5.024000|
802 PadnamelistMAX||5.024000|
803 PadnamelistREFCNT_dec||5.024000|
804 PadnamelistREFCNT||5.024000|
805 PerlIO_clearerr||5.007003|
806 PerlIO_close||5.007003|
807 PerlIO_context_layers||5.009004|
808 PerlIO_eof||5.007003|
809 PerlIO_error||5.007003|
810 PerlIO_fileno||5.007003|
811 PerlIO_fill||5.007003|
812 PerlIO_flush||5.007003|
813 PerlIO_get_base||5.007003|
814 PerlIO_get_bufsiz||5.007003|
815 PerlIO_get_cnt||5.007003|
816 PerlIO_get_ptr||5.007003|
817 PerlIO_read||5.007003|
818 PerlIO_restore_errno|||
819 PerlIO_save_errno|||
820 PerlIO_seek||5.007003|
821 PerlIO_set_cnt||5.007003|
822 PerlIO_set_ptrcnt||5.007003|
823 PerlIO_setlinebuf||5.007003|
824 PerlIO_stderr||5.007003|
825 PerlIO_stdin||5.007003|
826 PerlIO_stdout||5.007003|
827 PerlIO_tell||5.007003|
828 PerlIO_unread||5.007003|
829 PerlIO_write||5.007003|
830 Perl_signbit||5.009005|n
831 PoisonFree|5.009004||p
832 PoisonNew|5.009004||p
833 PoisonWith|5.009004||p
834 Poison|5.008000||p
835 READ_XDIGIT||5.017006|
836 RESTORE_LC_NUMERIC||5.024000|
837 RETVAL|||n
838 Renewc|||
839 Renew|||
840 SAVECLEARSV|||
841 SAVECOMPPAD|||
842 SAVEPADSV|||
843 SAVETMPS|||
844 SAVE_DEFSV|5.004050||p
845 SPAGAIN|||
846 SP|||
847 START_EXTERN_C|5.005000||p
848 START_MY_CXT|5.007003||p
849 STMT_END|||p
850 STMT_START|||p
851 STORE_LC_NUMERIC_FORCE_TO_UNDERLYING||5.024000|
852 STORE_LC_NUMERIC_SET_TO_NEEDED||5.024000|
853 STR_WITH_LEN|5.009003||p
854 ST|||
855 SV_CONST_RETURN|5.009003||p
856 SV_COW_DROP_PV|5.008001||p
857 SV_COW_SHARED_HASH_KEYS|5.009005||p
858 SV_GMAGIC|5.007002||p
859 SV_HAS_TRAILING_NUL|5.009004||p
860 SV_IMMEDIATE_UNREF|5.007001||p
861 SV_MUTABLE_RETURN|5.009003||p
862 SV_NOSTEAL|5.009002||p
863 SV_SMAGIC|5.009003||p
864 SV_UTF8_NO_ENCODING|5.008001||p
865 SVfARG|5.009005||p
866 SVf_UTF8|5.006000||p
867 SVf|5.006000||p
868 SVt_INVLIST||5.019002|
869 SVt_IV|||
870 SVt_NULL|||
871 SVt_NV|||
872 SVt_PVAV|||
873 SVt_PVCV|||
874 SVt_PVFM|||
875 SVt_PVGV|||
876 SVt_PVHV|||
877 SVt_PVIO|||
878 SVt_PVIV|||
879 SVt_PVLV|||
880 SVt_PVMG|||
881 SVt_PVNV|||
882 SVt_PV|||
883 SVt_REGEXP||5.011000|
884 Safefree|||
885 Slab_Alloc|||
886 Slab_Free|||
887 Slab_to_ro|||
888 Slab_to_rw|||
889 StructCopy|||
890 SvCUR_set|||
891 SvCUR|||
892 SvEND|||
893 SvGAMAGIC||5.006001|
894 SvGETMAGIC|5.004050||p
895 SvGROW|||
896 SvIOK_UV||5.006000|
897 SvIOK_notUV||5.006000|
898 SvIOK_off|||
899 SvIOK_only_UV||5.006000|
900 SvIOK_only|||
901 SvIOK_on|||
902 SvIOKp|||
903 SvIOK|||
904 SvIVX|||
905 SvIV_nomg|5.009001||p
906 SvIV_set|||
907 SvIVx|||
908 SvIV|||
909 SvIsCOW_shared_hash||5.008003|
910 SvIsCOW||5.008003|
911 SvLEN_set|||
912 SvLEN|||
913 SvLOCK||5.007003|
914 SvMAGIC_set|5.009003||p
915 SvNIOK_off|||
916 SvNIOKp|||
917 SvNIOK|||
918 SvNOK_off|||
919 SvNOK_only|||
920 SvNOK_on|||
921 SvNOKp|||
922 SvNOK|||
923 SvNVX|||
924 SvNV_nomg||5.013002|
925 SvNV_set|||
926 SvNVx|||
927 SvNV|||
928 SvOK|||
929 SvOOK_offset||5.011000|
930 SvOOK|||
931 SvPOK_off|||
932 SvPOK_only_UTF8||5.006000|
933 SvPOK_only|||
934 SvPOK_on|||
935 SvPOKp|||
936 SvPOK|||
937 SvPVX_const|5.009003||p
938 SvPVX_mutable|5.009003||p
939 SvPVX|||
940 SvPV_const|5.009003||p
941 SvPV_flags_const_nolen|5.009003||p
942 SvPV_flags_const|5.009003||p
943 SvPV_flags_mutable|5.009003||p
944 SvPV_flags|5.007002||p
945 SvPV_force_flags_mutable|5.009003||p
946 SvPV_force_flags_nolen|5.009003||p
947 SvPV_force_flags|5.007002||p
948 SvPV_force_mutable|5.009003||p
949 SvPV_force_nolen|5.009003||p
950 SvPV_force_nomg_nolen|5.009003||p
951 SvPV_force_nomg|5.007002||p
952 SvPV_force|||p
953 SvPV_mutable|5.009003||p
954 SvPV_nolen_const|5.009003||p
955 SvPV_nolen|5.006000||p
956 SvPV_nomg_const_nolen|5.009003||p
957 SvPV_nomg_const|5.009003||p
958 SvPV_nomg_nolen|5.013007||p
959 SvPV_nomg|5.007002||p
960 SvPV_renew|5.009003||p
961 SvPV_set|||
962 SvPVbyte_force||5.009002|
963 SvPVbyte_nolen||5.006000|
964 SvPVbytex_force||5.006000|
965 SvPVbytex||5.006000|
966 SvPVbyte|5.006000||p
967 SvPVutf8_force||5.006000|
968 SvPVutf8_nolen||5.006000|
969 SvPVutf8x_force||5.006000|
970 SvPVutf8x||5.006000|
971 SvPVutf8||5.006000|
972 SvPVx|||
973 SvPV|||
974 SvREFCNT_dec_NN||5.017007|
975 SvREFCNT_dec|||
976 SvREFCNT_inc_NN|5.009004||p
977 SvREFCNT_inc_simple_NN|5.009004||p
978 SvREFCNT_inc_simple_void_NN|5.009004||p
979 SvREFCNT_inc_simple_void|5.009004||p
980 SvREFCNT_inc_simple|5.009004||p
981 SvREFCNT_inc_void_NN|5.009004||p
982 SvREFCNT_inc_void|5.009004||p
983 SvREFCNT_inc|||p
984 SvREFCNT|||
985 SvROK_off|||
986 SvROK_on|||
987 SvROK|||
988 SvRV_set|5.009003||p
989 SvRV|||
990 SvRXOK|5.009005||p
991 SvRX|5.009005||p
992 SvSETMAGIC|||
993 SvSHARED_HASH|5.009003||p
994 SvSHARE||5.007003|
995 SvSTASH_set|5.009003||p
996 SvSTASH|||
997 SvSetMagicSV_nosteal||5.004000|
998 SvSetMagicSV||5.004000|
999 SvSetSV_nosteal||5.004000|
1000 SvSetSV|||
1001 SvTAINTED_off||5.004000|
1002 SvTAINTED_on||5.004000|
1003 SvTAINTED||5.004000|
1004 SvTAINT|||
1005 SvTHINKFIRST|||
1006 SvTRUE_nomg||5.013006|
1007 SvTRUE|||
1008 SvTYPE|||
1009 SvUNLOCK||5.007003|
1010 SvUOK|5.007001|5.006000|p
1011 SvUPGRADE|||
1012 SvUTF8_off||5.006000|
1013 SvUTF8_on||5.006000|
1014 SvUTF8||5.006000|
1015 SvUVXx|5.004000||p
1016 SvUVX|5.004000||p
1017 SvUV_nomg|5.009001||p
1018 SvUV_set|5.009003||p
1019 SvUVx|5.004000||p
1020 SvUV|5.004000||p
1021 SvVOK||5.008001|
1022 SvVSTRING_mg|5.009004||p
1023 THIS|||n
1024 UNDERBAR|5.009002||p
1025 UTF8SKIP||5.006000|
1026 UTF8_MAXBYTES|5.009002||p
1027 UVCHR_SKIP||5.022000|
1028 UVSIZE|5.006000||p
1029 UVTYPE|5.006000||p
1030 UVXf|5.007001||p
1031 UVof|5.006000||p
1032 UVuf|5.006000||p
1033 UVxf|5.006000||p
1034 WARN_ALL|5.006000||p
1035 WARN_AMBIGUOUS|5.006000||p
1036 WARN_ASSERTIONS|5.024000||p
1037 WARN_BAREWORD|5.006000||p
1038 WARN_CLOSED|5.006000||p
1039 WARN_CLOSURE|5.006000||p
1040 WARN_DEBUGGING|5.006000||p
1041 WARN_DEPRECATED|5.006000||p
1042 WARN_DIGIT|5.006000||p
1043 WARN_EXEC|5.006000||p
1044 WARN_EXITING|5.006000||p
1045 WARN_GLOB|5.006000||p
1046 WARN_INPLACE|5.006000||p
1047 WARN_INTERNAL|5.006000||p
1048 WARN_IO|5.006000||p
1049 WARN_LAYER|5.008000||p
1050 WARN_MALLOC|5.006000||p
1051 WARN_MISC|5.006000||p
1052 WARN_NEWLINE|5.006000||p
1053 WARN_NUMERIC|5.006000||p
1054 WARN_ONCE|5.006000||p
1055 WARN_OVERFLOW|5.006000||p
1056 WARN_PACK|5.006000||p
1057 WARN_PARENTHESIS|5.006000||p
1058 WARN_PIPE|5.006000||p
1059 WARN_PORTABLE|5.006000||p
1060 WARN_PRECEDENCE|5.006000||p
1061 WARN_PRINTF|5.006000||p
1062 WARN_PROTOTYPE|5.006000||p
1063 WARN_QW|5.006000||p
1064 WARN_RECURSION|5.006000||p
1065 WARN_REDEFINE|5.006000||p
1066 WARN_REGEXP|5.006000||p
1067 WARN_RESERVED|5.006000||p
1068 WARN_SEMICOLON|5.006000||p
1069 WARN_SEVERE|5.006000||p
1070 WARN_SIGNAL|5.006000||p
1071 WARN_SUBSTR|5.006000||p
1072 WARN_SYNTAX|5.006000||p
1073 WARN_TAINT|5.006000||p
1074 WARN_THREADS|5.008000||p
1075 WARN_UNINITIALIZED|5.006000||p
1076 WARN_UNOPENED|5.006000||p
1077 WARN_UNPACK|5.006000||p
1078 WARN_UNTIE|5.006000||p
1079 WARN_UTF8|5.006000||p
1080 WARN_VOID|5.006000||p
1081 WIDEST_UTYPE|5.015004||p
1082 XCPT_CATCH|5.009002||p
1083 XCPT_RETHROW|5.009002||p
1084 XCPT_TRY_END|5.009002||p
1085 XCPT_TRY_START|5.009002||p
1086 XPUSHi|||
1087 XPUSHmortal|5.009002||p
1088 XPUSHn|||
1089 XPUSHp|||
1090 XPUSHs|||
1091 XPUSHu|5.004000||p
1092 XSPROTO|5.010000||p
1093 XSRETURN_EMPTY|||
1094 XSRETURN_IV|||
1095 XSRETURN_NO|||
1096 XSRETURN_NV|||
1097 XSRETURN_PV|||
1098 XSRETURN_UNDEF|||
1099 XSRETURN_UV|5.008001||p
1100 XSRETURN_YES|||
1101 XSRETURN|||p
1102 XST_mIV|||
1103 XST_mNO|||
1104 XST_mNV|||
1105 XST_mPV|||
1106 XST_mUNDEF|||
1107 XST_mUV|5.008001||p
1108 XST_mYES|||
1109 XS_APIVERSION_BOOTCHECK||5.024000|
1110 XS_EXTERNAL||5.024000|
1111 XS_INTERNAL||5.024000|
1112 XS_VERSION_BOOTCHECK||5.024000|
1113 XS_VERSION|||
1114 XSprePUSH|5.006000||p
1115 XS|||
1116 XopDISABLE||5.024000|
1117 XopENABLE||5.024000|
1118 XopENTRYCUSTOM||5.024000|
1119 XopENTRY_set||5.024000|
1120 XopENTRY||5.024000|
1121 XopFLAGS||5.013007|
1122 ZeroD|5.009002||p
1123 Zero|||
1124 _aMY_CXT|5.007003||p
1125 _add_range_to_invlist|||
1126 _append_range_to_invlist|||
1127 _core_swash_init|||
1128 _get_encoding|||
1129 _get_regclass_nonbitmap_data|||
1130 _get_swash_invlist|||
1131 _invlistEQ|||
1132 _invlist_array_init|||n
1133 _invlist_contains_cp|||n
1134 _invlist_dump|||
1135 _invlist_intersection_maybe_complement_2nd|||
1136 _invlist_intersection|||
1137 _invlist_invert|||
1138 _invlist_len|||n
1139 _invlist_populate_swatch|||n
1140 _invlist_search|||n
1141 _invlist_subtract|||
1142 _invlist_union_maybe_complement_2nd|||
1143 _invlist_union|||
1144 _is_cur_LC_category_utf8|||
1145 _is_in_locale_category||5.021001|
1146 _is_uni_FOO||5.017008|
1147 _is_uni_perl_idcont||5.017008|
1148 _is_uni_perl_idstart||5.017007|
1149 _is_utf8_FOO||5.017008|
1150 _is_utf8_char_slow||5.021001|n
1151 _is_utf8_idcont||5.021001|
1152 _is_utf8_idstart||5.021001|
1153 _is_utf8_mark||5.017008|
1154 _is_utf8_perl_idcont||5.017008|
1155 _is_utf8_perl_idstart||5.017007|
1156 _is_utf8_xidcont||5.021001|
1157 _is_utf8_xidstart||5.021001|
1158 _load_PL_utf8_foldclosures|||
1159 _make_exactf_invlist|||
1160 _new_invlist_C_array|||
1161 _new_invlist|||
1162 _pMY_CXT|5.007003||p
1163 _setlocale_debug_string|||n
1164 _setup_canned_invlist|||
1165 _swash_inversion_hash|||
1166 _swash_to_invlist|||
1167 _to_fold_latin1|||
1168 _to_uni_fold_flags||5.014000|
1169 _to_upper_title_latin1|||
1170 _to_utf8_case|||
1171 _to_utf8_fold_flags||5.019009|
1172 _to_utf8_lower_flags||5.019009|
1173 _to_utf8_title_flags||5.019009|
1174 _to_utf8_upper_flags||5.019009|
1175 _warn_problematic_locale|||n
1176 aMY_CXT_|5.007003||p
1177 aMY_CXT|5.007003||p
1178 aTHXR_|5.024000||p
1179 aTHXR|5.024000||p
1180 aTHX_|5.006000||p
1181 aTHX|5.006000||p
1182 add_above_Latin1_folds|||
1183 add_cp_to_invlist|||
1184 add_data|||n
1185 add_multi_match|||
1186 add_utf16_textfilter|||
1187 adjust_size_and_find_bucket|||n
1188 advance_one_LB|||
1189 advance_one_SB|||
1190 advance_one_WB|||
1191 alloc_maybe_populate_EXACT|||
1192 alloccopstash|||
1193 allocmy|||
1194 amagic_call|||
1195 amagic_cmp_locale|||
1196 amagic_cmp|||
1197 amagic_deref_call||5.013007|
1198 amagic_i_ncmp|||
1199 amagic_is_enabled|||
1200 amagic_ncmp|||
1201 anonymise_cv_maybe|||
1202 any_dup|||
1203 ao|||
1204 append_utf8_from_native_byte||5.019004|n
1205 apply_attrs_my|||
1206 apply_attrs_string||5.006001|
1207 apply_attrs|||
1208 apply|||
1209 assert_uft8_cache_coherent|||
1210 assignment_type|||
1211 atfork_lock||5.007003|n
1212 atfork_unlock||5.007003|n
1213 av_arylen_p||5.009003|
1214 av_clear|||
1215 av_create_and_push||5.009005|
1216 av_create_and_unshift_one||5.009005|
1217 av_delete||5.006000|
1218 av_exists||5.006000|
1219 av_extend_guts|||
1220 av_extend|||
1221 av_fetch|||
1222 av_fill|||
1223 av_iter_p||5.011000|
1224 av_len|||
1225 av_make|||
1226 av_pop|||
1227 av_push|||
1228 av_reify|||
1229 av_shift|||
1230 av_store|||
1231 av_tindex||5.017009|
1232 av_top_index||5.017009|
1233 av_undef|||
1234 av_unshift|||
1235 ax|||n
1236 backup_one_LB|||
1237 backup_one_SB|||
1238 backup_one_WB|||
1239 bad_type_gv|||
1240 bad_type_pv|||
1241 bind_match|||
1242 block_end||5.004000|
1243 block_gimme||5.004000|
1244 block_start||5.004000|
1245 blockhook_register||5.013003|
1246 boolSV|5.004000||p
1247 boot_core_PerlIO|||
1248 boot_core_UNIVERSAL|||
1249 boot_core_mro|||
1250 bytes_cmp_utf8||5.013007|
1251 bytes_from_utf8||5.007001|
1252 bytes_to_utf8||5.006001|
1253 cBOOL|5.013000||p
1254 call_argv|5.006000||p
1255 call_atexit||5.006000|
1256 call_list||5.004000|
1257 call_method|5.006000||p
1258 call_pv|5.006000||p
1259 call_sv|5.006000||p
1260 caller_cx|5.013005|5.006000|p
1261 calloc||5.007002|n
1262 cando|||
1263 cast_i32||5.006000|n
1264 cast_iv||5.006000|n
1265 cast_ulong||5.006000|n
1266 cast_uv||5.006000|n
1267 check_locale_boundary_crossing|||
1268 check_type_and_open|||
1269 check_uni|||
1270 check_utf8_print|||
1271 checkcomma|||
1272 ckWARN|5.006000||p
1273 ck_entersub_args_core|||
1274 ck_entersub_args_list||5.013006|
1275 ck_entersub_args_proto_or_list||5.013006|
1276 ck_entersub_args_proto||5.013006|
1277 ck_warner_d||5.011001|v
1278 ck_warner||5.011001|v
1279 ckwarn_common|||
1280 ckwarn_d||5.009003|
1281 ckwarn||5.009003|
1282 clear_defarray||5.023008|
1283 clear_placeholders|||
1284 clear_special_blocks|||
1285 clone_params_del|||n
1286 clone_params_new|||n
1287 closest_cop|||
1288 cntrl_to_mnemonic|||n
1289 compute_EXACTish|||n
1290 construct_ahocorasick_from_trie|||
1291 cop_fetch_label||5.015001|
1292 cop_free|||
1293 cop_hints_2hv||5.013007|
1294 cop_hints_fetch_pvn||5.013007|
1295 cop_hints_fetch_pvs||5.013007|
1296 cop_hints_fetch_pv||5.013007|
1297 cop_hints_fetch_sv||5.013007|
1298 cop_store_label||5.015001|
1299 cophh_2hv||5.013007|
1300 cophh_copy||5.013007|
1301 cophh_delete_pvn||5.013007|
1302 cophh_delete_pvs||5.013007|
1303 cophh_delete_pv||5.013007|
1304 cophh_delete_sv||5.013007|
1305 cophh_fetch_pvn||5.013007|
1306 cophh_fetch_pvs||5.013007|
1307 cophh_fetch_pv||5.013007|
1308 cophh_fetch_sv||5.013007|
1309 cophh_free||5.013007|
1310 cophh_new_empty||5.024000|
1311 cophh_store_pvn||5.013007|
1312 cophh_store_pvs||5.013007|
1313 cophh_store_pv||5.013007|
1314 cophh_store_sv||5.013007|
1315 core_prototype|||
1316 coresub_op|||
1317 cr_textfilter|||
1318 create_eval_scope|||
1319 croak_memory_wrap|5.019003||pn
1320 croak_no_mem|||n
1321 croak_no_modify|5.013003||pn
1322 croak_nocontext|||pvn
1323 croak_popstack|||n
1324 croak_sv|5.013001||p
1325 croak_xs_usage|5.010001||pn
1326 croak|||v
1327 csighandler||5.009003|n
1328 current_re_engine|||
1329 curse|||
1330 custom_op_desc||5.007003|
1331 custom_op_get_field|||
1332 custom_op_name||5.007003|
1333 custom_op_register||5.013007|
1334 custom_op_xop||5.013007|
1335 cv_ckproto_len_flags|||
1336 cv_clone_into|||
1337 cv_clone|||
1338 cv_const_sv_or_av|||n
1339 cv_const_sv||5.003070|n
1340 cv_dump|||
1341 cv_forget_slab|||
1342 cv_get_call_checker||5.013006|
1343 cv_name||5.021005|
1344 cv_set_call_checker_flags||5.021004|
1345 cv_set_call_checker||5.013006|
1346 cv_undef_flags|||
1347 cv_undef|||
1348 cvgv_from_hek|||
1349 cvgv_set|||
1350 cvstash_set|||
1351 cx_dump||5.005000|
1352 cx_dup|||
1353 cx_popblock||5.023008|
1354 cx_popeval||5.023008|
1355 cx_popformat||5.023008|
1356 cx_popgiven||5.023008|
1357 cx_poploop||5.023008|
1358 cx_popsub_args||5.023008|
1359 cx_popsub_common||5.023008|
1360 cx_popsub||5.023008|
1361 cx_popwhen||5.023008|
1362 cx_pushblock||5.023008|
1363 cx_pusheval||5.023008|
1364 cx_pushformat||5.023008|
1365 cx_pushgiven||5.023008|
1366 cx_pushloop_for||5.023008|
1367 cx_pushloop_plain||5.023008|
1368 cx_pushsub||5.023008|
1369 cx_pushwhen||5.023008|
1370 cx_topblock||5.023008|
1371 cxinc|||
1372 dAXMARK|5.009003||p
1373 dAX|5.007002||p
1374 dITEMS|5.007002||p
1375 dMARK|||
1376 dMULTICALL||5.009003|
1377 dMY_CXT_SV|5.007003||p
1378 dMY_CXT|5.007003||p
1379 dNOOP|5.006000||p
1380 dORIGMARK|||
1381 dSP|||
1382 dTHR|5.004050||p
1383 dTHXR|5.024000||p
1384 dTHXa|5.006000||p
1385 dTHXoa|5.006000||p
1386 dTHX|5.006000||p
1387 dUNDERBAR|5.009002||p
1388 dVAR|5.009003||p
1389 dXCPT|5.009002||p
1390 dXSARGS|||
1391 dXSI32|||
1392 dXSTARG|5.006000||p
1393 deb_curcv|||
1394 deb_nocontext|||vn
1395 deb_stack_all|||
1396 deb_stack_n|||
1397 debop||5.005000|
1398 debprofdump||5.005000|
1399 debprof|||
1400 debstackptrs||5.007003|
1401 debstack||5.007003|
1402 debug_start_match|||
1403 deb||5.007003|v
1404 defelem_target|||
1405 del_sv|||
1406 delete_eval_scope|||
1407 delimcpy||5.004000|n
1408 deprecate_commaless_var_list|||
1409 despatch_signals||5.007001|
1410 destroy_matcher|||
1411 die_nocontext|||vn
1412 die_sv|5.013001||p
1413 die_unwind|||
1414 die|||v
1415 dirp_dup|||
1416 div128|||
1417 djSP|||
1418 do_aexec5|||
1419 do_aexec|||
1420 do_aspawn|||
1421 do_binmode||5.004050|
1422 do_chomp|||
1423 do_close|||
1424 do_delete_local|||
1425 do_dump_pad|||
1426 do_eof|||
1427 do_exec3|||
1428 do_execfree|||
1429 do_exec|||
1430 do_gv_dump||5.006000|
1431 do_gvgv_dump||5.006000|
1432 do_hv_dump||5.006000|
1433 do_ipcctl|||
1434 do_ipcget|||
1435 do_join|||
1436 do_magic_dump||5.006000|
1437 do_msgrcv|||
1438 do_msgsnd|||
1439 do_ncmp|||
1440 do_oddball|||
1441 do_op_dump||5.006000|
1442 do_open6|||
1443 do_open9||5.006000|
1444 do_open_raw|||
1445 do_openn||5.007001|
1446 do_open||5.003070|
1447 do_pmop_dump||5.006000|
1448 do_print|||
1449 do_readline|||
1450 do_seek|||
1451 do_semop|||
1452 do_shmio|||
1453 do_smartmatch|||
1454 do_spawn_nowait|||
1455 do_spawn|||
1456 do_sprintf|||
1457 do_sv_dump||5.006000|
1458 do_sysseek|||
1459 do_tell|||
1460 do_trans_complex_utf8|||
1461 do_trans_complex|||
1462 do_trans_count_utf8|||
1463 do_trans_count|||
1464 do_trans_simple_utf8|||
1465 do_trans_simple|||
1466 do_trans|||
1467 do_vecget|||
1468 do_vecset|||
1469 do_vop|||
1470 docatch|||
1471 doeval_compile|||
1472 dofile|||
1473 dofindlabel|||
1474 doform|||
1475 doing_taint||5.008001|n
1476 dooneliner|||
1477 doopen_pm|||
1478 doparseform|||
1479 dopoptoeval|||
1480 dopoptogivenfor|||
1481 dopoptolabel|||
1482 dopoptoloop|||
1483 dopoptosub_at|||
1484 dopoptowhen|||
1485 doref||5.009003|
1486 dounwind|||
1487 dowantarray|||
1488 drand48_init_r|||n
1489 drand48_r|||n
1490 dtrace_probe_call|||
1491 dtrace_probe_load|||
1492 dtrace_probe_op|||
1493 dtrace_probe_phase|||
1494 dump_all_perl|||
1495 dump_all||5.006000|
1496 dump_c_backtrace|||
1497 dump_eval||5.006000|
1498 dump_exec_pos|||
1499 dump_form||5.006000|
1500 dump_indent||5.006000|v
1501 dump_mstats|||
1502 dump_packsubs_perl|||
1503 dump_packsubs||5.006000|
1504 dump_sub_perl|||
1505 dump_sub||5.006000|
1506 dump_sv_child|||
1507 dump_trie_interim_list|||
1508 dump_trie_interim_table|||
1509 dump_trie|||
1510 dump_vindent||5.006000|
1511 dumpuntil|||
1512 dup_attrlist|||
1513 edit_distance|||n
1514 emulate_cop_io|||
1515 eval_pv|5.006000||p
1516 eval_sv|5.006000||p
1517 exec_failed|||
1518 expect_number|||
1519 fbm_compile||5.005000|
1520 fbm_instr||5.005000|
1521 feature_is_enabled|||
1522 filter_add|||
1523 filter_del|||
1524 filter_gets|||
1525 filter_read|||
1526 finalize_optree|||
1527 finalize_op|||
1528 find_and_forget_pmops|||
1529 find_array_subscript|||
1530 find_beginning|||
1531 find_byclass|||
1532 find_default_stash|||
1533 find_hash_subscript|||
1534 find_in_my_stash|||
1535 find_lexical_cv|||
1536 find_runcv_where|||
1537 find_runcv||5.008001|
1538 find_rundefsvoffset||5.009002|
1539 find_rundefsv||5.013002|
1540 find_script|||
1541 find_uninit_var|||
1542 first_symbol|||n
1543 fixup_errno_string|||
1544 foldEQ_latin1||5.013008|n
1545 foldEQ_locale||5.013002|n
1546 foldEQ_utf8_flags||5.013010|
1547 foldEQ_utf8||5.013002|
1548 foldEQ||5.013002|n
1549 fold_constants|||
1550 forbid_setid|||
1551 force_ident_maybe_lex|||
1552 force_ident|||
1553 force_list|||
1554 force_next|||
1555 force_strict_version|||
1556 force_version|||
1557 force_word|||
1558 forget_pmop|||
1559 form_nocontext|||vn
1560 form_short_octal_warning|||
1561 form||5.004000|v
1562 fp_dup|||
1563 fprintf_nocontext|||vn
1564 free_c_backtrace|||
1565 free_global_struct|||
1566 free_tied_hv_pool|||
1567 free_tmps|||
1568 gen_constant_list|||
1569 get_ANYOF_cp_list_for_ssc|||
1570 get_and_check_backslash_N_name|||
1571 get_aux_mg|||
1572 get_av|5.006000||p
1573 get_c_backtrace_dump|||
1574 get_c_backtrace|||
1575 get_context||5.006000|n
1576 get_cvn_flags|||
1577 get_cvs|5.011000||p
1578 get_cv|5.006000||p
1579 get_db_sub|||
1580 get_debug_opts|||
1581 get_hash_seed|||
1582 get_hv|5.006000||p
1583 get_invlist_iter_addr|||n
1584 get_invlist_offset_addr|||n
1585 get_invlist_previous_index_addr|||n
1586 get_mstats|||
1587 get_no_modify|||
1588 get_num|||
1589 get_op_descs||5.005000|
1590 get_op_names||5.005000|
1591 get_opargs|||
1592 get_ppaddr||5.006000|
1593 get_re_arg|||
1594 get_sv|5.006000||p
1595 get_vtbl||5.005030|
1596 getcwd_sv||5.007002|
1597 getenv_len|||
1598 glob_2number|||
1599 glob_assign_glob|||
1600 gp_dup|||
1601 gp_free|||
1602 gp_ref|||
1603 grok_atoUV|||n
1604 grok_bin|5.007003||p
1605 grok_bslash_N|||
1606 grok_bslash_c|||
1607 grok_bslash_o|||
1608 grok_bslash_x|||
1609 grok_hex|5.007003||p
1610 grok_infnan||5.021004|
1611 grok_number_flags||5.021002|
1612 grok_number|5.007002||p
1613 grok_numeric_radix|5.007002||p
1614 grok_oct|5.007003||p
1615 group_end|||
1616 gv_AVadd|||
1617 gv_HVadd|||
1618 gv_IOadd|||
1619 gv_SVadd|||
1620 gv_add_by_type||5.011000|
1621 gv_autoload4||5.004000|
1622 gv_autoload_pvn||5.015004|
1623 gv_autoload_pv||5.015004|
1624 gv_autoload_sv||5.015004|
1625 gv_check|||
1626 gv_const_sv||5.009003|
1627 gv_dump||5.006000|
1628 gv_efullname3||5.003070|
1629 gv_efullname4||5.006001|
1630 gv_efullname|||
1631 gv_fetchfile_flags||5.009005|
1632 gv_fetchfile|||
1633 gv_fetchmeth_autoload||5.007003|
1634 gv_fetchmeth_internal|||
1635 gv_fetchmeth_pv_autoload||5.015004|
1636 gv_fetchmeth_pvn_autoload||5.015004|
1637 gv_fetchmeth_pvn||5.015004|
1638 gv_fetchmeth_pv||5.015004|
1639 gv_fetchmeth_sv_autoload||5.015004|
1640 gv_fetchmeth_sv||5.015004|
1641 gv_fetchmethod_autoload||5.004000|
1642 gv_fetchmethod_pv_flags||5.015004|
1643 gv_fetchmethod_pvn_flags||5.015004|
1644 gv_fetchmethod_sv_flags||5.015004|
1645 gv_fetchmethod|||
1646 gv_fetchmeth|||
1647 gv_fetchpvn_flags|5.009002||p
1648 gv_fetchpvs|5.009004||p
1649 gv_fetchpv|||
1650 gv_fetchsv|||
1651 gv_fullname3||5.003070|
1652 gv_fullname4||5.006001|
1653 gv_fullname|||
1654 gv_handler||5.007001|
1655 gv_init_pvn|||
1656 gv_init_pv||5.015004|
1657 gv_init_svtype|||
1658 gv_init_sv||5.015004|
1659 gv_init|||
1660 gv_is_in_main|||
1661 gv_magicalize_isa|||
1662 gv_magicalize|||
1663 gv_name_set||5.009004|
1664 gv_override|||
1665 gv_setref|||
1666 gv_stashpvn_internal|||
1667 gv_stashpvn|5.003070||p
1668 gv_stashpvs|5.009003||p
1669 gv_stashpv|||
1670 gv_stashsvpvn_cached|||
1671 gv_stashsv|||
1672 gv_try_downgrade|||
1673 handle_named_backref|||
1674 handle_possible_posix|||
1675 handle_regex_sets|||
1676 he_dup|||
1677 hek_dup|||
1678 hfree_next_entry|||
1679 hsplit|||
1680 hv_assert|||
1681 hv_auxinit_internal|||n
1682 hv_auxinit|||
1683 hv_backreferences_p|||
1684 hv_clear_placeholders||5.009001|
1685 hv_clear|||
1686 hv_common_key_len||5.010000|
1687 hv_common||5.010000|
1688 hv_copy_hints_hv||5.009004|
1689 hv_delayfree_ent||5.004000|
1690 hv_delete_common|||
1691 hv_delete_ent||5.003070|
1692 hv_delete|||
1693 hv_eiter_p||5.009003|
1694 hv_eiter_set||5.009003|
1695 hv_ename_add|||
1696 hv_ename_delete|||
1697 hv_exists_ent||5.003070|
1698 hv_exists|||
1699 hv_fetch_ent||5.003070|
1700 hv_fetchs|5.009003||p
1701 hv_fetch|||
1702 hv_fill||5.013002|
1703 hv_free_ent_ret|||
1704 hv_free_entries|||
1705 hv_free_ent||5.004000|
1706 hv_iterinit|||
1707 hv_iterkeysv||5.003070|
1708 hv_iterkey|||
1709 hv_iternext_flags||5.008000|
1710 hv_iternextsv|||
1711 hv_iternext|||
1712 hv_iterval|||
1713 hv_kill_backrefs|||
1714 hv_ksplit||5.003070|
1715 hv_magic_check|||n
1716 hv_magic|||
1717 hv_name_set||5.009003|
1718 hv_notallowed|||
1719 hv_placeholders_get||5.009003|
1720 hv_placeholders_p|||
1721 hv_placeholders_set||5.009003|
1722 hv_rand_set||5.018000|
1723 hv_riter_p||5.009003|
1724 hv_riter_set||5.009003|
1725 hv_scalar||5.009001|
1726 hv_store_ent||5.003070|
1727 hv_store_flags||5.008000|
1728 hv_stores|5.009004||p
1729 hv_store|||
1730 hv_undef_flags|||
1731 hv_undef|||
1732 ibcmp_locale||5.004000|
1733 ibcmp_utf8||5.007003|
1734 ibcmp|||
1735 incline|||
1736 incpush_if_exists|||
1737 incpush_use_sep|||
1738 incpush|||
1739 ingroup|||
1740 init_argv_symbols|||
1741 init_constants|||
1742 init_dbargs|||
1743 init_debugger|||
1744 init_global_struct|||
1745 init_i18nl10n||5.006000|
1746 init_i18nl14n||5.006000|
1747 init_ids|||
1748 init_interp|||
1749 init_main_stash|||
1750 init_perllib|||
1751 init_postdump_symbols|||
1752 init_predump_symbols|||
1753 init_stacks||5.005000|
1754 init_tm||5.007002|
1755 inplace_aassign|||
1756 instr|||n
1757 intro_my||5.004000|
1758 intuit_method|||
1759 intuit_more|||
1760 invert|||
1761 invlist_array|||n
1762 invlist_clear|||
1763 invlist_clone|||
1764 invlist_contents|||
1765 invlist_extend|||
1766 invlist_highest|||n
1767 invlist_is_iterating|||n
1768 invlist_iterfinish|||n
1769 invlist_iterinit|||n
1770 invlist_iternext|||n
1771 invlist_max|||n
1772 invlist_previous_index|||n
1773 invlist_replace_list_destroys_src|||
1774 invlist_set_len|||
1775 invlist_set_previous_index|||n
1776 invlist_trim|||n
1777 invoke_exception_hook|||
1778 io_close|||
1779 isALNUMC|5.006000||p
1780 isALNUM_lazy||5.021001|
1781 isALPHANUMERIC||5.017008|
1782 isALPHA|||
1783 isASCII|5.006000||p
1784 isBLANK|5.006001||p
1785 isCNTRL|5.006000||p
1786 isDIGIT|||
1787 isFOO_lc|||
1788 isFOO_utf8_lc|||
1789 isGCB|||n
1790 isGRAPH|5.006000||p
1791 isIDCONT||5.017008|
1792 isIDFIRST_lazy||5.021001|
1793 isIDFIRST|||
1794 isLB|||
1795 isLOWER|||
1796 isOCTAL||5.013005|
1797 isPRINT|5.004000||p
1798 isPSXSPC|5.006001||p
1799 isPUNCT|5.006000||p
1800 isSB|||
1801 isSPACE|||
1802 isUPPER|||
1803 isUTF8_CHAR||5.021001|
1804 isWB|||
1805 isWORDCHAR||5.013006|
1806 isXDIGIT|5.006000||p
1807 is_an_int|||
1808 is_ascii_string||5.011000|
1809 is_handle_constructor|||n
1810 is_invariant_string||5.021007|n
1811 is_lvalue_sub||5.007001|
1812 is_safe_syscall||5.019004|
1813 is_ssc_worth_it|||n
1814 is_uni_alnum_lc||5.006000|
1815 is_uni_alnumc_lc||5.017007|
1816 is_uni_alnumc||5.017007|
1817 is_uni_alnum||5.006000|
1818 is_uni_alpha_lc||5.006000|
1819 is_uni_alpha||5.006000|
1820 is_uni_ascii_lc||5.006000|
1821 is_uni_ascii||5.006000|
1822 is_uni_blank_lc||5.017002|
1823 is_uni_blank||5.017002|
1824 is_uni_cntrl_lc||5.006000|
1825 is_uni_cntrl||5.006000|
1826 is_uni_digit_lc||5.006000|
1827 is_uni_digit||5.006000|
1828 is_uni_graph_lc||5.006000|
1829 is_uni_graph||5.006000|
1830 is_uni_idfirst_lc||5.006000|
1831 is_uni_idfirst||5.006000|
1832 is_uni_lower_lc||5.006000|
1833 is_uni_lower||5.006000|
1834 is_uni_print_lc||5.006000|
1835 is_uni_print||5.006000|
1836 is_uni_punct_lc||5.006000|
1837 is_uni_punct||5.006000|
1838 is_uni_space_lc||5.006000|
1839 is_uni_space||5.006000|
1840 is_uni_upper_lc||5.006000|
1841 is_uni_upper||5.006000|
1842 is_uni_xdigit_lc||5.006000|
1843 is_uni_xdigit||5.006000|
1844 is_utf8_alnumc||5.017007|
1845 is_utf8_alnum||5.006000|
1846 is_utf8_alpha||5.006000|
1847 is_utf8_ascii||5.006000|
1848 is_utf8_blank||5.017002|
1849 is_utf8_char_buf||5.015008|n
1850 is_utf8_char||5.006000|n
1851 is_utf8_cntrl||5.006000|
1852 is_utf8_common|||
1853 is_utf8_digit||5.006000|
1854 is_utf8_graph||5.006000|
1855 is_utf8_idcont||5.008000|
1856 is_utf8_idfirst||5.006000|
1857 is_utf8_lower||5.006000|
1858 is_utf8_mark||5.006000|
1859 is_utf8_perl_space||5.011001|
1860 is_utf8_perl_word||5.011001|
1861 is_utf8_posix_digit||5.011001|
1862 is_utf8_print||5.006000|
1863 is_utf8_punct||5.006000|
1864 is_utf8_space||5.006000|
1865 is_utf8_string_loclen||5.009003|n
1866 is_utf8_string_loc||5.008001|n
1867 is_utf8_string||5.006001|n
1868 is_utf8_upper||5.006000|
1869 is_utf8_xdigit||5.006000|
1870 is_utf8_xidcont||5.013010|
1871 is_utf8_xidfirst||5.013010|
1872 isa_lookup|||
1873 isinfnansv|||
1874 isinfnan||5.021004|n
1875 items|||n
1876 ix|||n
1877 jmaybe|||
1878 join_exact|||
1879 keyword_plugin_standard|||
1880 keyword|||
1881 leave_adjust_stacks||5.023008|
1882 leave_scope|||
1883 lex_bufutf8||5.011002|
1884 lex_discard_to||5.011002|
1885 lex_grow_linestr||5.011002|
1886 lex_next_chunk||5.011002|
1887 lex_peek_unichar||5.011002|
1888 lex_read_space||5.011002|
1889 lex_read_to||5.011002|
1890 lex_read_unichar||5.011002|
1891 lex_start||5.009005|
1892 lex_stuff_pvn||5.011002|
1893 lex_stuff_pvs||5.013005|
1894 lex_stuff_pv||5.013006|
1895 lex_stuff_sv||5.011002|
1896 lex_unstuff||5.011002|
1897 listkids|||
1898 list|||
1899 load_module_nocontext|||vn
1900 load_module|5.006000||pv
1901 localize|||
1902 looks_like_bool|||
1903 looks_like_number|||
1904 lop|||
1905 mPUSHi|5.009002||p
1906 mPUSHn|5.009002||p
1907 mPUSHp|5.009002||p
1908 mPUSHs|5.010001||p
1909 mPUSHu|5.009002||p
1910 mXPUSHi|5.009002||p
1911 mXPUSHn|5.009002||p
1912 mXPUSHp|5.009002||p
1913 mXPUSHs|5.010001||p
1914 mXPUSHu|5.009002||p
1915 magic_clear_all_env|||
1916 magic_cleararylen_p|||
1917 magic_clearenv|||
1918 magic_clearhints|||
1919 magic_clearhint|||
1920 magic_clearisa|||
1921 magic_clearpack|||
1922 magic_clearsig|||
1923 magic_copycallchecker|||
1924 magic_dump||5.006000|
1925 magic_existspack|||
1926 magic_freearylen_p|||
1927 magic_freeovrld|||
1928 magic_getarylen|||
1929 magic_getdebugvar|||
1930 magic_getdefelem|||
1931 magic_getnkeys|||
1932 magic_getpack|||
1933 magic_getpos|||
1934 magic_getsig|||
1935 magic_getsubstr|||
1936 magic_gettaint|||
1937 magic_getuvar|||
1938 magic_getvec|||
1939 magic_get|||
1940 magic_killbackrefs|||
1941 magic_methcall1|||
1942 magic_methcall|||v
1943 magic_methpack|||
1944 magic_nextpack|||
1945 magic_regdata_cnt|||
1946 magic_regdatum_get|||
1947 magic_regdatum_set|||
1948 magic_scalarpack|||
1949 magic_set_all_env|||
1950 magic_setarylen|||
1951 magic_setcollxfrm|||
1952 magic_setdbline|||
1953 magic_setdebugvar|||
1954 magic_setdefelem|||
1955 magic_setenv|||
1956 magic_sethint|||
1957 magic_setisa|||
1958 magic_setlvref|||
1959 magic_setmglob|||
1960 magic_setnkeys|||
1961 magic_setpack|||
1962 magic_setpos|||
1963 magic_setregexp|||
1964 magic_setsig|||
1965 magic_setsubstr|||
1966 magic_settaint|||
1967 magic_setutf8|||
1968 magic_setuvar|||
1969 magic_setvec|||
1970 magic_set|||
1971 magic_sizepack|||
1972 magic_wipepack|||
1973 make_matcher|||
1974 make_trie|||
1975 malloc_good_size|||n
1976 malloced_size|||n
1977 malloc||5.007002|n
1978 markstack_grow||5.021001|
1979 matcher_matches_sv|||
1980 maybe_multimagic_gv|||
1981 mayberelocate|||
1982 measure_struct|||
1983 memEQs|5.009005||p
1984 memEQ|5.004000||p
1985 memNEs|5.009005||p
1986 memNE|5.004000||p
1987 mem_collxfrm|||
1988 mem_log_alloc|||n
1989 mem_log_common|||n
1990 mem_log_free|||n
1991 mem_log_realloc|||n
1992 mess_alloc|||
1993 mess_nocontext|||pvn
1994 mess_sv|5.013001||p
1995 mess|5.006000||pv
1996 mfree||5.007002|n
1997 mg_clear|||
1998 mg_copy|||
1999 mg_dup|||
2000 mg_find_mglob|||
2001 mg_findext|5.013008||pn
2002 mg_find|||n
2003 mg_free_type||5.013006|
2004 mg_free|||
2005 mg_get|||
2006 mg_length||5.005000|
2007 mg_localize|||
2008 mg_magical|||n
2009 mg_set|||
2010 mg_size||5.005000|
2011 mini_mktime||5.007002|n
2012 minus_v|||
2013 missingterm|||
2014 mode_from_discipline|||
2015 modkids|||
2016 more_bodies|||
2017 more_sv|||
2018 moreswitches|||
2019 move_proto_attr|||
2020 mro_clean_isarev|||
2021 mro_gather_and_rename|||
2022 mro_get_from_name||5.010001|
2023 mro_get_linear_isa_dfs|||
2024 mro_get_linear_isa||5.009005|
2025 mro_get_private_data||5.010001|
2026 mro_isa_changed_in|||
2027 mro_meta_dup|||
2028 mro_meta_init|||
2029 mro_method_changed_in||5.009005|
2030 mro_package_moved|||
2031 mro_register||5.010001|
2032 mro_set_mro||5.010001|
2033 mro_set_private_data||5.010001|
2034 mul128|||
2035 mulexp10|||n
2036 multideref_stringify|||
2037 my_atof2||5.007002|
2038 my_atof||5.006000|
2039 my_attrs|||
2040 my_bcopy||5.004050|n
2041 my_bytes_to_utf8|||n
2042 my_bzero|||n
2043 my_chsize|||
2044 my_clearenv|||
2045 my_cxt_index|||
2046 my_cxt_init|||
2047 my_dirfd||5.009005|n
2048 my_exit_jump|||
2049 my_exit|||
2050 my_failure_exit||5.004000|
2051 my_fflush_all||5.006000|
2052 my_fork||5.007003|n
2053 my_kid|||
2054 my_lstat_flags|||
2055 my_lstat||5.024000|
2056 my_memcmp|||n
2057 my_memset|||n
2058 my_pclose||5.003070|
2059 my_popen_list||5.007001|
2060 my_popen||5.003070|
2061 my_setenv|||
2062 my_setlocale|||
2063 my_snprintf|5.009004||pvn
2064 my_socketpair||5.007003|n
2065 my_sprintf|5.009003||pvn
2066 my_stat_flags|||
2067 my_stat||5.024000|
2068 my_strerror||5.021001|
2069 my_strftime||5.007002|
2070 my_strlcat|5.009004||pn
2071 my_strlcpy|5.009004||pn
2072 my_unexec|||
2073 my_vsnprintf||5.009004|n
2074 need_utf8|||n
2075 newANONATTRSUB||5.006000|
2076 newANONHASH|||
2077 newANONLIST|||
2078 newANONSUB|||
2079 newASSIGNOP|||
2080 newATTRSUB_x|||
2081 newATTRSUB||5.006000|
2082 newAVREF|||
2083 newAV|||
2084 newBINOP|||
2085 newCONDOP|||
2086 newCONSTSUB_flags||5.015006|
2087 newCONSTSUB|5.004050||p
2088 newCVREF|||
2089 newDEFSVOP||5.021006|
2090 newFORM|||
2091 newFOROP||5.013007|
2092 newGIVENOP||5.009003|
2093 newGIVWHENOP|||
2094 newGP|||
2095 newGVOP|||
2096 newGVREF|||
2097 newGVgen_flags||5.015004|
2098 newGVgen|||
2099 newHVREF|||
2100 newHVhv||5.005000|
2101 newHV|||
2102 newIO|||
2103 newLISTOP|||
2104 newLOGOP|||
2105 newLOOPEX|||
2106 newLOOPOP|||
2107 newMETHOP_internal|||
2108 newMETHOP_named||5.021005|
2109 newMETHOP||5.021005|
2110 newMYSUB||5.017004|
2111 newNULLLIST|||
2112 newOP|||
2113 newPADNAMELIST||5.021007|n
2114 newPADNAMEouter||5.021007|n
2115 newPADNAMEpvn||5.021007|n
2116 newPADOP|||
2117 newPMOP|||
2118 newPROG|||
2119 newPVOP|||
2120 newRANGE|||
2121 newRV_inc|5.004000||p
2122 newRV_noinc|5.004000||p
2123 newRV|||
2124 newSLICEOP|||
2125 newSTATEOP|||
2126 newSTUB|||
2127 newSUB|||
2128 newSVOP|||
2129 newSVREF|||
2130 newSV_type|5.009005||p
2131 newSVavdefelem|||
2132 newSVhek||5.009003|
2133 newSViv|||
2134 newSVnv|||
2135 newSVpadname||5.017004|
2136 newSVpv_share||5.013006|
2137 newSVpvf_nocontext|||vn
2138 newSVpvf||5.004000|v
2139 newSVpvn_flags|5.010001||p
2140 newSVpvn_share|5.007001||p
2141 newSVpvn_utf8|5.010001||p
2142 newSVpvn|5.004050||p
2143 newSVpvs_flags|5.010001||p
2144 newSVpvs_share|5.009003||p
2145 newSVpvs|5.009003||p
2146 newSVpv|||
2147 newSVrv|||
2148 newSVsv|||
2149 newSVuv|5.006000||p
2150 newSV|||
2151 newUNOP_AUX||5.021007|
2152 newUNOP|||
2153 newWHENOP||5.009003|
2154 newWHILEOP||5.013007|
2155 newXS_deffile|||
2156 newXS_flags||5.009004|
2157 newXS_len_flags|||
2158 newXSproto||5.006000|
2159 newXS||5.006000|
2160 new_collate||5.006000|
2161 new_constant|||
2162 new_ctype||5.006000|
2163 new_he|||
2164 new_logop|||
2165 new_numeric||5.006000|
2166 new_stackinfo||5.005000|
2167 new_version||5.009000|
2168 new_warnings_bitfield|||
2169 next_symbol|||
2170 nextargv|||
2171 nextchar|||
2172 ninstr|||n
2173 no_bareword_allowed|||
2174 no_fh_allowed|||
2175 no_op|||
2176 noperl_die|||vn
2177 not_a_number|||
2178 not_incrementable|||
2179 nothreadhook||5.008000|
2180 nuke_stacks|||
2181 num_overflow|||n
2182 oopsAV|||
2183 oopsHV|||
2184 op_append_elem||5.013006|
2185 op_append_list||5.013006|
2186 op_clear|||
2187 op_contextualize||5.013006|
2188 op_convert_list||5.021006|
2189 op_dump||5.006000|
2190 op_free|||
2191 op_integerize|||
2192 op_linklist||5.013006|
2193 op_lvalue_flags|||
2194 op_lvalue||5.013007|
2195 op_null||5.007002|
2196 op_parent|||n
2197 op_prepend_elem||5.013006|
2198 op_refcnt_dec|||
2199 op_refcnt_inc|||
2200 op_refcnt_lock||5.009002|
2201 op_refcnt_unlock||5.009002|
2202 op_relocate_sv|||
2203 op_scope||5.013007|
2204 op_sibling_splice||5.021002|n
2205 op_std_init|||
2206 op_unscope|||
2207 open_script|||
2208 openn_cleanup|||
2209 openn_setup|||
2210 opmethod_stash|||
2211 opslab_force_free|||
2212 opslab_free_nopad|||
2213 opslab_free|||
2214 output_or_return_posix_warnings|||
2215 pMY_CXT_|5.007003||p
2216 pMY_CXT|5.007003||p
2217 pTHX_|5.006000||p
2218 pTHX|5.006000||p
2219 packWARN|5.007003||p
2220 pack_cat||5.007003|
2221 pack_rec|||
2222 package_version|||
2223 package|||
2224 packlist||5.008001|
2225 pad_add_anon||5.008001|
2226 pad_add_name_pvn||5.015001|
2227 pad_add_name_pvs||5.015001|
2228 pad_add_name_pv||5.015001|
2229 pad_add_name_sv||5.015001|
2230 pad_add_weakref|||
2231 pad_alloc_name|||
2232 pad_alloc|||
2233 pad_block_start|||
2234 pad_check_dup|||
2235 pad_compname_type||5.009003|
2236 pad_findlex|||
2237 pad_findmy_pvn||5.015001|
2238 pad_findmy_pvs||5.015001|
2239 pad_findmy_pv||5.015001|
2240 pad_findmy_sv||5.015001|
2241 pad_fixup_inner_anons|||
2242 pad_free|||
2243 pad_leavemy|||
2244 pad_new||5.008001|
2245 pad_push|||
2246 pad_reset|||
2247 pad_setsv|||
2248 pad_sv|||
2249 pad_swipe|||
2250 pad_tidy||5.008001|
2251 padlist_dup|||
2252 padlist_store|||
2253 padname_dup|||
2254 padname_free|||
2255 padnamelist_dup|||
2256 padnamelist_fetch||5.021007|n
2257 padnamelist_free|||
2258 padnamelist_store||5.021007|
2259 parse_arithexpr||5.013008|
2260 parse_barestmt||5.013007|
2261 parse_block||5.013007|
2262 parse_body|||
2263 parse_fullexpr||5.013008|
2264 parse_fullstmt||5.013005|
2265 parse_gv_stash_name|||
2266 parse_ident|||
2267 parse_label||5.013007|
2268 parse_listexpr||5.013008|
2269 parse_lparen_question_flags|||
2270 parse_stmtseq||5.013006|
2271 parse_subsignature|||
2272 parse_termexpr||5.013008|
2273 parse_unicode_opts|||
2274 parser_dup|||
2275 parser_free_nexttoke_ops|||
2276 parser_free|||
2277 path_is_searchable|||n
2278 peep|||
2279 pending_ident|||
2280 perl_alloc_using|||n
2281 perl_alloc|||n
2282 perl_clone_using|||n
2283 perl_clone|||n
2284 perl_construct|||n
2285 perl_destruct||5.007003|n
2286 perl_free|||n
2287 perl_parse||5.006000|n
2288 perl_run|||n
2289 pidgone|||
2290 pm_description|||
2291 pmop_dump||5.006000|
2292 pmruntime|||
2293 pmtrans|||
2294 pop_scope|||
2295 populate_ANYOF_from_invlist|||
2296 populate_isa|||v
2297 pregcomp||5.009005|
2298 pregexec|||
2299 pregfree2||5.011000|
2300 pregfree|||
2301 prescan_version||5.011004|
2302 printbuf|||
2303 printf_nocontext|||vn
2304 process_special_blocks|||
2305 ptr_hash|||n
2306 ptr_table_clear||5.009005|
2307 ptr_table_fetch||5.009005|
2308 ptr_table_find|||n
2309 ptr_table_free||5.009005|
2310 ptr_table_new||5.009005|
2311 ptr_table_split||5.009005|
2312 ptr_table_store||5.009005|
2313 push_scope|||
2314 put_charclass_bitmap_innards_common|||
2315 put_charclass_bitmap_innards_invlist|||
2316 put_charclass_bitmap_innards|||
2317 put_code_point|||
2318 put_range|||
2319 pv_display|5.006000||p
2320 pv_escape|5.009004||p
2321 pv_pretty|5.009004||p
2322 pv_uni_display||5.007003|
2323 qerror|||
2324 qsortsvu|||
2325 quadmath_format_needed|||n
2326 quadmath_format_single|||n
2327 re_compile||5.009005|
2328 re_croak2|||
2329 re_dup_guts|||
2330 re_exec_indentf|||v
2331 re_indentf|||v
2332 re_intuit_start||5.019001|
2333 re_intuit_string||5.006000|
2334 re_op_compile|||
2335 re_printf|||v
2336 realloc||5.007002|n
2337 reentrant_free||5.024000|
2338 reentrant_init||5.024000|
2339 reentrant_retry||5.024000|vn
2340 reentrant_size||5.024000|
2341 ref_array_or_hash|||
2342 refcounted_he_chain_2hv|||
2343 refcounted_he_fetch_pvn|||
2344 refcounted_he_fetch_pvs|||
2345 refcounted_he_fetch_pv|||
2346 refcounted_he_fetch_sv|||
2347 refcounted_he_free|||
2348 refcounted_he_inc|||
2349 refcounted_he_new_pvn|||
2350 refcounted_he_new_pvs|||
2351 refcounted_he_new_pv|||
2352 refcounted_he_new_sv|||
2353 refcounted_he_value|||
2354 refkids|||
2355 refto|||
2356 ref||5.024000|
2357 reg2Lanode|||
2358 reg_check_named_buff_matched|||n
2359 reg_named_buff_all||5.009005|
2360 reg_named_buff_exists||5.009005|
2361 reg_named_buff_fetch||5.009005|
2362 reg_named_buff_firstkey||5.009005|
2363 reg_named_buff_iter|||
2364 reg_named_buff_nextkey||5.009005|
2365 reg_named_buff_scalar||5.009005|
2366 reg_named_buff|||
2367 reg_node|||
2368 reg_numbered_buff_fetch|||
2369 reg_numbered_buff_length|||
2370 reg_numbered_buff_store|||
2371 reg_qr_package|||
2372 reg_recode|||
2373 reg_scan_name|||
2374 reg_skipcomment|||n
2375 reg_temp_copy|||
2376 reganode|||
2377 regatom|||
2378 regbranch|||
2379 regclass_swash||5.009004|
2380 regclass|||
2381 regcppop|||
2382 regcppush|||
2383 regcurly|||n
2384 regdump_extflags|||
2385 regdump_intflags|||
2386 regdump||5.005000|
2387 regdupe_internal|||
2388 regex_set_precedence|||n
2389 regexec_flags||5.005000|
2390 regfree_internal||5.009005|
2391 reghop3|||n
2392 reghop4|||n
2393 reghopmaybe3|||n
2394 reginclass|||
2395 reginitcolors||5.006000|
2396 reginsert|||
2397 regmatch|||
2398 regnext||5.005000|
2399 regnode_guts|||
2400 regpiece|||
2401 regprop|||
2402 regrepeat|||
2403 regtail_study|||
2404 regtail|||
2405 regtry|||
2406 reg|||
2407 repeatcpy|||n
2408 report_evil_fh|||
2409 report_redefined_cv|||
2410 report_uninit|||
2411 report_wrongway_fh|||
2412 require_pv||5.006000|
2413 require_tie_mod|||
2414 restore_magic|||
2415 rninstr|||n
2416 rpeep|||
2417 rsignal_restore|||
2418 rsignal_save|||
2419 rsignal_state||5.004000|
2420 rsignal||5.004000|
2421 run_body|||
2422 run_user_filter|||
2423 runops_debug||5.005000|
2424 runops_standard||5.005000|
2425 rv2cv_op_cv||5.013006|
2426 rvpv_dup|||
2427 rxres_free|||
2428 rxres_restore|||
2429 rxres_save|||
2430 safesyscalloc||5.006000|n
2431 safesysfree||5.006000|n
2432 safesysmalloc||5.006000|n
2433 safesysrealloc||5.006000|n
2434 same_dirent|||
2435 save_I16||5.004000|
2436 save_I32|||
2437 save_I8||5.006000|
2438 save_adelete||5.011000|
2439 save_aelem_flags||5.011000|
2440 save_aelem||5.004050|
2441 save_alloc||5.006000|
2442 save_aptr|||
2443 save_ary|||
2444 save_bool||5.008001|
2445 save_clearsv|||
2446 save_delete|||
2447 save_destructor_x||5.006000|
2448 save_destructor||5.006000|
2449 save_freeop|||
2450 save_freepv|||
2451 save_freesv|||
2452 save_generic_pvref||5.006001|
2453 save_generic_svref||5.005030|
2454 save_gp||5.004000|
2455 save_hash|||
2456 save_hdelete||5.011000|
2457 save_hek_flags|||n
2458 save_helem_flags||5.011000|
2459 save_helem||5.004050|
2460 save_hints||5.010001|
2461 save_hptr|||
2462 save_int|||
2463 save_item|||
2464 save_iv||5.005000|
2465 save_lines|||
2466 save_list|||
2467 save_long|||
2468 save_magic_flags|||
2469 save_mortalizesv||5.007001|
2470 save_nogv|||
2471 save_op||5.005000|
2472 save_padsv_and_mortalize||5.010001|
2473 save_pptr|||
2474 save_pushi32ptr||5.010001|
2475 save_pushptri32ptr|||
2476 save_pushptrptr||5.010001|
2477 save_pushptr||5.010001|
2478 save_re_context||5.006000|
2479 save_scalar_at|||
2480 save_scalar|||
2481 save_set_svflags||5.009000|
2482 save_shared_pvref||5.007003|
2483 save_sptr|||
2484 save_strlen|||
2485 save_svref|||
2486 save_vptr||5.006000|
2487 savepvn|||
2488 savepvs||5.009003|
2489 savepv|||
2490 savesharedpvn||5.009005|
2491 savesharedpvs||5.013006|
2492 savesharedpv||5.007003|
2493 savesharedsvpv||5.013006|
2494 savestack_grow_cnt||5.008001|
2495 savestack_grow|||
2496 savesvpv||5.009002|
2497 savetmps||5.023008|
2498 sawparens|||
2499 scalar_mod_type|||n
2500 scalarboolean|||
2501 scalarkids|||
2502 scalarseq|||
2503 scalarvoid|||
2504 scalar|||
2505 scan_bin||5.006000|
2506 scan_commit|||
2507 scan_const|||
2508 scan_formline|||
2509 scan_heredoc|||
2510 scan_hex|||
2511 scan_ident|||
2512 scan_inputsymbol|||
2513 scan_num||5.007001|
2514 scan_oct|||
2515 scan_pat|||
2516 scan_str|||
2517 scan_subst|||
2518 scan_trans|||
2519 scan_version||5.009001|
2520 scan_vstring||5.009005|
2521 scan_word|||
2522 search_const|||
2523 seed||5.008001|
2524 sequence_num|||
2525 set_ANYOF_arg|||
2526 set_caret_X|||
2527 set_context||5.006000|n
2528 set_numeric_local||5.006000|
2529 set_numeric_radix||5.006000|
2530 set_numeric_standard||5.006000|
2531 set_padlist|||n
2532 setdefout|||
2533 share_hek_flags|||
2534 share_hek||5.004000|
2535 should_warn_nl|||n
2536 si_dup|||
2537 sighandler|||n
2538 simplify_sort|||
2539 skip_to_be_ignored_text|||
2540 skipspace_flags|||
2541 softref2xv|||
2542 sortcv_stacked|||
2543 sortcv_xsub|||
2544 sortcv|||
2545 sortsv_flags||5.009003|
2546 sortsv||5.007003|
2547 space_join_names_mortal|||
2548 ss_dup|||
2549 ssc_add_range|||
2550 ssc_and|||
2551 ssc_anything|||
2552 ssc_clear_locale|||n
2553 ssc_cp_and|||
2554 ssc_finalize|||
2555 ssc_init|||
2556 ssc_intersection|||
2557 ssc_is_anything|||n
2558 ssc_is_cp_posixl_init|||n
2559 ssc_or|||
2560 ssc_union|||
2561 stack_grow|||
2562 start_glob|||
2563 start_subparse||5.004000|
2564 stdize_locale|||
2565 strEQ|||
2566 strGE|||
2567 strGT|||
2568 strLE|||
2569 strLT|||
2570 strNE|||
2571 str_to_version||5.006000|
2572 strip_return|||
2573 strnEQ|||
2574 strnNE|||
2575 study_chunk|||
2576 sub_crush_depth|||
2577 sublex_done|||
2578 sublex_push|||
2579 sublex_start|||
2580 sv_2bool_flags||5.013006|
2581 sv_2bool|||
2582 sv_2cv|||
2583 sv_2io|||
2584 sv_2iuv_common|||
2585 sv_2iuv_non_preserve|||
2586 sv_2iv_flags||5.009001|
2587 sv_2iv|||
2588 sv_2mortal|||
2589 sv_2num|||
2590 sv_2nv_flags||5.013001|
2591 sv_2pv_flags|5.007002||p
2592 sv_2pv_nolen|5.006000||p
2593 sv_2pvbyte_nolen|5.006000||p
2594 sv_2pvbyte|5.006000||p
2595 sv_2pvutf8_nolen||5.006000|
2596 sv_2pvutf8||5.006000|
2597 sv_2pv|||
2598 sv_2uv_flags||5.009001|
2599 sv_2uv|5.004000||p
2600 sv_add_arena|||
2601 sv_add_backref|||
2602 sv_backoff|||n
2603 sv_bless|||
2604 sv_buf_to_ro|||
2605 sv_buf_to_rw|||
2606 sv_cat_decode||5.008001|
2607 sv_catpv_flags||5.013006|
2608 sv_catpv_mg|5.004050||p
2609 sv_catpv_nomg||5.013006|
2610 sv_catpvf_mg_nocontext|||pvn
2611 sv_catpvf_mg|5.006000|5.004000|pv
2612 sv_catpvf_nocontext|||vn
2613 sv_catpvf||5.004000|v
2614 sv_catpvn_flags||5.007002|
2615 sv_catpvn_mg|5.004050||p
2616 sv_catpvn_nomg|5.007002||p
2617 sv_catpvn|||
2618 sv_catpvs_flags||5.013006|
2619 sv_catpvs_mg||5.013006|
2620 sv_catpvs_nomg||5.013006|
2621 sv_catpvs|5.009003||p
2622 sv_catpv|||
2623 sv_catsv_flags||5.007002|
2624 sv_catsv_mg|5.004050||p
2625 sv_catsv_nomg|5.007002||p
2626 sv_catsv|||
2627 sv_chop|||
2628 sv_clean_all|||
2629 sv_clean_objs|||
2630 sv_clear|||
2631 sv_cmp_flags||5.013006|
2632 sv_cmp_locale_flags||5.013006|
2633 sv_cmp_locale||5.004000|
2634 sv_cmp|||
2635 sv_collxfrm_flags||5.013006|
2636 sv_collxfrm|||
2637 sv_copypv_flags||5.017002|
2638 sv_copypv_nomg||5.017002|
2639 sv_copypv|||
2640 sv_dec_nomg||5.013002|
2641 sv_dec|||
2642 sv_del_backref|||
2643 sv_derived_from_pvn||5.015004|
2644 sv_derived_from_pv||5.015004|
2645 sv_derived_from_sv||5.015004|
2646 sv_derived_from||5.004000|
2647 sv_destroyable||5.010000|
2648 sv_display|||
2649 sv_does_pvn||5.015004|
2650 sv_does_pv||5.015004|
2651 sv_does_sv||5.015004|
2652 sv_does||5.009004|
2653 sv_dump|||
2654 sv_dup_common|||
2655 sv_dup_inc_multiple|||
2656 sv_dup_inc|||
2657 sv_dup|||
2658 sv_eq_flags||5.013006|
2659 sv_eq|||
2660 sv_exp_grow|||
2661 sv_force_normal_flags||5.007001|
2662 sv_force_normal||5.006000|
2663 sv_free2|||
2664 sv_free_arenas|||
2665 sv_free|||
2666 sv_get_backrefs||5.021008|n
2667 sv_gets||5.003070|
2668 sv_grow|||
2669 sv_i_ncmp|||
2670 sv_inc_nomg||5.013002|
2671 sv_inc|||
2672 sv_insert_flags||5.010001|
2673 sv_insert|||
2674 sv_isa|||
2675 sv_isobject|||
2676 sv_iv||5.005000|
2677 sv_kill_backrefs|||
2678 sv_len_utf8_nomg|||
2679 sv_len_utf8||5.006000|
2680 sv_len|||
2681 sv_magic_portable|5.024000|5.004000|p
2682 sv_magicext_mglob|||
2683 sv_magicext||5.007003|
2684 sv_magic|||
2685 sv_mortalcopy_flags|||
2686 sv_mortalcopy|||
2687 sv_ncmp|||
2688 sv_newmortal|||
2689 sv_newref|||
2690 sv_nolocking||5.007003|
2691 sv_nosharing||5.007003|
2692 sv_nounlocking|||
2693 sv_nv||5.005000|
2694 sv_only_taint_gmagic|||n
2695 sv_or_pv_pos_u2b|||
2696 sv_peek||5.005000|
2697 sv_pos_b2u_flags||5.019003|
2698 sv_pos_b2u_midway|||
2699 sv_pos_b2u||5.006000|
2700 sv_pos_u2b_cached|||
2701 sv_pos_u2b_flags||5.011005|
2702 sv_pos_u2b_forwards|||n
2703 sv_pos_u2b_midway|||n
2704 sv_pos_u2b||5.006000|
2705 sv_pvbyten_force||5.006000|
2706 sv_pvbyten||5.006000|
2707 sv_pvbyte||5.006000|
2708 sv_pvn_force_flags|5.007002||p
2709 sv_pvn_force|||
2710 sv_pvn_nomg|5.007003|5.005000|p
2711 sv_pvn||5.005000|
2712 sv_pvutf8n_force||5.006000|
2713 sv_pvutf8n||5.006000|
2714 sv_pvutf8||5.006000|
2715 sv_pv||5.006000|
2716 sv_recode_to_utf8||5.007003|
2717 sv_reftype|||
2718 sv_ref||5.015004|
2719 sv_replace|||
2720 sv_report_used|||
2721 sv_resetpvn|||
2722 sv_reset|||
2723 sv_rvweaken||5.006000|
2724 sv_sethek|||
2725 sv_setiv_mg|5.004050||p
2726 sv_setiv|||
2727 sv_setnv_mg|5.006000||p
2728 sv_setnv|||
2729 sv_setpv_mg|5.004050||p
2730 sv_setpvf_mg_nocontext|||pvn
2731 sv_setpvf_mg|5.006000|5.004000|pv
2732 sv_setpvf_nocontext|||vn
2733 sv_setpvf||5.004000|v
2734 sv_setpviv_mg||5.008001|
2735 sv_setpviv||5.008001|
2736 sv_setpvn_mg|5.004050||p
2737 sv_setpvn|||
2738 sv_setpvs_mg||5.013006|
2739 sv_setpvs|5.009004||p
2740 sv_setpv|||
2741 sv_setref_iv|||
2742 sv_setref_nv|||
2743 sv_setref_pvn|||
2744 sv_setref_pvs||5.024000|
2745 sv_setref_pv|||
2746 sv_setref_uv||5.007001|
2747 sv_setsv_cow|||
2748 sv_setsv_flags||5.007002|
2749 sv_setsv_mg|5.004050||p
2750 sv_setsv_nomg|5.007002||p
2751 sv_setsv|||
2752 sv_setuv_mg|5.004050||p
2753 sv_setuv|5.004000||p
2754 sv_tainted||5.004000|
2755 sv_taint||5.004000|
2756 sv_true||5.005000|
2757 sv_unglob|||
2758 sv_uni_display||5.007003|
2759 sv_unmagicext|5.013008||p
2760 sv_unmagic|||
2761 sv_unref_flags||5.007001|
2762 sv_unref|||
2763 sv_untaint||5.004000|
2764 sv_upgrade|||
2765 sv_usepvn_flags||5.009004|
2766 sv_usepvn_mg|5.004050||p
2767 sv_usepvn|||
2768 sv_utf8_decode||5.006000|
2769 sv_utf8_downgrade||5.006000|
2770 sv_utf8_encode||5.006000|
2771 sv_utf8_upgrade_flags_grow||5.011000|
2772 sv_utf8_upgrade_flags||5.007002|
2773 sv_utf8_upgrade_nomg||5.007002|
2774 sv_utf8_upgrade||5.007001|
2775 sv_uv|5.005000||p
2776 sv_vcatpvf_mg|5.006000|5.004000|p
2777 sv_vcatpvfn_flags||5.017002|
2778 sv_vcatpvfn||5.004000|
2779 sv_vcatpvf|5.006000|5.004000|p
2780 sv_vsetpvf_mg|5.006000|5.004000|p
2781 sv_vsetpvfn||5.004000|
2782 sv_vsetpvf|5.006000|5.004000|p
2783 svtype|||
2784 swallow_bom|||
2785 swash_fetch||5.007002|
2786 swash_init||5.006000|
2787 swash_scan_list_line|||
2788 swatch_get|||
2789 sync_locale||5.021004|
2790 sys_init3||5.010000|n
2791 sys_init||5.010000|n
2792 sys_intern_clear|||
2793 sys_intern_dup|||
2794 sys_intern_init|||
2795 sys_term||5.010000|n
2796 taint_env|||
2797 taint_proper|||
2798 tied_method|||v
2799 tmps_grow_p|||
2800 toFOLD_utf8||5.019001|
2801 toFOLD_uvchr||5.023009|
2802 toFOLD||5.019001|
2803 toLOWER_L1||5.019001|
2804 toLOWER_LC||5.004000|
2805 toLOWER_utf8||5.015007|
2806 toLOWER_uvchr||5.023009|
2807 toLOWER|||
2808 toTITLE_utf8||5.015007|
2809 toTITLE_uvchr||5.023009|
2810 toTITLE||5.019001|
2811 toUPPER_utf8||5.015007|
2812 toUPPER_uvchr||5.023009|
2813 toUPPER|||
2814 to_byte_substr|||
2815 to_lower_latin1|||n
2816 to_uni_fold||5.007003|
2817 to_uni_lower_lc||5.006000|
2818 to_uni_lower||5.007003|
2819 to_uni_title_lc||5.006000|
2820 to_uni_title||5.007003|
2821 to_uni_upper_lc||5.006000|
2822 to_uni_upper||5.007003|
2823 to_utf8_case||5.007003|
2824 to_utf8_fold||5.015007|
2825 to_utf8_lower||5.015007|
2826 to_utf8_substr|||
2827 to_utf8_title||5.015007|
2828 to_utf8_upper||5.015007|
2829 tokenize_use|||
2830 tokeq|||
2831 tokereport|||
2832 too_few_arguments_pv|||
2833 too_many_arguments_pv|||
2834 translate_substr_offsets|||n
2835 try_amagic_bin|||
2836 try_amagic_un|||
2837 uiv_2buf|||n
2838 unlnk|||
2839 unpack_rec|||
2840 unpack_str||5.007003|
2841 unpackstring||5.008001|
2842 unreferenced_to_tmp_stack|||
2843 unshare_hek_or_pvn|||
2844 unshare_hek|||
2845 unsharepvn||5.003070|
2846 unwind_handler_stack|||
2847 update_debugger_info|||
2848 upg_version||5.009005|
2849 usage|||
2850 utf16_textfilter|||
2851 utf16_to_utf8_reversed||5.006001|
2852 utf16_to_utf8||5.006001|
2853 utf8_distance||5.006000|
2854 utf8_hop||5.006000|n
2855 utf8_length||5.007001|
2856 utf8_mg_len_cache_update|||
2857 utf8_mg_pos_cache_update|||
2858 utf8_to_bytes||5.006001|
2859 utf8_to_uvchr_buf||5.015009|
2860 utf8_to_uvchr||5.007001|
2861 utf8_to_uvuni_buf||5.015009|
2862 utf8_to_uvuni||5.007001|
2863 utf8n_to_uvchr||5.007001|
2864 utf8n_to_uvuni||5.007001|
2865 utilize|||
2866 uvchr_to_utf8_flags||5.007003|
2867 uvchr_to_utf8||5.007001|
2868 uvoffuni_to_utf8_flags||5.019004|
2869 uvuni_to_utf8_flags||5.007003|
2870 uvuni_to_utf8||5.007001|
2871 valid_utf8_to_uvchr||5.015009|
2872 valid_utf8_to_uvuni||5.015009|
2873 validate_proto|||
2874 validate_suid|||
2875 varname|||
2876 vcmp||5.009000|
2877 vcroak||5.006000|
2878 vdeb||5.007003|
2879 vform||5.006000|
2880 visit|||
2881 vivify_defelem|||
2882 vivify_ref|||
2883 vload_module|5.006000||p
2884 vmess|5.006000||p
2885 vnewSVpvf|5.006000|5.004000|p
2886 vnormal||5.009002|
2887 vnumify||5.009000|
2888 vstringify||5.009000|
2889 vverify||5.009003|
2890 vwarner||5.006000|
2891 vwarn||5.006000|
2892 wait4pid|||
2893 warn_nocontext|||pvn
2894 warn_sv|5.013001||p
2895 warner_nocontext|||vn
2896 warner|5.006000|5.004000|pv
2897 warn|||v
2898 was_lvalue_sub|||
2899 watch|||
2900 whichsig_pvn||5.015004|
2901 whichsig_pv||5.015004|
2902 whichsig_sv||5.015004|
2903 whichsig|||
2904 win32_croak_not_implemented|||n
2905 with_queued_errors|||
2906 wrap_op_checker||5.015008|
2907 write_to_stderr|||
2908 xs_boot_epilog|||
2909 xs_handshake|||vn
2910 xs_version_bootcheck|||
2911 yyerror_pvn|||
2912 yyerror_pv|||
2913 yyerror|||
2914 yylex|||
2915 yyparse|||
2916 yyunlex|||
2917 yywarn|||
2918 );
2919
2920 if (exists $opt{'list-unsupported'}) {
2921   my $f;
2922   for $f (sort { lc $a cmp lc $b } keys %API) {
2923     next unless $API{$f}{todo};
2924     print "$f ", '.'x(40-length($f)), " ", format_version($API{$f}{todo}), "\n";
2925   }
2926   exit 0;
2927 }
2928
2929 # Scan for possible replacement candidates
2930
2931 my(%replace, %need, %hints, %warnings, %depends);
2932 my $replace = 0;
2933 my($hint, $define, $function);
2934
2935 sub find_api
2936 {
2937   my $code = shift;
2938   $code =~ s{
2939     / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]*)
2940   | "[^"\\]*(?:\\.[^"\\]*)*"
2941   | '[^'\\]*(?:\\.[^'\\]*)*' }{}egsx;
2942   grep { exists $API{$_} } $code =~ /(\w+)/mg;
2943 }
2944
2945 while (<DATA>) {
2946   if ($hint) {
2947     my $h = $hint->[0] eq 'Hint' ? \%hints : \%warnings;
2948     if (m{^\s*\*\s(.*?)\s*$}) {
2949       for (@{$hint->[1]}) {
2950         $h->{$_} ||= '';  # suppress warning with older perls
2951         $h->{$_} .= "$1\n";
2952       }
2953     }
2954     else { undef $hint }
2955   }
2956
2957   $hint = [$1, [split /,?\s+/, $2]]
2958       if m{^\s*$rccs\s+(Hint|Warning):\s+(\w+(?:,?\s+\w+)*)\s*$};
2959
2960   if ($define) {
2961     if ($define->[1] =~ /\\$/) {
2962       $define->[1] .= $_;
2963     }
2964     else {
2965       if (exists $API{$define->[0]} && $define->[1] !~ /^DPPP_\(/) {
2966         my @n = find_api($define->[1]);
2967         push @{$depends{$define->[0]}}, @n if @n
2968       }
2969       undef $define;
2970     }
2971   }
2972
2973   $define = [$1, $2] if m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(.*)};
2974
2975   if ($function) {
2976     if (/^}/) {
2977       if (exists $API{$function->[0]}) {
2978         my @n = find_api($function->[1]);
2979         push @{$depends{$function->[0]}}, @n if @n
2980       }
2981       undef $function;
2982     }
2983     else {
2984       $function->[1] .= $_;
2985     }
2986   }
2987
2988   $function = [$1, ''] if m{^DPPP_\(my_(\w+)\)};
2989
2990   $replace     = $1 if m{^\s*$rccs\s+Replace:\s+(\d+)\s+$rcce\s*$};
2991   $replace{$2} = $1 if $replace and m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(\w+)};
2992   $replace{$2} = $1 if m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(\w+).*$rccs\s+Replace\s+$rcce};
2993   $replace{$1} = $2 if m{^\s*$rccs\s+Replace (\w+) with (\w+)\s+$rcce\s*$};
2994
2995   if (m{^\s*$rccs\s+(\w+(\s*,\s*\w+)*)\s+depends\s+on\s+(\w+(\s*,\s*\w+)*)\s+$rcce\s*$}) {
2996     my @deps = map { s/\s+//g; $_ } split /,/, $3;
2997     my $d;
2998     for $d (map { s/\s+//g; $_ } split /,/, $1) {
2999       push @{$depends{$d}}, @deps;
3000     }
3001   }
3002
3003   $need{$1} = 1 if m{^#if\s+defined\(NEED_(\w+)(?:_GLOBAL)?\)};
3004 }
3005
3006 for (values %depends) {
3007   my %s;
3008   $_ = [sort grep !$s{$_}++, @$_];
3009 }
3010
3011 if (exists $opt{'api-info'}) {
3012   my $f;
3013   my $count = 0;
3014   my $match = $opt{'api-info'} =~ m!^/(.*)/$! ? $1 : "^\Q$opt{'api-info'}\E\$";
3015   for $f (sort { lc $a cmp lc $b } keys %API) {
3016     next unless $f =~ /$match/;
3017     print "\n=== $f ===\n\n";
3018     my $info = 0;
3019     if ($API{$f}{base} || $API{$f}{todo}) {
3020       my $base = format_version($API{$f}{base} || $API{$f}{todo});
3021       print "Supported at least starting from perl-$base.\n";
3022       $info++;
3023     }
3024     if ($API{$f}{provided}) {
3025       my $todo = $API{$f}{todo} ? format_version($API{$f}{todo}) : "5.003";
3026       print "Support by $ppport provided back to perl-$todo.\n";
3027       print "Support needs to be explicitly requested by NEED_$f.\n" if exists $need{$f};
3028       print "Depends on: ", join(', ', @{$depends{$f}}), ".\n" if exists $depends{$f};
3029       print "\n$hints{$f}" if exists $hints{$f};
3030       print "\nWARNING:\n$warnings{$f}" if exists $warnings{$f};
3031       $info++;
3032     }
3033     print "No portability information available.\n" unless $info;
3034     $count++;
3035   }
3036   $count or print "Found no API matching '$opt{'api-info'}'.";
3037   print "\n";
3038   exit 0;
3039 }
3040
3041 if (exists $opt{'list-provided'}) {
3042   my $f;
3043   for $f (sort { lc $a cmp lc $b } keys %API) {
3044     next unless $API{$f}{provided};
3045     my @flags;
3046     push @flags, 'explicit' if exists $need{$f};
3047     push @flags, 'depend'   if exists $depends{$f};
3048     push @flags, 'hint'     if exists $hints{$f};
3049     push @flags, 'warning'  if exists $warnings{$f};
3050     my $flags = @flags ? '  ['.join(', ', @flags).']' : '';
3051     print "$f$flags\n";
3052   }
3053   exit 0;
3054 }
3055
3056 my @files;
3057 my @srcext = qw( .xs .c .h .cc .cpp -c.inc -xs.inc );
3058 my $srcext = join '|', map { quotemeta $_ } @srcext;
3059
3060 if (@ARGV) {
3061   my %seen;
3062   for (@ARGV) {
3063     if (-e) {
3064       if (-f) {
3065         push @files, $_ unless $seen{$_}++;
3066       }
3067       else { warn "'$_' is not a file.\n" }
3068     }
3069     else {
3070       my @new = grep { -f } glob $_
3071           or warn "'$_' does not exist.\n";
3072       push @files, grep { !$seen{$_}++ } @new;
3073     }
3074   }
3075 }
3076 else {
3077   eval {
3078     require File::Find;
3079     File::Find::find(sub {
3080       $File::Find::name =~ /($srcext)$/i
3081           and push @files, $File::Find::name;
3082     }, '.');
3083   };
3084   if ($@) {
3085     @files = map { glob "*$_" } @srcext;
3086   }
3087 }
3088
3089 if (!@ARGV || $opt{filter}) {
3090   my(@in, @out);
3091   my %xsc = map { /(.*)\.xs$/ ? ("$1.c" => 1, "$1.cc" => 1) : () } @files;
3092   for (@files) {
3093     my $out = exists $xsc{$_} || /\b\Q$ppport\E$/i || !/($srcext)$/i;
3094     push @{ $out ? \@out : \@in }, $_;
3095   }
3096   if (@ARGV && @out) {
3097     warning("Skipping the following files (use --nofilter to avoid this):\n| ", join "\n| ", @out);
3098   }
3099   @files = @in;
3100 }
3101
3102 die "No input files given!\n" unless @files;
3103
3104 my(%files, %global, %revreplace);
3105 %revreplace = reverse %replace;
3106 my $filename;
3107 my $patch_opened = 0;
3108
3109 for $filename (@files) {
3110   unless (open IN, "<$filename") {
3111     warn "Unable to read from $filename: $!\n";
3112     next;
3113   }
3114
3115   info("Scanning $filename ...");
3116
3117   my $c = do { local $/; <IN> };
3118   close IN;
3119
3120   my %file = (orig => $c, changes => 0);
3121
3122   # Temporarily remove C/XS comments and strings from the code
3123   my @ccom;
3124
3125   $c =~ s{
3126     ( ^$HS*\#$HS*include\b[^\r\n]+\b(?:\Q$ppport\E|XSUB\.h)\b[^\r\n]*
3127     | ^$HS*\#$HS*(?:define|elif|if(?:def)?)\b[^\r\n]* )
3128   | ( ^$HS*\#[^\r\n]*
3129     | "[^"\\]*(?:\\.[^"\\]*)*"
3130     | '[^'\\]*(?:\\.[^'\\]*)*'
3131     | / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]* ) )
3132   }{ defined $2 and push @ccom, $2;
3133      defined $1 ? $1 : "$ccs$#ccom$cce" }mgsex;
3134
3135   $file{ccom} = \@ccom;
3136   $file{code} = $c;
3137   $file{has_inc_ppport} = $c =~ /^$HS*#$HS*include[^\r\n]+\b\Q$ppport\E\b/m;
3138
3139   my $func;
3140
3141   for $func (keys %API) {
3142     my $match = $func;
3143     $match .= "|$revreplace{$func}" if exists $revreplace{$func};
3144     if ($c =~ /\b(?:Perl_)?($match)\b/) {
3145       $file{uses_replace}{$1}++ if exists $revreplace{$func} && $1 eq $revreplace{$func};
3146       $file{uses_Perl}{$func}++ if $c =~ /\bPerl_$func\b/;
3147       if (exists $API{$func}{provided}) {
3148         $file{uses_provided}{$func}++;
3149         if (!exists $API{$func}{base} || $API{$func}{base} > $opt{'compat-version'}) {
3150           $file{uses}{$func}++;
3151           my @deps = rec_depend($func);
3152           if (@deps) {
3153             $file{uses_deps}{$func} = \@deps;
3154             for (@deps) {
3155               $file{uses}{$_} = 0 unless exists $file{uses}{$_};
3156             }
3157           }
3158           for ($func, @deps) {
3159             $file{needs}{$_} = 'static' if exists $need{$_};
3160           }
3161         }
3162       }
3163       if (exists $API{$func}{todo} && $API{$func}{todo} > $opt{'compat-version'}) {
3164         if ($c =~ /\b$func\b/) {
3165           $file{uses_todo}{$func}++;
3166         }
3167       }
3168     }
3169   }
3170
3171   while ($c =~ /^$HS*#$HS*define$HS+(NEED_(\w+?)(_GLOBAL)?)\b/mg) {
3172     if (exists $need{$2}) {
3173       $file{defined $3 ? 'needed_global' : 'needed_static'}{$2}++;
3174     }
3175     else { warning("Possibly wrong #define $1 in $filename") }
3176   }
3177
3178   for (qw(uses needs uses_todo needed_global needed_static)) {
3179     for $func (keys %{$file{$_}}) {
3180       push @{$global{$_}{$func}}, $filename;
3181     }
3182   }
3183
3184   $files{$filename} = \%file;
3185 }
3186
3187 # Globally resolve NEED_'s
3188 my $need;
3189 for $need (keys %{$global{needs}}) {
3190   if (@{$global{needs}{$need}} > 1) {
3191     my @targets = @{$global{needs}{$need}};
3192     my @t = grep $files{$_}{needed_global}{$need}, @targets;
3193     @targets = @t if @t;
3194     @t = grep /\.xs$/i, @targets;
3195     @targets = @t if @t;
3196     my $target = shift @targets;
3197     $files{$target}{needs}{$need} = 'global';
3198     for (@{$global{needs}{$need}}) {
3199       $files{$_}{needs}{$need} = 'extern' if $_ ne $target;
3200     }
3201   }
3202 }
3203
3204 for $filename (@files) {
3205   exists $files{$filename} or next;
3206
3207   info("=== Analyzing $filename ===");
3208
3209   my %file = %{$files{$filename}};
3210   my $func;
3211   my $c = $file{code};
3212   my $warnings = 0;
3213
3214   for $func (sort keys %{$file{uses_Perl}}) {
3215     if ($API{$func}{varargs}) {
3216       unless ($API{$func}{nothxarg}) {
3217         my $changes = ($c =~ s{\b(Perl_$func\s*\(\s*)(?!aTHX_?)(\)|[^\s)]*\))}
3218                               { $1 . ($2 eq ')' ? 'aTHX' : 'aTHX_ ') . $2 }ge);
3219         if ($changes) {
3220           warning("Doesn't pass interpreter argument aTHX to Perl_$func");
3221           $file{changes} += $changes;
3222         }
3223       }
3224     }
3225     else {
3226       warning("Uses Perl_$func instead of $func");
3227       $file{changes} += ($c =~ s{\bPerl_$func(\s*)\((\s*aTHX_?)?\s*}
3228                                 {$func$1(}g);
3229     }
3230   }
3231
3232   for $func (sort keys %{$file{uses_replace}}) {
3233     warning("Uses $func instead of $replace{$func}");
3234     $file{changes} += ($c =~ s/\b$func\b/$replace{$func}/g);
3235   }
3236
3237   for $func (sort keys %{$file{uses_provided}}) {
3238     if ($file{uses}{$func}) {
3239       if (exists $file{uses_deps}{$func}) {
3240         diag("Uses $func, which depends on ", join(', ', @{$file{uses_deps}{$func}}));
3241       }
3242       else {
3243         diag("Uses $func");
3244       }
3245     }
3246     $warnings += hint($func);
3247   }
3248
3249   unless ($opt{quiet}) {
3250     for $func (sort keys %{$file{uses_todo}}) {
3251       print "*** WARNING: Uses $func, which may not be portable below perl ",
3252             format_version($API{$func}{todo}), ", even with '$ppport'\n";
3253       $warnings++;
3254     }
3255   }
3256
3257   for $func (sort keys %{$file{needed_static}}) {
3258     my $message = '';
3259     if (not exists $file{uses}{$func}) {
3260       $message = "No need to define NEED_$func if $func is never used";
3261     }
3262     elsif (exists $file{needs}{$func} && $file{needs}{$func} ne 'static') {
3263       $message = "No need to define NEED_$func when already needed globally";
3264     }
3265     if ($message) {
3266       diag($message);
3267       $file{changes} += ($c =~ s/^$HS*#$HS*define$HS+NEED_$func\b.*$LF//mg);
3268     }
3269   }
3270
3271   for $func (sort keys %{$file{needed_global}}) {
3272     my $message = '';
3273     if (not exists $global{uses}{$func}) {
3274       $message = "No need to define NEED_${func}_GLOBAL if $func is never used";
3275     }
3276     elsif (exists $file{needs}{$func}) {
3277       if ($file{needs}{$func} eq 'extern') {
3278         $message = "No need to define NEED_${func}_GLOBAL when already needed globally";
3279       }
3280       elsif ($file{needs}{$func} eq 'static') {
3281         $message = "No need to define NEED_${func}_GLOBAL when only used in this file";
3282       }
3283     }
3284     if ($message) {
3285       diag($message);
3286       $file{changes} += ($c =~ s/^$HS*#$HS*define$HS+NEED_${func}_GLOBAL\b.*$LF//mg);
3287     }
3288   }
3289
3290   $file{needs_inc_ppport} = keys %{$file{uses}};
3291
3292   if ($file{needs_inc_ppport}) {
3293     my $pp = '';
3294
3295     for $func (sort keys %{$file{needs}}) {
3296       my $type = $file{needs}{$func};
3297       next if $type eq 'extern';
3298       my $suffix = $type eq 'global' ? '_GLOBAL' : '';
3299       unless (exists $file{"needed_$type"}{$func}) {
3300         if ($type eq 'global') {
3301           diag("Files [@{$global{needs}{$func}}] need $func, adding global request");
3302         }
3303         else {
3304           diag("File needs $func, adding static request");
3305         }
3306         $pp .= "#define NEED_$func$suffix\n";
3307       }
3308     }
3309
3310     if ($pp && ($c =~ s/^(?=$HS*#$HS*define$HS+NEED_\w+)/$pp/m)) {
3311       $pp = '';
3312       $file{changes}++;
3313     }
3314
3315     unless ($file{has_inc_ppport}) {
3316       diag("Needs to include '$ppport'");
3317       $pp .= qq(#include "$ppport"\n)
3318     }
3319
3320     if ($pp) {
3321       $file{changes} += ($c =~ s/^($HS*#$HS*define$HS+NEED_\w+.*?)^/$1$pp/ms)
3322                      || ($c =~ s/^(?=$HS*#$HS*include.*\Q$ppport\E)/$pp/m)
3323                      || ($c =~ s/^($HS*#$HS*include.*XSUB.*\s*?)^/$1$pp/m)
3324                      || ($c =~ s/^/$pp/);
3325     }
3326   }
3327   else {
3328     if ($file{has_inc_ppport}) {
3329       diag("No need to include '$ppport'");
3330       $file{changes} += ($c =~ s/^$HS*?#$HS*include.*\Q$ppport\E.*?$LF//m);
3331     }
3332   }
3333
3334   # put back in our C comments
3335   my $ix;
3336   my $cppc = 0;
3337   my @ccom = @{$file{ccom}};
3338   for $ix (0 .. $#ccom) {
3339     if (!$opt{cplusplus} && $ccom[$ix] =~ s!^//!!) {
3340       $cppc++;
3341       $file{changes} += $c =~ s/$rccs$ix$rcce/$ccs$ccom[$ix] $cce/;
3342     }
3343     else {
3344       $c =~ s/$rccs$ix$rcce/$ccom[$ix]/;
3345     }
3346   }
3347
3348   if ($cppc) {
3349     my $s = $cppc != 1 ? 's' : '';
3350     warning("Uses $cppc C++ style comment$s, which is not portable");
3351   }
3352
3353   my $s = $warnings != 1 ? 's' : '';
3354   my $warn = $warnings ? " ($warnings warning$s)" : '';
3355   info("Analysis completed$warn");
3356
3357   if ($file{changes}) {
3358     if (exists $opt{copy}) {
3359       my $newfile = "$filename$opt{copy}";
3360       if (-e $newfile) {
3361         error("'$newfile' already exists, refusing to write copy of '$filename'");
3362       }
3363       else {
3364         local *F;
3365         if (open F, ">$newfile") {
3366           info("Writing copy of '$filename' with changes to '$newfile'");
3367           print F $c;
3368           close F;
3369         }
3370         else {
3371           error("Cannot open '$newfile' for writing: $!");
3372         }
3373       }
3374     }
3375     elsif (exists $opt{patch} || $opt{changes}) {
3376       if (exists $opt{patch}) {
3377         unless ($patch_opened) {
3378           if (open PATCH, ">$opt{patch}") {
3379             $patch_opened = 1;
3380           }
3381           else {
3382             error("Cannot open '$opt{patch}' for writing: $!");
3383             delete $opt{patch};
3384             $opt{changes} = 1;
3385             goto fallback;
3386           }
3387         }
3388         mydiff(\*PATCH, $filename, $c);
3389       }
3390       else {
3391 fallback:
3392         info("Suggested changes:");
3393         mydiff(\*STDOUT, $filename, $c);
3394       }
3395     }
3396     else {
3397       my $s = $file{changes} == 1 ? '' : 's';
3398       info("$file{changes} potentially required change$s detected");
3399     }
3400   }
3401   else {
3402     info("Looks good");
3403   }
3404 }
3405
3406 close PATCH if $patch_opened;
3407
3408 exit 0;
3409
3410
3411 sub try_use { eval "use @_;"; return $@ eq '' }
3412
3413 sub mydiff
3414 {
3415   local *F = shift;
3416   my($file, $str) = @_;
3417   my $diff;
3418
3419   if (exists $opt{diff}) {
3420     $diff = run_diff($opt{diff}, $file, $str);
3421   }
3422
3423   if (!defined $diff and try_use('Text::Diff')) {
3424     $diff = Text::Diff::diff($file, \$str, { STYLE => 'Unified' });
3425     $diff = <<HEADER . $diff;
3426 --- $file
3427 +++ $file.patched
3428 HEADER
3429   }
3430
3431   if (!defined $diff) {
3432     $diff = run_diff('diff -u', $file, $str);
3433   }
3434
3435   if (!defined $diff) {
3436     $diff = run_diff('diff', $file, $str);
3437   }
3438
3439   if (!defined $diff) {
3440     error("Cannot generate a diff. Please install Text::Diff or use --copy.");
3441     return;
3442   }
3443
3444   print F $diff;
3445 }
3446
3447 sub run_diff
3448 {
3449   my($prog, $file, $str) = @_;
3450   my $tmp = 'dppptemp';
3451   my $suf = 'aaa';
3452   my $diff = '';
3453   local *F;
3454
3455   while (-e "$tmp.$suf") { $suf++ }
3456   $tmp = "$tmp.$suf";
3457
3458   if (open F, ">$tmp") {
3459     print F $str;
3460     close F;
3461
3462     if (open F, "$prog $file $tmp |") {
3463       while (<F>) {
3464         s/\Q$tmp\E/$file.patched/;
3465         $diff .= $_;
3466       }
3467       close F;
3468       unlink $tmp;
3469       return $diff;
3470     }
3471
3472     unlink $tmp;
3473   }
3474   else {
3475     error("Cannot open '$tmp' for writing: $!");
3476   }
3477
3478   return undef;
3479 }
3480
3481 sub rec_depend
3482 {
3483   my($func, $seen) = @_;
3484   return () unless exists $depends{$func};
3485   $seen = {%{$seen||{}}};
3486   return () if $seen->{$func}++;
3487   my %s;
3488   grep !$s{$_}++, map { ($_, rec_depend($_, $seen)) } @{$depends{$func}};
3489 }
3490
3491 sub parse_version
3492 {
3493   my $ver = shift;
3494
3495   if ($ver =~ /^(\d+)\.(\d+)\.(\d+)$/) {
3496     return ($1, $2, $3);
3497   }
3498   elsif ($ver !~ /^\d+\.[\d_]+$/) {
3499     die "cannot parse version '$ver'\n";
3500   }
3501
3502   $ver =~ s/_//g;
3503   $ver =~ s/$/000000/;
3504
3505   my($r,$v,$s) = $ver =~ /(\d+)\.(\d{3})(\d{3})/;
3506
3507   $v = int $v;
3508   $s = int $s;
3509
3510   if ($r < 5 || ($r == 5 && $v < 6)) {
3511     if ($s % 10) {
3512       die "cannot parse version '$ver'\n";
3513     }
3514   }
3515
3516   return ($r, $v, $s);
3517 }
3518
3519 sub format_version
3520 {
3521   my $ver = shift;
3522
3523   $ver =~ s/$/000000/;
3524   my($r,$v,$s) = $ver =~ /(\d+)\.(\d{3})(\d{3})/;
3525
3526   $v = int $v;
3527   $s = int $s;
3528
3529   if ($r < 5 || ($r == 5 && $v < 6)) {
3530     if ($s % 10) {
3531       die "invalid version '$ver'\n";
3532     }
3533     $s /= 10;
3534
3535     $ver = sprintf "%d.%03d", $r, $v;
3536     $s > 0 and $ver .= sprintf "_%02d", $s;
3537
3538     return $ver;
3539   }
3540
3541   return sprintf "%d.%d.%d", $r, $v, $s;
3542 }
3543
3544 sub info
3545 {
3546   $opt{quiet} and return;
3547   print @_, "\n";
3548 }
3549
3550 sub diag
3551 {
3552   $opt{quiet} and return;
3553   $opt{diag} and print @_, "\n";
3554 }
3555
3556 sub warning
3557 {
3558   $opt{quiet} and return;
3559   print "*** ", @_, "\n";
3560 }
3561
3562 sub error
3563 {
3564   print "*** ERROR: ", @_, "\n";
3565 }
3566
3567 my %given_hints;
3568 my %given_warnings;
3569 sub hint
3570 {
3571   $opt{quiet} and return;
3572   my $func = shift;
3573   my $rv = 0;
3574   if (exists $warnings{$func} && !$given_warnings{$func}++) {
3575     my $warn = $warnings{$func};
3576     $warn =~ s!^!*** !mg;
3577     print "*** WARNING: $func\n", $warn;
3578     $rv++;
3579   }
3580   if ($opt{hints} && exists $hints{$func} && !$given_hints{$func}++) {
3581     my $hint = $hints{$func};
3582     $hint =~ s/^/   /mg;
3583     print "   --- hint for $func ---\n", $hint;
3584   }
3585   $rv;
3586 }
3587
3588 sub usage
3589 {
3590   my($usage) = do { local(@ARGV,$/)=($0); <> } =~ /^=head\d$HS+SYNOPSIS\s*^(.*?)\s*^=/ms;
3591   my %M = ( 'I' => '*' );
3592   $usage =~ s/^\s*perl\s+\S+/$^X $0/;
3593   $usage =~ s/([A-Z])<([^>]+)>/$M{$1}$2$M{$1}/g;
3594
3595   print <<ENDUSAGE;
3596
3597 Usage: $usage
3598
3599 See perldoc $0 for details.
3600
3601 ENDUSAGE
3602
3603   exit 2;
3604 }
3605
3606 sub strip
3607 {
3608   my $self = do { local(@ARGV,$/)=($0); <> };
3609   my($copy) = $self =~ /^=head\d\s+COPYRIGHT\s*^(.*?)^=\w+/ms;
3610   $copy =~ s/^(?=\S+)/    /gms;
3611   $self =~ s/^$HS+Do NOT edit.*?(?=^-)/$copy/ms;
3612   $self =~ s/^SKIP.*(?=^__DATA__)/SKIP
3613 if (\@ARGV && \$ARGV[0] eq '--unstrip') {
3614   eval { require Devel::PPPort };
3615   \$@ and die "Cannot require Devel::PPPort, please install.\\n";
3616   if (eval \$Devel::PPPort::VERSION < $VERSION) {
3617     die "$0 was originally generated with Devel::PPPort $VERSION.\\n"
3618       . "Your Devel::PPPort is only version \$Devel::PPPort::VERSION.\\n"
3619       . "Please install a newer version, or --unstrip will not work.\\n";
3620   }
3621   Devel::PPPort::WriteFile(\$0);
3622   exit 0;
3623 }
3624 print <<END;
3625
3626 Sorry, but this is a stripped version of \$0.
3627
3628 To be able to use its original script and doc functionality,
3629 please try to regenerate this file using:
3630
3631   \$^X \$0 --unstrip
3632
3633 END
3634 /ms;
3635   my($pl, $c) = $self =~ /(.*^__DATA__)(.*)/ms;
3636   $c =~ s{
3637     / (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]*)
3638   | ( "[^"\\]*(?:\\.[^"\\]*)*"
3639     | '[^'\\]*(?:\\.[^'\\]*)*' )
3640   | ($HS+) }{ defined $2 ? ' ' : ($1 || '') }gsex;
3641   $c =~ s!\s+$!!mg;
3642   $c =~ s!^$LF!!mg;
3643   $c =~ s!^\s*#\s*!#!mg;
3644   $c =~ s!^\s+!!mg;
3645
3646   open OUT, ">$0" or die "cannot strip $0: $!\n";
3647   print OUT "$pl$c\n";
3648
3649   exit 0;
3650 }
3651
3652 __DATA__
3653 */
3654
3655 #ifndef _P_P_PORTABILITY_H_
3656 #define _P_P_PORTABILITY_H_
3657
3658 #ifndef DPPP_NAMESPACE
3659 #  define DPPP_NAMESPACE DPPP_
3660 #endif
3661
3662 #define DPPP_CAT2(x,y) CAT2(x,y)
3663 #define DPPP_(name) DPPP_CAT2(DPPP_NAMESPACE, name)
3664
3665 #ifndef PERL_REVISION
3666 #  if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION))
3667 #    define PERL_PATCHLEVEL_H_IMPLICIT
3668 #    include <patchlevel.h>
3669 #  endif
3670 #  if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL)))
3671 #    include <could_not_find_Perl_patchlevel.h>
3672 #  endif
3673 #  ifndef PERL_REVISION
3674 #    define PERL_REVISION       (5)
3675      /* Replace: 1 */
3676 #    define PERL_VERSION        PATCHLEVEL
3677 #    define PERL_SUBVERSION     SUBVERSION
3678      /* Replace PERL_PATCHLEVEL with PERL_VERSION */
3679      /* Replace: 0 */
3680 #  endif
3681 #endif
3682
3683 #define _dpppDEC2BCD(dec) ((((dec)/100)<<8)|((((dec)%100)/10)<<4)|((dec)%10))
3684 #define PERL_BCDVERSION ((_dpppDEC2BCD(PERL_REVISION)<<24)|(_dpppDEC2BCD(PERL_VERSION)<<12)|_dpppDEC2BCD(PERL_SUBVERSION))
3685
3686 /* It is very unlikely that anyone will try to use this with Perl 6
3687    (or greater), but who knows.
3688  */
3689 #if PERL_REVISION != 5
3690 #  error ppport.h only works with Perl version 5
3691 #endif /* PERL_REVISION != 5 */
3692 #ifndef dTHR
3693 #  define dTHR                           dNOOP
3694 #endif
3695 #ifndef dTHX
3696 #  define dTHX                           dNOOP
3697 #endif
3698
3699 #ifndef dTHXa
3700 #  define dTHXa(x)                       dNOOP
3701 #endif
3702 #ifndef pTHX
3703 #  define pTHX                           void
3704 #endif
3705
3706 #ifndef pTHX_
3707 #  define pTHX_
3708 #endif
3709
3710 #ifndef aTHX
3711 #  define aTHX
3712 #endif
3713
3714 #ifndef aTHX_
3715 #  define aTHX_
3716 #endif
3717
3718 #if (PERL_BCDVERSION < 0x5006000)
3719 #  ifdef USE_THREADS
3720 #    define aTHXR  thr
3721 #    define aTHXR_ thr,
3722 #  else
3723 #    define aTHXR
3724 #    define aTHXR_
3725 #  endif
3726 #  define dTHXR  dTHR
3727 #else
3728 #  define aTHXR  aTHX
3729 #  define aTHXR_ aTHX_
3730 #  define dTHXR  dTHX
3731 #endif
3732 #ifndef dTHXoa
3733 #  define dTHXoa(x)                      dTHXa(x)
3734 #endif
3735
3736 #ifdef I_LIMITS
3737 #  include <limits.h>
3738 #endif
3739
3740 #ifndef PERL_UCHAR_MIN
3741 #  define PERL_UCHAR_MIN ((unsigned char)0)
3742 #endif
3743
3744 #ifndef PERL_UCHAR_MAX
3745 #  ifdef UCHAR_MAX
3746 #    define PERL_UCHAR_MAX ((unsigned char)UCHAR_MAX)
3747 #  else
3748 #    ifdef MAXUCHAR
3749 #      define PERL_UCHAR_MAX ((unsigned char)MAXUCHAR)
3750 #    else
3751 #      define PERL_UCHAR_MAX ((unsigned char)~(unsigned)0)
3752 #    endif
3753 #  endif
3754 #endif
3755
3756 #ifndef PERL_USHORT_MIN
3757 #  define PERL_USHORT_MIN ((unsigned short)0)
3758 #endif
3759
3760 #ifndef PERL_USHORT_MAX
3761 #  ifdef USHORT_MAX
3762 #    define PERL_USHORT_MAX ((unsigned short)USHORT_MAX)
3763 #  else
3764 #    ifdef MAXUSHORT
3765 #      define PERL_USHORT_MAX ((unsigned short)MAXUSHORT)
3766 #    else
3767 #      ifdef USHRT_MAX
3768 #        define PERL_USHORT_MAX ((unsigned short)USHRT_MAX)
3769 #      else
3770 #        define PERL_USHORT_MAX ((unsigned short)~(unsigned)0)
3771 #      endif
3772 #    endif
3773 #  endif
3774 #endif
3775
3776 #ifndef PERL_SHORT_MAX
3777 #  ifdef SHORT_MAX
3778 #    define PERL_SHORT_MAX ((short)SHORT_MAX)
3779 #  else
3780 #    ifdef MAXSHORT    /* Often used in <values.h> */
3781 #      define PERL_SHORT_MAX ((short)MAXSHORT)
3782 #    else
3783 #      ifdef SHRT_MAX
3784 #        define PERL_SHORT_MAX ((short)SHRT_MAX)
3785 #      else
3786 #        define PERL_SHORT_MAX ((short) (PERL_USHORT_MAX >> 1))
3787 #      endif
3788 #    endif
3789 #  endif
3790 #endif
3791
3792 #ifndef PERL_SHORT_MIN
3793 #  ifdef SHORT_MIN
3794 #    define PERL_SHORT_MIN ((short)SHORT_MIN)
3795 #  else
3796 #    ifdef MINSHORT
3797 #      define PERL_SHORT_MIN ((short)MINSHORT)
3798 #    else
3799 #      ifdef SHRT_MIN
3800 #        define PERL_SHORT_MIN ((short)SHRT_MIN)
3801 #      else
3802 #        define PERL_SHORT_MIN (-PERL_SHORT_MAX - ((3 & -1) == 3))
3803 #      endif
3804 #    endif
3805 #  endif
3806 #endif
3807
3808 #ifndef PERL_UINT_MAX
3809 #  ifdef UINT_MAX
3810 #    define PERL_UINT_MAX ((unsigned int)UINT_MAX)
3811 #  else
3812 #    ifdef MAXUINT
3813 #      define PERL_UINT_MAX ((unsigned int)MAXUINT)
3814 #    else
3815 #      define PERL_UINT_MAX (~(unsigned int)0)
3816 #    endif
3817 #  endif
3818 #endif
3819
3820 #ifndef PERL_UINT_MIN
3821 #  define PERL_UINT_MIN ((unsigned int)0)
3822 #endif
3823
3824 #ifndef PERL_INT_MAX
3825 #  ifdef INT_MAX
3826 #    define PERL_INT_MAX ((int)INT_MAX)
3827 #  else
3828 #    ifdef MAXINT    /* Often used in <values.h> */
3829 #      define PERL_INT_MAX ((int)MAXINT)
3830 #    else
3831 #      define PERL_INT_MAX ((int)(PERL_UINT_MAX >> 1))
3832 #    endif
3833 #  endif
3834 #endif
3835
3836 #ifndef PERL_INT_MIN
3837 #  ifdef INT_MIN
3838 #    define PERL_INT_MIN ((int)INT_MIN)
3839 #  else
3840 #    ifdef MININT
3841 #      define PERL_INT_MIN ((int)MININT)
3842 #    else
3843 #      define PERL_INT_MIN (-PERL_INT_MAX - ((3 & -1) == 3))
3844 #    endif
3845 #  endif
3846 #endif
3847
3848 #ifndef PERL_ULONG_MAX
3849 #  ifdef ULONG_MAX
3850 #    define PERL_ULONG_MAX ((unsigned long)ULONG_MAX)
3851 #  else
3852 #    ifdef MAXULONG
3853 #      define PERL_ULONG_MAX ((unsigned long)MAXULONG)
3854 #    else
3855 #      define PERL_ULONG_MAX (~(unsigned long)0)
3856 #    endif
3857 #  endif
3858 #endif
3859
3860 #ifndef PERL_ULONG_MIN
3861 #  define PERL_ULONG_MIN ((unsigned long)0L)
3862 #endif
3863
3864 #ifndef PERL_LONG_MAX
3865 #  ifdef LONG_MAX
3866 #    define PERL_LONG_MAX ((long)LONG_MAX)
3867 #  else
3868 #    ifdef MAXLONG
3869 #      define PERL_LONG_MAX ((long)MAXLONG)
3870 #    else
3871 #      define PERL_LONG_MAX ((long) (PERL_ULONG_MAX >> 1))
3872 #    endif
3873 #  endif
3874 #endif
3875
3876 #ifndef PERL_LONG_MIN
3877 #  ifdef LONG_MIN
3878 #    define PERL_LONG_MIN ((long)LONG_MIN)
3879 #  else
3880 #    ifdef MINLONG
3881 #      define PERL_LONG_MIN ((long)MINLONG)
3882 #    else
3883 #      define PERL_LONG_MIN (-PERL_LONG_MAX - ((3 & -1) == 3))
3884 #    endif
3885 #  endif
3886 #endif
3887
3888 #if defined(HAS_QUAD) && (defined(convex) || defined(uts))
3889 #  ifndef PERL_UQUAD_MAX
3890 #    ifdef ULONGLONG_MAX
3891 #      define PERL_UQUAD_MAX ((unsigned long long)ULONGLONG_MAX)
3892 #    else
3893 #      ifdef MAXULONGLONG
3894 #        define PERL_UQUAD_MAX ((unsigned long long)MAXULONGLONG)
3895 #      else
3896 #        define PERL_UQUAD_MAX (~(unsigned long long)0)
3897 #      endif
3898 #    endif
3899 #  endif
3900
3901 #  ifndef PERL_UQUAD_MIN
3902 #    define PERL_UQUAD_MIN ((unsigned long long)0L)
3903 #  endif
3904
3905 #  ifndef PERL_QUAD_MAX
3906 #    ifdef LONGLONG_MAX
3907 #      define PERL_QUAD_MAX ((long long)LONGLONG_MAX)
3908 #    else
3909 #      ifdef MAXLONGLONG
3910 #        define PERL_QUAD_MAX ((long long)MAXLONGLONG)
3911 #      else
3912 #        define PERL_QUAD_MAX ((long long) (PERL_UQUAD_MAX >> 1))
3913 #      endif
3914 #    endif
3915 #  endif
3916
3917 #  ifndef PERL_QUAD_MIN
3918 #    ifdef LONGLONG_MIN
3919 #      define PERL_QUAD_MIN ((long long)LONGLONG_MIN)
3920 #    else
3921 #      ifdef MINLONGLONG
3922 #        define PERL_QUAD_MIN ((long long)MINLONGLONG)
3923 #      else
3924 #        define PERL_QUAD_MIN (-PERL_QUAD_MAX - ((3 & -1) == 3))
3925 #      endif
3926 #    endif
3927 #  endif
3928 #endif
3929
3930 /* This is based on code from 5.003 perl.h */
3931 #ifdef HAS_QUAD
3932 #  ifdef cray
3933 #ifndef IVTYPE
3934 #  define IVTYPE                         int
3935 #endif
3936
3937 #ifndef IV_MIN
3938 #  define IV_MIN                         PERL_INT_MIN
3939 #endif
3940
3941 #ifndef IV_MAX
3942 #  define IV_MAX                         PERL_INT_MAX
3943 #endif
3944
3945 #ifndef UV_MIN
3946 #  define UV_MIN                         PERL_UINT_MIN
3947 #endif
3948
3949 #ifndef UV_MAX
3950 #  define UV_MAX                         PERL_UINT_MAX
3951 #endif
3952
3953 #    ifdef INTSIZE
3954 #ifndef IVSIZE
3955 #  define IVSIZE                         INTSIZE
3956 #endif
3957
3958 #    endif
3959 #  else
3960 #    if defined(convex) || defined(uts)
3961 #ifndef IVTYPE
3962 #  define IVTYPE                         long long
3963 #endif
3964
3965 #ifndef IV_MIN
3966 #  define IV_MIN                         PERL_QUAD_MIN
3967 #endif
3968
3969 #ifndef IV_MAX
3970 #  define IV_MAX                         PERL_QUAD_MAX
3971 #endif
3972
3973 #ifndef UV_MIN
3974 #  define UV_MIN                         PERL_UQUAD_MIN
3975 #endif
3976
3977 #ifndef UV_MAX
3978 #  define UV_MAX                         PERL_UQUAD_MAX
3979 #endif
3980
3981 #      ifdef LONGLONGSIZE
3982 #ifndef IVSIZE
3983 #  define IVSIZE                         LONGLONGSIZE
3984 #endif
3985
3986 #      endif
3987 #    else
3988 #ifndef IVTYPE
3989 #  define IVTYPE                         long
3990 #endif
3991
3992 #ifndef IV_MIN
3993 #  define IV_MIN                         PERL_LONG_MIN
3994 #endif
3995
3996 #ifndef IV_MAX
3997 #  define IV_MAX                         PERL_LONG_MAX
3998 #endif
3999
4000 #ifndef UV_MIN
4001 #  define UV_MIN                         PERL_ULONG_MIN
4002 #endif
4003
4004 #ifndef UV_MAX
4005 #  define UV_MAX                         PERL_ULONG_MAX
4006 #endif
4007
4008 #      ifdef LONGSIZE
4009 #ifndef IVSIZE
4010 #  define IVSIZE                         LONGSIZE
4011 #endif
4012
4013 #      endif
4014 #    endif
4015 #  endif
4016 #ifndef IVSIZE
4017 #  define IVSIZE                         8
4018 #endif
4019
4020 #ifndef LONGSIZE
4021 #  define LONGSIZE                       8
4022 #endif
4023
4024 #ifndef PERL_QUAD_MIN
4025 #  define PERL_QUAD_MIN                  IV_MIN
4026 #endif
4027
4028 #ifndef PERL_QUAD_MAX
4029 #  define PERL_QUAD_MAX                  IV_MAX
4030 #endif
4031
4032 #ifndef PERL_UQUAD_MIN
4033 #  define PERL_UQUAD_MIN                 UV_MIN
4034 #endif
4035
4036 #ifndef PERL_UQUAD_MAX
4037 #  define PERL_UQUAD_MAX                 UV_MAX
4038 #endif
4039
4040 #else
4041 #ifndef IVTYPE
4042 #  define IVTYPE                         long
4043 #endif
4044
4045 #ifndef LONGSIZE
4046 #  define LONGSIZE                       4
4047 #endif
4048
4049 #ifndef IV_MIN
4050 #  define IV_MIN                         PERL_LONG_MIN
4051 #endif
4052
4053 #ifndef IV_MAX
4054 #  define IV_MAX                         PERL_LONG_MAX
4055 #endif
4056
4057 #ifndef UV_MIN
4058 #  define UV_MIN                         PERL_ULONG_MIN
4059 #endif
4060
4061 #ifndef UV_MAX
4062 #  define UV_MAX                         PERL_ULONG_MAX
4063 #endif
4064
4065 #endif
4066
4067 #ifndef IVSIZE
4068 #  ifdef LONGSIZE
4069 #    define IVSIZE LONGSIZE
4070 #  else
4071 #    define IVSIZE 4 /* A bold guess, but the best we can make. */
4072 #  endif
4073 #endif
4074 #ifndef UVTYPE
4075 #  define UVTYPE                         unsigned IVTYPE
4076 #endif
4077
4078 #ifndef UVSIZE
4079 #  define UVSIZE                         IVSIZE
4080 #endif
4081 #ifndef sv_setuv
4082 #  define sv_setuv(sv, uv)               \
4083                STMT_START {                         \
4084                  UV TeMpUv = uv;                    \
4085                  if (TeMpUv <= IV_MAX)              \
4086                    sv_setiv(sv, TeMpUv);            \
4087                  else                               \
4088                    sv_setnv(sv, (double)TeMpUv);    \
4089                } STMT_END
4090 #endif
4091 #ifndef newSVuv
4092 #  define newSVuv(uv)                    ((uv) <= IV_MAX ? newSViv((IV)uv) : newSVnv((NV)uv))
4093 #endif
4094 #ifndef sv_2uv
4095 #  define sv_2uv(sv)                     ((PL_Sv = (sv)), (UV) (SvNOK(PL_Sv) ? SvNV(PL_Sv) : sv_2nv(PL_Sv)))
4096 #endif
4097
4098 #ifndef SvUVX
4099 #  define SvUVX(sv)                      ((UV)SvIVX(sv))
4100 #endif
4101
4102 #ifndef SvUVXx
4103 #  define SvUVXx(sv)                     SvUVX(sv)
4104 #endif
4105
4106 #ifndef SvUV
4107 #  define SvUV(sv)                       (SvIOK(sv) ? SvUVX(sv) : sv_2uv(sv))
4108 #endif
4109
4110 #ifndef SvUVx
4111 #  define SvUVx(sv)                      ((PL_Sv = (sv)), SvUV(PL_Sv))
4112 #endif
4113
4114 /* Hint: sv_uv
4115  * Always use the SvUVx() macro instead of sv_uv().
4116  */
4117 #ifndef sv_uv
4118 #  define sv_uv(sv)                      SvUVx(sv)
4119 #endif
4120
4121 #if !defined(SvUOK) && defined(SvIOK_UV)
4122 #  define SvUOK(sv) SvIOK_UV(sv)
4123 #endif
4124 #ifndef XST_mUV
4125 #  define XST_mUV(i,v)                   (ST(i) = sv_2mortal(newSVuv(v))  )
4126 #endif
4127
4128 #ifndef XSRETURN_UV
4129 #  define XSRETURN_UV(v)                 STMT_START { XST_mUV(0,v);  XSRETURN(1); } STMT_END
4130 #endif
4131 #ifndef PUSHu
4132 #  define PUSHu(u)                       STMT_START { sv_setuv(TARG, (UV)(u)); PUSHTARG;  } STMT_END
4133 #endif
4134
4135 #ifndef XPUSHu
4136 #  define XPUSHu(u)                      STMT_START { sv_setuv(TARG, (UV)(u)); XPUSHTARG; } STMT_END
4137 #endif
4138
4139 #ifdef HAS_MEMCMP
4140 #ifndef memNE
4141 #  define memNE(s1,s2,l)                 (memcmp(s1,s2,l))
4142 #endif
4143
4144 #ifndef memEQ
4145 #  define memEQ(s1,s2,l)                 (!memcmp(s1,s2,l))
4146 #endif
4147
4148 #else
4149 #ifndef memNE
4150 #  define memNE(s1,s2,l)                 (bcmp(s1,s2,l))
4151 #endif
4152
4153 #ifndef memEQ
4154 #  define memEQ(s1,s2,l)                 (!bcmp(s1,s2,l))
4155 #endif
4156
4157 #endif
4158 #ifndef memEQs
4159 #  define memEQs(s1, l, s2)              \
4160                    (sizeof(s2)-1 == l && memEQ(s1, (s2 ""), (sizeof(s2)-1)))
4161 #endif
4162
4163 #ifndef memNEs
4164 #  define memNEs(s1, l, s2)              !memEQs(s1, l, s2)
4165 #endif
4166 #ifndef MoveD
4167 #  define MoveD(s,d,n,t)                 memmove((char*)(d),(char*)(s), (n) * sizeof(t))
4168 #endif
4169
4170 #ifndef CopyD
4171 #  define CopyD(s,d,n,t)                 memcpy((char*)(d),(char*)(s), (n) * sizeof(t))
4172 #endif
4173
4174 #ifdef HAS_MEMSET
4175 #ifndef ZeroD
4176 #  define ZeroD(d,n,t)                   memzero((char*)(d), (n) * sizeof(t))
4177 #endif
4178
4179 #else
4180 #ifndef ZeroD
4181 #  define ZeroD(d,n,t)                   ((void)memzero((char*)(d), (n) * sizeof(t)), d)
4182 #endif
4183
4184 #endif
4185 #ifndef PoisonWith
4186 #  define PoisonWith(d,n,t,b)            (void)memset((char*)(d), (U8)(b), (n) * sizeof(t))
4187 #endif
4188
4189 #ifndef PoisonNew
4190 #  define PoisonNew(d,n,t)               PoisonWith(d,n,t,0xAB)
4191 #endif
4192
4193 #ifndef PoisonFree
4194 #  define PoisonFree(d,n,t)              PoisonWith(d,n,t,0xEF)
4195 #endif
4196
4197 #ifndef Poison
4198 #  define Poison(d,n,t)                  PoisonFree(d,n,t)
4199 #endif
4200 #ifndef Newx
4201 #  define Newx(v,n,t)                    New(0,v,n,t)
4202 #endif
4203
4204 #ifndef Newxc
4205 #  define Newxc(v,n,t,c)                 Newc(0,v,n,t,c)
4206 #endif
4207
4208 #ifndef Newxz
4209 #  define Newxz(v,n,t)                   Newz(0,v,n,t)
4210 #endif
4211 #ifndef SvGETMAGIC
4212 #  define SvGETMAGIC(x)                  STMT_START { if (SvGMAGICAL(x)) mg_get(x); } STMT_END
4213 #endif
4214
4215 /* Some random bits for sv_unmagicext. These should probably be pulled in for
4216    real and organized at some point */
4217 #ifndef HEf_SVKEY
4218 #  define HEf_SVKEY                      -2
4219 #endif
4220
4221 #ifndef MUTABLE_PTR
4222 #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN)
4223 #  define MUTABLE_PTR(p) ({ void *_p = (p); _p; })
4224 #else
4225 #  define MUTABLE_PTR(p) ((void *) (p))
4226 #endif
4227 #endif
4228 #ifndef MUTABLE_SV
4229 #  define MUTABLE_SV(p)                  ((SV *)MUTABLE_PTR(p))
4230 #endif
4231
4232 /* end of random bits */
4233 #ifndef PERL_MAGIC_sv
4234 #  define PERL_MAGIC_sv                  '\0'
4235 #endif
4236
4237 #ifndef PERL_MAGIC_overload
4238 #  define PERL_MAGIC_overload            'A'
4239 #endif
4240
4241 #ifndef PERL_MAGIC_overload_elem
4242 #  define PERL_MAGIC_overload_elem       'a'
4243 #endif
4244
4245 #ifndef PERL_MAGIC_overload_table
4246 #  define PERL_MAGIC_overload_table      'c'
4247 #endif
4248
4249 #ifndef PERL_MAGIC_bm
4250 #  define PERL_MAGIC_bm                  'B'
4251 #endif
4252
4253 #ifndef PERL_MAGIC_regdata
4254 #  define PERL_MAGIC_regdata             'D'
4255 #endif
4256
4257 #ifndef PERL_MAGIC_regdatum
4258 #  define PERL_MAGIC_regdatum            'd'
4259 #endif
4260
4261 #ifndef PERL_MAGIC_env
4262 #  define PERL_MAGIC_env                 'E'
4263 #endif
4264
4265 #ifndef PERL_MAGIC_envelem
4266 #  define PERL_MAGIC_envelem             'e'
4267 #endif
4268
4269 #ifndef PERL_MAGIC_fm
4270 #  define PERL_MAGIC_fm                  'f'
4271 #endif
4272
4273 #ifndef PERL_MAGIC_regex_global
4274 #  define PERL_MAGIC_regex_global        'g'
4275 #endif
4276
4277 #ifndef PERL_MAGIC_isa
4278 #  define PERL_MAGIC_isa                 'I'
4279 #endif
4280
4281 #ifndef PERL_MAGIC_isaelem
4282 #  define PERL_MAGIC_isaelem             'i'
4283 #endif
4284
4285 #ifndef PERL_MAGIC_nkeys
4286 #  define PERL_MAGIC_nkeys               'k'
4287 #endif
4288
4289 #ifndef PERL_MAGIC_dbfile
4290 #  define PERL_MAGIC_dbfile              'L'
4291 #endif
4292
4293 #ifndef PERL_MAGIC_dbline
4294 #  define PERL_MAGIC_dbline              'l'
4295 #endif
4296
4297 #ifndef PERL_MAGIC_mutex
4298 #  define PERL_MAGIC_mutex               'm'
4299 #endif
4300
4301 #ifndef PERL_MAGIC_shared
4302 #  define PERL_MAGIC_shared              'N'
4303 #endif
4304
4305 #ifndef PERL_MAGIC_shared_scalar
4306 #  define PERL_MAGIC_shared_scalar       'n'
4307 #endif
4308
4309 #ifndef PERL_MAGIC_collxfrm
4310 #  define PERL_MAGIC_collxfrm            'o'
4311 #endif
4312
4313 #ifndef PERL_MAGIC_tied
4314 #  define PERL_MAGIC_tied                'P'
4315 #endif
4316
4317 #ifndef PERL_MAGIC_tiedelem
4318 #  define PERL_MAGIC_tiedelem            'p'
4319 #endif
4320
4321 #ifndef PERL_MAGIC_tiedscalar
4322 #  define PERL_MAGIC_tiedscalar          'q'
4323 #endif
4324
4325 #ifndef PERL_MAGIC_qr
4326 #  define PERL_MAGIC_qr                  'r'
4327 #endif
4328
4329 #ifndef PERL_MAGIC_sig
4330 #  define PERL_MAGIC_sig                 'S'
4331 #endif
4332
4333 #ifndef PERL_MAGIC_sigelem
4334 #  define PERL_MAGIC_sigelem             's'
4335 #endif
4336
4337 #ifndef PERL_MAGIC_taint
4338 #  define PERL_MAGIC_taint               't'
4339 #endif
4340
4341 #ifndef PERL_MAGIC_uvar
4342 #  define PERL_MAGIC_uvar                'U'
4343 #endif
4344
4345 #ifndef PERL_MAGIC_uvar_elem
4346 #  define PERL_MAGIC_uvar_elem           'u'
4347 #endif
4348
4349 #ifndef PERL_MAGIC_vstring
4350 #  define PERL_MAGIC_vstring             'V'
4351 #endif
4352
4353 #ifndef PERL_MAGIC_vec
4354 #  define PERL_MAGIC_vec                 'v'
4355 #endif
4356
4357 #ifndef PERL_MAGIC_utf8
4358 #  define PERL_MAGIC_utf8                'w'
4359 #endif
4360
4361 #ifndef PERL_MAGIC_substr
4362 #  define PERL_MAGIC_substr              'x'
4363 #endif
4364
4365 #ifndef PERL_MAGIC_defelem
4366 #  define PERL_MAGIC_defelem             'y'
4367 #endif
4368
4369 #ifndef PERL_MAGIC_glob
4370 #  define PERL_MAGIC_glob                '*'
4371 #endif
4372
4373 #ifndef PERL_MAGIC_arylen
4374 #  define PERL_MAGIC_arylen              '#'
4375 #endif
4376
4377 #ifndef PERL_MAGIC_pos
4378 #  define PERL_MAGIC_pos                 '.'
4379 #endif
4380
4381 #ifndef PERL_MAGIC_backref
4382 #  define PERL_MAGIC_backref             '<'
4383 #endif
4384
4385 #ifndef PERL_MAGIC_ext
4386 #  define PERL_MAGIC_ext                 '~'
4387 #endif
4388
4389 /* That's the best we can do... */
4390 #ifndef sv_catpvn_nomg
4391 #  define sv_catpvn_nomg                 sv_catpvn
4392 #endif
4393
4394 #ifndef sv_catsv_nomg
4395 #  define sv_catsv_nomg                  sv_catsv
4396 #endif
4397
4398 #ifndef sv_setsv_nomg
4399 #  define sv_setsv_nomg                  sv_setsv
4400 #endif
4401
4402 #ifndef sv_pvn_nomg
4403 #  define sv_pvn_nomg                    sv_pvn
4404 #endif
4405
4406 #ifndef SvIV_nomg
4407 #  define SvIV_nomg                      SvIV
4408 #endif
4409
4410 #ifndef SvUV_nomg
4411 #  define SvUV_nomg                      SvUV
4412 #endif
4413
4414 #ifndef sv_catpv_mg
4415 #  define sv_catpv_mg(sv, ptr)          \
4416    STMT_START {                         \
4417      SV *TeMpSv = sv;                   \
4418      sv_catpv(TeMpSv,ptr);              \
4419      SvSETMAGIC(TeMpSv);                \
4420    } STMT_END
4421 #endif
4422
4423 #ifndef sv_catpvn_mg
4424 #  define sv_catpvn_mg(sv, ptr, len)    \
4425    STMT_START {                         \
4426      SV *TeMpSv = sv;                   \
4427      sv_catpvn(TeMpSv,ptr,len);         \
4428      SvSETMAGIC(TeMpSv);                \
4429    } STMT_END
4430 #endif
4431
4432 #ifndef sv_catsv_mg
4433 #  define sv_catsv_mg(dsv, ssv)         \
4434    STMT_START {                         \
4435      SV *TeMpSv = dsv;                  \
4436      sv_catsv(TeMpSv,ssv);              \
4437      SvSETMAGIC(TeMpSv);                \
4438    } STMT_END
4439 #endif
4440
4441 #ifndef sv_setiv_mg
4442 #  define sv_setiv_mg(sv, i)            \
4443    STMT_START {                         \
4444      SV *TeMpSv = sv;                   \
4445      sv_setiv(TeMpSv,i);                \
4446      SvSETMAGIC(TeMpSv);                \
4447    } STMT_END
4448 #endif
4449
4450 #ifndef sv_setnv_mg
4451 #  define sv_setnv_mg(sv, num)          \
4452    STMT_START {                         \
4453      SV *TeMpSv = sv;                   \
4454      sv_setnv(TeMpSv,num);              \
4455      SvSETMAGIC(TeMpSv);                \
4456    } STMT_END
4457 #endif
4458
4459 #ifndef sv_setpv_mg
4460 #  define sv_setpv_mg(sv, ptr)          \
4461    STMT_START {                         \
4462      SV *TeMpSv = sv;                   \
4463      sv_setpv(TeMpSv,ptr);              \
4464      SvSETMAGIC(TeMpSv);                \
4465    } STMT_END
4466 #endif
4467
4468 #ifndef sv_setpvn_mg
4469 #  define sv_setpvn_mg(sv, ptr, len)    \
4470    STMT_START {                         \
4471      SV *TeMpSv = sv;                   \
4472      sv_setpvn(TeMpSv,ptr,len);         \
4473      SvSETMAGIC(TeMpSv);                \
4474    } STMT_END
4475 #endif
4476
4477 #ifndef sv_setsv_mg
4478 #  define sv_setsv_mg(dsv, ssv)         \
4479    STMT_START {                         \
4480      SV *TeMpSv = dsv;                  \
4481      sv_setsv(TeMpSv,ssv);              \
4482      SvSETMAGIC(TeMpSv);                \
4483    } STMT_END
4484 #endif
4485
4486 #ifndef sv_setuv_mg
4487 #  define sv_setuv_mg(sv, i)            \
4488    STMT_START {                         \
4489      SV *TeMpSv = sv;                   \
4490      sv_setuv(TeMpSv,i);                \
4491      SvSETMAGIC(TeMpSv);                \
4492    } STMT_END
4493 #endif
4494
4495 #ifndef sv_usepvn_mg
4496 #  define sv_usepvn_mg(sv, ptr, len)    \
4497    STMT_START {                         \
4498      SV *TeMpSv = sv;                   \
4499      sv_usepvn(TeMpSv,ptr,len);         \
4500      SvSETMAGIC(TeMpSv);                \
4501    } STMT_END
4502 #endif
4503 #ifndef SvVSTRING_mg
4504 #  define SvVSTRING_mg(sv)               (SvMAGICAL(sv) ? mg_find(sv, PERL_MAGIC_vstring) : NULL)
4505 #endif
4506
4507 /* Hint: sv_magic_portable
4508  * This is a compatibility function that is only available with
4509  * Devel::PPPort. It is NOT in the perl core.
4510  * Its purpose is to mimic the 5.8.0 behaviour of sv_magic() when
4511  * it is being passed a name pointer with namlen == 0. In that
4512  * case, perl 5.8.0 and later store the pointer, not a copy of it.
4513  * The compatibility can be provided back to perl 5.004. With
4514  * earlier versions, the code will not compile.
4515  */
4516
4517 #if (PERL_BCDVERSION < 0x5004000)
4518
4519   /* code that uses sv_magic_portable will not compile */
4520
4521 #elif (PERL_BCDVERSION < 0x5008000)
4522
4523 #  define sv_magic_portable(sv, obj, how, name, namlen)     \
4524    STMT_START {                                             \
4525      SV *SvMp_sv = (sv);                                    \
4526      char *SvMp_name = (char *) (name);                     \
4527      I32 SvMp_namlen = (namlen);                            \
4528      if (SvMp_name && SvMp_namlen == 0)                     \
4529      {                                                      \
4530        MAGIC *mg;                                           \
4531        sv_magic(SvMp_sv, obj, how, 0, 0);                   \
4532        mg = SvMAGIC(SvMp_sv);                               \
4533        mg->mg_len = -42; /* XXX: this is the tricky part */ \
4534        mg->mg_ptr = SvMp_name;                              \
4535      }                                                      \
4536      else                                                   \
4537      {                                                      \
4538        sv_magic(SvMp_sv, obj, how, SvMp_name, SvMp_namlen); \
4539      }                                                      \
4540    } STMT_END
4541
4542 #else
4543
4544 #  define sv_magic_portable(a, b, c, d, e)  sv_magic(a, b, c, d, e)
4545
4546 #endif
4547
4548 #if !defined(mg_findext)
4549 #if defined(NEED_mg_findext)
4550 static MAGIC * DPPP_(my_mg_findext)(SV * sv, int type, const MGVTBL *vtbl);
4551 static
4552 #else
4553 extern MAGIC * DPPP_(my_mg_findext)(SV * sv, int type, const MGVTBL *vtbl);
4554 #endif
4555
4556 #define mg_findext DPPP_(my_mg_findext)
4557 #define Perl_mg_findext DPPP_(my_mg_findext)
4558
4559 #if defined(NEED_mg_findext) || defined(NEED_mg_findext_GLOBAL)
4560
4561 MAGIC *
4562 DPPP_(my_mg_findext)(SV * sv, int type, const MGVTBL *vtbl) {
4563     if (sv) {
4564         MAGIC *mg;
4565
4566 #ifdef AvPAD_NAMELIST
4567         assert(!(SvTYPE(sv) == SVt_PVAV && AvPAD_NAMELIST(sv)));
4568 #endif
4569
4570         for (mg = SvMAGIC (sv); mg; mg = mg->mg_moremagic) {
4571             if (mg->mg_type == type && mg->mg_virtual == vtbl)
4572                 return mg;
4573         }
4574     }
4575
4576     return NULL;
4577 }
4578
4579 #endif
4580 #endif
4581
4582 #if !defined(sv_unmagicext)
4583 #if defined(NEED_sv_unmagicext)
4584 static int DPPP_(my_sv_unmagicext)(pTHX_ SV * const sv, const int type, MGVTBL * vtbl);
4585 static
4586 #else
4587 extern int DPPP_(my_sv_unmagicext)(pTHX_ SV * const sv, const int type, MGVTBL * vtbl);
4588 #endif
4589
4590 #ifdef sv_unmagicext
4591 #  undef sv_unmagicext
4592 #endif
4593 #define sv_unmagicext(a,b,c) DPPP_(my_sv_unmagicext)(aTHX_ a,b,c)
4594 #define Perl_sv_unmagicext DPPP_(my_sv_unmagicext)
4595
4596 #if defined(NEED_sv_unmagicext) || defined(NEED_sv_unmagicext_GLOBAL)
4597
4598 int
4599 DPPP_(my_sv_unmagicext)(pTHX_ SV *const sv, const int type, MGVTBL *vtbl)
4600 {
4601     MAGIC* mg;
4602     MAGIC** mgp;
4603
4604     if (SvTYPE(sv) < SVt_PVMG || !SvMAGIC(sv))
4605         return 0;
4606     mgp = &(SvMAGIC(sv));
4607     for (mg = *mgp; mg; mg = *mgp) {
4608         const MGVTBL* const virt = mg->mg_virtual;
4609         if (mg->mg_type == type && virt == vtbl) {
4610             *mgp = mg->mg_moremagic;
4611             if (virt && virt->svt_free)
4612                 virt->svt_free(aTHX_ sv, mg);
4613             if (mg->mg_ptr && mg->mg_type != PERL_MAGIC_regex_global) {
4614                 if (mg->mg_len > 0)
4615                     Safefree(mg->mg_ptr);
4616                 else if (mg->mg_len == HEf_SVKEY) /* Questionable on older perls... */
4617                     SvREFCNT_dec(MUTABLE_SV(mg->mg_ptr));
4618                 else if (mg->mg_type == PERL_MAGIC_utf8)
4619                     Safefree(mg->mg_ptr);
4620             }
4621             if (mg->mg_flags & MGf_REFCOUNTED)
4622                 SvREFCNT_dec(mg->mg_obj);
4623             Safefree(mg);
4624         }
4625         else
4626             mgp = &mg->mg_moremagic;
4627     }
4628     if (SvMAGIC(sv)) {
4629         if (SvMAGICAL(sv))      /* if we're under save_magic, wait for restore_magic; */
4630             mg_magical(sv);     /*    else fix the flags now */
4631     }
4632     else {
4633         SvMAGICAL_off(sv);
4634         SvFLAGS(sv) |= (SvFLAGS(sv) & (SVp_IOK|SVp_NOK|SVp_POK)) >> PRIVSHIFT;
4635     }
4636     return 0;
4637 }
4638
4639 #endif
4640 #endif
4641 #ifndef cBOOL
4642 #  define cBOOL(cbool)                   ((cbool) ? (bool)1 : (bool)0)
4643 #endif
4644
4645 #ifndef OpHAS_SIBLING
4646 #  define OpHAS_SIBLING(o)               (cBOOL((o)->op_sibling))
4647 #endif
4648
4649 #ifndef OpSIBLING
4650 #  define OpSIBLING(o)                   (0 + (o)->op_sibling)
4651 #endif
4652
4653 #ifndef OpMORESIB_set
4654 #  define OpMORESIB_set(o, sib)          ((o)->op_sibling = (sib))
4655 #endif
4656
4657 #ifndef OpLASTSIB_set
4658 #  define OpLASTSIB_set(o, parent)       ((o)->op_sibling = NULL)
4659 #endif
4660
4661 #ifndef OpMAYBESIB_set
4662 #  define OpMAYBESIB_set(o, sib, parent) ((o)->op_sibling = (sib))
4663 #endif
4664
4665 #ifndef SvRX
4666 #if defined(NEED_SvRX)
4667 static void * DPPP_(my_SvRX)(pTHX_ SV *rv);
4668 static
4669 #else
4670 extern void * DPPP_(my_SvRX)(pTHX_ SV *rv);
4671 #endif
4672
4673 #ifdef SvRX
4674 #  undef SvRX
4675 #endif
4676 #define SvRX(a) DPPP_(my_SvRX)(aTHX_ a)
4677
4678 #if defined(NEED_SvRX) || defined(NEED_SvRX_GLOBAL)
4679
4680 void *
4681 DPPP_(my_SvRX)(pTHX_ SV *rv)
4682 {
4683         if (SvROK(rv)) {
4684                 SV *sv = SvRV(rv);
4685                 if (SvMAGICAL(sv)) {
4686                         MAGIC *mg = mg_find(sv, PERL_MAGIC_qr);
4687                         if (mg && mg->mg_obj) {
4688                                 return mg->mg_obj;
4689                         }
4690                 }
4691         }
4692         return 0;
4693 }
4694 #endif
4695 #endif
4696 #ifndef SvRXOK
4697 #  define SvRXOK(sv)                     (!!SvRX(sv))
4698 #endif
4699
4700 #ifndef PERL_UNUSED_DECL
4701 #  ifdef HASATTRIBUTE
4702 #    if (defined(__GNUC__) && defined(__cplusplus)) || defined(__INTEL_COMPILER)
4703 #      define PERL_UNUSED_DECL
4704 #    else
4705 #      define PERL_UNUSED_DECL __attribute__((unused))
4706 #    endif
4707 #  else
4708 #    define PERL_UNUSED_DECL
4709 #  endif
4710 #endif
4711
4712 #ifndef PERL_UNUSED_ARG
4713 #  if defined(lint) && defined(S_SPLINT_S) /* www.splint.org */
4714 #    include <note.h>
4715 #    define PERL_UNUSED_ARG(x) NOTE(ARGUNUSED(x))
4716 #  else
4717 #    define PERL_UNUSED_ARG(x) ((void)x)
4718 #  endif
4719 #endif
4720
4721 #ifndef PERL_UNUSED_VAR
4722 #  define PERL_UNUSED_VAR(x) ((void)x)
4723 #endif
4724
4725 #ifndef PERL_UNUSED_CONTEXT
4726 #  ifdef USE_ITHREADS
4727 #    define PERL_UNUSED_CONTEXT PERL_UNUSED_ARG(my_perl)
4728 #  else
4729 #    define PERL_UNUSED_CONTEXT
4730 #  endif
4731 #endif
4732
4733 #ifndef PERL_UNUSED_RESULT
4734 #  if defined(__GNUC__) && defined(HASATTRIBUTE_WARN_UNUSED_RESULT)
4735 #    define PERL_UNUSED_RESULT(v) STMT_START { __typeof__(v) z = (v); (void)sizeof(z); } STMT_END
4736 #  else
4737 #    define PERL_UNUSED_RESULT(v) ((void)(v))
4738 #  endif
4739 #endif
4740 #ifndef NOOP
4741 #  define NOOP                           /*EMPTY*/(void)0
4742 #endif
4743
4744 #ifndef dNOOP
4745 #  define dNOOP                          extern int /*@unused@*/ Perl___notused PERL_UNUSED_DECL
4746 #endif
4747
4748 #ifndef NVTYPE
4749 #  if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
4750 #    define NVTYPE long double
4751 #  else
4752 #    define NVTYPE double
4753 #  endif
4754 typedef NVTYPE NV;
4755 #endif
4756
4757 #ifndef INT2PTR
4758 #  if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE)
4759 #    define PTRV                  UV
4760 #    define INT2PTR(any,d)        (any)(d)
4761 #  else
4762 #    if PTRSIZE == LONGSIZE
4763 #      define PTRV                unsigned long
4764 #    else
4765 #      define PTRV                unsigned
4766 #    endif
4767 #    define INT2PTR(any,d)        (any)(PTRV)(d)
4768 #  endif
4769 #endif
4770
4771 #ifndef PTR2ul
4772 #  if PTRSIZE == LONGSIZE
4773 #    define PTR2ul(p)     (unsigned long)(p)
4774 #  else
4775 #    define PTR2ul(p)     INT2PTR(unsigned long,p)
4776 #  endif
4777 #endif
4778 #ifndef PTR2nat
4779 #  define PTR2nat(p)                     (PTRV)(p)
4780 #endif
4781
4782 #ifndef NUM2PTR
4783 #  define NUM2PTR(any,d)                 (any)PTR2nat(d)
4784 #endif
4785
4786 #ifndef PTR2IV
4787 #  define PTR2IV(p)                      INT2PTR(IV,p)
4788 #endif
4789
4790 #ifndef PTR2UV
4791 #  define PTR2UV(p)                      INT2PTR(UV,p)
4792 #endif
4793
4794 #ifndef PTR2NV
4795 #  define PTR2NV(p)                      NUM2PTR(NV,p)
4796 #endif
4797
4798 #undef START_EXTERN_C
4799 #undef END_EXTERN_C
4800 #undef EXTERN_C
4801 #ifdef __cplusplus
4802 #  define START_EXTERN_C extern "C" {
4803 #  define END_EXTERN_C }
4804 #  define EXTERN_C extern "C"
4805 #else
4806 #  define START_EXTERN_C
4807 #  define END_EXTERN_C
4808 #  define EXTERN_C extern
4809 #endif
4810
4811 #if defined(PERL_GCC_PEDANTIC)
4812 #  ifndef PERL_GCC_BRACE_GROUPS_FORBIDDEN
4813 #    define PERL_GCC_BRACE_GROUPS_FORBIDDEN
4814 #  endif
4815 #endif
4816
4817 #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) && !defined(__cplusplus)
4818 #  ifndef PERL_USE_GCC_BRACE_GROUPS
4819 #    define PERL_USE_GCC_BRACE_GROUPS
4820 #  endif
4821 #endif
4822
4823 #undef STMT_START
4824 #undef STMT_END
4825 #ifdef PERL_USE_GCC_BRACE_GROUPS
4826 #  define STMT_START    (void)( /* gcc supports ``({ STATEMENTS; })'' */
4827 #  define STMT_END      )
4828 #else
4829 #  if defined(VOIDFLAGS) && (VOIDFLAGS) && (defined(sun) || defined(__sun__)) && !defined(__GNUC__)
4830 #    define STMT_START  if (1)
4831 #    define STMT_END    else (void)0
4832 #  else
4833 #    define STMT_START  do
4834 #    define STMT_END    while (0)
4835 #  endif
4836 #endif
4837 #ifndef boolSV
4838 #  define boolSV(b)                      ((b) ? &PL_sv_yes : &PL_sv_no)
4839 #endif
4840
4841 /* DEFSV appears first in 5.004_56 */
4842 #ifndef DEFSV
4843 #  define DEFSV                          GvSV(PL_defgv)
4844 #endif
4845
4846 #ifndef SAVE_DEFSV
4847 #  define SAVE_DEFSV                     SAVESPTR(GvSV(PL_defgv))
4848 #endif
4849
4850 #ifndef DEFSV_set
4851 #  define DEFSV_set(sv)                  (DEFSV = (sv))
4852 #endif
4853
4854 /* Older perls (<=5.003) lack AvFILLp */
4855 #ifndef AvFILLp
4856 #  define AvFILLp                        AvFILL
4857 #endif
4858 #ifndef ERRSV
4859 #  define ERRSV                          get_sv("@",FALSE)
4860 #endif
4861
4862 /* Hint: gv_stashpvn
4863  * This function's backport doesn't support the length parameter, but
4864  * rather ignores it. Portability can only be ensured if the length
4865  * parameter is used for speed reasons, but the length can always be
4866  * correctly computed from the string argument.
4867  */
4868 #ifndef gv_stashpvn
4869 #  define gv_stashpvn(str,len,create)    gv_stashpv(str,create)
4870 #endif
4871
4872 /* Replace: 1 */
4873 #ifndef get_cv
4874 #  define get_cv                         perl_get_cv
4875 #endif
4876
4877 #ifndef get_sv
4878 #  define get_sv                         perl_get_sv
4879 #endif
4880
4881 #ifndef get_av
4882 #  define get_av                         perl_get_av
4883 #endif
4884
4885 #ifndef get_hv
4886 #  define get_hv                         perl_get_hv
4887 #endif
4888
4889 /* Replace: 0 */
4890 #ifndef dUNDERBAR
4891 #  define dUNDERBAR                      dNOOP
4892 #endif
4893
4894 #ifndef UNDERBAR
4895 #  define UNDERBAR                       DEFSV
4896 #endif
4897 #ifndef dAX
4898 #  define dAX                            I32 ax = MARK - PL_stack_base + 1
4899 #endif
4900
4901 #ifndef dITEMS
4902 #  define dITEMS                         I32 items = SP - MARK
4903 #endif
4904 #ifndef dXSTARG
4905 #  define dXSTARG                        SV * targ = sv_newmortal()
4906 #endif
4907 #ifndef dAXMARK
4908 #  define dAXMARK                        I32 ax = POPMARK; \
4909                                register SV ** const mark = PL_stack_base + ax++
4910 #endif
4911 #ifndef XSprePUSH
4912 #  define XSprePUSH                      (sp = PL_stack_base + ax - 1)
4913 #endif
4914
4915 #if (PERL_BCDVERSION < 0x5005000)
4916 #  undef XSRETURN
4917 #  define XSRETURN(off)                                   \
4918       STMT_START {                                        \
4919           PL_stack_sp = PL_stack_base + ax + ((off) - 1); \
4920           return;                                         \
4921       } STMT_END
4922 #endif
4923 #ifndef XSPROTO
4924 #  define XSPROTO(name)                  void name(pTHX_ CV* cv)
4925 #endif
4926
4927 #ifndef SVfARG
4928 #  define SVfARG(p)                      ((void*)(p))
4929 #endif
4930 #ifndef PERL_ABS
4931 #  define PERL_ABS(x)                    ((x) < 0 ? -(x) : (x))
4932 #endif
4933 #ifndef dVAR
4934 #  define dVAR                           dNOOP
4935 #endif
4936 #ifndef SVf
4937 #  define SVf                            "_"
4938 #endif
4939 #ifndef UTF8_MAXBYTES
4940 #  define UTF8_MAXBYTES                  UTF8_MAXLEN
4941 #endif
4942 #ifndef CPERLscope
4943 #  define CPERLscope(x)                  x
4944 #endif
4945 #ifndef PERL_HASH
4946 #  define PERL_HASH(hash,str,len)        \
4947      STMT_START { \
4948         const char *s_PeRlHaSh = str; \
4949         I32 i_PeRlHaSh = len; \
4950         U32 hash_PeRlHaSh = 0; \
4951         while (i_PeRlHaSh--) \
4952             hash_PeRlHaSh = hash_PeRlHaSh * 33 + *s_PeRlHaSh++; \
4953         (hash) = hash_PeRlHaSh; \
4954     } STMT_END
4955 #endif
4956
4957 #ifndef PERLIO_FUNCS_DECL
4958 # ifdef PERLIO_FUNCS_CONST
4959 #  define PERLIO_FUNCS_DECL(funcs) const PerlIO_funcs funcs
4960 #  define PERLIO_FUNCS_CAST(funcs) (PerlIO_funcs*)(funcs)
4961 # else
4962 #  define PERLIO_FUNCS_DECL(funcs) PerlIO_funcs funcs
4963 #  define PERLIO_FUNCS_CAST(funcs) (funcs)
4964 # endif
4965 #endif
4966
4967 /* provide these typedefs for older perls */
4968 #if (PERL_BCDVERSION < 0x5009003)
4969
4970 # ifdef ARGSproto
4971 typedef OP* (CPERLscope(*Perl_ppaddr_t))(ARGSproto);
4972 # else
4973 typedef OP* (CPERLscope(*Perl_ppaddr_t))(pTHX);
4974 # endif
4975
4976 typedef OP* (CPERLscope(*Perl_check_t)) (pTHX_ OP*);
4977
4978 #endif
4979 #ifndef isPSXSPC
4980 #  define isPSXSPC(c)                    (isSPACE(c) || (c) == '\v')
4981 #endif
4982
4983 #ifndef isBLANK
4984 #  define isBLANK(c)                     ((c) == ' ' || (c) == '\t')
4985 #endif
4986
4987 #ifdef EBCDIC
4988 #ifndef isALNUMC
4989 #  define isALNUMC(c)                    isalnum(c)
4990 #endif
4991
4992 #ifndef isASCII
4993 #  define isASCII(c)                     isascii(c)
4994 #endif
4995
4996 #ifndef isCNTRL
4997 #  define isCNTRL(c)                     iscntrl(c)
4998 #endif
4999
5000 #ifndef isGRAPH
5001 #  define isGRAPH(c)                     isgraph(c)
5002 #endif
5003
5004 #ifndef isPRINT
5005 #  define isPRINT(c)                     isprint(c)
5006 #endif
5007
5008 #ifndef isPUNCT
5009 #  define isPUNCT(c)                     ispunct(c)
5010 #endif
5011
5012 #ifndef isXDIGIT
5013 #  define isXDIGIT(c)                    isxdigit(c)
5014 #endif
5015
5016 #else
5017 # if (PERL_BCDVERSION < 0x5010000)
5018 /* Hint: isPRINT
5019  * The implementation in older perl versions includes all of the
5020  * isSPACE() characters, which is wrong. The version provided by
5021  * Devel::PPPort always overrides a present buggy version.
5022  */
5023 #  undef isPRINT
5024 # endif
5025
5026 #ifndef WIDEST_UTYPE
5027 # ifdef QUADKIND
5028 #  ifdef U64TYPE
5029 #   define WIDEST_UTYPE U64TYPE
5030 #  else
5031 #   define WIDEST_UTYPE Quad_t
5032 #  endif
5033 # else
5034 #  define WIDEST_UTYPE U32
5035 # endif
5036 #endif
5037 #ifndef isALNUMC
5038 #  define isALNUMC(c)                    (isALPHA(c) || isDIGIT(c))
5039 #endif
5040
5041 #ifndef isASCII
5042 #  define isASCII(c)                     ((WIDEST_UTYPE) (c) <= 127)
5043 #endif
5044
5045 #ifndef isCNTRL
5046 #  define isCNTRL(c)                     ((WIDEST_UTYPE) (c) < ' ' || (c) == 127)
5047 #endif
5048
5049 #ifndef isGRAPH
5050 #  define isGRAPH(c)                     (isALNUM(c) || isPUNCT(c))
5051 #endif
5052
5053 #ifndef isPRINT
5054 #  define isPRINT(c)                     (((c) >= 32 && (c) < 127))
5055 #endif
5056
5057 #ifndef isPUNCT
5058 #  define isPUNCT(c)                     (((c) >= 33 && (c) <= 47) || ((c) >= 58 && (c) <= 64)  || ((c) >= 91 && (c) <= 96) || ((c) >= 123 && (c) <= 126))
5059 #endif
5060
5061 #ifndef isXDIGIT
5062 #  define isXDIGIT(c)                    (isDIGIT(c) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F'))
5063 #endif
5064
5065 #endif
5066
5067 /* Until we figure out how to support this in older perls... */
5068 #if (PERL_BCDVERSION >= 0x5008000)
5069 #ifndef HeUTF8
5070 #  define HeUTF8(he)                     ((HeKLEN(he) == HEf_SVKEY) ?            \
5071                                  SvUTF8(HeKEY_sv(he)) :                 \
5072                                  (U32)HeKUTF8(he))
5073 #endif
5074
5075 #endif
5076 #ifndef C_ARRAY_LENGTH
5077 #  define C_ARRAY_LENGTH(a)              (sizeof(a)/sizeof((a)[0]))
5078 #endif
5079
5080 #ifndef C_ARRAY_END
5081 #  define C_ARRAY_END(a)                 ((a) + C_ARRAY_LENGTH(a))
5082 #endif
5083
5084 #ifndef IVdf
5085 #  if IVSIZE == LONGSIZE
5086 #    define     IVdf      "ld"
5087 #    define     UVuf      "lu"
5088 #    define     UVof      "lo"
5089 #    define     UVxf      "lx"
5090 #    define     UVXf      "lX"
5091 #  elif IVSIZE == INTSIZE
5092 #    define   IVdf      "d"
5093 #    define   UVuf      "u"
5094 #    define   UVof      "o"
5095 #    define   UVxf      "x"
5096 #    define   UVXf      "X"
5097 #  else
5098 #    error "cannot define IV/UV formats"
5099 #  endif
5100 #endif
5101
5102 #ifndef NVef
5103 #  if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && \
5104       defined(PERL_PRIfldbl) && (PERL_BCDVERSION != 0x5006000)
5105             /* Not very likely, but let's try anyway. */
5106 #    define NVef          PERL_PRIeldbl
5107 #    define NVff          PERL_PRIfldbl
5108 #    define NVgf          PERL_PRIgldbl
5109 #  else
5110 #    define NVef          "e"
5111 #    define NVff          "f"
5112 #    define NVgf          "g"
5113 #  endif
5114 #endif
5115
5116 #ifdef NEED_mess_sv
5117 #define NEED_mess
5118 #endif
5119
5120 #ifdef NEED_mess
5121 #define NEED_mess_nocontext
5122 #define NEED_vmess
5123 #endif
5124
5125 #ifndef croak_sv
5126 #if (PERL_BCDVERSION >= 0x5007003) || ( (PERL_BCDVERSION >= 0x5006001) && (PERL_BCDVERSION < 0x5007000) )
5127 #  if ( (PERL_BCDVERSION >= 0x5008000) && (PERL_BCDVERSION < 0x5008009) ) || ( (PERL_BCDVERSION >= 0x5009000) && (PERL_BCDVERSION < 0x5010001) )
5128 #    define _dppp_fix_utf8_errsv(errsv, sv)                     \
5129         STMT_START {                                            \
5130             if (sv != ERRSV)                                    \
5131                 SvFLAGS(ERRSV) = (SvFLAGS(ERRSV) & ~SVf_UTF8) | \
5132                                  (SvFLAGS(sv) & SVf_UTF8);      \
5133         } STMT_END
5134 #  else
5135 #    define _dppp_fix_utf8_errsv(errsv, sv) STMT_START {} STMT_END
5136 #  endif
5137 #  define croak_sv(sv)                        \
5138     STMT_START {                              \
5139         if (SvROK(sv)) {                      \
5140             sv_setsv(ERRSV, sv);              \
5141             croak(NULL);                      \
5142         } else {                              \
5143             _dppp_fix_utf8_errsv(ERRSV, sv);  \
5144             croak("%" SVf, SVfARG(sv));       \
5145         }                                     \
5146     } STMT_END
5147 #elif (PERL_BCDVERSION >= 0x5004000)
5148 #  define croak_sv(sv) croak("%" SVf, SVfARG(sv))
5149 #else
5150 #  define croak_sv(sv) croak("%s", SvPV_nolen(sv))
5151 #endif
5152 #endif
5153
5154 #ifndef die_sv
5155 #if defined(NEED_die_sv)
5156 static OP * DPPP_(my_die_sv)(pTHX_ SV *sv);
5157 static
5158 #else
5159 extern OP * DPPP_(my_die_sv)(pTHX_ SV *sv);
5160 #endif
5161
5162 #ifdef die_sv
5163 #  undef die_sv
5164 #endif
5165 #define die_sv(a) DPPP_(my_die_sv)(aTHX_ a)
5166 #define Perl_die_sv DPPP_(my_die_sv)
5167
5168 #if defined(NEED_die_sv) || defined(NEED_die_sv_GLOBAL)
5169 OP *
5170 DPPP_(my_die_sv)(pTHX_ SV *sv)
5171 {
5172     croak_sv(sv);
5173     return (OP *)NULL;
5174 }
5175 #endif
5176 #endif
5177
5178 #ifndef warn_sv
5179 #if (PERL_BCDVERSION >= 0x5004000)
5180 #  define warn_sv(sv) warn("%" SVf, SVfARG(sv))
5181 #else
5182 #  define warn_sv(sv) warn("%s", SvPV_nolen(sv))
5183 #endif
5184 #endif
5185
5186 #ifndef vmess
5187 #if defined(NEED_vmess)
5188 static SV * DPPP_(my_vmess)(pTHX_ const char * pat, va_list * args);
5189 static
5190 #else
5191 extern SV * DPPP_(my_vmess)(pTHX_ const char * pat, va_list * args);
5192 #endif
5193
5194 #ifdef vmess
5195 #  undef vmess
5196 #endif
5197 #define vmess(a,b) DPPP_(my_vmess)(aTHX_ a,b)
5198 #define Perl_vmess DPPP_(my_vmess)
5199
5200 #if defined(NEED_vmess) || defined(NEED_vmess_GLOBAL)
5201 SV*
5202 DPPP_(my_vmess)(pTHX_ const char* pat, va_list* args)
5203 {
5204     mess(pat, args);
5205     return PL_mess_sv;
5206 }
5207 #endif
5208 #endif
5209
5210 #if (PERL_BCDVERSION < 0x5006000)
5211 #undef mess
5212 #endif
5213
5214 #if !defined(mess_nocontext) && !defined(Perl_mess_nocontext)
5215 #if defined(NEED_mess_nocontext)
5216 static SV * DPPP_(my_mess_nocontext)(const char * pat, ...);
5217 static
5218 #else
5219 extern SV * DPPP_(my_mess_nocontext)(const char * pat, ...);
5220 #endif
5221
5222 #define mess_nocontext DPPP_(my_mess_nocontext)
5223 #define Perl_mess_nocontext DPPP_(my_mess_nocontext)
5224
5225 #if defined(NEED_mess_nocontext) || defined(NEED_mess_nocontext_GLOBAL)
5226 SV*
5227 DPPP_(my_mess_nocontext)(const char* pat, ...)
5228 {
5229     dTHX;
5230     SV *sv;
5231     va_list args;
5232     va_start(args, pat);
5233     sv = vmess(pat, &args);
5234     va_end(args);
5235     return sv;
5236 }
5237 #endif
5238 #endif
5239
5240 #ifndef mess
5241 #if defined(NEED_mess)
5242 static SV * DPPP_(my_mess)(pTHX_ const char * pat, ...);
5243 static
5244 #else
5245 extern SV * DPPP_(my_mess)(pTHX_ const char * pat, ...);
5246 #endif
5247
5248 #define Perl_mess DPPP_(my_mess)
5249
5250 #if defined(NEED_mess) || defined(NEED_mess_GLOBAL)
5251 SV*
5252 DPPP_(my_mess)(pTHX_ const char* pat, ...)
5253 {
5254     SV *sv;
5255     va_list args;
5256     va_start(args, pat);
5257     sv = vmess(pat, &args);
5258     va_end(args);
5259     return sv;
5260 }
5261 #ifdef mess_nocontext
5262 #define mess mess_nocontext
5263 #else
5264 #define mess Perl_mess_nocontext
5265 #endif
5266 #endif
5267 #endif
5268
5269 #ifndef mess_sv
5270 #if defined(NEED_mess_sv)
5271 static SV * DPPP_(my_mess_sv)(pTHX_ SV * basemsg, bool consume);
5272 static
5273 #else
5274 extern SV * DPPP_(my_mess_sv)(pTHX_ SV * basemsg, bool consume);
5275 #endif
5276
5277 #ifdef mess_sv
5278 #  undef mess_sv
5279 #endif
5280 #define mess_sv(a,b) DPPP_(my_mess_sv)(aTHX_ a,b)
5281 #define Perl_mess_sv DPPP_(my_mess_sv)
5282
5283 #if defined(NEED_mess_sv) || defined(NEED_mess_sv_GLOBAL)
5284 SV *
5285 DPPP_(my_mess_sv)(pTHX_ SV *basemsg, bool consume)
5286 {
5287     SV *tmp;
5288     SV *ret;
5289
5290     if (SvPOK(basemsg) && SvCUR(basemsg) && *(SvEND(basemsg)-1) == '\n') {
5291         if (consume)
5292             return basemsg;
5293         ret = mess("");
5294         SvSetSV_nosteal(ret, basemsg);
5295         return ret;
5296     }
5297
5298     if (consume) {
5299         sv_catsv(basemsg, mess(""));
5300         return basemsg;
5301     }
5302
5303     ret = mess("");
5304     tmp = newSVsv(ret);
5305     SvSetSV_nosteal(ret, basemsg);
5306     sv_catsv(ret, tmp);
5307     sv_dec(tmp);
5308     return ret;
5309 }
5310 #endif
5311 #endif
5312
5313 #ifndef warn_nocontext
5314 #define warn_nocontext warn
5315 #endif
5316
5317 #ifndef croak_nocontext
5318 #define croak_nocontext croak
5319 #endif
5320
5321 #ifndef croak_no_modify
5322 #define croak_no_modify() croak_nocontext("%s", PL_no_modify)
5323 #define Perl_croak_no_modify() croak_no_modify()
5324 #endif
5325
5326 #ifndef croak_memory_wrap
5327 #if (PERL_BCDVERSION >= 0x5009002) || ( (PERL_BCDVERSION >= 0x5008006) && (PERL_BCDVERSION < 0x5009000) )
5328 #  define croak_memory_wrap() croak_nocontext("%s", PL_memory_wrap)
5329 #else
5330 #  define croak_memory_wrap() croak_nocontext("panic: memory wrap")
5331 #endif
5332 #endif
5333
5334 #ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE
5335 #define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params)
5336 #endif
5337
5338 #ifndef croak_xs_usage
5339 #if defined(NEED_croak_xs_usage)
5340 static void DPPP_(my_croak_xs_usage)(const CV * const cv, const char * const params);
5341 static
5342 #else
5343 extern void DPPP_(my_croak_xs_usage)(const CV * const cv, const char * const params);
5344 #endif
5345
5346 #define croak_xs_usage DPPP_(my_croak_xs_usage)
5347 #define Perl_croak_xs_usage DPPP_(my_croak_xs_usage)
5348
5349 #if defined(NEED_croak_xs_usage) || defined(NEED_croak_xs_usage_GLOBAL)
5350 void
5351 DPPP_(my_croak_xs_usage)(const CV *const cv, const char *const params)
5352 {
5353     dTHX;
5354     const GV *const gv = CvGV(cv);
5355
5356     PERL_ARGS_ASSERT_CROAK_XS_USAGE;
5357
5358     if (gv) {
5359         const char *const gvname = GvNAME(gv);
5360         const HV *const stash = GvSTASH(gv);
5361         const char *const hvname = stash ? HvNAME(stash) : NULL;
5362
5363         if (hvname)
5364             croak("Usage: %s::%s(%s)", hvname, gvname, params);
5365         else
5366             croak("Usage: %s(%s)", gvname, params);
5367     } else {
5368         /* Pants. I don't think that it should be possible to get here. */
5369         croak("Usage: CODE(0x%" UVxf ")(%s)", PTR2UV(cv), params);
5370     }
5371 }
5372 #endif
5373 #endif
5374
5375 #ifndef PERL_SIGNALS_UNSAFE_FLAG
5376
5377 #define PERL_SIGNALS_UNSAFE_FLAG 0x0001
5378
5379 #if (PERL_BCDVERSION < 0x5008000)
5380 #  define D_PPP_PERL_SIGNALS_INIT   PERL_SIGNALS_UNSAFE_FLAG
5381 #else
5382 #  define D_PPP_PERL_SIGNALS_INIT   0
5383 #endif
5384
5385 #if defined(NEED_PL_signals)
5386 static U32 DPPP_(my_PL_signals) = D_PPP_PERL_SIGNALS_INIT;
5387 #elif defined(NEED_PL_signals_GLOBAL)
5388 U32 DPPP_(my_PL_signals) = D_PPP_PERL_SIGNALS_INIT;
5389 #else
5390 extern U32 DPPP_(my_PL_signals);
5391 #endif
5392 #define PL_signals DPPP_(my_PL_signals)
5393
5394 #endif
5395
5396 /* Hint: PL_ppaddr
5397  * Calling an op via PL_ppaddr requires passing a context argument
5398  * for threaded builds. Since the context argument is different for
5399  * 5.005 perls, you can use aTHXR (supplied by ppport.h), which will
5400  * automatically be defined as the correct argument.
5401  */
5402
5403 #if (PERL_BCDVERSION <= 0x5005005)
5404 /* Replace: 1 */
5405 #  define PL_ppaddr                 ppaddr
5406 #  define PL_no_modify              no_modify
5407 /* Replace: 0 */
5408 #endif
5409
5410 #if (PERL_BCDVERSION <= 0x5004005)
5411 /* Replace: 1 */
5412 #  define PL_DBsignal               DBsignal
5413 #  define PL_DBsingle               DBsingle
5414 #  define PL_DBsub                  DBsub
5415 #  define PL_DBtrace                DBtrace
5416 #  define PL_Sv                     Sv
5417 #  define PL_bufend                 bufend
5418 #  define PL_bufptr                 bufptr
5419 #  define PL_compiling              compiling
5420 #  define PL_copline                copline
5421 #  define PL_curcop                 curcop
5422 #  define PL_curstash               curstash
5423 #  define PL_debstash               debstash
5424 #  define PL_defgv                  defgv
5425 #  define PL_diehook                diehook
5426 #  define PL_dirty                  dirty
5427 #  define PL_dowarn                 dowarn
5428 #  define PL_errgv                  errgv
5429 #  define PL_error_count            error_count
5430 #  define PL_expect                 expect
5431 #  define PL_hexdigit               hexdigit
5432 #  define PL_hints                  hints
5433 #  define PL_in_my                  in_my
5434 #  define PL_laststatval            laststatval
5435 #  define PL_lex_state              lex_state
5436 #  define PL_lex_stuff              lex_stuff
5437 #  define PL_linestr                linestr
5438 #  define PL_na                     na
5439 #  define PL_perl_destruct_level    perl_destruct_level
5440 #  define PL_perldb                 perldb
5441 #  define PL_rsfp_filters           rsfp_filters
5442 #  define PL_rsfp                   rsfp
5443 #  define PL_stack_base             stack_base
5444 #  define PL_stack_sp               stack_sp
5445 #  define PL_statcache              statcache
5446 #  define PL_stdingv                stdingv
5447 #  define PL_sv_arenaroot           sv_arenaroot
5448 #  define PL_sv_no                  sv_no
5449 #  define PL_sv_undef               sv_undef
5450 #  define PL_sv_yes                 sv_yes
5451 #  define PL_tainted                tainted
5452 #  define PL_tainting               tainting
5453 #  define PL_tokenbuf               tokenbuf
5454 /* Replace: 0 */
5455 #endif
5456
5457 /* Warning: PL_parser
5458  * For perl versions earlier than 5.9.5, this is an always
5459  * non-NULL dummy. Also, it cannot be dereferenced. Don't
5460  * use it if you can avoid is and unless you absolutely know
5461  * what you're doing.
5462  * If you always check that PL_parser is non-NULL, you can
5463  * define DPPP_PL_parser_NO_DUMMY to avoid the creation of
5464  * a dummy parser structure.
5465  */
5466
5467 #if (PERL_BCDVERSION >= 0x5009005)
5468 # ifdef DPPP_PL_parser_NO_DUMMY
5469 #  define D_PPP_my_PL_parser_var(var) ((PL_parser ? PL_parser : \
5470                 (croak("panic: PL_parser == NULL in %s:%d", \
5471                        __FILE__, __LINE__), (yy_parser *) NULL))->var)
5472 # else
5473 #  ifdef DPPP_PL_parser_NO_DUMMY_WARNING
5474 #   define D_PPP_parser_dummy_warning(var)
5475 #  else
5476 #   define D_PPP_parser_dummy_warning(var) \
5477              warn("warning: dummy PL_" #var " used in %s:%d", __FILE__, __LINE__),
5478 #  endif
5479 #  define D_PPP_my_PL_parser_var(var) ((PL_parser ? PL_parser : \
5480                 (D_PPP_parser_dummy_warning(var) &DPPP_(dummy_PL_parser)))->var)
5481 #if defined(NEED_PL_parser)
5482 static yy_parser DPPP_(dummy_PL_parser);
5483 #elif defined(NEED_PL_parser_GLOBAL)
5484 yy_parser DPPP_(dummy_PL_parser);
5485 #else
5486 extern yy_parser DPPP_(dummy_PL_parser);
5487 #endif
5488
5489 # endif
5490
5491 /* PL_expect, PL_copline, PL_rsfp, PL_rsfp_filters, PL_linestr, PL_bufptr, PL_bufend, PL_lex_state, PL_lex_stuff, PL_tokenbuf depends on PL_parser */
5492 /* Warning: PL_expect, PL_copline, PL_rsfp, PL_rsfp_filters, PL_linestr, PL_bufptr, PL_bufend, PL_lex_state, PL_lex_stuff, PL_tokenbuf
5493  * Do not use this variable unless you know exactly what you're
5494  * doing. It is internal to the perl parser and may change or even
5495  * be removed in the future. As of perl 5.9.5, you have to check
5496  * for (PL_parser != NULL) for this variable to have any effect.
5497  * An always non-NULL PL_parser dummy is provided for earlier
5498  * perl versions.
5499  * If PL_parser is NULL when you try to access this variable, a
5500  * dummy is being accessed instead and a warning is issued unless
5501  * you define DPPP_PL_parser_NO_DUMMY_WARNING.
5502  * If DPPP_PL_parser_NO_DUMMY is defined, the code trying to access
5503  * this variable will croak with a panic message.
5504  */
5505
5506 # define PL_expect         D_PPP_my_PL_parser_var(expect)
5507 # define PL_copline        D_PPP_my_PL_parser_var(copline)
5508 # define PL_rsfp           D_PPP_my_PL_parser_var(rsfp)
5509 # define PL_rsfp_filters   D_PPP_my_PL_parser_var(rsfp_filters)
5510 # define PL_linestr        D_PPP_my_PL_parser_var(linestr)
5511 # define PL_bufptr         D_PPP_my_PL_parser_var(bufptr)
5512 # define PL_bufend         D_PPP_my_PL_parser_var(bufend)
5513 # define PL_lex_state      D_PPP_my_PL_parser_var(lex_state)
5514 # define PL_lex_stuff      D_PPP_my_PL_parser_var(lex_stuff)
5515 # define PL_tokenbuf       D_PPP_my_PL_parser_var(tokenbuf)
5516 # define PL_in_my          D_PPP_my_PL_parser_var(in_my)
5517 # define PL_in_my_stash    D_PPP_my_PL_parser_var(in_my_stash)
5518 # define PL_error_count    D_PPP_my_PL_parser_var(error_count)
5519
5520
5521 #else
5522
5523 /* ensure that PL_parser != NULL and cannot be dereferenced */
5524 # define PL_parser         ((void *) 1)
5525
5526 #endif
5527 #ifndef mPUSHs
5528 #  define mPUSHs(s)                      PUSHs(sv_2mortal(s))
5529 #endif
5530
5531 #ifndef PUSHmortal
5532 #  define PUSHmortal                     PUSHs(sv_newmortal())
5533 #endif
5534
5535 #ifndef mPUSHp
5536 #  define mPUSHp(p,l)                    sv_setpvn(PUSHmortal, (p), (l))
5537 #endif
5538
5539 #ifndef mPUSHn
5540 #  define mPUSHn(n)                      sv_setnv(PUSHmortal, (NV)(n))
5541 #endif
5542
5543 #ifndef mPUSHi
5544 #  define mPUSHi(i)                      sv_setiv(PUSHmortal, (IV)(i))
5545 #endif
5546
5547 #ifndef mPUSHu
5548 #  define mPUSHu(u)                      sv_setuv(PUSHmortal, (UV)(u))
5549 #endif
5550 #ifndef mXPUSHs
5551 #  define mXPUSHs(s)                     XPUSHs(sv_2mortal(s))
5552 #endif
5553
5554 #ifndef XPUSHmortal
5555 #  define XPUSHmortal                    XPUSHs(sv_newmortal())
5556 #endif
5557
5558 #ifndef mXPUSHp
5559 #  define mXPUSHp(p,l)                   STMT_START { EXTEND(sp,1); sv_setpvn(PUSHmortal, (p), (l)); } STMT_END
5560 #endif
5561
5562 #ifndef mXPUSHn
5563 #  define mXPUSHn(n)                     STMT_START { EXTEND(sp,1); sv_setnv(PUSHmortal, (NV)(n)); } STMT_END
5564 #endif
5565
5566 #ifndef mXPUSHi
5567 #  define mXPUSHi(i)                     STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT_END
5568 #endif
5569
5570 #ifndef mXPUSHu
5571 #  define mXPUSHu(u)                     STMT_START { EXTEND(sp,1); sv_setuv(PUSHmortal, (UV)(u)); } STMT_END
5572 #endif
5573
5574 /* Replace: 1 */
5575 #ifndef call_sv
5576 #  define call_sv                        perl_call_sv
5577 #endif
5578
5579 #ifndef call_pv
5580 #  define call_pv                        perl_call_pv
5581 #endif
5582
5583 #ifndef call_argv
5584 #  define call_argv                      perl_call_argv
5585 #endif
5586
5587 #ifndef call_method
5588 #  define call_method                    perl_call_method
5589 #endif
5590 #ifndef eval_sv
5591 #  define eval_sv                        perl_eval_sv
5592 #endif
5593
5594 /* Replace: 0 */
5595 #ifndef PERL_LOADMOD_DENY
5596 #  define PERL_LOADMOD_DENY              0x1
5597 #endif
5598
5599 #ifndef PERL_LOADMOD_NOIMPORT
5600 #  define PERL_LOADMOD_NOIMPORT          0x2
5601 #endif
5602
5603 #ifndef PERL_LOADMOD_IMPORT_OPS
5604 #  define PERL_LOADMOD_IMPORT_OPS        0x4
5605 #endif
5606
5607 #ifndef G_METHOD
5608 # define G_METHOD               64
5609 # ifdef call_sv
5610 #  undef call_sv
5611 # endif
5612 # if (PERL_BCDVERSION < 0x5006000)
5613 #  define call_sv(sv, flags)  ((flags) & G_METHOD ? perl_call_method((char *) SvPV_nolen_const(sv), \
5614                                 (flags) & ~G_METHOD) : perl_call_sv(sv, flags))
5615 # else
5616 #  define call_sv(sv, flags)  ((flags) & G_METHOD ? Perl_call_method(aTHX_ (char *) SvPV_nolen_const(sv), \
5617                                 (flags) & ~G_METHOD) : Perl_call_sv(aTHX_ sv, flags))
5618 # endif
5619 #endif
5620
5621 /* Replace perl_eval_pv with eval_pv */
5622
5623 #ifndef eval_pv
5624 #if defined(NEED_eval_pv)
5625 static SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error);
5626 static
5627 #else
5628 extern SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error);
5629 #endif
5630
5631 #ifdef eval_pv
5632 #  undef eval_pv
5633 #endif
5634 #define eval_pv(a,b) DPPP_(my_eval_pv)(aTHX_ a,b)
5635 #define Perl_eval_pv DPPP_(my_eval_pv)
5636
5637 #if defined(NEED_eval_pv) || defined(NEED_eval_pv_GLOBAL)
5638
5639 SV*
5640 DPPP_(my_eval_pv)(char *p, I32 croak_on_error)
5641 {
5642     dSP;
5643     SV* sv = newSVpv(p, 0);
5644
5645     PUSHMARK(sp);
5646     eval_sv(sv, G_SCALAR);
5647     SvREFCNT_dec(sv);
5648
5649     SPAGAIN;
5650     sv = POPs;
5651     PUTBACK;
5652
5653     if (croak_on_error && SvTRUEx(ERRSV))
5654         croak_sv(ERRSV);
5655
5656     return sv;
5657 }
5658
5659 #endif
5660 #endif
5661
5662 #ifndef vload_module
5663 #if defined(NEED_vload_module)
5664 static void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args);
5665 static
5666 #else
5667 extern void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args);
5668 #endif
5669
5670 #ifdef vload_module
5671 #  undef vload_module
5672 #endif
5673 #define vload_module(a,b,c,d) DPPP_(my_vload_module)(aTHX_ a,b,c,d)
5674 #define Perl_vload_module DPPP_(my_vload_module)
5675
5676 #if defined(NEED_vload_module) || defined(NEED_vload_module_GLOBAL)
5677
5678 void
5679 DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args)
5680 {
5681     dTHR;
5682     dVAR;
5683     OP *veop, *imop;
5684
5685     OP * const modname = newSVOP(OP_CONST, 0, name);
5686     /* 5.005 has a somewhat hacky force_normal that doesn't croak on
5687        SvREADONLY() if PL_compling is true. Current perls take care in
5688        ck_require() to correctly turn off SvREADONLY before calling
5689        force_normal_flags(). This seems a better fix than fudging PL_compling
5690      */
5691     SvREADONLY_off(((SVOP*)modname)->op_sv);
5692     modname->op_private |= OPpCONST_BARE;
5693     if (ver) {
5694         veop = newSVOP(OP_CONST, 0, ver);
5695     }
5696     else
5697         veop = NULL;
5698     if (flags & PERL_LOADMOD_NOIMPORT) {
5699         imop = sawparens(newNULLLIST());
5700     }
5701     else if (flags & PERL_LOADMOD_IMPORT_OPS) {
5702         imop = va_arg(*args, OP*);
5703     }
5704     else {
5705         SV *sv;
5706         imop = NULL;
5707         sv = va_arg(*args, SV*);
5708         while (sv) {
5709             imop = append_elem(OP_LIST, imop, newSVOP(OP_CONST, 0, sv));
5710             sv = va_arg(*args, SV*);
5711         }
5712     }
5713     {
5714         const line_t ocopline = PL_copline;
5715         COP * const ocurcop = PL_curcop;
5716         const int oexpect = PL_expect;
5717
5718 #if (PERL_BCDVERSION >= 0x5004000)
5719         utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(FALSE, 0),
5720                 veop, modname, imop);
5721 #elif (PERL_BCDVERSION > 0x5003000)
5722         utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(),
5723                 veop, modname, imop);
5724 #else
5725         utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(),
5726                 modname, imop);
5727 #endif
5728         PL_expect = oexpect;
5729         PL_copline = ocopline;
5730         PL_curcop = ocurcop;
5731     }
5732 }
5733
5734 #endif
5735 #endif
5736
5737 #ifndef load_module
5738 #if defined(NEED_load_module)
5739 static void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...);
5740 static
5741 #else
5742 extern void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...);
5743 #endif
5744
5745 #ifdef load_module
5746 #  undef load_module
5747 #endif
5748 #define load_module DPPP_(my_load_module)
5749 #define Perl_load_module DPPP_(my_load_module)
5750
5751 #if defined(NEED_load_module) || defined(NEED_load_module_GLOBAL)
5752
5753 void
5754 DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...)
5755 {
5756     va_list args;
5757     va_start(args, ver);
5758     vload_module(flags, name, ver, &args);
5759     va_end(args);
5760 }
5761
5762 #endif
5763 #endif
5764 #ifndef newRV_inc
5765 #  define newRV_inc(sv)                  newRV(sv)   /* Replace */
5766 #endif
5767
5768 #ifndef newRV_noinc
5769 #if defined(NEED_newRV_noinc)
5770 static SV * DPPP_(my_newRV_noinc)(SV *sv);
5771 static
5772 #else
5773 extern SV * DPPP_(my_newRV_noinc)(SV *sv);
5774 #endif
5775
5776 #ifdef newRV_noinc
5777 #  undef newRV_noinc
5778 #endif
5779 #define newRV_noinc(a) DPPP_(my_newRV_noinc)(aTHX_ a)
5780 #define Perl_newRV_noinc DPPP_(my_newRV_noinc)
5781
5782 #if defined(NEED_newRV_noinc) || defined(NEED_newRV_noinc_GLOBAL)
5783 SV *
5784 DPPP_(my_newRV_noinc)(SV *sv)
5785 {
5786   SV *rv = (SV *)newRV(sv);
5787   SvREFCNT_dec(sv);
5788   return rv;
5789 }
5790 #endif
5791 #endif
5792
5793 /* Hint: newCONSTSUB
5794  * Returns a CV* as of perl-5.7.1. This return value is not supported
5795  * by Devel::PPPort.
5796  */
5797
5798 /* newCONSTSUB from IO.xs is in the core starting with 5.004_63 */
5799 #if (PERL_BCDVERSION < 0x5004063) && (PERL_BCDVERSION != 0x5004005)
5800 #if defined(NEED_newCONSTSUB)
5801 static void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv);
5802 static
5803 #else
5804 extern void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv);
5805 #endif
5806
5807 #ifdef newCONSTSUB
5808 #  undef newCONSTSUB
5809 #endif
5810 #define newCONSTSUB(a,b,c) DPPP_(my_newCONSTSUB)(aTHX_ a,b,c)
5811 #define Perl_newCONSTSUB DPPP_(my_newCONSTSUB)
5812
5813 #if defined(NEED_newCONSTSUB) || defined(NEED_newCONSTSUB_GLOBAL)
5814
5815 /* This is just a trick to avoid a dependency of newCONSTSUB on PL_parser */
5816 /* (There's no PL_parser in perl < 5.005, so this is completely safe)     */
5817 #define D_PPP_PL_copline PL_copline
5818
5819 void
5820 DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv)
5821 {
5822         U32 oldhints = PL_hints;
5823         HV *old_cop_stash = PL_curcop->cop_stash;
5824         HV *old_curstash = PL_curstash;
5825         line_t oldline = PL_curcop->cop_line;
5826         PL_curcop->cop_line = D_PPP_PL_copline;
5827
5828         PL_hints &= ~HINT_BLOCK_SCOPE;
5829         if (stash)
5830                 PL_curstash = PL_curcop->cop_stash = stash;
5831
5832         newSUB(
5833
5834 #if   (PERL_BCDVERSION < 0x5003022)
5835                 start_subparse(),
5836 #elif (PERL_BCDVERSION == 0x5003022)
5837                 start_subparse(0),
5838 #else  /* 5.003_23  onwards */
5839                 start_subparse(FALSE, 0),
5840 #endif
5841
5842                 newSVOP(OP_CONST, 0, newSVpv((char *) name, 0)),
5843                 newSVOP(OP_CONST, 0, &PL_sv_no),   /* SvPV(&PL_sv_no) == "" -- GMB */
5844                 newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv))
5845         );
5846
5847         PL_hints = oldhints;
5848         PL_curcop->cop_stash = old_cop_stash;
5849         PL_curstash = old_curstash;
5850         PL_curcop->cop_line = oldline;
5851 }
5852 #endif
5853 #endif
5854
5855 /*
5856  * Boilerplate macros for initializing and accessing interpreter-local
5857  * data from C.  All statics in extensions should be reworked to use
5858  * this, if you want to make the extension thread-safe.  See ext/re/re.xs
5859  * for an example of the use of these macros.
5860  *
5861  * Code that uses these macros is responsible for the following:
5862  * 1. #define MY_CXT_KEY to a unique string, e.g. "DynaLoader_guts"
5863  * 2. Declare a typedef named my_cxt_t that is a structure that contains
5864  *    all the data that needs to be interpreter-local.
5865  * 3. Use the START_MY_CXT macro after the declaration of my_cxt_t.
5866  * 4. Use the MY_CXT_INIT macro such that it is called exactly once
5867  *    (typically put in the BOOT: section).
5868  * 5. Use the members of the my_cxt_t structure everywhere as
5869  *    MY_CXT.member.
5870  * 6. Use the dMY_CXT macro (a declaration) in all the functions that
5871  *    access MY_CXT.
5872  */
5873
5874 #if defined(MULTIPLICITY) || defined(PERL_OBJECT) || \
5875     defined(PERL_CAPI)    || defined(PERL_IMPLICIT_CONTEXT)
5876
5877 #ifndef START_MY_CXT
5878
5879 /* This must appear in all extensions that define a my_cxt_t structure,
5880  * right after the definition (i.e. at file scope).  The non-threads
5881  * case below uses it to declare the data as static. */
5882 #define START_MY_CXT
5883
5884 #if (PERL_BCDVERSION < 0x5004068)
5885 /* Fetches the SV that keeps the per-interpreter data. */
5886 #define dMY_CXT_SV \
5887         SV *my_cxt_sv = get_sv(MY_CXT_KEY, FALSE)
5888 #else /* >= perl5.004_68 */
5889 #define dMY_CXT_SV \
5890         SV *my_cxt_sv = *hv_fetch(PL_modglobal, MY_CXT_KEY,             \
5891                                   sizeof(MY_CXT_KEY)-1, TRUE)
5892 #endif /* < perl5.004_68 */
5893
5894 /* This declaration should be used within all functions that use the
5895  * interpreter-local data. */
5896 #define dMY_CXT \
5897         dMY_CXT_SV;                                                     \
5898         my_cxt_t *my_cxtp = INT2PTR(my_cxt_t*,SvUV(my_cxt_sv))
5899
5900 /* Creates and zeroes the per-interpreter data.
5901  * (We allocate my_cxtp in a Perl SV so that it will be released when
5902  * the interpreter goes away.) */
5903 #define MY_CXT_INIT \
5904         dMY_CXT_SV;                                                     \
5905         /* newSV() allocates one more than needed */                    \
5906         my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
5907         Zero(my_cxtp, 1, my_cxt_t);                                     \
5908         sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
5909
5910 /* This macro must be used to access members of the my_cxt_t structure.
5911  * e.g. MYCXT.some_data */
5912 #define MY_CXT          (*my_cxtp)
5913
5914 /* Judicious use of these macros can reduce the number of times dMY_CXT
5915  * is used.  Use is similar to pTHX, aTHX etc. */
5916 #define pMY_CXT         my_cxt_t *my_cxtp
5917 #define pMY_CXT_        pMY_CXT,
5918 #define _pMY_CXT        ,pMY_CXT
5919 #define aMY_CXT         my_cxtp
5920 #define aMY_CXT_        aMY_CXT,
5921 #define _aMY_CXT        ,aMY_CXT
5922
5923 #endif /* START_MY_CXT */
5924
5925 #ifndef MY_CXT_CLONE
5926 /* Clones the per-interpreter data. */
5927 #define MY_CXT_CLONE \
5928         dMY_CXT_SV;                                                     \
5929         my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
5930         Copy(INT2PTR(my_cxt_t*, SvUV(my_cxt_sv)), my_cxtp, 1, my_cxt_t);\
5931         sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
5932 #endif
5933
5934 #else /* single interpreter */
5935
5936 #ifndef START_MY_CXT
5937
5938 #define START_MY_CXT    static my_cxt_t my_cxt;
5939 #define dMY_CXT_SV      dNOOP
5940 #define dMY_CXT         dNOOP
5941 #define MY_CXT_INIT     NOOP
5942 #define MY_CXT          my_cxt
5943
5944 #define pMY_CXT         void
5945 #define pMY_CXT_
5946 #define _pMY_CXT
5947 #define aMY_CXT
5948 #define aMY_CXT_
5949 #define _aMY_CXT
5950
5951 #endif /* START_MY_CXT */
5952
5953 #ifndef MY_CXT_CLONE
5954 #define MY_CXT_CLONE    NOOP
5955 #endif
5956
5957 #endif
5958
5959 #ifndef SvREFCNT_inc
5960 #  ifdef PERL_USE_GCC_BRACE_GROUPS
5961 #    define SvREFCNT_inc(sv)            \
5962       ({                                \
5963           SV * const _sv = (SV*)(sv);   \
5964           if (_sv)                      \
5965                (SvREFCNT(_sv))++;       \
5966           _sv;                          \
5967       })
5968 #  else
5969 #    define SvREFCNT_inc(sv)    \
5970           ((PL_Sv=(SV*)(sv)) ? (++(SvREFCNT(PL_Sv)),PL_Sv) : NULL)
5971 #  endif
5972 #endif
5973
5974 #ifndef SvREFCNT_inc_simple
5975 #  ifdef PERL_USE_GCC_BRACE_GROUPS
5976 #    define SvREFCNT_inc_simple(sv)     \
5977       ({                                        \
5978           if (sv)                               \
5979                (SvREFCNT(sv))++;                \
5980           (SV *)(sv);                           \
5981       })
5982 #  else
5983 #    define SvREFCNT_inc_simple(sv) \
5984           ((sv) ? (SvREFCNT(sv)++,(SV*)(sv)) : NULL)
5985 #  endif
5986 #endif
5987
5988 #ifndef SvREFCNT_inc_NN
5989 #  ifdef PERL_USE_GCC_BRACE_GROUPS
5990 #    define SvREFCNT_inc_NN(sv)         \
5991       ({                                        \
5992           SV * const _sv = (SV*)(sv);   \
5993           SvREFCNT(_sv)++;              \
5994           _sv;                          \
5995       })
5996 #  else
5997 #    define SvREFCNT_inc_NN(sv) \
5998           (PL_Sv=(SV*)(sv),++(SvREFCNT(PL_Sv)),PL_Sv)
5999 #  endif
6000 #endif
6001
6002 #ifndef SvREFCNT_inc_void
6003 #  ifdef PERL_USE_GCC_BRACE_GROUPS
6004 #    define SvREFCNT_inc_void(sv)               \
6005       ({                                        \
6006           SV * const _sv = (SV*)(sv);   \
6007           if (_sv)                      \
6008               (void)(SvREFCNT(_sv)++);  \
6009       })
6010 #  else
6011 #    define SvREFCNT_inc_void(sv) \
6012           (void)((PL_Sv=(SV*)(sv)) ? ++(SvREFCNT(PL_Sv)) : 0)
6013 #  endif
6014 #endif
6015 #ifndef SvREFCNT_inc_simple_void
6016 #  define SvREFCNT_inc_simple_void(sv)   STMT_START { if (sv) SvREFCNT(sv)++; } STMT_END
6017 #endif
6018
6019 #ifndef SvREFCNT_inc_simple_NN
6020 #  define SvREFCNT_inc_simple_NN(sv)     (++SvREFCNT(sv), (SV*)(sv))
6021 #endif
6022
6023 #ifndef SvREFCNT_inc_void_NN
6024 #  define SvREFCNT_inc_void_NN(sv)       (void)(++SvREFCNT((SV*)(sv)))
6025 #endif
6026
6027 #ifndef SvREFCNT_inc_simple_void_NN
6028 #  define SvREFCNT_inc_simple_void_NN(sv) (void)(++SvREFCNT((SV*)(sv)))
6029 #endif
6030
6031 #ifndef newSV_type
6032
6033 #if defined(NEED_newSV_type)
6034 static SV* DPPP_(my_newSV_type)(pTHX_ svtype const t);
6035 static
6036 #else
6037 extern SV* DPPP_(my_newSV_type)(pTHX_ svtype const t);
6038 #endif
6039
6040 #ifdef newSV_type
6041 #  undef newSV_type
6042 #endif
6043 #define newSV_type(a) DPPP_(my_newSV_type)(aTHX_ a)
6044 #define Perl_newSV_type DPPP_(my_newSV_type)
6045
6046 #if defined(NEED_newSV_type) || defined(NEED_newSV_type_GLOBAL)
6047
6048 SV*
6049 DPPP_(my_newSV_type)(pTHX_ svtype const t)
6050 {
6051   SV* const sv = newSV(0);
6052   sv_upgrade(sv, t);
6053   return sv;
6054 }
6055
6056 #endif
6057
6058 #endif
6059
6060 #if (PERL_BCDVERSION < 0x5006000)
6061 # define D_PPP_CONSTPV_ARG(x)  ((char *) (x))
6062 #else
6063 # define D_PPP_CONSTPV_ARG(x)  (x)
6064 #endif
6065 #ifndef newSVpvn
6066 #  define newSVpvn(data,len)             ((data)                                              \
6067                                     ? ((len) ? newSVpv((data), (len)) : newSVpv("", 0)) \
6068                                     : newSV(0))
6069 #endif
6070 #ifndef newSVpvn_utf8
6071 #  define newSVpvn_utf8(s, len, u)       newSVpvn_flags((s), (len), (u) ? SVf_UTF8 : 0)
6072 #endif
6073 #ifndef SVf_UTF8
6074 #  define SVf_UTF8                       0
6075 #endif
6076
6077 #ifndef newSVpvn_flags
6078
6079 #if defined(NEED_newSVpvn_flags)
6080 static SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags);
6081 static
6082 #else
6083 extern SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags);
6084 #endif
6085
6086 #ifdef newSVpvn_flags
6087 #  undef newSVpvn_flags
6088 #endif
6089 #define newSVpvn_flags(a,b,c) DPPP_(my_newSVpvn_flags)(aTHX_ a,b,c)
6090 #define Perl_newSVpvn_flags DPPP_(my_newSVpvn_flags)
6091
6092 #if defined(NEED_newSVpvn_flags) || defined(NEED_newSVpvn_flags_GLOBAL)
6093
6094 SV *
6095 DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags)
6096 {
6097   SV *sv = newSVpvn(D_PPP_CONSTPV_ARG(s), len);
6098   SvFLAGS(sv) |= (flags & SVf_UTF8);
6099   return (flags & SVs_TEMP) ? sv_2mortal(sv) : sv;
6100 }
6101
6102 #endif
6103
6104 #endif
6105
6106 /* Backwards compatibility stuff... :-( */
6107 #if !defined(NEED_sv_2pv_flags) && defined(NEED_sv_2pv_nolen)
6108 #  define NEED_sv_2pv_flags
6109 #endif
6110 #if !defined(NEED_sv_2pv_flags_GLOBAL) && defined(NEED_sv_2pv_nolen_GLOBAL)
6111 #  define NEED_sv_2pv_flags_GLOBAL
6112 #endif
6113
6114 /* Hint: sv_2pv_nolen
6115  * Use the SvPV_nolen() or SvPV_nolen_const() macros instead of sv_2pv_nolen().
6116  */
6117 #ifndef sv_2pv_nolen
6118 #  define sv_2pv_nolen(sv)               SvPV_nolen(sv)
6119 #endif
6120
6121 #ifdef SvPVbyte
6122
6123 /* Hint: SvPVbyte
6124  * Does not work in perl-5.6.1, ppport.h implements a version
6125  * borrowed from perl-5.7.3.
6126  */
6127
6128 #if (PERL_BCDVERSION < 0x5007000)
6129
6130 #if defined(NEED_sv_2pvbyte)
6131 static char * DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp);
6132 static
6133 #else
6134 extern char * DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp);
6135 #endif
6136
6137 #ifdef sv_2pvbyte
6138 #  undef sv_2pvbyte
6139 #endif
6140 #define sv_2pvbyte(a,b) DPPP_(my_sv_2pvbyte)(aTHX_ a,b)
6141 #define Perl_sv_2pvbyte DPPP_(my_sv_2pvbyte)
6142
6143 #if defined(NEED_sv_2pvbyte) || defined(NEED_sv_2pvbyte_GLOBAL)
6144
6145 char *
6146 DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp)
6147 {
6148   sv_utf8_downgrade(sv,0);
6149   return SvPV(sv,*lp);
6150 }
6151
6152 #endif
6153
6154 /* Hint: sv_2pvbyte
6155  * Use the SvPVbyte() macro instead of sv_2pvbyte().
6156  */
6157
6158 #undef SvPVbyte
6159
6160 #define SvPVbyte(sv, lp)                                                \
6161         ((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK)                \
6162          ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pvbyte(sv, &lp))
6163
6164 #endif
6165
6166 #else
6167
6168 #  define SvPVbyte          SvPV
6169 #  define sv_2pvbyte        sv_2pv
6170
6171 #endif
6172 #ifndef sv_2pvbyte_nolen
6173 #  define sv_2pvbyte_nolen(sv)           sv_2pv_nolen(sv)
6174 #endif
6175
6176 /* Hint: sv_pvn
6177  * Always use the SvPV() macro instead of sv_pvn().
6178  */
6179
6180 /* Hint: sv_pvn_force
6181  * Always use the SvPV_force() macro instead of sv_pvn_force().
6182  */
6183
6184 /* If these are undefined, they're not handled by the core anyway */
6185 #ifndef SV_IMMEDIATE_UNREF
6186 #  define SV_IMMEDIATE_UNREF             0
6187 #endif
6188
6189 #ifndef SV_GMAGIC
6190 #  define SV_GMAGIC                      0
6191 #endif
6192
6193 #ifndef SV_COW_DROP_PV
6194 #  define SV_COW_DROP_PV                 0
6195 #endif
6196
6197 #ifndef SV_UTF8_NO_ENCODING
6198 #  define SV_UTF8_NO_ENCODING            0
6199 #endif
6200
6201 #ifndef SV_NOSTEAL
6202 #  define SV_NOSTEAL                     0
6203 #endif
6204
6205 #ifndef SV_CONST_RETURN
6206 #  define SV_CONST_RETURN                0
6207 #endif
6208
6209 #ifndef SV_MUTABLE_RETURN
6210 #  define SV_MUTABLE_RETURN              0
6211 #endif
6212
6213 #ifndef SV_SMAGIC
6214 #  define SV_SMAGIC                      0
6215 #endif
6216
6217 #ifndef SV_HAS_TRAILING_NUL
6218 #  define SV_HAS_TRAILING_NUL            0
6219 #endif
6220
6221 #ifndef SV_COW_SHARED_HASH_KEYS
6222 #  define SV_COW_SHARED_HASH_KEYS        0
6223 #endif
6224
6225 #if (PERL_BCDVERSION < 0x5007002)
6226
6227 #if defined(NEED_sv_2pv_flags)
6228 static char * DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
6229 static
6230 #else
6231 extern char * DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
6232 #endif
6233
6234 #ifdef sv_2pv_flags
6235 #  undef sv_2pv_flags
6236 #endif
6237 #define sv_2pv_flags(a,b,c) DPPP_(my_sv_2pv_flags)(aTHX_ a,b,c)
6238 #define Perl_sv_2pv_flags DPPP_(my_sv_2pv_flags)
6239
6240 #if defined(NEED_sv_2pv_flags) || defined(NEED_sv_2pv_flags_GLOBAL)
6241
6242 char *
6243 DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags)
6244 {
6245   STRLEN n_a = (STRLEN) flags;
6246   return sv_2pv(sv, lp ? lp : &n_a);
6247 }
6248
6249 #endif
6250
6251 #if defined(NEED_sv_pvn_force_flags)
6252 static char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
6253 static
6254 #else
6255 extern char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
6256 #endif
6257
6258 #ifdef sv_pvn_force_flags
6259 #  undef sv_pvn_force_flags
6260 #endif
6261 #define sv_pvn_force_flags(a,b,c) DPPP_(my_sv_pvn_force_flags)(aTHX_ a,b,c)
6262 #define Perl_sv_pvn_force_flags DPPP_(my_sv_pvn_force_flags)
6263
6264 #if defined(NEED_sv_pvn_force_flags) || defined(NEED_sv_pvn_force_flags_GLOBAL)
6265
6266 char *
6267 DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags)
6268 {
6269   STRLEN n_a = (STRLEN) flags;
6270   return sv_pvn_force(sv, lp ? lp : &n_a);
6271 }
6272
6273 #endif
6274
6275 #endif
6276
6277 #if (PERL_BCDVERSION < 0x5008008) || ( (PERL_BCDVERSION >= 0x5009000) && (PERL_BCDVERSION < 0x5009003) )
6278 # define DPPP_SVPV_NOLEN_LP_ARG &PL_na
6279 #else
6280 # define DPPP_SVPV_NOLEN_LP_ARG 0
6281 #endif
6282 #ifndef SvPV_const
6283 #  define SvPV_const(sv, lp)             SvPV_flags_const(sv, lp, SV_GMAGIC)
6284 #endif
6285
6286 #ifndef SvPV_mutable
6287 #  define SvPV_mutable(sv, lp)           SvPV_flags_mutable(sv, lp, SV_GMAGIC)
6288 #endif
6289 #ifndef SvPV_flags
6290 #  define SvPV_flags(sv, lp, flags)      \
6291                  ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
6292                   ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pv_flags(sv, &lp, flags))
6293 #endif
6294 #ifndef SvPV_flags_const
6295 #  define SvPV_flags_const(sv, lp, flags) \
6296                  ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
6297                   ? ((lp = SvCUR(sv)), SvPVX_const(sv)) : \
6298                   (const char*) sv_2pv_flags(sv, &lp, flags|SV_CONST_RETURN))
6299 #endif
6300 #ifndef SvPV_flags_const_nolen
6301 #  define SvPV_flags_const_nolen(sv, flags) \
6302                  ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
6303                   ? SvPVX_const(sv) : \
6304                   (const char*) sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, flags|SV_CONST_RETURN))
6305 #endif
6306 #ifndef SvPV_flags_mutable
6307 #  define SvPV_flags_mutable(sv, lp, flags) \
6308                  ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
6309                   ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) : \
6310                   sv_2pv_flags(sv, &lp, flags|SV_MUTABLE_RETURN))
6311 #endif
6312 #ifndef SvPV_force
6313 #  define SvPV_force(sv, lp)             SvPV_force_flags(sv, lp, SV_GMAGIC)
6314 #endif
6315
6316 #ifndef SvPV_force_nolen
6317 #  define SvPV_force_nolen(sv)           SvPV_force_flags_nolen(sv, SV_GMAGIC)
6318 #endif
6319
6320 #ifndef SvPV_force_mutable
6321 #  define SvPV_force_mutable(sv, lp)     SvPV_force_flags_mutable(sv, lp, SV_GMAGIC)
6322 #endif
6323
6324 #ifndef SvPV_force_nomg
6325 #  define SvPV_force_nomg(sv, lp)        SvPV_force_flags(sv, lp, 0)
6326 #endif
6327
6328 #ifndef SvPV_force_nomg_nolen
6329 #  define SvPV_force_nomg_nolen(sv)      SvPV_force_flags_nolen(sv, 0)
6330 #endif
6331 #ifndef SvPV_force_flags
6332 #  define SvPV_force_flags(sv, lp, flags) \
6333                  ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
6334                  ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_pvn_force_flags(sv, &lp, flags))
6335 #endif
6336 #ifndef SvPV_force_flags_nolen
6337 #  define SvPV_force_flags_nolen(sv, flags) \
6338                  ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
6339                  ? SvPVX(sv) : sv_pvn_force_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, flags))
6340 #endif
6341 #ifndef SvPV_force_flags_mutable
6342 #  define SvPV_force_flags_mutable(sv, lp, flags) \
6343                  ((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \
6344                  ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) \
6345                   : sv_pvn_force_flags(sv, &lp, flags|SV_MUTABLE_RETURN))
6346 #endif
6347 #ifndef SvPV_nolen
6348 #  define SvPV_nolen(sv)                 \
6349                  ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
6350                   ? SvPVX(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC))
6351 #endif
6352 #ifndef SvPV_nolen_const
6353 #  define SvPV_nolen_const(sv)           \
6354                  ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
6355                   ? SvPVX_const(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC|SV_CONST_RETURN))
6356 #endif
6357 #ifndef SvPV_nomg
6358 #  define SvPV_nomg(sv, lp)              SvPV_flags(sv, lp, 0)
6359 #endif
6360
6361 #ifndef SvPV_nomg_const
6362 #  define SvPV_nomg_const(sv, lp)        SvPV_flags_const(sv, lp, 0)
6363 #endif
6364
6365 #ifndef SvPV_nomg_const_nolen
6366 #  define SvPV_nomg_const_nolen(sv)      SvPV_flags_const_nolen(sv, 0)
6367 #endif
6368
6369 #ifndef SvPV_nomg_nolen
6370 #  define SvPV_nomg_nolen(sv)            ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \
6371                                     ? SvPVX(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, 0))
6372 #endif
6373 #ifndef SvPV_renew
6374 #  define SvPV_renew(sv,n)               STMT_START { SvLEN_set(sv, n); \
6375                  SvPV_set((sv), (char *) saferealloc(          \
6376                        (Malloc_t)SvPVX(sv), (MEM_SIZE)((n)))); \
6377                } STMT_END
6378 #endif
6379 #ifndef SvMAGIC_set
6380 #  define SvMAGIC_set(sv, val)           \
6381                 STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
6382                 (((XPVMG*) SvANY(sv))->xmg_magic = (val)); } STMT_END
6383 #endif
6384
6385 #if (PERL_BCDVERSION < 0x5009003)
6386 #ifndef SvPVX_const
6387 #  define SvPVX_const(sv)                ((const char*) (0 + SvPVX(sv)))
6388 #endif
6389
6390 #ifndef SvPVX_mutable
6391 #  define SvPVX_mutable(sv)              (0 + SvPVX(sv))
6392 #endif
6393 #ifndef SvRV_set
6394 #  define SvRV_set(sv, val)              \
6395                 STMT_START { assert(SvTYPE(sv) >=  SVt_RV); \
6396                 (((XRV*) SvANY(sv))->xrv_rv = (val)); } STMT_END
6397 #endif
6398
6399 #else
6400 #ifndef SvPVX_const
6401 #  define SvPVX_const(sv)                ((const char*)((sv)->sv_u.svu_pv))
6402 #endif
6403
6404 #ifndef SvPVX_mutable
6405 #  define SvPVX_mutable(sv)              ((sv)->sv_u.svu_pv)
6406 #endif
6407 #ifndef SvRV_set
6408 #  define SvRV_set(sv, val)              \
6409                 STMT_START { assert(SvTYPE(sv) >=  SVt_RV); \
6410                 ((sv)->sv_u.svu_rv = (val)); } STMT_END
6411 #endif
6412
6413 #endif
6414 #ifndef SvSTASH_set
6415 #  define SvSTASH_set(sv, val)           \
6416                 STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \
6417                 (((XPVMG*) SvANY(sv))->xmg_stash = (val)); } STMT_END
6418 #endif
6419
6420 #if (PERL_BCDVERSION < 0x5004000)
6421 #ifndef SvUV_set
6422 #  define SvUV_set(sv, val)              \
6423                 STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \
6424                 (((XPVIV*) SvANY(sv))->xiv_iv = (IV) (val)); } STMT_END
6425 #endif
6426
6427 #else
6428 #ifndef SvUV_set
6429 #  define SvUV_set(sv, val)              \
6430                 STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \
6431                 (((XPVUV*) SvANY(sv))->xuv_uv = (val)); } STMT_END
6432 #endif
6433
6434 #endif
6435
6436 #if (PERL_BCDVERSION >= 0x5004000) && !defined(vnewSVpvf)
6437 #if defined(NEED_vnewSVpvf)
6438 static SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args);
6439 static
6440 #else
6441 extern SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args);
6442 #endif
6443
6444 #ifdef vnewSVpvf
6445 #  undef vnewSVpvf
6446 #endif
6447 #define vnewSVpvf(a,b) DPPP_(my_vnewSVpvf)(aTHX_ a,b)
6448 #define Perl_vnewSVpvf DPPP_(my_vnewSVpvf)
6449
6450 #if defined(NEED_vnewSVpvf) || defined(NEED_vnewSVpvf_GLOBAL)
6451
6452 SV *
6453 DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args)
6454 {
6455   register SV *sv = newSV(0);
6456   sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));
6457   return sv;
6458 }
6459
6460 #endif
6461 #endif
6462
6463 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf)
6464 #  define sv_vcatpvf(sv, pat, args)  sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*))
6465 #endif
6466
6467 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf)
6468 #  define sv_vsetpvf(sv, pat, args)  sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*))
6469 #endif
6470
6471 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg)
6472 #if defined(NEED_sv_catpvf_mg)
6473 static void DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
6474 static
6475 #else
6476 extern void DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
6477 #endif
6478
6479 #define Perl_sv_catpvf_mg DPPP_(my_sv_catpvf_mg)
6480
6481 #if defined(NEED_sv_catpvf_mg) || defined(NEED_sv_catpvf_mg_GLOBAL)
6482
6483 void
6484 DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...)
6485 {
6486   va_list args;
6487   va_start(args, pat);
6488   sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
6489   SvSETMAGIC(sv);
6490   va_end(args);
6491 }
6492
6493 #endif
6494 #endif
6495
6496 #ifdef PERL_IMPLICIT_CONTEXT
6497 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg_nocontext)
6498 #if defined(NEED_sv_catpvf_mg_nocontext)
6499 static void DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...);
6500 static
6501 #else
6502 extern void DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...);
6503 #endif
6504
6505 #define sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext)
6506 #define Perl_sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext)
6507
6508 #if defined(NEED_sv_catpvf_mg_nocontext) || defined(NEED_sv_catpvf_mg_nocontext_GLOBAL)
6509
6510 void
6511 DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...)
6512 {
6513   dTHX;
6514   va_list args;
6515   va_start(args, pat);
6516   sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
6517   SvSETMAGIC(sv);
6518   va_end(args);
6519 }
6520
6521 #endif
6522 #endif
6523 #endif
6524
6525 /* sv_catpvf_mg depends on sv_catpvf_mg_nocontext */
6526 #ifndef sv_catpvf_mg
6527 #  ifdef PERL_IMPLICIT_CONTEXT
6528 #    define sv_catpvf_mg   Perl_sv_catpvf_mg_nocontext
6529 #  else
6530 #    define sv_catpvf_mg   Perl_sv_catpvf_mg
6531 #  endif
6532 #endif
6533
6534 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf_mg)
6535 #  define sv_vcatpvf_mg(sv, pat, args)                                     \
6536    STMT_START {                                                            \
6537      sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));  \
6538      SvSETMAGIC(sv);                                                       \
6539    } STMT_END
6540 #endif
6541
6542 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg)
6543 #if defined(NEED_sv_setpvf_mg)
6544 static void DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
6545 static
6546 #else
6547 extern void DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...);
6548 #endif
6549
6550 #define Perl_sv_setpvf_mg DPPP_(my_sv_setpvf_mg)
6551
6552 #if defined(NEED_sv_setpvf_mg) || defined(NEED_sv_setpvf_mg_GLOBAL)
6553
6554 void
6555 DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...)
6556 {
6557   va_list args;
6558   va_start(args, pat);
6559   sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
6560   SvSETMAGIC(sv);
6561   va_end(args);
6562 }
6563
6564 #endif
6565 #endif
6566
6567 #ifdef PERL_IMPLICIT_CONTEXT
6568 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg_nocontext)
6569 #if defined(NEED_sv_setpvf_mg_nocontext)
6570 static void DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...);
6571 static
6572 #else
6573 extern void DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...);
6574 #endif
6575
6576 #define sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext)
6577 #define Perl_sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext)
6578
6579 #if defined(NEED_sv_setpvf_mg_nocontext) || defined(NEED_sv_setpvf_mg_nocontext_GLOBAL)
6580
6581 void
6582 DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...)
6583 {
6584   dTHX;
6585   va_list args;
6586   va_start(args, pat);
6587   sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*));
6588   SvSETMAGIC(sv);
6589   va_end(args);
6590 }
6591
6592 #endif
6593 #endif
6594 #endif
6595
6596 /* sv_setpvf_mg depends on sv_setpvf_mg_nocontext */
6597 #ifndef sv_setpvf_mg
6598 #  ifdef PERL_IMPLICIT_CONTEXT
6599 #    define sv_setpvf_mg   Perl_sv_setpvf_mg_nocontext
6600 #  else
6601 #    define sv_setpvf_mg   Perl_sv_setpvf_mg
6602 #  endif
6603 #endif
6604
6605 #if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf_mg)
6606 #  define sv_vsetpvf_mg(sv, pat, args)                                     \
6607    STMT_START {                                                            \
6608      sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));  \
6609      SvSETMAGIC(sv);                                                       \
6610    } STMT_END
6611 #endif
6612
6613 /* Hint: newSVpvn_share
6614  * The SVs created by this function only mimic the behaviour of
6615  * shared PVs without really being shared. Only use if you know
6616  * what you're doing.
6617  */
6618
6619 #ifndef newSVpvn_share
6620
6621 #if defined(NEED_newSVpvn_share)
6622 static SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash);
6623 static
6624 #else
6625 extern SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash);
6626 #endif
6627
6628 #ifdef newSVpvn_share
6629 #  undef newSVpvn_share
6630 #endif
6631 #define newSVpvn_share(a,b,c) DPPP_(my_newSVpvn_share)(aTHX_ a,b,c)
6632 #define Perl_newSVpvn_share DPPP_(my_newSVpvn_share)
6633
6634 #if defined(NEED_newSVpvn_share) || defined(NEED_newSVpvn_share_GLOBAL)
6635
6636 SV *
6637 DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash)
6638 {
6639   SV *sv;
6640   if (len < 0)
6641     len = -len;
6642   if (!hash)
6643     PERL_HASH(hash, (char*) src, len);
6644   sv = newSVpvn((char *) src, len);
6645   sv_upgrade(sv, SVt_PVIV);
6646   SvIVX(sv) = hash;
6647   SvREADONLY_on(sv);
6648   SvPOK_on(sv);
6649   return sv;
6650 }
6651
6652 #endif
6653
6654 #endif
6655 #ifndef SvSHARED_HASH
6656 #  define SvSHARED_HASH(sv)              (0 + SvUVX(sv))
6657 #endif
6658 #ifndef HvNAME_get
6659 #  define HvNAME_get(hv)                 HvNAME(hv)
6660 #endif
6661 #ifndef HvNAMELEN_get
6662 #  define HvNAMELEN_get(hv)              (HvNAME_get(hv) ? (I32)strlen(HvNAME_get(hv)) : 0)
6663 #endif
6664
6665 #ifndef gv_fetchpvn_flags
6666 #if defined(NEED_gv_fetchpvn_flags)
6667 static GV* DPPP_(my_gv_fetchpvn_flags)(pTHX_ const char* name, STRLEN len, int flags, int types);
6668 static
6669 #else
6670 extern GV* DPPP_(my_gv_fetchpvn_flags)(pTHX_ const char* name, STRLEN len, int flags, int types);
6671 #endif
6672
6673 #ifdef gv_fetchpvn_flags
6674 #  undef gv_fetchpvn_flags
6675 #endif
6676 #define gv_fetchpvn_flags(a,b,c,d) DPPP_(my_gv_fetchpvn_flags)(aTHX_ a,b,c,d)
6677 #define Perl_gv_fetchpvn_flags DPPP_(my_gv_fetchpvn_flags)
6678
6679 #if defined(NEED_gv_fetchpvn_flags) || defined(NEED_gv_fetchpvn_flags_GLOBAL)
6680
6681 GV*
6682 DPPP_(my_gv_fetchpvn_flags)(pTHX_ const char* name, STRLEN len, int flags, int types) {
6683         char *namepv = savepvn(name, len);
6684         GV* stash = gv_fetchpv(namepv, TRUE, SVt_PVHV);
6685         Safefree(namepv);
6686         return stash;
6687 }
6688
6689 #endif
6690 #endif
6691 #ifndef GvSVn
6692 #  define GvSVn(gv)                      GvSV(gv)
6693 #endif
6694
6695 #ifndef isGV_with_GP
6696 #  define isGV_with_GP(gv)               isGV(gv)
6697 #endif
6698
6699 #ifndef gv_fetchsv
6700 #  define gv_fetchsv(name, flags, svt)   gv_fetchpv(SvPV_nolen_const(name), flags, svt)
6701 #endif
6702 #ifndef get_cvn_flags
6703 #  define get_cvn_flags(name, namelen, flags) get_cv(name, flags)
6704 #endif
6705
6706 #ifndef gv_init_pvn
6707 #  define gv_init_pvn(gv, stash, ptr, len, flags) gv_init(gv, stash, ptr, len, flags & GV_ADDMULTI ? TRUE : FALSE)
6708 #endif
6709 #ifndef WARN_ALL
6710 #  define WARN_ALL                       0
6711 #endif
6712
6713 #ifndef WARN_CLOSURE
6714 #  define WARN_CLOSURE                   1
6715 #endif
6716
6717 #ifndef WARN_DEPRECATED
6718 #  define WARN_DEPRECATED                2
6719 #endif
6720
6721 #ifndef WARN_EXITING
6722 #  define WARN_EXITING                   3
6723 #endif
6724
6725 #ifndef WARN_GLOB
6726 #  define WARN_GLOB                      4
6727 #endif
6728
6729 #ifndef WARN_IO
6730 #  define WARN_IO                        5
6731 #endif
6732
6733 #ifndef WARN_CLOSED
6734 #  define WARN_CLOSED                    6
6735 #endif
6736
6737 #ifndef WARN_EXEC
6738 #  define WARN_EXEC                      7
6739 #endif
6740
6741 #ifndef WARN_LAYER
6742 #  define WARN_LAYER                     8
6743 #endif
6744
6745 #ifndef WARN_NEWLINE
6746 #  define WARN_NEWLINE                   9
6747 #endif
6748
6749 #ifndef WARN_PIPE
6750 #  define WARN_PIPE                      10
6751 #endif
6752
6753 #ifndef WARN_UNOPENED
6754 #  define WARN_UNOPENED                  11
6755 #endif
6756
6757 #ifndef WARN_MISC
6758 #  define WARN_MISC                      12
6759 #endif
6760
6761 #ifndef WARN_NUMERIC
6762 #  define WARN_NUMERIC                   13
6763 #endif
6764
6765 #ifndef WARN_ONCE
6766 #  define WARN_ONCE                      14
6767 #endif
6768
6769 #ifndef WARN_OVERFLOW
6770 #  define WARN_OVERFLOW                  15
6771 #endif
6772
6773 #ifndef WARN_PACK
6774 #  define WARN_PACK                      16
6775 #endif
6776
6777 #ifndef WARN_PORTABLE
6778 #  define WARN_PORTABLE                  17
6779 #endif
6780
6781 #ifndef WARN_RECURSION
6782 #  define WARN_RECURSION                 18
6783 #endif
6784
6785 #ifndef WARN_REDEFINE
6786 #  define WARN_REDEFINE                  19
6787 #endif
6788
6789 #ifndef WARN_REGEXP
6790 #  define WARN_REGEXP                    20
6791 #endif
6792
6793 #ifndef WARN_SEVERE
6794 #  define WARN_SEVERE                    21
6795 #endif
6796
6797 #ifndef WARN_DEBUGGING
6798 #  define WARN_DEBUGGING                 22
6799 #endif
6800
6801 #ifndef WARN_INPLACE
6802 #  define WARN_INPLACE                   23
6803 #endif
6804
6805 #ifndef WARN_INTERNAL
6806 #  define WARN_INTERNAL                  24
6807 #endif
6808
6809 #ifndef WARN_MALLOC
6810 #  define WARN_MALLOC                    25
6811 #endif
6812
6813 #ifndef WARN_SIGNAL
6814 #  define WARN_SIGNAL                    26
6815 #endif
6816
6817 #ifndef WARN_SUBSTR
6818 #  define WARN_SUBSTR                    27
6819 #endif
6820
6821 #ifndef WARN_SYNTAX
6822 #  define WARN_SYNTAX                    28
6823 #endif
6824
6825 #ifndef WARN_AMBIGUOUS
6826 #  define WARN_AMBIGUOUS                 29
6827 #endif
6828
6829 #ifndef WARN_BAREWORD
6830 #  define WARN_BAREWORD                  30
6831 #endif
6832
6833 #ifndef WARN_DIGIT
6834 #  define WARN_DIGIT                     31
6835 #endif
6836
6837 #ifndef WARN_PARENTHESIS
6838 #  define WARN_PARENTHESIS               32
6839 #endif
6840
6841 #ifndef WARN_PRECEDENCE
6842 #  define WARN_PRECEDENCE                33
6843 #endif
6844
6845 #ifndef WARN_PRINTF
6846 #  define WARN_PRINTF                    34
6847 #endif
6848
6849 #ifndef WARN_PROTOTYPE
6850 #  define WARN_PROTOTYPE                 35
6851 #endif
6852
6853 #ifndef WARN_QW
6854 #  define WARN_QW                        36
6855 #endif
6856
6857 #ifndef WARN_RESERVED
6858 #  define WARN_RESERVED                  37
6859 #endif
6860
6861 #ifndef WARN_SEMICOLON
6862 #  define WARN_SEMICOLON                 38
6863 #endif
6864
6865 #ifndef WARN_TAINT
6866 #  define WARN_TAINT                     39
6867 #endif
6868
6869 #ifndef WARN_THREADS
6870 #  define WARN_THREADS                   40
6871 #endif
6872
6873 #ifndef WARN_UNINITIALIZED
6874 #  define WARN_UNINITIALIZED             41
6875 #endif
6876
6877 #ifndef WARN_UNPACK
6878 #  define WARN_UNPACK                    42
6879 #endif
6880
6881 #ifndef WARN_UNTIE
6882 #  define WARN_UNTIE                     43
6883 #endif
6884
6885 #ifndef WARN_UTF8
6886 #  define WARN_UTF8                      44
6887 #endif
6888
6889 #ifndef WARN_VOID
6890 #  define WARN_VOID                      45
6891 #endif
6892
6893 #ifndef WARN_ASSERTIONS
6894 #  define WARN_ASSERTIONS                46
6895 #endif
6896 #ifndef packWARN
6897 #  define packWARN(a)                    (a)
6898 #endif
6899
6900 #ifndef ckWARN
6901 #  ifdef G_WARN_ON
6902 #    define  ckWARN(a)                  (PL_dowarn & G_WARN_ON)
6903 #  else
6904 #    define  ckWARN(a)                  PL_dowarn
6905 #  endif
6906 #endif
6907
6908 #if (PERL_BCDVERSION >= 0x5004000) && !defined(warner)
6909 #if defined(NEED_warner)
6910 static void DPPP_(my_warner)(U32 err, const char *pat, ...);
6911 static
6912 #else
6913 extern void DPPP_(my_warner)(U32 err, const char *pat, ...);
6914 #endif
6915
6916 #define Perl_warner DPPP_(my_warner)
6917
6918 #if defined(NEED_warner) || defined(NEED_warner_GLOBAL)
6919
6920 void
6921 DPPP_(my_warner)(U32 err, const char *pat, ...)
6922 {
6923   SV *sv;
6924   va_list args;
6925
6926   PERL_UNUSED_ARG(err);
6927
6928   va_start(args, pat);
6929   sv = vnewSVpvf(pat, &args);
6930   va_end(args);
6931   sv_2mortal(sv);
6932   warn("%s", SvPV_nolen(sv));
6933 }
6934
6935 #define warner  Perl_warner
6936
6937 #define Perl_warner_nocontext  Perl_warner
6938
6939 #endif
6940 #endif
6941
6942 /* concatenating with "" ensures that only literal strings are accepted as argument
6943  * note that STR_WITH_LEN() can't be used as argument to macros or functions that
6944  * under some configurations might be macros
6945  */
6946 #ifndef STR_WITH_LEN
6947 #  define STR_WITH_LEN(s)                (s ""), (sizeof(s)-1)
6948 #endif
6949 #ifndef newSVpvs
6950 #  define newSVpvs(str)                  newSVpvn(str "", sizeof(str) - 1)
6951 #endif
6952
6953 #ifndef newSVpvs_flags
6954 #  define newSVpvs_flags(str, flags)     newSVpvn_flags(str "", sizeof(str) - 1, flags)
6955 #endif
6956
6957 #ifndef newSVpvs_share
6958 #  define newSVpvs_share(str)            newSVpvn_share(str "", sizeof(str) - 1, 0)
6959 #endif
6960
6961 #ifndef sv_catpvs
6962 #  define sv_catpvs(sv, str)             sv_catpvn(sv, str "", sizeof(str) - 1)
6963 #endif
6964
6965 #ifndef sv_setpvs
6966 #  define sv_setpvs(sv, str)             sv_setpvn(sv, str "", sizeof(str) - 1)
6967 #endif
6968
6969 #ifndef hv_fetchs
6970 #  define hv_fetchs(hv, key, lval)       hv_fetch(hv, key "", sizeof(key) - 1, lval)
6971 #endif
6972
6973 #ifndef hv_stores
6974 #  define hv_stores(hv, key, val)        hv_store(hv, key "", sizeof(key) - 1, val, 0)
6975 #endif
6976 #ifndef gv_fetchpvs
6977 #  define gv_fetchpvs(name, flags, svt)  gv_fetchpvn_flags(name "", sizeof(name) - 1, flags, svt)
6978 #endif
6979
6980 #ifndef gv_stashpvs
6981 #  define gv_stashpvs(name, flags)       gv_stashpvn(name "", sizeof(name) - 1, flags)
6982 #endif
6983 #ifndef get_cvs
6984 #  define get_cvs(name, flags)           get_cvn_flags(name "", sizeof(name)-1, flags)
6985 #endif
6986
6987 #ifdef USE_ITHREADS
6988 #ifndef CopFILE
6989 #  define CopFILE(c)                     ((c)->cop_file)
6990 #endif
6991
6992 #ifndef CopFILEGV
6993 #  define CopFILEGV(c)                   (CopFILE(c) ? gv_fetchfile(CopFILE(c)) : Nullgv)
6994 #endif
6995
6996 #ifndef CopFILE_set
6997 #  define CopFILE_set(c,pv)              ((c)->cop_file = savepv(pv))
6998 #endif
6999
7000 #ifndef CopFILESV
7001 #  define CopFILESV(c)                   (CopFILE(c) ? GvSV(gv_fetchfile(CopFILE(c))) : Nullsv)
7002 #endif
7003
7004 #ifndef CopFILEAV
7005 #  define CopFILEAV(c)                   (CopFILE(c) ? GvAV(gv_fetchfile(CopFILE(c))) : Nullav)
7006 #endif
7007
7008 #ifndef CopSTASHPV
7009 #  define CopSTASHPV(c)                  ((c)->cop_stashpv)
7010 #endif
7011
7012 #ifndef CopSTASHPV_set
7013 #  define CopSTASHPV_set(c,pv)           ((c)->cop_stashpv = ((pv) ? savepv(pv) : Nullch))
7014 #endif
7015
7016 #ifndef CopSTASH
7017 #  define CopSTASH(c)                    (CopSTASHPV(c) ? gv_stashpv(CopSTASHPV(c),GV_ADD) : Nullhv)
7018 #endif
7019
7020 #ifndef CopSTASH_set
7021 #  define CopSTASH_set(c,hv)             CopSTASHPV_set(c, (hv) ? HvNAME(hv) : Nullch)
7022 #endif
7023
7024 #ifndef CopSTASH_eq
7025 #  define CopSTASH_eq(c,hv)              ((hv) && (CopSTASHPV(c) == HvNAME(hv) \
7026                                         || (CopSTASHPV(c) && HvNAME(hv) \
7027                                         && strEQ(CopSTASHPV(c), HvNAME(hv)))))
7028 #endif
7029
7030 #else
7031 #ifndef CopFILEGV
7032 #  define CopFILEGV(c)                   ((c)->cop_filegv)
7033 #endif
7034
7035 #ifndef CopFILEGV_set
7036 #  define CopFILEGV_set(c,gv)            ((c)->cop_filegv = (GV*)SvREFCNT_inc(gv))
7037 #endif
7038
7039 #ifndef CopFILE_set
7040 #  define CopFILE_set(c,pv)              CopFILEGV_set((c), gv_fetchfile(pv))
7041 #endif
7042
7043 #ifndef CopFILESV
7044 #  define CopFILESV(c)                   (CopFILEGV(c) ? GvSV(CopFILEGV(c)) : Nullsv)
7045 #endif
7046
7047 #ifndef CopFILEAV
7048 #  define CopFILEAV(c)                   (CopFILEGV(c) ? GvAV(CopFILEGV(c)) : Nullav)
7049 #endif
7050
7051 #ifndef CopFILE
7052 #  define CopFILE(c)                     (CopFILESV(c) ? SvPVX(CopFILESV(c)) : Nullch)
7053 #endif
7054
7055 #ifndef CopSTASH
7056 #  define CopSTASH(c)                    ((c)->cop_stash)
7057 #endif
7058
7059 #ifndef CopSTASH_set
7060 #  define CopSTASH_set(c,hv)             ((c)->cop_stash = (hv))
7061 #endif
7062
7063 #ifndef CopSTASHPV
7064 #  define CopSTASHPV(c)                  (CopSTASH(c) ? HvNAME(CopSTASH(c)) : Nullch)
7065 #endif
7066
7067 #ifndef CopSTASHPV_set
7068 #  define CopSTASHPV_set(c,pv)           CopSTASH_set((c), gv_stashpv(pv,GV_ADD))
7069 #endif
7070
7071 #ifndef CopSTASH_eq
7072 #  define CopSTASH_eq(c,hv)              (CopSTASH(c) == (hv))
7073 #endif
7074
7075 #endif /* USE_ITHREADS */
7076
7077 #if (PERL_BCDVERSION >= 0x5006000)
7078 #ifndef caller_cx
7079
7080 # if defined(NEED_caller_cx) || defined(NEED_caller_cx_GLOBAL)
7081 static I32
7082 DPPP_dopoptosub_at(const PERL_CONTEXT *cxstk, I32 startingblock)
7083 {
7084     I32 i;
7085
7086     for (i = startingblock; i >= 0; i--) {
7087         register const PERL_CONTEXT * const cx = &cxstk[i];
7088         switch (CxTYPE(cx)) {
7089         default:
7090             continue;
7091         case CXt_EVAL:
7092         case CXt_SUB:
7093         case CXt_FORMAT:
7094             return i;
7095         }
7096     }
7097     return i;
7098 }
7099 # endif
7100
7101 # if defined(NEED_caller_cx)
7102 static const PERL_CONTEXT * DPPP_(my_caller_cx)(pTHX_ I32 count, const PERL_CONTEXT **dbcxp);
7103 static
7104 #else
7105 extern const PERL_CONTEXT * DPPP_(my_caller_cx)(pTHX_ I32 count, const PERL_CONTEXT **dbcxp);
7106 #endif
7107
7108 #ifdef caller_cx
7109 #  undef caller_cx
7110 #endif
7111 #define caller_cx(a,b) DPPP_(my_caller_cx)(aTHX_ a,b)
7112 #define Perl_caller_cx DPPP_(my_caller_cx)
7113
7114 #if defined(NEED_caller_cx) || defined(NEED_caller_cx_GLOBAL)
7115
7116 const PERL_CONTEXT *
7117 DPPP_(my_caller_cx)(pTHX_ I32 count, const PERL_CONTEXT **dbcxp)
7118 {
7119     register I32 cxix = DPPP_dopoptosub_at(cxstack, cxstack_ix);
7120     register const PERL_CONTEXT *cx;
7121     register const PERL_CONTEXT *ccstack = cxstack;
7122     const PERL_SI *top_si = PL_curstackinfo;
7123
7124     for (;;) {
7125         /* we may be in a higher stacklevel, so dig down deeper */
7126         while (cxix < 0 && top_si->si_type != PERLSI_MAIN) {
7127             top_si = top_si->si_prev;
7128             ccstack = top_si->si_cxstack;
7129             cxix = DPPP_dopoptosub_at(ccstack, top_si->si_cxix);
7130         }
7131         if (cxix < 0)
7132             return NULL;
7133         /* caller() should not report the automatic calls to &DB::sub */
7134         if (PL_DBsub && GvCV(PL_DBsub) && cxix >= 0 &&
7135                 ccstack[cxix].blk_sub.cv == GvCV(PL_DBsub))
7136             count++;
7137         if (!count--)
7138             break;
7139         cxix = DPPP_dopoptosub_at(ccstack, cxix - 1);
7140     }
7141
7142     cx = &ccstack[cxix];
7143     if (dbcxp) *dbcxp = cx;
7144
7145     if (CxTYPE(cx) == CXt_SUB || CxTYPE(cx) == CXt_FORMAT) {
7146         const I32 dbcxix = DPPP_dopoptosub_at(ccstack, cxix - 1);
7147         /* We expect that ccstack[dbcxix] is CXt_SUB, anyway, the
7148            field below is defined for any cx. */
7149         /* caller() should not report the automatic calls to &DB::sub */
7150         if (PL_DBsub && GvCV(PL_DBsub) && dbcxix >= 0 && ccstack[dbcxix].blk_sub.cv == GvCV(PL_DBsub))
7151             cx = &ccstack[dbcxix];
7152     }
7153
7154     return cx;
7155 }
7156
7157 # endif
7158 #endif /* caller_cx */
7159 #endif /* 5.6.0 */
7160 #ifndef IN_PERL_COMPILETIME
7161 #  define IN_PERL_COMPILETIME            (PL_curcop == &PL_compiling)
7162 #endif
7163
7164 #ifndef IN_LOCALE_RUNTIME
7165 #  define IN_LOCALE_RUNTIME              (PL_curcop->op_private & HINT_LOCALE)
7166 #endif
7167
7168 #ifndef IN_LOCALE_COMPILETIME
7169 #  define IN_LOCALE_COMPILETIME          (PL_hints & HINT_LOCALE)
7170 #endif
7171
7172 #ifndef IN_LOCALE
7173 #  define IN_LOCALE                      (IN_PERL_COMPILETIME ? IN_LOCALE_COMPILETIME : IN_LOCALE_RUNTIME)
7174 #endif
7175 #ifndef IS_NUMBER_IN_UV
7176 #  define IS_NUMBER_IN_UV                0x01
7177 #endif
7178
7179 #ifndef IS_NUMBER_GREATER_THAN_UV_MAX
7180 #  define IS_NUMBER_GREATER_THAN_UV_MAX  0x02
7181 #endif
7182
7183 #ifndef IS_NUMBER_NOT_INT
7184 #  define IS_NUMBER_NOT_INT              0x04
7185 #endif
7186
7187 #ifndef IS_NUMBER_NEG
7188 #  define IS_NUMBER_NEG                  0x08
7189 #endif
7190
7191 #ifndef IS_NUMBER_INFINITY
7192 #  define IS_NUMBER_INFINITY             0x10
7193 #endif
7194
7195 #ifndef IS_NUMBER_NAN
7196 #  define IS_NUMBER_NAN                  0x20
7197 #endif
7198 #ifndef GROK_NUMERIC_RADIX
7199 #  define GROK_NUMERIC_RADIX(sp, send)   grok_numeric_radix(sp, send)
7200 #endif
7201 #ifndef PERL_SCAN_GREATER_THAN_UV_MAX
7202 #  define PERL_SCAN_GREATER_THAN_UV_MAX  0x02
7203 #endif
7204
7205 #ifndef PERL_SCAN_SILENT_ILLDIGIT
7206 #  define PERL_SCAN_SILENT_ILLDIGIT      0x04
7207 #endif
7208
7209 #ifndef PERL_SCAN_ALLOW_UNDERSCORES
7210 #  define PERL_SCAN_ALLOW_UNDERSCORES    0x01
7211 #endif
7212
7213 #ifndef PERL_SCAN_DISALLOW_PREFIX
7214 #  define PERL_SCAN_DISALLOW_PREFIX      0x02
7215 #endif
7216
7217 #ifndef grok_numeric_radix
7218 #if defined(NEED_grok_numeric_radix)
7219 static bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send);
7220 static
7221 #else
7222 extern bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send);
7223 #endif
7224
7225 #ifdef grok_numeric_radix
7226 #  undef grok_numeric_radix
7227 #endif
7228 #define grok_numeric_radix(a,b) DPPP_(my_grok_numeric_radix)(aTHX_ a,b)
7229 #define Perl_grok_numeric_radix DPPP_(my_grok_numeric_radix)
7230
7231 #if defined(NEED_grok_numeric_radix) || defined(NEED_grok_numeric_radix_GLOBAL)
7232 bool
7233 DPPP_(my_grok_numeric_radix)(pTHX_ const char **sp, const char *send)
7234 {
7235 #ifdef USE_LOCALE_NUMERIC
7236 #ifdef PL_numeric_radix_sv
7237     if (PL_numeric_radix_sv && IN_LOCALE) {
7238         STRLEN len;
7239         char* radix = SvPV(PL_numeric_radix_sv, len);
7240         if (*sp + len <= send && memEQ(*sp, radix, len)) {
7241             *sp += len;
7242             return TRUE;
7243         }
7244     }
7245 #else
7246     /* older perls don't have PL_numeric_radix_sv so the radix
7247      * must manually be requested from locale.h
7248      */
7249 #include <locale.h>
7250     dTHR;  /* needed for older threaded perls */
7251     struct lconv *lc = localeconv();
7252     char *radix = lc->decimal_point;
7253     if (radix && IN_LOCALE) {
7254         STRLEN len = strlen(radix);
7255         if (*sp + len <= send && memEQ(*sp, radix, len)) {
7256             *sp += len;
7257             return TRUE;
7258         }
7259     }
7260 #endif
7261 #endif /* USE_LOCALE_NUMERIC */
7262     /* always try "." if numeric radix didn't match because
7263      * we may have data from different locales mixed */
7264     if (*sp < send && **sp == '.') {
7265         ++*sp;
7266         return TRUE;
7267     }
7268     return FALSE;
7269 }
7270 #endif
7271 #endif
7272
7273 #ifndef grok_number
7274 #if defined(NEED_grok_number)
7275 static int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep);
7276 static
7277 #else
7278 extern int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep);
7279 #endif
7280
7281 #ifdef grok_number
7282 #  undef grok_number
7283 #endif
7284 #define grok_number(a,b,c) DPPP_(my_grok_number)(aTHX_ a,b,c)
7285 #define Perl_grok_number DPPP_(my_grok_number)
7286
7287 #if defined(NEED_grok_number) || defined(NEED_grok_number_GLOBAL)
7288 int
7289 DPPP_(my_grok_number)(pTHX_ const char *pv, STRLEN len, UV *valuep)
7290 {
7291   const char *s = pv;
7292   const char *send = pv + len;
7293   const UV max_div_10 = UV_MAX / 10;
7294   const char max_mod_10 = UV_MAX % 10;
7295   int numtype = 0;
7296   int sawinf = 0;
7297   int sawnan = 0;
7298
7299   while (s < send && isSPACE(*s))
7300     s++;
7301   if (s == send) {
7302     return 0;
7303   } else if (*s == '-') {
7304     s++;
7305     numtype = IS_NUMBER_NEG;
7306   }
7307   else if (*s == '+')
7308   s++;
7309
7310   if (s == send)
7311     return 0;
7312
7313   /* next must be digit or the radix separator or beginning of infinity */
7314   if (isDIGIT(*s)) {
7315     /* UVs are at least 32 bits, so the first 9 decimal digits cannot
7316        overflow.  */
7317     UV value = *s - '0';
7318     /* This construction seems to be more optimiser friendly.
7319        (without it gcc does the isDIGIT test and the *s - '0' separately)
7320        With it gcc on arm is managing 6 instructions (6 cycles) per digit.
7321        In theory the optimiser could deduce how far to unroll the loop
7322        before checking for overflow.  */
7323     if (++s < send) {
7324       int digit = *s - '0';
7325       if (digit >= 0 && digit <= 9) {
7326         value = value * 10 + digit;
7327         if (++s < send) {
7328           digit = *s - '0';
7329           if (digit >= 0 && digit <= 9) {
7330             value = value * 10 + digit;
7331             if (++s < send) {
7332               digit = *s - '0';
7333               if (digit >= 0 && digit <= 9) {
7334                 value = value * 10 + digit;
7335                 if (++s < send) {
7336                   digit = *s - '0';
7337                   if (digit >= 0 && digit <= 9) {
7338                     value = value * 10 + digit;
7339                     if (++s < send) {
7340                       digit = *s - '0';
7341                       if (digit >= 0 && digit <= 9) {
7342                         value = value * 10 + digit;
7343                         if (++s < send) {
7344                           digit = *s - '0';
7345                           if (digit >= 0 && digit <= 9) {
7346                             value = value * 10 + digit;
7347                             if (++s < send) {
7348                               digit = *s - '0';
7349                               if (digit >= 0 && digit <= 9) {
7350                                 value = value * 10 + digit;
7351                                 if (++s < send) {
7352                                   digit = *s - '0';
7353                                   if (digit >= 0 && digit <= 9) {
7354                                     value = value * 10 + digit;
7355                                     if (++s < send) {
7356                                       /* Now got 9 digits, so need to check
7357                                          each time for overflow.  */
7358                                       digit = *s - '0';
7359                                       while (digit >= 0 && digit <= 9
7360                                              && (value < max_div_10
7361                                                  || (value == max_div_10
7362                                                      && digit <= max_mod_10))) {
7363                                         value = value * 10 + digit;
7364                                         if (++s < send)
7365                                           digit = *s - '0';
7366                                         else
7367                                           break;
7368                                       }
7369                                       if (digit >= 0 && digit <= 9
7370                                           && (s < send)) {
7371                                         /* value overflowed.
7372                                            skip the remaining digits, don't
7373                                            worry about setting *valuep.  */
7374                                         do {
7375                                           s++;
7376                                         } while (s < send && isDIGIT(*s));
7377                                         numtype |=
7378                                           IS_NUMBER_GREATER_THAN_UV_MAX;
7379                                         goto skip_value;
7380                                       }
7381                                     }
7382                                   }
7383                                 }
7384                               }
7385                             }
7386                           }
7387                         }
7388                       }
7389                     }
7390                   }
7391                 }
7392               }
7393             }
7394           }
7395         }
7396       }
7397     }
7398     numtype |= IS_NUMBER_IN_UV;
7399     if (valuep)
7400       *valuep = value;
7401
7402   skip_value:
7403     if (GROK_NUMERIC_RADIX(&s, send)) {
7404       numtype |= IS_NUMBER_NOT_INT;
7405       while (s < send && isDIGIT(*s))  /* optional digits after the radix */
7406         s++;
7407     }
7408   }
7409   else if (GROK_NUMERIC_RADIX(&s, send)) {
7410     numtype |= IS_NUMBER_NOT_INT | IS_NUMBER_IN_UV; /* valuep assigned below */
7411     /* no digits before the radix means we need digits after it */
7412     if (s < send && isDIGIT(*s)) {
7413       do {
7414         s++;
7415       } while (s < send && isDIGIT(*s));
7416       if (valuep) {
7417         /* integer approximation is valid - it's 0.  */
7418         *valuep = 0;
7419       }
7420     }
7421     else
7422       return 0;
7423   } else if (*s == 'I' || *s == 'i') {
7424     s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
7425     s++; if (s == send || (*s != 'F' && *s != 'f')) return 0;
7426     s++; if (s < send && (*s == 'I' || *s == 'i')) {
7427       s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
7428       s++; if (s == send || (*s != 'I' && *s != 'i')) return 0;
7429       s++; if (s == send || (*s != 'T' && *s != 't')) return 0;
7430       s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0;
7431       s++;
7432     }
7433     sawinf = 1;
7434   } else if (*s == 'N' || *s == 'n') {
7435     /* XXX TODO: There are signaling NaNs and quiet NaNs. */
7436     s++; if (s == send || (*s != 'A' && *s != 'a')) return 0;
7437     s++; if (s == send || (*s != 'N' && *s != 'n')) return 0;
7438     s++;
7439     sawnan = 1;
7440   } else
7441     return 0;
7442
7443   if (sawinf) {
7444     numtype &= IS_NUMBER_NEG; /* Keep track of sign  */
7445     numtype |= IS_NUMBER_INFINITY | IS_NUMBER_NOT_INT;
7446   } else if (sawnan) {
7447     numtype &= IS_NUMBER_NEG; /* Keep track of sign  */
7448     numtype |= IS_NUMBER_NAN | IS_NUMBER_NOT_INT;
7449   } else if (s < send) {
7450     /* we can have an optional exponent part */
7451     if (*s == 'e' || *s == 'E') {
7452       /* The only flag we keep is sign.  Blow away any "it's UV"  */
7453       numtype &= IS_NUMBER_NEG;
7454       numtype |= IS_NUMBER_NOT_INT;
7455       s++;
7456       if (s < send && (*s == '-' || *s == '+'))
7457         s++;
7458       if (s < send && isDIGIT(*s)) {
7459         do {
7460           s++;
7461         } while (s < send && isDIGIT(*s));
7462       }
7463       else
7464       return 0;
7465     }
7466   }
7467   while (s < send && isSPACE(*s))
7468     s++;
7469   if (s >= send)
7470     return numtype;
7471   if (len == 10 && memEQ(pv, "0 but true", 10)) {
7472     if (valuep)
7473       *valuep = 0;
7474     return IS_NUMBER_IN_UV;
7475   }
7476   return 0;
7477 }
7478 #endif
7479 #endif
7480
7481 /*
7482  * The grok_* routines have been modified to use warn() instead of
7483  * Perl_warner(). Also, 'hexdigit' was the former name of PL_hexdigit,
7484  * which is why the stack variable has been renamed to 'xdigit'.
7485  */
7486
7487 #ifndef grok_bin
7488 #if defined(NEED_grok_bin)
7489 static UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
7490 static
7491 #else
7492 extern UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
7493 #endif
7494
7495 #ifdef grok_bin
7496 #  undef grok_bin
7497 #endif
7498 #define grok_bin(a,b,c,d) DPPP_(my_grok_bin)(aTHX_ a,b,c,d)
7499 #define Perl_grok_bin DPPP_(my_grok_bin)
7500
7501 #if defined(NEED_grok_bin) || defined(NEED_grok_bin_GLOBAL)
7502 UV
7503 DPPP_(my_grok_bin)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
7504 {
7505     const char *s = start;
7506     STRLEN len = *len_p;
7507     UV value = 0;
7508     NV value_nv = 0;
7509
7510     const UV max_div_2 = UV_MAX / 2;
7511     bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
7512     bool overflowed = FALSE;
7513
7514     if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) {
7515         /* strip off leading b or 0b.
7516            for compatibility silently suffer "b" and "0b" as valid binary
7517            numbers. */
7518         if (len >= 1) {
7519             if (s[0] == 'b') {
7520                 s++;
7521                 len--;
7522             }
7523             else if (len >= 2 && s[0] == '0' && s[1] == 'b') {
7524                 s+=2;
7525                 len-=2;
7526             }
7527         }
7528     }
7529
7530     for (; len-- && *s; s++) {
7531         char bit = *s;
7532         if (bit == '0' || bit == '1') {
7533             /* Write it in this wonky order with a goto to attempt to get the
7534                compiler to make the common case integer-only loop pretty tight.
7535                With gcc seems to be much straighter code than old scan_bin.  */
7536           redo:
7537             if (!overflowed) {
7538                 if (value <= max_div_2) {
7539                     value = (value << 1) | (bit - '0');
7540                     continue;
7541                 }
7542                 /* Bah. We're just overflowed.  */
7543                 warn("Integer overflow in binary number");
7544                 overflowed = TRUE;
7545                 value_nv = (NV) value;
7546             }
7547             value_nv *= 2.0;
7548             /* If an NV has not enough bits in its mantissa to
7549              * represent a UV this summing of small low-order numbers
7550              * is a waste of time (because the NV cannot preserve
7551              * the low-order bits anyway): we could just remember when
7552              * did we overflow and in the end just multiply value_nv by the
7553              * right amount. */
7554             value_nv += (NV)(bit - '0');
7555             continue;
7556         }
7557         if (bit == '_' && len && allow_underscores && (bit = s[1])
7558             && (bit == '0' || bit == '1'))
7559             {
7560                 --len;
7561                 ++s;
7562                 goto redo;
7563             }
7564         if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
7565             warn("Illegal binary digit '%c' ignored", *s);
7566         break;
7567     }
7568
7569     if (   ( overflowed && value_nv > 4294967295.0)
7570 #if UVSIZE > 4
7571         || (!overflowed && value > 0xffffffff  )
7572 #endif
7573         ) {
7574         warn("Binary number > 0b11111111111111111111111111111111 non-portable");
7575     }
7576     *len_p = s - start;
7577     if (!overflowed) {
7578         *flags = 0;
7579         return value;
7580     }
7581     *flags = PERL_SCAN_GREATER_THAN_UV_MAX;
7582     if (result)
7583         *result = value_nv;
7584     return UV_MAX;
7585 }
7586 #endif
7587 #endif
7588
7589 #ifndef grok_hex
7590 #if defined(NEED_grok_hex)
7591 static UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
7592 static
7593 #else
7594 extern UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
7595 #endif
7596
7597 #ifdef grok_hex
7598 #  undef grok_hex
7599 #endif
7600 #define grok_hex(a,b,c,d) DPPP_(my_grok_hex)(aTHX_ a,b,c,d)
7601 #define Perl_grok_hex DPPP_(my_grok_hex)
7602
7603 #if defined(NEED_grok_hex) || defined(NEED_grok_hex_GLOBAL)
7604 UV
7605 DPPP_(my_grok_hex)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
7606 {
7607     const char *s = start;
7608     STRLEN len = *len_p;
7609     UV value = 0;
7610     NV value_nv = 0;
7611
7612     const UV max_div_16 = UV_MAX / 16;
7613     bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
7614     bool overflowed = FALSE;
7615     const char *xdigit;
7616
7617     if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) {
7618         /* strip off leading x or 0x.
7619            for compatibility silently suffer "x" and "0x" as valid hex numbers.
7620         */
7621         if (len >= 1) {
7622             if (s[0] == 'x') {
7623                 s++;
7624                 len--;
7625             }
7626             else if (len >= 2 && s[0] == '0' && s[1] == 'x') {
7627                 s+=2;
7628                 len-=2;
7629             }
7630         }
7631     }
7632
7633     for (; len-- && *s; s++) {
7634         xdigit = strchr((char *) PL_hexdigit, *s);
7635         if (xdigit) {
7636             /* Write it in this wonky order with a goto to attempt to get the
7637                compiler to make the common case integer-only loop pretty tight.
7638                With gcc seems to be much straighter code than old scan_hex.  */
7639           redo:
7640             if (!overflowed) {
7641                 if (value <= max_div_16) {
7642                     value = (value << 4) | ((xdigit - PL_hexdigit) & 15);
7643                     continue;
7644                 }
7645                 warn("Integer overflow in hexadecimal number");
7646                 overflowed = TRUE;
7647                 value_nv = (NV) value;
7648             }
7649             value_nv *= 16.0;
7650             /* If an NV has not enough bits in its mantissa to
7651              * represent a UV this summing of small low-order numbers
7652              * is a waste of time (because the NV cannot preserve
7653              * the low-order bits anyway): we could just remember when
7654              * did we overflow and in the end just multiply value_nv by the
7655              * right amount of 16-tuples. */
7656             value_nv += (NV)((xdigit - PL_hexdigit) & 15);
7657             continue;
7658         }
7659         if (*s == '_' && len && allow_underscores && s[1]
7660                 && (xdigit = strchr((char *) PL_hexdigit, s[1])))
7661             {
7662                 --len;
7663                 ++s;
7664                 goto redo;
7665             }
7666         if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
7667             warn("Illegal hexadecimal digit '%c' ignored", *s);
7668         break;
7669     }
7670
7671     if (   ( overflowed && value_nv > 4294967295.0)
7672 #if UVSIZE > 4
7673         || (!overflowed && value > 0xffffffff  )
7674 #endif
7675         ) {
7676         warn("Hexadecimal number > 0xffffffff non-portable");
7677     }
7678     *len_p = s - start;
7679     if (!overflowed) {
7680         *flags = 0;
7681         return value;
7682     }
7683     *flags = PERL_SCAN_GREATER_THAN_UV_MAX;
7684     if (result)
7685         *result = value_nv;
7686     return UV_MAX;
7687 }
7688 #endif
7689 #endif
7690
7691 #ifndef grok_oct
7692 #if defined(NEED_grok_oct)
7693 static UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
7694 static
7695 #else
7696 extern UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
7697 #endif
7698
7699 #ifdef grok_oct
7700 #  undef grok_oct
7701 #endif
7702 #define grok_oct(a,b,c,d) DPPP_(my_grok_oct)(aTHX_ a,b,c,d)
7703 #define Perl_grok_oct DPPP_(my_grok_oct)
7704
7705 #if defined(NEED_grok_oct) || defined(NEED_grok_oct_GLOBAL)
7706 UV
7707 DPPP_(my_grok_oct)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
7708 {
7709     const char *s = start;
7710     STRLEN len = *len_p;
7711     UV value = 0;
7712     NV value_nv = 0;
7713
7714     const UV max_div_8 = UV_MAX / 8;
7715     bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES;
7716     bool overflowed = FALSE;
7717
7718     for (; len-- && *s; s++) {
7719          /* gcc 2.95 optimiser not smart enough to figure that this subtraction
7720             out front allows slicker code.  */
7721         int digit = *s - '0';
7722         if (digit >= 0 && digit <= 7) {
7723             /* Write it in this wonky order with a goto to attempt to get the
7724                compiler to make the common case integer-only loop pretty tight.
7725             */
7726           redo:
7727             if (!overflowed) {
7728                 if (value <= max_div_8) {
7729                     value = (value << 3) | digit;
7730                     continue;
7731                 }
7732                 /* Bah. We're just overflowed.  */
7733                 warn("Integer overflow in octal number");
7734                 overflowed = TRUE;
7735                 value_nv = (NV) value;
7736             }
7737             value_nv *= 8.0;
7738             /* If an NV has not enough bits in its mantissa to
7739              * represent a UV this summing of small low-order numbers
7740              * is a waste of time (because the NV cannot preserve
7741              * the low-order bits anyway): we could just remember when
7742              * did we overflow and in the end just multiply value_nv by the
7743              * right amount of 8-tuples. */
7744             value_nv += (NV)digit;
7745             continue;
7746         }
7747         if (digit == ('_' - '0') && len && allow_underscores
7748             && (digit = s[1] - '0') && (digit >= 0 && digit <= 7))
7749             {
7750                 --len;
7751                 ++s;
7752                 goto redo;
7753             }
7754         /* Allow \octal to work the DWIM way (that is, stop scanning
7755          * as soon as non-octal characters are seen, complain only iff
7756          * someone seems to want to use the digits eight and nine). */
7757         if (digit == 8 || digit == 9) {
7758             if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT))
7759                 warn("Illegal octal digit '%c' ignored", *s);
7760         }
7761         break;
7762     }
7763
7764     if (   ( overflowed && value_nv > 4294967295.0)
7765 #if UVSIZE > 4
7766         || (!overflowed && value > 0xffffffff  )
7767 #endif
7768         ) {
7769         warn("Octal number > 037777777777 non-portable");
7770     }
7771     *len_p = s - start;
7772     if (!overflowed) {
7773         *flags = 0;
7774         return value;
7775     }
7776     *flags = PERL_SCAN_GREATER_THAN_UV_MAX;
7777     if (result)
7778         *result = value_nv;
7779     return UV_MAX;
7780 }
7781 #endif
7782 #endif
7783
7784 #if !defined(my_snprintf)
7785 #if defined(NEED_my_snprintf)
7786 static int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...);
7787 static
7788 #else
7789 extern int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...);
7790 #endif
7791
7792 #define my_snprintf DPPP_(my_my_snprintf)
7793 #define Perl_my_snprintf DPPP_(my_my_snprintf)
7794
7795 #if defined(NEED_my_snprintf) || defined(NEED_my_snprintf_GLOBAL)
7796
7797 int
7798 DPPP_(my_my_snprintf)(char *buffer, const Size_t len, const char *format, ...)
7799 {
7800     dTHX;
7801     int retval;
7802     va_list ap;
7803     va_start(ap, format);
7804 #ifdef HAS_VSNPRINTF
7805     retval = vsnprintf(buffer, len, format, ap);
7806 #else
7807     retval = vsprintf(buffer, format, ap);
7808 #endif
7809     va_end(ap);
7810     if (retval < 0 || (len > 0 && (Size_t)retval >= len))
7811         Perl_croak(aTHX_ "panic: my_snprintf buffer overflow");
7812     return retval;
7813 }
7814
7815 #endif
7816 #endif
7817
7818 #if !defined(my_sprintf)
7819 #if defined(NEED_my_sprintf)
7820 static int DPPP_(my_my_sprintf)(char * buffer, const char * pat, ...);
7821 static
7822 #else
7823 extern int DPPP_(my_my_sprintf)(char * buffer, const char * pat, ...);
7824 #endif
7825
7826 #define my_sprintf DPPP_(my_my_sprintf)
7827 #define Perl_my_sprintf DPPP_(my_my_sprintf)
7828
7829 #if defined(NEED_my_sprintf) || defined(NEED_my_sprintf_GLOBAL)
7830
7831 int
7832 DPPP_(my_my_sprintf)(char *buffer, const char* pat, ...)
7833 {
7834     va_list args;
7835     va_start(args, pat);
7836     vsprintf(buffer, pat, args);
7837     va_end(args);
7838     return strlen(buffer);
7839 }
7840
7841 #endif
7842 #endif
7843
7844 #ifdef NO_XSLOCKS
7845 #  ifdef dJMPENV
7846 #    define dXCPT             dJMPENV; int rEtV = 0
7847 #    define XCPT_TRY_START    JMPENV_PUSH(rEtV); if (rEtV == 0)
7848 #    define XCPT_TRY_END      JMPENV_POP;
7849 #    define XCPT_CATCH        if (rEtV != 0)
7850 #    define XCPT_RETHROW      JMPENV_JUMP(rEtV)
7851 #  else
7852 #    define dXCPT             Sigjmp_buf oldTOP; int rEtV = 0
7853 #    define XCPT_TRY_START    Copy(top_env, oldTOP, 1, Sigjmp_buf); rEtV = Sigsetjmp(top_env, 1); if (rEtV == 0)
7854 #    define XCPT_TRY_END      Copy(oldTOP, top_env, 1, Sigjmp_buf);
7855 #    define XCPT_CATCH        if (rEtV != 0)
7856 #    define XCPT_RETHROW      Siglongjmp(top_env, rEtV)
7857 #  endif
7858 #endif
7859
7860 #if !defined(my_strlcat)
7861 #if defined(NEED_my_strlcat)
7862 static Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size);
7863 static
7864 #else
7865 extern Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size);
7866 #endif
7867
7868 #define my_strlcat DPPP_(my_my_strlcat)
7869 #define Perl_my_strlcat DPPP_(my_my_strlcat)
7870
7871 #if defined(NEED_my_strlcat) || defined(NEED_my_strlcat_GLOBAL)
7872
7873 Size_t
7874 DPPP_(my_my_strlcat)(char *dst, const char *src, Size_t size)
7875 {
7876     Size_t used, length, copy;
7877
7878     used = strlen(dst);
7879     length = strlen(src);
7880     if (size > 0 && used < size - 1) {
7881         copy = (length >= size - used) ? size - used - 1 : length;
7882         memcpy(dst + used, src, copy);
7883         dst[used + copy] = '\0';
7884     }
7885     return used + length;
7886 }
7887 #endif
7888 #endif
7889
7890 #if !defined(my_strlcpy)
7891 #if defined(NEED_my_strlcpy)
7892 static Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size);
7893 static
7894 #else
7895 extern Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size);
7896 #endif
7897
7898 #define my_strlcpy DPPP_(my_my_strlcpy)
7899 #define Perl_my_strlcpy DPPP_(my_my_strlcpy)
7900
7901 #if defined(NEED_my_strlcpy) || defined(NEED_my_strlcpy_GLOBAL)
7902
7903 Size_t
7904 DPPP_(my_my_strlcpy)(char *dst, const char *src, Size_t size)
7905 {
7906     Size_t length, copy;
7907
7908     length = strlen(src);
7909     if (size > 0) {
7910         copy = (length >= size) ? size - 1 : length;
7911         memcpy(dst, src, copy);
7912         dst[copy] = '\0';
7913     }
7914     return length;
7915 }
7916
7917 #endif
7918 #endif
7919 #ifndef PERL_PV_ESCAPE_QUOTE
7920 #  define PERL_PV_ESCAPE_QUOTE           0x0001
7921 #endif
7922
7923 #ifndef PERL_PV_PRETTY_QUOTE
7924 #  define PERL_PV_PRETTY_QUOTE           PERL_PV_ESCAPE_QUOTE
7925 #endif
7926
7927 #ifndef PERL_PV_PRETTY_ELLIPSES
7928 #  define PERL_PV_PRETTY_ELLIPSES        0x0002
7929 #endif
7930
7931 #ifndef PERL_PV_PRETTY_LTGT
7932 #  define PERL_PV_PRETTY_LTGT            0x0004
7933 #endif
7934
7935 #ifndef PERL_PV_ESCAPE_FIRSTCHAR
7936 #  define PERL_PV_ESCAPE_FIRSTCHAR       0x0008
7937 #endif
7938
7939 #ifndef PERL_PV_ESCAPE_UNI
7940 #  define PERL_PV_ESCAPE_UNI             0x0100
7941 #endif
7942
7943 #ifndef PERL_PV_ESCAPE_UNI_DETECT
7944 #  define PERL_PV_ESCAPE_UNI_DETECT      0x0200
7945 #endif
7946
7947 #ifndef PERL_PV_ESCAPE_ALL
7948 #  define PERL_PV_ESCAPE_ALL             0x1000
7949 #endif
7950
7951 #ifndef PERL_PV_ESCAPE_NOBACKSLASH
7952 #  define PERL_PV_ESCAPE_NOBACKSLASH     0x2000
7953 #endif
7954
7955 #ifndef PERL_PV_ESCAPE_NOCLEAR
7956 #  define PERL_PV_ESCAPE_NOCLEAR         0x4000
7957 #endif
7958
7959 #ifndef PERL_PV_ESCAPE_RE
7960 #  define PERL_PV_ESCAPE_RE              0x8000
7961 #endif
7962
7963 #ifndef PERL_PV_PRETTY_NOCLEAR
7964 #  define PERL_PV_PRETTY_NOCLEAR         PERL_PV_ESCAPE_NOCLEAR
7965 #endif
7966 #ifndef PERL_PV_PRETTY_DUMP
7967 #  define PERL_PV_PRETTY_DUMP            PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_QUOTE
7968 #endif
7969
7970 #ifndef PERL_PV_PRETTY_REGPROP
7971 #  define PERL_PV_PRETTY_REGPROP         PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_LTGT|PERL_PV_ESCAPE_RE
7972 #endif
7973
7974 /* Hint: pv_escape
7975  * Note that unicode functionality is only backported to
7976  * those perl versions that support it. For older perl
7977  * versions, the implementation will fall back to bytes.
7978  */
7979
7980 #ifndef pv_escape
7981 #if defined(NEED_pv_escape)
7982 static char * DPPP_(my_pv_escape)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, STRLEN * const escaped, const U32 flags);
7983 static
7984 #else
7985 extern char * DPPP_(my_pv_escape)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, STRLEN * const escaped, const U32 flags);
7986 #endif
7987
7988 #ifdef pv_escape
7989 #  undef pv_escape
7990 #endif
7991 #define pv_escape(a,b,c,d,e,f) DPPP_(my_pv_escape)(aTHX_ a,b,c,d,e,f)
7992 #define Perl_pv_escape DPPP_(my_pv_escape)
7993
7994 #if defined(NEED_pv_escape) || defined(NEED_pv_escape_GLOBAL)
7995
7996 char *
7997 DPPP_(my_pv_escape)(pTHX_ SV *dsv, char const * const str,
7998   const STRLEN count, const STRLEN max,
7999   STRLEN * const escaped, const U32 flags)
8000 {
8001     const char esc = flags & PERL_PV_ESCAPE_RE ? '%' : '\\';
8002     const char dq = flags & PERL_PV_ESCAPE_QUOTE ? '"' : esc;
8003     char octbuf[32] = "%123456789ABCDF";
8004     STRLEN wrote = 0;
8005     STRLEN chsize = 0;
8006     STRLEN readsize = 1;
8007 #if defined(is_utf8_string) && defined(utf8_to_uvchr)
8008     bool isuni = flags & PERL_PV_ESCAPE_UNI ? 1 : 0;
8009 #endif
8010     const char *pv  = str;
8011     const char * const end = pv + count;
8012     octbuf[0] = esc;
8013
8014     if (!(flags & PERL_PV_ESCAPE_NOCLEAR))
8015         sv_setpvs(dsv, "");
8016
8017 #if defined(is_utf8_string) && defined(utf8_to_uvchr)
8018     if ((flags & PERL_PV_ESCAPE_UNI_DETECT) && is_utf8_string((U8*)pv, count))
8019         isuni = 1;
8020 #endif
8021
8022     for (; pv < end && (!max || wrote < max) ; pv += readsize) {
8023         const UV u =
8024 #if defined(is_utf8_string) && defined(utf8_to_uvchr)
8025                      isuni ? utf8_to_uvchr((U8*)pv, &readsize) :
8026 #endif
8027                              (U8)*pv;
8028         const U8 c = (U8)u & 0xFF;
8029
8030         if (u > 255 || (flags & PERL_PV_ESCAPE_ALL)) {
8031             if (flags & PERL_PV_ESCAPE_FIRSTCHAR)
8032                 chsize = my_snprintf(octbuf, sizeof octbuf,
8033                                       "%" UVxf, u);
8034             else
8035                 chsize = my_snprintf(octbuf, sizeof octbuf,
8036                                       "%cx{%" UVxf "}", esc, u);
8037         } else if (flags & PERL_PV_ESCAPE_NOBACKSLASH) {
8038             chsize = 1;
8039         } else {
8040             if (c == dq || c == esc || !isPRINT(c)) {
8041                 chsize = 2;
8042                 switch (c) {
8043                 case '\\' : /* fallthrough */
8044                 case '%'  : if (c == esc)
8045                                 octbuf[1] = esc;
8046                             else
8047                                 chsize = 1;
8048                             break;
8049                 case '\v' : octbuf[1] = 'v'; break;
8050                 case '\t' : octbuf[1] = 't'; break;
8051                 case '\r' : octbuf[1] = 'r'; break;
8052                 case '\n' : octbuf[1] = 'n'; break;
8053                 case '\f' : octbuf[1] = 'f'; break;
8054                 case '"'  : if (dq == '"')
8055                                 octbuf[1] = '"';
8056                             else
8057                                 chsize = 1;
8058                             break;
8059                 default:    chsize = my_snprintf(octbuf, sizeof octbuf,
8060                                 pv < end && isDIGIT((U8)*(pv+readsize))
8061                                 ? "%c%03o" : "%c%o", esc, c);
8062                 }
8063             } else {
8064                 chsize = 1;
8065             }
8066         }
8067         if (max && wrote + chsize > max) {
8068             break;
8069         } else if (chsize > 1) {
8070             sv_catpvn(dsv, octbuf, chsize);
8071             wrote += chsize;
8072         } else {
8073             char tmp[2];
8074             my_snprintf(tmp, sizeof tmp, "%c", c);
8075             sv_catpvn(dsv, tmp, 1);
8076             wrote++;
8077         }
8078         if (flags & PERL_PV_ESCAPE_FIRSTCHAR)
8079             break;
8080     }
8081     if (escaped != NULL)
8082         *escaped= pv - str;
8083     return SvPVX(dsv);
8084 }
8085
8086 #endif
8087 #endif
8088
8089 #ifndef pv_pretty
8090 #if defined(NEED_pv_pretty)
8091 static char * DPPP_(my_pv_pretty)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, char const * const start_color, char const * const end_color, const U32 flags);
8092 static
8093 #else
8094 extern char * DPPP_(my_pv_pretty)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, char const * const start_color, char const * const end_color, const U32 flags);
8095 #endif
8096
8097 #ifdef pv_pretty
8098 #  undef pv_pretty
8099 #endif
8100 #define pv_pretty(a,b,c,d,e,f,g) DPPP_(my_pv_pretty)(aTHX_ a,b,c,d,e,f,g)
8101 #define Perl_pv_pretty DPPP_(my_pv_pretty)
8102
8103 #if defined(NEED_pv_pretty) || defined(NEED_pv_pretty_GLOBAL)
8104
8105 char *
8106 DPPP_(my_pv_pretty)(pTHX_ SV *dsv, char const * const str, const STRLEN count,
8107   const STRLEN max, char const * const start_color, char const * const end_color,
8108   const U32 flags)
8109 {
8110     const U8 dq = (flags & PERL_PV_PRETTY_QUOTE) ? '"' : '%';
8111     STRLEN escaped;
8112
8113     if (!(flags & PERL_PV_PRETTY_NOCLEAR))
8114         sv_setpvs(dsv, "");
8115
8116     if (dq == '"')
8117         sv_catpvs(dsv, "\"");
8118     else if (flags & PERL_PV_PRETTY_LTGT)
8119         sv_catpvs(dsv, "<");
8120
8121     if (start_color != NULL)
8122         sv_catpv(dsv, D_PPP_CONSTPV_ARG(start_color));
8123
8124     pv_escape(dsv, str, count, max, &escaped, flags | PERL_PV_ESCAPE_NOCLEAR);
8125
8126     if (end_color != NULL)
8127         sv_catpv(dsv, D_PPP_CONSTPV_ARG(end_color));
8128
8129     if (dq == '"')
8130         sv_catpvs(dsv, "\"");
8131     else if (flags & PERL_PV_PRETTY_LTGT)
8132         sv_catpvs(dsv, ">");
8133
8134     if ((flags & PERL_PV_PRETTY_ELLIPSES) && escaped < count)
8135         sv_catpvs(dsv, "...");
8136
8137     return SvPVX(dsv);
8138 }
8139
8140 #endif
8141 #endif
8142
8143 #ifndef pv_display
8144 #if defined(NEED_pv_display)
8145 static char * DPPP_(my_pv_display)(pTHX_ SV * dsv, const char * pv, STRLEN cur, STRLEN len, STRLEN pvlim);
8146 static
8147 #else
8148 extern char * DPPP_(my_pv_display)(pTHX_ SV * dsv, const char * pv, STRLEN cur, STRLEN len, STRLEN pvlim);
8149 #endif
8150
8151 #ifdef pv_display
8152 #  undef pv_display
8153 #endif
8154 #define pv_display(a,b,c,d,e) DPPP_(my_pv_display)(aTHX_ a,b,c,d,e)
8155 #define Perl_pv_display DPPP_(my_pv_display)
8156
8157 #if defined(NEED_pv_display) || defined(NEED_pv_display_GLOBAL)
8158
8159 char *
8160 DPPP_(my_pv_display)(pTHX_ SV *dsv, const char *pv, STRLEN cur, STRLEN len, STRLEN pvlim)
8161 {
8162     pv_pretty(dsv, pv, cur, pvlim, NULL, NULL, PERL_PV_PRETTY_DUMP);
8163     if (len > cur && pv[cur] == '\0')
8164         sv_catpvs(dsv, "\\0");
8165     return SvPVX(dsv);
8166 }
8167
8168 #endif
8169 #endif
8170
8171 #endif /* _P_P_PORTABILITY_H_ */
8172
8173 /* End of File ppport.h */