xs/Date_xsgen.cc

filter: Statementstmt 84.1% 1011 / 1202 Branchbran 45.8% 449 / 980 Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a totaltotal 66.9% 1460 / 2182 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« xs/Date.xs ↑ Summary xs/main_xsgen.cc »
1 /*
2 * This file was generated automatically by XS::Install::FrozenShit::ParseXS version 3.57 from the
3 * contents of Date.xs. Do not edit this file, edit Date.xs instead.
4 *
5 * ANY CHANGES MADE HERE WILL BE LOST!
6 *
7 */
8  
9 #line 1 "xs/Date.xs"
10 #include <xs/date.h>
11 #include <xs/export.h>
12 #include "private.h"
13  
14 using namespace xs;
15 using namespace xs::date;
16 using panda::string;
17 using panda::string_view;
18  
19 #ifdef _WIN32
20 const auto LT_FORMAT = string_view("%a %b %d %H:%M:%S %Y");
21 #else
22 const auto LT_FORMAT = string_view("%a %b %e %H:%M:%S %Y");
23 #endif
24
25 // arguments overloading for new_ymd(), date_ymd(), ->set_ymd()
26 static inline Date xs_date_ymd (SV** args, I32 items) {
27 ptime_t vals[8] = {1970, 1, 1, 0, 0, 0, 0, -1};
28 auto tz = list2vals(args, items, vals);
29 auto ret = Date(vals[0], vals[1], vals[2], vals[3], vals[4], vals[5], vals[6], vals[7], tz);
30 if (ret.error() && is_strict_mode()) throw xs::out(ret.error());
31 return ret;
32 }
33  
34 #line 35 "xs/Date_xsgen.cc"
35 #ifndef PERL_UNUSED_VAR
36 # define PERL_UNUSED_VAR(var) if (0) var = var
37 #endif
38  
39 #ifndef dVAR
40 # define dVAR dNOOP
41 #endif
42  
43  
44 /* This stuff is not part of the API! You have been warned. */
45 #ifndef PERL_VERSION_DECIMAL
46 # define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s)
47 #endif
48 #ifndef PERL_DECIMAL_VERSION
49 # define PERL_DECIMAL_VERSION \
50 PERL_VERSION_DECIMAL(PERL_REVISION,PERL_VERSION,PERL_SUBVERSION)
51 #endif
52 #ifndef PERL_VERSION_GE
53 # define PERL_VERSION_GE(r,v,s) \
54 (PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s))
55 #endif
56 #ifndef PERL_VERSION_LE
57 # define PERL_VERSION_LE(r,v,s) \
58 (PERL_DECIMAL_VERSION <= PERL_VERSION_DECIMAL(r,v,s))
59 #endif
60  
61 /* XS_INTERNAL is the explicit static-linkage variant of the default
62 * XS macro.
63 *
64 * XS_EXTERNAL is the same as XS_INTERNAL except it does not include
65 * "STATIC", ie. it exports XSUB symbols. You probably don't want that
66 * for anything but the BOOT XSUB.
67 *
68 * See XSUB.h in core!
69 */
70  
71  
72 /* TODO: This might be compatible further back than 5.10.0. */
73 #if PERL_VERSION_GE(5, 10, 0) && PERL_VERSION_LE(5, 15, 1)
74 # undef XS_EXTERNAL
75 # undef XS_INTERNAL
76 # if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING)
77 # define XS_EXTERNAL(name) __declspec(dllexport) XSPROTO(name)
78 # define XS_INTERNAL(name) STATIC XSPROTO(name)
79 # endif
80 # if defined(__SYMBIAN32__)
81 # define XS_EXTERNAL(name) EXPORT_C XSPROTO(name)
82 # define XS_INTERNAL(name) EXPORT_C STATIC XSPROTO(name)
83 # endif
84 # ifndef XS_EXTERNAL
85 # if defined(HASATTRIBUTE_UNUSED) && !defined(__cplusplus)
86 # define XS_EXTERNAL(name) void name(pTHX_ CV* cv __attribute__unused__)
87 # define XS_INTERNAL(name) STATIC void name(pTHX_ CV* cv __attribute__unused__)
88 # else
89 # ifdef __cplusplus
90 # define XS_EXTERNAL(name) extern "C" XSPROTO(name)
91 # define XS_INTERNAL(name) static XSPROTO(name)
92 # else
93 # define XS_EXTERNAL(name) XSPROTO(name)
94 # define XS_INTERNAL(name) STATIC XSPROTO(name)
95 # endif
96 # endif
97 # endif
98 #endif
99  
100 /* perl >= 5.10.0 && perl <= 5.15.1 */
101  
102  
103 /* The XS_EXTERNAL macro is used for functions that must not be static
104 * like the boot XSUB of a module. If perl didn't have an XS_EXTERNAL
105 * macro defined, the best we can do is assume XS is the same.
106 * Dito for XS_INTERNAL.
107 */
108 #ifndef XS_EXTERNAL
109 # define XS_EXTERNAL(name) XS(name)
110 #endif
111 #ifndef XS_INTERNAL
112 # define XS_INTERNAL(name) XS(name)
113 #endif
114  
115 /* Now, finally, after all this mess, we want an XS::Install::FrozenShit::ParseXS
116 * internal macro that we're free to redefine for varying linkage due
117 * to the EXPORT_XSUB_SYMBOLS XS keyword. This is internal, use
118 * XS_EXTERNAL(name) or XS_INTERNAL(name) in your code if you need to!
119 */
120  
121 #undef XS_EUPXS
122 #if defined(PERL_EUPXS_ALWAYS_EXPORT)
123 # define XS_EUPXS(name) XS_EXTERNAL(name)
124 #else
125 /* default to internal */
126 # define XS_EUPXS(name) XS_INTERNAL(name)
127 #endif
128  
129 #ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE
130 #define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params)
131  
132 /* prototype to pass -Wmissing-prototypes */
133 STATIC void
134 S_croak_xs_usage(const CV *const cv, const char *const params);
135  
136 STATIC void
137 S_croak_xs_usage(const CV *const cv, const char *const params)
138 {
139 const GV *const gv = CvGV(cv);
140  
141 PERL_ARGS_ASSERT_CROAK_XS_USAGE;
142  
143 if (gv) {
144 const char *const gvname = GvNAME(gv);
145 const HV *const stash = GvSTASH(gv);
146 const char *const hvname = stash ? HvNAME(stash) : NULL;
147  
148 if (hvname)
149 Perl_croak_nocontext("Usage: %s::%s(%s)", hvname, gvname, params);
150 else
151 Perl_croak_nocontext("Usage: %s(%s)", gvname, params);
152 } else {
153 /* Pants. I don't think that it should be possible to get here. */
154 Perl_croak_nocontext("Usage: CODE(0x%" UVxf ")(%s)", PTR2UV(cv), params);
155 }
156 }
157 #undef PERL_ARGS_ASSERT_CROAK_XS_USAGE
158  
159 #define croak_xs_usage S_croak_xs_usage
160  
161 #endif
162  
163 /* NOTE: the prototype of newXSproto() is different in versions of perls,
164 * so we define a portable version of newXSproto()
165 */
166 #ifdef newXS_flags
167 #define newXSproto_portable(name, c_impl, file, proto) newXS_flags(name, c_impl, file, proto, 0)
168 #else
169 #define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv)
170 #endif /* !defined(newXS_flags) */
171  
172 #if PERL_VERSION_LE(5, 21, 5)
173 # define newXS_deffile(a,b) Perl_newXS(aTHX_ a,b,file)
174 #else
175 # define newXS_deffile(a,b) Perl_newXS_deffile(aTHX_ a,b)
176 #endif
177  
178 /* simple backcompat versions of the TARGx() macros with no optimisation */
179 #ifndef TARGi
180 # define TARGi(iv, do_taint) sv_setiv_mg(TARG, iv)
181 # define TARGu(uv, do_taint) sv_setuv_mg(TARG, uv)
182 # define TARGn(nv, do_taint) sv_setnv_mg(TARG, nv)
183 #endif
184  
185 #line 186 "xs/Date_xsgen.cc"
186  
187  
188 32 ▶XS_EUPXS(XS_Date_tzget) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_tzget) { xs::throw_guard(cv, [=]() 16 0 16
189 {
190 16 dVAR; dXSARGS;
191 16 ▶ if (items < 0 || items > 1)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 0 || items > 1) 16 0 16
if (items < 0 || items > 1) 0 16 16
192 0 croak_xs_usage(cv, "zonename= {}");
193 {
194 const Timezone * RETVAL;
195 16 string_view zonename;
196  
197 16 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 9 7 16
198 9 zonename = {};
199 else {
200 { STRLEN __zonename_len;
201 7 const char* __zonename_buf = SvPV(ST(0), __zonename_len);
202 7 zonename = decltype(zonename)(__zonename_buf, __zonename_len); }
203 ;
204 }
205 #line 68 "xs/Date.xs"
206 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
207 RETVAL = tzget(zonename);
208 #line 209 "xs/Date_xsgen.cc"
209 {
210 SV * RETVALSV;
211 16 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 16 0 16
212 16 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 16 0 16
213 16 ST(0) = RETVALSV;
214 }
215 16 }
216 16 XSRETURN(1);
217 16 }); }
218  
219  
220  
221 168 ▶XS_EUPXS(XS_Date_tzset) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_tzset) { xs::throw_guard(cv, [=]() 84 0 84
222 {
223 84 dVAR; dXSARGS;
224 84 ▶ if (items < 0 || items > 1)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 0 || items > 1) 84 0 84
if (items < 0 || items > 1) 0 84 84
225 0 croak_xs_usage(cv, "newzone= {}");
226 PERL_UNUSED_VAR(ax); /* -Wall */
227 84 SP -= items;
228 {
229 84 TimezoneSP newzone;
230  
231 84 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 2 82 84
232 2 newzone = {};
233 else {
234 82 ▶ newzone = xs::in<TimezoneSP>(ST(0));
Branch: 1 branch
BranchTrueFalseTotal
newzone = xs::in<TimezoneSP>(ST(0)); 82 0 82
235 ;
236 }
237 #line 70 "xs/Date.xs"
238 tzset(newzone);
239 #line 240 "xs/Date_xsgen.cc"
240 84 PUTBACK;
241 168 return;
242 84 }
243 84 }); }
244  
245  
246  
247 0 ▶XS_EUPXS(XS_Date_tzdir) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_tzdir) { xs::throw_guard(cv, [=]() 0 0 0
248 {
249 0 dVAR; dXSARGS;
250 0 ▶ if (items < 0 || items > 1)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 0 || items > 1) 0 0 0
if (items < 0 || items > 1) 0 0 0
251 0 croak_xs_usage(cv, "newdir= NULL");
252 {
253 0 string RETVAL;
254 0 ▶ dXSTARG;
Branch: 2 branches
BranchTrueFalseTotal
dXSTARG; 0 0 0
dXSTARG; 0 0 0
255 SV* newdir;
256  
257 0 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 0 0 0
258 0 newdir = NULL;
259 else {
260 0 newdir = ST(0)
261 ;
262 }
263 #line 73 "xs/Date.xs"
264 if (newdir) {
265 tzdir(xs::in<string>(newdir));
266 XSRETURN_UNDEF;
267 }
268 RETVAL = tzdir();
269 #line 270 "xs/Date_xsgen.cc"
270 0 ▶ sv_setpvn((SV*)TARG, RETVAL.data(), RETVAL.length());
Branch: 1 branch
BranchTrueFalseTotal
sv_setpvn((SV*)TARG, RETVAL.data(), RETVAL.length()); 0 0 0
271 0 ST(0) = TARG;
272 0 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 0 0
273 0 XSRETURN(1);
274 0 }); }
275  
276  
277  
278 96 ▶XS_EUPXS(XS_Date_tzsysdir) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_tzsysdir) { xs::throw_guard(cv, [=]() 48 0 48
279 {
280 48 dVAR; dXSARGS;
281 48 ▶ if (items != 0)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 0) 0 48 48
282 0 croak_xs_usage(cv, "");
283 {
284 48 string RETVAL;
285 48 ▶ dXSTARG;
Branch: 3 branches
BranchTrueFalseTotal
dXSTARG; 48 0 48
dXSTARG; 0 0 0
dXSTARG; 48 0 48
286 #line 80 "xs/Date.xs"
287 RETVAL = tzsysdir();
288 #line 289 "xs/Date_xsgen.cc"
289 48 ▶ sv_setpvn((SV*)TARG, RETVAL.data(), RETVAL.length());
Branch: 1 branch
BranchTrueFalseTotal
sv_setpvn((SV*)TARG, RETVAL.data(), RETVAL.length()); 48 0 48
290 48 ST(0) = TARG;
291 48 }
292 48 XSRETURN(1);
293 48 }); }
294  
295  
296  
297 204 ▶XS_EUPXS(XS_Date_tzembededdir) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_tzembededdir) { xs::throw_guard(cv, [=]() 102 0 102
298 {
299 102 dVAR; dXSARGS;
300 102 ▶ if (items < 0 || items > 1)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 0 || items > 1) 102 0 102
if (items < 0 || items > 1) 0 102 102
301 0 croak_xs_usage(cv, "newdir= NULL");
302 {
303 102 string RETVAL;
304 102 ▶ dXSTARG;
Branch: 2 branches
BranchTrueFalseTotal
dXSTARG; 102 0 102
dXSTARG; 0 0 0
305 SV* newdir;
306  
307 102 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 27 75 102
308 27 newdir = NULL;
309 else {
310 75 newdir = ST(0)
311 ;
312 }
313 #line 83 "xs/Date.xs"
314 if (newdir) {
315 tzembededdir(xs::in<string>(newdir));
316 XSRETURN_UNDEF;
317 }
318 RETVAL = tzembededdir();
319 #line 320 "xs/Date_xsgen.cc"
320 27 ▶ sv_setpvn((SV*)TARG, RETVAL.data(), RETVAL.length());
Branch: 1 branch
BranchTrueFalseTotal
sv_setpvn((SV*)TARG, RETVAL.data(), RETVAL.length()); 27 0 27
321 27 ST(0) = TARG;
322 102 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 27 75 102
323 27 XSRETURN(1);
324 102 }); }
325  
326  
327  
328 2 ▶XS_EUPXS(XS_Date_available_timezones) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_available_timezones) { xs::throw_guard(cv, [=]() 1 0 1
329 {
330 1 dVAR; dXSARGS;
331 1 ▶ if (items != 0)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 0) 0 1 1
332 0 croak_xs_usage(cv, "");
333 PERL_UNUSED_VAR(ax); /* -Wall */
334 1 ▶ SP -= items;
Branch: 1 branch
BranchTrueFalseTotal
SP -= items; 1 0 1
335 {
336 #line 91 "xs/Date.xs"
337 auto list = available_timezones();
338 if (list.size()) EXTEND(SP, (int)list.size());
339 for (auto& name : list) {
340 mPUSHs(xs::out(name).detach());
341 }
342 XSRETURN(list.size());
343 #line 344 "xs/Date_xsgen.cc"
344 PUTBACK;
345 return;
346 1 }
347 1 }); }
348  
349  
350  
351 0 ▶XS_EUPXS(XS_Date_use_system_timezones) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_use_system_timezones) { xs::throw_guard(cv, [=]() 0 0 0
352 {
353 0 dVAR; dXSARGS;
354 0 ▶ if (items != 0)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 0) 0 0 0
355 0 croak_xs_usage(cv, "");
356 PERL_UNUSED_VAR(ax); /* -Wall */
357 0 SP -= items;
358 {
359 #line 99 "xs/Date.xs"
360 use_system_timezones();
361 #line 362 "xs/Date_xsgen.cc"
362 0 PUTBACK;
363 0 return;
364 }
365 0 }); }
366  
367  
368  
369 150 ▶XS_EUPXS(XS_Date_use_embed_timezones) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_use_embed_timezones) { xs::throw_guard(cv, [=]() 75 0 75
370 {
371 75 dVAR; dXSARGS;
372 75 ▶ if (items != 0)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 0) 0 75 75
373 0 croak_xs_usage(cv, "");
374 PERL_UNUSED_VAR(ax); /* -Wall */
375 75 SP -= items;
376 {
377 #line 101 "xs/Date.xs"
378 use_embed_timezones();
379 #line 380 "xs/Date_xsgen.cc"
380 75 PUTBACK;
381 75 return;
382 }
383 75 }); }
384  
385  
386  
387 14 ▶XS_EUPXS(XS_Date_gmtime) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_gmtime) { xs::throw_guard(cv, [=]() 7 0 7
388 {
389 7 dVAR; dXSARGS;
390 7 dXSI32;
391 7 ▶ if (items < 0 || items > 2)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 0 || items > 2) 7 0 7
if (items < 0 || items > 2) 0 7 7
392 0 croak_xs_usage(cv, "epochSV= {}, tz= {}");
393 PERL_UNUSED_VAR(ax); /* -Wall */
394 7 SP -= items;
395 {
396 SV* epochSV;
397 7 TimezoneSP tz;
398  
399 7 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 0 7 7
400 0 epochSV = {};
401 else {
402 7 epochSV = ST(0)
403 ;
404 }
405  
406 7 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 7 0 7
407 7 tz = {};
408 else {
409 0 ▶ tz = xs::in<TimezoneSP>(ST(1));
Branch: 1 branch
BranchTrueFalseTotal
tz = xs::in<TimezoneSP>(ST(1)); 0 0 0
410 ;
411 }
412 #line 104 "xs/Date.xs"
413 ptime_t epoch;
414 if (epochSV) epoch = xs::in<ptime_t>(epochSV);
415 else epoch = (ptime_t) ::time(NULL);
416  
417 datetime date;
418 bool success = false;
419 switch (ix) {
420 case 0: success = gmtime(epoch, &date); break;
421 case 1: success = localtime(epoch, &date); break;
422 case 2: success = anytime(epoch, &date, tz ? tz : tzlocal()); break;
423 }
424  
425 if (GIMME_V == G_ARRAY) {
426 if (!success) XSRETURN_EMPTY;
427 EXTEND(SP, 9);
428 EXTEND_MORTAL(9);
429 mPUSHu(date.sec);
430 mPUSHu(date.min);
431 mPUSHu(date.hour);
432 mPUSHu(date.mday);
433 mPUSHu(date.mon);
434 mPUSHi(date.year);
435 mPUSHu(date.wday);
436 mPUSHu(date.yday);
437 mPUSHu(date.isdst);
438 XSRETURN(9);
439 } else {
440 EXTEND(SP, 1);
441 if (!success) XSRETURN_UNDEF;
442 mPUSHs(xs::out(strftime(LT_FORMAT, date)).detach());
443 XSRETURN(1);
444 }
445 #line 446 "xs/Date_xsgen.cc"
446 PUTBACK;
447 return;
448 7 }
449 7 }); }
450  
451  
452  
453 20 ▶XS_EUPXS(XS_Date_timegm) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_timegm) { xs::throw_guard(cv, [=]() 9 0 9
454 {
455 10 dVAR; dXSARGS;
456 10 dXSI32;
457 10 ▶ if (items < 6 || items > 8)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 6 || items > 8) 10 0 10
if (items < 6 || items > 8) 0 10 10
458 0 croak_xs_usage(cv, "sec, min, hour, mday, mon, year, isdst= {}, tz= {}");
459 {
460 ptime_t RETVAL;
461 10 SV* sec = ST(0)
462 ;
463 10 SV* min = ST(1)
464 ;
465 10 SV* hour = ST(2)
466 ;
467 10 SV* mday = ST(3)
468 ;
469 10 SV* mon = ST(4)
470 ;
471 10 SV* year = ST(5)
472 ;
473 SV* isdst;
474 10 TimezoneSP tz;
475  
476 10 ▶ if (items < 7)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 7) 6 4 10
477 6 isdst = {};
478 else {
479 4 isdst = ST(6)
480 ;
481 }
482  
483 10 ▶ if (items < 8)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 8) 10 0 10
484 10 tz = {};
485 else {
486 0 ▶ tz = xs::in<TimezoneSP>(ST(7));
Branch: 1 branch
BranchTrueFalseTotal
tz = xs::in<TimezoneSP>(ST(7)); 0 0 0
487 ;
488 }
489 #line 139 "xs/Date.xs"
490 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
491 datetime date;
492 date.sec = xs::in<ptime_t>(sec);
493 date.min = xs::in<ptime_t>(min);
494 date.hour = xs::in<ptime_t>(hour);
495 date.mday = xs::in<ptime_t>(mday);
496 date.mon = xs::in<ptime_t>(mon);
497 date.year = xs::in<ptime_t>(year);
498  
499 if (isdst) date.isdst = SvIV(isdst);
500 else date.isdst = -1;
501  
502 switch (ix) {
503 case 0: RETVAL = timegml(&date); break;
504 case 1: RETVAL = timelocall(&date); break;
505 case 2: RETVAL = timeanyl(&date, tz ? tz : tzlocal()); break;
506 case 3: RETVAL = timegm(&date); break;
507 case 4: RETVAL = timelocal(&date); break;
508 case 5: RETVAL = timeany(&date, tz ? tz : tzlocal()); break;
509 default: croak("not reached");
510 }
511  
512 if (ix >= 3) {
513 sv_setiv(sec, date.sec);
514 sv_setiv(min, date.min);
515 sv_setiv(hour, date.hour);
516 sv_setiv(mday, date.mday);
517 sv_setiv(mon, date.mon);
518 sv_setiv(year, date.year);
519 if (isdst) sv_setiv(isdst, date.isdst);
520 }
521 #line 522 "xs/Date_xsgen.cc"
522 {
523 SV * RETVALSV;
524 9 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 9 0 9
525 9 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 9 0 9
526 9 ST(0) = RETVALSV;
527 }
528 9 }
529 9 XSRETURN(1);
530 9 }); }
531  
532  
533  
534 10 ▶XS_EUPXS(XS_Date_now) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_now) { xs::throw_guard(cv, [=]() 5 0 5
535 {
536 5 dVAR; dXSARGS;
537 5 ▶ if (items != 0)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 0) 0 5 5
538 0 croak_xs_usage(cv, "");
539 {
540 Date * RETVAL;
541 #line 172 "xs/Date.xs"
542 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
543 RETVAL = new Date(Date::now());
544 #line 545 "xs/Date_xsgen.cc"
545 {
546 SV * RETVALSV;
547 5 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 5 0 5
548 5 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 5 0 5
549 5 ST(0) = RETVALSV;
550 }
551 5 }
552 5 XSRETURN(1);
553 5 }); }
554  
555  
556  
557 4 ▶XS_EUPXS(XS_Date_now_hires) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_now_hires) { xs::throw_guard(cv, [=]() 2 0 2
558 {
559 2 dVAR; dXSARGS;
560 2 ▶ if (items != 0)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 0) 0 2 2
561 0 croak_xs_usage(cv, "");
562 {
563 Date * RETVAL;
564 #line 176 "xs/Date.xs"
565 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
566 RETVAL = new Date(Date::now_hires());
567 #line 568 "xs/Date_xsgen.cc"
568 {
569 SV * RETVALSV;
570 2 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 2 0 2
571 2 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 2 0 2
572 2 ST(0) = RETVALSV;
573 }
574 2 }
575 2 XSRETURN(1);
576 2 }); }
577  
578  
579  
580 4 ▶XS_EUPXS(XS_Date_today) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_today) { xs::throw_guard(cv, [=]() 2 0 2
581 {
582 2 dVAR; dXSARGS;
583 2 ▶ if (items != 0)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 0) 0 2 2
584 0 croak_xs_usage(cv, "");
585 {
586 Date * RETVAL;
587 #line 180 "xs/Date.xs"
588 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
589 RETVAL = new Date(Date::today());
590 #line 591 "xs/Date_xsgen.cc"
591 {
592 SV * RETVALSV;
593 2 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 2 0 2
594 2 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 2 0 2
595 2 ST(0) = RETVALSV;
596 }
597 2 }
598 2 XSRETURN(1);
599 2 }); }
600  
601  
602  
603 2 ▶XS_EUPXS(XS_Date_today_epoch) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_today_epoch) { xs::throw_guard(cv, [=]() 1 0 1
604 {
605 1 dVAR; dXSARGS;
606 1 ▶ if (items != 0)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 0) 0 1 1
607 0 croak_xs_usage(cv, "");
608 {
609 ptime_t RETVAL;
610 #line 184 "xs/Date.xs"
611 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
612 RETVAL = Date::today_epoch();
613 #line 614 "xs/Date_xsgen.cc"
614 {
615 SV * RETVALSV;
616 1 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 1 0 1
617 1 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 1 0 1
618 1 ST(0) = RETVALSV;
619 }
620 1 }
621 1 XSRETURN(1);
622 1 }); }
623  
624  
625  
626 604 ▶XS_EUPXS(XS_Date_date) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_date) { xs::throw_guard(cv, [=]() 295 0 295
627 {
628 302 dVAR; dXSARGS;
629 302 ▶ if (items < 0 || items > 3)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 0 || items > 3) 302 0 302
if (items < 0 || items > 3) 0 302 302
630 0 croak_xs_usage(cv, "val= {}, tz= {}, fmt= Date::InputFormat::all");
631 {
632 Date * RETVAL;
633 SV* val;
634 302 TimezoneSP tz;
635 int fmt;
636  
637 302 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 2 300 302
638 2 val = {};
639 else {
640 300 val = ST(0)
641 ;
642 }
643  
644 302 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 277 25 302
645 277 tz = {};
646 else {
647 25 ▶ tz = xs::in<TimezoneSP>(ST(1));
Branch: 1 branch
BranchTrueFalseTotal
tz = xs::in<TimezoneSP>(ST(1)); 25 0 25
648 ;
649 }
650  
651 302 ▶ if (items < 3)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 3) 296 6 302
652 296 fmt = Date::InputFormat::all;
653 else {
654 6 ▶ fmt = (int)SvIV(ST(2))
Branch: 1 branch
BranchTrueFalseTotal
fmt = (int)SvIV(ST(2)) 6 0 6
655 ;
656 }
657 #line 188 "xs/Date.xs"
658 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
659 RETVAL = new Date(sv2date(val, tz, fmt));
660 #line 661 "xs/Date_xsgen.cc"
661 {
662 SV * RETVALSV;
663 295 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 295 0 295
664 295 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 295 0 295
665 295 ST(0) = RETVALSV;
666 }
667 309 }
668 295 XSRETURN(1);
669 295 }); }
670  
671  
672  
673 34 ▶XS_EUPXS(XS_Date_date_ymd) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_date_ymd) { xs::throw_guard(cv, [=]() 16 0 16
674 {
675 17 dVAR; dXSARGS;
676 PERL_UNUSED_VAR(cv); /* -W */
677 PERL_UNUSED_VAR(items); /* -W */
678 {
679 Date * RETVAL;
680 #line 192 "xs/Date.xs"
681 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
682 RETVAL = new Date(xs_date_ymd(&ST(0), items));
683 #line 684 "xs/Date_xsgen.cc"
684 {
685 SV * RETVALSV;
686 16 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 16 0 16
687 16 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 16 0 16
688 16 ST(0) = RETVALSV;
689 }
690 17 }
691 16 XSRETURN(1);
692 16 }); }
693  
694  
695  
696 10 ▶XS_EUPXS(XS_Date_range_check) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_range_check) { xs::throw_guard(cv, [=]() 5 0 5
697 {
698 5 dVAR; dXSARGS;
699 5 ▶ if (items < 0 || items > 1)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 0 || items > 1) 5 0 5
if (items < 0 || items > 1) 0 5 5
700 0 croak_xs_usage(cv, "newval= {}");
701 {
702 bool RETVAL;
703 5 Sv newval;
704  
705 5 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 2 3 5
706 2 newval = {};
707 else {
708 3 ▶ newval = ST(0)
Branch: 1 branch
BranchTrueFalseTotal
newval = ST(0) 3 0 3
709 ;
710 }
711 #line 196 "xs/Date.xs"
712 if (newval) Date::range_check(newval.is_true());
713 RETVAL = Date::range_check();
714 #line 715 "xs/Date_xsgen.cc"
715 5 ▶ ST(0) = boolSV(RETVAL);
Branch: 1 branch
BranchTrueFalseTotal
ST(0) = boolSV(RETVAL); 3 2 5
716 5 }
717 5 XSRETURN(1);
718 5 }); }
719  
720  
721  
722 80 ▶XS_EUPXS(XS_Date_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_new) { xs::throw_guard(cv, [=]() 38 0 38
723 {
724 40 dVAR; dXSARGS;
725 40 ▶ if (items < 1 || items > 4)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 1 || items > 4) 40 0 40
if (items < 1 || items > 4) 0 40 40
726 0 croak_xs_usage(cv, "_____unused1, val= {}, tz= {}, fmt= Date::InputFormat::all");
727 {
728 Date * RETVAL;
729 SV* val;
730 40 TimezoneSP tz;
731 int fmt;
732  
733 40 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 0 40 40
734 0 val = {};
735 else {
736 40 val = ST(1)
737 ;
738 }
739  
740 40 ▶ if (items < 3)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 3) 40 0 40
741 40 tz = {};
742 else {
743 0 ▶ tz = xs::in<TimezoneSP>(ST(2));
Branch: 1 branch
BranchTrueFalseTotal
tz = xs::in<TimezoneSP>(ST(2)); 0 0 0
744 ;
745 }
746  
747 40 ▶ if (items < 4)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 4) 40 0 40
748 40 fmt = Date::InputFormat::all;
749 else {
750 0 ▶ fmt = (int)SvIV(ST(3))
Branch: 1 branch
BranchTrueFalseTotal
fmt = (int)SvIV(ST(3)) 0 0 0
751 ;
752 }
753 #line 203 "xs/Date.xs"
754 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
755 RETVAL = new Date(sv2date(val, tz, fmt));
756 #line 757 "xs/Date_xsgen.cc"
757 {
758 SV * RETVALSV;
759 38 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 38 0 38
760 38 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 38 0 38
761 38 ST(0) = RETVALSV;
762 }
763 42 }
764 38 XSRETURN(1);
765 38 }); }
766  
767  
768  
769 24 ▶XS_EUPXS(XS_Date_new_ymd) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_new_ymd) { xs::throw_guard(cv, [=]() 11 0 11
770 {
771 12 dVAR; dXSARGS;
772 PERL_UNUSED_VAR(cv); /* -W */
773 PERL_UNUSED_VAR(items); /* -W */
774 {
775 Date * RETVAL;
776 #line 207 "xs/Date.xs"
777 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
778 RETVAL = new Date(xs_date_ymd(&ST(1), items - 1));
779 #line 780 "xs/Date_xsgen.cc"
780 {
781 SV * RETVALSV;
782 11 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 11 0 11
783 11 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 11 0 11
784 11 ST(0) = RETVALSV;
785 }
786 12 }
787 11 XSRETURN(1);
788 11 }); }
789  
790  
791  
792 2 ▶XS_EUPXS(XS_Date_strptime) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_strptime) { xs::throw_guard(cv, [=]() 1 0 1
793 {
794 1 dVAR; dXSARGS;
795 1 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 1 1
796 0 croak_xs_usage(cv, "date, format");
797 {
798 Date * RETVAL;
799 1 string date;
800 1 string format;
801  
802 { STRLEN __date_len;
803 1 const char* __date_buf = SvPV(ST(0), __date_len);
804 1 ▶ date.assign(__date_buf, __date_len); }
Branch: 1 branch
BranchTrueFalseTotal
date.assign(__date_buf, __date_len); } 1 0 1
805 ;
806  
807 { STRLEN __format_len;
808 1 const char* __format_buf = SvPV(ST(1), __format_len);
809 1 ▶ format.assign(__format_buf, __format_len); }
Branch: 1 branch
BranchTrueFalseTotal
format.assign(__format_buf, __format_len); } 1 0 1
810 ;
811 #line 211 "xs/Date.xs"
812 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
813 RETVAL = new Date(Date::strptime(date, format));
814 #line 815 "xs/Date_xsgen.cc"
815 {
816 SV * RETVALSV;
817 1 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 1 0 1
818 1 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 1 0 1
819 1 ST(0) = RETVALSV;
820 }
821 1 }
822 1 XSRETURN(1);
823 1 }); }
824  
825  
826  
827 14 ▶XS_EUPXS(XS_Date_set) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_set) { xs::throw_guard(cv, [=]() 5 0 5
828 {
829 7 dVAR; dXSARGS;
830 7 ▶ if (items < 1 || items > 4)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 1 || items > 4) 7 0 7
if (items < 1 || items > 4) 0 7 7
831 0 croak_xs_usage(cv, "THIS, val= {}, tz= {}, fmt= Date::InputFormat::all");
832 PERL_UNUSED_VAR(ax); /* -Wall */
833 7 SP -= items;
834 {
835 7 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 7 0 7
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 7 7
836 ;
837 SV* val;
838 7 TimezoneSP tz;
839 int fmt;
840  
841 7 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 0 7 7
842 0 val = {};
843 else {
844 7 val = ST(1)
845 ;
846 }
847  
848 7 ▶ if (items < 3)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 3) 7 0 7
849 7 tz = {};
850 else {
851 0 ▶ tz = xs::in<TimezoneSP>(ST(2));
Branch: 1 branch
BranchTrueFalseTotal
tz = xs::in<TimezoneSP>(ST(2)); 0 0 0
852 ;
853 }
854  
855 7 ▶ if (items < 4)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 4) 7 0 7
856 7 fmt = Date::InputFormat::all;
857 else {
858 0 ▶ fmt = (int)SvIV(ST(3))
Branch: 1 branch
BranchTrueFalseTotal
fmt = (int)SvIV(ST(3)) 0 0 0
859 ;
860 }
861 #line 215 "xs/Date.xs"
862 THIS->set(sv2date(val, tz, fmt));
863 #line 864 "xs/Date_xsgen.cc"
864 5 PUTBACK;
865 10 return;
866 7 }
867 5 }); }
868  
869  
870  
871 6 ▶XS_EUPXS(XS_Date_set_ymd) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_set_ymd) { xs::throw_guard(cv, [=]() 2 0 2
872 {
873 3 dVAR; dXSARGS;
874 3 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 0 3 3
875 0 croak_xs_usage(cv, "THIS, ...");
876 PERL_UNUSED_VAR(ax); /* -Wall */
877 3 SP -= items;
878 {
879 3 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 3 3
880 ;
881 #line 219 "xs/Date.xs"
882 THIS->set(xs_date_ymd(&ST(1), items - 1));
883 #line 884 "xs/Date_xsgen.cc"
884 2 PUTBACK;
885 2 return;
886 }
887 2 }); }
888  
889  
890  
891 414 ▶XS_EUPXS(XS_Date_epoch) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_epoch) { xs::throw_guard(cv, [=]() 207 0 207
892 {
893 207 dVAR; dXSARGS;
894 207 ▶ if (items < 1 || items > 2)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 1 || items > 2) 207 0 207
if (items < 1 || items > 2) 0 207 207
895 0 croak_xs_usage(cv, "THIS, newval= NULL");
896 PERL_UNUSED_VAR(ax); /* -Wall */
897 207 SP -= items;
898 {
899 207 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 207 207
900 ;
901 SV* newval;
902  
903 207 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 206 1 207
904 206 newval = NULL;
905 else {
906 1 newval = ST(1)
907 ;
908 }
909 #line 223 "xs/Date.xs"
910 if (newval) {
911 if (SvNOK(newval)) THIS->epoch((double)SvNV(newval));
912 else THIS->epoch(xs::in<ptime_t>(newval));
913 XSRETURN(1);
914 }
915 dXSTARG; XSprePUSH;
916 if (THIS->mksec()) PUSHn(THIS->epoch_mks());
917 else PUSHi(THIS->epoch());
918 #line 919 "xs/Date_xsgen.cc"
919 206 PUTBACK;
920 206 return;
921 }
922 207 }); }
923  
924  
925  
926 0 ▶XS_EUPXS(XS_Date_epoch_sec) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_epoch_sec) { xs::throw_guard(cv, [=]() 0 0 0
927 {
928 0 dVAR; dXSARGS;
929 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
930 0 croak_xs_usage(cv, "THIS");
931 {
932 ptime_t RETVAL;
933 0 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
934 ;
935 #line 234 "xs/Date.xs"
936 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
937 RETVAL = THIS->epoch();
938 #line 939 "xs/Date_xsgen.cc"
939 {
940 SV * RETVALSV;
941 0 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 0 0 0
942 0 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 0 0 0
943 0 ST(0) = RETVALSV;
944 }
945 0 }
946 0 XSRETURN(1);
947 0 }); }
948  
949  
950  
951 48 ▶XS_EUPXS(XS_Date_year) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_year) { xs::throw_guard(cv, [=]() 24 0 24
952 {
953 24 dVAR; dXSARGS;
954 24 ▶ if (items < 1 || items > 2)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 1 || items > 2) 24 0 24
if (items < 1 || items > 2) 0 24 24
955 0 croak_xs_usage(cv, "THIS, newval= NULL");
956 {
957 int32_t RETVAL;
958 24 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 24 0 24
959 24 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 24 24
960 ;
961 SV* newval;
962  
963 24 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 17 7 24
964 17 newval = NULL;
965 else {
966 7 newval = ST(1)
967 ;
968 }
969 #line 238 "xs/Date.xs"
970 if (newval) THIS->year(xs::in<ptime_t>(newval));
971 RETVAL = THIS->year();
972 #line 973 "xs/Date_xsgen.cc"
973 24 ▶ TARGi((IV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGi((IV)RETVAL, 1); 0 24 24
974 24 ST(0) = TARG;
975 }
976 24 XSRETURN(1);
977 24 }); }
978  
979  
980  
981 6 ▶XS_EUPXS(XS_Date_c_year) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_c_year) { xs::throw_guard(cv, [=]() 3 0 3
982 {
983 3 dVAR; dXSARGS;
984 3 dXSI32;
985 3 ▶ if (items < 1 || items > 2)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 1 || items > 2) 3 0 3
if (items < 1 || items > 2) 0 3 3
986 0 croak_xs_usage(cv, "THIS, newval= NULL");
987 {
988 int32_t RETVAL;
989 3 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 3 0 3
990 3 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 3 3
991 ;
992 SV* newval;
993  
994 3 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 3 0 3
995 3 newval = NULL;
996 else {
997 0 newval = ST(1)
998 ;
999 }
1000 #line 243 "xs/Date.xs"
1001 PERL_UNUSED_VAR(ix);
1002 if (newval) THIS->c_year(xs::in<ptime_t>(newval));
1003 RETVAL = THIS->c_year();
1004 #line 1005 "xs/Date_xsgen.cc"
1005 3 ▶ TARGi((IV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGi((IV)RETVAL, 1); 0 3 3
1006 3 ST(0) = TARG;
1007 }
1008 3 XSRETURN(1);
1009 3 }); }
1010  
1011  
1012  
1013 6 ▶XS_EUPXS(XS_Date_yr) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_yr) { xs::throw_guard(cv, [=]() 3 0 3
1014 {
1015 3 dVAR; dXSARGS;
1016 3 ▶ if (items < 1 || items > 2)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 1 || items > 2) 3 0 3
if (items < 1 || items > 2) 0 3 3
1017 0 croak_xs_usage(cv, "THIS, newval= NULL");
1018 {
1019 int8_t RETVAL;
1020 3 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 3 0 3
1021 3 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 3 3
1022 ;
1023 SV* newval;
1024  
1025 3 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 3 0 3
1026 3 newval = NULL;
1027 else {
1028 0 newval = ST(1)
1029 ;
1030 }
1031 #line 249 "xs/Date.xs"
1032 if (newval) THIS->yr(xs::in<ptime_t>(newval));
1033 RETVAL = THIS->yr();
1034 #line 1035 "xs/Date_xsgen.cc"
1035 3 ▶ TARGi((IV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGi((IV)RETVAL, 1); 0 3 3
1036 3 ST(0) = TARG;
1037 }
1038 3 XSRETURN(1);
1039 3 }); }
1040  
1041  
1042  
1043 36 ▶XS_EUPXS(XS_Date_month) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_month) { xs::throw_guard(cv, [=]() 18 0 18
1044 {
1045 18 dVAR; dXSARGS;
1046 18 dXSI32;
1047 18 ▶ if (items < 1 || items > 2)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 1 || items > 2) 18 0 18
if (items < 1 || items > 2) 0 18 18
1048 0 croak_xs_usage(cv, "THIS, newval= NULL");
1049 {
1050 uint8_t RETVAL;
1051 18 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 18 0 18
1052 18 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 18 18
1053 ;
1054 SV* newval;
1055  
1056 18 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 18 0 18
1057 18 newval = NULL;
1058 else {
1059 0 newval = ST(1)
1060 ;
1061 }
1062 #line 254 "xs/Date.xs"
1063 PERL_UNUSED_VAR(ix);
1064 if (newval) THIS->month(xs::in<ptime_t>(newval));
1065 RETVAL = THIS->month();
1066 #line 1067 "xs/Date_xsgen.cc"
1067 18 ▶ TARGu((UV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 0 18 18
1068 18 ST(0) = TARG;
1069 }
1070 18 XSRETURN(1);
1071 18 }); }
1072  
1073  
1074  
1075 4 ▶XS_EUPXS(XS_Date_c_month) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_c_month) { xs::throw_guard(cv, [=]() 2 0 2
1076 {
1077 2 dVAR; dXSARGS;
1078 2 dXSI32;
1079 2 ▶ if (items < 1 || items > 2)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 1 || items > 2) 2 0 2
if (items < 1 || items > 2) 0 2 2
1080 0 croak_xs_usage(cv, "THIS, newval= NULL");
1081 {
1082 uint8_t RETVAL;
1083 2 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 2 0 2
1084 2 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 2 2
1085 ;
1086 SV* newval;
1087  
1088 2 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 2 0 2
1089 2 newval = NULL;
1090 else {
1091 0 newval = ST(1)
1092 ;
1093 }
1094 #line 260 "xs/Date.xs"
1095 PERL_UNUSED_VAR(ix);
1096 if (newval) THIS->c_month(xs::in<ptime_t>(newval));
1097 RETVAL = THIS->c_month();
1098 #line 1099 "xs/Date_xsgen.cc"
1099 2 ▶ TARGu((UV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 0 2 2
1100 2 ST(0) = TARG;
1101 }
1102 2 XSRETURN(1);
1103 2 }); }
1104  
1105  
1106  
1107 56 ▶XS_EUPXS(XS_Date_day) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_day) { xs::throw_guard(cv, [=]() 28 0 28
1108 {
1109 28 dVAR; dXSARGS;
1110 28 dXSI32;
1111 28 ▶ if (items < 1 || items > 2)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 1 || items > 2) 28 0 28
if (items < 1 || items > 2) 0 28 28
1112 0 croak_xs_usage(cv, "THIS, newval= NULL");
1113 {
1114 uint8_t RETVAL;
1115 28 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 28 0 28
1116 28 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 28 28
1117 ;
1118 SV* newval;
1119  
1120 28 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 18 10 28
1121 18 newval = NULL;
1122 else {
1123 10 newval = ST(1)
1124 ;
1125 }
1126 #line 266 "xs/Date.xs"
1127 PERL_UNUSED_VAR(ix);
1128 if (newval) THIS->day(xs::in<ptime_t>(newval));
1129 RETVAL = THIS->day();
1130 #line 1131 "xs/Date_xsgen.cc"
1131 28 ▶ TARGu((UV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 0 28 28
1132 28 ST(0) = TARG;
1133 }
1134 28 XSRETURN(1);
1135 28 }); }
1136  
1137  
1138  
1139 14 ▶XS_EUPXS(XS_Date_hour) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_hour) { xs::throw_guard(cv, [=]() 7 0 7
1140 {
1141 7 dVAR; dXSARGS;
1142 7 ▶ if (items < 1 || items > 2)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 1 || items > 2) 7 0 7
if (items < 1 || items > 2) 0 7 7
1143 0 croak_xs_usage(cv, "THIS, newval= NULL");
1144 {
1145 uint8_t RETVAL;
1146 7 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 7 0 7
1147 7 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 7 7
1148 ;
1149 SV* newval;
1150  
1151 7 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 7 0 7
1152 7 newval = NULL;
1153 else {
1154 0 newval = ST(1)
1155 ;
1156 }
1157 #line 272 "xs/Date.xs"
1158 if (newval) THIS->hour(xs::in<ptime_t>(newval));
1159 RETVAL = THIS->hour();
1160 #line 1161 "xs/Date_xsgen.cc"
1161 7 ▶ TARGu((UV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 0 7 7
1162 7 ST(0) = TARG;
1163 }
1164 7 XSRETURN(1);
1165 7 }); }
1166  
1167  
1168  
1169 16 ▶XS_EUPXS(XS_Date_min) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_min) { xs::throw_guard(cv, [=]() 8 0 8
1170 {
1171 8 dVAR; dXSARGS;
1172 8 dXSI32;
1173 8 ▶ if (items < 1 || items > 2)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 1 || items > 2) 8 0 8
if (items < 1 || items > 2) 0 8 8
1174 0 croak_xs_usage(cv, "THIS, newval= NULL");
1175 {
1176 uint8_t RETVAL;
1177 8 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 8 0 8
1178 8 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 8 8
1179 ;
1180 SV* newval;
1181  
1182 8 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 8 0 8
1183 8 newval = NULL;
1184 else {
1185 0 newval = ST(1)
1186 ;
1187 }
1188 #line 277 "xs/Date.xs"
1189 PERL_UNUSED_VAR(ix);
1190 if (newval) THIS->min(xs::in<ptime_t>(newval));
1191 RETVAL = THIS->min();
1192 #line 1193 "xs/Date_xsgen.cc"
1193 8 ▶ TARGu((UV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 0 8 8
1194 8 ST(0) = TARG;
1195 }
1196 8 XSRETURN(1);
1197 8 }); }
1198  
1199  
1200  
1201 16 ▶XS_EUPXS(XS_Date_sec) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_sec) { xs::throw_guard(cv, [=]() 8 0 8
1202 {
1203 8 dVAR; dXSARGS;
1204 8 dXSI32;
1205 8 ▶ if (items < 1 || items > 2)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 1 || items > 2) 8 0 8
if (items < 1 || items > 2) 0 8 8
1206 0 croak_xs_usage(cv, "THIS, newval= NULL");
1207 {
1208 uint8_t RETVAL;
1209 8 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 8 0 8
1210 8 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 8 8
1211 ;
1212 SV* newval;
1213  
1214 8 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 8 0 8
1215 8 newval = NULL;
1216 else {
1217 0 newval = ST(1)
1218 ;
1219 }
1220 #line 283 "xs/Date.xs"
1221 PERL_UNUSED_VAR(ix);
1222 if (newval) THIS->sec(xs::in<ptime_t>(newval));
1223 RETVAL = THIS->sec();
1224 #line 1225 "xs/Date_xsgen.cc"
1225 8 ▶ TARGu((UV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 0 8 8
1226 8 ST(0) = TARG;
1227 }
1228 8 XSRETURN(1);
1229 8 }); }
1230  
1231  
1232  
1233 16 ▶XS_EUPXS(XS_Date_mksec) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_mksec) { xs::throw_guard(cv, [=]() 8 0 8
1234 {
1235 8 dVAR; dXSARGS;
1236 8 ▶ if (items < 1 || items > 2)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 1 || items > 2) 8 0 8
if (items < 1 || items > 2) 0 8 8
1237 0 croak_xs_usage(cv, "THIS, newval= NULL");
1238 {
1239 uint32_t RETVAL;
1240 8 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 8 0 8
1241 8 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 8 8
1242 ;
1243 SV* newval;
1244  
1245 8 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 8 0 8
1246 8 newval = NULL;
1247 else {
1248 0 newval = ST(1)
1249 ;
1250 }
1251 #line 289 "xs/Date.xs"
1252 if (newval) THIS->mksec(xs::in<ptime_t>(newval));
1253 RETVAL = THIS->mksec();
1254 #line 1255 "xs/Date_xsgen.cc"
1255 8 ▶ TARGu((UV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 0 8 8
1256 8 ST(0) = TARG;
1257 }
1258 8 XSRETURN(1);
1259 8 }); }
1260  
1261  
1262  
1263 8 ▶XS_EUPXS(XS_Date_wday) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_wday) { xs::throw_guard(cv, [=]() 4 0 4
1264 {
1265 4 dVAR; dXSARGS;
1266 4 dXSI32;
1267 4 ▶ if (items < 1 || items > 2)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 1 || items > 2) 4 0 4
if (items < 1 || items > 2) 0 4 4
1268 0 croak_xs_usage(cv, "THIS, newval= NULL");
1269 {
1270 uint8_t RETVAL;
1271 4 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 4 0 4
1272 4 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 4 4
1273 ;
1274 SV* newval;
1275  
1276 4 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 4 0 4
1277 4 newval = NULL;
1278 else {
1279 0 newval = ST(1)
1280 ;
1281 }
1282 #line 294 "xs/Date.xs"
1283 PERL_UNUSED_VAR(ix);
1284 if (newval) THIS->wday(xs::in<ptime_t>(newval));
1285 RETVAL = THIS->wday();
1286 #line 1287 "xs/Date_xsgen.cc"
1287 4 ▶ TARGu((UV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 0 4 4
1288 4 ST(0) = TARG;
1289 }
1290 4 XSRETURN(1);
1291 4 }); }
1292  
1293  
1294  
1295 4 ▶XS_EUPXS(XS_Date_c_wday) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_c_wday) { xs::throw_guard(cv, [=]() 2 0 2
1296 {
1297 2 dVAR; dXSARGS;
1298 2 dXSI32;
1299 2 ▶ if (items < 1 || items > 2)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 1 || items > 2) 2 0 2
if (items < 1 || items > 2) 0 2 2
1300 0 croak_xs_usage(cv, "THIS, newval= NULL");
1301 {
1302 uint8_t RETVAL;
1303 2 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 2 0 2
1304 2 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 2 2
1305 ;
1306 SV* newval;
1307  
1308 2 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 2 0 2
1309 2 newval = NULL;
1310 else {
1311 0 newval = ST(1)
1312 ;
1313 }
1314 #line 300 "xs/Date.xs"
1315 PERL_UNUSED_VAR(ix);
1316 if (newval) THIS->c_wday(xs::in<ptime_t>(newval));
1317 RETVAL = THIS->c_wday();
1318 #line 1319 "xs/Date_xsgen.cc"
1319 2 ▶ TARGu((UV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 0 2 2
1320 2 ST(0) = TARG;
1321 }
1322 2 XSRETURN(1);
1323 2 }); }
1324  
1325  
1326  
1327 4 ▶XS_EUPXS(XS_Date_ewday) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_ewday) { xs::throw_guard(cv, [=]() 2 0 2
1328 {
1329 2 dVAR; dXSARGS;
1330 2 ▶ if (items < 1 || items > 2)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 1 || items > 2) 2 0 2
if (items < 1 || items > 2) 0 2 2
1331 0 croak_xs_usage(cv, "THIS, newval= NULL");
1332 {
1333 uint8_t RETVAL;
1334 2 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 2 0 2
1335 2 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 2 2
1336 ;
1337 SV* newval;
1338  
1339 2 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 2 0 2
1340 2 newval = NULL;
1341 else {
1342 0 newval = ST(1)
1343 ;
1344 }
1345 #line 306 "xs/Date.xs"
1346 if (newval) THIS->ewday(xs::in<ptime_t>(newval));
1347 RETVAL = THIS->ewday();
1348 #line 1349 "xs/Date_xsgen.cc"
1349 2 ▶ TARGu((UV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 0 2 2
1350 2 ST(0) = TARG;
1351 }
1352 2 XSRETURN(1);
1353 2 }); }
1354  
1355  
1356  
1357 4 ▶XS_EUPXS(XS_Date_yday) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_yday) { xs::throw_guard(cv, [=]() 2 0 2
1358 {
1359 2 dVAR; dXSARGS;
1360 2 dXSI32;
1361 2 ▶ if (items < 1 || items > 2)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 1 || items > 2) 2 0 2
if (items < 1 || items > 2) 0 2 2
1362 0 croak_xs_usage(cv, "THIS, newval= NULL");
1363 {
1364 uint16_t RETVAL;
1365 2 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 2 0 2
1366 2 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 2 2
1367 ;
1368 SV* newval;
1369  
1370 2 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 2 0 2
1371 2 newval = NULL;
1372 else {
1373 0 newval = ST(1)
1374 ;
1375 }
1376 #line 311 "xs/Date.xs"
1377 PERL_UNUSED_VAR(ix);
1378 if (newval) THIS->yday(xs::in<ptime_t>(newval));
1379 RETVAL = THIS->yday();
1380 #line 1381 "xs/Date_xsgen.cc"
1381 2 ▶ TARGu((UV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 0 2 2
1382 2 ST(0) = TARG;
1383 }
1384 2 XSRETURN(1);
1385 2 }); }
1386  
1387  
1388  
1389 2 ▶XS_EUPXS(XS_Date_c_yday) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_c_yday) { xs::throw_guard(cv, [=]() 1 0 1
1390 {
1391 1 dVAR; dXSARGS;
1392 1 dXSI32;
1393 1 ▶ if (items < 1 || items > 2)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 1 || items > 2) 1 0 1
if (items < 1 || items > 2) 0 1 1
1394 0 croak_xs_usage(cv, "THIS, newval= NULL");
1395 {
1396 uint16_t RETVAL;
1397 1 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 1 0 1
1398 1 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 1 1
1399 ;
1400 SV* newval;
1401  
1402 1 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 1 0 1
1403 1 newval = NULL;
1404 else {
1405 0 newval = ST(1)
1406 ;
1407 }
1408 #line 317 "xs/Date.xs"
1409 PERL_UNUSED_VAR(ix);
1410 if (newval) THIS->c_yday(xs::in<ptime_t>(newval));
1411 RETVAL = THIS->c_yday();
1412 #line 1413 "xs/Date_xsgen.cc"
1413 1 ▶ TARGu((UV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 0 1 1
1414 1 ST(0) = TARG;
1415 }
1416 1 XSRETURN(1);
1417 1 }); }
1418  
1419  
1420  
1421 12 ▶XS_EUPXS(XS_Date_isdst) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_isdst) { xs::throw_guard(cv, [=]() 6 0 6
1422 {
1423 6 dVAR; dXSARGS;
1424 6 dXSI32;
1425 6 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 6 6
1426 0 croak_xs_usage(cv, "THIS");
1427 {
1428 bool RETVAL;
1429 6 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 6 6
1430 ;
1431 #line 323 "xs/Date.xs"
1432 PERL_UNUSED_VAR(ix);
1433 RETVAL = THIS->isdst();
1434 #line 1435 "xs/Date_xsgen.cc"
1435 6 ▶ ST(0) = boolSV(RETVAL);
Branch: 1 branch
BranchTrueFalseTotal
ST(0) = boolSV(RETVAL); 2 4 6
1436 }
1437 6 XSRETURN(1);
1438 6 }); }
1439  
1440  
1441  
1442 94 ▶XS_EUPXS(XS_Date_to_string) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_to_string) { xs::throw_guard(cv, [=]() 47 0 47
1443 {
1444 47 dVAR; dXSARGS;
1445 47 ▶ if (items < 1 || items > 2)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 1 || items > 2) 47 0 47
if (items < 1 || items > 2) 0 47 47
1446 0 croak_xs_usage(cv, "THIS, format= (int)Date::Format::iso");
1447 {
1448 47 string RETVAL;
1449 47 ▶ dXSTARG;
Branch: 2 branches
BranchTrueFalseTotal
dXSTARG; 47 0 47
dXSTARG; 0 0 0
1450 47 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 47 0 47
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 47 47
1451 ;
1452 int format;
1453  
1454 47 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 25 22 47
1455 25 format = (int)Date::Format::iso;
1456 else {
1457 22 ▶ format = (int)SvIV(ST(1))
Branch: 1 branch
BranchTrueFalseTotal
format = (int)SvIV(ST(1)) 22 0 22
1458 ;
1459 }
1460 #line 328 "xs/Date.xs"
1461 if (THIS->error()) XSRETURN_UNDEF;
1462 RETVAL = THIS->to_string((Date::Format)format);
1463 #line 1464 "xs/Date_xsgen.cc"
1464 45 ▶ sv_setpvn((SV*)TARG, RETVAL.data(), RETVAL.length());
Branch: 1 branch
BranchTrueFalseTotal
sv_setpvn((SV*)TARG, RETVAL.data(), RETVAL.length()); 45 0 45
1465 45 ST(0) = TARG;
1466 47 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 45 2 47
1467 45 XSRETURN(1);
1468 47 }); }
1469  
1470  
1471  
1472 16 ▶XS_EUPXS(XS_Date__op_str) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date__op_str) { xs::throw_guard(cv, [=]() 8 0 8
1473 {
1474 8 dVAR; dXSARGS;
1475 8 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 0 8 8
1476 0 croak_xs_usage(cv, "THIS, ...");
1477 {
1478 8 string RETVAL;
1479 8 ▶ dXSTARG;
Branch: 2 branches
BranchTrueFalseTotal
dXSTARG; 0 8 8
dXSTARG; 8 0 8
1480 8 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 8 0 8
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 8 8
1481 ;
1482 #line 333 "xs/Date.xs"
1483 if (THIS->error()) XSRETURN_UNDEF;
1484 RETVAL = THIS->to_string();
1485 #line 1486 "xs/Date_xsgen.cc"
1486 8 ▶ sv_setpvn((SV*)TARG, RETVAL.data(), RETVAL.length());
Branch: 1 branch
BranchTrueFalseTotal
sv_setpvn((SV*)TARG, RETVAL.data(), RETVAL.length()); 8 0 8
1487 8 ST(0) = TARG;
1488 8 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 8 0 8
1489 8 XSRETURN(1);
1490 8 }); }
1491  
1492  
1493  
1494 22 ▶XS_EUPXS(XS_Date_strftime) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_strftime) { xs::throw_guard(cv, [=]() 11 0 11
1495 {
1496 11 dVAR; dXSARGS;
1497 11 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 0 11 11
1498 0 croak_xs_usage(cv, "arg0, arg1, ...");
1499 {
1500 11 string RETVAL;
1501 11 ▶ dXSTARG;
Branch: 2 branches
BranchTrueFalseTotal
dXSTARG; 11 0 11
dXSTARG; 0 0 0
1502 11 Sv arg0 = ST(0)
1503 ;
1504 11 ▶ SV* arg1 = ST(1)
Branch: 1 branch
BranchTrueFalseTotal
SV* arg1 = ST(1) 4 7 11
1505 ;
1506 #line 341 "xs/Date.xs"
1507 if (items == 2 && arg0.is_object_ref()) {
1508 auto THIS = xs::in<Date*>(arg0);
1509 RETVAL = THIS->strftime(xs::in<string_view>(arg1));
1510 }
1511 else {
1512 string_view format = xs::in<string_view>(arg0);
1513 TimezoneSP tz;
1514 datetime date;
1515 date.isdst = -1;
1516  
1517 switch (items) {
1518 case 9: tz = xs::in<TimezoneSP>(ST(8)); // fall through
1519 case 8: date.isdst = SvIV(ST(7)); // fall through
1520 case 7:
1521 date.sec = xs::in<ptime_t>(ST(1));
1522 date.min = xs::in<ptime_t>(ST(2));
1523 date.hour = xs::in<ptime_t>(ST(3));
1524 date.mday = xs::in<ptime_t>(ST(4));
1525 date.mon = xs::in<ptime_t>(ST(5));
1526 date.year = xs::in<ptime_t>(ST(6));
1527 timeany(&date, tz ? tz : tzlocal());
1528 break;
1529 case 3: tz = xs::in<TimezoneSP>(ST(2)); // fall through
1530 case 2: {
1531 auto epoch = xs::in<ptime_t>(arg1);
1532 if (!anytime(epoch, &date, tz ? tz : tzlocal())) XSRETURN_UNDEF;
1533 break;
1534 }
1535 default:
1536 throw "wrong number of arguments";
1537 }
1538 RETVAL = strftime(format, date);
1539 }
1540 #line 1541 "xs/Date_xsgen.cc"
1541 11 ▶ sv_setpvn((SV*)TARG, RETVAL.data(), RETVAL.length());
Branch: 1 branch
BranchTrueFalseTotal
sv_setpvn((SV*)TARG, RETVAL.data(), RETVAL.length()); 11 0 11
1542 11 ST(0) = TARG;
1543 11 ▶ }
Branch: 2 branches
BranchTrueFalseTotal
} 11 0 11
} 11 0 11
1544 11 XSRETURN(1);
1545 11 }); }
1546  
1547  
1548  
1549 6 ▶XS_EUPXS(XS_Date_to_bool) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_to_bool) { xs::throw_guard(cv, [=]() 3 0 3
1550 {
1551 3 dVAR; dXSARGS;
1552 3 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 0 3 3
1553 0 croak_xs_usage(cv, "THIS, ...");
1554 {
1555 bool RETVAL;
1556 3 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 3 3
1557 ;
1558 #line 377 "xs/Date.xs"
1559 RETVAL = THIS->error() ? false : true;
1560 #line 1561 "xs/Date_xsgen.cc"
1561 3 ▶ ST(0) = boolSV(RETVAL);
Branch: 1 branch
BranchTrueFalseTotal
ST(0) = boolSV(RETVAL); 0 3 3
1562 }
1563 3 XSRETURN(1);
1564 3 }); }
1565  
1566  
1567  
1568 14 ▶XS_EUPXS(XS_Date_to_number) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_to_number) { xs::throw_guard(cv, [=]() 7 0 7
1569 {
1570 7 dVAR; dXSARGS;
1571 7 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 0 7 7
1572 0 croak_xs_usage(cv, "THIS, ...");
1573 {
1574 ptime_t RETVAL;
1575 7 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 7 0 7
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 7 7
1576 ;
1577 #line 381 "xs/Date.xs"
1578 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
1579 RETVAL = THIS->error() ? 0 : THIS->epoch();
1580 #line 1581 "xs/Date_xsgen.cc"
1581 {
1582 SV * RETVALSV;
1583 7 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 7 0 7
1584 7 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 7 0 7
1585 7 ST(0) = RETVALSV;
1586 }
1587 7 }
1588 7 XSRETURN(1);
1589 7 }); }
1590  
1591  
1592  
1593 0 ▶XS_EUPXS(XS_Date_month_name) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_month_name) { xs::throw_guard(cv, [=]() 0 0 0
1594 {
1595 0 dVAR; dXSARGS;
1596 0 dXSI32;
1597 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
1598 0 croak_xs_usage(cv, "THIS");
1599 {
1600 0 string_view RETVAL;
1601 0 ▶ dXSTARG;
Branch: 2 branches
BranchTrueFalseTotal
dXSTARG; 0 0 0
dXSTARG; 0 0 0
1602 0 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
1603 ;
1604 #line 385 "xs/Date.xs"
1605 PERL_UNUSED_VAR(ix);
1606 RETVAL = THIS->month_name();
1607 #line 1608 "xs/Date_xsgen.cc"
1608 0 ▶ sv_setpvn((SV*)TARG, RETVAL.data(), RETVAL.length());
Branch: 1 branch
BranchTrueFalseTotal
sv_setpvn((SV*)TARG, RETVAL.data(), RETVAL.length()); 0 0 0
1609 0 ST(0) = TARG;
1610 }
1611 0 XSRETURN(1);
1612 0 }); }
1613  
1614  
1615  
1616 0 ▶XS_EUPXS(XS_Date_month_sname) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_month_sname) { xs::throw_guard(cv, [=]() 0 0 0
1617 {
1618 0 dVAR; dXSARGS;
1619 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
1620 0 croak_xs_usage(cv, "THIS");
1621 {
1622 0 string_view RETVAL;
1623 0 ▶ dXSTARG;
Branch: 2 branches
BranchTrueFalseTotal
dXSTARG; 0 0 0
dXSTARG; 0 0 0
1624 0 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
1625 ;
1626 #line 389 "xs/Date.xs"
1627 RETVAL = THIS->month_sname();
1628 #line 1629 "xs/Date_xsgen.cc"
1629 0 ▶ sv_setpvn((SV*)TARG, RETVAL.data(), RETVAL.length());
Branch: 1 branch
BranchTrueFalseTotal
sv_setpvn((SV*)TARG, RETVAL.data(), RETVAL.length()); 0 0 0
1630 0 ST(0) = TARG;
1631 }
1632 0 XSRETURN(1);
1633 0 }); }
1634  
1635  
1636  
1637 0 ▶XS_EUPXS(XS_Date_wday_name) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_wday_name) { xs::throw_guard(cv, [=]() 0 0 0
1638 {
1639 0 dVAR; dXSARGS;
1640 0 dXSI32;
1641 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
1642 0 croak_xs_usage(cv, "THIS");
1643 {
1644 0 string_view RETVAL;
1645 0 ▶ dXSTARG;
Branch: 2 branches
BranchTrueFalseTotal
dXSTARG; 0 0 0
dXSTARG; 0 0 0
1646 0 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
1647 ;
1648 #line 392 "xs/Date.xs"
1649 PERL_UNUSED_VAR(ix);
1650 RETVAL = THIS->wday_name();
1651 #line 1652 "xs/Date_xsgen.cc"
1652 0 ▶ sv_setpvn((SV*)TARG, RETVAL.data(), RETVAL.length());
Branch: 1 branch
BranchTrueFalseTotal
sv_setpvn((SV*)TARG, RETVAL.data(), RETVAL.length()); 0 0 0
1653 0 ST(0) = TARG;
1654 }
1655 0 XSRETURN(1);
1656 0 }); }
1657  
1658  
1659  
1660 0 ▶XS_EUPXS(XS_Date_wday_sname) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_wday_sname) { xs::throw_guard(cv, [=]() 0 0 0
1661 {
1662 0 dVAR; dXSARGS;
1663 0 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 0 0
1664 0 croak_xs_usage(cv, "THIS");
1665 {
1666 0 string_view RETVAL;
1667 0 ▶ dXSTARG;
Branch: 2 branches
BranchTrueFalseTotal
dXSTARG; 0 0 0
dXSTARG; 0 0 0
1668 0 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 0 0
1669 ;
1670 #line 396 "xs/Date.xs"
1671 RETVAL = THIS->wday_sname();
1672 #line 1673 "xs/Date_xsgen.cc"
1673 0 ▶ sv_setpvn((SV*)TARG, RETVAL.data(), RETVAL.length());
Branch: 1 branch
BranchTrueFalseTotal
sv_setpvn((SV*)TARG, RETVAL.data(), RETVAL.length()); 0 0 0
1674 0 ST(0) = TARG;
1675 }
1676 0 XSRETURN(1);
1677 0 }); }
1678  
1679  
1680  
1681 6 ▶XS_EUPXS(XS_Date_gmtoff) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_gmtoff) { xs::throw_guard(cv, [=]() 3 0 3
1682 {
1683 3 dVAR; dXSARGS;
1684 3 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 3 3
1685 0 croak_xs_usage(cv, "THIS");
1686 {
1687 int RETVAL;
1688 3 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 3 0 3
1689 3 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 3 3
1690 ;
1691 #line 398 "xs/Date.xs"
1692 RETVAL = THIS->gmtoff();
1693 #line 1694 "xs/Date_xsgen.cc"
1694 3 ▶ TARGi((IV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGi((IV)RETVAL, 1); 0 3 3
1695 3 ST(0) = TARG;
1696 }
1697 3 XSRETURN(1);
1698 3 }); }
1699  
1700  
1701  
1702 204 ▶XS_EUPXS(XS_Date_tzabbr) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_tzabbr) { xs::throw_guard(cv, [=]() 102 0 102
1703 {
1704 102 dVAR; dXSARGS;
1705 102 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 102 102
1706 0 croak_xs_usage(cv, "THIS");
1707 {
1708 102 string_view RETVAL;
1709 102 ▶ dXSTARG;
Branch: 2 branches
BranchTrueFalseTotal
dXSTARG; 102 0 102
dXSTARG; 0 0 0
1710 102 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 102 0 102
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 102 102
1711 ;
1712 #line 400 "xs/Date.xs"
1713 RETVAL = THIS->tzabbr();
1714 #line 1715 "xs/Date_xsgen.cc"
1715 102 ▶ sv_setpvn((SV*)TARG, RETVAL.data(), RETVAL.length());
Branch: 1 branch
BranchTrueFalseTotal
sv_setpvn((SV*)TARG, RETVAL.data(), RETVAL.length()); 102 0 102
1716 102 ST(0) = TARG;
1717 }
1718 102 XSRETURN(1);
1719 102 }); }
1720  
1721  
1722  
1723 62 ▶XS_EUPXS(XS_Date_tzname) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_tzname) { xs::throw_guard(cv, [=]() 31 0 31
1724 {
1725 31 dVAR; dXSARGS;
1726 31 ▶ if (items < 0 || items > 1)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 0 || items > 1) 31 0 31
if (items < 0 || items > 1) 0 31 31
1727 0 croak_xs_usage(cv, "date= nullptr");
1728 {
1729 31 string RETVAL;
1730 31 ▶ dXSTARG;
Branch: 2 branches
BranchTrueFalseTotal
dXSTARG; 31 0 31
dXSTARG; 0 0 0
1731 Date* date;
1732  
1733 31 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 5 26 31
1734 5 date = nullptr;
1735 else {
1736 26 ▶ date = xs::in<Date *>(ST(0));
Branch: 1 branch
BranchTrueFalseTotal
date = xs::in<Date *>(ST(0)); 26 0 26
1737 ;
1738 }
1739 #line 405 "xs/Date.xs"
1740 auto& zone = date ? date->timezone() : tzlocal();
1741 RETVAL = zone->name;
1742 #line 1743 "xs/Date_xsgen.cc"
1743 31 ▶ sv_setpvn((SV*)TARG, RETVAL.data(), RETVAL.length());
Branch: 1 branch
BranchTrueFalseTotal
sv_setpvn((SV*)TARG, RETVAL.data(), RETVAL.length()); 31 0 31
1744 31 ST(0) = TARG;
1745 31 }
1746 31 XSRETURN(1);
1747 31 }); }
1748  
1749  
1750  
1751 30 ▶XS_EUPXS(XS_Date_tzlocal) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_tzlocal) { xs::throw_guard(cv, [=]() 15 0 15
1752 {
1753 15 dVAR; dXSARGS;
1754 15 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 15 15
1755 0 croak_xs_usage(cv, "THIS");
1756 {
1757 bool RETVAL;
1758 15 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 15 15
1759 ;
1760 #line 410 "xs/Date.xs"
1761 RETVAL = THIS->timezone()->is_local;
1762 #line 1763 "xs/Date_xsgen.cc"
1763 15 ▶ ST(0) = boolSV(RETVAL);
Branch: 1 branch
BranchTrueFalseTotal
ST(0) = boolSV(RETVAL); 10 5 15
1764 }
1765 15 XSRETURN(1);
1766 15 }); }
1767  
1768  
1769  
1770 34 ▶XS_EUPXS(XS_Date_timezone) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_timezone) { xs::throw_guard(cv, [=]() 17 0 17
1771 {
1772 17 dVAR; dXSARGS;
1773 17 dXSI32;
1774 17 ▶ if (items < 1 || items > 2)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 1 || items > 2) 17 0 17
if (items < 1 || items > 2) 0 17 17
1775 0 croak_xs_usage(cv, "THIS, newzone= {}");
1776 {
1777 17 TimezoneSP RETVAL;
1778 17 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 17 0 17
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 17 17
1779 ;
1780 17 TimezoneSP newzone;
1781  
1782 17 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 15 2 17
1783 15 newzone = {};
1784 else {
1785 2 ▶ newzone = xs::in<TimezoneSP>(ST(1));
Branch: 1 branch
BranchTrueFalseTotal
newzone = xs::in<TimezoneSP>(ST(1)); 2 0 2
1786 ;
1787 }
1788 #line 414 "xs/Date.xs"
1789 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
1790 if (newzone) {
1791 THIS->timezone(newzone);
1792 XSRETURN_UNDEF;
1793 }
1794 RETVAL = THIS->timezone();
1795 PERL_UNUSED_VAR(ix);
1796 #line 1797 "xs/Date_xsgen.cc"
1797 {
1798 SV * RETVALSV;
1799 15 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 15 0 15
1800 15 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 15 0 15
1801 15 ST(0) = RETVALSV;
1802 }
1803 21 ▶ }
Branch: 3 branches
BranchTrueFalseTotal
} 15 2 17
} 15 2 17
} 15 2 17
1804 15 XSRETURN(1);
1805 17 }); }
1806  
1807  
1808  
1809 6 ▶XS_EUPXS(XS_Date_to_timezone) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_to_timezone) { xs::throw_guard(cv, [=]() 3 0 3
1810 {
1811 3 dVAR; dXSARGS;
1812 3 dXSI32;
1813 3 ▶ if (items != 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 2) 0 3 3
1814 0 croak_xs_usage(cv, "THIS, newzone");
1815 PERL_UNUSED_VAR(ax); /* -Wall */
1816 3 SP -= items;
1817 {
1818 3 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 3 0 3
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 3 3
1819 ;
1820 3 ▶ TimezoneSP newzone = xs::in<TimezoneSP>(ST(1));
Branch: 1 branch
BranchTrueFalseTotal
TimezoneSP newzone = xs::in<TimezoneSP>(ST(1)); 3 0 3
1821 ;
1822 #line 423 "xs/Date.xs"
1823 THIS->to_timezone(newzone);
1824 PERL_UNUSED_VAR(ix);
1825 #line 1826 "xs/Date_xsgen.cc"
1826 3 PUTBACK;
1827 6 return;
1828 3 }
1829 3 }); }
1830  
1831  
1832  
1833 4 ▶XS_EUPXS(XS_Date_array) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_array) { xs::throw_guard(cv, [=]() 2 0 2
1834 {
1835 2 dVAR; dXSARGS;
1836 2 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 2 2
1837 0 croak_xs_usage(cv, "THIS");
1838 PERL_UNUSED_VAR(ax); /* -Wall */
1839 2 SP -= items;
1840 {
1841 2 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 2 2
1842 ;
1843 #line 428 "xs/Date.xs"
1844 auto cnt = THIS->mksec() ? 7 : 6;
1845 EXTEND(SP, cnt);
1846 mPUSHi(THIS->year());
1847 mPUSHu(THIS->month());
1848 mPUSHu(THIS->day());
1849 mPUSHu(THIS->hour());
1850 mPUSHu(THIS->min());
1851 mPUSHu(THIS->sec());
1852 if (THIS->mksec()) mPUSHu(THIS->mksec());
1853 XSRETURN(cnt);
1854 #line 1855 "xs/Date_xsgen.cc"
1855 PUTBACK;
1856 return;
1857 }
1858 2 }); }
1859  
1860  
1861  
1862 2 ▶XS_EUPXS(XS_Date_struct) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_struct) { xs::throw_guard(cv, [=]() 1 0 1
1863 {
1864 1 dVAR; dXSARGS;
1865 1 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 1 1
1866 0 croak_xs_usage(cv, "THIS");
1867 PERL_UNUSED_VAR(ax); /* -Wall */
1868 1 SP -= items;
1869 {
1870 1 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 1 1
1871 ;
1872 #line 441 "xs/Date.xs"
1873 EXTEND(SP, 9);
1874 mPUSHu(THIS->sec());
1875 mPUSHu(THIS->min());
1876 mPUSHu(THIS->hour());
1877 mPUSHu(THIS->day());
1878 mPUSHu(THIS->c_month());
1879 mPUSHi(THIS->c_year());
1880 mPUSHu(THIS->c_wday());
1881 mPUSHu(THIS->c_yday());
1882 mPUSHu(THIS->isdst() ? 1 : 0);
1883 XSRETURN(9);
1884 #line 1885 "xs/Date_xsgen.cc"
1885 PUTBACK;
1886 return;
1887 }
1888 1 }); }
1889  
1890  
1891  
1892 36 ▶XS_EUPXS(XS_Date_clone) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_clone) { xs::throw_guard(cv, [=]() 17 0 17
1893 {
1894 18 dVAR; dXSARGS;
1895 18 ▶ if (items < 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 1) 0 18 18
1896 0 croak_xs_usage(cv, "THIS, ...");
1897 {
1898 Date * RETVAL;
1899 18 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 18 0 18
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 18 18
1900 ;
1901 #line 455 "xs/Date.xs"
1902 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
1903 if (items > 1) {
1904 ptime_t vals[] = {-1, -1, -1, -1, -1, -1, -1, -1};
1905 auto tz = list2vals(&ST(1), items - 1, vals);
1906 RETVAL = new Date(THIS->clone(vals[0], vals[1], vals[2], vals[3], vals[4], vals[5], vals[6], vals[7], tz));
1907 }
1908 else RETVAL = new Date(*THIS);
1909  
1910 if (RETVAL->error() && is_strict_mode()) {
1911 auto err = RETVAL->error();
1912 delete RETVAL;
1913 throw xs::out(err);
1914 }
1915  
1916 PROTO = Object(ST(0)).stash();
1917 #line 1918 "xs/Date_xsgen.cc"
1918 {
1919 SV * RETVALSV;
1920 17 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 17 0 17
1921 17 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 17 0 17
1922 17 ST(0) = RETVALSV;
1923 }
1924 18 }
1925 17 XSRETURN(1);
1926 17 }); }
1927  
1928  
1929  
1930 2 ▶XS_EUPXS(XS_Date_month_begin) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_month_begin) { xs::throw_guard(cv, [=]() 1 0 1
1931 {
1932 1 dVAR; dXSARGS;
1933 1 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 1 1
1934 0 croak_xs_usage(cv, "THIS");
1935 {
1936 SV * RETVAL;
1937 1 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 1 1
1938 ;
1939 #line 472 "xs/Date.xs"
1940 THIS->month_begin();
1941 XSRETURN(1);
1942 #line 1943 "xs/Date_xsgen.cc"
1943 RETVAL = sv_2mortal(RETVAL);
1944 ST(0) = RETVAL;
1945 }
1946 XSRETURN(1);
1947 1 }); }
1948  
1949  
1950  
1951 8 ▶XS_EUPXS(XS_Date_month_begin_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_month_begin_new) { xs::throw_guard(cv, [=]() 4 0 4
1952 {
1953 4 dVAR; dXSARGS;
1954 4 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 4 4
1955 0 croak_xs_usage(cv, "THIS");
1956 {
1957 Date * RETVAL;
1958 4 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 4 0 4
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 4 4
1959 ;
1960 #line 477 "xs/Date.xs"
1961 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
1962 RETVAL = new Date(THIS->month_begin_new());
1963 PROTO = Object(ST(0)).stash();
1964 #line 1965 "xs/Date_xsgen.cc"
1965 {
1966 SV * RETVALSV;
1967 4 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 4 0 4
1968 4 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 4 0 4
1969 4 ST(0) = RETVALSV;
1970 }
1971 4 }
1972 4 XSRETURN(1);
1973 4 }); }
1974  
1975  
1976  
1977 2 ▶XS_EUPXS(XS_Date_month_end) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_month_end) { xs::throw_guard(cv, [=]() 1 0 1
1978 {
1979 1 dVAR; dXSARGS;
1980 1 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 1 1
1981 0 croak_xs_usage(cv, "THIS");
1982 {
1983 SV * RETVAL;
1984 1 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 1 1
1985 ;
1986 #line 482 "xs/Date.xs"
1987 THIS->month_end();
1988 XSRETURN(1);
1989 #line 1990 "xs/Date_xsgen.cc"
1990 RETVAL = sv_2mortal(RETVAL);
1991 ST(0) = RETVAL;
1992 }
1993 XSRETURN(1);
1994 1 }); }
1995  
1996  
1997  
1998 8 ▶XS_EUPXS(XS_Date_month_end_new) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_month_end_new) { xs::throw_guard(cv, [=]() 4 0 4
1999 {
2000 4 dVAR; dXSARGS;
2001 4 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 4 4
2002 0 croak_xs_usage(cv, "THIS");
2003 {
2004 Date * RETVAL;
2005 4 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 4 0 4
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 4 4
2006 ;
2007 #line 487 "xs/Date.xs"
2008 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
2009 RETVAL = new Date(THIS->month_end_new());
2010 PROTO = Object(ST(0)).stash();
2011 #line 2012 "xs/Date_xsgen.cc"
2012 {
2013 SV * RETVALSV;
2014 4 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 4 0 4
2015 4 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 4 0 4
2016 4 ST(0) = RETVALSV;
2017 }
2018 4 }
2019 4 XSRETURN(1);
2020 4 }); }
2021  
2022  
2023  
2024 8 ▶XS_EUPXS(XS_Date_days_in_month) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_days_in_month) { xs::throw_guard(cv, [=]() 4 0 4
2025 {
2026 4 dVAR; dXSARGS;
2027 4 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 4 4
2028 0 croak_xs_usage(cv, "THIS");
2029 {
2030 int RETVAL;
2031 4 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 4 0 4
2032 4 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 4 4
2033 ;
2034 #line 492 "xs/Date.xs"
2035 RETVAL = THIS->days_in_month();
2036 #line 2037 "xs/Date_xsgen.cc"
2037 4 ▶ TARGi((IV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGi((IV)RETVAL, 1); 0 4 4
2038 4 ST(0) = TARG;
2039 }
2040 4 XSRETURN(1);
2041 4 }); }
2042  
2043  
2044  
2045 22 ▶XS_EUPXS(XS_Date_week_of_month) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_week_of_month) { xs::throw_guard(cv, [=]() 11 0 11
2046 {
2047 11 dVAR; dXSARGS;
2048 11 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 11 11
2049 0 croak_xs_usage(cv, "THIS");
2050 {
2051 uint8_t RETVAL;
2052 11 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 11 0 11
2053 11 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 11 11
2054 ;
2055 #line 495 "xs/Date.xs"
2056 RETVAL = THIS->week_of_month();
2057 #line 2058 "xs/Date_xsgen.cc"
2058 11 ▶ TARGu((UV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 0 11 11
2059 11 ST(0) = TARG;
2060 }
2061 11 XSRETURN(1);
2062 11 }); }
2063  
2064  
2065  
2066 16 ▶XS_EUPXS(XS_Date_weeks_in_year) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_weeks_in_year) { xs::throw_guard(cv, [=]() 8 0 8
2067 {
2068 8 dVAR; dXSARGS;
2069 8 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 8 8
2070 0 croak_xs_usage(cv, "THIS");
2071 {
2072 uint8_t RETVAL;
2073 8 ▶ dXSTARG;
Branch: 1 branch
BranchTrueFalseTotal
dXSTARG; 8 0 8
2074 8 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 8 8
2075 ;
2076 #line 497 "xs/Date.xs"
2077 RETVAL = THIS->weeks_in_year();
2078 #line 2079 "xs/Date_xsgen.cc"
2079 8 ▶ TARGu((UV)RETVAL, 1);
Branch: 1 branch
BranchTrueFalseTotal
TARGu((UV)RETVAL, 1); 0 8 8
2080 8 ST(0) = TARG;
2081 }
2082 8 XSRETURN(1);
2083 8 }); }
2084  
2085  
2086  
2087 32 ▶XS_EUPXS(XS_Date_week_of_year) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_week_of_year) { xs::throw_guard(cv, [=]() 16 0 16
2088 {
2089 16 dVAR; dXSARGS;
2090 16 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 16 16
2091 0 croak_xs_usage(cv, "THIS");
2092 PERL_UNUSED_VAR(ax); /* -Wall */
2093 16 SP -= items;
2094 {
2095 16 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 16 0 16
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 16 16
2096 ;
2097 #line 500 "xs/Date.xs"
2098 auto info = THIS->week_of_year();
2099 int rcnt = 1;
2100 if (GIMME_V == G_ARRAY) {
2101 mXPUSHi(info.year);
2102 rcnt = 2;
2103 }
2104 mXPUSHu(info.week);
2105 XSRETURN(rcnt);
2106 #line 2107 "xs/Date_xsgen.cc"
2107 PUTBACK;
2108 return;
2109 }
2110 16 }); }
2111  
2112  
2113  
2114 244 ▶XS_EUPXS(XS_Date_error) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_error) { xs::throw_guard(cv, [=]() 122 0 122
2115 {
2116 122 dVAR; dXSARGS;
2117 122 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 122 122
2118 0 croak_xs_usage(cv, "THIS");
2119 {
2120 122 std::error_code RETVAL;
2121 122 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 122 0 122
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 122 122
2122 ;
2123 #line 510 "xs/Date.xs"
2124 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
2125 RETVAL = THIS->error();
2126 #line 2127 "xs/Date_xsgen.cc"
2127 {
2128 SV * RETVALSV;
2129 122 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 122 0 122
2130 122 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 122 0 122
2131 122 ST(0) = RETVALSV;
2132 }
2133 122 }
2134 122 XSRETURN(1);
2135 122 }); }
2136  
2137  
2138  
2139 2 ▶XS_EUPXS(XS_Date_truncate) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_truncate) { xs::throw_guard(cv, [=]() 1 0 1
2140 {
2141 1 dVAR; dXSARGS;
2142 1 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 1 1
2143 0 croak_xs_usage(cv, "THIS");
2144 {
2145 SV * RETVAL;
2146 1 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 1 branch
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 1 1
2147 ;
2148 #line 513 "xs/Date.xs"
2149 THIS->truncate();
2150 XSRETURN(1);
2151 #line 2152 "xs/Date_xsgen.cc"
2152 RETVAL = sv_2mortal(RETVAL);
2153 ST(0) = RETVAL;
2154 }
2155 XSRETURN(1);
2156 1 }); }
2157  
2158  
2159  
2160 2 ▶XS_EUPXS(XS_Date_truncated) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_truncated) { xs::throw_guard(cv, [=]() 1 0 1
2161 {
2162 1 dVAR; dXSARGS;
2163 1 ▶ if (items != 1)
Branch: 1 branch
BranchTrueFalseTotal
if (items != 1) 0 1 1
2164 0 croak_xs_usage(cv, "THIS");
2165 {
2166 Date * RETVAL;
2167 1 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 1 0 1
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 1 1
2168 ;
2169 #line 518 "xs/Date.xs"
2170 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
2171 RETVAL = new Date(THIS->truncated());
2172 PROTO = Object(ST(0)).stash();
2173 #line 2174 "xs/Date_xsgen.cc"
2174 {
2175 SV * RETVALSV;
2176 1 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 1 0 1
2177 1 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 1 0 1
2178 1 ST(0) = RETVALSV;
2179 }
2180 1 }
2181 1 XSRETURN(1);
2182 1 }); }
2183  
2184  
2185  
2186 288 ▶XS_EUPXS(XS_Date_compare) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_compare) { xs::throw_guard(cv, [=]() 142 0 142
2187 {
2188 144 dVAR; dXSARGS;
2189 144 ▶ if (items < 2 || items > 3)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 2 || items > 3) 144 0 144
if (items < 2 || items > 3) 0 144 144
2190 0 croak_xs_usage(cv, "THIS, arg, reverse= false");
2191 {
2192 int RETVAL;
2193 144 ▶ dXSTARG;
Branch: 2 branches
BranchTrueFalseTotal
dXSTARG; 0 144 144
dXSTARG; 144 0 144
2194 144 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 144 0 144
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 144 144
2195 ;
2196 144 Sv arg = ST(1)
2197 ;
2198 bool reverse;
2199  
2200 144 ▶ if (items < 3)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 3) 0 144 144
2201 0 reverse = false;
2202 else {
2203 144 ▶ reverse = (bool)SvTRUE(ST(2))
Branch: 1 branch
BranchTrueFalseTotal
reverse = (bool)SvTRUE(ST(2)) 144 0 144
2204 ;
2205 }
2206 #line 523 "xs/Date.xs"
2207 if (arg.is_ref() && !arg.is_object_ref()) XSRETURN_IV(-1); // avoid exception in typemap for wrong types
2208 RETVAL = THIS->compare(sv2date(arg, THIS->timezone()));
2209 if (reverse) RETVAL = -RETVAL;
2210 if (RETVAL < 0) RETVAL = -1;
2211 else if (RETVAL > 0) RETVAL = 1;
2212 #line 2213 "xs/Date_xsgen.cc"
2213 140 ▶ TARGi((IV)RETVAL, 1);
Branch: 2 branches
BranchTrueFalseTotal
TARGi((IV)RETVAL, 1); 0 140 140
TARGi((IV)RETVAL, 1); 140 0 140
2214 140 ST(0) = TARG;
2215 144 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 140 2 142
2216 140 XSRETURN(1);
2217 142 }); }
2218  
2219  
2220  
2221 30 ▶XS_EUPXS(XS_Date_sum) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_sum) { xs::throw_guard(cv, [=]() 13 0 13
2222 {
2223 15 dVAR; dXSARGS;
2224 15 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 0 15 15
2225 0 croak_xs_usage(cv, "THIS, arg, ...");
2226 {
2227 Date * RETVAL;
2228 15 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 15 0 15
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 15 15
2229 ;
2230 15 Sv arg = ST(1)
2231 ;
2232 #line 531 "xs/Date.xs"
2233 xs::Sv PROTO; PERL_UNUSED_VAR(PROTO);
2234 RETVAL = new Date(*THIS + sv2daterel(arg));
2235 PROTO = Object(ST(0)).stash();
2236 #line 2237 "xs/Date_xsgen.cc"
2237 {
2238 SV * RETVALSV;
2239 13 ▶ RETVALSV = xs::out(RETVAL, PROTO).detach();
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = xs::out(RETVAL, PROTO).detach(); 13 0 13
2240 13 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 13 0 13
2241 13 ST(0) = RETVALSV;
2242 }
2243 17 }
2244 13 XSRETURN(1);
2245 13 }); }
2246  
2247  
2248  
2249 12 ▶XS_EUPXS(XS_Date_add) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_add) { xs::throw_guard(cv, [=]() 5 0 5
2250 {
2251 6 dVAR; dXSARGS;
2252 6 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 0 6 6
2253 0 croak_xs_usage(cv, "THIS, arg, ...");
2254 {
2255 SV * RETVAL;
2256 6 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 6 0 6
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 6 6
2257 ;
2258 6 Sv arg = ST(1)
2259 ;
2260 #line 536 "xs/Date.xs"
2261 *THIS += sv2daterel(arg);
2262 XSRETURN(1);
2263 #line 2264 "xs/Date_xsgen.cc"
2264 RETVAL = sv_2mortal(RETVAL);
2265 ST(0) = RETVAL;
2266 6 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 5 5
2267 0 XSRETURN(1);
2268 5 }); }
2269  
2270  
2271  
2272 10 ▶XS_EUPXS(XS_Date_difference) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_difference) { xs::throw_guard(cv, [=]() 4 0 4
2273 {
2274 5 dVAR; dXSARGS;
2275 5 ▶ if (items < 2 || items > 3)
Branch: 2 branches
BranchTrueFalseTotal
if (items < 2 || items > 3) 5 0 5
if (items < 2 || items > 3) 0 5 5
2276 0 croak_xs_usage(cv, "THIS, arg, reverse= false");
2277 {
2278 5 Sv RETVAL;
2279 5 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 5 0 5
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 5 5
2280 ;
2281 5 Sv arg = ST(1)
2282 ;
2283 bool reverse;
2284  
2285 5 ▶ if (items < 3)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 3) 0 5 5
2286 0 reverse = false;
2287 else {
2288 5 ▶ reverse = (bool)SvTRUE(ST(2))
Branch: 1 branch
BranchTrueFalseTotal
reverse = (bool)SvTRUE(ST(2)) 5 0 5
2289 ;
2290 }
2291 #line 541 "xs/Date.xs"
2292 bool is_date = arg.is_object_ref() && Object(arg).stash().name() == "Date";
2293 if (is_date) RETVAL = xs::out(new DateRel(*xs::in<Date*>(arg), *THIS));
2294 else if (reverse) throw "wrong date operation";
2295 else RETVAL = xs::out(new Date(*THIS - sv2daterel(arg)), Object(ST(0)).stash());
2296 #line 2297 "xs/Date_xsgen.cc"
2297 {
2298 SV * RETVALSV;
2299 4 RETVALSV = NULL;
2300 4 ▶ if (!RETVAL) XSRETURN_UNDEF;
Branch: 1 branch
BranchTrueFalseTotal
if (!RETVAL) XSRETURN_UNDEF; 0 4 4
2301 4 ▶ if (RETVAL.is_scalar()) RETVALSV = RETVAL.detach();
Branch: 2 branches
BranchTrueFalseTotal
if (RETVAL.is_scalar()) RETVALSV = RETVAL.detach(); 4 0 4
if (RETVAL.is_scalar()) RETVALSV = RETVAL.detach(); 4 0 4
2302 0 else switch (RETVAL.type()) {
2303 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
2304 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
2305 0 case SVt_PVCV:
2306 case SVt_PVIO:
2307 0 ▶ RETVALSV = newRV_noinc(RETVAL.detach());
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = newRV_noinc(RETVAL.detach()); 0 0 0
2308 0 break;
2309 0 default: throw "unknown type of Sv to return";
2310 }
2311 4 ▶ RETVALSV = sv_2mortal(RETVALSV);
Branch: 1 branch
BranchTrueFalseTotal
RETVALSV = sv_2mortal(RETVALSV); 4 0 4
2312 4 ST(0) = RETVALSV;
2313 }
2314 6 ▶ }
Branch: 2 branches
BranchTrueFalseTotal
} 4 0 4
} 4 0 4
2315 4 XSRETURN(1);
2316 4 }); }
2317  
2318  
2319  
2320 6 ▶XS_EUPXS(XS_Date_subtract) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date_subtract) { xs::throw_guard(cv, [=]() 2 0 2
2321 {
2322 3 dVAR; dXSARGS;
2323 3 ▶ if (items < 2)
Branch: 1 branch
BranchTrueFalseTotal
if (items < 2) 0 3 3
2324 0 croak_xs_usage(cv, "THIS, arg, ...");
2325 {
2326 SV * RETVAL;
2327 3 ▶ Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS";
Branch: 2 branches
BranchTrueFalseTotal
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 3 0 3
Date* THIS = xs::in<Date *>(ST(0)); if (!SvOK(ST(0))) throw "undef not allowed as THIS"; 0 3 3
2328 ;
2329 3 Sv arg = ST(1)
2330 ;
2331 #line 548 "xs/Date.xs"
2332 *THIS -= sv2daterel(arg);
2333 XSRETURN(1);
2334 #line 2335 "xs/Date_xsgen.cc"
2335 RETVAL = sv_2mortal(RETVAL);
2336 ST(0) = RETVAL;
2337 3 ▶ }
Branch: 1 branch
BranchTrueFalseTotal
} 0 2 2
2338 0 XSRETURN(1);
2339 2 }); }
2340  
2341  
2342  
2343 16 ▶XS_EUPXS(XS_Date___assign_stub) { xs::throw_guard(cv, [=]()
Branch: 1 branch
BranchTrueFalseTotal
XS_EUPXS(XS_Date___assign_stub) { xs::throw_guard(cv, [=]() 8 0 8
2344 {
2345 8 dVAR; dXSARGS;
2346 PERL_UNUSED_VAR(cv); /* -W */
2347 PERL_UNUSED_VAR(items); /* -W */
2348 PERL_UNUSED_VAR(ax); /* -Wall */
2349 8 ▶ SP -= items;
Branch: 1 branch
BranchTrueFalseTotal
SP -= items; 0 8 8
2350 {
2351 #line 553 "xs/Date.xs"
2352 if (!items) throw "should not happen";
2353 XSRETURN(1);
2354 #line 2355 "xs/Date_xsgen.cc"
2355 PUTBACK;
2356 return;
2357 }
2358 8 }); }
2359  
2360 #ifdef __cplusplus
2361 extern "C" {
2362 #endif
2363  
2364 96 ▶XS_EXTERNAL(boot_Date__Date) { xs::throw_guard(cv, [=]() mutable
Branch: 1 branch
BranchTrueFalseTotal
XS_EXTERNAL(boot_Date__Date) { xs::throw_guard(cv, [=]() mutable 48 0 48
2365 {
2366 #if PERL_VERSION_LE(5, 21, 5)
2367 dVAR; dXSARGS;
2368 #else
2369 48 dVAR; dXSBOOTARGSXSAPIVERCHK;
2370 #endif
2371 #if PERL_VERSION_LE(5, 8, 999) /* PERL_VERSION_LT is 5.33+ */
2372 char* file = __FILE__;
2373 #else
2374 48 const char* file = __FILE__;
2375 #endif
2376  
2377 PERL_UNUSED_VAR(file);
2378  
2379 PERL_UNUSED_VAR(cv); /* -W */
2380 PERL_UNUSED_VAR(items); /* -W */
2381 #if PERL_VERSION_LE(5, 21, 5)
2382 XS_VERSION_BOOTCHECK;
2383 # ifdef XS_APIVERSION_BOOTCHECK
2384 XS_APIVERSION_BOOTCHECK;
2385 # endif
2386 #endif
2387  
2388 48 newXS_deffile("Date::tzget", XS_Date_tzget);
2389 48 newXS_deffile("Date::tzset", XS_Date_tzset);
2390 48 newXS_deffile("Date::tzdir", XS_Date_tzdir);
2391 48 newXS_deffile("Date::tzsysdir", XS_Date_tzsysdir);
2392 48 newXS_deffile("Date::tzembededdir", XS_Date_tzembededdir);
2393 48 newXS_deffile("Date::available_timezones", XS_Date_available_timezones);
2394 48 newXS_deffile("Date::use_system_timezones", XS_Date_use_system_timezones);
2395 48 newXS_deffile("Date::use_embed_timezones", XS_Date_use_embed_timezones);
2396 48 cv = newXS_deffile("Date::anytime", XS_Date_gmtime);
2397 48 XSANY.any_i32 = 2;
2398 48 cv = newXS_deffile("Date::gmtime", XS_Date_gmtime);
2399 48 XSANY.any_i32 = 0;
2400 48 cv = newXS_deffile("Date::localtime", XS_Date_gmtime);
2401 48 XSANY.any_i32 = 1;
2402 48 cv = newXS_deffile("Date::timeany", XS_Date_timegm);
2403 48 XSANY.any_i32 = 2;
2404 48 cv = newXS_deffile("Date::timeanyn", XS_Date_timegm);
2405 48 XSANY.any_i32 = 5;
2406 48 cv = newXS_deffile("Date::timegm", XS_Date_timegm);
2407 48 XSANY.any_i32 = 0;
2408 48 cv = newXS_deffile("Date::timegmn", XS_Date_timegm);
2409 48 XSANY.any_i32 = 3;
2410 48 cv = newXS_deffile("Date::timelocal", XS_Date_timegm);
2411 48 XSANY.any_i32 = 1;
2412 48 cv = newXS_deffile("Date::timelocaln", XS_Date_timegm);
2413 48 XSANY.any_i32 = 4;
2414 48 newXS_deffile("Date::now", XS_Date_now);
2415 48 newXS_deffile("Date::now_hires", XS_Date_now_hires);
2416 48 newXS_deffile("Date::today", XS_Date_today);
2417 48 newXS_deffile("Date::today_epoch", XS_Date_today_epoch);
2418 48 newXS_deffile("Date::date", XS_Date_date);
2419 48 newXS_deffile("Date::date_ymd", XS_Date_date_ymd);
2420 48 newXS_deffile("Date::range_check", XS_Date_range_check);
2421 48 newXS_deffile("Date::new", XS_Date_new);
2422 48 newXS_deffile("Date::new_ymd", XS_Date_new_ymd);
2423 48 newXS_deffile("Date::strptime", XS_Date_strptime);
2424 48 newXS_deffile("Date::set", XS_Date_set);
2425 48 newXS_deffile("Date::set_ymd", XS_Date_set_ymd);
2426 48 newXS_deffile("Date::epoch", XS_Date_epoch);
2427 48 newXS_deffile("Date::epoch_sec", XS_Date_epoch_sec);
2428 48 newXS_deffile("Date::year", XS_Date_year);
2429 48 cv = newXS_deffile("Date::_year", XS_Date_c_year);
2430 48 XSANY.any_i32 = 1;
2431 48 cv = newXS_deffile("Date::c_year", XS_Date_c_year);
2432 48 XSANY.any_i32 = 0;
2433 48 newXS_deffile("Date::yr", XS_Date_yr);
2434 48 cv = newXS_deffile("Date::mon", XS_Date_month);
2435 48 XSANY.any_i32 = 1;
2436 48 cv = newXS_deffile("Date::month", XS_Date_month);
2437 48 XSANY.any_i32 = 0;
2438 48 cv = newXS_deffile("Date::_mon", XS_Date_c_month);
2439 48 XSANY.any_i32 = 2;
2440 48 cv = newXS_deffile("Date::_month", XS_Date_c_month);
2441 48 XSANY.any_i32 = 3;
2442 48 cv = newXS_deffile("Date::c_mon", XS_Date_c_month);
2443 48 XSANY.any_i32 = 1;
2444 48 cv = newXS_deffile("Date::c_month", XS_Date_c_month);
2445 48 XSANY.any_i32 = 0;
2446 48 cv = newXS_deffile("Date::day", XS_Date_day);
2447 48 XSANY.any_i32 = 0;
2448 48 cv = newXS_deffile("Date::day_of_month", XS_Date_day);
2449 48 XSANY.any_i32 = 2;
2450 48 cv = newXS_deffile("Date::mday", XS_Date_day);
2451 48 XSANY.any_i32 = 1;
2452 48 newXS_deffile("Date::hour", XS_Date_hour);
2453 48 cv = newXS_deffile("Date::min", XS_Date_min);
2454 48 XSANY.any_i32 = 0;
2455 48 cv = newXS_deffile("Date::minute", XS_Date_min);
2456 48 XSANY.any_i32 = 1;
2457 48 cv = newXS_deffile("Date::sec", XS_Date_sec);
2458 48 XSANY.any_i32 = 0;
2459 48 cv = newXS_deffile("Date::second", XS_Date_sec);
2460 48 XSANY.any_i32 = 1;
2461 48 newXS_deffile("Date::mksec", XS_Date_mksec);
2462 48 cv = newXS_deffile("Date::day_of_week", XS_Date_wday);
2463 48 XSANY.any_i32 = 1;
2464 48 cv = newXS_deffile("Date::wday", XS_Date_wday);
2465 48 XSANY.any_i32 = 0;
2466 48 cv = newXS_deffile("Date::_wday", XS_Date_c_wday);
2467 48 XSANY.any_i32 = 1;
2468 48 cv = newXS_deffile("Date::c_wday", XS_Date_c_wday);
2469 48 XSANY.any_i32 = 0;
2470 48 newXS_deffile("Date::ewday", XS_Date_ewday);
2471 48 cv = newXS_deffile("Date::day_of_year", XS_Date_yday);
2472 48 XSANY.any_i32 = 1;
2473 48 cv = newXS_deffile("Date::yday", XS_Date_yday);
2474 48 XSANY.any_i32 = 0;
2475 48 cv = newXS_deffile("Date::_yday", XS_Date_c_yday);
2476 48 XSANY.any_i32 = 1;
2477 48 cv = newXS_deffile("Date::c_yday", XS_Date_c_yday);
2478 48 XSANY.any_i32 = 0;
2479 48 cv = newXS_deffile("Date::daylight_savings", XS_Date_isdst);
2480 48 XSANY.any_i32 = 1;
2481 48 cv = newXS_deffile("Date::isdst", XS_Date_isdst);
2482 48 XSANY.any_i32 = 0;
2483 48 newXS_deffile("Date::to_string", XS_Date_to_string);
2484 48 newXS_deffile("Date::_op_str", XS_Date__op_str);
2485 48 newXS_deffile("Date::strftime", XS_Date_strftime);
2486 48 newXS_deffile("Date::to_bool", XS_Date_to_bool);
2487 48 newXS_deffile("Date::to_number", XS_Date_to_number);
2488 48 cv = newXS_deffile("Date::monname", XS_Date_month_name);
2489 48 XSANY.any_i32 = 1;
2490 48 cv = newXS_deffile("Date::month_name", XS_Date_month_name);
2491 48 XSANY.any_i32 = 0;
2492 48 cv = newXS_deffile("Date::monthname", XS_Date_month_name);
2493 48 XSANY.any_i32 = 2;
2494 48 newXS_deffile("Date::month_sname", XS_Date_month_sname);
2495 48 cv = newXS_deffile("Date::day_of_weekname", XS_Date_wday_name);
2496 48 XSANY.any_i32 = 1;
2497 48 cv = newXS_deffile("Date::wday_name", XS_Date_wday_name);
2498 48 XSANY.any_i32 = 0;
2499 48 cv = newXS_deffile("Date::wdayname", XS_Date_wday_name);
2500 48 XSANY.any_i32 = 2;
2501 48 newXS_deffile("Date::wday_sname", XS_Date_wday_sname);
2502 48 newXS_deffile("Date::gmtoff", XS_Date_gmtoff);
2503 48 newXS_deffile("Date::tzabbr", XS_Date_tzabbr);
2504 48 newXS_deffile("Date::tzname", XS_Date_tzname);
2505 48 newXS_deffile("Date::tzlocal", XS_Date_tzlocal);
2506 48 cv = newXS_deffile("Date::timezone", XS_Date_timezone);
2507 48 XSANY.any_i32 = 0;
2508 48 cv = newXS_deffile("Date::tz", XS_Date_timezone);
2509 48 XSANY.any_i32 = 1;
2510 48 cv = newXS_deffile("Date::zone", XS_Date_timezone);
2511 48 XSANY.any_i32 = 2;
2512 48 cv = newXS_deffile("Date::to_timezone", XS_Date_to_timezone);
2513 48 XSANY.any_i32 = 0;
2514 48 cv = newXS_deffile("Date::to_tz", XS_Date_to_timezone);
2515 48 XSANY.any_i32 = 1;
2516 48 cv = newXS_deffile("Date::to_zone", XS_Date_to_timezone);
2517 48 XSANY.any_i32 = 2;
2518 48 newXS_deffile("Date::array", XS_Date_array);
2519 48 newXS_deffile("Date::struct", XS_Date_struct);
2520 48 newXS_deffile("Date::clone", XS_Date_clone);
2521 48 newXS_deffile("Date::month_begin", XS_Date_month_begin);
2522 48 newXS_deffile("Date::month_begin_new", XS_Date_month_begin_new);
2523 48 newXS_deffile("Date::month_end", XS_Date_month_end);
2524 48 newXS_deffile("Date::month_end_new", XS_Date_month_end_new);
2525 48 newXS_deffile("Date::days_in_month", XS_Date_days_in_month);
2526 48 newXS_deffile("Date::week_of_month", XS_Date_week_of_month);
2527 48 newXS_deffile("Date::weeks_in_year", XS_Date_weeks_in_year);
2528 48 newXS_deffile("Date::week_of_year", XS_Date_week_of_year);
2529 48 newXS_deffile("Date::error", XS_Date_error);
2530 48 newXS_deffile("Date::truncate", XS_Date_truncate);
2531 48 newXS_deffile("Date::truncated", XS_Date_truncated);
2532 48 newXS_deffile("Date::compare", XS_Date_compare);
2533 48 newXS_deffile("Date::sum", XS_Date_sum);
2534 48 newXS_deffile("Date::add", XS_Date_add);
2535 48 newXS_deffile("Date::difference", XS_Date_difference);
2536 48 newXS_deffile("Date::subtract", XS_Date_subtract);
2537 48 newXS_deffile("Date::__assign_stub", XS_Date___assign_stub);
2538  
2539 /* Initialisation Section */
2540  
2541 #line 28 "xs/Date.xs"
2542 {
2543 Stash stash("Date");
2544  
2545 xs::exp::create_constants(stash, {
2546 {"FORMAT_ISO", (int)Date::Format::iso},
2547 {"FORMAT_ISO_TZ", (int)Date::Format::iso_tz},
2548 {"FORMAT_ISO_DATE", (int)Date::Format::iso_date},
2549 {"FORMAT_ISO8601", (int)Date::Format::iso8601},
2550 {"FORMAT_ISO8601_NOTZ", (int)Date::Format::iso8601_notz},
2551 {"FORMAT_RFC1123", (int)Date::Format::rfc1123},
2552 {"FORMAT_COOKIE", (int)Date::Format::cookie},
2553 {"FORMAT_RFC850", (int)Date::Format::rfc850},
2554 {"FORMAT_ANSI_C", (int)Date::Format::ansi_c},
2555 {"FORMAT_YMD", (int)Date::Format::ymd},
2556 {"FORMAT_DOT", (int)Date::Format::dot},
2557 {"FORMAT_HMS", (int)Date::Format::hms},
2558 {"FORMAT_CLF", (int)Date::Format::clf},
2559 {"FORMAT_CLF_BRACKETS", (int)Date::Format::clfb},
2560  
2561 {"INPUT_FORMAT_ALL", Date::InputFormat::all},
2562 {"INPUT_FORMAT_ISO", Date::InputFormat::iso},
2563 {"INPUT_FORMAT_ISO8601", Date::InputFormat::iso8601},
2564 {"INPUT_FORMAT_RFC1123", Date::InputFormat::rfc1123},
2565 {"INPUT_FORMAT_RFC850", Date::InputFormat::rfc850},
2566 {"INPUT_FORMAT_ANSI_C", Date::InputFormat::ansi_c},
2567 {"INPUT_FORMAT_DOT", Date::InputFormat::dot},
2568 {"INPUT_FORMAT_CLF", Date::InputFormat::clf},
2569 });
2570  
2571 Stash ecstash("Date::Error", GV_ADD);
2572 xs::exp::create_constants(ecstash, {
2573 {"parser_error", xs::out(make_error_code(errc::parser_error))},
2574 {"out_of_range", xs::out(make_error_code(errc::out_of_range))},
2575 });
2576  
2577 stash.add_const_sub("error_category", xs::out<const std::error_category*>(&error_category));
2578 }
2579  
2580 #line 2581 "xs/Date_xsgen.cc"
2581  
2582 /* End of Initialisation Section */
2583  
2584 #if PERL_VERSION_LE(5, 21, 5)
2585 # if PERL_VERSION_GE(5, 9, 0)
2586 if (PL_unitcheckav)
2587 call_list(PL_scopestack_ix, PL_unitcheckav);
2588 # endif
2589 XSRETURN_YES;
2590 #else
2591 48 Perl_xs_boot_epilog(aTHX_ ax);
2592 #endif
2593 432 ▶}); }
Branch: 30 branches
BranchTrueFalseTotal
}); } 48 0 48
}); } 48 0 48
}); } 48 0 48
}); } 48 0 48
}); } 48 0 48
}); } 48 0 48
}); } 48 0 48
}); } 48 0 48
}); } 48 0 48
}); } 48 0 48
}); } 48 0 48
}); } 48 0 48
}); } 48 0 48
}); } 48 0 48
}); } 48 0 48
}); } 48 0 48
}); } 48 0 48
}); } 48 0 48
}); } 48 0 48
}); } 48 0 48
}); } 48 0 48
}); } 48 0 48
}); } 48 0 48
}); } 48 0 48
}); } 48 0 48
}); } 48 0 48
}); } 0 0 0
}); } 0 0 0
}); } 0 0 0
}); } 0 0 0
2594  
2595 #ifdef __cplusplus
2596 }
2597 #endif
« xs/Date.xs ↑ Summary xs/main_xsgen.cc »