t/parts.xs

filter: Statementstmt 100% 14 / 14 Branchbran 100% 8 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 100% 22 / 22 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« t/func.xs ↑ Summary t/prefix.xs »
1 /* You may distribute under the terms of either the GNU General Public License
2 * or the Artistic License (the same terms as Perl itself)
3 *
4 * (C) Paul Evans, 2020 -- leonerd@leonerd.org.uk
5 */
6  
7 #include "EXTERN.h"
8 #include "perl.h"
9 #include "XSUB.h"
10  
11 #include "XSParseSublike.h"
12  
13 static bool parts_permit(pTHX_ void *_);
14  
15 static struct XSParseSublikeHooks parse_parts_hooks = {
16 .ver = XSPARSESUBLIKE_ABI_VERSION,
17 .permit = parts_permit,
18 };
19  
20 10 static bool parts_permit(pTHX_ void *_)
21 {
22 10 parse_parts_hooks.require_parts = 0;
23 10 parse_parts_hooks.skip_parts = 0;
24  
25 10 ▶ if(hv_fetchs(GvHV(PL_hintgv), "t::parts/require-name", 0))
Branch: 1 branch
BranchTrueFalseTotal
if(hv_fetchs(GvHV(PL_hintgv), "t::parts/require-name", 0)) 1 9 10
26 1 parse_parts_hooks.require_parts |= XS_PARSE_SUBLIKE_PART_NAME;
27 10 ▶ if(hv_fetchs(GvHV(PL_hintgv), "t::parts/skip-name", 0))
Branch: 1 branch
BranchTrueFalseTotal
if(hv_fetchs(GvHV(PL_hintgv), "t::parts/skip-name", 0)) 1 9 10
28 1 parse_parts_hooks.skip_parts |= XS_PARSE_SUBLIKE_PART_NAME;
29  
30 10 ▶ if(hv_fetchs(GvHV(PL_hintgv), "t::parts/skip-attrs", 0))
Branch: 1 branch
BranchTrueFalseTotal
if(hv_fetchs(GvHV(PL_hintgv), "t::parts/skip-attrs", 0)) 1 9 10
31 1 parse_parts_hooks.skip_parts |= XS_PARSE_SUBLIKE_PART_ATTRS;
32  
33 10 ▶ if(hv_fetchs(GvHV(PL_hintgv), "t::parts/skip-signature", 0))
Branch: 1 branch
BranchTrueFalseTotal
if(hv_fetchs(GvHV(PL_hintgv), "t::parts/skip-signature", 0)) 1 9 10
34 1 parse_parts_hooks.skip_parts |= XS_PARSE_SUBLIKE_PART_SIGNATURE;
35  
36 10 return TRUE;
37 }
38  
39 MODULE = t::parts PACKAGE = t::parts
40  
41 BOOT:
42 3 boot_xs_parse_sublike(0);
43  
44 3 register_xs_parse_sublike("parts", &parse_parts_hooks, NULL);
« t/func.xs ↑ Summary t/prefix.xs »