t/typemap/typemap_xsgen.cc

filter: Statementstmt 90.7% 923 / 1017 Branchbran 57.2% 474 / 828 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 75.7% 1397 / 1845 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« t/typemap/container.xsi ↑ Summary t/svapi/scope.cc »
1 /*
2 * This file was generated automatically by XS::Install::FrozenShit::ParseXS version 3.57 from the
3 * contents of typemap.xs. Do not edit this file, edit typemap.xs instead.
4 *
5 * ANY CHANGES MADE HERE WILL BE LOST!
6 *
7 */
8  
9 #line 1 "t/typemap/typemap.xs"
10 #include <xs.h>
11 #include <vector>
12 #include <map>
13 #include "tmtest.h"
14 #include <panda/error.h>
15  
16 using namespace xs;
17 using namespace panda;
18  
19 DCnt dcnt;
20  
21 #line 22 "t/typemap/typemap_xsgen.cc"
22 #ifndef PERL_UNUSED_VAR
23 # define PERL_UNUSED_VAR(var) if (0) var = var
24 #endif
25  
26 #ifndef dVAR
27 # define dVAR dNOOP
28 #endif
29  
30  
31 /* This stuff is not part of the API! You have been warned. */
32 #ifndef PERL_VERSION_DECIMAL
33 # define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s)
34 #endif
35 #ifndef PERL_DECIMAL_VERSION
36 # define PERL_DECIMAL_VERSION \
37 PERL_VERSION_DECIMAL(PERL_REVISION,PERL_VERSION,PERL_SUBVERSION)
38 #endif
39 #ifndef PERL_VERSION_GE
40 # define PERL_VERSION_GE(r,v,s) \
41 (PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s))
42 #endif
43 #ifndef PERL_VERSION_LE
44 # define PERL_VERSION_LE(r,v,s) \
45 (PERL_DECIMAL_VERSION <= PERL_VERSION_DECIMAL(r,v,s))
46 #endif
47  
48 /* XS_INTERNAL is the explicit static-linkage variant of the default
49 * XS macro.
50 *
51 * XS_EXTERNAL is the same as XS_INTERNAL except it does not include
52 * "STATIC", ie. it exports XSUB symbols. You probably don't want that
53 * for anything but the BOOT XSUB.
54 *
55 * See XSUB.h in core!
56 */
57  
58  
59 /* TODO: This might be compatible further back than 5.10.0. */
60 #if PERL_VERSION_GE(5, 10, 0) && PERL_VERSION_LE(5, 15, 1)
61 # undef XS_EXTERNAL
62 # undef XS_INTERNAL
63 # if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING)
64 # define XS_EXTERNAL(name) __declspec(dllexport) XSPROTO(name)
65 # define XS_INTERNAL(name) STATIC XSPROTO(name)
66 # endif
67 # if defined(__SYMBIAN32__)
68 # define XS_EXTERNAL(name) EXPORT_C XSPROTO(name)
69 # define XS_INTERNAL(name) EXPORT_C STATIC XSPROTO(name)
70 # endif
71 # ifndef XS_EXTERNAL
72 # if defined(HASATTRIBUTE_UNUSED) && !defined(__cplusplus)
73 # define XS_EXTERNAL(name) void name(pTHX_ CV* cv __attribute__unused__)
74 # define XS_INTERNAL(name) STATIC void name(pTHX_ CV* cv __attribute__unused__)
75 # else
76 # ifdef __cplusplus
77 # define XS_EXTERNAL(name) extern "C" XSPROTO(name)
78 # define XS_INTERNAL(name) static XSPROTO(name)
79 # else
80 # define XS_EXTERNAL(name) XSPROTO(name)
81 # define XS_INTERNAL(name) STATIC XSPROTO(name)
82 # endif
83 # endif
84 # endif
85 #endif
86  
87 /* perl >= 5.10.0 && perl <= 5.15.1 */
88  
89  
90 /* The XS_EXTERNAL macro is used for functions that must not be static
91 * like the boot XSUB of a module. If perl didn't have an XS_EXTERNAL
92 * macro defined, the best we can do is assume XS is the same.
93 * Dito for XS_INTERNAL.
94 */
95 #ifndef XS_EXTERNAL
96 # define XS_EXTERNAL(name) XS(name)
97 #endif
98 #ifndef XS_INTERNAL
99 # define XS_INTERNAL(name) XS(name)
100 #endif
101  
102 /* Now, finally, after all this mess, we want an XS::Install::FrozenShit::ParseXS
103 * internal macro that we're free to redefine for varying linkage due
104 * to the EXPORT_XSUB_SYMBOLS XS keyword. This is internal, use
105 * XS_EXTERNAL(name) or XS_INTERNAL(name) in your code if you need to!
106 */
107  
108 #undef XS_EUPXS
109 #if defined(PERL_EUPXS_ALWAYS_EXPORT)
110 # define XS_EUPXS(name) XS_EXTERNAL(name)
111 #else
112 /* default to internal */
113 # define XS_EUPXS(name) XS_INTERNAL(name)
114 #endif
115  
116 #ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE
117 #define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params)
118  
119 /* prototype to pass -Wmissing-prototypes */
120 STATIC void
121 S_croak_xs_usage(const CV *const cv, const char *const params);
122  
123 STATIC void
124 S_croak_xs_usage(const CV *const cv, const char *const params)
125 {
126 const GV *const gv = CvGV(cv);
127  
128 PERL_ARGS_ASSERT_CROAK_XS_USAGE;
129  
130 if (gv) {
131 const char *const gvname = GvNAME(gv);
132 const HV *const stash = GvSTASH(gv);
133 const char *const hvname = stash ? HvNAME(stash) : NULL;
134  
135 if (hvname)
136 Perl_croak_nocontext("Usage: %s::%s(%s)", hvname, gvname, params);
137 else
138 Perl_croak_nocontext("Usage: %s(%s)", gvname, params);
139 } else {
140 /* Pants. I don't think that it should be possible to get here. */
141 Perl_croak_nocontext("Usage: CODE(0x%" UVxf ")(%s)", PTR2UV(cv), params);
142 }
143 }
144 #undef PERL_ARGS_ASSERT_CROAK_XS_USAGE
145  
146 #define croak_xs_usage S_croak_xs_usage
147  
148 #endif
149  
150 /* NOTE: the prototype of newXSproto() is different in versions of perls,
151 * so we define a portable version of newXSproto()
152 */
153 #ifdef newXS_flags
154 #define newXSproto_portable(name, c_impl, file, proto) newXS_flags(name, c_impl, file, proto, 0)
155 #else
156 #define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv)
157 #endif /* !defined(newXS_flags) */
158  
159 #if PERL_VERSION_LE(5, 21, 5)
160 # define newXS_deffile(a,b) Perl_newXS(aTHX_ a,b,file)
161 #else
162 # define newXS_deffile(a,b) Perl_newXS_deffile(aTHX_ a,b)
163 #endif
164  
165 /* simple backcompat versions of the TARGx() macros with no optimisation */
166 #ifndef TARGi
167 # define TARGi(iv, do_taint) sv_setiv_mg(TARG, iv)
168 # define TARGu(uv, do_taint) sv_setuv_mg(TARG, uv)
169 # define TARGn(nv, do_taint) sv_setnv_mg(TARG, nv)
170 #endif
171  
172 #line 173 "t/typemap/typemap_xsgen.cc"
173  
174  
175 222 ▶XS_EUPXS(XS_MyTest_dcnt) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest_dcnt) { xs::throw_guard(cv, [=]() 111 0 111
176 {
177 111 dVAR; dXSARGS;
178 111 ▶ if (items != 0)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 0) 0 111 111
179 0 croak_xs_usage(cv, "");
180 {
181 AV * RETVAL;
182 #line 21 "t/typemap/typemap.xs"
183 RETVAL = newAV();
184 av_push(RETVAL, newSViv(dcnt.c));
185 av_push(RETVAL, newSViv(dcnt.perl));
186 dcnt.c = 0;
187 dcnt.perl = 0;
188 #line 189 "t/typemap/typemap_xsgen.cc"
189 {
190 SV * RETVALSV;
191 111 ▶ RETVALSV = RETVAL ? newRV_noinc((SV*)RETVAL) : &PL_sv_undef;
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = RETVAL ? newRV_noinc((SV*)RETVAL) : &PL_sv_undef; 111 0 111
192 111 RETVALSV = sv_2mortal(RETVALSV);
193 111 ST(0) = RETVALSV;
194 }
195 }
196 111 XSRETURN(1);
197 111 }); }
198  
199  
200 /* INCLUDE: Including 'primitives.xsi' from 'typemap.xs' */
201  
202  
203  
204 6 ▶XS_EUPXS(XS_MyTest_i8) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest_i8) { xs::throw_guard(cv, [=]() 3 0 3
205 {
206 3 dVAR; dXSARGS;
207 3 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 3 3
208 0 croak_xs_usage(cv, "val");
209 {
210 int8_t RETVAL;
211 3 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 3 0 3
212 3 ▶ int8_t val = (int8_t)SvIV(ST(0))
Branch: 1 branch
BranchTrueFalseTotal
int8_t val = (int8_t)SvIV(ST(0)) 0 3 3
213 ;
214 #line 5 "t/typemap/primitives.xsi"
215 RETVAL = val;
216 #line 217 "t/typemap/typemap_xsgen.cc"
217 3 ▶ TARGi((IV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGi((IV)RETVAL, 1); 0 3 3
218 3 ST(0) = TARG;
219 }
220 3 XSRETURN(1);
221 3 }); }
222  
223  
224  
225 6 ▶XS_EUPXS(XS_MyTest_i16) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest_i16) { xs::throw_guard(cv, [=]() 3 0 3
226 {
227 3 dVAR; dXSARGS;
228 3 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 3 3
229 0 croak_xs_usage(cv, "val");
230 {
231 int16_t RETVAL;
232 3 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 3 0 3
233 3 ▶ int16_t val = (int16_t)SvIV(ST(0))
Branch: 1 branch
BranchTrueFalseTotal
int16_t val = (int16_t)SvIV(ST(0)) 0 3 3
234 ;
235 #line 9 "t/typemap/primitives.xsi"
236 RETVAL = val;
237 #line 238 "t/typemap/typemap_xsgen.cc"
238 3 ▶ TARGi((IV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGi((IV)RETVAL, 1); 0 3 3
239 3 ST(0) = TARG;
240 }
241 3 XSRETURN(1);
242 3 }); }
243  
244  
245  
246 6 ▶XS_EUPXS(XS_MyTest_i32) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest_i32) { xs::throw_guard(cv, [=]() 3 0 3
247 {
248 3 dVAR; dXSARGS;
249 3 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 3 3
250 0 croak_xs_usage(cv, "val");
251 {
252 int32_t RETVAL;
253 3 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 3 0 3
254 3 ▶ int32_t val = (int32_t)SvIV(ST(0))
Branch: 1 branch
BranchTrueFalseTotal
int32_t val = (int32_t)SvIV(ST(0)) 0 3 3
255 ;
256 #line 13 "t/typemap/primitives.xsi"
257 RETVAL = val;
258 #line 259 "t/typemap/typemap_xsgen.cc"
259 3 ▶ TARGi((IV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGi((IV)RETVAL, 1); 0 3 3
260 3 ST(0) = TARG;
261 }
262 3 XSRETURN(1);
263 3 }); }
264  
265  
266  
267 6 ▶XS_EUPXS(XS_MyTest_i64) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest_i64) { xs::throw_guard(cv, [=]() 3 0 3
268 {
269 3 dVAR; dXSARGS;
270 3 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 3 3
271 0 croak_xs_usage(cv, "val");
272 {
273 int64_t RETVAL;
274 3 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 3 0 3
275 3 ▶ int64_t val = (int64_t)SvIV(ST(0))
Branch: 1 branch
BranchTrueFalseTotal
int64_t val = (int64_t)SvIV(ST(0)) 0 3 3
276 ;
277 #line 17 "t/typemap/primitives.xsi"
278 RETVAL = val;
279 #line 280 "t/typemap/typemap_xsgen.cc"
280 3 ▶ TARGi((IV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGi((IV)RETVAL, 1); 0 3 3
281 3 ST(0) = TARG;
282 }
283 3 XSRETURN(1);
284 3 }); }
285  
286  
287  
288 8 ▶XS_EUPXS(XS_MyTest_u8) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest_u8) { xs::throw_guard(cv, [=]() 4 0 4
289 {
290 4 dVAR; dXSARGS;
291 4 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 4 4
292 0 croak_xs_usage(cv, "val");
293 {
294 uint8_t RETVAL;
295 4 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 4 0 4
296 4 ▶ uint8_t val = (uint8_t)SvUV(ST(0))
Branch: 1 branch
BranchTrueFalseTotal
uint8_t val = (uint8_t)SvUV(ST(0)) 0 4 4
297 ;
298 #line 21 "t/typemap/primitives.xsi"
299 RETVAL = val;
300 #line 301 "t/typemap/typemap_xsgen.cc"
301 4 ▶ TARGu((UV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 0 4 4
302 4 ST(0) = TARG;
303 }
304 4 XSRETURN(1);
305 4 }); }
306  
307  
308  
309 8 ▶XS_EUPXS(XS_MyTest_u16) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest_u16) { xs::throw_guard(cv, [=]() 4 0 4
310 {
311 4 dVAR; dXSARGS;
312 4 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 4 4
313 0 croak_xs_usage(cv, "val");
314 {
315 uint16_t RETVAL;
316 4 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 4 0 4
317 4 ▶ uint16_t val = (uint16_t)SvUV(ST(0))
Branch: 1 branch
BranchTrueFalseTotal
uint16_t val = (uint16_t)SvUV(ST(0)) 0 4 4
318 ;
319 #line 25 "t/typemap/primitives.xsi"
320 RETVAL = val;
321 #line 322 "t/typemap/typemap_xsgen.cc"
322 4 ▶ TARGu((UV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 0 4 4
323 4 ST(0) = TARG;
324 }
325 4 XSRETURN(1);
326 4 }); }
327  
328  
329  
330 6 ▶XS_EUPXS(XS_MyTest_u32) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest_u32) { xs::throw_guard(cv, [=]() 3 0 3
331 {
332 3 dVAR; dXSARGS;
333 3 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 3 3
334 0 croak_xs_usage(cv, "val");
335 {
336 uint32_t RETVAL;
337 3 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 3 0 3
338 3 ▶ uint32_t val = (uint32_t)SvUV(ST(0))
Branch: 1 branch
BranchTrueFalseTotal
uint32_t val = (uint32_t)SvUV(ST(0)) 0 3 3
339 ;
340 #line 29 "t/typemap/primitives.xsi"
341 RETVAL = val;
342 #line 343 "t/typemap/typemap_xsgen.cc"
343 3 ▶ TARGu((UV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 0 3 3
344 3 ST(0) = TARG;
345 }
346 3 XSRETURN(1);
347 3 }); }
348  
349  
350  
351 6 ▶XS_EUPXS(XS_MyTest_u64) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest_u64) { xs::throw_guard(cv, [=]() 3 0 3
352 {
353 3 dVAR; dXSARGS;
354 3 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 3 3
355 0 croak_xs_usage(cv, "val");
356 {
357 uint64_t RETVAL;
358 3 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 3 0 3
359 3 ▶ uint64_t val = (uint64_t)SvUV(ST(0))
Branch: 1 branch
BranchTrueFalseTotal
uint64_t val = (uint64_t)SvUV(ST(0)) 0 3 3
360 ;
361 #line 33 "t/typemap/primitives.xsi"
362 RETVAL = val;
363 #line 364 "t/typemap/typemap_xsgen.cc"
364 3 ▶ TARGu((UV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 0 3 3
365 3 ST(0) = TARG;
366 }
367 3 XSRETURN(1);
368 3 }); }
369  
370  
371  
372 4 ▶XS_EUPXS(XS_MyTest_time_t) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest_time_t) { xs::throw_guard(cv, [=]() 2 0 2
373 {
374 2 dVAR; dXSARGS;
375 2 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 2 2
376 0 croak_xs_usage(cv, "val");
377 {
378 time_t RETVAL;
379 2 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 2 0 2
380 2 ▶ time_t val = (time_t)SvIV(ST(0))
Branch: 1 branch
BranchTrueFalseTotal
time_t val = (time_t)SvIV(ST(0)) 0 2 2
381 ;
382 #line 37 "t/typemap/primitives.xsi"
383 RETVAL = val;
384 #line 385 "t/typemap/typemap_xsgen.cc"
385 2 ▶ TARGi((IV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGi((IV)RETVAL, 1); 0 2 2
386 2 ST(0) = TARG;
387 }
388 2 XSRETURN(1);
389 2 }); }
390  
391  
392 /* INCLUDE: Returning to 'typemap.xs' from 'primitives.xsi' */
393  
394  
395 /* INCLUDE: Including 'svrefs.xsi' from 'typemap.xs' */
396  
397  
398  
399 4 ▶XS_EUPXS(XS_MyTest_av_out) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest_av_out) { xs::throw_guard(cv, [=]() 2 0 2
400 {
401 2 dVAR; dXSARGS;
402 2 ▶ if (items < 0 || items > 1)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 0 || items > 1) 2 0 2
if (items < 0 || items > 1) 0 2 2
403 0 croak_xs_usage(cv, "not_null= false");
404 {
405 AV * RETVAL;
406 bool not_null;
407  
408 2 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 1 1 2
409 1 not_null = false;
410 else {
411 1 not_null = (bool)SvTRUE(ST(0))
412 ;
413 }
414 #line 5 "t/typemap/svrefs.xsi"
415 RETVAL = not_null ? newAV() : NULL;
416 #line 417 "t/typemap/typemap_xsgen.cc"
417 {
418 SV * RETVALSV;
419 2 ▶ RETVALSV = RETVAL ? newRV_noinc((SV*)RETVAL) : &PL_sv_undef;
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = RETVAL ? newRV_noinc((SV*)RETVAL) : &PL_sv_undef; 1 1 2
420 2 RETVALSV = sv_2mortal(RETVALSV);
421 2 ST(0) = RETVALSV;
422 }
423 }
424 2 XSRETURN(1);
425 2 }); }
426  
427  
428  
429 22 ▶XS_EUPXS(XS_MyTest_av_in) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest_av_in) { xs::throw_guard(cv, [=]() 2 0 2
430 {
431 11 dVAR; dXSARGS;
432 11 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 11 11
433 0 croak_xs_usage(cv, "val");
434 {
435 uint64_t RETVAL;
436 11 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 11 0 11
437 AV* val;
438  
439 11 ▶ if (SvROK(ST(0)) && SvTYPE(SvRV(ST(0))) == SVt_PVAV) val = (AV*)SvRV(ST(0));
Branch: 2 branches
BranchTrueFalseTotal
if (SvROK(ST(0)) && SvTYPE(SvRV(ST(0))) == SVt_PVAV) val = (AV*)SvRV(ST(0)); 5 6 11
if (SvROK(ST(0)) && SvTYPE(SvRV(ST(0))) == SVt_PVAV) val = (AV*)SvRV(ST(0)); 1 4 5
440 10 ▶ else if (SvOK(ST(0))) throw "MyTest::av_in() -- val is not an ARRAY reference";
Branch: 1 branch
BranchTrueFalseTotal
else if (SvOK(ST(0))) throw "MyTest::av_in() -- val is not an ARRAY reference"; 9 1 10
441 1 else val = NULL
442 ;
443 #line 9 "t/typemap/svrefs.xsi"
444 RETVAL = (uint64_t)val;
445 #line 446 "t/typemap/typemap_xsgen.cc"
446 2 ▶ TARGu((UV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 2 0 2
447 2 ST(0) = TARG;
448 }
449 2 XSRETURN(1);
450 2 }); }
451  
452  
453  
454 4 ▶XS_EUPXS(XS_MyTest_hv_out) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest_hv_out) { xs::throw_guard(cv, [=]() 2 0 2
455 {
456 2 dVAR; dXSARGS;
457 2 ▶ if (items < 0 || items > 1)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 0 || items > 1) 2 0 2
if (items < 0 || items > 1) 0 2 2
458 0 croak_xs_usage(cv, "not_null= false");
459 {
460 HV * RETVAL;
461 bool not_null;
462  
463 2 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 1 1 2
464 1 not_null = false;
465 else {
466 1 not_null = (bool)SvTRUE(ST(0))
467 ;
468 }
469 #line 13 "t/typemap/svrefs.xsi"
470 RETVAL = not_null ? newHV() : NULL;
471 #line 472 "t/typemap/typemap_xsgen.cc"
472 {
473 SV * RETVALSV;
474 2 ▶ RETVALSV = RETVAL ? newRV_noinc((SV*)RETVAL) : &PL_sv_undef;
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = RETVAL ? newRV_noinc((SV*)RETVAL) : &PL_sv_undef; 1 1 2
475 2 RETVALSV = sv_2mortal(RETVALSV);
476 2 ST(0) = RETVALSV;
477 }
478 }
479 2 XSRETURN(1);
480 2 }); }
481  
482  
483  
484 22 ▶XS_EUPXS(XS_MyTest_hv_in) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest_hv_in) { xs::throw_guard(cv, [=]() 2 0 2
485 {
486 11 dVAR; dXSARGS;
487 11 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 11 11
488 0 croak_xs_usage(cv, "val");
489 {
490 uint64_t RETVAL;
491 11 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 11 0 11
492 HV* val;
493  
494 11 ▶ if (SvROK(ST(0)) && SvTYPE(SvRV(ST(0))) == SVt_PVHV) val = (HV*)SvRV(ST(0));
Branch: 2 branches
BranchTrueFalseTotal
if (SvROK(ST(0)) && SvTYPE(SvRV(ST(0))) == SVt_PVHV) val = (HV*)SvRV(ST(0)); 5 6 11
if (SvROK(ST(0)) && SvTYPE(SvRV(ST(0))) == SVt_PVHV) val = (HV*)SvRV(ST(0)); 1 4 5
495 10 ▶ else if (SvOK(ST(0))) throw "MyTest::hv_in() -- val is not a HASH reference";
Branch: 1 branch
BranchTrueFalseTotal
else if (SvOK(ST(0))) throw "MyTest::hv_in() -- val is not a HASH reference"; 9 1 10
496 1 else val = NULL
497 ;
498 #line 17 "t/typemap/svrefs.xsi"
499 RETVAL = (uint64_t)val;
500 #line 501 "t/typemap/typemap_xsgen.cc"
501 2 ▶ TARGu((UV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 2 0 2
502 2 ST(0) = TARG;
503 }
504 2 XSRETURN(1);
505 2 }); }
506  
507  
508  
509 4 ▶XS_EUPXS(XS_MyTest_io_out) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest_io_out) { xs::throw_guard(cv, [=]() 2 0 2
510 {
511 2 dVAR; dXSARGS;
512 2 ▶ if (items < 0 || items > 1)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 0 || items > 1) 2 0 2
if (items < 0 || items > 1) 0 2 2
513 0 croak_xs_usage(cv, "not_null= false");
514 {
515 IO * RETVAL;
516 bool not_null;
517  
518 2 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 1 1 2
519 1 not_null = false;
520 else {
521 1 not_null = (bool)SvTRUE(ST(0))
522 ;
523 }
524 #line 21 "t/typemap/svrefs.xsi"
525 if (not_null) {
526 GV* gv = gv_fetchpv("STDOUT", 0, SVt_PVIO);
527 RETVAL = GvIO(gv);
528 }
529 else RETVAL = NULL;
530 #line 531 "t/typemap/typemap_xsgen.cc"
531 {
532 SV * RETVALSV;
533 2 ▶ RETVALSV = RETVAL ? newRV_noinc((SV*)RETVAL) : &PL_sv_undef;
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = RETVAL ? newRV_noinc((SV*)RETVAL) : &PL_sv_undef; 1 1 2
534 2 RETVALSV = sv_2mortal(RETVALSV);
535 2 ST(0) = RETVALSV;
536 }
537 }
538 2 XSRETURN(1);
539 2 }); }
540  
541  
542  
543 22 ▶XS_EUPXS(XS_MyTest_io_in) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest_io_in) { xs::throw_guard(cv, [=]() 2 0 2
544 {
545 11 dVAR; dXSARGS;
546 11 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 11 11
547 0 croak_xs_usage(cv, "val");
548 {
549 uint64_t RETVAL;
550 11 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 11 0 11
551 IO* val;
552  
553 11 ▶ if (SvROK(ST(0)) && SvTYPE(SvRV(ST(0))) == SVt_PVIO) val = (IO*)SvRV(ST(0));
Branch: 2 branches
BranchTrueFalseTotal
if (SvROK(ST(0)) && SvTYPE(SvRV(ST(0))) == SVt_PVIO) val = (IO*)SvRV(ST(0)); 5 6 11
if (SvROK(ST(0)) && SvTYPE(SvRV(ST(0))) == SVt_PVIO) val = (IO*)SvRV(ST(0)); 1 4 5
554 10 ▶ else if (SvROK(ST(0)) && SvTYPE(SvRV(ST(0))) == SVt_PVGV && (val = GvIO(SvRV(ST(0))))) {}
Branch: 8 branches
BranchTrueFalseTotal
else if (SvROK(ST(0)) && SvTYPE(SvRV(ST(0))) == SVt_PVGV && (val = GvIO(SvRV(ST(0))))) {} 4 6 10
else if (SvROK(ST(0)) && SvTYPE(SvRV(ST(0))) == SVt_PVGV && (val = GvIO(SvRV(ST(0))))) {} 0 4 4
else if (SvROK(ST(0)) && SvTYPE(SvRV(ST(0))) == SVt_PVGV && (val = GvIO(SvRV(ST(0))))) {} 0 0 0
else if (SvROK(ST(0)) && SvTYPE(SvRV(ST(0))) == SVt_PVGV && (val = GvIO(SvRV(ST(0))))) {} 0 0 0
else if (SvROK(ST(0)) && SvTYPE(SvRV(ST(0))) == SVt_PVGV && (val = GvIO(SvRV(ST(0))))) {} 0 0 0
else if (SvROK(ST(0)) && SvTYPE(SvRV(ST(0))) == SVt_PVGV && (val = GvIO(SvRV(ST(0))))) {} 0 0 0
else if (SvROK(ST(0)) && SvTYPE(SvRV(ST(0))) == SVt_PVGV && (val = GvIO(SvRV(ST(0))))) {} 0 0 0
else if (SvROK(ST(0)) && SvTYPE(SvRV(ST(0))) == SVt_PVGV && (val = GvIO(SvRV(ST(0))))) {} 10 0 10
555 10 ▶ else if (SvOK(ST(0))) throw "MyTest::io_in() -- val is not an IO reference";
Branch: 1 branch
BranchTrueFalseTotal
else if (SvOK(ST(0))) throw "MyTest::io_in() -- val is not an IO reference"; 9 1 10
556 1 else val = NULL
557 ;
558 #line 29 "t/typemap/svrefs.xsi"
559 RETVAL = (uint64_t)val;
560 #line 561 "t/typemap/typemap_xsgen.cc"
561 2 ▶ TARGu((UV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 0 2 2
562 2 ST(0) = TARG;
563 }
564 2 XSRETURN(1);
565 2 }); }
566  
567  
568  
569 4 ▶XS_EUPXS(XS_MyTest_cv_out) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest_cv_out) { xs::throw_guard(cv, [=]() 2 0 2
570 {
571 2 dVAR; dXSARGS;
572 2 ▶ if (items < 0 || items > 1)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 0 || items > 1) 2 0 2
if (items < 0 || items > 1) 0 2 2
573 0 croak_xs_usage(cv, "not_null= false");
574 {
575 CV * RETVAL;
576 bool not_null;
577  
578 2 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 1 1 2
579 1 not_null = false;
580 else {
581 1 not_null = (bool)SvTRUE(ST(0))
582 ;
583 }
584 #line 33 "t/typemap/svrefs.xsi"
585 RETVAL = not_null ? cv : NULL;
586 #line 587 "t/typemap/typemap_xsgen.cc"
587 {
588 SV * RETVALSV;
589 2 ▶ RETVALSV = RETVAL ? newRV_noinc((SV*)RETVAL) : &PL_sv_undef;
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = RETVAL ? newRV_noinc((SV*)RETVAL) : &PL_sv_undef; 1 1 2
590 2 RETVALSV = sv_2mortal(RETVALSV);
591 2 ST(0) = RETVALSV;
592 }
593 }
594 2 XSRETURN(1);
595 2 }); }
596  
597  
598  
599 22 ▶XS_EUPXS(XS_MyTest_cv_in) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest_cv_in) { xs::throw_guard(cv, [=]() 2 0 2
600 {
601 11 dVAR; dXSARGS;
602 11 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 11 11
603 0 croak_xs_usage(cv, "val");
604 {
605 uint64_t RETVAL;
606 11 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 11 0 11
607 CV* val;
608  
609 11 ▶ if (SvROK(ST(0)) && SvTYPE(SvRV(ST(0))) == SVt_PVCV) val = (CV*)SvRV(ST(0));
Branch: 2 branches
BranchTrueFalseTotal
if (SvROK(ST(0)) && SvTYPE(SvRV(ST(0))) == SVt_PVCV) val = (CV*)SvRV(ST(0)); 5 6 11
if (SvROK(ST(0)) && SvTYPE(SvRV(ST(0))) == SVt_PVCV) val = (CV*)SvRV(ST(0)); 1 4 5
610 10 ▶ else if (SvOK(ST(0))) throw "MyTest::cv_in() -- val is not a CODE reference";
Branch: 1 branch
BranchTrueFalseTotal
else if (SvOK(ST(0))) throw "MyTest::cv_in() -- val is not a CODE reference"; 9 1 10
611 1 else val = NULL
612 ;
613 #line 37 "t/typemap/svrefs.xsi"
614 RETVAL = (uint64_t)val;
615 #line 616 "t/typemap/typemap_xsgen.cc"
616 2 ▶ TARGu((UV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 2 0 2
617 2 ST(0) = TARG;
618 }
619 2 XSRETURN(1);
620 2 }); }
621  
622  
623  
624 4 ▶XS_EUPXS(XS_MyTest_gv_out) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest_gv_out) { xs::throw_guard(cv, [=]() 2 0 2
625 {
626 2 dVAR; dXSARGS;
627 2 ▶ if (items < 0 || items > 1)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 0 || items > 1) 2 0 2
if (items < 0 || items > 1) 0 2 2
628 0 croak_xs_usage(cv, "not_null= false");
629 {
630 GV * RETVAL;
631 bool not_null;
632  
633 2 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 1 1 2
634 1 not_null = false;
635 else {
636 1 not_null = (bool)SvTRUE(ST(0))
637 ;
638 }
639 #line 41 "t/typemap/svrefs.xsi"
640 RETVAL = not_null ? CvGV(cv) : NULL;
641 #line 642 "t/typemap/typemap_xsgen.cc"
642 {
643 SV * RETVALSV;
644 2 ▶ RETVALSV = RETVAL ? (SV*)RETVAL : &PL_sv_undef;
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = RETVAL ? (SV*)RETVAL : &PL_sv_undef; 1 1 2
645 2 RETVALSV = sv_2mortal(RETVALSV);
646 2 ST(0) = RETVALSV;
647 }
648 }
649 2 XSRETURN(1);
650 2 }); }
651  
652  
653  
654 22 ▶XS_EUPXS(XS_MyTest_gv_in) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest_gv_in) { xs::throw_guard(cv, [=]() 2 0 2
655 {
656 11 dVAR; dXSARGS;
657 11 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 11 11
658 0 croak_xs_usage(cv, "val");
659 {
660 uint64_t RETVAL;
661 11 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 11 0 11
662 GV* val;
663  
664 11 ▶ if (SvTYPE(ST(0)) == SVt_PVGV) val = (GV*)ST(0);
Branch: 1 branch
BranchTrueFalseTotal
if (SvTYPE(ST(0)) == SVt_PVGV) val = (GV*)ST(0); 1 10 11
665 10 ▶ else if (SvOK(ST(0))) throw "MyTest::gv_in() -- val is not a GLOB";
Branch: 1 branch
BranchTrueFalseTotal
else if (SvOK(ST(0))) throw "MyTest::gv_in() -- val is not a GLOB"; 9 1 10
666 1 else val = NULL
667 ;
668 #line 45 "t/typemap/svrefs.xsi"
669 RETVAL = (uint64_t)val;
670 #line 671 "t/typemap/typemap_xsgen.cc"
671 2 ▶ TARGu((UV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 2 0 2
672 2 ST(0) = TARG;
673 }
674 2 XSRETURN(1);
675 2 }); }
676  
677  
678 /* INCLUDE: Returning to 'typemap.xs' from 'svrefs.xsi' */
679  
680  
681 /* INCLUDE: Including 'const.xsi' from 'typemap.xs' */
682  
683 template <int i>
684 struct _MyConst {
685 int val;
686 5 _MyConst (int arg) : val(arg) {}
687 6 int get_val () const { return val; }
688 0 virtual _MyConst* clone () const { return new _MyConst(val); }
689 10 virtual ~_MyConst () { dcnt.c++; }
690 };
691 using MyConst = _MyConst<0>;
692 using MyConst2 = _MyConst<1>;
693 namespace xs {
694 template <class TYPE> struct Typemap<MyConst*, TYPE> : TypemapObject<MyConst*, TYPE, ObjectTypePtr, ObjectStorageMG> {
695 12 ▶ static std::string package () { return "MyTest::MyConst"; }
Branch: 2 branches
BranchTrueFalseTotal
static std::string package () { return "MyTest::MyConst"; } 2 0 2
static std::string package () { return "MyTest::MyConst"; } 2 0 2
696 };
697  
698 template <class TYPE> struct Typemap<MyConst2*, TYPE> : TypemapObject<MyConst2*, TYPE, ObjectTypePtr, ObjectStorageMG> {
699 6 ▶ static std::string package () { return "MyTest::MyConst2"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::MyConst2"; } 2 0 2
700 1 static Sv out (TYPE var, const Sv& proto = {}) {
701 1 var->val = 555;
702 1 return TypemapObject<MyConst2*, TYPE, ObjectTypePtr, ObjectStorageMG>::out(var, proto);
703 }
704 };
705 template <class TYPE> struct Typemap<const MyConst2*, TYPE> : TypemapObject<const MyConst2*, TYPE, ObjectTypePtr, ObjectStorageMG> {
706 6 ▶ static std::string package () { return "MyTest::MyConst2"; }
Branch: 1 branch
BranchTrueFalseTotal
static std::string package () { return "MyTest::MyConst2"; } 2 0 2
707 };
708 }
709  
710  
711 2 ▶XS_EUPXS(XS_MyTest__MyConst_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__MyConst_new) { xs::throw_guard(cv, [=]() 1 0 1
712 {
713 1 dVAR; dXSARGS;
714 1 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 1 1
715 0 croak_xs_usage(cv, "_____unused1, arg");
716 {
717 MyConst * RETVAL;
718 1 ▶ int arg = (int)SvIV(ST(1))
Branch: 1 branch
BranchTrueFalseTotal
int arg = (int)SvIV(ST(1)) 1 0 1
719 ;
720 #line 36 "t/typemap/const.xsi"
721 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
722 RETVAL = new MyConst(arg);
723 #line 724 "t/typemap/typemap_xsgen.cc"
724 {
725 SV * RETVALSV;
726 1 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 1 0 1
727 1 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 1 0 1
728 1 ST(0) = RETVALSV;
729 }
730 1 }
731 1 XSRETURN(1);
732 1 }); }
733  
734  
735  
736 4 ▶XS_EUPXS(XS_MyTest__MyConst_new_const) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__MyConst_new_const) { xs::throw_guard(cv, [=]() 2 0 2
737 {
738 2 dVAR; dXSARGS;
739 2 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 2 2
740 0 croak_xs_usage(cv, "_____unused2, arg");
741 {
742 const MyConst * RETVAL;
743 2 ▶ int arg = (int)SvIV(ST(1))
Branch: 1 branch
BranchTrueFalseTotal
int arg = (int)SvIV(ST(1)) 2 0 2
744 ;
745 #line 39 "t/typemap/const.xsi"
746 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
747 RETVAL = new MyConst(arg);
748 #line 749 "t/typemap/typemap_xsgen.cc"
749 {
750 SV * RETVALSV;
751 2 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 2 0 2
752 2 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 2 0 2
753 2 ST(0) = RETVALSV;
754 }
755 2 }
756 2 XSRETURN(1);
757 2 }); }
758  
759  
760  
761 12 ▶XS_EUPXS(XS_MyTest__MyConst_get_val) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__MyConst_get_val) { xs::throw_guard(cv, [=]() 6 0 6
762 {
763 6 dVAR; dXSARGS;
764 6 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 6 6
765 0 croak_xs_usage(cv, "THIS");
766 {
767 int RETVAL;
768 6 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 6 0 6
769 6 ▶ const MyConst* THIS = xs::in<const MyConst *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
const MyConst* THIS = xs::in<const MyConst *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 6 6
770 ;
771 #line 42 "t/typemap/const.xsi"
772 RETVAL = THIS->get_val();
773 #line 774 "t/typemap/typemap_xsgen.cc"
774 6 ▶ TARGi((IV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGi((IV)RETVAL, 1); 0 6 6
775 6 ST(0) = TARG;
776 }
777 6 XSRETURN(1);
778 6 }); }
779  
780  
781  
782 6 ▶XS_EUPXS(XS_MyTest__MyConst_set_val) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__MyConst_set_val) { xs::throw_guard(cv, [=]() 2 0 2
783 {
784 3 dVAR; dXSARGS;
785 3 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 3 3
786 0 croak_xs_usage(cv, "THIS, newval");
787 PERL_UNUSED_VAR(ax); /* -Wall */
788 3 SP -= items;
789 {
790 3 ▶ MyConst* THIS = xs::in<MyConst *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
MyConst* THIS = xs::in<MyConst *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 2 2
791 ;
792 2 SV* newval = ST(1)
793 ;
794 #line 44 "t/typemap/const.xsi"
795 THIS->val = SvIV(newval);
796 #line 797 "t/typemap/typemap_xsgen.cc"
797 2 PUTBACK;
798 2 return;
799 }
800 2 }); }
801  
802  
803  
804 2 ▶XS_EUPXS(XS_MyTest__MyConst_set_from) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__MyConst_set_from) { xs::throw_guard(cv, [=]() 1 0 1
805 {
806 1 dVAR; dXSARGS;
807 1 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 1 1
808 0 croak_xs_usage(cv, "THIS, other");
809 PERL_UNUSED_VAR(ax); /* -Wall */
810 1 SP -= items;
811 {
812 1 ▶ MyConst* THIS = xs::in<MyConst *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
MyConst* THIS = xs::in<MyConst *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 1 1
813 ;
814 1 ▶ const MyConst* other = xs::in<const MyConst *>(ST(1));
Branch: 1 branch
BranchTrueFalseTotal
const MyConst* other = xs::in<const MyConst *>(ST(1)); 1 0 1
815 ;
816 #line 46 "t/typemap/const.xsi"
817 if (other) THIS->val = other->val;
818 #line 819 "t/typemap/typemap_xsgen.cc"
819 1 PUTBACK;
820 1 return;
821 }
822 1 }); }
823  
824  
825  
826 6 ▶XS_EUPXS(XS_MyTest__MyConst_DESTROY) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__MyConst_DESTROY) { xs::throw_guard(cv, [=]() 3 0 3
827 {
828 3 dVAR; dXSARGS;
829 3 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 3 3
830 0 croak_xs_usage(cv, "THIS");
831 PERL_UNUSED_VAR(ax); /* -Wall */
832 3 SP -= items;
833 {
834 3 ▶ const MyConst* THIS = xs::in<const MyConst *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
const MyConst* THIS = xs::in<const MyConst *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 3 0 3
const MyConst* THIS = xs::in<const MyConst *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 3 3
835 ;
836 #line 49 "t/typemap/const.xsi"
837 dcnt.perl++;
838 xs::Typemap<const MyConst*>().destroy(THIS, SvRV(ST(0)));
839 #line 840 "t/typemap/typemap_xsgen.cc"
840 3 PUTBACK;
841 6 return;
842 }
843 3 }); }
844  
845  
846  
847 2 ▶XS_EUPXS(XS_MyTest__MyConst2_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__MyConst2_new) { xs::throw_guard(cv, [=]() 1 0 1
848 {
849 1 dVAR; dXSARGS;
850 1 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 1 1
851 0 croak_xs_usage(cv, "_____unused3, arg");
852 {
853 MyConst2 * RETVAL;
854 1 ▶ int arg = (int)SvIV(ST(1))
Branch: 1 branch
BranchTrueFalseTotal
int arg = (int)SvIV(ST(1)) 1 0 1
855 ;
856 #line 56 "t/typemap/const.xsi"
857 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
858 RETVAL = new MyConst2(arg);
859 #line 860 "t/typemap/typemap_xsgen.cc"
860 {
861 SV * RETVALSV;
862 1 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 1 0 1
863 1 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 1 0 1
864 1 ST(0) = RETVALSV;
865 }
866 1 }
867 1 XSRETURN(1);
868 1 }); }
869  
870  
871  
872 2 ▶XS_EUPXS(XS_MyTest__MyConst2_new_const) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__MyConst2_new_const) { xs::throw_guard(cv, [=]() 1 0 1
873 {
874 1 dVAR; dXSARGS;
875 1 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 1 1
876 0 croak_xs_usage(cv, "_____unused4, arg");
877 {
878 const MyConst2 * RETVAL;
879 1 ▶ int arg = (int)SvIV(ST(1))
Branch: 1 branch
BranchTrueFalseTotal
int arg = (int)SvIV(ST(1)) 1 0 1
880 ;
881 #line 59 "t/typemap/const.xsi"
882 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
883 RETVAL = new MyConst2(arg);
884 #line 885 "t/typemap/typemap_xsgen.cc"
885 {
886 SV * RETVALSV;
887 1 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 1 0 1
888 1 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 1 0 1
889 1 ST(0) = RETVALSV;
890 }
891 1 }
892 1 XSRETURN(1);
893 1 }); }
894  
895  
896  
897 4 ▶XS_EUPXS(XS_MyTest__MyConst2_get_val) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__MyConst2_get_val) { xs::throw_guard(cv, [=]() 2 0 2
898 {
899 2 dVAR; dXSARGS;
900 2 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 2 2
901 0 croak_xs_usage(cv, "THIS");
902 {
903 int RETVAL;
904 2 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 2 0 2
905 2 ▶ const MyConst2* THIS = xs::in<const MyConst2 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
const MyConst2* THIS = xs::in<const MyConst2 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 2 2
906 ;
907 #line 63 "t/typemap/const.xsi"
908 RETVAL = THIS->val;
909 #line 910 "t/typemap/typemap_xsgen.cc"
910 2 ▶ TARGi((IV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGi((IV)RETVAL, 1); 0 2 2
911 2 ST(0) = TARG;
912 }
913 2 XSRETURN(1);
914 2 }); }
915  
916  
917  
918 0 ▶XS_EUPXS(XS_MyTest__MyConst2_set_val) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__MyConst2_set_val) { xs::throw_guard(cv, [=]() 0 0 0
919 {
920 0 dVAR; dXSARGS;
921 0 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 0 0
922 0 croak_xs_usage(cv, "THIS, newval");
923 PERL_UNUSED_VAR(ax); /* -Wall */
924 0 SP -= items;
925 {
926 0 ▶ MyConst2* THIS = xs::in<MyConst2 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
MyConst2* THIS = xs::in<MyConst2 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
927 ;
928 0 SV* newval = ST(1)
929 ;
930 #line 67 "t/typemap/const.xsi"
931 THIS->val = SvIV(newval);
932 #line 933 "t/typemap/typemap_xsgen.cc"
933 0 PUTBACK;
934 0 return;
935 }
936 0 }); }
937  
938  
939  
940 0 ▶XS_EUPXS(XS_MyTest__MyConst2_set_from) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__MyConst2_set_from) { xs::throw_guard(cv, [=]() 0 0 0
941 {
942 0 dVAR; dXSARGS;
943 0 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 0 0
944 0 croak_xs_usage(cv, "THIS, other");
945 PERL_UNUSED_VAR(ax); /* -Wall */
946 0 SP -= items;
947 {
948 0 ▶ MyConst2* THIS = xs::in<MyConst2 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
MyConst2* THIS = xs::in<MyConst2 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
949 ;
950 0 ▶ const MyConst2* other = xs::in<const MyConst2 *>(ST(1));
Branch: 1 branch
BranchTrueFalseTotal
const MyConst2* other = xs::in<const MyConst2 *>(ST(1)); 0 0 0
951 ;
952 #line 71 "t/typemap/const.xsi"
953 if (other) THIS->val = other->val;
954 #line 955 "t/typemap/typemap_xsgen.cc"
955 0 PUTBACK;
956 0 return;
957 }
958 0 }); }
959  
960  
961  
962 4 ▶XS_EUPXS(XS_MyTest__MyConst2_DESTROY) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__MyConst2_DESTROY) { xs::throw_guard(cv, [=]() 2 0 2
963 {
964 2 dVAR; dXSARGS;
965 2 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 2 2
966 0 croak_xs_usage(cv, "THIS");
967 PERL_UNUSED_VAR(ax); /* -Wall */
968 2 SP -= items;
969 {
970 2 ▶ const MyConst2* THIS = xs::in<const MyConst2 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
const MyConst2* THIS = xs::in<const MyConst2 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 2 0 2
const MyConst2* THIS = xs::in<const MyConst2 *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 2 2
971 ;
972 #line 75 "t/typemap/const.xsi"
973 dcnt.perl++;
974 xs::Typemap<const MyConst2*>().destroy(THIS, SvRV(ST(0)));
975 #line 976 "t/typemap/typemap_xsgen.cc"
976 2 PUTBACK;
977 4 return;
978 }
979 2 }); }
980  
981  
982 /* INCLUDE: Returning to 'typemap.xs' from 'const.xsi' */
983  
984  
985 /* INCLUDE: Including 'container.xsi' from 'typemap.xs' */
986  
987 #include <vector>
988 #include <map>
989 using MapStringInt = std::map<std::string, int>;
990 using MapIntBool = std::map<int, bool>;
991  
992  
993 2 ▶XS_EUPXS(XS_MyTest__Container_std_vector_int) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Container_std_vector_int) { xs::throw_guard(cv, [=]() 1 0 1
994 {
995 1 dVAR; dXSARGS;
996 1 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 1 1
997 0 croak_xs_usage(cv, "val");
998 {
999 1 std::vector<int> RETVAL;
1000 1 ▶ std::vector<int> val = xs::in<std::vector<int>>(ST(0));
Branch: 1 branch
BranchTrueFalseTotal
std::vector<int> val = xs::in<std::vector<int>>(ST(0)); 1 0 1
1001 ;
1002 #line 12 "t/typemap/container.xsi"
1003 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
1004 RETVAL = val;
1005 #line 1006 "t/typemap/typemap_xsgen.cc"
1006 {
1007 SV * RETVALSV;
1008 1 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 1 0 1
1009 1 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 1 0 1
1010 1 ST(0) = RETVALSV;
1011 }
1012 1 }
1013 1 XSRETURN(1);
1014 1 }); }
1015  
1016  
1017  
1018 2 ▶XS_EUPXS(XS_MyTest__Container_std_map_string_int) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Container_std_map_string_int) { xs::throw_guard(cv, [=]() 1 0 1
1019 {
1020 1 dVAR; dXSARGS;
1021 1 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 1 1
1022 0 croak_xs_usage(cv, "val");
1023 {
1024 1 MapStringInt RETVAL;
1025 1 ▶ MapStringInt val = xs::in<MapStringInt>(ST(0));
Branch: 1 branch
BranchTrueFalseTotal
MapStringInt val = xs::in<MapStringInt>(ST(0)); 1 0 1
1026 ;
1027 #line 16 "t/typemap/container.xsi"
1028 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
1029 RETVAL = val;
1030 #line 1031 "t/typemap/typemap_xsgen.cc"
1031 {
1032 SV * RETVALSV;
1033 1 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 1 0 1
1034 1 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 1 0 1
1035 1 ST(0) = RETVALSV;
1036 }
1037 1 }
1038 1 XSRETURN(1);
1039 1 }); }
1040  
1041  
1042  
1043 2 ▶XS_EUPXS(XS_MyTest__Container_std_map_int_bool) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Container_std_map_int_bool) { xs::throw_guard(cv, [=]() 1 0 1
1044 {
1045 1 dVAR; dXSARGS;
1046 1 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 1 1
1047 0 croak_xs_usage(cv, "val");
1048 {
1049 1 MapIntBool RETVAL;
1050 1 ▶ MapIntBool val = xs::in<MapIntBool>(ST(0));
Branch: 1 branch
BranchTrueFalseTotal
MapIntBool val = xs::in<MapIntBool>(ST(0)); 1 0 1
1051 ;
1052 #line 20 "t/typemap/container.xsi"
1053 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
1054 RETVAL = val;
1055 #line 1056 "t/typemap/typemap_xsgen.cc"
1056 {
1057 SV * RETVALSV;
1058 1 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 1 0 1
1059 1 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 1 0 1
1060 1 ST(0) = RETVALSV;
1061 }
1062 1 }
1063 1 XSRETURN(1);
1064 1 }); }
1065  
1066  
1067 /* INCLUDE: Returning to 'typemap.xs' from 'container.xsi' */
1068  
1069  
1070 /* INCLUDE: Including 'not_null.xsi' from 'typemap.xs' */
1071  
1072 struct TestNN : panda::Refcnt {
1073 int val;
1074 3 TestNN (int val) : val(val) {}
1075 };
1076 using TestNNi = panda::iptr<TestNN>;
1077 namespace xs {
1078 template <> struct Typemap<TestNN*> : TypemapObject<TestNN*, TestNN*, ObjectTypeRefcntPtr, ObjectStorageIV> {};
1079 }
1080  
1081  
1082 6 ▶XS_EUPXS(XS_MyTest__NotNull_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__NotNull_new) { xs::throw_guard(cv, [=]() 3 0 3
1083 {
1084 3 dVAR; dXSARGS;
1085 3 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 3 3
1086 0 croak_xs_usage(cv, "CLASS, arg");
1087 {
1088 TestNN * RETVAL;
1089 3 SV* CLASS = ST(0)
1090 ;
1091 3 ▶ int arg = (int)SvIV(ST(1))
Branch: 1 branch
BranchTrueFalseTotal
int arg = (int)SvIV(ST(1)) 3 0 3
1092 ;
1093 #line 17 "t/typemap/not_null.xsi"
1094 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
1095 PROTO = CLASS;
1096 RETVAL = new TestNN(arg);
1097 #line 1098 "t/typemap/typemap_xsgen.cc"
1098 {
1099 SV * RETVALSV;
1100 3 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 3 0 3
1101 3 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 3 0 3
1102 3 ST(0) = RETVALSV;
1103 }
1104 3 }
1105 3 XSRETURN(1);
1106 3 }); }
1107  
1108  
1109  
1110 4 ▶XS_EUPXS(XS_MyTest__NotNull_val) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__NotNull_val) { xs::throw_guard(cv, [=]() 2 0 2
1111 {
1112 2 dVAR; dXSARGS;
1113 2 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 2 2
1114 0 croak_xs_usage(cv, "THIS");
1115 {
1116 int RETVAL;
1117 2 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 2 0 2
1118 2 ▶ TestNN* THIS = xs::in<TestNN *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
TestNN* THIS = xs::in<TestNN *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 2 2
1119 ;
1120 #line 21 "t/typemap/not_null.xsi"
1121 RETVAL = THIS->val;
1122 #line 1123 "t/typemap/typemap_xsgen.cc"
1123 2 ▶ TARGi((IV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGi((IV)RETVAL, 1); 0 2 2
1124 2 ST(0) = TARG;
1125 }
1126 2 XSRETURN(1);
1127 2 }); }
1128  
1129  
1130  
1131 4 ▶XS_EUPXS(XS_MyTest__NotNull_set_from) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__NotNull_set_from) { xs::throw_guard(cv, [=]() 1 0 1
1132 {
1133 2 dVAR; dXSARGS;
1134 2 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 2 2
1135 0 croak_xs_usage(cv, "THIS, other");
1136 PERL_UNUSED_VAR(ax); /* -Wall */
1137 2 SP -= items;
1138 {
1139 2 ▶ TestNN* THIS = xs::in<TestNN *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
TestNN* THIS = xs::in<TestNN *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 2 0 2
TestNN* THIS = xs::in<TestNN *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 2 2
1140 ;
1141 2 ▶ xs::nn<TestNN*> other = xs::in<xs::nn<TestNN * >>(ST(1));
Branch: 1 branch
BranchTrueFalseTotal
xs::nn<TestNN*> other = xs::in<xs::nn<TestNN * >>(ST(1)); 1 1 2
1142 ;
1143 #line 25 "t/typemap/not_null.xsi"
1144 THIS->val = (&*other)->val;
1145 #line 1146 "t/typemap/typemap_xsgen.cc"
1146 1 PUTBACK;
1147 2 return;
1148 }
1149 1 }); }
1150  
1151  
1152  
1153 4 ▶XS_EUPXS(XS_MyTest__NotNull_set_from2) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__NotNull_set_from2) { xs::throw_guard(cv, [=]() 1 0 1
1154 {
1155 2 dVAR; dXSARGS;
1156 2 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 2 2
1157 0 croak_xs_usage(cv, "THIS, other");
1158 PERL_UNUSED_VAR(ax); /* -Wall */
1159 2 SP -= items;
1160 {
1161 2 ▶ TestNN* THIS = xs::in<TestNN *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
TestNN* THIS = xs::in<TestNN *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 2 0 2
TestNN* THIS = xs::in<TestNN *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 2 2
1162 ;
1163 2 ▶ xs::nn<TestNNi> other = xs::in<xs::nn<TestNNi>>(ST(1));
Branch: 2 branches
BranchTrueFalseTotal
xs::nn<TestNNi> other = xs::in<xs::nn<TestNNi>>(ST(1)); 1 1 2
xs::nn<TestNNi> other = xs::in<xs::nn<TestNNi>>(ST(1)); 1 0 1
1164 ;
1165 #line 29 "t/typemap/not_null.xsi"
1166 THIS->val = other->val;
1167 #line 1168 "t/typemap/typemap_xsgen.cc"
1168 1 PUTBACK;
1169 2 return;
1170 1 }
1171 1 }); }
1172  
1173  
1174  
1175 6 ▶XS_EUPXS(XS_MyTest__NotNull_DESTROY) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__NotNull_DESTROY) { xs::throw_guard(cv, [=]() 3 0 3
1176 {
1177 3 dVAR; dXSARGS;
1178 3 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 3 3
1179 0 croak_xs_usage(cv, "THIS");
1180 PERL_UNUSED_VAR(ax); /* -Wall */
1181 3 SP -= items;
1182 {
1183 3 ▶ TestNN* THIS = xs::in<TestNN *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
TestNN* THIS = xs::in<TestNN *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 3 0 3
TestNN* THIS = xs::in<TestNN *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 3 3
1184 ;
1185 #line 32 "t/typemap/not_null.xsi"
1186 xs::Typemap<TestNN*>().destroy(THIS, SvRV(ST(0)));
1187 #line 1188 "t/typemap/typemap_xsgen.cc"
1188 3 PUTBACK;
1189 6 return;
1190 }
1191 3 }); }
1192  
1193  
1194 /* INCLUDE: Returning to 'typemap.xs' from 'not_null.xsi' */
1195  
1196  
1197 /* INCLUDE: Including 'svapi.xsi' from 'typemap.xs' */
1198  
1199  
1200  
1201 34 ▶XS_EUPXS(XS_MyTest__SvAPI_sv_out) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__SvAPI_sv_out) { xs::throw_guard(cv, [=]() 17 0 17
1202 {
1203 17 dVAR; dXSARGS;
1204 17 ▶ if (items < 0 || items > 2)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 0 || items > 2) 17 0 17
if (items < 0 || items > 2) 0 17 17
1205 0 croak_xs_usage(cv, "retv= NULL, deref= false");
1206 {
1207 17 Sv RETVAL;
1208 SV* retv;
1209 bool deref;
1210  
1211 17 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 1 16 17
1212 1 retv = NULL;
1213 else {
1214 16 retv = ST(0)
1215 ;
1216 }
1217  
1218 17 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 15 2 17
1219 15 deref = false;
1220 else {
1221 2 ▶ deref = (bool)SvTRUE(ST(1))
Branch: 1 branch
BranchTrueFalseTotal
deref = (bool)SvTRUE(ST(1)) 2 0 2
1222 ;
1223 }
1224 #line 5 "t/typemap/svapi.xsi"
1225 if (deref) retv = SvRV(retv);
1226 RETVAL = retv;
1227 #line 1228 "t/typemap/typemap_xsgen.cc"
1228 {
1229 SV * RETVALSV;
1230 17 RETVALSV = NULL;
1231 17 ▶ if (!RETVAL) XSRETURN_UNDEF;
Branch: 1 branch
BranchTrueFalseTotal
if (!RETVAL) XSRETURN_UNDEF; 1 16 17
1232 16 ▶ if (RETVAL.is_scalar()) RETVALSV = RETVAL.detach();
Branch: 2 branches
BranchTrueFalseTotal
if (RETVAL.is_scalar()) RETVALSV = RETVAL.detach(); 16 0 16
if (RETVAL.is_scalar()) RETVALSV = RETVAL.detach(); 14 2 16
1233 2 else switch (RETVAL.type()) {
1234 1 ▶ case SVt_PVAV: XSRETURN(xs::Array(RETVAL.get<AV>()).push_on_stack(MARK));
Branch: 2 branches
BranchTrueFalseTotal
case SVt_PVAV: XSRETURN(xs::Array(RETVAL.get<AV>()).push_on_stack(MARK)); 1 0 1
case SVt_PVAV: XSRETURN(xs::Array(RETVAL.get<AV>()).push_on_stack(MARK)); 1 0 1
1235 1 ▶ case SVt_PVHV: XSRETURN(xs::Hash(RETVAL.get<HV>()).push_on_stack(MARK));
Branch: 2 branches
BranchTrueFalseTotal
case SVt_PVHV: XSRETURN(xs::Hash(RETVAL.get<HV>()).push_on_stack(MARK)); 1 0 1
case SVt_PVHV: XSRETURN(xs::Hash(RETVAL.get<HV>()).push_on_stack(MARK)); 1 0 1
1236 0 case SVt_PVCV:
1237 case SVt_PVIO:
1238 0 ▶ RETVALSV = newRV_noinc(RETVAL.detach());
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = newRV_noinc(RETVAL.detach()); 0 0 0
1239 0 break;
1240 0 default: throw "unknown type of Sv to return";
1241 }
1242 14 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 14 0 14
1243 14 ST(0) = RETVALSV;
1244 }
1245 17 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 14 3 17
1246 14 XSRETURN(1);
1247 17 }); }
1248  
1249  
1250  
1251 30 ▶XS_EUPXS(XS_MyTest__SvAPI_scalar_in) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__SvAPI_scalar_in) { xs::throw_guard(cv, [=]() 15 0 15
1252 {
1253 15 dVAR; dXSARGS;
1254 15 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 15 15
1255 0 croak_xs_usage(cv, "val");
1256 {
1257 uint64_t RETVAL;
1258 15 ▶ dXSTARG;
Branch: 2 branches
BranchTrueFalseTotal
dXSTARG; 15 0 15
dXSTARG; 0 0 0
1259 15 ▶ Scalar val = ST(0);
Branch: 1 branch
BranchTrueFalseTotal
Scalar val = ST(0); 15 0 15
1260 15 ▶ if (!val && SvOK(ST(0))) throw "arg is not a 'Scalar' value"
Branch: 3 branches
BranchTrueFalseTotal
if (!val && SvOK(ST(0))) throw "arg is not a 'Scalar' value" 0 15 15
if (!val && SvOK(ST(0))) throw "arg is not a 'Scalar' value" 0 0 0
if (!val && SvOK(ST(0))) throw "arg is not a 'Scalar' value" 0 15 15
1261 ;
1262 #line 10 "t/typemap/svapi.xsi"
1263 RETVAL = (uint64_t)val.get();
1264 #line 1265 "t/typemap/typemap_xsgen.cc"
1265 15 ▶ TARGu((UV)RETVAL, 1);
Branch: 2 branches
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 13 2 15
TARGu((UV)RETVAL, 1); 2 0 2
1266 15 ST(0) = TARG;
1267 15 }
1268 15 XSRETURN(1);
1269 15 }); }
1270  
1271  
1272  
1273 4 ▶XS_EUPXS(XS_MyTest__SvAPI_scalar_out) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__SvAPI_scalar_out) { xs::throw_guard(cv, [=]() 2 0 2
1274 {
1275 2 dVAR; dXSARGS;
1276 2 ▶ if (items < 0 || items > 1)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 0 || items > 1) 2 0 2
if (items < 0 || items > 1) 0 2 2
1277 0 croak_xs_usage(cv, "val= NULL");
1278 {
1279 2 Scalar RETVAL;
1280 SV* val;
1281  
1282 2 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 1 1 2
1283 1 val = NULL;
1284 else {
1285 1 val = ST(0)
1286 ;
1287 }
1288 #line 14 "t/typemap/svapi.xsi"
1289 RETVAL = val;
1290 #line 1291 "t/typemap/typemap_xsgen.cc"
1291 {
1292 SV * RETVALSV;
1293 2 RETVALSV = NULL;
1294 2 ▶ if (!RETVAL) XSRETURN_UNDEF;
Branch: 1 branch
BranchTrueFalseTotal
if (!RETVAL) XSRETURN_UNDEF; 1 1 2
1295 1 RETVALSV = RETVAL.detach();
1296 1 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 1 0 1
1297 1 ST(0) = RETVALSV;
1298 }
1299 2 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 1 1 2
1300 1 XSRETURN(1);
1301 2 }); }
1302  
1303  
1304  
1305 30 ▶XS_EUPXS(XS_MyTest__SvAPI_simple_in) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__SvAPI_simple_in) { xs::throw_guard(cv, [=]() 5 0 5
1306 {
1307 15 dVAR; dXSARGS;
1308 15 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 15 15
1309 0 croak_xs_usage(cv, "val");
1310 {
1311 uint64_t RETVAL;
1312 15 ▶ dXSTARG;
Branch: 2 branches
BranchTrueFalseTotal
dXSTARG; 15 0 15
dXSTARG; 0 0 0
1313 15 ▶ Simple val = ST(0);
Branch: 1 branch
BranchTrueFalseTotal
Simple val = ST(0); 5 10 15
1314 5 ▶ if (!val && SvOK(ST(0))) throw "arg is not a 'Simple' value"
Branch: 3 branches
BranchTrueFalseTotal
if (!val && SvOK(ST(0))) throw "arg is not a 'Simple' value" 0 5 5
if (!val && SvOK(ST(0))) throw "arg is not a 'Simple' value" 0 0 0
if (!val && SvOK(ST(0))) throw "arg is not a 'Simple' value" 0 5 5
1315 ;
1316 #line 18 "t/typemap/svapi.xsi"
1317 RETVAL = (uint64_t)val.get();
1318 #line 1319 "t/typemap/typemap_xsgen.cc"
1319 5 ▶ TARGu((UV)RETVAL, 1);
Branch: 2 branches
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 3 2 5
TARGu((UV)RETVAL, 1); 2 0 2
1320 5 ST(0) = TARG;
1321 5 }
1322 5 XSRETURN(1);
1323 5 }); }
1324  
1325  
1326  
1327 4 ▶XS_EUPXS(XS_MyTest__SvAPI_simple_out) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__SvAPI_simple_out) { xs::throw_guard(cv, [=]() 2 0 2
1328 {
1329 2 dVAR; dXSARGS;
1330 2 ▶ if (items < 0 || items > 1)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 0 || items > 1) 2 0 2
if (items < 0 || items > 1) 0 2 2
1331 0 croak_xs_usage(cv, "val= NULL");
1332 {
1333 2 Simple RETVAL;
1334 SV* val;
1335  
1336 2 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 1 1 2
1337 1 val = NULL;
1338 else {
1339 1 val = ST(0)
1340 ;
1341 }
1342 #line 22 "t/typemap/svapi.xsi"
1343 RETVAL = val;
1344 #line 1345 "t/typemap/typemap_xsgen.cc"
1345 {
1346 SV * RETVALSV;
1347 2 RETVALSV = NULL;
1348 2 ▶ if (!RETVAL) XSRETURN_UNDEF;
Branch: 1 branch
BranchTrueFalseTotal
if (!RETVAL) XSRETURN_UNDEF; 1 1 2
1349 1 RETVALSV = RETVAL.detach();
1350 1 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 1 0 1
1351 1 ST(0) = RETVALSV;
1352 }
1353 2 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 1 1 2
1354 1 XSRETURN(1);
1355 2 }); }
1356  
1357  
1358  
1359 30 ▶XS_EUPXS(XS_MyTest__SvAPI_ref_in) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__SvAPI_ref_in) { xs::throw_guard(cv, [=]() 10 0 10
1360 {
1361 15 dVAR; dXSARGS;
1362 15 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 15 15
1363 0 croak_xs_usage(cv, "val");
1364 {
1365 uint64_t RETVAL;
1366 15 ▶ dXSTARG;
Branch: 2 branches
BranchTrueFalseTotal
dXSTARG; 15 0 15
dXSTARG; 0 0 0
1367 15 ▶ Ref val = ST(0);
Branch: 1 branch
BranchTrueFalseTotal
Ref val = ST(0); 10 5 15
1368 10 ▶ if (!val && SvOK(ST(0))) throw "arg is not a 'Ref' value"
Branch: 3 branches
BranchTrueFalseTotal
if (!val && SvOK(ST(0))) throw "arg is not a 'Ref' value" 1 9 10
if (!val && SvOK(ST(0))) throw "arg is not a 'Ref' value" 0 1 1
if (!val && SvOK(ST(0))) throw "arg is not a 'Ref' value" 0 10 10
1369 ;
1370 #line 26 "t/typemap/svapi.xsi"
1371 RETVAL = (uint64_t)val.get();
1372 #line 1373 "t/typemap/typemap_xsgen.cc"
1373 10 ▶ TARGu((UV)RETVAL, 1);
Branch: 2 branches
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 8 2 10
TARGu((UV)RETVAL, 1); 2 0 2
1374 10 ST(0) = TARG;
1375 10 }
1376 10 XSRETURN(1);
1377 10 }); }
1378  
1379  
1380  
1381 4 ▶XS_EUPXS(XS_MyTest__SvAPI_ref_out) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__SvAPI_ref_out) { xs::throw_guard(cv, [=]() 2 0 2
1382 {
1383 2 dVAR; dXSARGS;
1384 2 ▶ if (items < 0 || items > 1)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 0 || items > 1) 2 0 2
if (items < 0 || items > 1) 0 2 2
1385 0 croak_xs_usage(cv, "val= NULL");
1386 {
1387 2 Ref RETVAL;
1388 SV* val;
1389  
1390 2 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 1 1 2
1391 1 val = NULL;
1392 else {
1393 1 val = ST(0)
1394 ;
1395 }
1396 #line 30 "t/typemap/svapi.xsi"
1397 RETVAL = val;
1398 #line 1399 "t/typemap/typemap_xsgen.cc"
1399 {
1400 SV * RETVALSV;
1401 2 RETVALSV = NULL;
1402 2 ▶ if (!RETVAL) XSRETURN_UNDEF;
Branch: 1 branch
BranchTrueFalseTotal
if (!RETVAL) XSRETURN_UNDEF; 1 1 2
1403 1 RETVALSV = RETVAL.detach();
1404 1 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 1 0 1
1405 1 ST(0) = RETVALSV;
1406 }
1407 2 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 1 1 2
1408 1 XSRETURN(1);
1409 2 }); }
1410  
1411  
1412  
1413 30 ▶XS_EUPXS(XS_MyTest__SvAPI_glob_in) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__SvAPI_glob_in) { xs::throw_guard(cv, [=]() 2 0 2
1414 {
1415 15 dVAR; dXSARGS;
1416 15 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 15 15
1417 0 croak_xs_usage(cv, "val");
1418 {
1419 uint64_t RETVAL;
1420 15 ▶ dXSTARG;
Branch: 2 branches
BranchTrueFalseTotal
dXSTARG; 15 0 15
dXSTARG; 0 0 0
1421 15 ▶ Glob val = ST(0);
Branch: 1 branch
BranchTrueFalseTotal
Glob val = ST(0); 2 13 15
1422 2 ▶ if (!val && SvOK(ST(0))) throw "arg is not a 'Glob' value"
Branch: 3 branches
BranchTrueFalseTotal
if (!val && SvOK(ST(0))) throw "arg is not a 'Glob' value" 1 1 2
if (!val && SvOK(ST(0))) throw "arg is not a 'Glob' value" 0 1 1
if (!val && SvOK(ST(0))) throw "arg is not a 'Glob' value" 0 2 2
1423 ;
1424 #line 34 "t/typemap/svapi.xsi"
1425 RETVAL = (uint64_t)val.get();
1426 #line 1427 "t/typemap/typemap_xsgen.cc"
1427 2 ▶ TARGu((UV)RETVAL, 1);
Branch: 2 branches
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 0 2 2
TARGu((UV)RETVAL, 1); 2 0 2
1428 2 ST(0) = TARG;
1429 2 }
1430 2 XSRETURN(1);
1431 2 }); }
1432  
1433  
1434  
1435 4 ▶XS_EUPXS(XS_MyTest__SvAPI_glob_out) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__SvAPI_glob_out) { xs::throw_guard(cv, [=]() 2 0 2
1436 {
1437 2 dVAR; dXSARGS;
1438 2 ▶ if (items < 0 || items > 1)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 0 || items > 1) 2 0 2
if (items < 0 || items > 1) 0 2 2
1439 0 croak_xs_usage(cv, "val= NULL");
1440 {
1441 2 Glob RETVAL;
1442 SV* val;
1443  
1444 2 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 1 1 2
1445 1 val = NULL;
1446 else {
1447 1 val = ST(0)
1448 ;
1449 }
1450 #line 38 "t/typemap/svapi.xsi"
1451 RETVAL = val;
1452 #line 1453 "t/typemap/typemap_xsgen.cc"
1453 {
1454 SV * RETVALSV;
1455 2 RETVALSV = NULL;
1456 2 ▶ if (!RETVAL) XSRETURN_UNDEF;
Branch: 1 branch
BranchTrueFalseTotal
if (!RETVAL) XSRETURN_UNDEF; 1 1 2
1457 1 RETVALSV = RETVAL.detach();
1458 1 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 1 0 1
1459 1 ST(0) = RETVALSV;
1460 }
1461 2 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 1 1 2
1462 1 XSRETURN(1);
1463 2 }); }
1464  
1465  
1466  
1467 30 ▶XS_EUPXS(XS_MyTest__SvAPI_sub_in) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__SvAPI_sub_in) { xs::throw_guard(cv, [=]() 2 0 2
1468 {
1469 15 dVAR; dXSARGS;
1470 15 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 15 15
1471 0 croak_xs_usage(cv, "val");
1472 {
1473 uint64_t RETVAL;
1474 15 ▶ dXSTARG;
Branch: 2 branches
BranchTrueFalseTotal
dXSTARG; 15 0 15
dXSTARG; 0 0 0
1475 15 ▶ Sub val = ST(0);
Branch: 1 branch
BranchTrueFalseTotal
Sub val = ST(0); 2 13 15
1476 2 ▶ if (!val && SvOK(ST(0))) throw "arg is not a 'Sub' reference"
Branch: 3 branches
BranchTrueFalseTotal
if (!val && SvOK(ST(0))) throw "arg is not a 'Sub' reference" 1 1 2
if (!val && SvOK(ST(0))) throw "arg is not a 'Sub' reference" 0 1 1
if (!val && SvOK(ST(0))) throw "arg is not a 'Sub' reference" 0 2 2
1477 ;
1478 #line 42 "t/typemap/svapi.xsi"
1479 RETVAL = (uint64_t)val.get();
1480 #line 1481 "t/typemap/typemap_xsgen.cc"
1481 2 ▶ TARGu((UV)RETVAL, 1);
Branch: 2 branches
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 0 2 2
TARGu((UV)RETVAL, 1); 2 0 2
1482 2 ST(0) = TARG;
1483 2 }
1484 2 XSRETURN(1);
1485 2 }); }
1486  
1487  
1488  
1489 4 ▶XS_EUPXS(XS_MyTest__SvAPI_sub_out) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__SvAPI_sub_out) { xs::throw_guard(cv, [=]() 2 0 2
1490 {
1491 2 dVAR; dXSARGS;
1492 2 ▶ if (items < 0 || items > 1)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 0 || items > 1) 2 0 2
if (items < 0 || items > 1) 0 2 2
1493 0 croak_xs_usage(cv, "val= NULL");
1494 {
1495 2 Sub RETVAL;
1496 SV* val;
1497  
1498 2 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 1 1 2
1499 1 val = NULL;
1500 else {
1501 1 val = ST(0)
1502 ;
1503 }
1504 #line 46 "t/typemap/svapi.xsi"
1505 RETVAL = val;
1506 #line 1507 "t/typemap/typemap_xsgen.cc"
1507 {
1508 SV * RETVALSV;
1509 2 RETVALSV = NULL;
1510 2 ▶ if (!RETVAL) XSRETURN_UNDEF;
Branch: 1 branch
BranchTrueFalseTotal
if (!RETVAL) XSRETURN_UNDEF; 1 1 2
1511 1 ▶ RETVALSV = newRV_noinc(RETVAL.detach());
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = newRV_noinc(RETVAL.detach()); 1 0 1
1512 1 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 1 0 1
1513 1 ST(0) = RETVALSV;
1514 }
1515 2 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 1 1 2
1516 1 XSRETURN(1);
1517 2 }); }
1518  
1519  
1520  
1521 30 ▶XS_EUPXS(XS_MyTest__SvAPI_array_in) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__SvAPI_array_in) { xs::throw_guard(cv, [=]() 3 0 3
1522 {
1523 15 dVAR; dXSARGS;
1524 15 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 15 15
1525 0 croak_xs_usage(cv, "val");
1526 {
1527 uint64_t RETVAL;
1528 15 ▶ dXSTARG;
Branch: 2 branches
BranchTrueFalseTotal
dXSTARG; 15 0 15
dXSTARG; 0 0 0
1529 15 ▶ Array val = ST(0);
Branch: 1 branch
BranchTrueFalseTotal
Array val = ST(0); 3 12 15
1530 3 ▶ if (!val && SvOK(ST(0))) throw "arg is not a 'Array' reference"
Branch: 3 branches
BranchTrueFalseTotal
if (!val && SvOK(ST(0))) throw "arg is not a 'Array' reference" 1 2 3
if (!val && SvOK(ST(0))) throw "arg is not a 'Array' reference" 0 1 1
if (!val && SvOK(ST(0))) throw "arg is not a 'Array' reference" 0 3 3
1531 ;
1532 #line 50 "t/typemap/svapi.xsi"
1533 RETVAL = (uint64_t)val.get();
1534 #line 1535 "t/typemap/typemap_xsgen.cc"
1535 3 ▶ TARGu((UV)RETVAL, 1);
Branch: 2 branches
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 1 2 3
TARGu((UV)RETVAL, 1); 2 0 2
1536 3 ST(0) = TARG;
1537 3 }
1538 3 XSRETURN(1);
1539 3 }); }
1540  
1541  
1542  
1543 4 ▶XS_EUPXS(XS_MyTest__SvAPI_array_out) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__SvAPI_array_out) { xs::throw_guard(cv, [=]() 2 0 2
1544 {
1545 2 dVAR; dXSARGS;
1546 2 ▶ if (items < 0 || items > 1)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 0 || items > 1) 2 0 2
if (items < 0 || items > 1) 0 2 2
1547 0 croak_xs_usage(cv, "val= NULL");
1548 {
1549 2 Array RETVAL;
1550 SV* val;
1551  
1552 2 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 1 1 2
1553 1 val = NULL;
1554 else {
1555 1 val = ST(0)
1556 ;
1557 }
1558 #line 54 "t/typemap/svapi.xsi"
1559 RETVAL = val;
1560 #line 1561 "t/typemap/typemap_xsgen.cc"
1561 {
1562 SV * RETVALSV;
1563 2 RETVALSV = NULL;
1564 2 ▶ if (!RETVAL) XSRETURN_UNDEF;
Branch: 1 branch
BranchTrueFalseTotal
if (!RETVAL) XSRETURN_UNDEF; 1 1 2
1565 1 ▶ RETVALSV = newRV_noinc(RETVAL.detach());
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = newRV_noinc(RETVAL.detach()); 1 0 1
1566 1 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 1 0 1
1567 1 ST(0) = RETVALSV;
1568 }
1569 2 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 1 1 2
1570 1 XSRETURN(1);
1571 2 }); }
1572  
1573  
1574  
1575 28 ▶XS_EUPXS(XS_MyTest__SvAPI_hash_in) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__SvAPI_hash_in) { xs::throw_guard(cv, [=]() 4 0 4
1576 {
1577 14 dVAR; dXSARGS;
1578 14 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 14 14
1579 0 croak_xs_usage(cv, "val");
1580 {
1581 uint64_t RETVAL;
1582 14 ▶ dXSTARG;
Branch: 2 branches
BranchTrueFalseTotal
dXSTARG; 14 0 14
dXSTARG; 0 0 0
1583 14 ▶ Hash val = ST(0);
Branch: 1 branch
BranchTrueFalseTotal
Hash val = ST(0); 4 10 14
1584 4 ▶ if (!val && SvOK(ST(0))) throw "arg is not a 'Hash' reference"
Branch: 3 branches
BranchTrueFalseTotal
if (!val && SvOK(ST(0))) throw "arg is not a 'Hash' reference" 1 3 4
if (!val && SvOK(ST(0))) throw "arg is not a 'Hash' reference" 0 1 1
if (!val && SvOK(ST(0))) throw "arg is not a 'Hash' reference" 0 4 4
1585 ;
1586 #line 58 "t/typemap/svapi.xsi"
1587 RETVAL = (uint64_t)val.get();
1588 #line 1589 "t/typemap/typemap_xsgen.cc"
1589 4 ▶ TARGu((UV)RETVAL, 1);
Branch: 2 branches
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 2 2 4
TARGu((UV)RETVAL, 1); 2 0 2
1590 4 ST(0) = TARG;
1591 4 }
1592 4 XSRETURN(1);
1593 4 }); }
1594  
1595  
1596  
1597 4 ▶XS_EUPXS(XS_MyTest__SvAPI_hash_out) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__SvAPI_hash_out) { xs::throw_guard(cv, [=]() 2 0 2
1598 {
1599 2 dVAR; dXSARGS;
1600 2 ▶ if (items < 0 || items > 1)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 0 || items > 1) 2 0 2
if (items < 0 || items > 1) 0 2 2
1601 0 croak_xs_usage(cv, "val= NULL");
1602 {
1603 2 Hash RETVAL;
1604 SV* val;
1605  
1606 2 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 1 1 2
1607 1 val = NULL;
1608 else {
1609 1 val = ST(0)
1610 ;
1611 }
1612 #line 62 "t/typemap/svapi.xsi"
1613 RETVAL = val;
1614 #line 1615 "t/typemap/typemap_xsgen.cc"
1615 {
1616 SV * RETVALSV;
1617 2 RETVALSV = NULL;
1618 2 ▶ if (!RETVAL) XSRETURN_UNDEF;
Branch: 1 branch
BranchTrueFalseTotal
if (!RETVAL) XSRETURN_UNDEF; 1 1 2
1619 1 ▶ RETVALSV = newRV_noinc(RETVAL.detach());
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = newRV_noinc(RETVAL.detach()); 1 0 1
1620 1 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 1 0 1
1621 1 ST(0) = RETVALSV;
1622 }
1623 2 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 1 1 2
1624 1 XSRETURN(1);
1625 2 }); }
1626  
1627  
1628  
1629 28 ▶XS_EUPXS(XS_MyTest__SvAPI_stash_in) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__SvAPI_stash_in) { xs::throw_guard(cv, [=]() 2 0 2
1630 {
1631 14 dVAR; dXSARGS;
1632 14 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 14 14
1633 0 croak_xs_usage(cv, "val");
1634 {
1635 uint64_t RETVAL;
1636 14 ▶ dXSTARG;
Branch: 2 branches
BranchTrueFalseTotal
dXSTARG; 14 0 14
dXSTARG; 0 0 0
1637 14 ▶ Stash val = ST(0);
Branch: 1 branch
BranchTrueFalseTotal
Stash val = ST(0); 2 12 14
1638 2 ▶ if (!val && SvOK(ST(0))) throw "arg is not a 'Stash' reference"
Branch: 3 branches
BranchTrueFalseTotal
if (!val && SvOK(ST(0))) throw "arg is not a 'Stash' reference" 1 1 2
if (!val && SvOK(ST(0))) throw "arg is not a 'Stash' reference" 0 1 1
if (!val && SvOK(ST(0))) throw "arg is not a 'Stash' reference" 0 2 2
1639 ;
1640 #line 66 "t/typemap/svapi.xsi"
1641 RETVAL = (uint64_t)val.get();
1642 #line 1643 "t/typemap/typemap_xsgen.cc"
1643 2 ▶ TARGu((UV)RETVAL, 1);
Branch: 2 branches
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 0 2 2
TARGu((UV)RETVAL, 1); 2 0 2
1644 2 ST(0) = TARG;
1645 2 }
1646 2 XSRETURN(1);
1647 2 }); }
1648  
1649  
1650  
1651 4 ▶XS_EUPXS(XS_MyTest__SvAPI_stash_out) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__SvAPI_stash_out) { xs::throw_guard(cv, [=]() 2 0 2
1652 {
1653 2 dVAR; dXSARGS;
1654 2 ▶ if (items < 0 || items > 1)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 0 || items > 1) 2 0 2
if (items < 0 || items > 1) 0 2 2
1655 0 croak_xs_usage(cv, "val= NULL");
1656 {
1657 2 Stash RETVAL;
1658 SV* val;
1659  
1660 2 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 1 1 2
1661 1 val = NULL;
1662 else {
1663 1 val = ST(0)
1664 ;
1665 }
1666 #line 70 "t/typemap/svapi.xsi"
1667 RETVAL = val;
1668 #line 1669 "t/typemap/typemap_xsgen.cc"
1669 {
1670 SV * RETVALSV;
1671 2 RETVALSV = NULL;
1672 2 ▶ if (!RETVAL) XSRETURN_UNDEF;
Branch: 1 branch
BranchTrueFalseTotal
if (!RETVAL) XSRETURN_UNDEF; 1 1 2
1673 1 ▶ RETVALSV = newRV_noinc(RETVAL.detach());
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = newRV_noinc(RETVAL.detach()); 1 0 1
1674 1 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 1 0 1
1675 1 ST(0) = RETVALSV;
1676 }
1677 2 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 1 1 2
1678 1 XSRETURN(1);
1679 2 }); }
1680  
1681  
1682  
1683 30 ▶XS_EUPXS(XS_MyTest__SvAPI_object_in) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__SvAPI_object_in) { xs::throw_guard(cv, [=]() 3 0 3
1684 {
1685 15 dVAR; dXSARGS;
1686 15 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 15 15
1687 0 croak_xs_usage(cv, "val");
1688 {
1689 uint64_t RETVAL;
1690 15 ▶ dXSTARG;
Branch: 2 branches
BranchTrueFalseTotal
dXSTARG; 15 0 15
dXSTARG; 0 0 0
1691 15 ▶ Object val = ST(0);
Branch: 1 branch
BranchTrueFalseTotal
Object val = ST(0); 3 12 15
1692 3 ▶ if (!val && SvOK(ST(0))) throw "arg is not a blessed reference"
Branch: 3 branches
BranchTrueFalseTotal
if (!val && SvOK(ST(0))) throw "arg is not a blessed reference" 1 2 3
if (!val && SvOK(ST(0))) throw "arg is not a blessed reference" 0 1 1
if (!val && SvOK(ST(0))) throw "arg is not a blessed reference" 0 3 3
1693 ;
1694 #line 74 "t/typemap/svapi.xsi"
1695 RETVAL = (uint64_t)val.get();
1696 #line 1697 "t/typemap/typemap_xsgen.cc"
1697 3 ▶ TARGu((UV)RETVAL, 1);
Branch: 2 branches
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 1 2 3
TARGu((UV)RETVAL, 1); 2 0 2
1698 3 ST(0) = TARG;
1699 3 }
1700 3 XSRETURN(1);
1701 3 }); }
1702  
1703  
1704  
1705 4 ▶XS_EUPXS(XS_MyTest__SvAPI_object_out) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__SvAPI_object_out) { xs::throw_guard(cv, [=]() 2 0 2
1706 {
1707 2 dVAR; dXSARGS;
1708 2 ▶ if (items < 0 || items > 1)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 0 || items > 1) 2 0 2
if (items < 0 || items > 1) 0 2 2
1709 0 croak_xs_usage(cv, "val= NULL");
1710 {
1711 2 Object RETVAL;
1712 SV* val;
1713  
1714 2 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 1 1 2
1715 1 val = NULL;
1716 else {
1717 1 val = ST(0)
1718 ;
1719 }
1720 #line 78 "t/typemap/svapi.xsi"
1721 RETVAL = val;
1722 #line 1723 "t/typemap/typemap_xsgen.cc"
1723 {
1724 SV * RETVALSV;
1725 2 RETVALSV = NULL;
1726 2 ▶ if (!RETVAL) XSRETURN_UNDEF;
Branch: 1 branch
BranchTrueFalseTotal
if (!RETVAL) XSRETURN_UNDEF; 1 1 2
1727 1 ▶ RETVALSV = SvREFCNT_inc_NN(RETVAL.ref().get());
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = SvREFCNT_inc_NN(RETVAL.ref().get()); 1 0 1
1728 1 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 1 0 1
1729 1 ST(0) = RETVALSV;
1730 }
1731 2 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 1 1 2
1732 1 XSRETURN(1);
1733 2 }); }
1734  
1735  
1736 /* INCLUDE: Returning to 'typemap.xs' from 'svapi.xsi' */
1737  
1738  
1739 /* INCLUDE: Including 'error.xsi' from 'typemap.xs' */
1740  
1741  
1742  
1743 2 ▶XS_EUPXS(XS_MyTest__Error_operation_canceled) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Error_operation_canceled) { xs::throw_guard(cv, [=]() 1 0 1
1744 {
1745 1 dVAR; dXSARGS;
1746 1 ▶ if (items != 0)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 0) 0 1 1
1747 0 croak_xs_usage(cv, "");
1748 {
1749 1 std::error_code RETVAL;
1750 #line 5 "t/typemap/error.xsi"
1751 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
1752 RETVAL = make_error_code(std::errc::operation_canceled);
1753 #line 1754 "t/typemap/typemap_xsgen.cc"
1754 {
1755 SV * RETVALSV;
1756 1 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 1 0 1
1757 1 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 1 0 1
1758 1 ST(0) = RETVALSV;
1759 }
1760 1 }
1761 1 XSRETURN(1);
1762 1 }); }
1763  
1764  
1765  
1766 8 ▶XS_EUPXS(XS_MyTest__Error_operation_chain_canceled) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Error_operation_chain_canceled) { xs::throw_guard(cv, [=]() 4 0 4
1767 {
1768 4 dVAR; dXSARGS;
1769 4 ▶ if (items != 0)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 0) 0 4 4
1770 0 croak_xs_usage(cv, "");
1771 {
1772 4 ErrorCode RETVAL;
1773 #line 9 "t/typemap/error.xsi"
1774 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
1775 ErrorCode orig(make_error_code(std::errc::operation_canceled));
1776 RETVAL = ErrorCode(make_error_code(std::errc::connection_aborted), orig);
1777 #line 1778 "t/typemap/typemap_xsgen.cc"
1778 {
1779 SV * RETVALSV;
1780 4 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 4 0 4
1781 4 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 4 0 4
1782 4 ST(0) = RETVALSV;
1783 }
1784 4 }
1785 4 XSRETURN(1);
1786 4 }); }
1787  
1788  
1789 /* INCLUDE: Returning to 'typemap.xs' from 'error.xsi' */
1790  
1791  
1792 /* INCLUDE: Including 'expected.xsi' from 'typemap.xs' */
1793  
1794 #include <xs/typemap/expected.h>
1795  
1796  
1797 8 ▶XS_EUPXS(XS_MyTest__Expected_void_ok) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Expected_void_ok) { xs::throw_guard(cv, [=]() 4 0 4
1798 {
1799 4 dVAR; dXSARGS;
1800 PERL_UNUSED_VAR(cv); /* -W */
1801 PERL_UNUSED_VAR(items); /* -W */
1802 PERL_UNUSED_VAR(ax); /* -Wall */
1803 4 SP -= items;
1804 {
1805 #line 13 "t/typemap/expected.xsi"
1806 expected<void,std::error_code> ret = {};
1807 XSRETURN_EXPECTED(ret);
1808 #line 1809 "t/typemap/typemap_xsgen.cc"
1809 PUTBACK;
1810 return;
1811 4 }
1812 4 }); }
1813  
1814  
1815  
1816 8 ▶XS_EUPXS(XS_MyTest__Expected_void_err) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Expected_void_err) { xs::throw_guard(cv, [=]() 3 0 3
1817 {
1818 4 dVAR; dXSARGS;
1819 PERL_UNUSED_VAR(cv); /* -W */
1820 PERL_UNUSED_VAR(items); /* -W */
1821 {
1822 4 expected<void,std::error_code> RETVAL;
1823 #line 18 "t/typemap/expected.xsi"
1824 RETVAL = make_unexpected(make_error_code(std::errc::timed_out));
1825 #line 1826 "t/typemap/typemap_xsgen.cc"
1826 {
1827 SV * RETVALSV;
1828 4 RETVALSV = NULL;
1829 4 ▶ XSRETURN_EXPECTED(RETVAL);
Branch: 1 branch
BranchTrueFalseTotal
XSRETURN_EXPECTED(RETVAL); 3 1 4
1830 RETVALSV = sv_2mortal(RETVALSV);
1831 ST(0) = RETVALSV;
1832 }
1833 4 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 3 3
1834 0 XSRETURN(1);
1835 3 }); }
1836  
1837  
1838  
1839 8 ▶XS_EUPXS(XS_MyTest__Expected_ret_ok) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Expected_ret_ok) { xs::throw_guard(cv, [=]() 4 0 4
1840 {
1841 4 dVAR; dXSARGS;
1842 PERL_UNUSED_VAR(cv); /* -W */
1843 PERL_UNUSED_VAR(items); /* -W */
1844 PERL_UNUSED_VAR(ax); /* -Wall */
1845 4 SP -= items;
1846 {
1847 #line 22 "t/typemap/expected.xsi"
1848 expected<string,std::error_code> ret = string("hi");
1849 XSRETURN_EXPECTED(ret);
1850 #line 1851 "t/typemap/typemap_xsgen.cc"
1851 PUTBACK;
1852 return;
1853 4 }
1854 4 }); }
1855  
1856  
1857  
1858 8 ▶XS_EUPXS(XS_MyTest__Expected_ret_err) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Expected_ret_err) { xs::throw_guard(cv, [=]() 1 0 1
1859 {
1860 4 dVAR; dXSARGS;
1861 PERL_UNUSED_VAR(cv); /* -W */
1862 PERL_UNUSED_VAR(items); /* -W */
1863 {
1864 4 expected<string,std::error_code> RETVAL;
1865 #line 27 "t/typemap/expected.xsi"
1866 RETVAL = make_unexpected(make_error_code(std::errc::timed_out));
1867 #line 1868 "t/typemap/typemap_xsgen.cc"
1868 {
1869 SV * RETVALSV;
1870 4 RETVALSV = NULL;
1871 4 ▶ XSRETURN_EXPECTED(RETVAL);
Branch: 1 branch
BranchTrueFalseTotal
XSRETURN_EXPECTED(RETVAL); 1 3 4
1872 RETVALSV = sv_2mortal(RETVALSV);
1873 ST(0) = RETVALSV;
1874 }
1875 4 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 1 1
1876 0 XSRETURN(1);
1877 1 }); }
1878  
1879  
1880  
1881 8 ▶XS_EUPXS(XS_MyTest__Excepted_void_ok) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Excepted_void_ok) { xs::throw_guard(cv, [=]() 4 0 4
1882 {
1883 4 dVAR; dXSARGS;
1884 PERL_UNUSED_VAR(cv); /* -W */
1885 PERL_UNUSED_VAR(items); /* -W */
1886 PERL_UNUSED_VAR(ax); /* -Wall */
1887 4 SP -= items;
1888 {
1889 #line 40 "t/typemap/expected.xsi"
1890 excepted<void,std::error_code> ret = {};
1891 XSRETURN_EXPECTED(ret);
1892 #line 1893 "t/typemap/typemap_xsgen.cc"
1893 PUTBACK;
1894 return;
1895 4 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 4 0 4
1896 4 }); }
1897  
1898  
1899  
1900 8 ▶XS_EUPXS(XS_MyTest__Excepted_void_err) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Excepted_void_err) { xs::throw_guard(cv, [=]() 3 0 3
1901 {
1902 4 dVAR; dXSARGS;
1903 PERL_UNUSED_VAR(cv); /* -W */
1904 PERL_UNUSED_VAR(items); /* -W */
1905 {
1906 4 excepted<void,std::error_code> RETVAL;
1907 #line 45 "t/typemap/expected.xsi"
1908 RETVAL = make_unexpected(make_error_code(std::errc::timed_out));
1909 #line 1910 "t/typemap/typemap_xsgen.cc"
1910 {
1911 SV * RETVALSV;
1912 4 RETVALSV = NULL;
1913 4 ▶ XSRETURN_EXPECTED(RETVAL);
Branch: 1 branch
BranchTrueFalseTotal
XSRETURN_EXPECTED(RETVAL); 3 1 4
1914 RETVALSV = sv_2mortal(RETVALSV);
1915 ST(0) = RETVALSV;
1916 }
1917 4 ▶ }
Branch: 2 branches
BranchTrueFalseTotal
} 3 0 3
} 0 3 3
1918 0 XSRETURN(1);
1919 3 }); }
1920  
1921  
1922  
1923 8 ▶XS_EUPXS(XS_MyTest__Excepted_ret_ok) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Excepted_ret_ok) { xs::throw_guard(cv, [=]() 4 0 4
1924 {
1925 4 dVAR; dXSARGS;
1926 PERL_UNUSED_VAR(cv); /* -W */
1927 PERL_UNUSED_VAR(items); /* -W */
1928 PERL_UNUSED_VAR(ax); /* -Wall */
1929 4 SP -= items;
1930 {
1931 #line 49 "t/typemap/expected.xsi"
1932 excepted<string,std::error_code> ret = string("hi");
1933 XSRETURN_EXPECTED(ret);
1934 #line 1935 "t/typemap/typemap_xsgen.cc"
1935 PUTBACK;
1936 return;
1937 4 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 4 0 4
1938 4 }); }
1939  
1940  
1941  
1942 8 ▶XS_EUPXS(XS_MyTest__Excepted_ret_err) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_MyTest__Excepted_ret_err) { xs::throw_guard(cv, [=]() 1 0 1
1943 {
1944 4 dVAR; dXSARGS;
1945 PERL_UNUSED_VAR(cv); /* -W */
1946 PERL_UNUSED_VAR(items); /* -W */
1947 {
1948 4 excepted<string,std::error_code> RETVAL;
1949 #line 54 "t/typemap/expected.xsi"
1950 RETVAL = make_unexpected(make_error_code(std::errc::timed_out));
1951 #line 1952 "t/typemap/typemap_xsgen.cc"
1952 {
1953 SV * RETVALSV;
1954 4 RETVALSV = NULL;
1955 4 ▶ XSRETURN_EXPECTED(RETVAL);
Branch: 1 branch
BranchTrueFalseTotal
XSRETURN_EXPECTED(RETVAL); 1 3 4
1956 RETVALSV = sv_2mortal(RETVALSV);
1957 ST(0) = RETVALSV;
1958 }
1959 4 ▶ }
Branch: 2 branches
BranchTrueFalseTotal
} 1 0 1
} 0 1 1
1960 0 XSRETURN(1);
1961 1 }); }
1962  
1963  
1964 /* INCLUDE: Returning to 'typemap.xs' from 'expected.xsi' */
1965  
1966 #ifdef __cplusplus
1967 extern "C" {
1968 #endif
1969  
1970 70 ▶XS_EXTERNAL(boot_MyTest__Typemap) { xs::throw_guard(cv, [=]() mutable
Branch: 1 branch
BranchTrueFalseTotal
XS_EXTERNAL(boot_MyTest__Typemap) { xs::throw_guard(cv, [=]() mutable 35 0 35
1971 {
1972 #if PERL_VERSION_LE(5, 21, 5)
1973 dVAR; dXSARGS;
1974 #else
1975 35 dVAR; dXSBOOTARGSXSAPIVERCHK;
1976 #endif
1977 #if PERL_VERSION_LE(5, 8, 999) /* PERL_VERSION_LT is 5.33+ */
1978 char* file = __FILE__;
1979 #else
1980 35 const char* file = __FILE__;
1981 #endif
1982  
1983 PERL_UNUSED_VAR(file);
1984  
1985 PERL_UNUSED_VAR(cv); /* -W */
1986 PERL_UNUSED_VAR(items); /* -W */
1987 #if PERL_VERSION_LE(5, 21, 5)
1988 XS_VERSION_BOOTCHECK;
1989 # ifdef XS_APIVERSION_BOOTCHECK
1990 XS_APIVERSION_BOOTCHECK;
1991 # endif
1992 #endif
1993  
1994 35 newXS_deffile("MyTest::dcnt", XS_MyTest_dcnt);
1995 35 newXS_deffile("MyTest::i8", XS_MyTest_i8);
1996 35 newXS_deffile("MyTest::i16", XS_MyTest_i16);
1997 35 newXS_deffile("MyTest::i32", XS_MyTest_i32);
1998 35 newXS_deffile("MyTest::i64", XS_MyTest_i64);
1999 35 newXS_deffile("MyTest::u8", XS_MyTest_u8);
2000 35 newXS_deffile("MyTest::u16", XS_MyTest_u16);
2001 35 newXS_deffile("MyTest::u32", XS_MyTest_u32);
2002 35 newXS_deffile("MyTest::u64", XS_MyTest_u64);
2003 35 newXS_deffile("MyTest::time_t", XS_MyTest_time_t);
2004 35 newXS_deffile("MyTest::av_out", XS_MyTest_av_out);
2005 35 newXS_deffile("MyTest::av_in", XS_MyTest_av_in);
2006 35 newXS_deffile("MyTest::hv_out", XS_MyTest_hv_out);
2007 35 newXS_deffile("MyTest::hv_in", XS_MyTest_hv_in);
2008 35 newXS_deffile("MyTest::io_out", XS_MyTest_io_out);
2009 35 newXS_deffile("MyTest::io_in", XS_MyTest_io_in);
2010 35 newXS_deffile("MyTest::cv_out", XS_MyTest_cv_out);
2011 35 newXS_deffile("MyTest::cv_in", XS_MyTest_cv_in);
2012 35 newXS_deffile("MyTest::gv_out", XS_MyTest_gv_out);
2013 35 newXS_deffile("MyTest::gv_in", XS_MyTest_gv_in);
2014 35 newXS_deffile("MyTest::MyConst::new", XS_MyTest__MyConst_new);
2015 35 newXS_deffile("MyTest::MyConst::new_const", XS_MyTest__MyConst_new_const);
2016 35 newXS_deffile("MyTest::MyConst::get_val", XS_MyTest__MyConst_get_val);
2017 35 newXS_deffile("MyTest::MyConst::set_val", XS_MyTest__MyConst_set_val);
2018 35 newXS_deffile("MyTest::MyConst::set_from", XS_MyTest__MyConst_set_from);
2019 35 newXS_deffile("MyTest::MyConst::DESTROY", XS_MyTest__MyConst_DESTROY);
2020 35 newXS_deffile("MyTest::MyConst2::new", XS_MyTest__MyConst2_new);
2021 35 newXS_deffile("MyTest::MyConst2::new_const", XS_MyTest__MyConst2_new_const);
2022 35 newXS_deffile("MyTest::MyConst2::get_val", XS_MyTest__MyConst2_get_val);
2023 35 newXS_deffile("MyTest::MyConst2::set_val", XS_MyTest__MyConst2_set_val);
2024 35 newXS_deffile("MyTest::MyConst2::set_from", XS_MyTest__MyConst2_set_from);
2025 35 newXS_deffile("MyTest::MyConst2::DESTROY", XS_MyTest__MyConst2_DESTROY);
2026 35 newXS_deffile("MyTest::Container::std_vector_int", XS_MyTest__Container_std_vector_int);
2027 35 newXS_deffile("MyTest::Container::std_map_string_int", XS_MyTest__Container_std_map_string_int);
2028 35 newXS_deffile("MyTest::Container::std_map_int_bool", XS_MyTest__Container_std_map_int_bool);
2029 35 newXS_deffile("MyTest::NotNull::new", XS_MyTest__NotNull_new);
2030 35 newXS_deffile("MyTest::NotNull::val", XS_MyTest__NotNull_val);
2031 35 newXS_deffile("MyTest::NotNull::set_from", XS_MyTest__NotNull_set_from);
2032 35 newXS_deffile("MyTest::NotNull::set_from2", XS_MyTest__NotNull_set_from2);
2033 35 newXS_deffile("MyTest::NotNull::DESTROY", XS_MyTest__NotNull_DESTROY);
2034 35 newXS_deffile("MyTest::SvAPI::sv_out", XS_MyTest__SvAPI_sv_out);
2035 35 newXS_deffile("MyTest::SvAPI::scalar_in", XS_MyTest__SvAPI_scalar_in);
2036 35 newXS_deffile("MyTest::SvAPI::scalar_out", XS_MyTest__SvAPI_scalar_out);
2037 35 newXS_deffile("MyTest::SvAPI::simple_in", XS_MyTest__SvAPI_simple_in);
2038 35 newXS_deffile("MyTest::SvAPI::simple_out", XS_MyTest__SvAPI_simple_out);
2039 35 newXS_deffile("MyTest::SvAPI::ref_in", XS_MyTest__SvAPI_ref_in);
2040 35 newXS_deffile("MyTest::SvAPI::ref_out", XS_MyTest__SvAPI_ref_out);
2041 35 newXS_deffile("MyTest::SvAPI::glob_in", XS_MyTest__SvAPI_glob_in);
2042 35 newXS_deffile("MyTest::SvAPI::glob_out", XS_MyTest__SvAPI_glob_out);
2043 35 newXS_deffile("MyTest::SvAPI::sub_in", XS_MyTest__SvAPI_sub_in);
2044 35 newXS_deffile("MyTest::SvAPI::sub_out", XS_MyTest__SvAPI_sub_out);
2045 35 newXS_deffile("MyTest::SvAPI::array_in", XS_MyTest__SvAPI_array_in);
2046 35 newXS_deffile("MyTest::SvAPI::array_out", XS_MyTest__SvAPI_array_out);
2047 35 newXS_deffile("MyTest::SvAPI::hash_in", XS_MyTest__SvAPI_hash_in);
2048 35 newXS_deffile("MyTest::SvAPI::hash_out", XS_MyTest__SvAPI_hash_out);
2049 35 newXS_deffile("MyTest::SvAPI::stash_in", XS_MyTest__SvAPI_stash_in);
2050 35 newXS_deffile("MyTest::SvAPI::stash_out", XS_MyTest__SvAPI_stash_out);
2051 35 newXS_deffile("MyTest::SvAPI::object_in", XS_MyTest__SvAPI_object_in);
2052 35 newXS_deffile("MyTest::SvAPI::object_out", XS_MyTest__SvAPI_object_out);
2053 35 newXS_deffile("MyTest::Error::operation_canceled", XS_MyTest__Error_operation_canceled);
2054 35 newXS_deffile("MyTest::Error::operation_chain_canceled", XS_MyTest__Error_operation_chain_canceled);
2055 35 newXS_deffile("MyTest::Expected::void_ok", XS_MyTest__Expected_void_ok);
2056 35 newXS_deffile("MyTest::Expected::void_err", XS_MyTest__Expected_void_err);
2057 35 newXS_deffile("MyTest::Expected::ret_ok", XS_MyTest__Expected_ret_ok);
2058 35 newXS_deffile("MyTest::Expected::ret_err", XS_MyTest__Expected_ret_err);
2059 35 newXS_deffile("MyTest::Excepted::void_ok", XS_MyTest__Excepted_void_ok);
2060 35 newXS_deffile("MyTest::Excepted::void_err", XS_MyTest__Excepted_void_err);
2061 35 newXS_deffile("MyTest::Excepted::ret_ok", XS_MyTest__Excepted_ret_ok);
2062 35 newXS_deffile("MyTest::Excepted::ret_err", XS_MyTest__Excepted_ret_err);
2063  
2064 /* Initialisation Section */
2065  
2066 #line 15 "t/typemap/typemap.xs"
2067 {
2068 XS_BOOT(MyTest__Typemap__Object);
2069 XS_BOOT(MyTest__Typemap__CD);
2070 }
2071  
2072 #line 2073 "t/typemap/typemap_xsgen.cc"
2073  
2074 /* End of Initialisation Section */
2075  
2076 #if PERL_VERSION_LE(5, 21, 5)
2077 # if PERL_VERSION_GE(5, 9, 0)
2078 if (PL_unitcheckav)
2079 call_list(PL_scopestack_ix, PL_unitcheckav);
2080 # endif
2081 XSRETURN_YES;
2082 #else
2083 35 Perl_xs_boot_epilog(aTHX_ ax);
2084 #endif
2085 35 }); }
2086  
2087 #ifdef __cplusplus
2088 }
2089 #endif
« t/typemap/container.xsi ↑ Summary t/svapi/scope.cc »