has.xs

filter: Statementstmt 0.0% 0 / 23 Branchbran 0.0% 0 / 22 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 0.0% 0 / 45 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
↑ Summary blib/lib/UNIVERSAL/has.pm »
1 #include "EXTERN.h"
2 #include "perl.h"
3 #include "XSUB.h"
4  
5 #include "ppport.h"
6  
7 MODULE = UNIVERSAL::has PACKAGE = UNIVERSAL::has
8  
9 SV *
10 xs_has(sv)
11 SV * sv
12 PROTOTYPE: $
13 PREINIT:
14 HV *pkg;
15 AV *linear_av;
16  
17 HV *cstash;
18 SV **linear_svp;
19 SV *linear_sv;
20  
21 HE *entry;
22 SV *val;
23 CV *cv;
24 char *key;
25  
26 STRLEN len;
27  
28 AV* ret;
29 CODE:
30 0 ret = newAV();
31  
32 0 ▶ if (!(SvROK(sv) && SvOBJECT(SvRV(sv))))
Branch: 2 branches
BranchTrueFalseTotal
if (!(SvROK(sv) && SvOBJECT(SvRV(sv)))) 0 0 0
if (!(SvROK(sv) && SvOBJECT(SvRV(sv)))) 0 0 0
33 0 XSRETURN_EMPTY;
34  
35 0 sv = MUTABLE_SV(SvRV(sv));
36 0 ▶ if (SvOBJECT(sv))
Branch: 1 branch
BranchTrueFalseTotal
if (SvOBJECT(sv)) 0 0 0
37 0 pkg = SvSTASH(sv);
38  
39 0 ▶ if (pkg) {
Branch: 1 branch
BranchTrueFalseTotal
if (pkg) { 0 0 0
40 0 linear_av = mro_get_linear_isa(pkg); /* has ourselves at the top of the list */
41  
42 0 linear_svp = AvARRAY(linear_av);
43 0 items = AvFILLp(linear_av);
44  
45 0 ▶ while (items--) {
Branch: 1 branch
BranchTrueFalseTotal
while (items--) { 0 0 0
46 0 linear_sv = *linear_svp++;
47 0 cstash = gv_stashsv(linear_sv, 0);
48  
49 /* av_push(ret, newSVpv(SvPV_nolen(linear_sv), 0)); */
50  
51 0 ▶ if (cstash) {
Branch: 1 branch
BranchTrueFalseTotal
if (cstash) { 0 0 0
52 0 hv_iterinit(cstash);
53  
54 0 ▶ while (entry = hv_iternext(cstash)) {
Branch: 1 branch
BranchTrueFalseTotal
while (entry = hv_iternext(cstash)) { 0 0 0
55 0 val = HeVAL(entry);
56  
57 /* av_push(ret, newSVpv(SvPV_nolen(val), 0)); */
58  
59 0 ▶ if (SvTYPE(val) == SVt_PVGV) {
Branch: 1 branch
BranchTrueFalseTotal
if (SvTYPE(val) == SVt_PVGV) { 0 0 0
60 0 cv = GvCV(val);
61  
62 0 ▶ if (cv && SvTYPE(cv) == SVt_PVCV) {
Branch: 2 branches
BranchTrueFalseTotal
if (cv && SvTYPE(cv) == SVt_PVCV) { 0 0 0
if (cv && SvTYPE(cv) == SVt_PVCV) { 0 0 0
63 0 ▶ key = HePV(entry, len);
Branch: 1 branch
BranchTrueFalseTotal
key = HePV(entry, len); 0 0 0
64 0 av_push(ret, newSVpv(key,0));
65 }
66 }
67 }
68 }
69 }
70 }
71  
72 0 RETVAL = newRV_noinc((SV *)ret);
73 OUTPUT:
74 RETVAL
↑ Summary blib/lib/UNIVERSAL/has.pm »