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_ERRNO */
28 /* Offset 5 gives the best switch position. */
31 if (memEQ(name, "OS_CODE", 7)) {
35 return PERL_constant_ISIV;
37 return PERL_constant_NOTDEF;
42 if (memEQ(name, "Z_ASCII", 7)) {
46 return PERL_constant_ISIV;
48 return PERL_constant_NOTDEF;
53 if (memEQ(name, "Z_ERRNO", 7)) {
57 return PERL_constant_ISIV;
59 return PERL_constant_NOTDEF;
64 return PERL_constant_NOTFOUND;
68 constant_9 (pTHX_ const char *name, IV *iv_return) {
69 /* When generated this function returned values for the list of names given
70 here. However, subsequent manual editing may have added or removed some.
71 DEF_WBITS MAX_WBITS Z_UNKNOWN */
72 /* Offset 2 gives the best switch position. */
75 if (memEQ(name, "DEF_WBITS", 9)) {
78 *iv_return = DEF_WBITS;
79 return PERL_constant_ISIV;
81 return PERL_constant_NOTDEF;
86 if (memEQ(name, "Z_UNKNOWN", 9)) {
89 *iv_return = Z_UNKNOWN;
90 return PERL_constant_ISIV;
92 return PERL_constant_NOTDEF;
97 if (memEQ(name, "MAX_WBITS", 9)) {
100 *iv_return = MAX_WBITS;
101 return PERL_constant_ISIV;
103 return PERL_constant_NOTDEF;
108 return PERL_constant_NOTFOUND;
112 constant_10 (pTHX_ const char *name, IV *iv_return) {
113 /* When generated this function returned values for the list of names given
114 here. However, subsequent manual editing may have added or removed some.
115 Z_DEFLATED Z_FILTERED Z_NO_FLUSH */
116 /* Offset 7 gives the best switch position. */
119 if (memEQ(name, "Z_FILTERED", 10)) {
122 *iv_return = Z_FILTERED;
123 return PERL_constant_ISIV;
125 return PERL_constant_NOTDEF;
130 if (memEQ(name, "Z_DEFLATED", 10)) {
133 *iv_return = Z_DEFLATED;
134 return PERL_constant_ISIV;
136 return PERL_constant_NOTDEF;
141 if (memEQ(name, "Z_NO_FLUSH", 10)) {
144 *iv_return = Z_NO_FLUSH;
145 return PERL_constant_ISIV;
147 return PERL_constant_NOTDEF;
152 return PERL_constant_NOTFOUND;
156 constant_11 (pTHX_ const char *name, IV *iv_return) {
157 /* When generated this function returned values for the list of names given
158 here. However, subsequent manual editing may have added or removed some.
159 Z_BUF_ERROR Z_MEM_ERROR Z_NEED_DICT */
160 /* Offset 4 gives the best switch position. */
163 if (memEQ(name, "Z_NEED_DICT", 11)) {
166 *iv_return = Z_NEED_DICT;
167 return PERL_constant_ISIV;
169 return PERL_constant_NOTDEF;
174 if (memEQ(name, "Z_BUF_ERROR", 11)) {
177 *iv_return = Z_BUF_ERROR;
178 return PERL_constant_ISIV;
180 return PERL_constant_NOTDEF;
185 if (memEQ(name, "Z_MEM_ERROR", 11)) {
188 *iv_return = Z_MEM_ERROR;
189 return PERL_constant_ISIV;
191 return PERL_constant_NOTDEF;
196 return PERL_constant_NOTFOUND;
200 constant_12 (pTHX_ const char *name, IV *iv_return, const char **pv_return) {
201 /* When generated this function returned values for the list of names given
202 here. However, subsequent manual editing may have added or removed some.
203 ZLIB_VERSION Z_BEST_SPEED Z_DATA_ERROR Z_FULL_FLUSH Z_STREAM_END
205 /* Offset 4 gives the best switch position. */
208 if (memEQ(name, "Z_FULL_FLUSH", 12)) {
211 *iv_return = Z_FULL_FLUSH;
212 return PERL_constant_ISIV;
214 return PERL_constant_NOTDEF;
219 if (memEQ(name, "Z_SYNC_FLUSH", 12)) {
222 *iv_return = Z_SYNC_FLUSH;
223 return PERL_constant_ISIV;
225 return PERL_constant_NOTDEF;
230 if (memEQ(name, "Z_STREAM_END", 12)) {
233 *iv_return = Z_STREAM_END;
234 return PERL_constant_ISIV;
236 return PERL_constant_NOTDEF;
241 if (memEQ(name, "Z_BEST_SPEED", 12)) {
244 *iv_return = Z_BEST_SPEED;
245 return PERL_constant_ISIV;
247 return PERL_constant_NOTDEF;
252 if (memEQ(name, "Z_DATA_ERROR", 12)) {
255 *iv_return = Z_DATA_ERROR;
256 return PERL_constant_ISIV;
258 return PERL_constant_NOTDEF;
263 if (memEQ(name, "ZLIB_VERSION", 12)) {
266 *pv_return = ZLIB_VERSION;
267 return PERL_constant_ISPV;
269 return PERL_constant_NOTDEF;
274 return PERL_constant_NOTFOUND;
278 constant (pTHX_ const char *name, STRLEN len, IV *iv_return, const char **pv_return) {
279 /* Initially switch on the length of the name. */
280 /* When generated this function returned values for the list of names given
281 in this section of perl code. Rather than manually editing these functions
282 to add or remove constants, which would result in this comment and section
283 of code becoming inaccurate, we recommend that you edit this section of
284 code, and use it to regenerate a new set of constant functions which you
285 then use to replace the originals.
287 Regenerate these constant functions by feeding this entire source file to
290 #!/home/paul/perl/install/redhat6.1/bleed/bin/perl5.7.2 -w
291 use ExtUtils::Constant qw (constant_types C_constant XS_constant);
293 my $types = {map {($_, 1)} qw(IV PV)};
294 my @names = (qw(DEF_WBITS MAX_MEM_LEVEL MAX_WBITS OS_CODE Z_ASCII
295 Z_BEST_COMPRESSION Z_BEST_SPEED Z_BINARY Z_BUF_ERROR
296 Z_DATA_ERROR Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY Z_DEFLATED
297 Z_ERRNO Z_FILTERED Z_FINISH Z_FULL_FLUSH Z_HUFFMAN_ONLY
298 Z_MEM_ERROR Z_NEED_DICT Z_NO_COMPRESSION Z_NO_FLUSH Z_NULL Z_OK
299 Z_PARTIAL_FLUSH Z_STREAM_END Z_STREAM_ERROR Z_SYNC_FLUSH
300 Z_UNKNOWN Z_VERSION_ERROR),
301 {name=>"ZLIB_VERSION", type=>"PV"});
303 print constant_types(); # macro defs
304 foreach (C_constant ("Zlib", 'constant', 'IV', $types, undef, 3, @names) ) {
305 print $_, "\n"; # C constant subs
307 print "#### XS Section:\n";
308 print XS_constant ("Zlib", $types);
314 if (memEQ(name, "Z_OK", 4)) {
317 return PERL_constant_ISIV;
319 return PERL_constant_NOTDEF;
324 if (memEQ(name, "Z_NULL", 6)) {
327 return PERL_constant_ISIV;
329 return PERL_constant_NOTDEF;
334 return constant_7 (aTHX_ name, iv_return);
337 /* Names all of length 8. */
338 /* Z_BINARY Z_FINISH */
339 /* Offset 6 gives the best switch position. */
342 if (memEQ(name, "Z_BINARY", 8)) {
345 *iv_return = Z_BINARY;
346 return PERL_constant_ISIV;
348 return PERL_constant_NOTDEF;
353 if (memEQ(name, "Z_FINISH", 8)) {
356 *iv_return = Z_FINISH;
357 return PERL_constant_ISIV;
359 return PERL_constant_NOTDEF;
366 return constant_9 (aTHX_ name, iv_return);
369 return constant_10 (aTHX_ name, iv_return);
372 return constant_11 (aTHX_ name, iv_return);
375 return constant_12 (aTHX_ name, iv_return, pv_return);
378 if (memEQ(name, "MAX_MEM_LEVEL", 13)) {
380 *iv_return = MAX_MEM_LEVEL;
381 return PERL_constant_ISIV;
383 return PERL_constant_NOTDEF;
388 /* Names all of length 14. */
389 /* Z_HUFFMAN_ONLY Z_STREAM_ERROR */
390 /* Offset 3 gives the best switch position. */
393 if (memEQ(name, "Z_STREAM_ERROR", 14)) {
395 #ifdef Z_STREAM_ERROR
396 *iv_return = Z_STREAM_ERROR;
397 return PERL_constant_ISIV;
399 return PERL_constant_NOTDEF;
404 if (memEQ(name, "Z_HUFFMAN_ONLY", 14)) {
406 #ifdef Z_HUFFMAN_ONLY
407 *iv_return = Z_HUFFMAN_ONLY;
408 return PERL_constant_ISIV;
410 return PERL_constant_NOTDEF;
417 /* Names all of length 15. */
418 /* Z_PARTIAL_FLUSH Z_VERSION_ERROR */
419 /* Offset 5 gives the best switch position. */
422 if (memEQ(name, "Z_VERSION_ERROR", 15)) {
424 #ifdef Z_VERSION_ERROR
425 *iv_return = Z_VERSION_ERROR;
426 return PERL_constant_ISIV;
428 return PERL_constant_NOTDEF;
433 if (memEQ(name, "Z_PARTIAL_FLUSH", 15)) {
435 #ifdef Z_PARTIAL_FLUSH
436 *iv_return = Z_PARTIAL_FLUSH;
437 return PERL_constant_ISIV;
439 return PERL_constant_NOTDEF;
446 if (memEQ(name, "Z_NO_COMPRESSION", 16)) {
447 #ifdef Z_NO_COMPRESSION
448 *iv_return = Z_NO_COMPRESSION;
449 return PERL_constant_ISIV;
451 return PERL_constant_NOTDEF;
456 /* Names all of length 18. */
457 /* Z_BEST_COMPRESSION Z_DEFAULT_STRATEGY */
458 /* Offset 14 gives the best switch position. */
461 if (memEQ(name, "Z_BEST_COMPRESSION", 18)) {
463 #ifdef Z_BEST_COMPRESSION
464 *iv_return = Z_BEST_COMPRESSION;
465 return PERL_constant_ISIV;
467 return PERL_constant_NOTDEF;
472 if (memEQ(name, "Z_DEFAULT_STRATEGY", 18)) {
474 #ifdef Z_DEFAULT_STRATEGY
475 *iv_return = Z_DEFAULT_STRATEGY;
476 return PERL_constant_ISIV;
478 return PERL_constant_NOTDEF;
485 if (memEQ(name, "Z_DEFAULT_COMPRESSION", 21)) {
486 #ifdef Z_DEFAULT_COMPRESSION
487 *iv_return = Z_DEFAULT_COMPRESSION;
488 return PERL_constant_ISIV;
490 return PERL_constant_NOTDEF;
495 return PERL_constant_NOTFOUND;