| 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 |
6 |
| constant_13 (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 |
|
| DBX_DATA_READ DBX_FLAG_BODY DBX_ITEMCOUNT DBX_NEWS_ITEM DBX_TYPE_NEWS |
| 28 |
|
| DBX_TYPE_VOID */ |
| 29 |
|
| /* Offset 9 gives the best switch position. */ |
| 30 |
6 |
| switch (name[9]) { |
| 31 |
1 |
| case 'B': |
| 32 |
1 |
▶ | if (memEQ(name, "DBX_FLAG_BODY", 13)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "DBX_FLAG_BODY", 13)) { |
1 |
0 |
1 |
|
| 33 |
|
| /* ^ */ |
| 34 |
|
| #ifdef DBX_FLAG_BODY |
| 35 |
1 |
| *iv_return = DBX_FLAG_BODY; |
| 36 |
1 |
| return PERL_constant_ISIV; |
| 37 |
|
| #else |
| 38 |
|
| return PERL_constant_NOTDEF; |
| 39 |
|
| #endif |
| 40 |
|
| } |
| 41 |
0 |
| break; |
| 42 |
1 |
| case 'I': |
| 43 |
1 |
▶ | if (memEQ(name, "DBX_NEWS_ITEM", 13)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "DBX_NEWS_ITEM", 13)) { |
1 |
0 |
1 |
|
| 44 |
|
| /* ^ */ |
| 45 |
|
| #ifdef DBX_NEWS_ITEM |
| 46 |
1 |
| *iv_return = DBX_NEWS_ITEM; |
| 47 |
1 |
| return PERL_constant_ISIV; |
| 48 |
|
| #else |
| 49 |
|
| return PERL_constant_NOTDEF; |
| 50 |
|
| #endif |
| 51 |
|
| } |
| 52 |
0 |
| break; |
| 53 |
1 |
| case 'N': |
| 54 |
1 |
▶ | if (memEQ(name, "DBX_TYPE_NEWS", 13)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "DBX_TYPE_NEWS", 13)) { |
1 |
0 |
1 |
|
| 55 |
|
| /* ^ */ |
| 56 |
|
| #ifdef DBX_TYPE_NEWS |
| 57 |
1 |
| *iv_return = DBX_TYPE_NEWS; |
| 58 |
1 |
| return PERL_constant_ISIV; |
| 59 |
|
| #else |
| 60 |
|
| return PERL_constant_NOTDEF; |
| 61 |
|
| #endif |
| 62 |
|
| } |
| 63 |
0 |
| break; |
| 64 |
1 |
| case 'O': |
| 65 |
1 |
▶ | if (memEQ(name, "DBX_ITEMCOUNT", 13)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "DBX_ITEMCOUNT", 13)) { |
1 |
0 |
1 |
|
| 66 |
|
| /* ^ */ |
| 67 |
|
| #ifdef DBX_ITEMCOUNT |
| 68 |
1 |
| *iv_return = DBX_ITEMCOUNT; |
| 69 |
1 |
| return PERL_constant_ISIV; |
| 70 |
|
| #else |
| 71 |
|
| return PERL_constant_NOTDEF; |
| 72 |
|
| #endif |
| 73 |
|
| } |
| 74 |
0 |
| break; |
| 75 |
1 |
| case 'R': |
| 76 |
1 |
▶ | if (memEQ(name, "DBX_DATA_READ", 13)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "DBX_DATA_READ", 13)) { |
1 |
0 |
1 |
|
| 77 |
|
| /* ^ */ |
| 78 |
|
| #ifdef DBX_DATA_READ |
| 79 |
1 |
| *iv_return = DBX_DATA_READ; |
| 80 |
1 |
| return PERL_constant_ISIV; |
| 81 |
|
| #else |
| 82 |
|
| return PERL_constant_NOTDEF; |
| 83 |
|
| #endif |
| 84 |
|
| } |
| 85 |
0 |
| break; |
| 86 |
1 |
| case 'V': |
| 87 |
1 |
▶ | if (memEQ(name, "DBX_TYPE_VOID", 13)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "DBX_TYPE_VOID", 13)) { |
1 |
0 |
1 |
|
| 88 |
|
| /* ^ */ |
| 89 |
|
| #ifdef DBX_TYPE_VOID |
| 90 |
1 |
| *iv_return = DBX_TYPE_VOID; |
| 91 |
1 |
| return PERL_constant_ISIV; |
| 92 |
|
| #else |
| 93 |
|
| return PERL_constant_NOTDEF; |
| 94 |
|
| #endif |
| 95 |
|
| } |
| 96 |
0 |
| break; |
| 97 |
|
| } |
| 98 |
0 |
| return PERL_constant_NOTFOUND; |
| 99 |
|
| } |
| 100 |
|
| |
| 101 |
|
| static int |
| 102 |
3 |
| constant_14 (pTHX_ const char *name, IV *iv_return) { |
| 103 |
|
| /* When generated this function returned values for the list of names given |
| 104 |
|
| here. However, subsequent manual editing may have added or removed some. |
| 105 |
|
| DBX_INDEXCOUNT DBX_INDEX_READ DBX_TYPE_EMAIL */ |
| 106 |
|
| /* Offset 10 gives the best switch position. */ |
| 107 |
3 |
| switch (name[10]) { |
| 108 |
1 |
| case 'M': |
| 109 |
1 |
▶ | if (memEQ(name, "DBX_TYPE_EMAIL", 14)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "DBX_TYPE_EMAIL", 14)) { |
1 |
0 |
1 |
|
| 110 |
|
| /* ^ */ |
| 111 |
|
| #ifdef DBX_TYPE_EMAIL |
| 112 |
1 |
| *iv_return = DBX_TYPE_EMAIL; |
| 113 |
1 |
| return PERL_constant_ISIV; |
| 114 |
|
| #else |
| 115 |
|
| return PERL_constant_NOTDEF; |
| 116 |
|
| #endif |
| 117 |
|
| } |
| 118 |
0 |
| break; |
| 119 |
1 |
| case 'O': |
| 120 |
1 |
▶ | if (memEQ(name, "DBX_INDEXCOUNT", 14)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "DBX_INDEXCOUNT", 14)) { |
1 |
0 |
1 |
|
| 121 |
|
| /* ^ */ |
| 122 |
|
| #ifdef DBX_INDEXCOUNT |
| 123 |
1 |
| *iv_return = DBX_INDEXCOUNT; |
| 124 |
1 |
| return PERL_constant_ISIV; |
| 125 |
|
| #else |
| 126 |
|
| return PERL_constant_NOTDEF; |
| 127 |
|
| #endif |
| 128 |
|
| } |
| 129 |
0 |
| break; |
| 130 |
1 |
| case 'R': |
| 131 |
1 |
▶ | if (memEQ(name, "DBX_INDEX_READ", 14)) { |
Branch: 1 branch
| Branch | True | False | Total |
| if (memEQ(name, "DBX_INDEX_READ", 14)) { |
1 |
0 |
1 |
|
| 132 |
|
| /* ^ */ |
| 133 |
|
| #ifdef DBX_INDEX_READ |
| 134 |
1 |
| *iv_return = DBX_INDEX_READ; |
| 135 |
1 |
| return PERL_constant_ISIV; |
| 136 |
|
| #else |
| 137 |
|
| return PERL_constant_NOTDEF; |
| 138 |
|
| #endif |
| 139 |
|
| } |
| 140 |
0 |
| break; |
| 141 |
|
| } |
| 142 |
0 |
| return PERL_constant_NOTFOUND; |
| 143 |
|
| } |
| 144 |
|
| |
| 145 |
|
| static int |
| 146 |
15 |
| constant (pTHX_ const char *name, STRLEN len, IV *iv_return) { |
| 147 |
|
| /* Initially switch on the length of the name. */ |
| 148 |
|
| /* When generated this function returned values for the list of names given |
| 149 |
|
| in this section of perl code. Rather than manually editing these functions |
| 150 |
|
| to add or remove constants, which would result in this comment and section |
| 151 |
|
| of code becoming inaccurate, we recommend that you edit this section of |
| 152 |
|
| code, and use it to regenerate a new set of constant functions which you |
| 153 |
|
| then use to replace the originals. |
| 154 |
|
| |
| 155 |
|
| Regenerate these constant functions by feeding this entire source file to |
| 156 |
|
| perl -x |
| 157 |
|
| |
| 158 |
|
| #!/usr/local/bin/perl -w |
| 159 |
|
| use ExtUtils::Constant qw (constant_types C_constant XS_constant); |
| 160 |
|
| |
| 161 |
|
| my $types = {map {($_, 1)} qw(IV)}; |
| 162 |
|
| my @names = (qw(DBX_BADFILE DBX_DATA_READ DBX_EMAIL_FLAG_ISSEEN DBX_FLAG_BODY |
| 163 |
|
| DBX_INDEXCOUNT DBX_INDEX_OVERREAD DBX_INDEX_READ |
| 164 |
|
| DBX_INDEX_UNDERREAD DBX_ITEMCOUNT DBX_NEWS_ITEM DBX_NOERROR |
| 165 |
|
| DBX_TYPE_EMAIL DBX_TYPE_FOLDER DBX_TYPE_NEWS DBX_TYPE_VOID)); |
| 166 |
|
| |
| 167 |
|
| print constant_types(), "\n"; # macro defs |
| 168 |
|
| foreach (C_constant ("Mail::Transport::Dbx", 'constant', 'IV', $types, undef, 3, @names) ) { |
| 169 |
|
| print $_, "\n"; # C constant subs |
| 170 |
|
| } |
| 171 |
|
| print "\n#### XS Section:\n"; |
| 172 |
|
| print XS_constant ("Mail::Transport::Dbx", $types); |
| 173 |
|
| __END__ |