File Coverage

const-c.inc
Criterion Covered Total %
statement 21 225 9.3
branch 4 80 5.0
condition n/a
subroutine n/a
pod n/a
total 25 305 8.2


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