xs/main_xsgen.cc

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