Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Devel-PPPort CPAN distribution.

Report information
The Basics
Id: 47174
Status: resolved
Priority: 0/
Queue: Devel-PPPort

People
Owner: Nobody in particular
Requestors: gfuji [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Hi, MHX. Thank you for 3.19, but I forgot to include some APIs: * newSVpvs_share() * get_cvn_flags() * get_cvs() I have used these APIs in some modules, so I have implemented them. I have also changed newSVpvn_share() using newSV_type(), but it's not important. Regards, -- Goro Fuji (gfx) GFUJI at CPAN.org
Subject: dppp.patch
diff -urN Devel-PPPort-3.19/parts/inc/gv Devel-PPPort/parts/inc/gv --- Devel-PPPort-3.19/parts/inc/gv 2009-06-14 18:53:16.000000000 +0900 +++ Devel-PPPort/parts/inc/gv 2009-06-20 10:14:53.000000000 +0900 @@ -24,6 +24,8 @@ __UNDEFINED__ GvSVn(gv) GvSV(gv) __UNDEFINED__ isGV_with_GP(gv) isGV(gv) +__UNDEFINED__ get_cvn_flags(name, namelen, flags) get_cv(name, flags) + =xsubs int @@ -58,9 +60,26 @@ OUTPUT: RETVAL +int +get_cvn_flags() + PREINIT: + CV* xv; + CODE: + RETVAL = 0; + xv = get_cvn_flags("Devel::PPPort::foobar", sizeof("Devel::PPPort::foobar")-1, 0); + if(xv == NULL) RETVAL++; + xv = get_cvn_flags("Devel::PPPort::foobar", sizeof("Devel::PPPort::foobar")-1, GV_ADDMULTI); + if(xv && SvTYPE(xv) == SVt_PVCV) RETVAL++; + xv = get_cvn_flags("Devel::PPPort::get_cvn_flags", sizeof("Devel::PPPort::get_cvn_flags")-1, 0); + if(xv && SvTYPE(xv) == SVt_PVCV) RETVAL++; + OUTPUT: + RETVAL -=tests plan => 2 + +=tests plan => 3 ok(Devel::PPPort::GvSVn(), 1); -ok(Devel::PPPort::isGV_with_GP(), 2) +ok(Devel::PPPort::isGV_with_GP(), 2); + +ok(Devel::PPPort::get_cvn_flags(), 3); diff -urN Devel-PPPort-3.19/parts/inc/pvs Devel-PPPort/parts/inc/pvs --- Devel-PPPort-3.19/parts/inc/pvs 2009-06-14 18:53:16.000000000 +0900 +++ Devel-PPPort/parts/inc/pvs 2009-06-20 10:14:29.000000000 +0900 @@ -30,6 +30,7 @@ __UNDEFINED__ newSVpvs(str) newSVpvn(str "", sizeof(str) - 1) __UNDEFINED__ newSVpvs_flags(str, flags) newSVpvn_flags(str "", sizeof(str) - 1, flags) +__UNDEFINED__ newSVpvs_share(str) newSVpvn_share(str "", sizeof(str) - 1, 0) __UNDEFINED__ sv_catpvs(sv, str) sv_catpvn(sv, str "", sizeof(str) - 1) __UNDEFINED__ sv_setpvs(sv, str) sv_setpvn(sv, str "", sizeof(str) - 1) __UNDEFINED__ hv_fetchs(hv, key, lval) hv_fetch(hv, key "", sizeof(key) - 1, lval) @@ -39,6 +40,12 @@ __UNDEFINED__ gv_fetchpvs(name, flags, svt) gv_fetchpvn_flags(name "", sizeof(name) - 1, flags, svt) __UNDEFINED__ gv_stashpvs(name, flags) gv_stashpvn(name "", sizeof(name) - 1, flags) +__UNDEFINED__ get_cvs(name, flags) get_cvn_flags(name "", sizeof(name)-1, flags) + +=xsinit + +#define NEED_newSVpvn_share + =xsubs void @@ -54,6 +61,12 @@ XSRETURN(1); void +newSVpvs_share() + PPCODE: + mXPUSHs(newSVpvs_share("newSVpvs_share")); + XSRETURN(1); + +void sv_catpvs(sv) SV *sv PPCODE: @@ -103,13 +116,28 @@ OUTPUT: RETVAL +int +get_cvs() + PREINIT: + CV* xv; + CODE: + RETVAL = 0; + xv = get_cvs("Devel::PPPort::foobar", 0); + if(xv == NULL) RETVAL++; + xv = get_cvs("Devel::PPPort::foobar", GV_ADDMULTI); + if(xv && SvTYPE(xv) == SVt_PVCV) RETVAL++; + xv = get_cvs("Devel::PPPort::get_cvs", 0); + if(xv && SvTYPE(xv) == SVt_PVCV) RETVAL++; +OUTPUT: + RETVAL -=tests plan => 11 +=tests plan => 13 my $x = 'foo'; ok(Devel::PPPort::newSVpvs(), "newSVpvs"); ok(Devel::PPPort::newSVpvs_flags(), "newSVpvs_flags"); +ok(Devel::PPPort::newSVpvs_share(), "newSVpvs_share"); Devel::PPPort::sv_catpvs($x); ok($x, "foosv_catpvs"); @@ -126,3 +154,5 @@ ok(Devel::PPPort::gv_fetchpvn_flags(), \*Devel::PPPort::VERSION); ok(Devel::PPPort::gv_fetchpvs(), \*Devel::PPPort::VERSION); ok(Devel::PPPort::gv_stashpvs(), \%Devel::PPPort::); + +ok(Devel::PPPort::get_cvs(), 3); diff -urN Devel-PPPort-3.19/parts/inc/shared_pv Devel-PPPort/parts/inc/shared_pv --- Devel-PPPort-3.19/parts/inc/shared_pv 2009-06-14 18:53:17.000000000 +0900 +++ Devel-PPPort/parts/inc/shared_pv 2009-06-17 09:50:00.000000000 +0900 @@ -34,11 +34,10 @@ len = -len; if (!hash) PERL_HASH(hash, (char*) src, len); - sv = newSVpvn((char *) src, len); - sv_upgrade(sv, SVt_PVIV); - SvIVX(sv) = hash; + sv = newSV_type(SVt_PVIV); + sv_setpvn(sv, src, len); + SvUV_set(sv, hash) SvREADONLY_on(sv); - SvPOK_on(sv); return sv; }
Sorry for the delay. Please check out 3.19_02 to see if it works for you as I had to make some changes to your patch. Cheers, Marcus