| 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 int |
| 24 |
0 |
| constant_7 (pTHX_ const char *name, IV *iv_return) { |
| 25 |
|
| /* When generated this function returned values for the list of names given |
| 26 |
|
| here. However, subsequent manual editing may have added or removed some. |
| 27 |
|
| FNV0_32 FNV0_64 FNV1_32 FNV1_64 */ |
| 28 |
|
| /* Offset 3 gives the best switch position. */ |
| 29 |
0 |
| switch (name[3]) { |
| 30 |
0 |
| case '0': |
| 31 |
0 |
▶ | if (memEQ(name, "FNV0_32", 7)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "FNV0_32", 7)) { |
0 |
0 |
0 |
|
| 32 |
|
| /* ^ */ |
| 33 |
|
| #ifdef FNV0_32 |
| 34 |
|
| *iv_return = FNV0_32; |
| 35 |
|
| return PERL_constant_ISIV; |
| 36 |
|
| #else |
| 37 |
0 |
| return PERL_constant_NOTDEF; |
| 38 |
|
| #endif |
| 39 |
|
| } |
| 40 |
0 |
▶ | if (memEQ(name, "FNV0_64", 7)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "FNV0_64", 7)) { |
0 |
0 |
0 |
|
| 41 |
|
| /* ^ */ |
| 42 |
|
| #ifdef FNV0_64 |
| 43 |
|
| *iv_return = FNV0_64; |
| 44 |
|
| return PERL_constant_ISIV; |
| 45 |
|
| #else |
| 46 |
0 |
| return PERL_constant_NOTDEF; |
| 47 |
|
| #endif |
| 48 |
|
| } |
| 49 |
0 |
| break; |
| 50 |
0 |
| case '1': |
| 51 |
0 |
▶ | if (memEQ(name, "FNV1_32", 7)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "FNV1_32", 7)) { |
0 |
0 |
0 |
|
| 52 |
|
| /* ^ */ |
| 53 |
|
| #ifdef FNV1_32 |
| 54 |
|
| *iv_return = FNV1_32; |
| 55 |
|
| return PERL_constant_ISIV; |
| 56 |
|
| #else |
| 57 |
0 |
| return PERL_constant_NOTDEF; |
| 58 |
|
| #endif |
| 59 |
|
| } |
| 60 |
0 |
▶ | if (memEQ(name, "FNV1_64", 7)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "FNV1_64", 7)) { |
0 |
0 |
0 |
|
| 61 |
|
| /* ^ */ |
| 62 |
|
| #ifdef FNV1_64 |
| 63 |
|
| *iv_return = FNV1_64; |
| 64 |
|
| return PERL_constant_ISIV; |
| 65 |
|
| #else |
| 66 |
0 |
| return PERL_constant_NOTDEF; |
| 67 |
|
| #endif |
| 68 |
|
| } |
| 69 |
0 |
| break; |
| 70 |
|
| } |
| 71 |
0 |
| return PERL_constant_NOTFOUND; |
| 72 |
|
| } |
| 73 |
|
| |
| 74 |
|
| static int |
| 75 |
0 |
| constant_8 (pTHX_ const char *name, IV *iv_return) { |
| 76 |
|
| /* When generated this function returned values for the list of names given |
| 77 |
|
| here. However, subsequent manual editing may have added or removed some. |
| 78 |
|
| FNV1a_32 FNV1a_64 FNV_NONE */ |
| 79 |
|
| /* Offset 7 gives the best switch position. */ |
| 80 |
0 |
| switch (name[7]) { |
| 81 |
0 |
| case '2': |
| 82 |
0 |
▶ | if (memEQ(name, "FNV1a_3", 7)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "FNV1a_3", 7)) { |
0 |
0 |
0 |
|
| 83 |
|
| /* 2 */ |
| 84 |
|
| #ifdef FNV1a_32 |
| 85 |
|
| *iv_return = FNV1a_32; |
| 86 |
|
| return PERL_constant_ISIV; |
| 87 |
|
| #else |
| 88 |
0 |
| return PERL_constant_NOTDEF; |
| 89 |
|
| #endif |
| 90 |
|
| } |
| 91 |
0 |
| break; |
| 92 |
0 |
| case '4': |
| 93 |
0 |
▶ | if (memEQ(name, "FNV1a_6", 7)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "FNV1a_6", 7)) { |
0 |
0 |
0 |
|
| 94 |
|
| /* 4 */ |
| 95 |
|
| #ifdef FNV1a_64 |
| 96 |
|
| *iv_return = FNV1a_64; |
| 97 |
|
| return PERL_constant_ISIV; |
| 98 |
|
| #else |
| 99 |
0 |
| return PERL_constant_NOTDEF; |
| 100 |
|
| #endif |
| 101 |
|
| } |
| 102 |
0 |
| break; |
| 103 |
0 |
| case 'E': |
| 104 |
0 |
▶ | if (memEQ(name, "FNV_NON", 7)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "FNV_NON", 7)) { |
0 |
0 |
0 |
|
| 105 |
|
| /* E */ |
| 106 |
|
| #ifdef FNV_NONE |
| 107 |
|
| *iv_return = FNV_NONE; |
| 108 |
|
| return PERL_constant_ISIV; |
| 109 |
|
| #else |
| 110 |
0 |
| return PERL_constant_NOTDEF; |
| 111 |
|
| #endif |
| 112 |
|
| } |
| 113 |
0 |
| break; |
| 114 |
|
| } |
| 115 |
0 |
| return PERL_constant_NOTFOUND; |
| 116 |
|
| } |
| 117 |
|
| |
| 118 |
|
| static int |
| 119 |
0 |
| constant_12 (pTHX_ const char *name, IV *iv_return) { |
| 120 |
|
| /* When generated this function returned values for the list of names given |
| 121 |
|
| here. However, subsequent manual editing may have added or removed some. |
| 122 |
|
| FNV0_32_INIT FNV0_64_INIT FNV1_32_INIT FNV1_64_INIT */ |
| 123 |
|
| /* Offset 3 gives the best switch position. */ |
| 124 |
0 |
| switch (name[3]) { |
| 125 |
0 |
| case '0': |
| 126 |
0 |
▶ | if (memEQ(name, "FNV0_32_INIT", 12)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "FNV0_32_INIT", 12)) { |
0 |
0 |
0 |
|
| 127 |
|
| /* ^ */ |
| 128 |
|
| #ifdef FNV0_32_INIT |
| 129 |
0 |
| *iv_return = FNV0_32_INIT; |
| 130 |
0 |
| return PERL_constant_ISIV; |
| 131 |
|
| #else |
| 132 |
|
| return PERL_constant_NOTDEF; |
| 133 |
|
| #endif |
| 134 |
|
| } |
| 135 |
0 |
▶ | if (memEQ(name, "FNV0_64_INIT", 12)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "FNV0_64_INIT", 12)) { |
0 |
0 |
0 |
|
| 136 |
|
| /* ^ */ |
| 137 |
|
| #ifdef FNV0_64_INIT |
| 138 |
|
| *iv_return = FNV0_64_INIT; |
| 139 |
|
| return PERL_constant_ISIV; |
| 140 |
|
| #else |
| 141 |
0 |
| return PERL_constant_NOTDEF; |
| 142 |
|
| #endif |
| 143 |
|
| } |
| 144 |
0 |
| break; |
| 145 |
0 |
| case '1': |
| 146 |
0 |
▶ | if (memEQ(name, "FNV1_32_INIT", 12)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "FNV1_32_INIT", 12)) { |
0 |
0 |
0 |
|
| 147 |
|
| /* ^ */ |
| 148 |
|
| #ifdef FNV1_32_INIT |
| 149 |
0 |
| *iv_return = FNV1_32_INIT; |
| 150 |
0 |
| return PERL_constant_ISIV; |
| 151 |
|
| #else |
| 152 |
|
| return PERL_constant_NOTDEF; |
| 153 |
|
| #endif |
| 154 |
|
| } |
| 155 |
0 |
▶ | if (memEQ(name, "FNV1_64_INIT", 12)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "FNV1_64_INIT", 12)) { |
0 |
0 |
0 |
|
| 156 |
|
| /* ^ */ |
| 157 |
|
| #ifdef FNV1_64_INIT |
| 158 |
|
| *iv_return = FNV1_64_INIT; |
| 159 |
|
| return PERL_constant_ISIV; |
| 160 |
|
| #else |
| 161 |
0 |
| return PERL_constant_NOTDEF; |
| 162 |
|
| #endif |
| 163 |
|
| } |
| 164 |
0 |
| break; |
| 165 |
|
| } |
| 166 |
0 |
| return PERL_constant_NOTFOUND; |
| 167 |
|
| } |
| 168 |
|
| |
| 169 |
|
| static int |
| 170 |
0 |
| constant (pTHX_ const char *name, STRLEN len, IV *iv_return) { |
| 171 |
|
| /* Initially switch on the length of the name. */ |
| 172 |
|
| /* When generated this function returned values for the list of names given |
| 173 |
|
| in this section of perl code. Rather than manually editing these functions |
| 174 |
|
| to add or remove constants, which would result in this comment and section |
| 175 |
|
| of code becoming inaccurate, we recommend that you edit this section of |
| 176 |
|
| code, and use it to regenerate a new set of constant functions which you |
| 177 |
|
| then use to replace the originals. |
| 178 |
|
| |
| 179 |
|
| Regenerate these constant functions by feeding this entire source file to |
| 180 |
|
| perl -x |
| 181 |
|
| |
| 182 |
|
| #!/usr/local/bin/perl -w |
| 183 |
|
| use ExtUtils::Constant qw (constant_types C_constant XS_constant); |
| 184 |
|
| |
| 185 |
|
| my $types = {map {($_, 1)} qw(IV)}; |
| 186 |
|
| my @names = (qw(FNV0_32 FNV0_32_INIT FNV0_64 FNV0_64_INIT FNV1A_64_INIT FNV1_32 |
| 187 |
|
| FNV1_32A_INIT FNV1_32_INIT FNV1_64 FNV1_64_INIT FNV1a_32 |
| 188 |
|
| FNV1a_64 FNV_NONE)); |
| 189 |
|
| |
| 190 |
|
| print constant_types(), "\n"; # macro defs |
| 191 |
|
| foreach (C_constant ("Digest::FNV", 'constant', 'IV', $types, undef, 3, @names) ) { |
| 192 |
|
| print $_, "\n"; # C constant subs |
| 193 |
|
| } |
| 194 |
|
| print "\n#### XS Section:\n"; |
| 195 |
|
| print XS_constant ("Digest::FNV", $types); |
| 196 |
|
| __END__ |