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
37 use ExtUtils::Constant qw (constant_types C_constant XS_constant);
39 my $types = {map {($_, 1)} qw(IV)};
40 my @names = (qw(EDLIB_EDOP_DELETE EDLIB_EDOP_INSERT EDLIB_EDOP_MATCH
41 EDLIB_EDOP_MISMATCH EDLIB_STATUS_ERROR EDLIB_STATUS_OK),
42 {name=>"EDLIB_CIGAR_EXTENDED", type=>"IV", macro=>"1"},
43 {name=>"EDLIB_CIGAR_STANDARD", type=>"IV", macro=>"1"},
44 {name=>"EDLIB_MODE_HW", type=>"IV", macro=>"1"},
45 {name=>"EDLIB_MODE_NW", type=>"IV", macro=>"1"},
46 {name=>"EDLIB_MODE_SHW", type=>"IV", macro=>"1"},
47 {name=>"EDLIB_TASK_DISTANCE", type=>"IV", macro=>"1"},
48 {name=>"EDLIB_TASK_LOC", type=>"IV", macro=>"1"},
49 {name=>"EDLIB_TASK_PATH", type=>"IV", macro=>"1"});
51 print constant_types(), "\n"; # macro defs
52 foreach (C_constant ("Text::Levenshtein::Edlib", 'constant', 'IV', $types, undef, 3, @names) ) {
53 print $_, "\n"; # C constant subs
55 print "\n#### XS Section:\n";
56 print XS_constant ("Text::Levenshtein::Edlib", $types);
62 /* Names all of length 13. */
63 /* EDLIB_MODE_HW EDLIB_MODE_NW */
64 /* Offset 11 gives the best switch position. */
67 if (memEQ(name, "EDLIB_MODE_HW", 13)) {
69 *iv_return = EDLIB_MODE_HW;
70 return PERL_constant_ISIV;
74 if (memEQ(name, "EDLIB_MODE_NW", 13)) {
76 *iv_return = EDLIB_MODE_NW;
77 return PERL_constant_ISIV;
83 /* Names all of length 14. */
84 /* EDLIB_MODE_SHW EDLIB_TASK_LOC */
85 /* Offset 9 gives the best switch position. */
88 if (memEQ(name, "EDLIB_MODE_SHW", 14)) {
90 *iv_return = EDLIB_MODE_SHW;
91 return PERL_constant_ISIV;
95 if (memEQ(name, "EDLIB_TASK_LOC", 14)) {
97 *iv_return = EDLIB_TASK_LOC;
98 return PERL_constant_ISIV;
104 /* Names all of length 15. */
105 /* EDLIB_STATUS_OK EDLIB_TASK_PATH */
106 /* Offset 6 gives the best switch position. */
109 if (memEQ(name, "EDLIB_STATUS_OK", 15)) {
111 #ifdef EDLIB_STATUS_OK
112 *iv_return = EDLIB_STATUS_OK;
113 return PERL_constant_ISIV;
115 return PERL_constant_NOTDEF;
120 if (memEQ(name, "EDLIB_TASK_PATH", 15)) {
122 *iv_return = EDLIB_TASK_PATH;
123 return PERL_constant_ISIV;
129 if (memEQ(name, "EDLIB_EDOP_MATCH", 16)) {
130 #ifdef EDLIB_EDOP_MATCH
131 *iv_return = EDLIB_EDOP_MATCH;
132 return PERL_constant_ISIV;
134 return PERL_constant_NOTDEF;
139 /* Names all of length 17. */
140 /* EDLIB_EDOP_DELETE EDLIB_EDOP_INSERT */
141 /* Offset 15 gives the best switch position. */
144 if (memEQ(name, "EDLIB_EDOP_INSERT", 17)) {
146 #ifdef EDLIB_EDOP_INSERT
147 *iv_return = EDLIB_EDOP_INSERT;
148 return PERL_constant_ISIV;
150 return PERL_constant_NOTDEF;
155 if (memEQ(name, "EDLIB_EDOP_DELETE", 17)) {
157 #ifdef EDLIB_EDOP_DELETE
158 *iv_return = EDLIB_EDOP_DELETE;
159 return PERL_constant_ISIV;
161 return PERL_constant_NOTDEF;
168 if (memEQ(name, "EDLIB_STATUS_ERROR", 18)) {
169 #ifdef EDLIB_STATUS_ERROR
170 *iv_return = EDLIB_STATUS_ERROR;
171 return PERL_constant_ISIV;
173 return PERL_constant_NOTDEF;
178 /* Names all of length 19. */
179 /* EDLIB_EDOP_MISMATCH EDLIB_TASK_DISTANCE */
180 /* Offset 18 gives the best switch position. */
183 if (memEQ(name, "EDLIB_TASK_DISTANC", 18)) {
185 *iv_return = EDLIB_TASK_DISTANCE;
186 return PERL_constant_ISIV;
190 if (memEQ(name, "EDLIB_EDOP_MISMATC", 18)) {
192 #ifdef EDLIB_EDOP_MISMATCH
193 *iv_return = EDLIB_EDOP_MISMATCH;
194 return PERL_constant_ISIV;
196 return PERL_constant_NOTDEF;
203 /* Names all of length 20. */
204 /* EDLIB_CIGAR_EXTENDED EDLIB_CIGAR_STANDARD */
205 /* Offset 17 gives the best switch position. */
208 if (memEQ(name, "EDLIB_CIGAR_STANDARD", 20)) {
210 *iv_return = EDLIB_CIGAR_STANDARD;
211 return PERL_constant_ISIV;
215 if (memEQ(name, "EDLIB_CIGAR_EXTENDED", 20)) {
217 *iv_return = EDLIB_CIGAR_EXTENDED;
218 return PERL_constant_ISIV;
224 return PERL_constant_NOTFOUND;