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