| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
/* |
|
2
|
|
|
|
|
|
|
* This file was generated automatically by ExtUtils::ParseXS version 3.34 from the |
|
3
|
|
|
|
|
|
|
* contents of callback_dispatcher.xs. Do not edit this file, edit callback_dispatcher.xs instead. |
|
4
|
|
|
|
|
|
|
* |
|
5
|
|
|
|
|
|
|
* ANY CHANGES MADE HERE WILL BE LOST! |
|
6
|
|
|
|
|
|
|
* |
|
7
|
|
|
|
|
|
|
*/ |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
#line 1 "t/typemap/callback_dispatcher.xs" |
|
10
|
|
|
|
|
|
|
#include |
|
11
|
|
|
|
|
|
|
#include |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
using namespace xs; |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
using panda::string; |
|
16
|
|
|
|
|
|
|
using panda::string_view; |
|
17
|
|
|
|
|
|
|
using panda::CallbackDispatcher; |
|
18
|
|
|
|
|
|
|
template using iptr = panda::iptr; |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
struct NoTmStruct { |
|
21
|
|
|
|
|
|
|
string val; |
|
22
|
|
|
|
|
|
|
}; |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
struct SomeClass : panda::Refcnt {}; |
|
25
|
|
|
|
|
|
|
struct SomeClass2 : panda::Refcnt {}; |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
using cdVS = CallbackDispatcher; |
|
28
|
|
|
|
|
|
|
using cdIS = CallbackDispatcher; |
|
29
|
|
|
|
|
|
|
using cdIV = CallbackDispatcher; |
|
30
|
|
|
|
|
|
|
using cdVIref = CallbackDispatcher; |
|
31
|
|
|
|
|
|
|
using cdVPtrref = CallbackDispatcher&)>; |
|
32
|
|
|
|
|
|
|
using cdVV = CallbackDispatcher; |
|
33
|
|
|
|
|
|
|
using cdPtrPtr = CallbackDispatcher, iptr)>; |
|
34
|
|
|
|
|
|
|
using cdNoTm = CallbackDispatcher; |
|
35
|
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
struct DispatchingObject { |
|
37
|
|
|
|
|
|
|
cdVS vs; |
|
38
|
|
|
|
|
|
|
cdIV iv; |
|
39
|
|
|
|
|
|
|
cdVIref viref; |
|
40
|
|
|
|
|
|
|
cdVPtrref vptrref; |
|
41
|
|
|
|
|
|
|
cdIS is; |
|
42
|
|
|
|
|
|
|
cdVV vv; |
|
43
|
|
|
|
|
|
|
cdNoTm notm; |
|
44
|
|
|
|
|
|
|
cdPtrPtr ptrptr; |
|
45
|
|
|
|
|
|
|
}; |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
namespace xs { |
|
48
|
|
|
|
|
|
|
template struct Typemap : TypemapObject { |
|
49
|
|
|
|
|
|
|
static panda::string_view package () { return "MyTest::DispatchingObject"; } |
|
50
|
|
|
|
|
|
|
}; |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
template struct Typemap : TypemapObject { |
|
53
|
|
|
|
|
|
|
static panda::string_view package () { return "MyTest::SomeClass"; } |
|
54
|
|
|
|
|
|
|
}; |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
template struct Typemap : TypemapObject { |
|
57
|
|
|
|
|
|
|
static panda::string_view package () { return "MyTest::SomeClass2"; } |
|
58
|
|
|
|
|
|
|
}; |
|
59
|
|
|
|
|
|
|
} |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
#line 62 "t/typemap/callback_dispatcher_xsgen.cc" |
|
62
|
|
|
|
|
|
|
#ifndef PERL_UNUSED_VAR |
|
63
|
|
|
|
|
|
|
# define PERL_UNUSED_VAR(var) if (0) var = var |
|
64
|
|
|
|
|
|
|
#endif |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
#ifndef dVAR |
|
67
|
|
|
|
|
|
|
# define dVAR dNOOP |
|
68
|
|
|
|
|
|
|
#endif |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
/* This stuff is not part of the API! You have been warned. */ |
|
72
|
|
|
|
|
|
|
#ifndef PERL_VERSION_DECIMAL |
|
73
|
|
|
|
|
|
|
# define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s) |
|
74
|
|
|
|
|
|
|
#endif |
|
75
|
|
|
|
|
|
|
#ifndef PERL_DECIMAL_VERSION |
|
76
|
|
|
|
|
|
|
# define PERL_DECIMAL_VERSION \ |
|
77
|
|
|
|
|
|
|
PERL_VERSION_DECIMAL(PERL_REVISION,PERL_VERSION,PERL_SUBVERSION) |
|
78
|
|
|
|
|
|
|
#endif |
|
79
|
|
|
|
|
|
|
#ifndef PERL_VERSION_GE |
|
80
|
|
|
|
|
|
|
# define PERL_VERSION_GE(r,v,s) \ |
|
81
|
|
|
|
|
|
|
(PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s)) |
|
82
|
|
|
|
|
|
|
#endif |
|
83
|
|
|
|
|
|
|
#ifndef PERL_VERSION_LE |
|
84
|
|
|
|
|
|
|
# define PERL_VERSION_LE(r,v,s) \ |
|
85
|
|
|
|
|
|
|
(PERL_DECIMAL_VERSION <= PERL_VERSION_DECIMAL(r,v,s)) |
|
86
|
|
|
|
|
|
|
#endif |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
/* XS_INTERNAL is the explicit static-linkage variant of the default |
|
89
|
|
|
|
|
|
|
* XS macro. |
|
90
|
|
|
|
|
|
|
* |
|
91
|
|
|
|
|
|
|
* XS_EXTERNAL is the same as XS_INTERNAL except it does not include |
|
92
|
|
|
|
|
|
|
* "STATIC", ie. it exports XSUB symbols. You probably don't want that |
|
93
|
|
|
|
|
|
|
* for anything but the BOOT XSUB. |
|
94
|
|
|
|
|
|
|
* |
|
95
|
|
|
|
|
|
|
* See XSUB.h in core! |
|
96
|
|
|
|
|
|
|
*/ |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
/* TODO: This might be compatible further back than 5.10.0. */ |
|
100
|
|
|
|
|
|
|
#if PERL_VERSION_GE(5, 10, 0) && PERL_VERSION_LE(5, 15, 1) |
|
101
|
|
|
|
|
|
|
# undef XS_EXTERNAL |
|
102
|
|
|
|
|
|
|
# undef XS_INTERNAL |
|
103
|
|
|
|
|
|
|
# if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING) |
|
104
|
|
|
|
|
|
|
# define XS_EXTERNAL(name) __declspec(dllexport) XSPROTO(name) |
|
105
|
|
|
|
|
|
|
# define XS_INTERNAL(name) STATIC XSPROTO(name) |
|
106
|
|
|
|
|
|
|
# endif |
|
107
|
|
|
|
|
|
|
# if defined(__SYMBIAN32__) |
|
108
|
|
|
|
|
|
|
# define XS_EXTERNAL(name) EXPORT_C XSPROTO(name) |
|
109
|
|
|
|
|
|
|
# define XS_INTERNAL(name) EXPORT_C STATIC XSPROTO(name) |
|
110
|
|
|
|
|
|
|
# endif |
|
111
|
|
|
|
|
|
|
# ifndef XS_EXTERNAL |
|
112
|
|
|
|
|
|
|
# if defined(HASATTRIBUTE_UNUSED) && !defined(__cplusplus) |
|
113
|
|
|
|
|
|
|
# define XS_EXTERNAL(name) void name(pTHX_ CV* cv __attribute__unused__) |
|
114
|
|
|
|
|
|
|
# define XS_INTERNAL(name) STATIC void name(pTHX_ CV* cv __attribute__unused__) |
|
115
|
|
|
|
|
|
|
# else |
|
116
|
|
|
|
|
|
|
# ifdef __cplusplus |
|
117
|
|
|
|
|
|
|
# define XS_EXTERNAL(name) extern "C" XSPROTO(name) |
|
118
|
|
|
|
|
|
|
# define XS_INTERNAL(name) static XSPROTO(name) |
|
119
|
|
|
|
|
|
|
# else |
|
120
|
|
|
|
|
|
|
# define XS_EXTERNAL(name) XSPROTO(name) |
|
121
|
|
|
|
|
|
|
# define XS_INTERNAL(name) STATIC XSPROTO(name) |
|
122
|
|
|
|
|
|
|
# endif |
|
123
|
|
|
|
|
|
|
# endif |
|
124
|
|
|
|
|
|
|
# endif |
|
125
|
|
|
|
|
|
|
#endif |
|
126
|
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
/* perl >= 5.10.0 && perl <= 5.15.1 */ |
|
128
|
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
/* The XS_EXTERNAL macro is used for functions that must not be static |
|
131
|
|
|
|
|
|
|
* like the boot XSUB of a module. If perl didn't have an XS_EXTERNAL |
|
132
|
|
|
|
|
|
|
* macro defined, the best we can do is assume XS is the same. |
|
133
|
|
|
|
|
|
|
* Dito for XS_INTERNAL. |
|
134
|
|
|
|
|
|
|
*/ |
|
135
|
|
|
|
|
|
|
#ifndef XS_EXTERNAL |
|
136
|
|
|
|
|
|
|
# define XS_EXTERNAL(name) XS(name) |
|
137
|
|
|
|
|
|
|
#endif |
|
138
|
|
|
|
|
|
|
#ifndef XS_INTERNAL |
|
139
|
|
|
|
|
|
|
# define XS_INTERNAL(name) XS(name) |
|
140
|
|
|
|
|
|
|
#endif |
|
141
|
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
/* Now, finally, after all this mess, we want an ExtUtils::ParseXS |
|
143
|
|
|
|
|
|
|
* internal macro that we're free to redefine for varying linkage due |
|
144
|
|
|
|
|
|
|
* to the EXPORT_XSUB_SYMBOLS XS keyword. This is internal, use |
|
145
|
|
|
|
|
|
|
* XS_EXTERNAL(name) or XS_INTERNAL(name) in your code if you need to! |
|
146
|
|
|
|
|
|
|
*/ |
|
147
|
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
#undef XS_EUPXS |
|
149
|
|
|
|
|
|
|
#if defined(PERL_EUPXS_ALWAYS_EXPORT) |
|
150
|
|
|
|
|
|
|
# define XS_EUPXS(name) XS_EXTERNAL(name) |
|
151
|
|
|
|
|
|
|
#else |
|
152
|
|
|
|
|
|
|
/* default to internal */ |
|
153
|
|
|
|
|
|
|
# define XS_EUPXS(name) XS_INTERNAL(name) |
|
154
|
|
|
|
|
|
|
#endif |
|
155
|
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
#ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE |
|
157
|
|
|
|
|
|
|
#define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params) |
|
158
|
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
/* prototype to pass -Wmissing-prototypes */ |
|
160
|
|
|
|
|
|
|
STATIC void |
|
161
|
|
|
|
|
|
|
S_croak_xs_usage(const CV *const cv, const char *const params); |
|
162
|
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
STATIC void |
|
164
|
|
|
|
|
|
|
S_croak_xs_usage(const CV *const cv, const char *const params) |
|
165
|
|
|
|
|
|
|
{ |
|
166
|
|
|
|
|
|
|
const GV *const gv = CvGV(cv); |
|
167
|
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
PERL_ARGS_ASSERT_CROAK_XS_USAGE; |
|
169
|
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
if (gv) { |
|
171
|
|
|
|
|
|
|
const char *const gvname = GvNAME(gv); |
|
172
|
|
|
|
|
|
|
const HV *const stash = GvSTASH(gv); |
|
173
|
|
|
|
|
|
|
const char *const hvname = stash ? HvNAME(stash) : NULL; |
|
174
|
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
if (hvname) |
|
176
|
|
|
|
|
|
|
Perl_croak_nocontext("Usage: %s::%s(%s)", hvname, gvname, params); |
|
177
|
|
|
|
|
|
|
else |
|
178
|
|
|
|
|
|
|
Perl_croak_nocontext("Usage: %s(%s)", gvname, params); |
|
179
|
|
|
|
|
|
|
} else { |
|
180
|
|
|
|
|
|
|
/* Pants. I don't think that it should be possible to get here. */ |
|
181
|
|
|
|
|
|
|
Perl_croak_nocontext("Usage: CODE(0x%" UVxf ")(%s)", PTR2UV(cv), params); |
|
182
|
|
|
|
|
|
|
} |
|
183
|
|
|
|
|
|
|
} |
|
184
|
|
|
|
|
|
|
#undef PERL_ARGS_ASSERT_CROAK_XS_USAGE |
|
185
|
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
#define croak_xs_usage S_croak_xs_usage |
|
187
|
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
#endif |
|
189
|
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
/* NOTE: the prototype of newXSproto() is different in versions of perls, |
|
191
|
|
|
|
|
|
|
* so we define a portable version of newXSproto() |
|
192
|
|
|
|
|
|
|
*/ |
|
193
|
|
|
|
|
|
|
#ifdef newXS_flags |
|
194
|
|
|
|
|
|
|
#define newXSproto_portable(name, c_impl, file, proto) newXS_flags(name, c_impl, file, proto, 0) |
|
195
|
|
|
|
|
|
|
#else |
|
196
|
|
|
|
|
|
|
#define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv) |
|
197
|
|
|
|
|
|
|
#endif /* !defined(newXS_flags) */ |
|
198
|
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
#if PERL_VERSION_LE(5, 21, 5) |
|
200
|
|
|
|
|
|
|
# define newXS_deffile(a,b) Perl_newXS(aTHX_ a,b,file) |
|
201
|
|
|
|
|
|
|
#else |
|
202
|
|
|
|
|
|
|
# define newXS_deffile(a,b) Perl_newXS_deffile(aTHX_ a,b) |
|
203
|
|
|
|
|
|
|
#endif |
|
204
|
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
#line 206 "t/typemap/callback_dispatcher_xsgen.cc" |
|
206
|
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
|
|
208
|
2
|
|
|
|
|
|
XS_EUPXS(XS_MyTest__DispatchingObject_new) { xs::throw_guard(cv, [=]() |
|
209
|
|
|
|
|
|
|
{ |
|
210
|
1
|
|
|
|
|
|
dVAR; dXSARGS; |
|
211
|
1
|
50
|
|
|
|
|
if (items != 1) |
|
212
|
0
|
|
|
|
|
|
croak_xs_usage(cv, "SV*"); |
|
213
|
|
|
|
|
|
|
{ |
|
214
|
|
|
|
|
|
|
DispatchingObject * RETVAL; |
|
215
|
|
|
|
|
|
|
#line 55 "t/typemap/callback_dispatcher.xs" |
|
216
|
|
|
|
|
|
|
xs::Sv PROTO; PERL_UNUSED_VAR(PROTO); |
|
217
|
|
|
|
|
|
|
RETVAL = new DispatchingObject(); |
|
218
|
|
|
|
|
|
|
#line 219 "t/typemap/callback_dispatcher_xsgen.cc" |
|
219
|
|
|
|
|
|
|
{ |
|
220
|
|
|
|
|
|
|
SV * RETVALSV; |
|
221
|
1
|
50
|
|
|
|
|
RETVALSV = xs::out(RETVAL, PROTO).detach(); |
|
222
|
1
|
50
|
|
|
|
|
RETVALSV = sv_2mortal(RETVALSV); |
|
223
|
1
|
|
|
|
|
|
ST(0) = RETVALSV; |
|
224
|
|
|
|
|
|
|
} |
|
225
|
|
|
|
|
|
|
} |
|
226
|
1
|
|
|
|
|
|
XSRETURN(1); |
|
227
|
1
|
50
|
|
|
|
|
}); } |
|
228
|
|
|
|
|
|
|
|
|
229
|
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
|
|
231
|
110
|
|
|
|
|
|
XS_EUPXS(XS_MyTest__DispatchingObject_vs) { xs::throw_guard(cv, [=]() |
|
232
|
|
|
|
|
|
|
{ |
|
233
|
55
|
|
|
|
|
|
dVAR; dXSARGS; |
|
234
|
55
|
50
|
|
|
|
|
if (items < 1 || items > 2) |
|
|
|
50
|
|
|
|
|
|
|
235
|
0
|
|
|
|
|
|
croak_xs_usage(cv, "THIS, type= string_view()"); |
|
236
|
|
|
|
|
|
|
{ |
|
237
|
|
|
|
|
|
|
XSCallbackDispatcher * RETVAL; |
|
238
|
55
|
50
|
|
|
|
|
DispatchingObject* THIS = xs::in(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; |
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
; |
|
240
|
55
|
|
|
|
|
|
string_view type; |
|
241
|
|
|
|
|
|
|
|
|
242
|
55
|
100
|
|
|
|
|
if (items < 2) |
|
243
|
48
|
|
|
|
|
|
type = string_view(); |
|
244
|
|
|
|
|
|
|
else { |
|
245
|
|
|
|
|
|
|
{ STRLEN __type_len; |
|
246
|
7
|
50
|
|
|
|
|
const char* __type_buf = SvPV(ST(1), __type_len); |
|
|
|
0
|
|
|
|
|
|
|
247
|
7
|
|
|
|
|
|
type = decltype(type)(__type_buf, __type_len); } |
|
248
|
|
|
|
|
|
|
; |
|
249
|
|
|
|
|
|
|
} |
|
250
|
|
|
|
|
|
|
#line 58 "t/typemap/callback_dispatcher.xs" |
|
251
|
|
|
|
|
|
|
xs::Sv PROTO; PERL_UNUSED_VAR(PROTO); |
|
252
|
|
|
|
|
|
|
if (type == "") |
|
253
|
|
|
|
|
|
|
RETVAL = XSCallbackDispatcher::create(THIS->vs); |
|
254
|
|
|
|
|
|
|
else if (type == "nullptr") |
|
255
|
|
|
|
|
|
|
RETVAL = XSCallbackDispatcher::create(THIS->vs, nullptr); |
|
256
|
|
|
|
|
|
|
else if (type == "pair_inout") |
|
257
|
|
|
|
|
|
|
RETVAL = XSCallbackDispatcher::create(THIS->vs, std::make_pair( |
|
258
|
|
|
|
|
|
|
[](string str) { return Simple(str + " custom_out"); }, |
|
259
|
|
|
|
|
|
|
[](const Sv& sv) { return xs::in(sv) + " custom_in"; } |
|
260
|
|
|
|
|
|
|
)); |
|
261
|
|
|
|
|
|
|
else if (type == "pair_out") |
|
262
|
|
|
|
|
|
|
RETVAL = XSCallbackDispatcher::create(THIS->vs, std::make_pair( |
|
263
|
|
|
|
|
|
|
[](string str) { return Simple(str + " custom_out"); }, |
|
264
|
|
|
|
|
|
|
nullptr |
|
265
|
|
|
|
|
|
|
)); |
|
266
|
|
|
|
|
|
|
else if (type == "pair_in") |
|
267
|
|
|
|
|
|
|
RETVAL = XSCallbackDispatcher::create(THIS->vs, std::make_pair( |
|
268
|
|
|
|
|
|
|
nullptr, |
|
269
|
|
|
|
|
|
|
[](const Sv& sv) { return xs::in(sv) + " custom_in"; } |
|
270
|
|
|
|
|
|
|
)); |
|
271
|
|
|
|
|
|
|
else throw "wtf"; |
|
272
|
|
|
|
|
|
|
#line 273 "t/typemap/callback_dispatcher_xsgen.cc" |
|
273
|
|
|
|
|
|
|
{ |
|
274
|
|
|
|
|
|
|
SV * RETVALSV; |
|
275
|
55
|
50
|
|
|
|
|
RETVALSV = xs::out(RETVAL, PROTO).detach(); |
|
276
|
55
|
50
|
|
|
|
|
RETVALSV = sv_2mortal(RETVALSV); |
|
277
|
55
|
|
|
|
|
|
ST(0) = RETVALSV; |
|
278
|
|
|
|
|
|
|
} |
|
279
|
|
|
|
|
|
|
} |
|
280
|
55
|
|
|
|
|
|
XSRETURN(1); |
|
281
|
55
|
50
|
|
|
|
|
}); } |
|
282
|
|
|
|
|
|
|
|
|
283
|
|
|
|
|
|
|
|
|
284
|
|
|
|
|
|
|
|
|
285
|
36
|
|
|
|
|
|
XS_EUPXS(XS_MyTest__DispatchingObject_iv) { xs::throw_guard(cv, [=]() |
|
286
|
|
|
|
|
|
|
{ |
|
287
|
18
|
|
|
|
|
|
dVAR; dXSARGS; |
|
288
|
18
|
50
|
|
|
|
|
if (items != 1) |
|
289
|
0
|
|
|
|
|
|
croak_xs_usage(cv, "THIS"); |
|
290
|
|
|
|
|
|
|
{ |
|
291
|
|
|
|
|
|
|
cdIV * RETVAL; |
|
292
|
18
|
50
|
|
|
|
|
DispatchingObject* THIS = xs::in(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; |
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
; |
|
294
|
|
|
|
|
|
|
#line 81 "t/typemap/callback_dispatcher.xs" |
|
295
|
|
|
|
|
|
|
xs::Sv PROTO; PERL_UNUSED_VAR(PROTO); |
|
296
|
|
|
|
|
|
|
RETVAL = &THIS->iv; |
|
297
|
|
|
|
|
|
|
#line 298 "t/typemap/callback_dispatcher_xsgen.cc" |
|
298
|
|
|
|
|
|
|
{ |
|
299
|
|
|
|
|
|
|
SV * RETVALSV; |
|
300
|
18
|
50
|
|
|
|
|
RETVALSV = xs::out(RETVAL, PROTO).detach(); |
|
301
|
18
|
50
|
|
|
|
|
RETVALSV = sv_2mortal(RETVALSV); |
|
302
|
18
|
|
|
|
|
|
ST(0) = RETVALSV; |
|
303
|
|
|
|
|
|
|
} |
|
304
|
|
|
|
|
|
|
} |
|
305
|
18
|
|
|
|
|
|
XSRETURN(1); |
|
306
|
18
|
50
|
|
|
|
|
}); } |
|
307
|
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
|
|
310
|
4
|
|
|
|
|
|
XS_EUPXS(XS_MyTest__DispatchingObject_viref) { xs::throw_guard(cv, [=]() |
|
311
|
|
|
|
|
|
|
{ |
|
312
|
2
|
|
|
|
|
|
dVAR; dXSARGS; |
|
313
|
2
|
50
|
|
|
|
|
if (items != 1) |
|
314
|
0
|
|
|
|
|
|
croak_xs_usage(cv, "THIS"); |
|
315
|
|
|
|
|
|
|
{ |
|
316
|
|
|
|
|
|
|
XSCallbackDispatcher * RETVAL; |
|
317
|
2
|
50
|
|
|
|
|
DispatchingObject* THIS = xs::in(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; |
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
; |
|
319
|
|
|
|
|
|
|
#line 85 "t/typemap/callback_dispatcher.xs" |
|
320
|
|
|
|
|
|
|
xs::Sv PROTO; PERL_UNUSED_VAR(PROTO); |
|
321
|
|
|
|
|
|
|
RETVAL = XSCallbackDispatcher::create(THIS->viref, std::make_pair( |
|
322
|
|
|
|
|
|
|
[](const int& v) { return xs::out(v); }, |
|
323
|
|
|
|
|
|
|
[](const Sv& sv) { return xs::in(sv); } |
|
324
|
|
|
|
|
|
|
)); |
|
325
|
|
|
|
|
|
|
#line 326 "t/typemap/callback_dispatcher_xsgen.cc" |
|
326
|
|
|
|
|
|
|
{ |
|
327
|
|
|
|
|
|
|
SV * RETVALSV; |
|
328
|
2
|
50
|
|
|
|
|
RETVALSV = xs::out(RETVAL, PROTO).detach(); |
|
329
|
2
|
50
|
|
|
|
|
RETVALSV = sv_2mortal(RETVALSV); |
|
330
|
2
|
|
|
|
|
|
ST(0) = RETVALSV; |
|
331
|
|
|
|
|
|
|
} |
|
332
|
|
|
|
|
|
|
} |
|
333
|
2
|
|
|
|
|
|
XSRETURN(1); |
|
334
|
2
|
50
|
|
|
|
|
}); } |
|
335
|
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
|
|
338
|
0
|
|
|
|
|
|
XS_EUPXS(XS_MyTest__DispatchingObject_vptrref) { xs::throw_guard(cv, [=]() |
|
339
|
|
|
|
|
|
|
{ |
|
340
|
0
|
|
|
|
|
|
dVAR; dXSARGS; |
|
341
|
0
|
0
|
|
|
|
|
if (items != 1) |
|
342
|
0
|
|
|
|
|
|
croak_xs_usage(cv, "THIS"); |
|
343
|
|
|
|
|
|
|
{ |
|
344
|
|
|
|
|
|
|
cdVPtrref * RETVAL; |
|
345
|
0
|
0
|
|
|
|
|
DispatchingObject* THIS = xs::in(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
346
|
|
|
|
|
|
|
; |
|
347
|
|
|
|
|
|
|
#line 92 "t/typemap/callback_dispatcher.xs" |
|
348
|
|
|
|
|
|
|
xs::Sv PROTO; PERL_UNUSED_VAR(PROTO); |
|
349
|
|
|
|
|
|
|
RETVAL = &THIS->vptrref; |
|
350
|
|
|
|
|
|
|
#line 351 "t/typemap/callback_dispatcher_xsgen.cc" |
|
351
|
|
|
|
|
|
|
{ |
|
352
|
|
|
|
|
|
|
SV * RETVALSV; |
|
353
|
0
|
0
|
|
|
|
|
RETVALSV = xs::out(RETVAL, PROTO).detach(); |
|
354
|
0
|
0
|
|
|
|
|
RETVALSV = sv_2mortal(RETVALSV); |
|
355
|
0
|
|
|
|
|
|
ST(0) = RETVALSV; |
|
356
|
|
|
|
|
|
|
} |
|
357
|
|
|
|
|
|
|
} |
|
358
|
0
|
|
|
|
|
|
XSRETURN(1); |
|
359
|
0
|
0
|
|
|
|
|
}); } |
|
360
|
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
|
|
363
|
28
|
|
|
|
|
|
XS_EUPXS(XS_MyTest__DispatchingObject_is) { xs::throw_guard(cv, [=]() |
|
364
|
|
|
|
|
|
|
{ |
|
365
|
14
|
|
|
|
|
|
dVAR; dXSARGS; |
|
366
|
14
|
50
|
|
|
|
|
if (items < 1 || items > 2) |
|
|
|
50
|
|
|
|
|
|
|
367
|
0
|
|
|
|
|
|
croak_xs_usage(cv, "THIS, type= string_view()"); |
|
368
|
|
|
|
|
|
|
{ |
|
369
|
|
|
|
|
|
|
XSCallbackDispatcher * RETVAL; |
|
370
|
14
|
50
|
|
|
|
|
DispatchingObject* THIS = xs::in(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; |
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
371
|
|
|
|
|
|
|
; |
|
372
|
14
|
|
|
|
|
|
string_view type; |
|
373
|
|
|
|
|
|
|
|
|
374
|
14
|
100
|
|
|
|
|
if (items < 2) |
|
375
|
8
|
|
|
|
|
|
type = string_view(); |
|
376
|
|
|
|
|
|
|
else { |
|
377
|
|
|
|
|
|
|
{ STRLEN __type_len; |
|
378
|
6
|
50
|
|
|
|
|
const char* __type_buf = SvPV(ST(1), __type_len); |
|
|
|
0
|
|
|
|
|
|
|
379
|
6
|
|
|
|
|
|
type = decltype(type)(__type_buf, __type_len); } |
|
380
|
|
|
|
|
|
|
; |
|
381
|
|
|
|
|
|
|
} |
|
382
|
|
|
|
|
|
|
#line 96 "t/typemap/callback_dispatcher.xs" |
|
383
|
|
|
|
|
|
|
xs::Sv PROTO; PERL_UNUSED_VAR(PROTO); |
|
384
|
|
|
|
|
|
|
if (type == "") |
|
385
|
|
|
|
|
|
|
RETVAL = XSCallbackDispatcher::create(THIS->is); |
|
386
|
|
|
|
|
|
|
else if (type == "nullptr") |
|
387
|
|
|
|
|
|
|
RETVAL = XSCallbackDispatcher::create(THIS->is, nullptr); |
|
388
|
|
|
|
|
|
|
else if (type == "ret_inout") |
|
389
|
|
|
|
|
|
|
RETVAL = XSCallbackDispatcher::create(THIS->is, std::make_pair( |
|
390
|
|
|
|
|
|
|
[](panda::optional val) { return val ? Simple(*val + 100) : Simple::undef; }, |
|
391
|
|
|
|
|
|
|
[](const Sv& sv) { return xs::in(sv) + 10; } |
|
392
|
|
|
|
|
|
|
)); |
|
393
|
|
|
|
|
|
|
else if (type == "ret_arg_inout") |
|
394
|
|
|
|
|
|
|
RETVAL = XSCallbackDispatcher::create(THIS->is, std::make_pair( |
|
395
|
|
|
|
|
|
|
[](panda::optional val) { return val ? Simple(*val + 100) : Simple::undef; }, |
|
396
|
|
|
|
|
|
|
[](const Sv& sv) { return xs::in(sv) + 10; } |
|
397
|
|
|
|
|
|
|
), std::make_pair( |
|
398
|
|
|
|
|
|
|
[](string str) { return Simple(str + " custom_out"); }, |
|
399
|
|
|
|
|
|
|
[](const Sv& sv) { return xs::in(sv) + " custom_in"; } |
|
400
|
|
|
|
|
|
|
)); |
|
401
|
|
|
|
|
|
|
else throw "wtf"; |
|
402
|
|
|
|
|
|
|
#line 403 "t/typemap/callback_dispatcher_xsgen.cc" |
|
403
|
|
|
|
|
|
|
{ |
|
404
|
|
|
|
|
|
|
SV * RETVALSV; |
|
405
|
14
|
50
|
|
|
|
|
RETVALSV = xs::out(RETVAL, PROTO).detach(); |
|
406
|
14
|
50
|
|
|
|
|
RETVALSV = sv_2mortal(RETVALSV); |
|
407
|
14
|
|
|
|
|
|
ST(0) = RETVALSV; |
|
408
|
|
|
|
|
|
|
} |
|
409
|
|
|
|
|
|
|
} |
|
410
|
14
|
|
|
|
|
|
XSRETURN(1); |
|
411
|
14
|
50
|
|
|
|
|
}); } |
|
412
|
|
|
|
|
|
|
|
|
413
|
|
|
|
|
|
|
|
|
414
|
|
|
|
|
|
|
|
|
415
|
16
|
|
|
|
|
|
XS_EUPXS(XS_MyTest__DispatchingObject_vv) { xs::throw_guard(cv, [=]() |
|
416
|
|
|
|
|
|
|
{ |
|
417
|
8
|
|
|
|
|
|
dVAR; dXSARGS; |
|
418
|
8
|
50
|
|
|
|
|
if (items != 1) |
|
419
|
0
|
|
|
|
|
|
croak_xs_usage(cv, "THIS"); |
|
420
|
|
|
|
|
|
|
{ |
|
421
|
|
|
|
|
|
|
cdVV * RETVAL; |
|
422
|
8
|
50
|
|
|
|
|
DispatchingObject* THIS = xs::in(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; |
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
423
|
|
|
|
|
|
|
; |
|
424
|
|
|
|
|
|
|
#line 117 "t/typemap/callback_dispatcher.xs" |
|
425
|
|
|
|
|
|
|
xs::Sv PROTO; PERL_UNUSED_VAR(PROTO); |
|
426
|
|
|
|
|
|
|
RETVAL = &THIS->vv; |
|
427
|
|
|
|
|
|
|
#line 428 "t/typemap/callback_dispatcher_xsgen.cc" |
|
428
|
|
|
|
|
|
|
{ |
|
429
|
|
|
|
|
|
|
SV * RETVALSV; |
|
430
|
8
|
50
|
|
|
|
|
RETVALSV = xs::out(RETVAL, PROTO).detach(); |
|
431
|
8
|
50
|
|
|
|
|
RETVALSV = sv_2mortal(RETVALSV); |
|
432
|
8
|
|
|
|
|
|
ST(0) = RETVALSV; |
|
433
|
|
|
|
|
|
|
} |
|
434
|
|
|
|
|
|
|
} |
|
435
|
8
|
|
|
|
|
|
XSRETURN(1); |
|
436
|
8
|
50
|
|
|
|
|
}); } |
|
437
|
|
|
|
|
|
|
|
|
438
|
|
|
|
|
|
|
|
|
439
|
|
|
|
|
|
|
|
|
440
|
8
|
|
|
|
|
|
XS_EUPXS(XS_MyTest__DispatchingObject_notm) { xs::throw_guard(cv, [=]() |
|
441
|
|
|
|
|
|
|
{ |
|
442
|
4
|
|
|
|
|
|
dVAR; dXSARGS; |
|
443
|
4
|
50
|
|
|
|
|
if (items != 1) |
|
444
|
0
|
|
|
|
|
|
croak_xs_usage(cv, "THIS"); |
|
445
|
|
|
|
|
|
|
{ |
|
446
|
|
|
|
|
|
|
XSCallbackDispatcher * RETVAL; |
|
447
|
4
|
50
|
|
|
|
|
DispatchingObject* THIS = xs::in(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; |
|
|
|
50
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
448
|
|
|
|
|
|
|
; |
|
449
|
|
|
|
|
|
|
#line 121 "t/typemap/callback_dispatcher.xs" |
|
450
|
|
|
|
|
|
|
xs::Sv PROTO; PERL_UNUSED_VAR(PROTO); |
|
451
|
|
|
|
|
|
|
auto caster = std::make_pair( |
|
452
|
|
|
|
|
|
|
[](panda::optional a) { return a ? Simple(a.value().val + "o") : Simple::undef; }, |
|
453
|
|
|
|
|
|
|
[](const Sv& arg) { return NoTmStruct { xs::in(arg) + "i" }; } |
|
454
|
|
|
|
|
|
|
); |
|
455
|
|
|
|
|
|
|
RETVAL = XSCallbackDispatcher::create(THIS->notm, caster, caster); |
|
456
|
|
|
|
|
|
|
#line 457 "t/typemap/callback_dispatcher_xsgen.cc" |
|
457
|
|
|
|
|
|
|
{ |
|
458
|
|
|
|
|
|
|
SV * RETVALSV; |
|
459
|
4
|
50
|
|
|
|
|
RETVALSV = xs::out(RETVAL, PROTO).detach(); |
|
460
|
4
|
50
|
|
|
|
|
RETVALSV = sv_2mortal(RETVALSV); |
|
461
|
4
|
|
|
|
|
|
ST(0) = RETVALSV; |
|
462
|
|
|
|
|
|
|
} |
|
463
|
|
|
|
|
|
|
} |
|
464
|
4
|
|
|
|
|
|
XSRETURN(1); |
|
465
|
4
|
50
|
|
|
|
|
}); } |
|
466
|
|
|
|
|
|
|
|
|
467
|
|
|
|
|
|
|
|
|
468
|
|
|
|
|
|
|
|
|
469
|
0
|
|
|
|
|
|
XS_EUPXS(XS_MyTest__DispatchingObject_ptrptr) { xs::throw_guard(cv, [=]() |
|
470
|
|
|
|
|
|
|
{ |
|
471
|
0
|
|
|
|
|
|
dVAR; dXSARGS; |
|
472
|
0
|
0
|
|
|
|
|
if (items != 1) |
|
473
|
0
|
|
|
|
|
|
croak_xs_usage(cv, "THIS"); |
|
474
|
|
|
|
|
|
|
{ |
|
475
|
|
|
|
|
|
|
cdPtrPtr * RETVAL; |
|
476
|
0
|
0
|
|
|
|
|
DispatchingObject* THIS = xs::in(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; |
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
477
|
|
|
|
|
|
|
; |
|
478
|
|
|
|
|
|
|
#line 129 "t/typemap/callback_dispatcher.xs" |
|
479
|
|
|
|
|
|
|
xs::Sv PROTO; PERL_UNUSED_VAR(PROTO); |
|
480
|
|
|
|
|
|
|
RETVAL = &THIS->ptrptr; |
|
481
|
|
|
|
|
|
|
#line 482 "t/typemap/callback_dispatcher_xsgen.cc" |
|
482
|
|
|
|
|
|
|
{ |
|
483
|
|
|
|
|
|
|
SV * RETVALSV; |
|
484
|
0
|
0
|
|
|
|
|
RETVALSV = xs::out(RETVAL, PROTO).detach(); |
|
485
|
0
|
0
|
|
|
|
|
RETVALSV = sv_2mortal(RETVALSV); |
|
486
|
0
|
|
|
|
|
|
ST(0) = RETVALSV; |
|
487
|
|
|
|
|
|
|
} |
|
488
|
|
|
|
|
|
|
} |
|
489
|
0
|
|
|
|
|
|
XSRETURN(1); |
|
490
|
0
|
0
|
|
|
|
|
}); } |
|
491
|
|
|
|
|
|
|
|
|
492
|
|
|
|
|
|
|
#ifdef __cplusplus |
|
493
|
|
|
|
|
|
|
extern "C" |
|
494
|
|
|
|
|
|
|
#endif |
|
495
|
|
|
|
|
|
|
|
|
496
|
68
|
|
|
|
|
|
XS_EXTERNAL(boot_MyTest__Typemap__CD) { xs::throw_guard(cv, [=]() mutable |
|
497
|
|
|
|
|
|
|
{ |
|
498
|
|
|
|
|
|
|
#if PERL_VERSION_LE(5, 21, 5) |
|
499
|
|
|
|
|
|
|
dVAR; dXSARGS; |
|
500
|
|
|
|
|
|
|
#else |
|
501
|
34
|
50
|
|
|
|
|
dVAR; dXSBOOTARGSXSAPIVERCHK; |
|
|
|
50
|
|
|
|
|
|
|
502
|
|
|
|
|
|
|
#endif |
|
503
|
|
|
|
|
|
|
#if (PERL_REVISION == 5 && PERL_VERSION < 9) |
|
504
|
|
|
|
|
|
|
char* file = __FILE__; |
|
505
|
|
|
|
|
|
|
#else |
|
506
|
34
|
|
|
|
|
|
const char* file = __FILE__; |
|
507
|
|
|
|
|
|
|
#endif |
|
508
|
|
|
|
|
|
|
|
|
509
|
|
|
|
|
|
|
PERL_UNUSED_VAR(file); |
|
510
|
|
|
|
|
|
|
|
|
511
|
|
|
|
|
|
|
PERL_UNUSED_VAR(cv); /* -W */ |
|
512
|
|
|
|
|
|
|
PERL_UNUSED_VAR(items); /* -W */ |
|
513
|
|
|
|
|
|
|
#if PERL_VERSION_LE(5, 21, 5) |
|
514
|
|
|
|
|
|
|
XS_VERSION_BOOTCHECK; |
|
515
|
|
|
|
|
|
|
# ifdef XS_APIVERSION_BOOTCHECK |
|
516
|
|
|
|
|
|
|
XS_APIVERSION_BOOTCHECK; |
|
517
|
|
|
|
|
|
|
# endif |
|
518
|
|
|
|
|
|
|
#endif |
|
519
|
|
|
|
|
|
|
|
|
520
|
34
|
|
|
|
|
|
newXS_deffile("MyTest::DispatchingObject::new", XS_MyTest__DispatchingObject_new); |
|
521
|
34
|
|
|
|
|
|
newXS_deffile("MyTest::DispatchingObject::vs", XS_MyTest__DispatchingObject_vs); |
|
522
|
34
|
|
|
|
|
|
newXS_deffile("MyTest::DispatchingObject::iv", XS_MyTest__DispatchingObject_iv); |
|
523
|
34
|
|
|
|
|
|
newXS_deffile("MyTest::DispatchingObject::viref", XS_MyTest__DispatchingObject_viref); |
|
524
|
34
|
|
|
|
|
|
newXS_deffile("MyTest::DispatchingObject::vptrref", XS_MyTest__DispatchingObject_vptrref); |
|
525
|
34
|
|
|
|
|
|
newXS_deffile("MyTest::DispatchingObject::is", XS_MyTest__DispatchingObject_is); |
|
526
|
34
|
|
|
|
|
|
newXS_deffile("MyTest::DispatchingObject::vv", XS_MyTest__DispatchingObject_vv); |
|
527
|
34
|
|
|
|
|
|
newXS_deffile("MyTest::DispatchingObject::notm", XS_MyTest__DispatchingObject_notm); |
|
528
|
34
|
|
|
|
|
|
newXS_deffile("MyTest::DispatchingObject::ptrptr", XS_MyTest__DispatchingObject_ptrptr); |
|
529
|
|
|
|
|
|
|
#if PERL_VERSION_LE(5, 21, 5) |
|
530
|
|
|
|
|
|
|
# if PERL_VERSION_GE(5, 9, 0) |
|
531
|
|
|
|
|
|
|
if (PL_unitcheckav) |
|
532
|
|
|
|
|
|
|
call_list(PL_scopestack_ix, PL_unitcheckav); |
|
533
|
|
|
|
|
|
|
# endif |
|
534
|
|
|
|
|
|
|
XSRETURN_YES; |
|
535
|
|
|
|
|
|
|
#else |
|
536
|
34
|
|
|
|
|
|
Perl_xs_boot_epilog(aTHX_ ax); |
|
537
|
|
|
|
|
|
|
#endif |
|
538
|
34
|
50
|
|
|
|
|
}); } |
|
539
|
|
|
|
|
|
|
|