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