| 1 |
|
| #include "cbor_free_boolean.h" |
| 2 |
|
| |
| 3 |
|
| static HV *boolean_stash = NULL; |
| 4 |
|
| |
| 5 |
14 |
| HV *cbf_get_boolean_stash() { |
| 6 |
14 |
▶ | if (!boolean_stash) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (!boolean_stash) { |
5 |
9 |
14 |
|
| 7 |
|
| dTHX; |
| 8 |
|
| |
| 9 |
5 |
| boolean_stash = gv_stashpv(BOOLEAN_CLASS, 0); |
| 10 |
|
| |
| 11 |
5 |
▶ | if (!boolean_stash) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (!boolean_stash) { |
1 |
4 |
5 |
|
| 12 |
1 |
| SV *modname = newSVpvs(LOAD_BOOLEAN_CLASS); |
| 13 |
1 |
| load_module(PERL_LOADMOD_NOIMPORT, modname, NULL); |
| 14 |
|
| |
| 15 |
1 |
| boolean_stash = gv_stashpv(BOOLEAN_CLASS, 0); |
| 16 |
|
| |
| 17 |
1 |
▶ | if (!boolean_stash) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (!boolean_stash) { |
0 |
1 |
1 |
|
| 18 |
0 |
| _croak("Loaded Types::Serialiser but didn’t find stash!"); |
| 19 |
|
| } |
| 20 |
|
| } |
| 21 |
|
| } |
| 22 |
|
| |
| 23 |
14 |
| return boolean_stash; |
| 24 |
|
| } |
| 25 |
|
| |
| 26 |
|
| static SV *stored_false = NULL; |
| 27 |
|
| static SV *stored_true = NULL; |
| 28 |
|
| |
| 29 |
3 |
| SV *cbf_get_false() { |
| 30 |
3 |
▶ | if (!stored_false) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (!stored_false) { |
2 |
1 |
3 |
|
| 31 |
|
| dTHX; |
| 32 |
2 |
| cbf_get_boolean_stash(); |
| 33 |
2 |
| stored_false = get_sv("Types::Serialiser::false", 0); |
| 34 |
|
| } |
| 35 |
|
| |
| 36 |
3 |
| return stored_false; |
| 37 |
|
| } |
| 38 |
|
| |
| 39 |
6 |
| SV *cbf_get_true() { |
| 40 |
6 |
▶ | if (!stored_true) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (!stored_true) { |
3 |
3 |
6 |
|
| 41 |
|
| dTHX; |
| 42 |
3 |
| cbf_get_boolean_stash(); |
| 43 |
3 |
| stored_true = get_sv("Types::Serialiser::true", 0); |
| 44 |
|
| } |
| 45 |
|
| |
| 46 |
6 |
| return stored_true; |
| 47 |
|
| } |