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_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. */
32 if (memEQ(name, "xdg_mime_media_type_equal", 25)) {
34 #ifdef xdg_mime_media_type_equal
35 *iv_return = xdg_mime_media_type_equal;
36 return PERL_constant_ISIV;
38 return PERL_constant_NOTDEF;
43 if (memEQ(name, "_xdg_mime_mime_type_equal", 25)) {
45 #ifdef _xdg_mime_mime_type_equal
46 *iv_return = _xdg_mime_mime_type_equal;
47 return PERL_constant_ISIV;
49 return PERL_constant_NOTDEF;
54 if (memEQ(name, "xdg_mime_get_generic_icon", 25)) {
56 #ifdef xdg_mime_get_generic_icon
57 *iv_return = xdg_mime_get_generic_icon;
58 return PERL_constant_ISIV;
60 return PERL_constant_NOTDEF;
65 if (memEQ(name, "xdg_mime_get_mime_parents", 25)) {
67 #ifdef xdg_mime_get_mime_parents
68 *iv_return = xdg_mime_get_mime_parents;
69 return PERL_constant_ISIV;
71 return PERL_constant_NOTDEF;
76 return PERL_constant_NOTFOUND;
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. */
88 if (memEQ(name, "_xdg_mime_unalias_mime_type", 27)) {
90 #ifdef _xdg_mime_unalias_mime_type
91 *iv_return = _xdg_mime_unalias_mime_type;
92 return PERL_constant_ISIV;
94 return PERL_constant_NOTDEF;
99 if (memEQ(name, "xdg_mime_is_valid_mime_type", 27)) {
101 #ifdef xdg_mime_is_valid_mime_type
102 *iv_return = xdg_mime_is_valid_mime_type;
103 return PERL_constant_ISIV;
105 return PERL_constant_NOTDEF;
110 if (memEQ(name, "xdg_mime_mime_type_subclass", 27)) {
112 #ifdef xdg_mime_mime_type_subclass
113 *iv_return = xdg_mime_mime_type_subclass;
114 return PERL_constant_ISIV;
116 return PERL_constant_NOTDEF;
121 return PERL_constant_NOTFOUND;
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. */
133 if (memEQ(name, "xdg_mime_get_mime_type_for_data", 31)) {
135 #ifdef xdg_mime_get_mime_type_for_data
136 *iv_return = xdg_mime_get_mime_type_for_data;
137 return PERL_constant_ISIV;
139 return PERL_constant_NOTDEF;
144 if (memEQ(name, "xdg_mime_get_max_buffer_extents", 31)) {
146 #ifdef xdg_mime_get_max_buffer_extents
147 *iv_return = xdg_mime_get_max_buffer_extents;
148 return PERL_constant_ISIV;
150 return PERL_constant_NOTDEF;
155 if (memEQ(name, "xdg_mime_get_mime_type_for_file", 31)) {
157 #ifdef xdg_mime_get_mime_type_for_file
158 *iv_return = xdg_mime_get_mime_type_for_file;
159 return PERL_constant_ISIV;
161 return PERL_constant_NOTDEF;
166 return PERL_constant_NOTFOUND;
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.
179 Regenerate these constant functions by feeding this entire source file to
183 use ExtUtils::Constant qw (constant_types C_constant XS_constant);
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));
201 print constant_types(), "\n"; # macro defs
202 foreach (C_constant ("Xdgmime", 'constant', 'IV', $types, undef, 3, @names) ) {
203 print $_, "\n"; # C constant subs
205 print "\n#### XS Section:\n";
206 print XS_constant ("Xdgmime", $types);
212 if (memEQ(name, "xdg_mime_dump", 13)) {
214 *iv_return = xdg_mime_dump;
215 return PERL_constant_ISIV;
217 return PERL_constant_NOTDEF;
222 /* Names all of length 17. */
223 /* xdg_mime_get_icon xdg_mime_shutdown */
224 /* Offset 11 gives the best switch position. */
227 if (memEQ(name, "xdg_mime_get_icon", 17)) {
229 #ifdef xdg_mime_get_icon
230 *iv_return = xdg_mime_get_icon;
231 return PERL_constant_ISIV;
233 return PERL_constant_NOTDEF;
238 if (memEQ(name, "xdg_mime_shutdown", 17)) {
240 #ifdef xdg_mime_shutdown
241 *iv_return = xdg_mime_shutdown;
242 return PERL_constant_ISIV;
244 return PERL_constant_NOTDEF;
251 /* Names all of length 19. */
252 /* XDG_MIME_TYPE_EMPTY xdg_mime_type_empty */
253 /* Offset 18 gives the best switch position. */
256 if (memEQ(name, "XDG_MIME_TYPE_EMPT", 18)) {
258 #ifdef XDG_MIME_TYPE_EMPTY
259 *iv_return = XDG_MIME_TYPE_EMPTY;
260 return PERL_constant_ISIV;
262 return PERL_constant_NOTDEF;
267 if (memEQ(name, "xdg_mime_type_empt", 18)) {
269 #ifdef xdg_mime_type_empty
270 *iv_return = xdg_mime_type_empty;
271 return PERL_constant_ISIV;
273 return PERL_constant_NOTDEF;
280 /* Names all of length 21. */
281 /* XDG_MIME_TYPE_UNKNOWN xdg_mime_type_unknown */
282 /* Offset 20 gives the best switch position. */
285 if (memEQ(name, "XDG_MIME_TYPE_UNKNOW", 20)) {
287 #ifdef XDG_MIME_TYPE_UNKNOWN
288 *iv_return = XDG_MIME_TYPE_UNKNOWN;
289 return PERL_constant_ISIV;
291 return PERL_constant_NOTDEF;
296 if (memEQ(name, "xdg_mime_type_unknow", 20)) {
298 #ifdef xdg_mime_type_unknown
299 *iv_return = xdg_mime_type_unknown;
300 return PERL_constant_ISIV;
302 return PERL_constant_NOTDEF;
309 /* Names all of length 23. */
310 /* XDG_MIME_TYPE_TEXTPLAIN xdg_mime_type_textplain */
311 /* Offset 22 gives the best switch position. */
314 if (memEQ(name, "XDG_MIME_TYPE_TEXTPLAI", 22)) {
316 #ifdef XDG_MIME_TYPE_TEXTPLAIN
317 *iv_return = XDG_MIME_TYPE_TEXTPLAIN;
318 return PERL_constant_ISIV;
320 return PERL_constant_NOTDEF;
325 if (memEQ(name, "xdg_mime_type_textplai", 22)) {
327 #ifdef xdg_mime_type_textplain
328 *iv_return = xdg_mime_type_textplain;
329 return PERL_constant_ISIV;
331 return PERL_constant_NOTDEF;
338 /* Names all of length 24. */
339 /* xdg_mime_mime_type_equal xdg_mime_remove_callback */
340 /* Offset 23 gives the best switch position. */
343 if (memEQ(name, "xdg_mime_remove_callbac", 23)) {
345 #ifdef xdg_mime_remove_callback
346 *iv_return = xdg_mime_remove_callback;
347 return PERL_constant_ISIV;
349 return PERL_constant_NOTDEF;
354 if (memEQ(name, "xdg_mime_mime_type_equa", 23)) {
356 #ifdef xdg_mime_mime_type_equal
357 *iv_return = xdg_mime_mime_type_equal;
358 return PERL_constant_ISIV;
360 return PERL_constant_NOTDEF;
367 return constant_25 (aTHX_ name, iv_return);
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. */
375 if (memEQ(name, "xdg_mime_unalias_mime_type", 26)) {
377 #ifdef xdg_mime_unalias_mime_type
378 *iv_return = xdg_mime_unalias_mime_type;
379 return PERL_constant_ISIV;
381 return PERL_constant_NOTDEF;
386 if (memEQ(name, "xdg_mime_list_mime_parents", 26)) {
388 #ifdef xdg_mime_list_mime_parents
389 *iv_return = xdg_mime_list_mime_parents;
390 return PERL_constant_ISIV;
392 return PERL_constant_NOTDEF;
399 return constant_27 (aTHX_ name, iv_return);
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;
407 return PERL_constant_NOTDEF;
412 return constant_31 (aTHX_ name, iv_return);
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;
420 return PERL_constant_NOTDEF;
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;
430 return PERL_constant_NOTDEF;
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;
440 return PERL_constant_NOTDEF;
445 return PERL_constant_NOTFOUND;