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 (pTHX_ const char *name, STRLEN len, IV *iv_return) {
25 /* Initially switch on the length of the name. */
26 /* When generated this function returned values for the list of names given
27 in this section of perl code. Rather than manually editing these functions
28 to add or remove constants, which would result in this comment and section
29 of code becoming inaccurate, we recommend that you edit this section of
30 code, and use it to regenerate a new set of constant functions which you
31 then use to replace the originals.
33 Regenerate these constant functions by feeding this entire source file to
36 #!/spare/local/perls/5.8.6/bin/perl5.8.6 -w
37 use ExtUtils::Constant qw (constant_types C_constant XS_constant);
39 my $types = {map {($_, 1)} qw(IV)};
40 my @names = (qw(BZ_CONFIG_ERROR BZ_DATA_ERROR BZ_DATA_ERROR_MAGIC BZ_FINISH
41 BZ_FINISH_OK BZ_FLUSH BZ_FLUSH_OK BZ_IO_ERROR BZ_MEM_ERROR BZ_OK
42 BZ_OUTBUFF_FULL BZ_PARAM_ERROR BZ_RUN BZ_RUN_OK
43 BZ_SEQUENCE_ERROR BZ_STREAM_END BZ_UNEXPECTED_EOF));
45 print constant_types(); # macro defs
46 foreach (C_constant ("Bzip2", 'constant', 'IV', $types, undef, 3, @names) ) {
47 print $_, "\n"; # C constant subs
49 print "#### XS Section:\n";
50 print XS_constant ("Bzip2", $types);
56 if (memEQ(name, "BZ_OK", 5)) {
59 return PERL_constant_ISIV;
61 return PERL_constant_NOTDEF;
66 if (memEQ(name, "BZ_RUN", 6)) {
69 return PERL_constant_ISIV;
71 return PERL_constant_NOTDEF;
76 if (memEQ(name, "BZ_FLUSH", 8)) {
78 *iv_return = BZ_FLUSH;
79 return PERL_constant_ISIV;
81 return PERL_constant_NOTDEF;
86 /* Names all of length 9. */
87 /* BZ_FINISH BZ_RUN_OK */
88 /* Offset 8 gives the best switch position. */
91 if (memEQ(name, "BZ_FINIS", 8)) {
94 *iv_return = BZ_FINISH;
95 return PERL_constant_ISIV;
97 return PERL_constant_NOTDEF;
102 if (memEQ(name, "BZ_RUN_O", 8)) {
105 *iv_return = BZ_RUN_OK;
106 return PERL_constant_ISIV;
108 return PERL_constant_NOTDEF;
115 /* Names all of length 11. */
116 /* BZ_FLUSH_OK BZ_IO_ERROR */
117 /* Offset 3 gives the best switch position. */
120 if (memEQ(name, "BZ_FLUSH_OK", 11)) {
123 *iv_return = BZ_FLUSH_OK;
124 return PERL_constant_ISIV;
126 return PERL_constant_NOTDEF;
131 if (memEQ(name, "BZ_IO_ERROR", 11)) {
134 *iv_return = BZ_IO_ERROR;
135 return PERL_constant_ISIV;
137 return PERL_constant_NOTDEF;
144 /* Names all of length 12. */
145 /* BZ_FINISH_OK BZ_MEM_ERROR */
146 /* Offset 5 gives the best switch position. */
149 if (memEQ(name, "BZ_MEM_ERROR", 12)) {
152 *iv_return = BZ_MEM_ERROR;
153 return PERL_constant_ISIV;
155 return PERL_constant_NOTDEF;
160 if (memEQ(name, "BZ_FINISH_OK", 12)) {
163 *iv_return = BZ_FINISH_OK;
164 return PERL_constant_ISIV;
166 return PERL_constant_NOTDEF;
173 /* Names all of length 13. */
174 /* BZ_DATA_ERROR BZ_STREAM_END */
175 /* Offset 11 gives the best switch position. */
178 if (memEQ(name, "BZ_STREAM_END", 13)) {
181 *iv_return = BZ_STREAM_END;
182 return PERL_constant_ISIV;
184 return PERL_constant_NOTDEF;
189 if (memEQ(name, "BZ_DATA_ERROR", 13)) {
192 *iv_return = BZ_DATA_ERROR;
193 return PERL_constant_ISIV;
195 return PERL_constant_NOTDEF;
202 if (memEQ(name, "BZ_PARAM_ERROR", 14)) {
203 #ifdef BZ_PARAM_ERROR
204 *iv_return = BZ_PARAM_ERROR;
205 return PERL_constant_ISIV;
207 return PERL_constant_NOTDEF;
212 /* Names all of length 15. */
213 /* BZ_CONFIG_ERROR BZ_OUTBUFF_FULL */
214 /* Offset 8 gives the best switch position. */
217 if (memEQ(name, "BZ_OUTBUFF_FULL", 15)) {
219 #ifdef BZ_OUTBUFF_FULL
220 *iv_return = BZ_OUTBUFF_FULL;
221 return PERL_constant_ISIV;
223 return PERL_constant_NOTDEF;
228 if (memEQ(name, "BZ_CONFIG_ERROR", 15)) {
230 #ifdef BZ_CONFIG_ERROR
231 *iv_return = BZ_CONFIG_ERROR;
232 return PERL_constant_ISIV;
234 return PERL_constant_NOTDEF;
241 /* Names all of length 17. */
242 /* BZ_SEQUENCE_ERROR BZ_UNEXPECTED_EOF */
243 /* Offset 12 gives the best switch position. */
246 if (memEQ(name, "BZ_UNEXPECTED_EOF", 17)) {
248 #ifdef BZ_UNEXPECTED_EOF
249 *iv_return = BZ_UNEXPECTED_EOF;
250 return PERL_constant_ISIV;
252 return PERL_constant_NOTDEF;
257 if (memEQ(name, "BZ_SEQUENCE_ERROR", 17)) {
259 #ifdef BZ_SEQUENCE_ERROR
260 *iv_return = BZ_SEQUENCE_ERROR;
261 return PERL_constant_ISIV;
263 return PERL_constant_NOTDEF;
270 if (memEQ(name, "BZ_DATA_ERROR_MAGIC", 19)) {
271 #ifdef BZ_DATA_ERROR_MAGIC
272 *iv_return = BZ_DATA_ERROR_MAGIC;
273 return PERL_constant_ISIV;
275 return PERL_constant_NOTDEF;
280 return PERL_constant_NOTFOUND;