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