| 1 |
|
| static int |
| 2 |
0 |
| event_constant_30 (pTHX_ const char *name, IV *iv_return) { |
| 3 |
|
| /* When generated this function returned values for the list of names given |
| 4 |
|
| here. However, subsequent manual editing may have added or removed some. |
| 5 |
|
| MARPAESLIF_EVENTTYPE_COMPLETED MARPAESLIF_EVENTTYPE_EXHAUSTED |
| 6 |
|
| MARPAESLIF_EVENTTYPE_PREDICTED */ |
| 7 |
|
| /* Offset 23 gives the best switch position. */ |
| 8 |
0 |
| switch (name[23]) { |
| 9 |
0 |
| case 'E': |
| 10 |
0 |
▶ | if (memEQ(name, "MARPAESLIF_EVENTTYPE_PREDICTED", 30)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "MARPAESLIF_EVENTTYPE_PREDICTED", 30)) { |
0 |
0 |
0 |
|
| 11 |
|
| /* ^ */ |
| 12 |
|
| #if 1 |
| 13 |
0 |
| *iv_return = MARPAESLIF_EVENTTYPE_PREDICTED; |
| 14 |
0 |
| return PERL_constant_ISIV; |
| 15 |
|
| #else |
| 16 |
|
| return PERL_constant_NOTDEF; |
| 17 |
|
| #endif |
| 18 |
|
| } |
| 19 |
0 |
| break; |
| 20 |
0 |
| case 'H': |
| 21 |
0 |
▶ | if (memEQ(name, "MARPAESLIF_EVENTTYPE_EXHAUSTED", 30)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "MARPAESLIF_EVENTTYPE_EXHAUSTED", 30)) { |
0 |
0 |
0 |
|
| 22 |
|
| /* ^ */ |
| 23 |
|
| #if 1 |
| 24 |
0 |
| *iv_return = MARPAESLIF_EVENTTYPE_EXHAUSTED; |
| 25 |
0 |
| return PERL_constant_ISIV; |
| 26 |
|
| #else |
| 27 |
|
| return PERL_constant_NOTDEF; |
| 28 |
|
| #endif |
| 29 |
|
| } |
| 30 |
0 |
| break; |
| 31 |
0 |
| case 'M': |
| 32 |
0 |
▶ | if (memEQ(name, "MARPAESLIF_EVENTTYPE_COMPLETED", 30)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "MARPAESLIF_EVENTTYPE_COMPLETED", 30)) { |
0 |
0 |
0 |
|
| 33 |
|
| /* ^ */ |
| 34 |
|
| #if 1 |
| 35 |
0 |
| *iv_return = MARPAESLIF_EVENTTYPE_COMPLETED; |
| 36 |
0 |
| return PERL_constant_ISIV; |
| 37 |
|
| #else |
| 38 |
|
| return PERL_constant_NOTDEF; |
| 39 |
|
| #endif |
| 40 |
|
| } |
| 41 |
0 |
| break; |
| 42 |
|
| } |
| 43 |
0 |
| return PERL_constant_NOTFOUND; |
| 44 |
|
| } |
| 45 |
|
| static int |
| 46 |
0 |
| event_constant (pTHX_ const char *name, STRLEN len, IV *iv_return) { |
| 47 |
|
| /* Initially switch on the length of the name. */ |
| 48 |
|
| /* When generated this function returned values for the list of names given |
| 49 |
|
| in this section of perl code. Rather than manually editing these functions |
| 50 |
|
| to add or remove constants, which would result in this comment and section |
| 51 |
|
| of code becoming inaccurate, we recommend that you edit this section of |
| 52 |
|
| code, and use it to regenerate a new set of constant functions which you |
| 53 |
|
| then use to replace the originals. |
| 54 |
|
| |
| 55 |
|
| Regenerate these constant functions by feeding this entire source file to |
| 56 |
|
| perl -x |
| 57 |
|
| |
| 58 |
|
| #!/usr/local/bin/perl -w |
| 59 |
|
| use ExtUtils::Constant qw (constant_types C_constant XS_constant); |
| 60 |
|
| |
| 61 |
|
| my $types = {map {($_, 1)} qw(IV)}; |
| 62 |
|
| my @names = (qw(MARPAESLIF_EVENTTYPE_AFTER MARPAESLIF_EVENTTYPE_BEFORE |
| 63 |
|
| MARPAESLIF_EVENTTYPE_COMPLETED MARPAESLIF_EVENTTYPE_DISCARD |
| 64 |
|
| MARPAESLIF_EVENTTYPE_EXHAUSTED MARPAESLIF_EVENTTYPE_NONE |
| 65 |
|
| MARPAESLIF_EVENTTYPE_NULLED MARPAESLIF_EVENTTYPE_PREDICTED)); |
| 66 |
|
| |
| 67 |
|
| print constant_types(), "\n"; # macro defs |
| 68 |
|
| foreach (C_constant ("MarpaX::ESLIF::Event::Type", 'event_constant', 'IV', $types, undef, 3, @names) ) { |
| 69 |
|
| print $_, "\n"; # C constant subs |
| 70 |
|
| } |
| 71 |
|
| print "\n#### XS Section:\n"; |
| 72 |
|
| print XS_constant ("MarpaX::ESLIF::Event::Type", $types); |
| 73 |
|
| __END__ |