1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541
|
#define PERL_constant_NOTFOUND 1
#define PERL_constant_NOTDEF 2
#define PERL_constant_ISIV 3
#define PERL_constant_ISNO 4
#define PERL_constant_ISNV 5
#define PERL_constant_ISPV 6
#define PERL_constant_ISPVN 7
#define PERL_constant_ISSV 8
#define PERL_constant_ISUNDEF 9
#define PERL_constant_ISUV 10
#define PERL_constant_ISYES 11
#ifndef NVTYPE
typedef double NV; /* 5.6 and later define NVTYPE, and typedef NV to it. */
#endif
#ifndef aTHX_
#define aTHX_ /* 5.6 or later define this for threading support. */
#endif
#ifndef pTHX_
#define pTHX_ /* 5.6 or later define this for threading support. */
#endif
static int
constant_7 (pTHX_ const char *name, IV *iv_return) {
/* When generated this function returned values for the list of names given
here. However, subsequent manual editing may have added or removed some.
OS_CODE Z_ASCII Z_BLOCK Z_ERRNO Z_FIXED Z_TREES */
/* Offset 6 gives the best switch position. */
switch (name[6]) {
case 'D':
if (memEQ(name, "Z_FIXE", 6)) {
/* D */
#ifdef Z_FIXED
*iv_return = Z_FIXED;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 'E':
if (memEQ(name, "OS_COD", 6)) {
/* E */
#ifdef OS_CODE
*iv_return = OS_CODE;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 'I':
if (memEQ(name, "Z_ASCI", 6)) {
/* I */
#ifdef Z_ASCII
*iv_return = Z_ASCII;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 'K':
if (memEQ(name, "Z_BLOC", 6)) {
/* K */
#ifdef Z_BLOCK
*iv_return = Z_BLOCK;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 'O':
if (memEQ(name, "Z_ERRN", 6)) {
/* O */
#ifdef Z_ERRNO
*iv_return = Z_ERRNO;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 'S':
if (memEQ(name, "Z_TREE", 6)) {
/* S */
#if ZLIB_VERNUM >= 0x1240
*iv_return = Z_TREES;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
}
return PERL_constant_NOTFOUND;
}
static int
constant_9 (pTHX_ const char *name, IV *iv_return) {
/* When generated this function returned values for the list of names given
here. However, subsequent manual editing may have added or removed some.
DEF_WBITS MAX_WBITS Z_UNKNOWN */
/* Offset 2 gives the best switch position. */
switch (name[2]) {
case 'F':
if (memEQ(name, "DEF_WBITS", 9)) {
/* ^ */
#ifdef DEF_WBITS
*iv_return = DEF_WBITS;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 'U':
if (memEQ(name, "Z_UNKNOWN", 9)) {
/* ^ */
#ifdef Z_UNKNOWN
*iv_return = Z_UNKNOWN;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 'X':
if (memEQ(name, "MAX_WBITS", 9)) {
/* ^ */
#ifdef MAX_WBITS
*iv_return = MAX_WBITS;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
}
return PERL_constant_NOTFOUND;
}
static int
constant_10 (pTHX_ const char *name, IV *iv_return) {
/* When generated this function returned values for the list of names given
here. However, subsequent manual editing may have added or removed some.
Z_DEFLATED Z_FILTERED Z_NO_FLUSH */
/* Offset 7 gives the best switch position. */
switch (name[7]) {
case 'R':
if (memEQ(name, "Z_FILTERED", 10)) {
/* ^ */
#ifdef Z_FILTERED
*iv_return = Z_FILTERED;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 'T':
if (memEQ(name, "Z_DEFLATED", 10)) {
/* ^ */
#ifdef Z_DEFLATED
*iv_return = Z_DEFLATED;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 'U':
if (memEQ(name, "Z_NO_FLUSH", 10)) {
/* ^ */
#ifdef Z_NO_FLUSH
*iv_return = Z_NO_FLUSH;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
}
return PERL_constant_NOTFOUND;
}
static int
constant_11 (pTHX_ const char *name, IV *iv_return) {
/* When generated this function returned values for the list of names given
here. However, subsequent manual editing may have added or removed some.
Z_BUF_ERROR Z_MEM_ERROR Z_NEED_DICT */
/* Offset 4 gives the best switch position. */
switch (name[4]) {
case 'E':
if (memEQ(name, "Z_NEED_DICT", 11)) {
/* ^ */
#ifdef Z_NEED_DICT
*iv_return = Z_NEED_DICT;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 'F':
if (memEQ(name, "Z_BUF_ERROR", 11)) {
/* ^ */
#ifdef Z_BUF_ERROR
*iv_return = Z_BUF_ERROR;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 'M':
if (memEQ(name, "Z_MEM_ERROR", 11)) {
/* ^ */
#ifdef Z_MEM_ERROR
*iv_return = Z_MEM_ERROR;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
}
return PERL_constant_NOTFOUND;
}
static int
constant_12 (pTHX_ const char *name, IV *iv_return, const char **pv_return) {
/* When generated this function returned values for the list of names given
here. However, subsequent manual editing may have added or removed some.
ZLIB_VERSION Z_BEST_SPEED Z_DATA_ERROR Z_FULL_FLUSH Z_STREAM_END
Z_SYNC_FLUSH */
/* Offset 4 gives the best switch position. */
switch (name[4]) {
case 'L':
if (memEQ(name, "Z_FULL_FLUSH", 12)) {
/* ^ */
#ifdef Z_FULL_FLUSH
*iv_return = Z_FULL_FLUSH;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 'N':
if (memEQ(name, "Z_SYNC_FLUSH", 12)) {
/* ^ */
#ifdef Z_SYNC_FLUSH
*iv_return = Z_SYNC_FLUSH;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 'R':
if (memEQ(name, "Z_STREAM_END", 12)) {
/* ^ */
#ifdef Z_STREAM_END
*iv_return = Z_STREAM_END;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 'S':
if (memEQ(name, "Z_BEST_SPEED", 12)) {
/* ^ */
#ifdef Z_BEST_SPEED
*iv_return = Z_BEST_SPEED;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 'T':
if (memEQ(name, "Z_DATA_ERROR", 12)) {
/* ^ */
#ifdef Z_DATA_ERROR
*iv_return = Z_DATA_ERROR;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case '_':
if (memEQ(name, "ZLIB_VERSION", 12)) {
/* ^ */
#ifdef ZLIB_VERSION
*pv_return = ZLIB_VERSION;
return PERL_constant_ISPV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
}
return PERL_constant_NOTFOUND;
}
static int
constant (pTHX_ const char *name, STRLEN len, IV *iv_return, const char **pv_return) {
/* Initially switch on the length of the name. */
/* When generated this function returned values for the list of names given
in this section of perl code. Rather than manually editing these functions
to add or remove constants, which would result in this comment and section
of code becoming inaccurate, we recommend that you edit this section of
code, and use it to regenerate a new set of constant functions which you
then use to replace the originals.
Regenerate these constant functions by feeding this entire source file to
perl -x
#!/linux-shared/base/perl/install/bin/perl -w
use ExtUtils::Constant qw (constant_types C_constant XS_constant);
my $types = {map {($_, 1)} qw(IV PV)};
my @names = (qw(DEF_WBITS MAX_MEM_LEVEL MAX_WBITS OS_CODE Z_ASCII
Z_BEST_COMPRESSION Z_BEST_SPEED Z_BINARY Z_BLOCK Z_BUF_ERROR
Z_DATA_ERROR Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY Z_DEFLATED
Z_ERRNO Z_FILTERED Z_FINISH Z_FIXED Z_FULL_FLUSH Z_HUFFMAN_ONLY
Z_MEM_ERROR Z_NEED_DICT Z_NO_COMPRESSION Z_NO_FLUSH Z_NULL Z_OK
Z_PARTIAL_FLUSH Z_RLE Z_STREAM_END Z_STREAM_ERROR Z_SYNC_FLUSH
Z_UNKNOWN Z_VERSION_ERROR),
{name=>"ZLIB_VERSION", type=>"PV"},
{name=>"Z_TREES", type=>"IV", macro=>["#if ZLIB_VERNUM >= 0x1240\n", "#endif\n"]});
print constant_types(), "\n"; # macro defs
foreach (C_constant ("Zlib", 'constant', 'IV', $types, undef, 3, @names) ) {
print $_, "\n"; # C constant subs
}
print "\n#### XS Section:\n";
print XS_constant ("Zlib", $types);
__END__
*/
switch (len) {
case 4:
if (memEQ(name, "Z_OK", 4)) {
#ifdef Z_OK
*iv_return = Z_OK;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 5:
if (memEQ(name, "Z_RLE", 5)) {
#ifdef Z_RLE
*iv_return = Z_RLE;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 6:
if (memEQ(name, "Z_NULL", 6)) {
#ifdef Z_NULL
*iv_return = Z_NULL;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 7:
return constant_7 (aTHX_ name, iv_return);
break;
case 8:
/* Names all of length 8. */
/* Z_BINARY Z_FINISH */
/* Offset 6 gives the best switch position. */
switch (name[6]) {
case 'R':
if (memEQ(name, "Z_BINARY", 8)) {
/* ^ */
#ifdef Z_BINARY
*iv_return = Z_BINARY;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 'S':
if (memEQ(name, "Z_FINISH", 8)) {
/* ^ */
#ifdef Z_FINISH
*iv_return = Z_FINISH;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
}
break;
case 9:
return constant_9 (aTHX_ name, iv_return);
break;
case 10:
return constant_10 (aTHX_ name, iv_return);
break;
case 11:
return constant_11 (aTHX_ name, iv_return);
break;
case 12:
return constant_12 (aTHX_ name, iv_return, pv_return);
break;
case 13:
if (memEQ(name, "MAX_MEM_LEVEL", 13)) {
#ifdef MAX_MEM_LEVEL
*iv_return = MAX_MEM_LEVEL;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 14:
/* Names all of length 14. */
/* Z_HUFFMAN_ONLY Z_STREAM_ERROR */
/* Offset 3 gives the best switch position. */
switch (name[3]) {
case 'T':
if (memEQ(name, "Z_STREAM_ERROR", 14)) {
/* ^ */
#ifdef Z_STREAM_ERROR
*iv_return = Z_STREAM_ERROR;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 'U':
if (memEQ(name, "Z_HUFFMAN_ONLY", 14)) {
/* ^ */
#ifdef Z_HUFFMAN_ONLY
*iv_return = Z_HUFFMAN_ONLY;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
}
break;
case 15:
/* Names all of length 15. */
/* Z_PARTIAL_FLUSH Z_VERSION_ERROR */
/* Offset 5 gives the best switch position. */
switch (name[5]) {
case 'S':
if (memEQ(name, "Z_VERSION_ERROR", 15)) {
/* ^ */
#ifdef Z_VERSION_ERROR
*iv_return = Z_VERSION_ERROR;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 'T':
if (memEQ(name, "Z_PARTIAL_FLUSH", 15)) {
/* ^ */
#ifdef Z_PARTIAL_FLUSH
*iv_return = Z_PARTIAL_FLUSH;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
}
break;
case 16:
if (memEQ(name, "Z_NO_COMPRESSION", 16)) {
#ifdef Z_NO_COMPRESSION
*iv_return = Z_NO_COMPRESSION;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 18:
/* Names all of length 18. */
/* Z_BEST_COMPRESSION Z_DEFAULT_STRATEGY */
/* Offset 14 gives the best switch position. */
switch (name[14]) {
case 'S':
if (memEQ(name, "Z_BEST_COMPRESSION", 18)) {
/* ^ */
#ifdef Z_BEST_COMPRESSION
*iv_return = Z_BEST_COMPRESSION;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
case 'T':
if (memEQ(name, "Z_DEFAULT_STRATEGY", 18)) {
/* ^ */
#ifdef Z_DEFAULT_STRATEGY
*iv_return = Z_DEFAULT_STRATEGY;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
}
break;
case 21:
if (memEQ(name, "Z_DEFAULT_COMPRESSION", 21)) {
#ifdef Z_DEFAULT_COMPRESSION
*iv_return = Z_DEFAULT_COMPRESSION;
return PERL_constant_ISIV;
#else
return PERL_constant_NOTDEF;
#endif
}
break;
}
return PERL_constant_NOTFOUND;
}
|