]> git.proxmox.com Git - libxdgmime-perl.git/blob - Xdgmime/fallback/const-c.inc
import from svn://proxdev/server/svn//libxdgmime-perl/pmg3
[libxdgmime-perl.git] / Xdgmime / fallback / const-c.inc
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_25 (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 _xdg_mime_mime_type_equal xdg_mime_get_generic_icon
28 xdg_mime_get_mime_parents xdg_mime_media_type_equal */
29 /* Offset 13 gives the best switch position. */
30 switch (name[13]) {
31 case 'a':
32 if (memEQ(name, "xdg_mime_media_type_equal", 25)) {
33 /* ^ */
34 #ifdef xdg_mime_media_type_equal
35 *iv_return = xdg_mime_media_type_equal;
36 return PERL_constant_ISIV;
37 #else
38 return PERL_constant_NOTDEF;
39 #endif
40 }
41 break;
42 case 'e':
43 if (memEQ(name, "_xdg_mime_mime_type_equal", 25)) {
44 /* ^ */
45 #ifdef _xdg_mime_mime_type_equal
46 *iv_return = _xdg_mime_mime_type_equal;
47 return PERL_constant_ISIV;
48 #else
49 return PERL_constant_NOTDEF;
50 #endif
51 }
52 break;
53 case 'g':
54 if (memEQ(name, "xdg_mime_get_generic_icon", 25)) {
55 /* ^ */
56 #ifdef xdg_mime_get_generic_icon
57 *iv_return = xdg_mime_get_generic_icon;
58 return PERL_constant_ISIV;
59 #else
60 return PERL_constant_NOTDEF;
61 #endif
62 }
63 break;
64 case 'm':
65 if (memEQ(name, "xdg_mime_get_mime_parents", 25)) {
66 /* ^ */
67 #ifdef xdg_mime_get_mime_parents
68 *iv_return = xdg_mime_get_mime_parents;
69 return PERL_constant_ISIV;
70 #else
71 return PERL_constant_NOTDEF;
72 #endif
73 }
74 break;
75 }
76 return PERL_constant_NOTFOUND;
77 }
78
79 static int
80 constant_27 (pTHX_ const char *name, IV *iv_return) {
81 /* When generated this function returned values for the list of names given
82 here. However, subsequent manual editing may have added or removed some.
83 _xdg_mime_unalias_mime_type xdg_mime_is_valid_mime_type
84 xdg_mime_mime_type_subclass */
85 /* Offset 14 gives the best switch position. */
86 switch (name[14]) {
87 case 'i':
88 if (memEQ(name, "_xdg_mime_unalias_mime_type", 27)) {
89 /* ^ */
90 #ifdef _xdg_mime_unalias_mime_type
91 *iv_return = _xdg_mime_unalias_mime_type;
92 return PERL_constant_ISIV;
93 #else
94 return PERL_constant_NOTDEF;
95 #endif
96 }
97 break;
98 case 'l':
99 if (memEQ(name, "xdg_mime_is_valid_mime_type", 27)) {
100 /* ^ */
101 #ifdef xdg_mime_is_valid_mime_type
102 *iv_return = xdg_mime_is_valid_mime_type;
103 return PERL_constant_ISIV;
104 #else
105 return PERL_constant_NOTDEF;
106 #endif
107 }
108 break;
109 case 't':
110 if (memEQ(name, "xdg_mime_mime_type_subclass", 27)) {
111 /* ^ */
112 #ifdef xdg_mime_mime_type_subclass
113 *iv_return = xdg_mime_mime_type_subclass;
114 return PERL_constant_ISIV;
115 #else
116 return PERL_constant_NOTDEF;
117 #endif
118 }
119 break;
120 }
121 return PERL_constant_NOTFOUND;
122 }
123
124 static int
125 constant_31 (pTHX_ const char *name, IV *iv_return) {
126 /* When generated this function returned values for the list of names given
127 here. However, subsequent manual editing may have added or removed some.
128 xdg_mime_get_max_buffer_extents xdg_mime_get_mime_type_for_data
129 xdg_mime_get_mime_type_for_file */
130 /* Offset 27 gives the best switch position. */
131 switch (name[27]) {
132 case 'd':
133 if (memEQ(name, "xdg_mime_get_mime_type_for_data", 31)) {
134 /* ^ */
135 #ifdef xdg_mime_get_mime_type_for_data
136 *iv_return = xdg_mime_get_mime_type_for_data;
137 return PERL_constant_ISIV;
138 #else
139 return PERL_constant_NOTDEF;
140 #endif
141 }
142 break;
143 case 'e':
144 if (memEQ(name, "xdg_mime_get_max_buffer_extents", 31)) {
145 /* ^ */
146 #ifdef xdg_mime_get_max_buffer_extents
147 *iv_return = xdg_mime_get_max_buffer_extents;
148 return PERL_constant_ISIV;
149 #else
150 return PERL_constant_NOTDEF;
151 #endif
152 }
153 break;
154 case 'f':
155 if (memEQ(name, "xdg_mime_get_mime_type_for_file", 31)) {
156 /* ^ */
157 #ifdef xdg_mime_get_mime_type_for_file
158 *iv_return = xdg_mime_get_mime_type_for_file;
159 return PERL_constant_ISIV;
160 #else
161 return PERL_constant_NOTDEF;
162 #endif
163 }
164 break;
165 }
166 return PERL_constant_NOTFOUND;
167 }
168
169 static int
170 constant (pTHX_ const char *name, STRLEN len, IV *iv_return) {
171 /* Initially switch on the length of the name. */
172 /* When generated this function returned values for the list of names given
173 in this section of perl code. Rather than manually editing these functions
174 to add or remove constants, which would result in this comment and section
175 of code becoming inaccurate, we recommend that you edit this section of
176 code, and use it to regenerate a new set of constant functions which you
177 then use to replace the originals.
178
179 Regenerate these constant functions by feeding this entire source file to
180 perl -x
181
182 #!/usr/bin/perl -w
183 use ExtUtils::Constant qw (constant_types C_constant XS_constant);
184
185 my $types = {map {($_, 1)} qw(IV)};
186 my @names = (qw(XDG_MIME_TYPE_EMPTY XDG_MIME_TYPE_TEXTPLAIN
187 XDG_MIME_TYPE_UNKNOWN _xdg_mime_mime_type_equal
188 _xdg_mime_mime_type_subclass _xdg_mime_unalias_mime_type
189 xdg_mime_dump xdg_mime_get_generic_icon xdg_mime_get_icon
190 xdg_mime_get_max_buffer_extents xdg_mime_get_mime_parents
191 xdg_mime_get_mime_type_for_data xdg_mime_get_mime_type_for_file
192 xdg_mime_get_mime_type_from_file_name
193 xdg_mime_get_mime_types_from_file_name
194 xdg_mime_is_valid_mime_type xdg_mime_list_mime_parents
195 xdg_mime_media_type_equal xdg_mime_mime_type_equal
196 xdg_mime_mime_type_subclass xdg_mime_register_reload_callback
197 xdg_mime_remove_callback xdg_mime_shutdown xdg_mime_type_empty
198 xdg_mime_type_textplain xdg_mime_type_unknown
199 xdg_mime_unalias_mime_type));
200
201 print constant_types(), "\n"; # macro defs
202 foreach (C_constant ("Xdgmime", 'constant', 'IV', $types, undef, 3, @names) ) {
203 print $_, "\n"; # C constant subs
204 }
205 print "\n#### XS Section:\n";
206 print XS_constant ("Xdgmime", $types);
207 __END__
208 */
209
210 switch (len) {
211 case 13:
212 if (memEQ(name, "xdg_mime_dump", 13)) {
213 #ifdef xdg_mime_dump
214 *iv_return = xdg_mime_dump;
215 return PERL_constant_ISIV;
216 #else
217 return PERL_constant_NOTDEF;
218 #endif
219 }
220 break;
221 case 17:
222 /* Names all of length 17. */
223 /* xdg_mime_get_icon xdg_mime_shutdown */
224 /* Offset 11 gives the best switch position. */
225 switch (name[11]) {
226 case 't':
227 if (memEQ(name, "xdg_mime_get_icon", 17)) {
228 /* ^ */
229 #ifdef xdg_mime_get_icon
230 *iv_return = xdg_mime_get_icon;
231 return PERL_constant_ISIV;
232 #else
233 return PERL_constant_NOTDEF;
234 #endif
235 }
236 break;
237 case 'u':
238 if (memEQ(name, "xdg_mime_shutdown", 17)) {
239 /* ^ */
240 #ifdef xdg_mime_shutdown
241 *iv_return = xdg_mime_shutdown;
242 return PERL_constant_ISIV;
243 #else
244 return PERL_constant_NOTDEF;
245 #endif
246 }
247 break;
248 }
249 break;
250 case 19:
251 /* Names all of length 19. */
252 /* XDG_MIME_TYPE_EMPTY xdg_mime_type_empty */
253 /* Offset 18 gives the best switch position. */
254 switch (name[18]) {
255 case 'Y':
256 if (memEQ(name, "XDG_MIME_TYPE_EMPT", 18)) {
257 /* Y */
258 #ifdef XDG_MIME_TYPE_EMPTY
259 *iv_return = XDG_MIME_TYPE_EMPTY;
260 return PERL_constant_ISIV;
261 #else
262 return PERL_constant_NOTDEF;
263 #endif
264 }
265 break;
266 case 'y':
267 if (memEQ(name, "xdg_mime_type_empt", 18)) {
268 /* y */
269 #ifdef xdg_mime_type_empty
270 *iv_return = xdg_mime_type_empty;
271 return PERL_constant_ISIV;
272 #else
273 return PERL_constant_NOTDEF;
274 #endif
275 }
276 break;
277 }
278 break;
279 case 21:
280 /* Names all of length 21. */
281 /* XDG_MIME_TYPE_UNKNOWN xdg_mime_type_unknown */
282 /* Offset 20 gives the best switch position. */
283 switch (name[20]) {
284 case 'N':
285 if (memEQ(name, "XDG_MIME_TYPE_UNKNOW", 20)) {
286 /* N */
287 #ifdef XDG_MIME_TYPE_UNKNOWN
288 *iv_return = XDG_MIME_TYPE_UNKNOWN;
289 return PERL_constant_ISIV;
290 #else
291 return PERL_constant_NOTDEF;
292 #endif
293 }
294 break;
295 case 'n':
296 if (memEQ(name, "xdg_mime_type_unknow", 20)) {
297 /* n */
298 #ifdef xdg_mime_type_unknown
299 *iv_return = xdg_mime_type_unknown;
300 return PERL_constant_ISIV;
301 #else
302 return PERL_constant_NOTDEF;
303 #endif
304 }
305 break;
306 }
307 break;
308 case 23:
309 /* Names all of length 23. */
310 /* XDG_MIME_TYPE_TEXTPLAIN xdg_mime_type_textplain */
311 /* Offset 22 gives the best switch position. */
312 switch (name[22]) {
313 case 'N':
314 if (memEQ(name, "XDG_MIME_TYPE_TEXTPLAI", 22)) {
315 /* N */
316 #ifdef XDG_MIME_TYPE_TEXTPLAIN
317 *iv_return = XDG_MIME_TYPE_TEXTPLAIN;
318 return PERL_constant_ISIV;
319 #else
320 return PERL_constant_NOTDEF;
321 #endif
322 }
323 break;
324 case 'n':
325 if (memEQ(name, "xdg_mime_type_textplai", 22)) {
326 /* n */
327 #ifdef xdg_mime_type_textplain
328 *iv_return = xdg_mime_type_textplain;
329 return PERL_constant_ISIV;
330 #else
331 return PERL_constant_NOTDEF;
332 #endif
333 }
334 break;
335 }
336 break;
337 case 24:
338 /* Names all of length 24. */
339 /* xdg_mime_mime_type_equal xdg_mime_remove_callback */
340 /* Offset 23 gives the best switch position. */
341 switch (name[23]) {
342 case 'k':
343 if (memEQ(name, "xdg_mime_remove_callbac", 23)) {
344 /* k */
345 #ifdef xdg_mime_remove_callback
346 *iv_return = xdg_mime_remove_callback;
347 return PERL_constant_ISIV;
348 #else
349 return PERL_constant_NOTDEF;
350 #endif
351 }
352 break;
353 case 'l':
354 if (memEQ(name, "xdg_mime_mime_type_equa", 23)) {
355 /* l */
356 #ifdef xdg_mime_mime_type_equal
357 *iv_return = xdg_mime_mime_type_equal;
358 return PERL_constant_ISIV;
359 #else
360 return PERL_constant_NOTDEF;
361 #endif
362 }
363 break;
364 }
365 break;
366 case 25:
367 return constant_25 (aTHX_ name, iv_return);
368 break;
369 case 26:
370 /* Names all of length 26. */
371 /* xdg_mime_list_mime_parents xdg_mime_unalias_mime_type */
372 /* Offset 19 gives the best switch position. */
373 switch (name[19]) {
374 case 'm':
375 if (memEQ(name, "xdg_mime_unalias_mime_type", 26)) {
376 /* ^ */
377 #ifdef xdg_mime_unalias_mime_type
378 *iv_return = xdg_mime_unalias_mime_type;
379 return PERL_constant_ISIV;
380 #else
381 return PERL_constant_NOTDEF;
382 #endif
383 }
384 break;
385 case 'p':
386 if (memEQ(name, "xdg_mime_list_mime_parents", 26)) {
387 /* ^ */
388 #ifdef xdg_mime_list_mime_parents
389 *iv_return = xdg_mime_list_mime_parents;
390 return PERL_constant_ISIV;
391 #else
392 return PERL_constant_NOTDEF;
393 #endif
394 }
395 break;
396 }
397 break;
398 case 27:
399 return constant_27 (aTHX_ name, iv_return);
400 break;
401 case 28:
402 if (memEQ(name, "_xdg_mime_mime_type_subclass", 28)) {
403 #ifdef _xdg_mime_mime_type_subclass
404 *iv_return = _xdg_mime_mime_type_subclass;
405 return PERL_constant_ISIV;
406 #else
407 return PERL_constant_NOTDEF;
408 #endif
409 }
410 break;
411 case 31:
412 return constant_31 (aTHX_ name, iv_return);
413 break;
414 case 33:
415 if (memEQ(name, "xdg_mime_register_reload_callback", 33)) {
416 #ifdef xdg_mime_register_reload_callback
417 *iv_return = xdg_mime_register_reload_callback;
418 return PERL_constant_ISIV;
419 #else
420 return PERL_constant_NOTDEF;
421 #endif
422 }
423 break;
424 case 37:
425 if (memEQ(name, "xdg_mime_get_mime_type_from_file_name", 37)) {
426 #ifdef xdg_mime_get_mime_type_from_file_name
427 *iv_return = xdg_mime_get_mime_type_from_file_name;
428 return PERL_constant_ISIV;
429 #else
430 return PERL_constant_NOTDEF;
431 #endif
432 }
433 break;
434 case 38:
435 if (memEQ(name, "xdg_mime_get_mime_types_from_file_name", 38)) {
436 #ifdef xdg_mime_get_mime_types_from_file_name
437 *iv_return = xdg_mime_get_mime_types_from_file_name;
438 return PERL_constant_ISIV;
439 #else
440 return PERL_constant_NOTDEF;
441 #endif
442 }
443 break;
444 }
445 return PERL_constant_NOTFOUND;
446 }
447