| 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 |
93 |
| constant_add_symbol(pTHX_ HV *hash, const char *name, I32 namelen, SV *value) { |
| 25 |
93 |
| HE *he = (HE*) hv_common_key_len(hash, name, namelen, HV_FETCH_LVALUE, NULL, |
| 26 |
|
| 0); |
| 27 |
|
| SV *sv; |
| 28 |
|
| |
| 29 |
93 |
▶ | if (!he) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (!he) { |
0 |
93 |
93 |
|
| 30 |
0 |
| croak("Couldn't add key '%s' to %%Ouroboros::", |
| 31 |
|
| name); |
| 32 |
|
| } |
| 33 |
93 |
| sv = HeVAL(he); |
| 34 |
93 |
▶ | if (SvOK(sv) || SvTYPE(sv) == SVt_PVGV) { |
Branch: 2 branches
| Branch | True | False | Total |
| if (SvOK(sv) || SvTYPE(sv) == SVt_PVGV) { |
90 |
3 |
93 |
| if (SvOK(sv) || SvTYPE(sv) == SVt_PVGV) { |
0 |
90 |
90 |
|
| 35 |
|
| /* Someone has been here before us - have to make a real sub. */ |
| 36 |
3 |
| newCONSTSUB(hash, name, value); |
| 37 |
|
| } else { |
| 38 |
90 |
▶ | SvUPGRADE(sv, SVt_RV); |
Branch: 1 branch
| Branch | True | False | Total |
| SvUPGRADE(sv, SVt_RV); |
90 |
0 |
90 |
|
| 39 |
90 |
| SvRV_set(sv, value); |
| 40 |
90 |
| SvROK_on(sv); |
| 41 |
90 |
| SvREADONLY_on(value); |
| 42 |
|
| } |
| 43 |
93 |
| 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 |
0 |
| get_missing_hash(pTHX) { |
| 57 |
|
| HV *const parent |
| 58 |
0 |
| = 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 |
0 |
| = hv_fetch(parent, "Ouroboros", 9, TRUE); |
| 64 |
|
| HV *new_hv; |
| 65 |
|
| |
| 66 |
0 |
▶ | if (!ref) |
Branch: 1 branch
| Branch | True | False | Total |
| if (!ref) |
0 |
0 |
0 |
|
| 67 |
0 |
| return NULL; |
| 68 |
|
| |
| 69 |
0 |
▶ | if (SvROK(*ref)) |
Branch: 1 branch
| Branch | True | False | Total |
| if (SvROK(*ref)) |
0 |
0 |
0 |
|
| 70 |
0 |
| return (HV*) SvRV(*ref); |
| 71 |
|
| |
| 72 |
0 |
| new_hv = newHV(); |
| 73 |
0 |
▶ | SvUPGRADE(*ref, SVt_RV); |
Branch: 1 branch
| Branch | True | False | Total |
| SvUPGRADE(*ref, SVt_RV); |
0 |
0 |
0 |
|
| 74 |
0 |
| SvRV_set(*ref, (SV *)new_hv); |
| 75 |
0 |
| SvROK_on(*ref); |
| 76 |
0 |
| 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_COW_DROP_PV |
| 92 |
|
| { "SV_COW_DROP_PV", 14 }, |
| 93 |
|
| #endif |
| 94 |
|
| #ifndef SV_COW_OTHER_PVS |
| 95 |
|
| { "SV_COW_OTHER_PVS", 16 }, |
| 96 |
|
| #endif |
| 97 |
|
| #ifndef SV_COW_SHARED_HASH_KEYS |
| 98 |
|
| { "SV_COW_SHARED_HASH_KEYS", 23 }, |
| 99 |
|
| #endif |
| 100 |
|
| #ifndef SV_FORCE_UTF8_UPGRADE |
| 101 |
|
| { "SV_FORCE_UTF8_UPGRADE", 21 }, |
| 102 |
|
| #endif |
| 103 |
|
| #ifndef SV_GMAGIC |
| 104 |
|
| { "SV_GMAGIC", 9 }, |
| 105 |
|
| #endif |
| 106 |
|
| #ifndef SV_HAS_TRAILING_NUL |
| 107 |
|
| { "SV_HAS_TRAILING_NUL", 19 }, |
| 108 |
|
| #endif |
| 109 |
|
| #ifndef SV_IMMEDIATE_UNREF |
| 110 |
|
| { "SV_IMMEDIATE_UNREF", 18 }, |
| 111 |
|
| #endif |
| 112 |
|
| #ifndef SV_MUTABLE_RETURN |
| 113 |
|
| { "SV_MUTABLE_RETURN", 17 }, |
| 114 |
|
| #endif |
| 115 |
|
| #ifndef SV_NOSTEAL |
| 116 |
|
| { "SV_NOSTEAL", 10 }, |
| 117 |
|
| #endif |
| 118 |
|
| #ifndef SV_SKIP_OVERLOAD |
| 119 |
|
| { "SV_SKIP_OVERLOAD", 16 }, |
| 120 |
|
| #endif |
| 121 |
|
| #ifndef SV_SMAGIC |
| 122 |
|
| { "SV_SMAGIC", 9 }, |
| 123 |
|
| #endif |
| 124 |
|
| #ifndef SV_UNDEF_RETURNS_NULL |
| 125 |
|
| { "SV_UNDEF_RETURNS_NULL", 21 }, |
| 126 |
|
| #endif |
| 127 |
|
| #ifndef SV_UTF8_NO_ENCODING |
| 128 |
|
| { "SV_UTF8_NO_ENCODING", 19 }, |
| 129 |
|
| #endif |
| 130 |
|
| { NULL, 0 } }; |
| 131 |
|
| struct iv_s {const char *name; I32 namelen; IV value;}; |
| 132 |
|
| struct uv_s {const char *name; I32 namelen; UV value;}; |