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
14 typedef double NV; /* 5.6 and later define NVTYPE, and typedef NV to it. */
17 #define aTHX_ /* 5.6 or later define this for threading support. */
20 #define pTHX_ /* 5.6 or later define this for threading support. */
24 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 OS_CODE Z_ASCII Z_BLOCK Z_ERRNO Z_FIXED Z_TREES */
28 /* Offset 6 gives the best switch position. */
31 if (memEQ(name, "Z_FIXE", 6)) {
35 return PERL_constant_ISIV;
37 return PERL_constant_NOTDEF;
42 if (memEQ(name, "OS_COD", 6)) {
46 return PERL_constant_ISIV;
48 return PERL_constant_NOTDEF;
53 if (memEQ(name, "Z_ASCI", 6)) {
57 return PERL_constant_ISIV;
59 return PERL_constant_NOTDEF;
64 if (memEQ(name, "Z_BLOC", 6)) {
68 return PERL_constant_ISIV;
70 return PERL_constant_NOTDEF;
75 if (memEQ(name, "Z_ERRN", 6)) {
79 return PERL_constant_ISIV;
81 return PERL_constant_NOTDEF;
86 if (memEQ(name, "Z_TREE", 6)) {
88 #if ZLIB_VERNUM >= 0x1240
90 return PERL_constant_ISIV;
92 return PERL_constant_NOTDEF;
97 return PERL_constant_NOTFOUND;
101 constant_9 (pTHX_ const char *name, IV *iv_return) {
102 /* When generated this function returned values for the list of names given
103 here. However, subsequent manual editing may have added or removed some.
104 DEF_WBITS MAX_WBITS Z_UNKNOWN */
105 /* Offset 2 gives the best switch position. */
108 if (memEQ(name, "DEF_WBITS", 9)) {
111 *iv_return = DEF_WBITS;
112 return PERL_constant_ISIV;
114 return PERL_constant_NOTDEF;
119 if (memEQ(name, "Z_UNKNOWN", 9)) {
122 *iv_return = Z_UNKNOWN;
123 return PERL_constant_ISIV;
125 return PERL_constant_NOTDEF;
130 if (memEQ(name, "MAX_WBITS", 9)) {
133 *iv_return = MAX_WBITS;
134 return PERL_constant_ISIV;
136 return PERL_constant_NOTDEF;
141 return PERL_constant_NOTFOUND;
145 constant_10 (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 Z_DEFLATED Z_FILTERED Z_NO_FLUSH */
149 /* Offset 7 gives the best switch position. */
152 if (memEQ(name, "Z_FILTERED", 10)) {
155 *iv_return = Z_FILTERED;
156 return PERL_constant_ISIV;
158 return PERL_constant_NOTDEF;
163 if (memEQ(name, "Z_DEFLATED", 10)) {
166 *iv_return = Z_DEFLATED;
167 return PERL_constant_ISIV;
169 return PERL_constant_NOTDEF;
174 if (memEQ(name, "Z_NO_FLUSH", 10)) {
177 *iv_return = Z_NO_FLUSH;
178 return PERL_constant_ISIV;
180 return PERL_constant_NOTDEF;
185 return PERL_constant_NOTFOUND;
189 constant_11 (pTHX_ const char *name, IV *iv_return) {
190 /* When generated this function returned values for the list of names given
191 here. However, subsequent manual editing may have added or removed some.
192 Z_BUF_ERROR Z_MEM_ERROR Z_NEED_DICT */
193 /* Offset 4 gives the best switch position. */
196 if (memEQ(name, "Z_NEED_DICT", 11)) {
199 *iv_return = Z_NEED_DICT;
200 return PERL_constant_ISIV;
202 return PERL_constant_NOTDEF;
207 if (memEQ(name, "Z_BUF_ERROR", 11)) {
210 *iv_return = Z_BUF_ERROR;
211 return PERL_constant_ISIV;
213 return PERL_constant_NOTDEF;
218 if (memEQ(name, "Z_MEM_ERROR", 11)) {
221 *iv_return = Z_MEM_ERROR;
222 return PERL_constant_ISIV;
224 return PERL_constant_NOTDEF;
229 return PERL_constant_NOTFOUND;
233 constant_12 (pTHX_ const char *name, IV *iv_return, const char **pv_return) {
234 /* When generated this function returned values for the list of names given
235 here. However, subsequent manual editing may have added or removed some.
236 ZLIB_VERSION Z_BEST_SPEED Z_DATA_ERROR Z_FULL_FLUSH Z_STREAM_END
238 /* Offset 4 gives the best switch position. */
241 if (memEQ(name, "Z_FULL_FLUSH", 12)) {
244 *iv_return = Z_FULL_FLUSH;
245 return PERL_constant_ISIV;
247 return PERL_constant_NOTDEF;
252 if (memEQ(name, "Z_SYNC_FLUSH", 12)) {
255 *iv_return = Z_SYNC_FLUSH;
256 return PERL_constant_ISIV;
258 return PERL_constant_NOTDEF;
263 if (memEQ(name, "Z_STREAM_END", 12)) {
266 *iv_return = Z_STREAM_END;
267 return PERL_constant_ISIV;
269 return PERL_constant_NOTDEF;
274 if (memEQ(name, "Z_BEST_SPEED", 12)) {
277 *iv_return = Z_BEST_SPEED;
278 return PERL_constant_ISIV;
280 return PERL_constant_NOTDEF;
285 if (memEQ(name, "Z_DATA_ERROR", 12)) {
288 *iv_return = Z_DATA_ERROR;
289 return PERL_constant_ISIV;
291 return PERL_constant_NOTDEF;
296 if (memEQ(name, "ZLIB_VERSION", 12)) {
299 *pv_return = ZLIB_VERSION;
300 return PERL_constant_ISPV;
302 return PERL_constant_NOTDEF;
307 return PERL_constant_NOTFOUND;
311 constant (pTHX_ const char *name, STRLEN len, IV *iv_return, const char **pv_return) {
312 /* Initially switch on the length of the name. */
313 /* When generated this function returned values for the list of names given
314 in this section of perl code. Rather than manually editing these functions
315 to add or remove constants, which would result in this comment and section
316 of code becoming inaccurate, we recommend that you edit this section of
317 code, and use it to regenerate a new set of constant functions which you
318 then use to replace the originals.
320 Regenerate these constant functions by feeding this entire source file to
323 #!/linux-shared/base/perl/install/bin/perl -w
324 use ExtUtils::Constant qw (constant_types C_constant XS_constant);
326 my $types = {map {($_, 1)} qw(IV PV)};
327 my @names = (qw(DEF_WBITS MAX_MEM_LEVEL MAX_WBITS OS_CODE Z_ASCII
328 Z_BEST_COMPRESSION Z_BEST_SPEED Z_BINARY Z_BLOCK Z_BUF_ERROR
329 Z_DATA_ERROR Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY Z_DEFLATED
330 Z_ERRNO Z_FILTERED Z_FINISH Z_FIXED Z_FULL_FLUSH Z_HUFFMAN_ONLY
331 Z_MEM_ERROR Z_NEED_DICT Z_NO_COMPRESSION Z_NO_FLUSH Z_NULL Z_OK
332 Z_PARTIAL_FLUSH Z_RLE Z_STREAM_END Z_STREAM_ERROR Z_SYNC_FLUSH
333 Z_UNKNOWN Z_VERSION_ERROR),
334 {name=>"ZLIB_VERSION", type=>"PV"},
335 {name=>"Z_TREES", type=>"IV", macro=>["#if ZLIB_VERNUM >= 0x1240\n", "#endif\n"]});
337 print constant_types(), "\n"; # macro defs
338 foreach (C_constant ("Zlib", 'constant', 'IV', $types, undef, 3, @names) ) {
339 print $_, "\n"; # C constant subs
341 print "\n#### XS Section:\n";
342 print XS_constant ("Zlib", $types);
348 if (memEQ(name, "Z_OK", 4)) {
351 return PERL_constant_ISIV;
353 return PERL_constant_NOTDEF;
358 if (memEQ(name, "Z_RLE", 5)) {
361 return PERL_constant_ISIV;
363 return PERL_constant_NOTDEF;
368 if (memEQ(name, "Z_NULL", 6)) {
371 return PERL_constant_ISIV;
373 return PERL_constant_NOTDEF;
378 return constant_7 (aTHX_ name, iv_return);
381 /* Names all of length 8. */
382 /* Z_BINARY Z_FINISH */
383 /* Offset 6 gives the best switch position. */
386 if (memEQ(name, "Z_BINARY", 8)) {
389 *iv_return = Z_BINARY;
390 return PERL_constant_ISIV;
392 return PERL_constant_NOTDEF;
397 if (memEQ(name, "Z_FINISH", 8)) {
400 *iv_return = Z_FINISH;
401 return PERL_constant_ISIV;
403 return PERL_constant_NOTDEF;
410 return constant_9 (aTHX_ name, iv_return);
413 return constant_10 (aTHX_ name, iv_return);
416 return constant_11 (aTHX_ name, iv_return);
419 return constant_12 (aTHX_ name, iv_return, pv_return);
422 if (memEQ(name, "MAX_MEM_LEVEL", 13)) {
424 *iv_return = MAX_MEM_LEVEL;
425 return PERL_constant_ISIV;
427 return PERL_constant_NOTDEF;
432 /* Names all of length 14. */
433 /* Z_HUFFMAN_ONLY Z_STREAM_ERROR */
434 /* Offset 3 gives the best switch position. */
437 if (memEQ(name, "Z_STREAM_ERROR", 14)) {
439 #ifdef Z_STREAM_ERROR
440 *iv_return = Z_STREAM_ERROR;
441 return PERL_constant_ISIV;
443 return PERL_constant_NOTDEF;
448 if (memEQ(name, "Z_HUFFMAN_ONLY", 14)) {
450 #ifdef Z_HUFFMAN_ONLY
451 *iv_return = Z_HUFFMAN_ONLY;
452 return PERL_constant_ISIV;
454 return PERL_constant_NOTDEF;
461 /* Names all of length 15. */
462 /* Z_PARTIAL_FLUSH Z_VERSION_ERROR */
463 /* Offset 5 gives the best switch position. */
466 if (memEQ(name, "Z_VERSION_ERROR", 15)) {
468 #ifdef Z_VERSION_ERROR
469 *iv_return = Z_VERSION_ERROR;
470 return PERL_constant_ISIV;
472 return PERL_constant_NOTDEF;
477 if (memEQ(name, "Z_PARTIAL_FLUSH", 15)) {
479 #ifdef Z_PARTIAL_FLUSH
480 *iv_return = Z_PARTIAL_FLUSH;
481 return PERL_constant_ISIV;
483 return PERL_constant_NOTDEF;
490 if (memEQ(name, "Z_NO_COMPRESSION", 16)) {
491 #ifdef Z_NO_COMPRESSION
492 *iv_return = Z_NO_COMPRESSION;
493 return PERL_constant_ISIV;
495 return PERL_constant_NOTDEF;
500 /* Names all of length 18. */
501 /* Z_BEST_COMPRESSION Z_DEFAULT_STRATEGY */
502 /* Offset 14 gives the best switch position. */
505 if (memEQ(name, "Z_BEST_COMPRESSION", 18)) {
507 #ifdef Z_BEST_COMPRESSION
508 *iv_return = Z_BEST_COMPRESSION;
509 return PERL_constant_ISIV;
511 return PERL_constant_NOTDEF;
516 if (memEQ(name, "Z_DEFAULT_STRATEGY", 18)) {
518 #ifdef Z_DEFAULT_STRATEGY
519 *iv_return = Z_DEFAULT_STRATEGY;
520 return PERL_constant_ISIV;
522 return PERL_constant_NOTDEF;
529 if (memEQ(name, "Z_DEFAULT_COMPRESSION", 21)) {
530 #ifdef Z_DEFAULT_COMPRESSION
531 *iv_return = Z_DEFAULT_COMPRESSION;
532 return PERL_constant_ISIV;
534 return PERL_constant_NOTDEF;
539 return PERL_constant_NOTFOUND;