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