__UNDEFINED__ newSVpvn_flags
#if { VERSION < 5.6.0 } # define D_PPP_CONSTPV_ARG(x) ((char *) (x)) #else # define D_PPP_CONSTPV_ARG(x) (x) #endif
__UNDEFINED__ newSVpvn(data,len) ((data) \ ? ((len) ? newSVpv((data), (len)) : newSVpv("", 0)) \ : newSV(0))
__UNDEFINED__ newSVpvn_utf8(s, len, u) newSVpvn_flags((s), (len), (u) ? SVf_UTF8 : 0)
__UNDEFINED__ SVf_UTF8 0
#ifndef newSVpvn_flags #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) # define newSVpvn_flags(s, len, flags) ({ SV *_sv = newSVpvn(D_PPP_CONSTPV_ARG((s)), (len)); SvFLAGS(_sv) |= ((flags) & SVf_UTF8); ((flags) & SVs_TEMP) ? sv_2mortal(_sv) : _sv; }) #else # define newSVpvn_flags(s, len, flags) ((PL_Sv = newSVpvn(D_PPP_CONSTPV_ARG((s)), (len))), SvFLAGS(PL_Sv) |= ((flags) & SVf_UTF8), (((flags) & SVs_TEMP) ? sv_2mortal(PL_Sv) : PL_Sv)) #endif #endif
void newSVpvn() PPCODE: mXPUSHs(newSVpvn("test", 4)); mXPUSHs(newSVpvn("test", 2)); mXPUSHs(newSVpvn("test", 0)); mXPUSHs(newSVpvn(NULL, 2)); mXPUSHs(newSVpvn(NULL, 0)); XSRETURN(5);
void newSVpvn_flags() PPCODE: XPUSHs(newSVpvn_flags("test", 4, SVs_TEMP)); XPUSHs(newSVpvn_flags("test", 2, SVs_TEMP)); XPUSHs(newSVpvn_flags("test", 0, SVs_TEMP)); XPUSHs(newSVpvn_flags(NULL, 2, SVs_TEMP)); XPUSHs(newSVpvn_flags(NULL, 0, SVs_TEMP)); XSRETURN(5);
void newSVpvn_utf8() PPCODE: XPUSHs(newSVpvn_flags("test", 4, SVs_TEMP|SVf_UTF8)); XSRETURN(1);
my @s = &Devel::PPPort::newSVpvn(); ok(@s == 5); is($s[0], "test"); is($s[1], "te"); is($s[2], ""); ok(!defined($s[3])); ok(!defined($s[4]));
@s = &Devel::PPPort::newSVpvn_flags(); ok(@s == 5); is($s[0], "test"); is($s[1], "te"); is($s[2], ""); ok(!defined($s[3])); ok(!defined($s[4]));
@s = &Devel::PPPort::newSVpvn_utf8(); ok(@s == 1); is($s[0], "test");
if (ivers($]) >= ivers("5.008001")) { require utf8; ok(utf8::is_utf8($s[0])); } else { skip("skip: no is_utf8()", 1); }
4 POD Errors
The following errors were encountered while parsing the POD:
- Around line 12:
Unknown directive: =provides
- Around line 17:
Unknown directive: =implementation
- Around line 41:
Unknown directive: =xsubs
- Around line 69:
Unknown directive: =tests