| 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: configure |
| 13 |
|
| # |
| 14 |
|
| # WRITTEN BY: Marcus Holland-Moritz ON: Jan 2002 |
| 15 |
|
| # CHANGED BY: ON: |
| 16 |
|
| # |
| 17 |
|
| ################################################################################ |
| 18 |
|
| |
| 19 |
|
| SV * |
| 20 |
|
| CBC::configure(...) |
| 21 |
|
| PREINIT: |
| 22 |
7737 |
| CBC_METHOD(configure); |
| 23 |
|
| |
| 24 |
|
| CODE: |
| 25 |
|
| CT_DEBUG_METHOD; |
| 26 |
|
| |
| 27 |
7737 |
▶ | if (items <= 2 && GIMME_V == G_VOID) |
Branch: 2 branches
| Branch | True | False | Total |
| if (items <= 2 && GIMME_V == G_VOID) |
1244 |
6493 |
7737 |
| if (items <= 2 && GIMME_V == G_VOID) |
27 |
1217 |
1244 |
|
| 28 |
|
| { |
| 29 |
27 |
▶ | WARN_VOID_CONTEXT; |
Branch: 1 branch
| Branch | True | False | Total |
| WARN_VOID_CONTEXT; |
26 |
1 |
27 |
|
| 30 |
6080 |
| XSRETURN_EMPTY; |
| 31 |
|
| } |
| 32 |
7710 |
▶ | else if (items == 1) |
Branch: 1 branch
| Branch | True | False | Total |
| else if (items == 1) |
982 |
6728 |
7710 |
|
| 33 |
982 |
| RETVAL = get_configuration(aTHX_ THIS); |
| 34 |
6728 |
▶ | else if (items == 2) |
Branch: 1 branch
| Branch | True | False | Total |
| else if (items == 2) |
235 |
6493 |
6728 |
|
| 35 |
235 |
| handle_option(aTHX_ THIS, ST(1), NULL, &RETVAL, NULL); |
| 36 |
6493 |
▶ | else if (items % 2) |
Branch: 1 branch
| Branch | True | False | Total |
| else if (items % 2) |
6492 |
1 |
6493 |
|
| 37 |
|
| { |
| 38 |
6492 |
| int i, changes = 0, layout = 0, preproc = 0; |
| 39 |
|
| HandleOptionResult res; |
| 40 |
|
| |
| 41 |
12915 |
▶ | for (i = 1; i < items; i += 2) |
Branch: 1 branch
| Branch | True | False | Total |
| for (i = 1; i < items; i += 2) |
6862 |
6053 |
12915 |
|
| 42 |
|
| { |
| 43 |
6862 |
| handle_option(aTHX_ THIS, ST(i), ST(i+1), NULL, &res); |
| 44 |
6423 |
▶ | if (res.option_modified) |
Branch: 1 branch
| Branch | True | False | Total |
| if (res.option_modified) |
5990 |
433 |
6423 |
|
| 45 |
5990 |
| changes = 1; |
| 46 |
6423 |
▶ | if (res.impacts_layout) |
Branch: 1 branch
| Branch | True | False | Total |
| if (res.impacts_layout) |
6137 |
286 |
6423 |
|
| 47 |
6137 |
| layout = 1; |
| 48 |
6423 |
▶ | if (res.impacts_preproc) |
Branch: 1 branch
| Branch | True | False | Total |
| if (res.impacts_preproc) |
139 |
6284 |
6423 |
|
| 49 |
139 |
| preproc = 1; |
| 50 |
|
| } |
| 51 |
|
| |
| 52 |
6053 |
▶ | if (changes) |
Branch: 1 branch
| Branch | True | False | Total |
| if (changes) |
5908 |
145 |
6053 |
|
| 53 |
|
| { |
| 54 |
5908 |
▶ | if (layout) |
Branch: 1 branch
| Branch | True | False | Total |
| if (layout) |
5764 |
144 |
5908 |
|
| 55 |
|
| { |
| 56 |
5764 |
| basic_types_reset(THIS->basic); |
| 57 |
|
| |
| 58 |
5764 |
▶ | if (THIS->cpi.available && THIS->cpi.ready) |
Branch: 2 branches
| Branch | True | False | Total |
| if (THIS->cpi.available && THIS->cpi.ready) |
5632 |
132 |
5764 |
| if (THIS->cpi.available && THIS->cpi.ready) |
5595 |
37 |
5632 |
|
| 59 |
5595 |
| reset_parse_info(&THIS->cpi); |
| 60 |
|
| } |
| 61 |
|
| |
| 62 |
5908 |
▶ | if (preproc) |
Branch: 1 branch
| Branch | True | False | Total |
| if (preproc) |
82 |
5826 |
5908 |
|
| 63 |
|
| { |
| 64 |
82 |
| reset_preprocessor(&THIS->cpi); |
| 65 |
|
| } |
| 66 |
|
| } |
| 67 |
|
| |
| 68 |
6053 |
| XSRETURN(1); |
| 69 |
|
| } |
| 70 |
|
| else |
| 71 |
1 |
| Perl_croak(aTHX_ "Invalid number of arguments to %s", method); |
| 72 |
|
| |
| 73 |
|
| OUTPUT: |
| 74 |
|
| RETVAL |
| 75 |
|
| |