| 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 |
228 |
| constant_add_symbol(pTHX_ HV *hash, const char *name, I32 namelen, SV *value) { |
| 25 |
228 |
| HE *he = (HE*) hv_common_key_len(hash, name, namelen, HV_FETCH_LVALUE, NULL, |
| 26 |
|
| 0); |
| 27 |
|
| SV *sv; |
| 28 |
|
| |
| 29 |
228 |
▶ | if (!he) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (!he) { |
0 |
228 |
228 |
|
| 30 |
0 |
| croak("Couldn't add key '%s' to %%Ouroboros::", |
| 31 |
|
| name); |
| 32 |
|
| } |
| 33 |
228 |
| sv = HeVAL(he); |
| 34 |
228 |
▶ | if (SvOK(sv) || SvTYPE(sv) == SVt_PVGV) { |
Branch: 2 branches
| Branch | True | False | Total |
| if (SvOK(sv) || SvTYPE(sv) == SVt_PVGV) { |
225 |
3 |
228 |
| if (SvOK(sv) || SvTYPE(sv) == SVt_PVGV) { |
0 |
225 |
225 |
|
| 35 |
|
| /* Someone has been here before us - have to make a real sub. */ |
| 36 |
3 |
| newCONSTSUB(hash, name, value); |
| 37 |
|
| } else { |
| 38 |
225 |
▶ | SvUPGRADE(sv, SVt_RV); |
Branch: 1 branch
| Branch | True | False | Total |
| SvUPGRADE(sv, SVt_RV); |
225 |
0 |
225 |
|
| 39 |
225 |
| SvRV_set(sv, value); |
| 40 |
225 |
| SvROK_on(sv); |
| 41 |
225 |
| SvREADONLY_on(value); |
| 42 |
|
| } |
| 43 |
228 |
| 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 |
3 |
| get_missing_hash(pTHX) { |
| 57 |
|
| HV *const parent |
| 58 |
3 |
| = 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 |
3 |
| = hv_fetch(parent, "Ouroboros", 9, TRUE); |
| 64 |
|
| HV *new_hv; |
| 65 |
|
| |
| 66 |
3 |
▶ | if (!ref) |
Branch: 1 branch
| Branch | True | False | Total |
| if (!ref) |
0 |
3 |
3 |
|
| 67 |
0 |
| return NULL; |
| 68 |
|
| |
| 69 |
3 |
▶ | if (SvROK(*ref)) |
Branch: 1 branch
| Branch | True | False | Total |
| if (SvROK(*ref)) |
0 |
3 |
3 |
|
| 70 |
0 |
| return (HV*) SvRV(*ref); |
| 71 |
|
| |
| 72 |
3 |
| new_hv = newHV(); |
| 73 |
3 |
▶ | SvUPGRADE(*ref, SVt_RV); |
Branch: 1 branch
| Branch | True | False | Total |
| SvUPGRADE(*ref, SVt_RV); |
3 |
0 |
3 |
|
| 74 |
3 |
| SvRV_set(*ref, (SV *)new_hv); |
| 75 |
3 |
| SvROK_on(*ref); |
| 76 |
3 |
| 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 |
|
| #ifndef SV_CATBYTES |
| 86 |
|
| { "SV_CATBYTES", 11 }, |
| 87 |
|
| #endif |
| 88 |
|
| #ifndef SV_CATUTF8 |
| 89 |
|
| { "SV_CATUTF8", 10 }, |
| 90 |
|
| #endif |
| 91 |
|
| #ifndef SV_CONST_RETURN |
| 92 |
|
| { "SV_CONST_RETURN", 15 }, |
| 93 |
|
| #endif |
| 94 |
|
| #ifndef SV_COW_DROP_PV |
| 95 |
|
| { "SV_COW_DROP_PV", 14 }, |
| 96 |
|
| #endif |
| 97 |
|
| #ifndef SV_FORCE_UTF8_UPGRADE |
| 98 |
|
| { "SV_FORCE_UTF8_UPGRADE", 21 }, |
| 99 |
|
| #endif |
| 100 |
|
| #ifndef SV_GMAGIC |
| 101 |
|
| { "SV_GMAGIC", 9 }, |
| 102 |
|
| #endif |
| 103 |
|
| #ifndef SV_HAS_TRAILING_NUL |
| 104 |
|
| { "SV_HAS_TRAILING_NUL", 19 }, |
| 105 |
|
| #endif |
| 106 |
|
| #ifndef SV_IMMEDIATE_UNREF |
| 107 |
|
| { "SV_IMMEDIATE_UNREF", 18 }, |
| 108 |
|
| #endif |
| 109 |
|
| #ifndef SV_NOSTEAL |
| 110 |
|
| { "SV_NOSTEAL", 10 }, |
| 111 |
|
| #endif |
| 112 |
|
| #ifndef SV_SMAGIC |
| 113 |
|
| { "SV_SMAGIC", 9 }, |
| 114 |
|
| #endif |
| 115 |
|
| #ifndef GV_ADD |
| 116 |
|
| { "GV_ADD", 6 }, |
| 117 |
|
| #endif |
| 118 |
|
| #ifndef GV_ADDMG |
| 119 |
|
| { "GV_ADDMG", 8 }, |
| 120 |
|
| #endif |
| 121 |
|
| #ifndef GV_ADDMULTI |
| 122 |
|
| { "GV_ADDMULTI", 11 }, |
| 123 |
|
| #endif |
| 124 |
|
| #ifndef GV_NOADD_NOINIT |
| 125 |
|
| { "GV_NOADD_NOINIT", 15 }, |
| 126 |
|
| #endif |
| 127 |
|
| #ifndef GV_NOEXPAND |
| 128 |
|
| { "GV_NOEXPAND", 11 }, |
| 129 |
|
| #endif |
| 130 |
|
| #ifndef GV_NOINIT |
| 131 |
|
| { "GV_NOINIT", 9 }, |
| 132 |
|
| #endif |
| 133 |
|
| #ifndef GV_SUPER |
| 134 |
|
| { "GV_SUPER", 8 }, |
| 135 |
|
| #endif |
| 136 |
|
| #ifndef PERL_MAGIC_arylen |
| 137 |
|
| { "PERL_MAGIC_arylen", 17 }, |
| 138 |
|
| #endif |
| 139 |
|
| #ifndef PERL_MAGIC_arylen_p |
| 140 |
|
| { "PERL_MAGIC_arylen_p", 19 }, |
| 141 |
|
| #endif |
| 142 |
|
| #ifndef PERL_MAGIC_backref |
| 143 |
|
| { "PERL_MAGIC_backref", 18 }, |
| 144 |
|
| #endif |
| 145 |
|
| #ifndef PERL_MAGIC_bm |
| 146 |
|
| { "PERL_MAGIC_bm", 13 }, |
| 147 |
|
| #endif |
| 148 |
|
| #ifndef PERL_MAGIC_checkcall |
| 149 |
|
| { "PERL_MAGIC_checkcall", 20 }, |
| 150 |
|
| #endif |
| 151 |
|
| #ifndef PERL_MAGIC_collxfrm |
| 152 |
|
| { "PERL_MAGIC_collxfrm", 19 }, |
| 153 |
|
| #endif |
| 154 |
|
| #ifndef PERL_MAGIC_dbfile |
| 155 |
|
| { "PERL_MAGIC_dbfile", 17 }, |
| 156 |
|
| #endif |
| 157 |
|
| #ifndef PERL_MAGIC_dbline |
| 158 |
|
| { "PERL_MAGIC_dbline", 17 }, |
| 159 |
|
| #endif |
| 160 |
|
| #ifndef PERL_MAGIC_debugvar |
| 161 |
|
| { "PERL_MAGIC_debugvar", 19 }, |
| 162 |
|
| #endif |
| 163 |
|
| #ifndef PERL_MAGIC_defelem |
| 164 |
|
| { "PERL_MAGIC_defelem", 18 }, |
| 165 |
|
| #endif |
| 166 |
|
| #ifndef PERL_MAGIC_env |
| 167 |
|
| { "PERL_MAGIC_env", 14 }, |
| 168 |
|
| #endif |
| 169 |
|
| #ifndef PERL_MAGIC_envelem |
| 170 |
|
| { "PERL_MAGIC_envelem", 18 }, |
| 171 |
|
| #endif |
| 172 |
|
| #ifndef PERL_MAGIC_ext |
| 173 |
|
| { "PERL_MAGIC_ext", 14 }, |
| 174 |
|
| #endif |
| 175 |
|
| #ifndef PERL_MAGIC_fm |
| 176 |
|
| { "PERL_MAGIC_fm", 13 }, |
| 177 |
|
| #endif |
| 178 |
|
| #ifndef PERL_MAGIC_foo |
| 179 |
|
| { "PERL_MAGIC_foo", 14 }, |
| 180 |
|
| #endif |
| 181 |
|
| #ifndef PERL_MAGIC_hints |
| 182 |
|
| { "PERL_MAGIC_hints", 16 }, |
| 183 |
|
| #endif |
| 184 |
|
| #ifndef PERL_MAGIC_hintselem |
| 185 |
|
| { "PERL_MAGIC_hintselem", 20 }, |
| 186 |
|
| #endif |
| 187 |
|
| #ifndef PERL_MAGIC_isa |
| 188 |
|
| { "PERL_MAGIC_isa", 14 }, |
| 189 |
|
| #endif |
| 190 |
|
| #ifndef PERL_MAGIC_isaelem |
| 191 |
|
| { "PERL_MAGIC_isaelem", 18 }, |
| 192 |
|
| #endif |
| 193 |
|
| #ifndef PERL_MAGIC_lvref |
| 194 |
|
| { "PERL_MAGIC_lvref", 16 }, |
| 195 |
|
| #endif |
| 196 |
|
| #ifndef PERL_MAGIC_nkeys |
| 197 |
|
| { "PERL_MAGIC_nkeys", 16 }, |
| 198 |
|
| #endif |
| 199 |
|
| #ifndef PERL_MAGIC_overload_table |
| 200 |
|
| { "PERL_MAGIC_overload_table", 25 }, |
| 201 |
|
| #endif |
| 202 |
|
| #ifndef PERL_MAGIC_pos |
| 203 |
|
| { "PERL_MAGIC_pos", 14 }, |
| 204 |
|
| #endif |
| 205 |
|
| #ifndef PERL_MAGIC_qr |
| 206 |
|
| { "PERL_MAGIC_qr", 13 }, |
| 207 |
|
| #endif |
| 208 |
|
| #ifndef PERL_MAGIC_regdata |
| 209 |
|
| { "PERL_MAGIC_regdata", 18 }, |
| 210 |
|
| #endif |
| 211 |
|
| #ifndef PERL_MAGIC_regdatum |
| 212 |
|
| { "PERL_MAGIC_regdatum", 19 }, |
| 213 |
|
| #endif |
| 214 |
|
| #ifndef PERL_MAGIC_regex_global |
| 215 |
|
| { "PERL_MAGIC_regex_global", 23 }, |
| 216 |
|
| #endif |
| 217 |
|
| #ifndef PERL_MAGIC_rhash |
| 218 |
|
| { "PERL_MAGIC_rhash", 16 }, |
| 219 |
|
| #endif |
| 220 |
|
| #ifndef PERL_MAGIC_shared |
| 221 |
|
| { "PERL_MAGIC_shared", 17 }, |
| 222 |
|
| #endif |
| 223 |
|
| #ifndef PERL_MAGIC_shared_scalar |
| 224 |
|
| { "PERL_MAGIC_shared_scalar", 24 }, |
| 225 |
|
| #endif |
| 226 |
|
| #ifndef PERL_MAGIC_sig |
| 227 |
|
| { "PERL_MAGIC_sig", 14 }, |
| 228 |
|
| #endif |
| 229 |
|
| #ifndef PERL_MAGIC_sigelem |
| 230 |
|
| { "PERL_MAGIC_sigelem", 18 }, |
| 231 |
|
| #endif |
| 232 |
|
| #ifndef PERL_MAGIC_substr |
| 233 |
|
| { "PERL_MAGIC_substr", 17 }, |
| 234 |
|
| #endif |
| 235 |
|
| #ifndef PERL_MAGIC_sv |
| 236 |
|
| { "PERL_MAGIC_sv", 13 }, |
| 237 |
|
| #endif |
| 238 |
|
| #ifndef PERL_MAGIC_symtab |
| 239 |
|
| { "PERL_MAGIC_symtab", 17 }, |
| 240 |
|
| #endif |
| 241 |
|
| #ifndef PERL_MAGIC_taint |
| 242 |
|
| { "PERL_MAGIC_taint", 16 }, |
| 243 |
|
| #endif |
| 244 |
|
| #ifndef PERL_MAGIC_tied |
| 245 |
|
| { "PERL_MAGIC_tied", 15 }, |
| 246 |
|
| #endif |
| 247 |
|
| #ifndef PERL_MAGIC_tiedelem |
| 248 |
|
| { "PERL_MAGIC_tiedelem", 19 }, |
| 249 |
|
| #endif |
| 250 |
|
| #ifndef PERL_MAGIC_tiedscalar |
| 251 |
|
| { "PERL_MAGIC_tiedscalar", 21 }, |
| 252 |
|
| #endif |
| 253 |
|
| #ifndef PERL_MAGIC_utf8 |
| 254 |
|
| { "PERL_MAGIC_utf8", 15 }, |
| 255 |
|
| #endif |
| 256 |
|
| #ifndef PERL_MAGIC_uvar |
| 257 |
|
| { "PERL_MAGIC_uvar", 15 }, |
| 258 |
|
| #endif |
| 259 |
|
| #ifndef PERL_MAGIC_uvar_elem |
| 260 |
|
| { "PERL_MAGIC_uvar_elem", 20 }, |
| 261 |
|
| #endif |
| 262 |
|
| #ifndef PERL_MAGIC_vec |
| 263 |
|
| { "PERL_MAGIC_vec", 14 }, |
| 264 |
|
| #endif |
| 265 |
|
| #ifndef PERL_MAGIC_vstring |
| 266 |
|
| { "PERL_MAGIC_vstring", 18 }, |
| 267 |
|
| #endif |
| 268 |
|
| { NULL, 0 } }; |
| 269 |
|
| struct iv_s {const char *name; I32 namelen; IV value;}; |
| 270 |
|
| struct uv_s {const char *name; I32 namelen; UV value;}; |