Xbm2bmp.c

filter: Statementstmt 0.0% 0 / 15 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 0.0% 0 / 19 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« blib/lib/Image/Xbm2bmp.pm ↑ Summary const-c.inc »
1 /*
2 * This file was generated automatically by ExtUtils::ParseXS version 3.63 from the
3 * contents of Xbm2bmp.xs. Do not edit this file, edit Xbm2bmp.xs instead.
4 *
5 * ANY CHANGES MADE HERE WILL BE LOST!
6 *
7 */
8  
9 #line 1 "Xbm2bmp.xs"
10 #include "EXTERN.h"
11 #include "perl.h"
12 #include "XSUB.h"
13  
14 #include "ppport.h"
15  
16 #include "const-c.inc"
17  
18 #line 19 "Xbm2bmp.c"
19 #ifndef PERL_UNUSED_VAR
20 # define PERL_UNUSED_VAR(var) if (0) var = var
21 #endif
22  
23 #ifndef dVAR
24 # define dVAR dNOOP
25 #endif
26  
27  
28 /* This stuff is not part of the API! You have been warned. */
29 #ifndef PERL_VERSION_DECIMAL
30 # define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s)
31 #endif
32 #ifndef PERL_DECIMAL_VERSION
33 # define PERL_DECIMAL_VERSION \
34 PERL_VERSION_DECIMAL(PERL_REVISION,PERL_VERSION,PERL_SUBVERSION)
35 #endif
36 #ifndef PERL_VERSION_GE
37 # define PERL_VERSION_GE(r,v,s) \
38 (PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s))
39 #endif
40 #ifndef PERL_VERSION_LE
41 # define PERL_VERSION_LE(r,v,s) \
42 (PERL_DECIMAL_VERSION <= PERL_VERSION_DECIMAL(r,v,s))
43 #endif
44  
45 /* XS_INTERNAL is the explicit static-linkage variant of the default
46 * XS macro.
47 *
48 * XS_EXTERNAL is the same as XS_INTERNAL except it does not include
49 * "static", ie. it exports XSUB symbols. You probably don't want that
50 * for anything but the BOOT XSUB.
51 *
52 * See XSUB.h in core!
53 */
54  
55  
56 /* TODO: This might be compatible further back than 5.10.0. */
57 #if PERL_VERSION_GE(5, 10, 0) && PERL_VERSION_LE(5, 15, 1)
58 # undef XS_EXTERNAL
59 # undef XS_INTERNAL
60 # if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING)
61 # define XS_EXTERNAL(name) __declspec(dllexport) XSPROTO(name)
62 # define XS_INTERNAL(name) static XSPROTO(name)
63 # endif
64 # if defined(__SYMBIAN32__)
65 # define XS_EXTERNAL(name) EXPORT_C XSPROTO(name)
66 # define XS_INTERNAL(name) EXPORT_C static XSPROTO(name)
67 # endif
68 # ifndef XS_EXTERNAL
69 # if defined(HASATTRIBUTE_UNUSED) && !defined(__cplusplus)
70 # define XS_EXTERNAL(name) void name(pTHX_ CV* cv __attribute__unused__)
71 # define XS_INTERNAL(name) static void name(pTHX_ CV* cv __attribute__unused__)
72 # else
73 # ifdef __cplusplus
74 # define XS_EXTERNAL(name) extern "C" XSPROTO(name)
75 # define XS_INTERNAL(name) static XSPROTO(name)
76 # else
77 # define XS_EXTERNAL(name) XSPROTO(name)
78 # define XS_INTERNAL(name) static XSPROTO(name)
79 # endif
80 # endif
81 # endif
82 #endif
83  
84 /* perl >= 5.10.0 && perl <= 5.15.1 */
85  
86  
87 /* The XS_EXTERNAL macro is used for functions that must not be static
88 * like the boot XSUB of a module. If perl didn't have an XS_EXTERNAL
89 * macro defined, the best we can do is assume XS is the same.
90 * Dito for XS_INTERNAL.
91 */
92 #ifndef XS_EXTERNAL
93 # define XS_EXTERNAL(name) XS(name)
94 #endif
95 #ifndef XS_INTERNAL
96 # define XS_INTERNAL(name) XS(name)
97 #endif
98  
99 /* Now, finally, after all this mess, we want an ExtUtils::ParseXS
100 * internal macro that we're free to redefine for varying linkage due
101 * to the EXPORT_XSUB_SYMBOLS XS keyword. This is internal, use
102 * XS_EXTERNAL(name) or XS_INTERNAL(name) in your code if you need to!
103 */
104  
105 #undef XS_EUPXS
106 #if defined(PERL_EUPXS_ALWAYS_EXPORT)
107 # define XS_EUPXS(name) XS_EXTERNAL(name)
108 #else
109 /* default to internal */
110 # define XS_EUPXS(name) XS_INTERNAL(name)
111 #endif
112  
113 #ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE
114 #define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params)
115  
116 /* prototype to pass -Wmissing-prototypes */
117 static void
118 S_croak_xs_usage(const CV *const cv, const char *const params);
119  
120 static void
121 S_croak_xs_usage(const CV *const cv, const char *const params)
122 {
123 const GV *const gv = CvGV(cv);
124  
125 PERL_ARGS_ASSERT_CROAK_XS_USAGE;
126  
127 if (gv) {
128 const char *const gvname = GvNAME(gv);
129 const HV *const stash = GvSTASH(gv);
130 const char *const hvname = stash ? HvNAME(stash) : NULL;
131  
132 if (hvname)
133 Perl_croak_nocontext("Usage: %s::%s(%s)", hvname, gvname, params);
134 else
135 Perl_croak_nocontext("Usage: %s(%s)", gvname, params);
136 } else {
137 /* Pants. I don't think that it should be possible to get here. */
138 Perl_croak_nocontext("Usage: CODE(0x%" UVxf ")(%s)", PTR2UV(cv), params);
139 }
140 }
141 #undef PERL_ARGS_ASSERT_CROAK_XS_USAGE
142  
143 #define croak_xs_usage S_croak_xs_usage
144  
145 #endif
146  
147 /* NOTE: the prototype of newXSproto() is different in versions of perls,
148 * so we define a portable version of newXSproto()
149 */
150 #ifdef newXS_flags
151 #define newXSproto_portable(name, c_impl, file, proto) newXS_flags(name, c_impl, file, proto, 0)
152 #else
153 #define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv)
154 #endif /* !defined(newXS_flags) */
155  
156 #if PERL_VERSION_LE(5, 21, 5)
157 # define newXS_deffile(a,b) Perl_newXS(aTHX_ a,b,file)
158 #else
159 # define newXS_deffile(a,b) Perl_newXS_deffile(aTHX_ a,b)
160 #endif
161  
162 /* simple backcompat versions of the TARGx() macros with no optimisation */
163 #ifndef TARGi
164 # define TARGi(iv, do_taint) sv_setiv_mg(TARG, iv)
165 # define TARGu(uv, do_taint) sv_setuv_mg(TARG, uv)
166 # define TARGn(nv, do_taint) sv_setnv_mg(TARG, nv)
167 #endif
168  
169 #line 170 "Xbm2bmp.c"
170  
171 /* INCLUDE: Including 'const-xs.inc' from 'Xbm2bmp.xs' */
172  
173  
174 XS_EUPXS(XS_Image__Xbm2bmp_constant); /* prototype to pass -Wmissing-prototypes */
175 0 XS_EUPXS(XS_Image__Xbm2bmp_constant)
176 {
177 0 dVAR; dXSARGS;
178 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
179 0 croak_xs_usage(cv, "sv");
180 PERL_UNUSED_VAR(ax); /* -Wall */
181 0 ▶ SP -= items;
Branch: 1 branch
BranchTrueFalseTotal
SP -= items; 0 0 0
182 {
183 #line 4 "./const-xs.inc"
184 #ifdef dXSTARG
185 dXSTARG; /* Faster if we have it. */
186 #else
187 dTARGET;
188 #endif
189 STRLEN len;
190 int type;
191 /* IV iv; Uncomment this if you need to return IVs */
192 /* NV nv; Uncomment this if you need to return NVs */
193 /* const char *pv; Uncomment this if you need to return PVs */
194 #line 195 "Xbm2bmp.c"
195 0 SV * sv = ST(0)
196 ;
197 0 const char * s = SvPV(sv, len);
198 #line 18 "./const-xs.inc"
199 type = constant(aTHX_ s, len);
200 /* Return 1 or 2 items. First is error message, or undef if no error.
201 Second, if present, is found value */
202 switch (type) {
203 case PERL_constant_NOTFOUND:
204 sv =
205 sv_2mortal(newSVpvf("%s is not a valid Image::Xbm2bmp macro", s));
206 PUSHs(sv);
207 break;
208 case PERL_constant_NOTDEF:
209 sv = sv_2mortal(newSVpvf(
210 "Your vendor has not defined Image::Xbm2bmp macro %s, used",
211 s));
212 PUSHs(sv);
213 break;
214 /* Uncomment this if you need to return IVs
215 case PERL_constant_ISIV:
216 EXTEND(SP, 2);
217 PUSHs(&PL_sv_undef);
218 PUSHi(iv);
219 break; */
220 /* Uncomment this if you need to return NOs
221 case PERL_constant_ISNO:
222 EXTEND(SP, 2);
223 PUSHs(&PL_sv_undef);
224 PUSHs(&PL_sv_no);
225 break; */
226 /* Uncomment this if you need to return NVs
227 case PERL_constant_ISNV:
228 EXTEND(SP, 2);
229 PUSHs(&PL_sv_undef);
230 PUSHn(nv);
231 break; */
232 /* Uncomment this if you need to return PVs
233 case PERL_constant_ISPV:
234 EXTEND(SP, 2);
235 PUSHs(&PL_sv_undef);
236 PUSHp(pv, strlen(pv));
237 break; */
238 /* Uncomment this if you need to return PVNs
239 case PERL_constant_ISPVN:
240 EXTEND(SP, 2);
241 PUSHs(&PL_sv_undef);
242 PUSHp(pv, iv);
243 break; */
244 /* Uncomment this if you need to return SVs
245 case PERL_constant_ISSV:
246 EXTEND(SP, 2);
247 PUSHs(&PL_sv_undef);
248 PUSHs(sv);
249 break; */
250 /* Uncomment this if you need to return UNDEFs
251 case PERL_constant_ISUNDEF:
252 break; */
253 /* Uncomment this if you need to return UVs
254 case PERL_constant_ISUV:
255 EXTEND(SP, 2);
256 PUSHs(&PL_sv_undef);
257 PUSHu((UV)iv);
258 break; */
259 /* Uncomment this if you need to return YESs
260 case PERL_constant_ISYES:
261 EXTEND(SP, 2);
262 PUSHs(&PL_sv_undef);
263 PUSHs(&PL_sv_yes);
264 break; */
265 default:
266 sv = sv_2mortal(newSVpvf(
267 "Unexpected return type %d while processing Image::Xbm2bmp macro %s, used",
268 type, s));
269 PUSHs(sv);
270 }
271 #line 272 "Xbm2bmp.c"
272 0 PUTBACK;
273 0 return;
274 }
275 }
276  
277  
278 /* INCLUDE: Returning to 'Xbm2bmp.xs' from 'const-xs.inc' */
279  
280 #ifdef __cplusplus
281 extern "C" {
282 #endif
283 XS_EXTERNAL(boot_Image__Xbm2bmp); /* prototype to pass -Wmissing-prototypes */
284 0 XS_EXTERNAL(boot_Image__Xbm2bmp)
285 {
286 #if PERL_VERSION_LE(5, 21, 5)
287 dVAR; dXSARGS;
288 #else
289 0 dVAR; dXSBOOTARGSXSAPIVERCHK;
290 #endif
291 #if PERL_VERSION_LE(5, 8, 999) /* PERL_VERSION_LT is 5.33+ */
292 char* file = __FILE__;
293 #else
294 0 const char* file = __FILE__;
295 #endif
296  
297 PERL_UNUSED_VAR(file);
298  
299 PERL_UNUSED_VAR(cv); /* -W */
300 PERL_UNUSED_VAR(items); /* -W */
301 #if PERL_VERSION_LE(5, 21, 5)
302 XS_VERSION_BOOTCHECK;
303 # ifdef XS_APIVERSION_BOOTCHECK
304 XS_APIVERSION_BOOTCHECK;
305 # endif
306 #endif
307  
308 0 newXS_deffile("Image::Xbm2bmp::constant", XS_Image__Xbm2bmp_constant);
309 #if PERL_VERSION_LE(5, 21, 5)
310 # if PERL_VERSION_GE(5, 9, 0)
311 if (PL_unitcheckav)
312 call_list(PL_scopestack_ix, PL_unitcheckav);
313 # endif
314 XSRETURN_YES;
315 #else
316 0 Perl_xs_boot_epilog(aTHX_ ax);
317 #endif
318 0 }
319  
320 #ifdef __cplusplus
321 }
322 #endif
« blib/lib/Image/Xbm2bmp.pm ↑ Summary const-c.inc »