App-Sandy

 view release on metacpan or  search on metacpan

ppport.h  view on Meta::CPAN


=back

=item *

If you use one of a few functions or variables that were not present in
earlier versions of Perl, and that can't be provided using a macro, you
have to explicitly request support for these functions by adding one or
more C<#define>s in your source code before the inclusion of F<ppport.h>.

These functions or variables will be marked C<explicit> in the list shown
by C<--list-provided>.

Depending on whether you module has a single or multiple files that
use such functions or variables, you want either C<static> or global
variants.

For a C<static> function or variable (used only in a single source
file), use:

    #define NEED_function
    #define NEED_variable

For a global function or variable (used in multiple source files),
use:

    #define NEED_function_GLOBAL
    #define NEED_variable_GLOBAL

Note that you mustn't have more than one global request for the
same function or variable in your project.

    Function / Variable       Static Request               Global Request
    -----------------------------------------------------------------------------------------
    caller_cx()               NEED_caller_cx               NEED_caller_cx_GLOBAL
    ck_warner()               NEED_ck_warner               NEED_ck_warner_GLOBAL
    ck_warner_d()             NEED_ck_warner_d             NEED_ck_warner_d_GLOBAL
    croak_xs_usage()          NEED_croak_xs_usage          NEED_croak_xs_usage_GLOBAL
    die_sv()                  NEED_die_sv                  NEED_die_sv_GLOBAL
    eval_pv()                 NEED_eval_pv                 NEED_eval_pv_GLOBAL
    grok_bin()                NEED_grok_bin                NEED_grok_bin_GLOBAL
    grok_hex()                NEED_grok_hex                NEED_grok_hex_GLOBAL
    grok_number()             NEED_grok_number             NEED_grok_number_GLOBAL
    grok_numeric_radix()      NEED_grok_numeric_radix      NEED_grok_numeric_radix_GLOBAL
    grok_oct()                NEED_grok_oct                NEED_grok_oct_GLOBAL
    load_module()             NEED_load_module             NEED_load_module_GLOBAL
    mess()                    NEED_mess                    NEED_mess_GLOBAL
    mess_nocontext()          NEED_mess_nocontext          NEED_mess_nocontext_GLOBAL
    mess_sv()                 NEED_mess_sv                 NEED_mess_sv_GLOBAL
    mg_findext()              NEED_mg_findext              NEED_mg_findext_GLOBAL
    my_snprintf()             NEED_my_snprintf             NEED_my_snprintf_GLOBAL
    my_sprintf()              NEED_my_sprintf              NEED_my_sprintf_GLOBAL
    my_strlcat()              NEED_my_strlcat              NEED_my_strlcat_GLOBAL
    my_strlcpy()              NEED_my_strlcpy              NEED_my_strlcpy_GLOBAL
    my_strnlen()              NEED_my_strnlen              NEED_my_strnlen_GLOBAL
    newCONSTSUB()             NEED_newCONSTSUB             NEED_newCONSTSUB_GLOBAL
    newSVpvn_share()          NEED_newSVpvn_share          NEED_newSVpvn_share_GLOBAL
    PL_parser                 NEED_PL_parser               NEED_PL_parser_GLOBAL
    PL_signals                NEED_PL_signals              NEED_PL_signals_GLOBAL
    pv_display()              NEED_pv_display              NEED_pv_display_GLOBAL
    pv_escape()               NEED_pv_escape               NEED_pv_escape_GLOBAL
    pv_pretty()               NEED_pv_pretty               NEED_pv_pretty_GLOBAL
    sv_catpvf_mg()            NEED_sv_catpvf_mg            NEED_sv_catpvf_mg_GLOBAL
    sv_catpvf_mg_nocontext()  NEED_sv_catpvf_mg_nocontext  NEED_sv_catpvf_mg_nocontext_GLOBAL
    sv_setpvf_mg()            NEED_sv_setpvf_mg            NEED_sv_setpvf_mg_GLOBAL
    sv_setpvf_mg_nocontext()  NEED_sv_setpvf_mg_nocontext  NEED_sv_setpvf_mg_nocontext_GLOBAL
    sv_unmagicext()           NEED_sv_unmagicext           NEED_sv_unmagicext_GLOBAL
    utf8_to_uvchr_buf()       NEED_utf8_to_uvchr_buf       NEED_utf8_to_uvchr_buf_GLOBAL
    vload_module()            NEED_vload_module            NEED_vload_module_GLOBAL
    vmess()                   NEED_vmess                   NEED_vmess_GLOBAL
    warner()                  NEED_warner                  NEED_warner_GLOBAL

To avoid namespace conflicts, you can change the namespace of the
explicitly exported functions / variables using the C<DPPP_NAMESPACE>
macro. Just C<#define> the macro before including C<ppport.h>:

    #define DPPP_NAMESPACE MyOwnNamespace_
    #include "ppport.h"

The default namespace is C<DPPP_>.

=back

The good thing is that most of the above can be checked by running
F<ppport.h> on your source code. See the next section for
details.

=head1 EXAMPLES

To verify whether F<ppport.h> is needed for your module, whether you
should make any changes to your code, and whether any special defines
should be used, F<ppport.h> can be run as a Perl script to check your
source code. Simply say:

    perl ppport.h

The result will usually be a list of patches suggesting changes
that should at least be acceptable, if not necessarily the most
efficient solution, or a fix for all possible problems.

If you know that your XS module uses features only available in
newer Perl releases, if you're aware that it uses C++ comments,
and if you want all suggestions as a single patch file, you could
use something like this:

    perl ppport.h --compat-version=5.6.0 --cplusplus --patch=test.diff

If you only want your code to be scanned without any suggestions
for changes, use:

    perl ppport.h --nochanges

You can specify a different C<diff> program or options, using
the C<--diff> option:

    perl ppport.h --diff='diff -C 10'

This would output context diffs with 10 lines of context.

If you want to create patched copies of your files instead, use:

ppport.h  view on Meta::CPAN

DEBUG_STATE_r|5.009004||Viu
DEBUG_s_TEST|5.007001||Viu
DEBUG_S_TEST|5.017002||Viu
DEBUG_t|5.003007||Viu
DEBUG_T|5.007001||Viu
DEBUG_TEST_r|5.021005||Viu
DEBUG_T_FLAG|5.007001||Viu
DEBUG_t_FLAG|5.007001||Viu
DEBUG_TOP_FLAG|5.007001||Viu
DEBUG_TRIE_COMPILE_MORE_r|5.009002||Viu
DEBUG_TRIE_COMPILE_r|5.009002||Viu
DEBUG_TRIE_EXECUTE_MORE_r|5.009002||Viu
DEBUG_TRIE_EXECUTE_r|5.009002||Viu
DEBUG_TRIE_r|5.009002||Viu
DEBUG_T_TEST|5.007001||Viu
DEBUG_t_TEST|5.007001||Viu
DEBUG_u|5.003007||Viu
DEBUG_U|5.009005||Viu
DEBUG_u_FLAG|5.007001||Viu
DEBUG_U_FLAG|5.009005||Viu
DEBUG_u_TEST|5.007001||Viu
DEBUG_U_TEST|5.009005||Viu
DEBUG_Uv|5.009005||Viu
DEBUG_Uv_TEST|5.009005||Viu
DEBUG_v|5.008001||Viu
DEBUG_v_FLAG|5.008001||Viu
DEBUG_v_TEST|5.008001||Viu
DEBUG_X|5.003007||Viu
DEBUG_x|5.003007||Viu
DEBUG_X_FLAG|5.007001||Viu
DEBUG_x_FLAG|5.007001||Viu
DEBUG_X_TEST|5.007001||Viu
DEBUG_x_TEST|5.007001||Viu
DEBUG_Xv|5.008001||Viu
DEBUG_Xv_TEST|5.008001||Viu
DEBUG_y|5.031007||Viu
DEBUG_y_FLAG|5.031007||Viu
DEBUG_y_TEST|5.031007||Viu
DEBUG_yv|5.031007||Viu
DEBUG_yv_TEST|5.031007||Viu
DEBUG_ZAPHOD32_HASH|5.027001||Viu
DECLARATION_FOR_LC_NUMERIC_MANIPULATION|5.021010|5.021010|p
DECLARE_AND_GET_RE_DEBUG_FLAGS|5.031011||Viu
DECLARE_AND_GET_RE_DEBUG_FLAGS_NON_REGEX|5.031011||Viu
DEFAULT_INC_EXCLUDES_DOT|5.025011|5.025011|Vn
DEFAULT_PAT_MOD|5.013006||Viu
defelem_target|5.019002||Viu
DEFINE_INC_MACROS|5.027006||Viu
DEFINEP|5.009005||Viu
DEFINEP_t8|5.035004||Viu
DEFINEP_t8_p8|5.033003||Viu
DEFINEP_t8_pb|5.033003||Viu
DEFINEP_tb|5.035004||Viu
DEFINEP_tb_p8|5.033003||Viu
DEFINEP_tb_pb|5.033003||Viu
DEFSV|5.004005|5.003007|p
DEFSV_set|5.010001|5.003007|p
del_body_by_type|||Viu
delete_eval_scope|5.009004||xViu
delimcpy|5.004000|5.004000|n
delimcpy_no_escape|5.025005||cVni
DEL_NATIVE|5.017010||Viu
del_sv|5.005000||Viu
DEPENDS_PAT_MOD|5.013009||Viu
DEPENDS_PAT_MODS|5.013009||Viu
deprecate|5.011001||Viu
deprecate_disappears_in|5.025009||Viu
deprecate_fatal_in|5.025009||Viu
despatch_signals|5.007001||cVu
destroy_matcher|5.027008||Viu
DETACH|5.005000||Viu
dEXT|5.003007||Viu
dEXTCONST|5.004000||Viu
DFA_RETURN_FAILURE|5.035004||Viu
DFA_RETURN_SUCCESS|5.035004||Viu
DFA_TEASE_APART_FF|5.035004||Viu
D_FMT|5.027010||Viu
DIE|5.003007||Viu
die|5.003007||vV
die_nocontext|5.006000||vVn
die_sv|5.013001|5.003007|p
die_unwind|5.013001||Viu
Direntry_t|5.003007|5.003007|Vn
dirp_dup|5.013007|5.013007|u
dITEMS|5.007002|5.003007|p
div128|5.005000||Viu
dJMPENV|5.004000||Viu
djSP|5.004005||Vi
dMARK|5.003007|5.003007|
DM_ARRAY_ISA|5.013002||Viu
DM_DELAY|5.003007||Viu
DM_EGID|5.003007||Viu
DM_EUID|5.003007||Viu
DM_GID|5.003007||Viu
DM_RGID|5.003007||Viu
DM_RUID|5.003007||Viu
DM_UID|5.003007||Viu
dMULTICALL|5.009003|5.009003|
dMY_CXT|5.009000|5.009000|p
dMY_CXT_INTERP|5.009003||Viu
dMY_CXT_SV|5.007003|5.003007|pV
dNOOP|5.006000|5.003007|p
do_aexec|5.009003||Viu
do_aexec5|5.006000||Viu
do_aspawn|5.008000||Vu
do_binmode|5.004005|5.004005|du
docatch|5.005000||Vi
do_chomp|5.003007||Viu
do_close|5.003007|5.003007|u
do_delete_local|5.011000||Viu
do_dump_pad|5.008001||Vi
do_eof|5.003007||Viu
does_utf8_overflow|5.025006||Vniu
doeval_compile|5.023008||Viu
do_exec3|5.006000||Viu
do_exec|5.009003||Viu
dofile|5.005003||Viu
dofindlabel|5.003007||Viu
doform|5.005000||Viu
do_gv_dump|5.006000||cVu
do_gvgv_dump|5.006000||cVu

ppport.h  view on Meta::CPAN

pthread_mutexattr_init|5.005000||Viu
pthread_mutexattr_settype|5.005000||Viu
pTHX_12|5.019010||Viu
pTHX_1|5.006000||Viu
pTHX_2|5.006000||Viu
pTHX_3|5.006000||Viu
pTHX_4|5.006000||Viu
pTHX|5.006000|5.003007|p
pTHX_5|5.009003||Viu
pTHX_6|5.009003||Viu
pTHX_7|5.009003||Viu
pTHX_8|5.009003||Viu
pTHX_9|5.009003||Viu
pTHX_||5.003007|p
pTHX__FORMAT|5.009002||Viu
pTHX_FORMAT|5.009002||Viu
pTHXo|5.006000||Viu
pTHX__VALUE|5.009002||Viu
pTHX_VALUE|5.009002||Viu
pTHXx|5.006000||Viu
PTR2IV|5.006000|5.003007|p
PTR2nat|5.009003|5.003007|p
PTR2NV|5.006000|5.003007|p
PTR2ul|5.007001|5.003007|p
PTR2UV|5.006000|5.003007|p
Ptrdiff_t|5.029003||Viu
ptr_hash|5.017010||Vniu
PTRSIZE|5.005000|5.005000|Vn
ptr_table_fetch|5.009005|5.009005|u
ptr_table_find|5.009004||Vniu
ptr_table_free|5.009005|5.009005|u
ptr_table_new|5.009005|5.009005|u
ptr_table_split|5.009005|5.009005|u
ptr_table_store|5.009005|5.009005|u
PTRV|5.006000|5.003007|poVnu
PUSHi|5.003007|5.003007|
PUSHMARK|5.003007|5.003007|
PUSHmortal|5.009002|5.003007|p
PUSH_MULTICALL|5.011000|5.011000|
PUSH_MULTICALL_FLAGS|5.018000||Viu
PUSHn|5.006000|5.003007|
PUSHp|5.003007|5.003007|
PUSHs|5.003007|5.003007|
push_scope|5.003007|5.003007|u
PUSHSTACK|5.005000||Viu
PUSHSTACKi|5.005000||Viu
PUSHSTACK_INIT_HWM|5.027002||Viu
PUSHTARG|5.003007||Viu
PUSHu|5.004000|5.003007|p
PUTBACK|5.003007|5.003007|
putc|5.003007||Viu
put_charclass_bitmap_innards|5.021004||Viu
put_charclass_bitmap_innards_common|5.023008||Viu
put_charclass_bitmap_innards_invlist|5.023008||Viu
put_code_point|5.021004||Viu
putc_unlocked|5.003007||Viu
putenv|5.005000||Viu
put_range|5.019009||Viu
putw|5.003007||Viu
pv_display|5.006000|5.003007|p
pv_escape|5.009004|5.003007|p
pv_pretty|5.009004|5.003007|p
pv_uni_display|5.007003|5.007003|
pWARN_ALL|5.006000||Viu
pWARN_NONE|5.006000||Viu
pWARN_STD|5.006000||Viu
PWGECOS|5.004005|5.004005|Vn
PWPASSWD|5.005000|5.005000|Vn
qerror|5.006000||cViu
QR_PAT_MODS|5.009005||Viu
QUAD_IS_INT|5.006000|5.006000|Vn
QUAD_IS___INT64|5.015003|5.015003|Vn
QUAD_IS_INT64_T|5.006000|5.006000|Vn
QUAD_IS_LONG|5.006000|5.006000|Vn
QUAD_IS_LONG_LONG|5.006000|5.006000|Vn
QUADKIND|5.006000|5.006000|Vn
quadmath_format_needed|5.021004||Vni
quadmath_format_valid|5.031007||Vni
Quad_t|5.003007|5.003007|Vn
QUESTION_MARK_CTRL|5.021001||Viu
RADIXCHAR|5.027010||Viu
RANDBITS|5.003007|5.003007|Vn
RANDOM_R_PROTO|5.008000|5.008000|Vn
Rand_seed_t|5.006000|5.006000|Vn
RANGE_INDICATOR|5.031006||Viu
rck_elide_nothing|5.032001||Viu
RD_NODATA|5.003007|5.003007|Vn
read|5.005000||Viu
readdir|5.005000||Viu
readdir64|5.009000||Viu
READDIR64_R_PROTO|5.008000|5.008000|Vn
READDIR_R_PROTO|5.008000|5.008000|Vn
READ_XDIGIT|5.017006|5.017006|
realloc|5.003007||Vn
ReANY|5.017006||cVnu
re_compile|5.009005|5.009005|u
RE_COMPILE_RECURSION_INIT|5.029009||Viu
RE_COMPILE_RECURSION_LIMIT|5.029009||Viu
re_croak|||iu
recv|5.006000||Viu
recvfrom|5.005000||Viu
RE_DEBUG_COMPILE_DUMP|5.009004||Viu
RE_DEBUG_COMPILE_FLAGS|5.009005||Viu
RE_DEBUG_COMPILE_MASK|5.009004||Viu
RE_DEBUG_COMPILE_OPTIMISE|5.009004||Viu
RE_DEBUG_COMPILE_PARSE|5.009004||Viu
RE_DEBUG_COMPILE_TEST|5.021005||Viu
RE_DEBUG_COMPILE_TRIE|5.009004||Viu
RE_DEBUG_EXECUTE_INTUIT|5.009004||Viu
RE_DEBUG_EXECUTE_MASK|5.009004||Viu
RE_DEBUG_EXECUTE_MATCH|5.009004||Viu
RE_DEBUG_EXECUTE_TRIE|5.009004||Viu
RE_DEBUG_EXTRA_BUFFERS|5.009005||Viu
RE_DEBUG_EXTRA_DUMP_PRE_OPTIMIZE|5.031004||Viu
RE_DEBUG_EXTRA_GPOS|5.011000||Viu
RE_DEBUG_EXTRA_MASK|5.009004||Viu
RE_DEBUG_EXTRA_OPTIMISE|5.009005||Viu
RE_DEBUG_EXTRA_STACK|5.009005||Viu
RE_DEBUG_EXTRA_STATE|5.009004||Viu
RE_DEBUG_EXTRA_TRIE|5.009004||Viu
RE_DEBUG_EXTRA_WILDCARD|5.031011||Viu

ppport.h  view on Meta::CPAN

       }
#      define sv_len_utf8(sv) D_PPP_sv_len_utf8(sv)
#    endif
#  endif    /* End of < 5.17.5 */
#endif
#ifndef PERL_PV_ESCAPE_QUOTE
#  define PERL_PV_ESCAPE_QUOTE           0x0001
#endif

#ifndef PERL_PV_PRETTY_QUOTE
#  define PERL_PV_PRETTY_QUOTE           PERL_PV_ESCAPE_QUOTE
#endif

#ifndef PERL_PV_PRETTY_ELLIPSES
#  define PERL_PV_PRETTY_ELLIPSES        0x0002
#endif

#ifndef PERL_PV_PRETTY_LTGT
#  define PERL_PV_PRETTY_LTGT            0x0004
#endif

#ifndef PERL_PV_ESCAPE_FIRSTCHAR
#  define PERL_PV_ESCAPE_FIRSTCHAR       0x0008
#endif

#ifndef PERL_PV_ESCAPE_UNI
#  define PERL_PV_ESCAPE_UNI             0x0100
#endif

#ifndef PERL_PV_ESCAPE_UNI_DETECT
#  define PERL_PV_ESCAPE_UNI_DETECT      0x0200
#endif

#ifndef PERL_PV_ESCAPE_ALL
#  define PERL_PV_ESCAPE_ALL             0x1000
#endif

#ifndef PERL_PV_ESCAPE_NOBACKSLASH
#  define PERL_PV_ESCAPE_NOBACKSLASH     0x2000
#endif

#ifndef PERL_PV_ESCAPE_NOCLEAR
#  define PERL_PV_ESCAPE_NOCLEAR         0x4000
#endif

#ifndef PERL_PV_ESCAPE_RE
#  define PERL_PV_ESCAPE_RE              0x8000
#endif

#ifndef PERL_PV_PRETTY_NOCLEAR
#  define PERL_PV_PRETTY_NOCLEAR         PERL_PV_ESCAPE_NOCLEAR
#endif
#ifndef PERL_PV_PRETTY_DUMP
#  define PERL_PV_PRETTY_DUMP            PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_QUOTE
#endif

#ifndef PERL_PV_PRETTY_REGPROP
#  define PERL_PV_PRETTY_REGPROP         PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_LTGT|PERL_PV_ESCAPE_RE
#endif

/* Hint: pv_escape
 * Note that unicode functionality is only backported to
 * those perl versions that support it. For older perl
 * versions, the implementation will fall back to bytes.
 */

#ifndef pv_escape
#if defined(NEED_pv_escape)
static char * DPPP_(my_pv_escape)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, STRLEN * const escaped, const U32 flags);
static
#else
extern char * DPPP_(my_pv_escape)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, STRLEN * const escaped, const U32 flags);
#endif

#if defined(NEED_pv_escape) || defined(NEED_pv_escape_GLOBAL)

#ifdef pv_escape
#  undef pv_escape
#endif
#define pv_escape(a,b,c,d,e,f) DPPP_(my_pv_escape)(aTHX_ a,b,c,d,e,f)
#define Perl_pv_escape DPPP_(my_pv_escape)


char *
DPPP_(my_pv_escape)(pTHX_ SV *dsv, char const * const str,
  const STRLEN count, const STRLEN max,
  STRLEN * const escaped, const U32 flags)
{
    const char esc = flags & PERL_PV_ESCAPE_RE ? '%' : '\\';
    const char dq = flags & PERL_PV_ESCAPE_QUOTE ? '"' : esc;
    char octbuf[32] = "%123456789ABCDF";
    STRLEN wrote = 0;
    STRLEN chsize = 0;
    STRLEN readsize = 1;
#if defined(is_utf8_string) && defined(utf8_to_uvchr_buf)
    bool isuni = flags & PERL_PV_ESCAPE_UNI ? 1 : 0;
#endif
    const char *pv  = str;
    const char * const end = pv + count;
    octbuf[0] = esc;

    if (!(flags & PERL_PV_ESCAPE_NOCLEAR))
        sv_setpvs(dsv, "");

#if defined(is_utf8_string) && defined(utf8_to_uvchr_buf)
    if ((flags & PERL_PV_ESCAPE_UNI_DETECT) && is_utf8_string((U8*)pv, count))
        isuni = 1;
#endif

    for (; pv < end && (!max || wrote < max) ; pv += readsize) {
        const UV u =
#if defined(is_utf8_string) && defined(utf8_to_uvchr_buf)
                     isuni ? utf8_to_uvchr_buf((U8*)pv, end, &readsize) :
#endif
                             (U8)*pv;
        const U8 c = (U8)u & 0xFF;

        if (u > 255 || (flags & PERL_PV_ESCAPE_ALL)) {
            if (flags & PERL_PV_ESCAPE_FIRSTCHAR)
                chsize = my_snprintf(octbuf, sizeof octbuf,
                                      "%" UVxf, u);
            else
                chsize = my_snprintf(octbuf, sizeof octbuf,
                                      "%cx{%" UVxf "}", esc, u);
        } else if (flags & PERL_PV_ESCAPE_NOBACKSLASH) {
            chsize = 1;
        } else {
            if (c == dq || c == esc || !isPRINT(c)) {
                chsize = 2;
                switch (c) {
                case '\\' : /* fallthrough */
                case '%'  : if (c == esc)
                                octbuf[1] = esc;
                            else
                                chsize = 1;
                            break;
                case '\v' : octbuf[1] = 'v'; break;
                case '\t' : octbuf[1] = 't'; break;
                case '\r' : octbuf[1] = 'r'; break;
                case '\n' : octbuf[1] = 'n'; break;
                case '\f' : octbuf[1] = 'f'; break;
                case '"'  : if (dq == '"')
                                octbuf[1] = '"';
                            else
                                chsize = 1;
                            break;
                default:    chsize = my_snprintf(octbuf, sizeof octbuf,
                                pv < end && isDIGIT((U8)*(pv+readsize))
                                ? "%c%03o" : "%c%o", esc, c);
                }
            } else {
                chsize = 1;
            }
        }
        if (max && wrote + chsize > max) {
            break;
        } else if (chsize > 1) {
            sv_catpvn(dsv, octbuf, chsize);
            wrote += chsize;
        } else {
            char tmp[2];
            my_snprintf(tmp, sizeof tmp, "%c", c);
            sv_catpvn(dsv, tmp, 1);
            wrote++;
        }
        if (flags & PERL_PV_ESCAPE_FIRSTCHAR)
            break;
    }
    if (escaped != NULL)
        *escaped= pv - str;
    return SvPVX(dsv);
}

#endif
#endif

#ifndef pv_pretty
#if defined(NEED_pv_pretty)
static char * DPPP_(my_pv_pretty)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, char const * const start_color, char const * const end_color, const U32 flags);
static
#else
extern char * DPPP_(my_pv_pretty)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, char const * const start_color, char const * const end_color, const U32 flags);
#endif

#if defined(NEED_pv_pretty) || defined(NEED_pv_pretty_GLOBAL)

#ifdef pv_pretty
#  undef pv_pretty
#endif
#define pv_pretty(a,b,c,d,e,f,g) DPPP_(my_pv_pretty)(aTHX_ a,b,c,d,e,f,g)
#define Perl_pv_pretty DPPP_(my_pv_pretty)


char *
DPPP_(my_pv_pretty)(pTHX_ SV *dsv, char const * const str, const STRLEN count,
  const STRLEN max, char const * const start_color, char const * const end_color,
  const U32 flags)
{
    const U8 dq = (flags & PERL_PV_PRETTY_QUOTE) ? '"' : '%';
    STRLEN escaped;

    if (!(flags & PERL_PV_PRETTY_NOCLEAR))
        sv_setpvs(dsv, "");

    if (dq == '"')
        sv_catpvs(dsv, "\"");
    else if (flags & PERL_PV_PRETTY_LTGT)
        sv_catpvs(dsv, "<");

    if (start_color != NULL)
        sv_catpv(dsv, D_PPP_CONSTPV_ARG(start_color));

    pv_escape(dsv, str, count, max, &escaped, flags | PERL_PV_ESCAPE_NOCLEAR);

    if (end_color != NULL)
        sv_catpv(dsv, D_PPP_CONSTPV_ARG(end_color));

    if (dq == '"')
        sv_catpvs(dsv, "\"");
    else if (flags & PERL_PV_PRETTY_LTGT)
        sv_catpvs(dsv, ">");

    if ((flags & PERL_PV_PRETTY_ELLIPSES) && escaped < count)
        sv_catpvs(dsv, "...");

    return SvPVX(dsv);
}

#endif
#endif

#ifndef pv_display
#if defined(NEED_pv_display)
static char * DPPP_(my_pv_display)(pTHX_ SV * dsv, const char * pv, STRLEN cur, STRLEN len, STRLEN pvlim);
static
#else
extern char * DPPP_(my_pv_display)(pTHX_ SV * dsv, const char * pv, STRLEN cur, STRLEN len, STRLEN pvlim);
#endif

#if defined(NEED_pv_display) || defined(NEED_pv_display_GLOBAL)

#ifdef pv_display
#  undef pv_display
#endif
#define pv_display(a,b,c,d,e) DPPP_(my_pv_display)(aTHX_ a,b,c,d,e)
#define Perl_pv_display DPPP_(my_pv_display)


char *
DPPP_(my_pv_display)(pTHX_ SV *dsv, const char *pv, STRLEN cur, STRLEN len, STRLEN pvlim)
{
    pv_pretty(dsv, pv, cur, pvlim, NULL, NULL, PERL_PV_PRETTY_DUMP);
    if (len > cur && pv[cur] == '\0')
        sv_catpvs(dsv, "\\0");
    return SvPVX(dsv);
}

#endif
#endif

#if PERL_VERSION_LT(5,27,9)
#ifndef LC_NUMERIC_LOCK
#  define LC_NUMERIC_LOCK
#endif

#ifndef LC_NUMERIC_UNLOCK
#  define LC_NUMERIC_UNLOCK
#endif

#  if PERL_VERSION_LT(5,19,0)
#    undef STORE_LC_NUMERIC_SET_STANDARD
#    undef RESTORE_LC_NUMERIC
#    undef DECLARATION_FOR_LC_NUMERIC_MANIPULATION
#    ifdef USE_LOCALE
#ifndef DECLARATION_FOR_LC_NUMERIC_MANIPULATION
#  define DECLARATION_FOR_LC_NUMERIC_MANIPULATION char *LoC_
#endif

#ifndef STORE_NUMERIC_SET_STANDARD
#  define STORE_NUMERIC_SET_STANDARD()   \
	 LoC_ = savepv(setlocale(LC_NUMERIC, NULL));  \
	 SAVEFREEPV(LoC_);                            \
	 setlocale(LC_NUMERIC, "C");



( run in 0.831 second using v1.01-cache-2.11-cpan-d8267643d1d )