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