File Coverage

ext/B/const-c.inc
Criterion Covered Total %
statement 10 12 83.3
branch n/a
condition n/a
subroutine n/a
total 10 12 83.3


line stmt bran cond sub time code
1           #define PERL_constant_NOTFOUND 1
2           #define PERL_constant_NOTDEF 2
3           #define PERL_constant_ISIV 3
4           #define PERL_constant_ISNO 4
5           #define PERL_constant_ISNV 5
6           #define PERL_constant_ISPV 6
7           #define PERL_constant_ISPVN 7
8           #define PERL_constant_ISSV 8
9           #define PERL_constant_ISUNDEF 9
10           #define PERL_constant_ISUV 10
11           #define PERL_constant_ISYES 11
12            
13           #ifndef NVTYPE
14           typedef double NV; /* 5.6 and later define NVTYPE, and typedef NV to it. */
15           #endif
16           #ifndef aTHX_
17           #define aTHX_ /* 5.6 or later define this for threading support. */
18           #endif
19           #ifndef pTHX_
20           #define pTHX_ /* 5.6 or later define this for threading support. */
21           #endif
22            
23           static HE *
24 1498224         _add_symbol(pTHX_ HV *hash, const char *name, I32 namelen, SV *value) {
25 1498224         HE *he = (HE*) hv_common_key_len(hash, name, namelen, HV_FETCH_LVALUE, NULL,
26           0);
27           SV *sv;
28            
29 1498224         if (!he) {
30 0         Perl_croak(aTHX_ "Couldn't add key '%s' to %%B::",
31           name);
32           }
33 1498224         sv = HeVAL(he);
34 2996448         if (SvOK(sv) || SvTYPE(sv) == SVt_PVGV) {
35           /* Someone has been here before us - have to make a real sub. */
36 0         newCONSTSUB(hash, name, value);
37           } else {
38 2996448         SvUPGRADE(sv, SVt_RV);
39 1498224         SvRV_set(sv, value);
40 1498224         SvROK_on(sv);
41 1498224         SvREADONLY_on(value);
42           }
43 1498224         return he;
44           }
45            
46            
47            
48           #ifndef SYMBIAN
49            
50           /* Store a hash of all symbols missing from the package. To avoid trampling on
51           the package namespace (uninvited) put each package's hash in our namespace.
52           To avoid creating lots of typeblogs and symbol tables for sub-packages, put
53           each package's hash into one hash in our namespace. */
54            
55           static HV *
56           get_missing_hash(pTHX) {
57           HV *const parent
58           = get_hv("ExtUtils::Constant::ProxySubs::Missing", GVf_MULTI);
59           /* We could make a hash of hashes directly, but this would confuse anything
60           at Perl space that looks at us, and as we're visible in Perl space,
61           best to play nice. */
62           SV *const *const ref
63           = hv_fetch(parent, "B", 1, TRUE);
64           HV *new_hv;
65            
66           if (!ref)
67           return NULL;
68            
69           if (SvROK(*ref))
70           return (HV*) SvRV(*ref);
71            
72           new_hv = newHV();
73           SvUPGRADE(*ref, SVt_RV);
74           SvRV_set(*ref, (SV *)new_hv);
75           SvROK_on(*ref);
76           return new_hv;
77           }
78            
79           #endif
80            
81           struct notfound_s {const char *name; I32 namelen;} ;
82            
83           static const struct notfound_s values_for_notfound[] =
84           {
85           { NULL, 0 } };
86           struct iv_s {const char *name; I32 namelen; IV value;};
87           struct uv_s {const char *name; I32 namelen; UV value;};