xsubs/sourcify.xs

filter: Statementstmt 100% 14 / 14 Branchbran 100% 14 / 14 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 100% 28 / 28 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« xsubs/sizeof.xs ↑ Summary xsubs/typeof.xs »
1 ################################################################################
2 #
3 # Copyright (c) 2002-2020 Marcus Holland-Moritz. All rights reserved.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the same terms as Perl itself.
6 #
7 ################################################################################
8  
9  
10 ################################################################################
11 #
12 # METHOD: sourcify
13 #
14 # WRITTEN BY: Marcus Holland-Moritz ON: Oct 2002
15 # CHANGED BY: ON:
16 #
17 ################################################################################
18  
19 SV *
20 CBC::sourcify(...)
21 PREINIT:
22 974 CBC_METHOD(sourcify);
23 SourcifyConfig sc;
24  
25 CODE:
26 CT_DEBUG_METHOD;
27  
28 974 ▶ CHECK_PARSE_DATA;
Branch: 1 branch
BranchTrueFalseTotal
CHECK_PARSE_DATA; 6 968 974
29 968 ▶ CHECK_VOID_CONTEXT;
Branch: 2 branches
BranchTrueFalseTotal
CHECK_VOID_CONTEXT; 6 962 968
CHECK_VOID_CONTEXT; 4 2 6
30  
31 /* preset with defaults */
32 962 sc.context = 0;
33 962 sc.defines = 0;
34  
35 962 ▶ if (items == 2 && SvROK(ST(1)))
Branch: 2 branches
BranchTrueFalseTotal
if (items == 2 && SvROK(ST(1))) 935 27 962
if (items == 2 && SvROK(ST(1))) 929 6 935
36 917 {
37 929 SV *sv = SvRV(ST(1));
38  
39 929 ▶ if (SvTYPE(sv) == SVt_PVHV)
Branch: 1 branch
BranchTrueFalseTotal
if (SvTYPE(sv) == SVt_PVHV) 923 6 929
40 923 get_sourcify_config(aTHX_ (HV *) sv, &sc);
41 else
42 6 Perl_croak(aTHX_ "Need a hash reference for configuration options");
43 }
44 33 ▶ else if (items >= 2)
Branch: 1 branch
BranchTrueFalseTotal
else if (items >= 2) 18 15 33
45 18 Perl_croak(aTHX_ "Sourcification of individual types is not yet supported");
46  
47 932 RETVAL = get_parsed_definitions_string(aTHX_ &THIS->cpi, &sc);
48  
49 OUTPUT:
50 RETVAL
51  
« xsubs/sizeof.xs ↑ Summary xsubs/typeof.xs »