| 1 |
|
| static int |
| 2 |
0 |
| value_constant_25 (pTHX_ const char *name, IV *iv_return) { |
| 3 |
|
| /* When generated this function returned values for the list of names given |
| 4 |
|
| here. However, subsequent manual editing may have added or removed some. |
| 5 |
|
| MARPAESLIF_VALUE_TYPE_INT MARPAESLIF_VALUE_TYPE_PTR |
| 6 |
|
| MARPAESLIF_VALUE_TYPE_ROW */ |
| 7 |
|
| /* Offset 24 gives the best switch position. */ |
| 8 |
0 |
| switch (name[24]) { |
| 9 |
0 |
| case 'R': |
| 10 |
0 |
▶ | if (memEQ(name, "MARPAESLIF_VALUE_TYPE_PT", 24)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "MARPAESLIF_VALUE_TYPE_PT", 24)) { |
0 |
0 |
0 |
|
| 11 |
|
| /* R */ |
| 12 |
|
| #if 1 |
| 13 |
0 |
| *iv_return = MARPAESLIF_VALUE_TYPE_PTR; |
| 14 |
0 |
| return PERL_constant_ISIV; |
| 15 |
|
| #else |
| 16 |
|
| return PERL_constant_NOTDEF; |
| 17 |
|
| #endif |
| 18 |
|
| } |
| 19 |
0 |
| break; |
| 20 |
0 |
| case 'T': |
| 21 |
0 |
▶ | if (memEQ(name, "MARPAESLIF_VALUE_TYPE_IN", 24)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "MARPAESLIF_VALUE_TYPE_IN", 24)) { |
0 |
0 |
0 |
|
| 22 |
|
| /* T */ |
| 23 |
|
| #if 1 |
| 24 |
0 |
| *iv_return = MARPAESLIF_VALUE_TYPE_INT; |
| 25 |
0 |
| return PERL_constant_ISIV; |
| 26 |
|
| #else |
| 27 |
|
| return PERL_constant_NOTDEF; |
| 28 |
|
| #endif |
| 29 |
|
| } |
| 30 |
0 |
| break; |
| 31 |
0 |
| case 'W': |
| 32 |
0 |
▶ | if (memEQ(name, "MARPAESLIF_VALUE_TYPE_RO", 24)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "MARPAESLIF_VALUE_TYPE_RO", 24)) { |
0 |
0 |
0 |
|
| 33 |
|
| /* W */ |
| 34 |
|
| #if 1 |
| 35 |
0 |
| *iv_return = MARPAESLIF_VALUE_TYPE_ROW; |
| 36 |
0 |
| return PERL_constant_ISIV; |
| 37 |
|
| #else |
| 38 |
|
| return PERL_constant_NOTDEF; |
| 39 |
|
| #endif |
| 40 |
|
| } |
| 41 |
0 |
| break; |
| 42 |
|
| } |
| 43 |
0 |
| return PERL_constant_NOTFOUND; |
| 44 |
|
| } |
| 45 |
|
| static int |
| 46 |
0 |
| value_constant_26 (pTHX_ const char *name, IV *iv_return) { |
| 47 |
|
| /* When generated this function returned values for the list of names given |
| 48 |
|
| here. However, subsequent manual editing may have added or removed some. |
| 49 |
|
| MARPAESLIF_VALUE_TYPE_BOOL MARPAESLIF_VALUE_TYPE_CHAR |
| 50 |
|
| MARPAESLIF_VALUE_TYPE_LONG */ |
| 51 |
|
| /* Offset 22 gives the best switch position. */ |
| 52 |
0 |
| switch (name[22]) { |
| 53 |
0 |
| case 'B': |
| 54 |
0 |
▶ | if (memEQ(name, "MARPAESLIF_VALUE_TYPE_BOOL", 26)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "MARPAESLIF_VALUE_TYPE_BOOL", 26)) { |
0 |
0 |
0 |
|
| 55 |
|
| /* ^ */ |
| 56 |
|
| #if 1 |
| 57 |
0 |
| *iv_return = MARPAESLIF_VALUE_TYPE_BOOL; |
| 58 |
0 |
| return PERL_constant_ISIV; |
| 59 |
|
| #else |
| 60 |
|
| return PERL_constant_NOTDEF; |
| 61 |
|
| #endif |
| 62 |
|
| } |
| 63 |
0 |
| break; |
| 64 |
0 |
| case 'C': |
| 65 |
0 |
▶ | if (memEQ(name, "MARPAESLIF_VALUE_TYPE_CHAR", 26)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "MARPAESLIF_VALUE_TYPE_CHAR", 26)) { |
0 |
0 |
0 |
|
| 66 |
|
| /* ^ */ |
| 67 |
|
| #if 1 |
| 68 |
0 |
| *iv_return = MARPAESLIF_VALUE_TYPE_CHAR; |
| 69 |
0 |
| return PERL_constant_ISIV; |
| 70 |
|
| #else |
| 71 |
|
| return PERL_constant_NOTDEF; |
| 72 |
|
| #endif |
| 73 |
|
| } |
| 74 |
0 |
| break; |
| 75 |
0 |
| case 'L': |
| 76 |
0 |
▶ | if (memEQ(name, "MARPAESLIF_VALUE_TYPE_LONG", 26)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "MARPAESLIF_VALUE_TYPE_LONG", 26)) { |
0 |
0 |
0 |
|
| 77 |
|
| /* ^ */ |
| 78 |
|
| #if 1 |
| 79 |
0 |
| *iv_return = MARPAESLIF_VALUE_TYPE_LONG; |
| 80 |
0 |
| return PERL_constant_ISIV; |
| 81 |
|
| #else |
| 82 |
|
| return PERL_constant_NOTDEF; |
| 83 |
|
| #endif |
| 84 |
|
| } |
| 85 |
0 |
| break; |
| 86 |
|
| } |
| 87 |
0 |
| return PERL_constant_NOTFOUND; |
| 88 |
|
| } |
| 89 |
|
| static int |
| 90 |
0 |
| value_constant_27 (pTHX_ const char *name, IV *iv_return) { |
| 91 |
|
| /* When generated this function returned values for the list of names given |
| 92 |
|
| here. However, subsequent manual editing may have added or removed some. |
| 93 |
|
| MARPAESLIF_VALUE_TYPE_ARRAY MARPAESLIF_VALUE_TYPE_FLOAT |
| 94 |
|
| MARPAESLIF_VALUE_TYPE_SHORT MARPAESLIF_VALUE_TYPE_TABLE |
| 95 |
|
| MARPAESLIF_VALUE_TYPE_UNDEF */ |
| 96 |
|
| /* Offset 23 gives the best switch position. */ |
| 97 |
0 |
| switch (name[23]) { |
| 98 |
0 |
| case 'A': |
| 99 |
0 |
▶ | if (memEQ(name, "MARPAESLIF_VALUE_TYPE_TABLE", 27)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "MARPAESLIF_VALUE_TYPE_TABLE", 27)) { |
0 |
0 |
0 |
|
| 100 |
|
| /* ^ */ |
| 101 |
|
| #if 1 |
| 102 |
0 |
| *iv_return = MARPAESLIF_VALUE_TYPE_TABLE; |
| 103 |
0 |
| return PERL_constant_ISIV; |
| 104 |
|
| #else |
| 105 |
|
| return PERL_constant_NOTDEF; |
| 106 |
|
| #endif |
| 107 |
|
| } |
| 108 |
0 |
| break; |
| 109 |
0 |
| case 'H': |
| 110 |
0 |
▶ | if (memEQ(name, "MARPAESLIF_VALUE_TYPE_SHORT", 27)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "MARPAESLIF_VALUE_TYPE_SHORT", 27)) { |
0 |
0 |
0 |
|
| 111 |
|
| /* ^ */ |
| 112 |
|
| #if 1 |
| 113 |
0 |
| *iv_return = MARPAESLIF_VALUE_TYPE_SHORT; |
| 114 |
0 |
| return PERL_constant_ISIV; |
| 115 |
|
| #else |
| 116 |
|
| return PERL_constant_NOTDEF; |
| 117 |
|
| #endif |
| 118 |
|
| } |
| 119 |
0 |
| break; |
| 120 |
0 |
| case 'L': |
| 121 |
0 |
▶ | if (memEQ(name, "MARPAESLIF_VALUE_TYPE_FLOAT", 27)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "MARPAESLIF_VALUE_TYPE_FLOAT", 27)) { |
0 |
0 |
0 |
|
| 122 |
|
| /* ^ */ |
| 123 |
|
| #if 1 |
| 124 |
0 |
| *iv_return = MARPAESLIF_VALUE_TYPE_FLOAT; |
| 125 |
0 |
| return PERL_constant_ISIV; |
| 126 |
|
| #else |
| 127 |
|
| return PERL_constant_NOTDEF; |
| 128 |
|
| #endif |
| 129 |
|
| } |
| 130 |
0 |
| break; |
| 131 |
0 |
| case 'N': |
| 132 |
0 |
▶ | if (memEQ(name, "MARPAESLIF_VALUE_TYPE_UNDEF", 27)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "MARPAESLIF_VALUE_TYPE_UNDEF", 27)) { |
0 |
0 |
0 |
|
| 133 |
|
| /* ^ */ |
| 134 |
|
| #if 1 |
| 135 |
0 |
| *iv_return = MARPAESLIF_VALUE_TYPE_UNDEF; |
| 136 |
0 |
| return PERL_constant_ISIV; |
| 137 |
|
| #else |
| 138 |
|
| return PERL_constant_NOTDEF; |
| 139 |
|
| #endif |
| 140 |
|
| } |
| 141 |
0 |
| break; |
| 142 |
0 |
| case 'R': |
| 143 |
0 |
▶ | if (memEQ(name, "MARPAESLIF_VALUE_TYPE_ARRAY", 27)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "MARPAESLIF_VALUE_TYPE_ARRAY", 27)) { |
0 |
0 |
0 |
|
| 144 |
|
| /* ^ */ |
| 145 |
|
| #if 1 |
| 146 |
0 |
| *iv_return = MARPAESLIF_VALUE_TYPE_ARRAY; |
| 147 |
0 |
| return PERL_constant_ISIV; |
| 148 |
|
| #else |
| 149 |
|
| return PERL_constant_NOTDEF; |
| 150 |
|
| #endif |
| 151 |
|
| } |
| 152 |
0 |
| break; |
| 153 |
|
| } |
| 154 |
0 |
| return PERL_constant_NOTFOUND; |
| 155 |
|
| } |
| 156 |
|
| static int |
| 157 |
0 |
| value_constant (pTHX_ const char *name, STRLEN len, IV *iv_return) { |
| 158 |
|
| /* Initially switch on the length of the name. */ |
| 159 |
|
| /* When generated this function returned values for the list of names given |
| 160 |
|
| in this section of perl code. Rather than manually editing these functions |
| 161 |
|
| to add or remove constants, which would result in this comment and section |
| 162 |
|
| of code becoming inaccurate, we recommend that you edit this section of |
| 163 |
|
| code, and use it to regenerate a new set of constant functions which you |
| 164 |
|
| then use to replace the originals. |
| 165 |
|
| |
| 166 |
|
| Regenerate these constant functions by feeding this entire source file to |
| 167 |
|
| perl -x |
| 168 |
|
| |
| 169 |
|
| #!/usr/local/bin/perl -w |
| 170 |
|
| use ExtUtils::Constant qw (constant_types C_constant XS_constant); |
| 171 |
|
| |
| 172 |
|
| my $types = {map {($_, 1)} qw(IV)}; |
| 173 |
|
| my @names = (qw(MARPAESLIF_VALUE_TYPE_ARRAY MARPAESLIF_VALUE_TYPE_BOOL |
| 174 |
|
| MARPAESLIF_VALUE_TYPE_CHAR MARPAESLIF_VALUE_TYPE_DOUBLE |
| 175 |
|
| MARPAESLIF_VALUE_TYPE_FLOAT MARPAESLIF_VALUE_TYPE_INT |
| 176 |
|
| MARPAESLIF_VALUE_TYPE_LONG MARPAESLIF_VALUE_TYPE_LONG_DOUBLE |
| 177 |
|
| MARPAESLIF_VALUE_TYPE_PTR MARPAESLIF_VALUE_TYPE_ROW |
| 178 |
|
| MARPAESLIF_VALUE_TYPE_SHORT MARPAESLIF_VALUE_TYPE_STRING |
| 179 |
|
| MARPAESLIF_VALUE_TYPE_TABLE MARPAESLIF_VALUE_TYPE_UNDEF)); |
| 180 |
|
| |
| 181 |
|
| print constant_types(), "\n"; # macro defs |
| 182 |
|
| foreach (C_constant ("MarpaX::ESLIF::Value::Type", 'value_constant', 'IV', $types, undef, 3, @names) ) { |
| 183 |
|
| print $_, "\n"; # C constant subs |
| 184 |
|
| } |
| 185 |
|
| print "\n#### XS Section:\n"; |
| 186 |
|
| print XS_constant ("MarpaX::ESLIF::Value::Type", $types); |
| 187 |
|
| __END__ |