File Coverage

const-c.inc
Criterion Covered Total %
statement 20 24 83.3
branch 7 14 50.0
condition n/a
subroutine n/a
pod n/a
total 27 38 71.0


line stmt bran cond sub pod 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             /* This allows slightly more efficient code on !USE_ITHREADS: */
24             #ifdef USE_ITHREADS
25             # define COP_FILE(c) CopFILE(c)
26             # define COP_FILE_F "s"
27             #else
28             # define COP_FILE(c) CopFILESV(c)
29             # define COP_FILE_F SVf
30             #endif
31              
32             static void
33 2           constant_add_symbol(pTHX_ HV *hash, const char *name, I32 namelen, SV *value) {
34 2           HE *he = (HE*) hv_common_key_len(hash, name, namelen, HV_FETCH_LVALUE, NULL,
35             0);
36             SV *sv;
37              
38 2 50         if (!he) {
39 0           croak("Couldn't add key '%s' to %%Dir::TempChdir::",
40             name);
41             }
42 2           sv = HeVAL(he);
43 2 50         if (SvOK(sv) || SvTYPE(sv) == SVt_PVGV) {
    50          
44             /* Someone has been here before us - have to make a real sub. */
45 0           newCONSTSUB(hash, name, value);
46             } else {
47 2 50         SvUPGRADE(sv, SVt_RV);
48 2           SvRV_set(sv, value);
49 2           SvROK_on(sv);
50 2           SvREADONLY_on(value);
51             }
52 2           }
53              
54              
55              
56             #ifndef SYMBIAN
57              
58             /* Store a hash of all symbols missing from the package. To avoid trampling on
59             the package namespace (uninvited) put each package's hash in our namespace.
60             To avoid creating lots of typeblogs and symbol tables for sub-packages, put
61             each package's hash into one hash in our namespace. */
62              
63             static HV *
64 2           get_missing_hash(pTHX) {
65             HV *const parent
66 2           = get_hv("ExtUtils::Constant::ProxySubs::Missing", GVf_MULTI);
67             /* We could make a hash of hashes directly, but this would confuse anything
68             at Perl space that looks at us, and as we're visible in Perl space,
69             best to play nice. */
70             SV *const *const ref
71 2           = hv_fetch(parent, "Dir::TempChdir", 14, TRUE);
72             HV *new_hv;
73              
74 2 50         if (!ref)
75 0           return NULL;
76              
77 2 50         if (SvROK(*ref))
78 0           return (HV*) SvRV(*ref);
79              
80 2           new_hv = newHV();
81 2 50         SvUPGRADE(*ref, SVt_RV);
82 2           SvRV_set(*ref, (SV *)new_hv);
83 2           SvROK_on(*ref);
84 2           return new_hv;
85             }
86              
87             #endif
88              
89             struct notfound_s {const char *name; I32 namelen;} ;
90              
91             static const struct notfound_s values_for_notfound[] =
92             {
93             #ifndef O_PATH
94             { "O_PATH", 6 },
95             #endif
96             #ifndef O_SEARCH
97             { "O_SEARCH", 8 },
98             #endif
99             { NULL, 0 } };
100             struct iv_s {const char *name; I32 namelen; IV value;};