]>
Commit | Line | Data |
---|---|---|
a3f1cbda MG |
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 | 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 | OP_EIMPL OP_EREAD OP_FALSE */ | |
28 | /* Offset 7 gives the best switch position. */ | |
29 | switch (name[7]) { | |
30 | case 'D': | |
31 | if (memEQ(name, "OP_EREA", 7)) { | |
32 | /* D */ | |
33 | #ifdef OP_EREAD | |
34 | *iv_return = OP_EREAD; | |
35 | return PERL_constant_ISIV; | |
36 | #else | |
37 | return PERL_constant_NOTDEF; | |
38 | #endif | |
39 | } | |
40 | break; | |
41 | case 'E': | |
42 | if (memEQ(name, "OP_FALS", 7)) { | |
43 | /* E */ | |
44 | #ifdef OP_FALSE | |
45 | *iv_return = OP_FALSE; | |
46 | return PERL_constant_ISIV; | |
47 | #else | |
48 | return PERL_constant_NOTDEF; | |
49 | #endif | |
50 | } | |
51 | break; | |
52 | case 'L': | |
53 | if (memEQ(name, "OP_EIMP", 7)) { | |
54 | /* L */ | |
55 | #ifdef OP_EIMPL | |
56 | *iv_return = OP_EIMPL; | |
57 | return PERL_constant_ISIV; | |
58 | #else | |
59 | return PERL_constant_NOTDEF; | |
60 | #endif | |
61 | } | |
62 | break; | |
63 | } | |
64 | return PERL_constant_NOTFOUND; | |
65 | } | |
66 | ||
67 | static int | |
68 | constant_13 (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 | OP_EBADHEADER OP_EBADPACKET OP_ENOTFORMAT OP_TRACK_GAIN */ | |
72 | /* Offset 7 gives the best switch position. */ | |
73 | switch (name[7]) { | |
74 | case 'F': | |
75 | if (memEQ(name, "OP_ENOTFORMAT", 13)) { | |
76 | /* ^ */ | |
77 | #ifdef OP_ENOTFORMAT | |
78 | *iv_return = OP_ENOTFORMAT; | |
79 | return PERL_constant_ISIV; | |
80 | #else | |
81 | return PERL_constant_NOTDEF; | |
82 | #endif | |
83 | } | |
84 | break; | |
85 | case 'H': | |
86 | if (memEQ(name, "OP_EBADHEADER", 13)) { | |
87 | /* ^ */ | |
88 | #ifdef OP_EBADHEADER | |
89 | *iv_return = OP_EBADHEADER; | |
90 | return PERL_constant_ISIV; | |
91 | #else | |
92 | return PERL_constant_NOTDEF; | |
93 | #endif | |
94 | } | |
95 | break; | |
96 | case 'K': | |
97 | if (memEQ(name, "OP_TRACK_GAIN", 13)) { | |
98 | /* ^ */ | |
99 | #ifdef OP_TRACK_GAIN | |
100 | *iv_return = OP_TRACK_GAIN; | |
101 | return PERL_constant_ISIV; | |
102 | #else | |
103 | return PERL_constant_NOTDEF; | |
104 | #endif | |
105 | } | |
106 | break; | |
107 | case 'P': | |
108 | if (memEQ(name, "OP_EBADPACKET", 13)) { | |
109 | /* ^ */ | |
110 | #ifdef OP_EBADPACKET | |
111 | *iv_return = OP_EBADPACKET; | |
112 | return PERL_constant_ISIV; | |
113 | #else | |
114 | return PERL_constant_NOTDEF; | |
115 | #endif | |
116 | } | |
117 | break; | |
118 | } | |
119 | return PERL_constant_NOTFOUND; | |
120 | } | |
121 | ||
122 | static int | |
123 | constant_17 (pTHX_ const char *name, IV *iv_return) { | |
124 | /* When generated this function returned values for the list of names given | |
125 | here. However, subsequent manual editing may have added or removed some. | |
126 | OP_PIC_FORMAT_GIF OP_PIC_FORMAT_PNG OP_PIC_FORMAT_URL */ | |
127 | /* Offset 16 gives the best switch position. */ | |
128 | switch (name[16]) { | |
129 | case 'F': | |
130 | if (memEQ(name, "OP_PIC_FORMAT_GI", 16)) { | |
131 | /* F */ | |
132 | #ifdef OP_PIC_FORMAT_GIF | |
133 | *iv_return = OP_PIC_FORMAT_GIF; | |
134 | return PERL_constant_ISIV; | |
135 | #else | |
136 | return PERL_constant_NOTDEF; | |
137 | #endif | |
138 | } | |
139 | break; | |
140 | case 'G': | |
141 | if (memEQ(name, "OP_PIC_FORMAT_PN", 16)) { | |
142 | /* G */ | |
143 | #ifdef OP_PIC_FORMAT_PNG | |
144 | *iv_return = OP_PIC_FORMAT_PNG; | |
145 | return PERL_constant_ISIV; | |
146 | #else | |
147 | return PERL_constant_NOTDEF; | |
148 | #endif | |
149 | } | |
150 | break; | |
151 | case 'L': | |
152 | if (memEQ(name, "OP_PIC_FORMAT_UR", 16)) { | |
153 | /* L */ | |
154 | #ifdef OP_PIC_FORMAT_URL | |
155 | *iv_return = OP_PIC_FORMAT_URL; | |
156 | return PERL_constant_ISIV; | |
157 | #else | |
158 | return PERL_constant_NOTDEF; | |
159 | #endif | |
160 | } | |
161 | break; | |
162 | } | |
163 | return PERL_constant_NOTFOUND; | |
164 | } | |
165 | ||
166 | static int | |
167 | constant_26 (pTHX_ const char *name, IV *iv_return) { | |
168 | /* When generated this function returned values for the list of names given | |
169 | here. However, subsequent manual editing may have added or removed some. | |
170 | OP_GET_SERVER_INFO_REQUEST OP_HTTP_PROXY_HOST_REQUEST | |
171 | OP_HTTP_PROXY_PASS_REQUEST OP_HTTP_PROXY_PORT_REQUEST | |
172 | OP_HTTP_PROXY_USER_REQUEST */ | |
173 | /* Offset 17 gives the best switch position. */ | |
174 | switch (name[17]) { | |
175 | case 'O': | |
176 | if (memEQ(name, "OP_GET_SERVER_INFO_REQUEST", 26)) { | |
177 | /* ^ */ | |
178 | #ifdef OP_GET_SERVER_INFO_REQUEST | |
179 | *iv_return = OP_GET_SERVER_INFO_REQUEST; | |
180 | return PERL_constant_ISIV; | |
181 | #else | |
182 | return PERL_constant_NOTDEF; | |
183 | #endif | |
184 | } | |
185 | break; | |
186 | case 'R': | |
187 | if (memEQ(name, "OP_HTTP_PROXY_USER_REQUEST", 26)) { | |
188 | /* ^ */ | |
189 | #ifdef OP_HTTP_PROXY_USER_REQUEST | |
190 | *iv_return = OP_HTTP_PROXY_USER_REQUEST; | |
191 | return PERL_constant_ISIV; | |
192 | #else | |
193 | return PERL_constant_NOTDEF; | |
194 | #endif | |
195 | } | |
196 | break; | |
197 | case 'S': | |
198 | if (memEQ(name, "OP_HTTP_PROXY_PASS_REQUEST", 26)) { | |
199 | /* ^ */ | |
200 | #ifdef OP_HTTP_PROXY_PASS_REQUEST | |
201 | *iv_return = OP_HTTP_PROXY_PASS_REQUEST; | |
202 | return PERL_constant_ISIV; | |
203 | #else | |
204 | return PERL_constant_NOTDEF; | |
205 | #endif | |
206 | } | |
207 | break; | |
208 | case 'T': | |
209 | if (memEQ(name, "OP_HTTP_PROXY_HOST_REQUEST", 26)) { | |
210 | /* ^ */ | |
211 | #ifdef OP_HTTP_PROXY_HOST_REQUEST | |
212 | *iv_return = OP_HTTP_PROXY_HOST_REQUEST; | |
213 | return PERL_constant_ISIV; | |
214 | #else | |
215 | return PERL_constant_NOTDEF; | |
216 | #endif | |
217 | } | |
218 | if (memEQ(name, "OP_HTTP_PROXY_PORT_REQUEST", 26)) { | |
219 | /* ^ */ | |
220 | #ifdef OP_HTTP_PROXY_PORT_REQUEST | |
221 | *iv_return = OP_HTTP_PROXY_PORT_REQUEST; | |
222 | return PERL_constant_ISIV; | |
223 | #else | |
224 | return PERL_constant_NOTDEF; | |
225 | #endif | |
226 | } | |
227 | break; | |
228 | } | |
229 | return PERL_constant_NOTFOUND; | |
230 | } | |
231 | ||
232 | static int | |
233 | constant (pTHX_ const char *name, STRLEN len, IV *iv_return) { | |
234 | /* Initially switch on the length of the name. */ | |
235 | /* When generated this function returned values for the list of names given | |
236 | in this section of perl code. Rather than manually editing these functions | |
237 | to add or remove constants, which would result in this comment and section | |
238 | of code becoming inaccurate, we recommend that you edit this section of | |
239 | code, and use it to regenerate a new set of constant functions which you | |
240 | then use to replace the originals. | |
241 | ||
242 | Regenerate these constant functions by feeding this entire source file to | |
243 | perl -x | |
244 | ||
245 | #!/usr/bin/perl -w | |
246 | use ExtUtils::Constant qw (constant_types C_constant XS_constant); | |
247 | ||
248 | my $types = {map {($_, 1)} qw(IV)}; | |
249 | my @names = (qw(OPUS_CHANNEL_COUNT_MAX OP_ABSOLUTE_GAIN OP_DEC_FORMAT_FLOAT | |
250 | OP_DEC_FORMAT_SHORT OP_DEC_USE_DEFAULT OP_EBADHEADER OP_EBADLINK | |
251 | OP_EBADPACKET OP_EBADTIMESTAMP OP_EFAULT OP_EIMPL OP_EINVAL | |
252 | OP_ENOSEEK OP_ENOTAUDIO OP_ENOTFORMAT OP_EOF OP_EREAD | |
253 | OP_EVERSION OP_FALSE OP_GET_SERVER_INFO_REQUEST OP_HEADER_GAIN | |
254 | OP_HOLE OP_HTTP_PROXY_HOST_REQUEST OP_HTTP_PROXY_PASS_REQUEST | |
255 | OP_HTTP_PROXY_PORT_REQUEST OP_HTTP_PROXY_USER_REQUEST | |
256 | OP_PIC_FORMAT_GIF OP_PIC_FORMAT_JPEG OP_PIC_FORMAT_PNG | |
257 | OP_PIC_FORMAT_UNKNOWN OP_PIC_FORMAT_URL | |
258 | OP_SSL_SKIP_CERTIFICATE_CHECK_REQUEST OP_TRACK_GAIN)); | |
259 | ||
260 | print constant_types(), "\n"; # macro defs | |
261 | foreach (C_constant ("Audio::Opusfile", 'constant', 'IV', $types, undef, 3, @names) ) { | |
262 | print $_, "\n"; # C constant subs | |
263 | } | |
264 | print "\n#### XS Section:\n"; | |
265 | print XS_constant ("Audio::Opusfile", $types); | |
266 | __END__ | |
267 | */ | |
268 | ||
269 | switch (len) { | |
270 | case 6: | |
271 | if (memEQ(name, "OP_EOF", 6)) { | |
272 | #ifdef OP_EOF | |
273 | *iv_return = OP_EOF; | |
274 | return PERL_constant_ISIV; | |
275 | #else | |
276 | return PERL_constant_NOTDEF; | |
277 | #endif | |
278 | } | |
279 | break; | |
280 | case 7: | |
281 | if (memEQ(name, "OP_HOLE", 7)) { | |
282 | #ifdef OP_HOLE | |
283 | *iv_return = OP_HOLE; | |
284 | return PERL_constant_ISIV; | |
285 | #else | |
286 | return PERL_constant_NOTDEF; | |
287 | #endif | |
288 | } | |
289 | break; | |
290 | case 8: | |
291 | return constant_8 (aTHX_ name, iv_return); | |
292 | break; | |
293 | case 9: | |
294 | /* Names all of length 9. */ | |
295 | /* OP_EFAULT OP_EINVAL */ | |
296 | /* Offset 6 gives the best switch position. */ | |
297 | switch (name[6]) { | |
298 | case 'U': | |
299 | if (memEQ(name, "OP_EFAULT", 9)) { | |
300 | /* ^ */ | |
301 | #ifdef OP_EFAULT | |
302 | *iv_return = OP_EFAULT; | |
303 | return PERL_constant_ISIV; | |
304 | #else | |
305 | return PERL_constant_NOTDEF; | |
306 | #endif | |
307 | } | |
308 | break; | |
309 | case 'V': | |
310 | if (memEQ(name, "OP_EINVAL", 9)) { | |
311 | /* ^ */ | |
312 | #ifdef OP_EINVAL | |
313 | *iv_return = OP_EINVAL; | |
314 | return PERL_constant_ISIV; | |
315 | #else | |
316 | return PERL_constant_NOTDEF; | |
317 | #endif | |
318 | } | |
319 | break; | |
320 | } | |
321 | break; | |
322 | case 10: | |
323 | if (memEQ(name, "OP_ENOSEEK", 10)) { | |
324 | #ifdef OP_ENOSEEK | |
325 | *iv_return = OP_ENOSEEK; | |
326 | return PERL_constant_ISIV; | |
327 | #else | |
328 | return PERL_constant_NOTDEF; | |
329 | #endif | |
330 | } | |
331 | break; | |
332 | case 11: | |
333 | /* Names all of length 11. */ | |
334 | /* OP_EBADLINK OP_EVERSION */ | |
335 | /* Offset 9 gives the best switch position. */ | |
336 | switch (name[9]) { | |
337 | case 'N': | |
338 | if (memEQ(name, "OP_EBADLINK", 11)) { | |
339 | /* ^ */ | |
340 | #ifdef OP_EBADLINK | |
341 | *iv_return = OP_EBADLINK; | |
342 | return PERL_constant_ISIV; | |
343 | #else | |
344 | return PERL_constant_NOTDEF; | |
345 | #endif | |
346 | } | |
347 | break; | |
348 | case 'O': | |
349 | if (memEQ(name, "OP_EVERSION", 11)) { | |
350 | /* ^ */ | |
351 | #ifdef OP_EVERSION | |
352 | *iv_return = OP_EVERSION; | |
353 | return PERL_constant_ISIV; | |
354 | #else | |
355 | return PERL_constant_NOTDEF; | |
356 | #endif | |
357 | } | |
358 | break; | |
359 | } | |
360 | break; | |
361 | case 12: | |
362 | if (memEQ(name, "OP_ENOTAUDIO", 12)) { | |
363 | #ifdef OP_ENOTAUDIO | |
364 | *iv_return = OP_ENOTAUDIO; | |
365 | return PERL_constant_ISIV; | |
366 | #else | |
367 | return PERL_constant_NOTDEF; | |
368 | #endif | |
369 | } | |
370 | break; | |
371 | case 13: | |
372 | return constant_13 (aTHX_ name, iv_return); | |
373 | break; | |
374 | case 14: | |
375 | if (memEQ(name, "OP_HEADER_GAIN", 14)) { | |
376 | #ifdef OP_HEADER_GAIN | |
377 | *iv_return = OP_HEADER_GAIN; | |
378 | return PERL_constant_ISIV; | |
379 | #else | |
380 | return PERL_constant_NOTDEF; | |
381 | #endif | |
382 | } | |
383 | break; | |
384 | case 16: | |
385 | /* Names all of length 16. */ | |
386 | /* OP_ABSOLUTE_GAIN OP_EBADTIMESTAMP */ | |
387 | /* Offset 15 gives the best switch position. */ | |
388 | switch (name[15]) { | |
389 | case 'N': | |
390 | if (memEQ(name, "OP_ABSOLUTE_GAI", 15)) { | |
391 | /* N */ | |
392 | #ifdef OP_ABSOLUTE_GAIN | |
393 | *iv_return = OP_ABSOLUTE_GAIN; | |
394 | return PERL_constant_ISIV; | |
395 | #else | |
396 | return PERL_constant_NOTDEF; | |
397 | #endif | |
398 | } | |
399 | break; | |
400 | case 'P': | |
401 | if (memEQ(name, "OP_EBADTIMESTAM", 15)) { | |
402 | /* P */ | |
403 | #ifdef OP_EBADTIMESTAMP | |
404 | *iv_return = OP_EBADTIMESTAMP; | |
405 | return PERL_constant_ISIV; | |
406 | #else | |
407 | return PERL_constant_NOTDEF; | |
408 | #endif | |
409 | } | |
410 | break; | |
411 | } | |
412 | break; | |
413 | case 17: | |
414 | return constant_17 (aTHX_ name, iv_return); | |
415 | break; | |
416 | case 18: | |
417 | /* Names all of length 18. */ | |
418 | /* OP_DEC_USE_DEFAULT OP_PIC_FORMAT_JPEG */ | |
419 | /* Offset 11 gives the best switch position. */ | |
420 | switch (name[11]) { | |
421 | case 'A': | |
422 | if (memEQ(name, "OP_PIC_FORMAT_JPEG", 18)) { | |
423 | /* ^ */ | |
424 | #ifdef OP_PIC_FORMAT_JPEG | |
425 | *iv_return = OP_PIC_FORMAT_JPEG; | |
426 | return PERL_constant_ISIV; | |
427 | #else | |
428 | return PERL_constant_NOTDEF; | |
429 | #endif | |
430 | } | |
431 | break; | |
432 | case 'D': | |
433 | if (memEQ(name, "OP_DEC_USE_DEFAULT", 18)) { | |
434 | /* ^ */ | |
435 | #ifdef OP_DEC_USE_DEFAULT | |
436 | *iv_return = OP_DEC_USE_DEFAULT; | |
437 | return PERL_constant_ISIV; | |
438 | #else | |
439 | return PERL_constant_NOTDEF; | |
440 | #endif | |
441 | } | |
442 | break; | |
443 | } | |
444 | break; | |
445 | case 19: | |
446 | /* Names all of length 19. */ | |
447 | /* OP_DEC_FORMAT_FLOAT OP_DEC_FORMAT_SHORT */ | |
448 | /* Offset 15 gives the best switch position. */ | |
449 | switch (name[15]) { | |
450 | case 'H': | |
451 | if (memEQ(name, "OP_DEC_FORMAT_SHORT", 19)) { | |
452 | /* ^ */ | |
453 | #ifdef OP_DEC_FORMAT_SHORT | |
454 | *iv_return = OP_DEC_FORMAT_SHORT; | |
455 | return PERL_constant_ISIV; | |
456 | #else | |
457 | return PERL_constant_NOTDEF; | |
458 | #endif | |
459 | } | |
460 | break; | |
461 | case 'L': | |
462 | if (memEQ(name, "OP_DEC_FORMAT_FLOAT", 19)) { | |
463 | /* ^ */ | |
464 | #ifdef OP_DEC_FORMAT_FLOAT | |
465 | *iv_return = OP_DEC_FORMAT_FLOAT; | |
466 | return PERL_constant_ISIV; | |
467 | #else | |
468 | return PERL_constant_NOTDEF; | |
469 | #endif | |
470 | } | |
471 | break; | |
472 | } | |
473 | break; | |
474 | case 21: | |
475 | if (memEQ(name, "OP_PIC_FORMAT_UNKNOWN", 21)) { | |
476 | #ifdef OP_PIC_FORMAT_UNKNOWN | |
477 | *iv_return = OP_PIC_FORMAT_UNKNOWN; | |
478 | return PERL_constant_ISIV; | |
479 | #else | |
480 | return PERL_constant_NOTDEF; | |
481 | #endif | |
482 | } | |
483 | break; | |
484 | case 22: | |
485 | if (memEQ(name, "OPUS_CHANNEL_COUNT_MAX", 22)) { | |
486 | #ifdef OPUS_CHANNEL_COUNT_MAX | |
487 | *iv_return = OPUS_CHANNEL_COUNT_MAX; | |
488 | return PERL_constant_ISIV; | |
489 | #else | |
490 | return PERL_constant_NOTDEF; | |
491 | #endif | |
492 | } | |
493 | break; | |
494 | case 26: | |
495 | return constant_26 (aTHX_ name, iv_return); | |
496 | break; | |
497 | case 37: | |
498 | if (memEQ(name, "OP_SSL_SKIP_CERTIFICATE_CHECK_REQUEST", 37)) { | |
499 | #ifdef OP_SSL_SKIP_CERTIFICATE_CHECK_REQUEST | |
500 | *iv_return = OP_SSL_SKIP_CERTIFICATE_CHECK_REQUEST; | |
501 | return PERL_constant_ISIV; | |
502 | #else | |
503 | return PERL_constant_NOTDEF; | |
504 | #endif | |
505 | } | |
506 | break; | |
507 | } | |
508 | return PERL_constant_NOTFOUND; | |
509 | } | |
510 |