[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3-unattended/var/se3/unattended/install/linuxaux/opt/perl/lib/5.10.0/i586-linux-thread-multi/Devel/ -> PPPort.pm (source)

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


Generated: Tue Mar 17 22:47:18 2015 Cross-referenced by PHPXref 0.7.1