xsubs/cbc.xs

filter: Statementstmt 100% 17 / 17 Branchbran 100% 12 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 100% 29 / 29 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« xsubs/arg.xs ↑ Summary xsubs/clean.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 # CONSTRUCTOR
13 #
14 # WRITTEN BY: Marcus Holland-Moritz ON: Jan 2002
15 # CHANGED BY: ON:
16 #
17 ################################################################################
18  
19 void
20 CBC::new(...)
21 PREINIT:
22 1356 CBC_METHOD(new);
23  
24 PPCODE:
25 CT_DEBUG_METHOD;
26  
27 1356 ▶ if (items % 2 == 0)
Branch: 1 branch
BranchTrueFalseTotal
if (items % 2 == 0) 2 1354 1356
28 2 Perl_croak(aTHX_ "Number of configuration arguments "
29 "to %s must be even", method);
30 else
31 {
32 int i;
33 1354 CBC *THIS = cbc_new(aTHX);
34  
35 1354 ▶ if (gs_DisableParser)
Branch: 1 branch
BranchTrueFalseTotal
if (gs_DisableParser) 2 1352 1354
36 {
37 2 Perl_warn(aTHX_ XSCLASS " parser is DISABLED");
38 2 THIS->cfg.disable_parser = 1;
39 }
40  
41 /* Only preset the option here, user may explicitly */
42 /* disable OrderMembers in the constructor */
43 1354 ▶ if (gs_OrderMembers)
Branch: 1 branch
BranchTrueFalseTotal
if (gs_OrderMembers) 2 1352 1354
44 2 THIS->order_members = 1;
45  
46 /*
47 * bless the new object here, because handle_option()
48 * may croak and DESTROY would not be called to free
49 * the memory that has been allocated
50 */
51 1354 ST(0) = sv_2mortal(cbc_bless(aTHX_ THIS, CLASS));
52  
53 2216 ▶ for (i = 1; i < items; i += 2)
Branch: 1 branch
BranchTrueFalseTotal
for (i = 1; i < items; i += 2) 865 1351 2216
54 865 handle_option(aTHX_ THIS, ST(i), ST(i+1), NULL, NULL);
55  
56 1351 ▶ if (gs_OrderMembers && THIS->order_members)
Branch: 2 branches
BranchTrueFalseTotal
if (gs_OrderMembers && THIS->order_members) 2 1349 1351
if (gs_OrderMembers && THIS->order_members) 1 1 2
57 1 load_indexed_hash_module(aTHX_ THIS);
58  
59 1351 XSRETURN(1);
60 }
61  
62  
63 ################################################################################
64 #
65 # DESTRUCTOR
66 #
67 # WRITTEN BY: Marcus Holland-Moritz ON: Jan 2002
68 # CHANGED BY: ON:
69 #
70 ################################################################################
71  
72 void
73 CBC::DESTROY()
74 PREINIT:
75 1425 CBC_METHOD(DESTROY);
76  
77 CODE:
78 CT_DEBUG_METHOD;
79  
80 1425 cbc_delete(aTHX_ THIS);
81  
« xsubs/arg.xs ↑ Summary xsubs/clean.xs »