Easy.xs

filter: Statementstmt 100% 8 / 8 Branchbran 45.4% 10 / 22 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 60.0% 18 / 30 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« blib/lib/Class/Easy/Log/Tie.pm ↑ Summary blib/lib/Class/Easy/Import.pm »
1  
2 #include "EXTERN.h"
3 #include "perl.h"
4 #include "XSUB.h"
5 #include "ppport.h"
6  
7 /*
8 get_code_info:
9 Pass in a coderef, returns:
10 [ $pkg_name, $coderef_name ] ie:
11 [ 'Foo::Bar', 'new' ]
12 */
13  
14 MODULE = Class::Easy PACKAGE = Class::Easy
15  
16 PROTOTYPES: ENABLE
17  
18 void
19 get_coderef_info(coderef)
20 SV* coderef
21 PREINIT:
22 char* name;
23 char* pkg;
24 PPCODE:
25 23 ▶ if (SvOK(coderef) && SvROK(coderef) && SvTYPE(SvRV(coderef)) == SVt_PVCV) {
Branch: 3 branches
BranchTrueFalseTotal
if (SvOK(coderef) && SvROK(coderef) && SvTYPE(SvRV(coderef)) == SVt_PVCV) { 23 0 23
if (SvOK(coderef) && SvROK(coderef) && SvTYPE(SvRV(coderef)) == SVt_PVCV) { 23 0 23
if (SvOK(coderef) && SvROK(coderef) && SvTYPE(SvRV(coderef)) == SVt_PVCV) { 23 0 23
26 23 coderef = SvRV(coderef);
27 23 ▶ if (CvGV(coderef)) {
Branch: 1 branch
BranchTrueFalseTotal
if (CvGV(coderef)) { 23 0 23
28 23 name = GvNAME( CvGV(coderef) );
29 23 ▶ pkg = HvNAME( GvSTASH(CvGV(coderef)) );
Branch: 6 branches
BranchTrueFalseTotal
pkg = HvNAME( GvSTASH(CvGV(coderef)) ); 23 0 23
pkg = HvNAME( GvSTASH(CvGV(coderef)) ); 23 0 23
pkg = HvNAME( GvSTASH(CvGV(coderef)) ); 0 23 23
pkg = HvNAME( GvSTASH(CvGV(coderef)) ); 0 0 0
pkg = HvNAME( GvSTASH(CvGV(coderef)) ); 23 0 23
pkg = HvNAME( GvSTASH(CvGV(coderef)) ); 0 23 23
30 23 ▶ EXTEND(SP, 2);
Branch: 1 branch
BranchTrueFalseTotal
EXTEND(SP, 2); 0 23 23
31 23 PUSHs(sv_2mortal(newSVpvn(pkg, strlen(pkg))));
32 23 PUSHs(sv_2mortal(newSVpvn(name, strlen(name))));
33 }
34 else {
35 /* sub is being compiled: bail out and return nothing. */
36 }
37 }
« blib/lib/Class/Easy/Log/Tie.pm ↑ Summary blib/lib/Class/Easy/Import.pm »