line |
stmt |
bran |
cond |
sub |
time |
code |
1
|
|
|
|
|
|
/******************************************************************************* |
2
|
|
|
|
|
|
* |
3
|
|
|
|
|
|
* !!!!! Do NOT edit this file directly! -- Edit PPPort_xs.PL instead. !!!!! |
4
|
|
|
|
|
|
* |
5
|
|
|
|
|
|
* This file was automatically generated from the definition files in the |
6
|
|
|
|
|
|
* parts/inc/ subdirectory by PPPort_xs.PL. To learn more about how all this |
7
|
|
|
|
|
|
* works, please read the F file that came with this distribution. |
8
|
|
|
|
|
|
* |
9
|
|
|
|
|
|
******************************************************************************** |
10
|
|
|
|
|
|
* |
11
|
|
|
|
|
|
* Perl/Pollution/Portability |
12
|
|
|
|
|
|
* |
13
|
|
|
|
|
|
******************************************************************************** |
14
|
|
|
|
|
|
* |
15
|
|
|
|
|
|
* Version 3.x, Copyright (C) 2004-2013, Marcus Holland-Moritz. |
16
|
|
|
|
|
|
* Version 2.x, Copyright (C) 2001, Paul Marquess. |
17
|
|
|
|
|
|
* Version 1.x, Copyright (C) 1999, Kenneth Albanowski. |
18
|
|
|
|
|
|
* |
19
|
|
|
|
|
|
* This program is free software; you can redistribute it and/or |
20
|
|
|
|
|
|
* modify it under the same terms as Perl itself. |
21
|
|
|
|
|
|
* |
22
|
|
|
|
|
|
*******************************************************************************/ |
23
|
|
|
|
|
|
|
24
|
|
|
|
|
|
/* ========== BEGIN XSHEAD ================================================== */ |
25
|
|
|
|
|
|
|
26
|
|
|
|
|
|
#define PERL_NO_GET_CONTEXT |
27
|
|
|
|
|
|
|
28
|
|
|
|
|
|
/* =========== END XSHEAD =================================================== */ |
29
|
|
|
|
|
|
|
30
|
|
|
|
|
|
#include "EXTERN.h" |
31
|
|
|
|
|
|
#include "perl.h" |
32
|
|
|
|
|
|
#include "XSUB.h" |
33
|
|
|
|
|
|
|
34
|
|
|
|
|
|
/* ========== BEGIN XSINIT ================================================== */ |
35
|
|
|
|
|
|
|
36
|
|
|
|
|
|
/* ---- code from parts/inc/call ---- */ |
37
|
|
|
|
|
|
#define NEED_eval_pv |
38
|
|
|
|
|
|
#define NEED_load_module |
39
|
|
|
|
|
|
#define NEED_vload_module |
40
|
|
|
|
|
|
|
41
|
|
|
|
|
|
/* ---- code from parts/inc/warn ---- */ |
42
|
|
|
|
|
|
#define NEED_warner |
43
|
|
|
|
|
|
|
44
|
|
|
|
|
|
/* ---- code from parts/inc/variables ---- */ |
45
|
|
|
|
|
|
#define NEED_PL_signals |
46
|
|
|
|
|
|
#define NEED_PL_parser |
47
|
|
|
|
|
|
#define DPPP_PL_parser_NO_DUMMY_WARNING |
48
|
|
|
|
|
|
|
49
|
|
|
|
|
|
/* ---- code from parts/inc/newSV_type ---- */ |
50
|
|
|
|
|
|
#define NEED_newSV_type |
51
|
|
|
|
|
|
|
52
|
|
|
|
|
|
/* ---- code from parts/inc/shared_pv ---- */ |
53
|
|
|
|
|
|
#define NEED_newSVpvn_share |
54
|
|
|
|
|
|
|
55
|
|
|
|
|
|
/* ---- code from parts/inc/strlfuncs ---- */ |
56
|
|
|
|
|
|
#define NEED_my_strlcat |
57
|
|
|
|
|
|
#define NEED_my_strlcpy |
58
|
|
|
|
|
|
|
59
|
|
|
|
|
|
/* ---- code from parts/inc/newSVpv ---- */ |
60
|
|
|
|
|
|
#define NEED_newSVpvn_flags |
61
|
|
|
|
|
|
|
62
|
|
|
|
|
|
/* ---- code from parts/inc/sv_xpvf ---- */ |
63
|
|
|
|
|
|
#define NEED_vnewSVpvf |
64
|
|
|
|
|
|
#define NEED_sv_catpvf_mg |
65
|
|
|
|
|
|
#define NEED_sv_catpvf_mg_nocontext |
66
|
|
|
|
|
|
#define NEED_sv_setpvf_mg |
67
|
|
|
|
|
|
#define NEED_sv_setpvf_mg_nocontext |
68
|
|
|
|
|
|
|
69
|
|
|
|
|
|
/* ---- code from parts/inc/snprintf ---- */ |
70
|
|
|
|
|
|
#define NEED_my_snprintf |
71
|
|
|
|
|
|
|
72
|
|
|
|
|
|
/* ---- code from parts/inc/newCONSTSUB ---- */ |
73
|
|
|
|
|
|
#define NEED_newCONSTSUB |
74
|
|
|
|
|
|
|
75
|
|
|
|
|
|
/* ---- code from parts/inc/newRV ---- */ |
76
|
|
|
|
|
|
#define NEED_newRV_noinc |
77
|
|
|
|
|
|
|
78
|
|
|
|
|
|
/* ---- code from parts/inc/SvPV ---- */ |
79
|
|
|
|
|
|
#define NEED_sv_2pv_flags |
80
|
|
|
|
|
|
#define NEED_sv_pvn_force_flags |
81
|
|
|
|
|
|
#define NEED_sv_2pvbyte |
82
|
|
|
|
|
|
|
83
|
|
|
|
|
|
/* ---- code from parts/inc/pv_tools ---- */ |
84
|
|
|
|
|
|
#define NEED_pv_escape |
85
|
|
|
|
|
|
#define NEED_pv_pretty |
86
|
|
|
|
|
|
#define NEED_pv_display |
87
|
|
|
|
|
|
|
88
|
|
|
|
|
|
/* ---- code from parts/inc/grok ---- */ |
89
|
|
|
|
|
|
#define NEED_grok_number |
90
|
|
|
|
|
|
#define NEED_grok_numeric_radix |
91
|
|
|
|
|
|
#define NEED_grok_bin |
92
|
|
|
|
|
|
#define NEED_grok_hex |
93
|
|
|
|
|
|
#define NEED_grok_oct |
94
|
|
|
|
|
|
|
95
|
|
|
|
|
|
/* ---- code from parts/inc/sprintf ---- */ |
96
|
|
|
|
|
|
#define NEED_my_sprintf |
97
|
|
|
|
|
|
|
98
|
|
|
|
|
|
/* ---- code from parts/inc/pvs ---- */ |
99
|
|
|
|
|
|
#define NEED_newSVpvn_share |
100
|
|
|
|
|
|
|
101
|
|
|
|
|
|
/* =========== END XSINIT =================================================== */ |
102
|
|
|
|
|
|
|
103
|
|
|
|
|
|
#include "ppport.h" |
104
|
|
|
|
|
|
|
105
|
|
|
|
|
|
/* ========== BEGIN XSMISC ================================================== */ |
106
|
|
|
|
|
|
|
107
|
|
|
|
|
|
/* ---- code from parts/inc/variables ---- */ |
108
|
2
|
|
|
|
|
U32 get_PL_signals_1(void) |
109
|
|
|
|
|
|
{ |
110
|
|
|
|
|
|
#ifdef PERL_NO_GET_CONTEXT |
111
|
|
|
|
|
|
dTHX; |
112
|
|
|
|
|
|
#endif |
113
|
2
|
|
|
|
|
return PL_signals; |
114
|
|
|
|
|
|
} |
115
|
|
|
|
|
|
|
116
|
|
|
|
|
|
extern U32 get_PL_signals_2(void); |
117
|
|
|
|
|
|
extern U32 get_PL_signals_3(void); |
118
|
|
|
|
|
|
int no_dummy_parser_vars(int); |
119
|
|
|
|
|
|
int dummy_parser_warning(void); |
120
|
|
|
|
|
|
|
121
|
|
|
|
|
|
#define ppp_TESTVAR(var) STMT_START { mXPUSHi(&var != NULL); count++; } STMT_END |
122
|
|
|
|
|
|
|
123
|
|
|
|
|
|
#define ppp_PARSERVAR(type, var) STMT_START { \ |
124
|
|
|
|
|
|
type volatile my_ ## var; \ |
125
|
|
|
|
|
|
type volatile *my_p_ ## var; \ |
126
|
|
|
|
|
|
my_ ## var = var; \ |
127
|
|
|
|
|
|
my_p_ ## var = &var; \ |
128
|
|
|
|
|
|
var = my_ ## var; \ |
129
|
|
|
|
|
|
var = *my_p_ ## var; \ |
130
|
|
|
|
|
|
mXPUSHi(&var != NULL); \ |
131
|
|
|
|
|
|
count++; \ |
132
|
|
|
|
|
|
} STMT_END |
133
|
|
|
|
|
|
|
134
|
|
|
|
|
|
#define ppp_PARSERVAR_dummy STMT_START { \ |
135
|
|
|
|
|
|
mXPUSHi(1); \ |
136
|
|
|
|
|
|
count++; \ |
137
|
|
|
|
|
|
} STMT_END |
138
|
|
|
|
|
|
|
139
|
|
|
|
|
|
#if (PERL_BCDVERSION < 0x5004000) |
140
|
|
|
|
|
|
# define ppp_rsfp_t FILE * |
141
|
|
|
|
|
|
#else |
142
|
|
|
|
|
|
# define ppp_rsfp_t PerlIO * |
143
|
|
|
|
|
|
#endif |
144
|
|
|
|
|
|
|
145
|
|
|
|
|
|
#if (PERL_BCDVERSION < 0x5006000) |
146
|
|
|
|
|
|
# define ppp_expect_t expectation |
147
|
|
|
|
|
|
#elif (PERL_BCDVERSION < 0x5009005) |
148
|
|
|
|
|
|
# define ppp_expect_t int |
149
|
|
|
|
|
|
#else |
150
|
|
|
|
|
|
# define ppp_expect_t U8 |
151
|
|
|
|
|
|
#endif |
152
|
|
|
|
|
|
|
153
|
|
|
|
|
|
#if (PERL_BCDVERSION < 0x5009005) |
154
|
|
|
|
|
|
# define ppp_lex_state_t U32 |
155
|
|
|
|
|
|
#else |
156
|
|
|
|
|
|
# define ppp_lex_state_t U8 |
157
|
|
|
|
|
|
#endif |
158
|
|
|
|
|
|
|
159
|
|
|
|
|
|
#if (PERL_BCDVERSION < 0x5006000) |
160
|
|
|
|
|
|
# define ppp_in_my_t bool |
161
|
|
|
|
|
|
#elif (PERL_BCDVERSION < 0x5009005) |
162
|
|
|
|
|
|
# define ppp_in_my_t I32 |
163
|
|
|
|
|
|
#else |
164
|
|
|
|
|
|
# define ppp_in_my_t U16 |
165
|
|
|
|
|
|
#endif |
166
|
|
|
|
|
|
|
167
|
|
|
|
|
|
#if (PERL_BCDVERSION < 0x5009005) |
168
|
|
|
|
|
|
# define ppp_error_count_t I32 |
169
|
|
|
|
|
|
#else |
170
|
|
|
|
|
|
# define ppp_error_count_t U8 |
171
|
|
|
|
|
|
#endif |
172
|
|
|
|
|
|
|
173
|
|
|
|
|
|
/* ---- code from parts/inc/sv_xpvf ---- */ |
174
|
2
|
|
|
|
|
static SV * test_vnewSVpvf(pTHX_ const char *pat, ...) |
175
|
|
|
|
|
|
{ |
176
|
|
|
|
|
|
SV *sv; |
177
|
|
|
|
|
|
va_list args; |
178
|
2
|
|
|
|
|
va_start(args, pat); |
179
|
|
|
|
|
|
#if (PERL_BCDVERSION >= 0x5004000) |
180
|
2
|
|
|
|
|
sv = vnewSVpvf(pat, &args); |
181
|
|
|
|
|
|
#else |
182
|
|
|
|
|
|
sv = newSVpv((char *) pat, 0); |
183
|
|
|
|
|
|
#endif |
184
|
2
|
|
|
|
|
va_end(args); |
185
|
2
|
|
|
|
|
return sv; |
186
|
|
|
|
|
|
} |
187
|
|
|
|
|
|
|
188
|
2
|
|
|
|
|
static void test_sv_vcatpvf(pTHX_ SV *sv, const char *pat, ...) |
189
|
|
|
|
|
|
{ |
190
|
|
|
|
|
|
va_list args; |
191
|
2
|
|
|
|
|
va_start(args, pat); |
192
|
|
|
|
|
|
#if (PERL_BCDVERSION >= 0x5004000) |
193
|
2
|
|
|
|
|
sv_vcatpvf(sv, pat, &args); |
194
|
|
|
|
|
|
#else |
195
|
|
|
|
|
|
sv_catpv(sv, (char *) pat); |
196
|
|
|
|
|
|
#endif |
197
|
2
|
|
|
|
|
va_end(args); |
198
|
2
|
|
|
|
|
} |
199
|
|
|
|
|
|
|
200
|
2
|
|
|
|
|
static void test_sv_vsetpvf(pTHX_ SV *sv, const char *pat, ...) |
201
|
|
|
|
|
|
{ |
202
|
|
|
|
|
|
va_list args; |
203
|
2
|
|
|
|
|
va_start(args, pat); |
204
|
|
|
|
|
|
#if (PERL_BCDVERSION >= 0x5004000) |
205
|
2
|
|
|
|
|
sv_vsetpvf(sv, pat, &args); |
206
|
|
|
|
|
|
#else |
207
|
|
|
|
|
|
sv_setpv(sv, (char *) pat); |
208
|
|
|
|
|
|
#endif |
209
|
2
|
|
|
|
|
va_end(args); |
210
|
2
|
|
|
|
|
} |
211
|
|
|
|
|
|
|
212
|
|
|
|
|
|
/* ---- code from parts/inc/exception ---- */ |
213
|
|
|
|
|
|
/* defined in module3.c */ |
214
|
|
|
|
|
|
int exception(int throw_e); |
215
|
|
|
|
|
|
|
216
|
|
|
|
|
|
/* ---- code from parts/inc/newCONSTSUB ---- */ |
217
|
2
|
|
|
|
|
void call_newCONSTSUB_1(void) |
218
|
|
|
|
|
|
{ |
219
|
|
|
|
|
|
#ifdef PERL_NO_GET_CONTEXT |
220
|
|
|
|
|
|
dTHX; |
221
|
|
|
|
|
|
#endif |
222
|
2
|
|
|
|
|
newCONSTSUB(gv_stashpv("Devel::PPPort", FALSE), "test_value_1", newSViv(1)); |
223
|
2
|
|
|
|
|
} |
224
|
|
|
|
|
|
|
225
|
|
|
|
|
|
extern void call_newCONSTSUB_2(void); |
226
|
|
|
|
|
|
extern void call_newCONSTSUB_3(void); |
227
|
|
|
|
|
|
|
228
|
|
|
|
|
|
/* ---- code from parts/inc/MY_CXT ---- */ |
229
|
|
|
|
|
|
#define MY_CXT_KEY "Devel::PPPort::_guts" XS_VERSION |
230
|
|
|
|
|
|
|
231
|
|
|
|
|
|
typedef struct { |
232
|
|
|
|
|
|
/* Put Global Data in here */ |
233
|
|
|
|
|
|
int dummy; |
234
|
|
|
|
|
|
} my_cxt_t; |
235
|
|
|
|
|
|
|
236
|
|
|
|
|
|
START_MY_CXT |
237
|
|
|
|
|
|
|
238
|
|
|
|
|
|
/* ---- code from parts/inc/misc ---- */ |
239
|
|
|
|
|
|
typedef XSPROTO(XSPROTO_test_t); |
240
|
|
|
|
|
|
typedef XSPROTO_test_t *XSPROTO_test_t_ptr; |
241
|
|
|
|
|
|
|
242
|
|
|
|
|
|
XS(XS_Devel__PPPort_dXSTARG); /* prototype */ |
243
|
2
|
|
|
|
|
XS(XS_Devel__PPPort_dXSTARG) |
244
|
|
|
|
|
|
{ |
245
|
2
|
|
|
|
|
dXSARGS; |
246
|
2
|
|
|
|
|
dXSTARG; |
247
|
|
|
|
|
|
IV iv; |
248
|
2
|
|
|
|
|
SP -= items; |
249
|
2
|
|
|
|
|
iv = SvIV(ST(0)) + 1; |
250
|
2
|
|
|
|
|
PUSHi(iv); |
251
|
2
|
|
|
|
|
XSRETURN(1); |
252
|
|
|
|
|
|
} |
253
|
|
|
|
|
|
|
254
|
|
|
|
|
|
XS(XS_Devel__PPPort_dAXMARK); /* prototype */ |
255
|
2
|
|
|
|
|
XS(XS_Devel__PPPort_dAXMARK) |
256
|
|
|
|
|
|
{ |
257
|
2
|
|
|
|
|
dSP; |
258
|
2
|
|
|
|
|
dAXMARK; |
259
|
2
|
|
|
|
|
dITEMS; |
260
|
|
|
|
|
|
IV iv; |
261
|
2
|
|
|
|
|
SP -= items; |
262
|
2
|
|
|
|
|
iv = SvIV(ST(0)) - 1; |
263
|
2
|
|
|
|
|
mPUSHi(iv); |
264
|
2
|
|
|
|
|
XSRETURN(1); |
265
|
|
|
|
|
|
} |
266
|
|
|
|
|
|
|
267
|
|
|
|
|
|
/* =========== END XSMISC =================================================== */ |
268
|
|
|
|
|
|
|
269
|
|
|
|
|
|
MODULE = Devel::PPPort PACKAGE = Devel::PPPort |
270
|
|
|
|
|
|
|
271
|
|
|
|
|
|
BOOT: |
272
|
|
|
|
|
|
/* ---- code from parts/inc/MY_CXT ---- */ |
273
|
|
|
|
|
|
{ |
274
|
|
|
|
|
|
MY_CXT_INIT; |
275
|
|
|
|
|
|
/* If any of the fields in the my_cxt_t struct need |
276
|
|
|
|
|
|
* to be initialised, do it here. |
277
|
|
|
|
|
|
*/ |
278
|
66
|
|
|
|
|
MY_CXT.dummy = 42; |
279
|
|
|
|
|
|
} |
280
|
|
|
|
|
|
|
281
|
|
|
|
|
|
/* ---- code from parts/inc/misc ---- */ |
282
|
|
|
|
|
|
{ |
283
|
|
|
|
|
|
XSPROTO_test_t_ptr p = &XS_Devel__PPPort_dXSTARG; |
284
|
66
|
|
|
|
|
newXS("Devel::PPPort::dXSTARG", *p, file); |
285
|
|
|
|
|
|
} |
286
|
66
|
|
|
|
|
newXS("Devel::PPPort::dAXMARK", XS_Devel__PPPort_dAXMARK, file); |
287
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
289
|
|
|
|
|
|
##---------------------------------------------------------------------- |
290
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/call |
291
|
|
|
|
|
|
##---------------------------------------------------------------------- |
292
|
|
|
|
|
|
|
293
|
|
|
|
|
|
I32 |
294
|
|
|
|
|
|
G_SCALAR() |
295
|
|
|
|
|
|
CODE: |
296
|
|
|
|
|
|
RETVAL = G_SCALAR; |
297
|
|
|
|
|
|
OUTPUT: |
298
|
|
|
|
|
|
RETVAL |
299
|
|
|
|
|
|
|
300
|
|
|
|
|
|
I32 |
301
|
|
|
|
|
|
G_ARRAY() |
302
|
|
|
|
|
|
CODE: |
303
|
|
|
|
|
|
RETVAL = G_ARRAY; |
304
|
|
|
|
|
|
OUTPUT: |
305
|
|
|
|
|
|
RETVAL |
306
|
|
|
|
|
|
|
307
|
|
|
|
|
|
I32 |
308
|
|
|
|
|
|
G_DISCARD() |
309
|
|
|
|
|
|
CODE: |
310
|
|
|
|
|
|
RETVAL = G_DISCARD; |
311
|
|
|
|
|
|
OUTPUT: |
312
|
|
|
|
|
|
RETVAL |
313
|
|
|
|
|
|
|
314
|
|
|
|
|
|
void |
315
|
|
|
|
|
|
eval_sv(sv, flags) |
316
|
|
|
|
|
|
SV* sv |
317
|
|
|
|
|
|
I32 flags |
318
|
|
|
|
|
|
PREINIT: |
319
|
|
|
|
|
|
I32 i; |
320
|
|
|
|
|
|
PPCODE: |
321
|
12
|
|
|
|
|
PUTBACK; |
322
|
12
|
|
|
|
|
i = eval_sv(sv, flags); |
323
|
12
|
|
|
|
|
SPAGAIN; |
324
|
12
|
|
|
|
|
EXTEND(SP, 1); |
325
|
12
|
|
|
|
|
mPUSHi(i); |
326
|
|
|
|
|
|
|
327
|
|
|
|
|
|
void |
328
|
|
|
|
|
|
eval_pv(p, croak_on_error) |
329
|
|
|
|
|
|
char* p |
330
|
|
|
|
|
|
I32 croak_on_error |
331
|
|
|
|
|
|
PPCODE: |
332
|
4
|
|
|
|
|
PUTBACK; |
333
|
4
|
|
|
|
|
EXTEND(SP, 1); |
334
|
4
|
|
|
|
|
PUSHs(eval_pv(p, croak_on_error)); |
335
|
|
|
|
|
|
|
336
|
|
|
|
|
|
void |
337
|
|
|
|
|
|
call_sv(sv, flags, ...) |
338
|
|
|
|
|
|
SV* sv |
339
|
|
|
|
|
|
I32 flags |
340
|
|
|
|
|
|
PREINIT: |
341
|
|
|
|
|
|
I32 i; |
342
|
|
|
|
|
|
PPCODE: |
343
|
90
|
|
|
|
|
for (i=0; i
|
344
|
54
|
|
|
|
|
ST(i) = ST(i+2); /* pop first two args */ |
345
|
36
|
|
|
|
|
PUSHMARK(SP); |
346
|
36
|
|
|
|
|
SP += items - 2; |
347
|
36
|
|
|
|
|
PUTBACK; |
348
|
36
|
|
|
|
|
i = call_sv(sv, flags); |
349
|
36
|
|
|
|
|
SPAGAIN; |
350
|
36
|
|
|
|
|
EXTEND(SP, 1); |
351
|
36
|
|
|
|
|
mPUSHi(i); |
352
|
|
|
|
|
|
|
353
|
|
|
|
|
|
void |
354
|
|
|
|
|
|
call_pv(subname, flags, ...) |
355
|
|
|
|
|
|
char* subname |
356
|
|
|
|
|
|
I32 flags |
357
|
|
|
|
|
|
PREINIT: |
358
|
|
|
|
|
|
I32 i; |
359
|
|
|
|
|
|
PPCODE: |
360
|
30
|
|
|
|
|
for (i=0; i
|
361
|
18
|
|
|
|
|
ST(i) = ST(i+2); /* pop first two args */ |
362
|
12
|
|
|
|
|
PUSHMARK(SP); |
363
|
12
|
|
|
|
|
SP += items - 2; |
364
|
12
|
|
|
|
|
PUTBACK; |
365
|
12
|
|
|
|
|
i = call_pv(subname, flags); |
366
|
12
|
|
|
|
|
SPAGAIN; |
367
|
12
|
|
|
|
|
EXTEND(SP, 1); |
368
|
12
|
|
|
|
|
mPUSHi(i); |
369
|
|
|
|
|
|
|
370
|
|
|
|
|
|
void |
371
|
|
|
|
|
|
call_argv(subname, flags, ...) |
372
|
|
|
|
|
|
char* subname |
373
|
|
|
|
|
|
I32 flags |
374
|
|
|
|
|
|
PREINIT: |
375
|
|
|
|
|
|
I32 i; |
376
|
|
|
|
|
|
char *args[8]; |
377
|
|
|
|
|
|
PPCODE: |
378
|
12
|
|
|
|
|
if (items > 8) /* play safe */ |
379
|
0
|
|
|
|
|
XSRETURN_UNDEF; |
380
|
18
|
|
|
|
|
for (i=2; i
|
381
|
18
|
|
|
|
|
args[i-2] = SvPV_nolen(ST(i)); |
382
|
12
|
|
|
|
|
args[items-2] = NULL; |
383
|
12
|
|
|
|
|
PUTBACK; |
384
|
12
|
|
|
|
|
i = call_argv(subname, flags, args); |
385
|
12
|
|
|
|
|
SPAGAIN; |
386
|
12
|
|
|
|
|
EXTEND(SP, 1); |
387
|
12
|
|
|
|
|
mPUSHi(i); |
388
|
|
|
|
|
|
|
389
|
|
|
|
|
|
void |
390
|
|
|
|
|
|
call_method(methname, flags, ...) |
391
|
|
|
|
|
|
char* methname |
392
|
|
|
|
|
|
I32 flags |
393
|
|
|
|
|
|
PREINIT: |
394
|
|
|
|
|
|
I32 i; |
395
|
|
|
|
|
|
PPCODE: |
396
|
42
|
|
|
|
|
for (i=0; i
|
397
|
30
|
|
|
|
|
ST(i) = ST(i+2); /* pop first two args */ |
398
|
12
|
|
|
|
|
PUSHMARK(SP); |
399
|
12
|
|
|
|
|
SP += items - 2; |
400
|
12
|
|
|
|
|
PUTBACK; |
401
|
12
|
|
|
|
|
i = call_method(methname, flags); |
402
|
12
|
|
|
|
|
SPAGAIN; |
403
|
12
|
|
|
|
|
EXTEND(SP, 1); |
404
|
12
|
|
|
|
|
mPUSHi(i); |
405
|
|
|
|
|
|
|
406
|
|
|
|
|
|
void |
407
|
|
|
|
|
|
call_sv_G_METHOD(sv, flags, ...) |
408
|
|
|
|
|
|
SV* sv |
409
|
|
|
|
|
|
I32 flags |
410
|
|
|
|
|
|
PREINIT: |
411
|
|
|
|
|
|
I32 i; |
412
|
|
|
|
|
|
PPCODE: |
413
|
42
|
|
|
|
|
for (i=0; i
|
414
|
30
|
|
|
|
|
ST(i) = ST(i+2); /* pop first two args */ |
415
|
12
|
|
|
|
|
PUSHMARK(SP); |
416
|
12
|
|
|
|
|
SP += items - 2; |
417
|
12
|
|
|
|
|
PUTBACK; |
418
|
12
|
|
|
|
|
i = call_sv(sv, flags | G_METHOD); |
419
|
12
|
|
|
|
|
SPAGAIN; |
420
|
12
|
|
|
|
|
EXTEND(SP, 1); |
421
|
12
|
|
|
|
|
mPUSHi(i); |
422
|
|
|
|
|
|
|
423
|
|
|
|
|
|
void |
424
|
|
|
|
|
|
load_module(flags, name, version, ...) |
425
|
|
|
|
|
|
U32 flags |
426
|
|
|
|
|
|
SV *name |
427
|
|
|
|
|
|
SV *version |
428
|
|
|
|
|
|
CODE: |
429
|
|
|
|
|
|
/* Both SV parameters are donated to the ops built inside |
430
|
|
|
|
|
|
load_module, so we need to bump the refcounts. */ |
431
|
2
|
|
|
|
|
Perl_load_module(aTHX_ flags, SvREFCNT_inc_simple(name), |
432
|
|
|
|
|
|
SvREFCNT_inc_simple(version), NULL); |
433
|
|
|
|
|
|
|
434
|
|
|
|
|
|
##---------------------------------------------------------------------- |
435
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/warn |
436
|
|
|
|
|
|
##---------------------------------------------------------------------- |
437
|
|
|
|
|
|
|
438
|
|
|
|
|
|
void |
439
|
|
|
|
|
|
warner() |
440
|
|
|
|
|
|
CODE: |
441
|
|
|
|
|
|
#if (PERL_BCDVERSION >= 0x5004000) |
442
|
2
|
|
|
|
|
warner(packWARN(WARN_MISC), "warner %s:%d", "bar", 42); |
443
|
|
|
|
|
|
#endif |
444
|
|
|
|
|
|
|
445
|
|
|
|
|
|
void |
446
|
|
|
|
|
|
Perl_warner() |
447
|
|
|
|
|
|
CODE: |
448
|
|
|
|
|
|
#if (PERL_BCDVERSION >= 0x5004000) |
449
|
2
|
|
|
|
|
Perl_warner(aTHX_ packWARN(WARN_MISC), "Perl_warner %s:%d", "bar", 42); |
450
|
|
|
|
|
|
#endif |
451
|
|
|
|
|
|
|
452
|
|
|
|
|
|
void |
453
|
|
|
|
|
|
Perl_warner_nocontext() |
454
|
|
|
|
|
|
CODE: |
455
|
|
|
|
|
|
#if (PERL_BCDVERSION >= 0x5004000) |
456
|
2
|
|
|
|
|
Perl_warner_nocontext(packWARN(WARN_MISC), "Perl_warner_nocontext %s:%d", "bar", 42); |
457
|
|
|
|
|
|
#endif |
458
|
|
|
|
|
|
|
459
|
|
|
|
|
|
void |
460
|
|
|
|
|
|
ckWARN() |
461
|
|
|
|
|
|
CODE: |
462
|
|
|
|
|
|
#if (PERL_BCDVERSION >= 0x5004000) |
463
|
4
|
|
|
|
|
if (ckWARN(WARN_MISC)) |
464
|
2
|
|
|
|
|
Perl_warner_nocontext(packWARN(WARN_MISC), "ckWARN %s:%d", "bar", 42); |
465
|
|
|
|
|
|
#endif |
466
|
|
|
|
|
|
|
467
|
|
|
|
|
|
##---------------------------------------------------------------------- |
468
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/variables |
469
|
|
|
|
|
|
##---------------------------------------------------------------------- |
470
|
|
|
|
|
|
|
471
|
|
|
|
|
|
int |
472
|
|
|
|
|
|
compare_PL_signals() |
473
|
|
|
|
|
|
CODE: |
474
|
|
|
|
|
|
{ |
475
|
2
|
|
|
|
|
U32 ref = get_PL_signals_1(); |
476
|
2
|
|
|
|
|
RETVAL = ref == get_PL_signals_2() && ref == get_PL_signals_3(); |
477
|
|
|
|
|
|
} |
478
|
|
|
|
|
|
OUTPUT: |
479
|
|
|
|
|
|
RETVAL |
480
|
|
|
|
|
|
|
481
|
|
|
|
|
|
SV * |
482
|
|
|
|
|
|
PL_sv_undef() |
483
|
|
|
|
|
|
CODE: |
484
|
2
|
|
|
|
|
RETVAL = newSVsv(&PL_sv_undef); |
485
|
|
|
|
|
|
OUTPUT: |
486
|
|
|
|
|
|
RETVAL |
487
|
|
|
|
|
|
|
488
|
|
|
|
|
|
SV * |
489
|
|
|
|
|
|
PL_sv_yes() |
490
|
|
|
|
|
|
CODE: |
491
|
2
|
|
|
|
|
RETVAL = newSVsv(&PL_sv_yes); |
492
|
|
|
|
|
|
OUTPUT: |
493
|
|
|
|
|
|
RETVAL |
494
|
|
|
|
|
|
|
495
|
|
|
|
|
|
SV * |
496
|
|
|
|
|
|
PL_sv_no() |
497
|
|
|
|
|
|
CODE: |
498
|
2
|
|
|
|
|
RETVAL = newSVsv(&PL_sv_no); |
499
|
|
|
|
|
|
OUTPUT: |
500
|
|
|
|
|
|
RETVAL |
501
|
|
|
|
|
|
|
502
|
|
|
|
|
|
int |
503
|
|
|
|
|
|
PL_na(string) |
504
|
|
|
|
|
|
char *string |
505
|
|
|
|
|
|
CODE: |
506
|
2
|
|
|
|
|
PL_na = strlen(string); |
507
|
2
|
|
|
|
|
RETVAL = PL_na; |
508
|
|
|
|
|
|
OUTPUT: |
509
|
|
|
|
|
|
RETVAL |
510
|
|
|
|
|
|
|
511
|
|
|
|
|
|
SV * |
512
|
|
|
|
|
|
PL_Sv() |
513
|
|
|
|
|
|
CODE: |
514
|
2
|
|
|
|
|
PL_Sv = newSVpv("mhx", 0); |
515
|
2
|
|
|
|
|
RETVAL = PL_Sv; |
516
|
|
|
|
|
|
OUTPUT: |
517
|
|
|
|
|
|
RETVAL |
518
|
|
|
|
|
|
|
519
|
|
|
|
|
|
SV * |
520
|
|
|
|
|
|
PL_tokenbuf() |
521
|
|
|
|
|
|
CODE: |
522
|
2
|
|
|
|
|
RETVAL = newSViv(PL_tokenbuf[0]); |
523
|
|
|
|
|
|
OUTPUT: |
524
|
|
|
|
|
|
RETVAL |
525
|
|
|
|
|
|
|
526
|
|
|
|
|
|
SV * |
527
|
|
|
|
|
|
PL_parser() |
528
|
|
|
|
|
|
CODE: |
529
|
0
|
|
|
|
|
RETVAL = newSViv(PL_parser != NULL); |
530
|
|
|
|
|
|
OUTPUT: |
531
|
|
|
|
|
|
RETVAL |
532
|
|
|
|
|
|
|
533
|
|
|
|
|
|
SV * |
534
|
|
|
|
|
|
PL_hexdigit() |
535
|
|
|
|
|
|
CODE: |
536
|
2
|
|
|
|
|
RETVAL = newSVpv((char *) PL_hexdigit, 0); |
537
|
|
|
|
|
|
OUTPUT: |
538
|
|
|
|
|
|
RETVAL |
539
|
|
|
|
|
|
|
540
|
|
|
|
|
|
SV * |
541
|
|
|
|
|
|
PL_hints() |
542
|
|
|
|
|
|
CODE: |
543
|
2
|
|
|
|
|
RETVAL = newSViv((IV) PL_hints); |
544
|
|
|
|
|
|
OUTPUT: |
545
|
|
|
|
|
|
RETVAL |
546
|
|
|
|
|
|
|
547
|
|
|
|
|
|
void |
548
|
|
|
|
|
|
PL_ppaddr(string) |
549
|
|
|
|
|
|
char *string |
550
|
|
|
|
|
|
PPCODE: |
551
|
2
|
|
|
|
|
PUSHMARK(SP); |
552
|
2
|
|
|
|
|
mXPUSHs(newSVpv(string, 0)); |
553
|
2
|
|
|
|
|
PUTBACK; |
554
|
2
|
|
|
|
|
ENTER; |
555
|
2
|
|
|
|
|
(void)*(PL_ppaddr[OP_UC])(aTHXR); |
556
|
|
|
|
|
|
SPAGAIN; |
557
|
2
|
|
|
|
|
LEAVE; |
558
|
2
|
|
|
|
|
XSRETURN(1); |
559
|
|
|
|
|
|
|
560
|
|
|
|
|
|
void |
561
|
|
|
|
|
|
other_variables() |
562
|
|
|
|
|
|
PREINIT: |
563
|
|
|
|
|
|
int count = 0; |
564
|
|
|
|
|
|
PPCODE: |
565
|
2
|
|
|
|
|
ppp_TESTVAR(PL_DBsignal); |
566
|
2
|
|
|
|
|
ppp_TESTVAR(PL_DBsingle); |
567
|
2
|
|
|
|
|
ppp_TESTVAR(PL_DBsub); |
568
|
2
|
|
|
|
|
ppp_TESTVAR(PL_DBtrace); |
569
|
2
|
|
|
|
|
ppp_TESTVAR(PL_compiling); |
570
|
2
|
|
|
|
|
ppp_TESTVAR(PL_curcop); |
571
|
2
|
|
|
|
|
ppp_TESTVAR(PL_curstash); |
572
|
2
|
|
|
|
|
ppp_TESTVAR(PL_debstash); |
573
|
2
|
|
|
|
|
ppp_TESTVAR(PL_defgv); |
574
|
2
|
|
|
|
|
ppp_TESTVAR(PL_diehook); |
575
|
|
|
|
|
|
#if (PERL_BCDVERSION >= 0x5013007) |
576
|
|
|
|
|
|
/* can't get a pointer any longer */ |
577
|
2
|
|
|
|
|
mXPUSHi(PL_dirty ? 1 : 1); |
578
|
|
|
|
|
|
count++; |
579
|
|
|
|
|
|
#else |
580
|
|
|
|
|
|
ppp_TESTVAR(PL_dirty); |
581
|
|
|
|
|
|
#endif |
582
|
2
|
|
|
|
|
ppp_TESTVAR(PL_dowarn); |
583
|
2
|
|
|
|
|
ppp_TESTVAR(PL_errgv); |
584
|
2
|
|
|
|
|
ppp_TESTVAR(PL_laststatval); |
585
|
2
|
|
|
|
|
ppp_TESTVAR(PL_no_modify); |
586
|
2
|
|
|
|
|
ppp_TESTVAR(PL_perl_destruct_level); |
587
|
2
|
|
|
|
|
ppp_TESTVAR(PL_perldb); |
588
|
2
|
|
|
|
|
ppp_TESTVAR(PL_stack_base); |
589
|
2
|
|
|
|
|
ppp_TESTVAR(PL_stack_sp); |
590
|
2
|
|
|
|
|
ppp_TESTVAR(PL_statcache); |
591
|
2
|
|
|
|
|
ppp_TESTVAR(PL_stdingv); |
592
|
2
|
|
|
|
|
ppp_TESTVAR(PL_sv_arenaroot); |
593
|
2
|
|
|
|
|
ppp_TESTVAR(PL_tainted); |
594
|
2
|
|
|
|
|
ppp_TESTVAR(PL_tainting); |
595
|
|
|
|
|
|
|
596
|
2
|
|
|
|
|
ppp_PARSERVAR(ppp_expect_t, PL_expect); |
597
|
2
|
|
|
|
|
ppp_PARSERVAR(line_t, PL_copline); |
598
|
2
|
|
|
|
|
ppp_PARSERVAR(ppp_rsfp_t, PL_rsfp); |
599
|
2
|
|
|
|
|
ppp_PARSERVAR(AV *, PL_rsfp_filters); |
600
|
2
|
|
|
|
|
ppp_PARSERVAR(SV *, PL_linestr); |
601
|
2
|
|
|
|
|
ppp_PARSERVAR(char *, PL_bufptr); |
602
|
2
|
|
|
|
|
ppp_PARSERVAR(char *, PL_bufend); |
603
|
2
|
|
|
|
|
ppp_PARSERVAR(ppp_lex_state_t, PL_lex_state); |
604
|
2
|
|
|
|
|
ppp_PARSERVAR(SV *, PL_lex_stuff); |
605
|
2
|
|
|
|
|
ppp_PARSERVAR(ppp_error_count_t, PL_error_count); |
606
|
2
|
|
|
|
|
ppp_PARSERVAR(ppp_in_my_t, PL_in_my); |
607
|
|
|
|
|
|
#if (PERL_BCDVERSION >= 0x5005000) |
608
|
2
|
|
|
|
|
ppp_PARSERVAR(HV*, PL_in_my_stash); |
609
|
|
|
|
|
|
#else |
610
|
|
|
|
|
|
ppp_PARSERVAR_dummy; |
611
|
|
|
|
|
|
#endif |
612
|
2
|
|
|
|
|
XSRETURN(count); |
613
|
|
|
|
|
|
|
614
|
|
|
|
|
|
int |
615
|
|
|
|
|
|
no_dummy_parser_vars(check) |
616
|
|
|
|
|
|
int check |
617
|
|
|
|
|
|
|
618
|
|
|
|
|
|
int |
619
|
|
|
|
|
|
dummy_parser_warning() |
620
|
|
|
|
|
|
|
621
|
|
|
|
|
|
##---------------------------------------------------------------------- |
622
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/gv |
623
|
|
|
|
|
|
##---------------------------------------------------------------------- |
624
|
|
|
|
|
|
|
625
|
|
|
|
|
|
int |
626
|
|
|
|
|
|
GvSVn() |
627
|
|
|
|
|
|
PREINIT: |
628
|
|
|
|
|
|
GV* gv; |
629
|
|
|
|
|
|
CODE: |
630
|
|
|
|
|
|
RETVAL = 0; |
631
|
2
|
|
|
|
|
gv = gv_fetchpvs("Devel::PPPort::GvTest", GV_ADDMULTI, SVt_PVGV); |
632
|
2
|
|
|
|
|
if (GvSVn(gv) != NULL) |
633
|
|
|
|
|
|
{ |
634
|
|
|
|
|
|
RETVAL++; |
635
|
|
|
|
|
|
} |
636
|
|
|
|
|
|
OUTPUT: |
637
|
|
|
|
|
|
RETVAL |
638
|
|
|
|
|
|
|
639
|
|
|
|
|
|
int |
640
|
|
|
|
|
|
isGV_with_GP() |
641
|
|
|
|
|
|
PREINIT: |
642
|
|
|
|
|
|
GV* gv; |
643
|
|
|
|
|
|
CODE: |
644
|
|
|
|
|
|
RETVAL = 0; |
645
|
2
|
|
|
|
|
gv = gv_fetchpvs("Devel::PPPort::GvTest", GV_ADDMULTI, SVt_PVGV); |
646
|
2
|
|
|
|
|
if (isGV_with_GP(gv)) |
647
|
|
|
|
|
|
{ |
648
|
|
|
|
|
|
RETVAL++; |
649
|
|
|
|
|
|
} |
650
|
2
|
|
|
|
|
if (!isGV(&PL_sv_undef)) |
651
|
|
|
|
|
|
{ |
652
|
2
|
|
|
|
|
RETVAL++; |
653
|
|
|
|
|
|
} |
654
|
|
|
|
|
|
OUTPUT: |
655
|
|
|
|
|
|
RETVAL |
656
|
|
|
|
|
|
|
657
|
|
|
|
|
|
int |
658
|
|
|
|
|
|
get_cvn_flags() |
659
|
|
|
|
|
|
PREINIT: |
660
|
|
|
|
|
|
CV* xv; |
661
|
|
|
|
|
|
CODE: |
662
|
|
|
|
|
|
RETVAL = 0; |
663
|
2
|
|
|
|
|
xv = get_cvn_flags("Devel::PPPort::foobar", sizeof("Devel::PPPort::foobar")-1, 0); |
664
|
2
|
|
|
|
|
if(xv == NULL) RETVAL++; |
665
|
2
|
|
|
|
|
xv = get_cvn_flags("Devel::PPPort::foobar", sizeof("Devel::PPPort::foobar")-1, GV_ADDMULTI); |
666
|
2
|
|
|
|
|
if(xv && SvTYPE(xv) == SVt_PVCV) RETVAL++; |
667
|
2
|
|
|
|
|
xv = get_cvn_flags("Devel::PPPort::get_cvn_flags", sizeof("Devel::PPPort::get_cvn_flags")-1, 0); |
668
|
2
|
|
|
|
|
if(xv && SvTYPE(xv) == SVt_PVCV) RETVAL++; |
669
|
|
|
|
|
|
OUTPUT: |
670
|
|
|
|
|
|
RETVAL |
671
|
|
|
|
|
|
|
672
|
|
|
|
|
|
SV* |
673
|
|
|
|
|
|
gv_fetchpvn_flags() |
674
|
|
|
|
|
|
CODE: |
675
|
2
|
|
|
|
|
RETVAL = newRV_inc((SV*)gv_fetchpvn_flags("Devel::PPPort::VERSION", sizeof("Devel::PPPort::VERSION")-1, 0, SVt_PV)); |
676
|
|
|
|
|
|
OUTPUT: |
677
|
|
|
|
|
|
RETVAL |
678
|
|
|
|
|
|
|
679
|
|
|
|
|
|
SV* |
680
|
|
|
|
|
|
gv_fetchsv(name) |
681
|
|
|
|
|
|
SV *name |
682
|
|
|
|
|
|
CODE: |
683
|
2
|
|
|
|
|
RETVAL = newRV_inc((SV*)gv_fetchsv(name, 0, SVt_PV)); |
684
|
|
|
|
|
|
OUTPUT: |
685
|
|
|
|
|
|
RETVAL |
686
|
|
|
|
|
|
|
687
|
|
|
|
|
|
##---------------------------------------------------------------------- |
688
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/threads |
689
|
|
|
|
|
|
##---------------------------------------------------------------------- |
690
|
|
|
|
|
|
|
691
|
|
|
|
|
|
IV |
692
|
|
|
|
|
|
no_THX_arg(sv) |
693
|
|
|
|
|
|
SV *sv |
694
|
|
|
|
|
|
CODE: |
695
|
2
|
|
|
|
|
RETVAL = 1 + sv_2iv(sv); |
696
|
|
|
|
|
|
OUTPUT: |
697
|
|
|
|
|
|
RETVAL |
698
|
|
|
|
|
|
|
699
|
|
|
|
|
|
void |
700
|
|
|
|
|
|
with_THX_arg(error) |
701
|
|
|
|
|
|
char *error |
702
|
|
|
|
|
|
PPCODE: |
703
|
2
|
|
|
|
|
Perl_croak(aTHX_ "%s", error); |
704
|
|
|
|
|
|
|
705
|
|
|
|
|
|
##---------------------------------------------------------------------- |
706
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/newSV_type |
707
|
|
|
|
|
|
##---------------------------------------------------------------------- |
708
|
|
|
|
|
|
|
709
|
|
|
|
|
|
int |
710
|
|
|
|
|
|
newSV_type() |
711
|
|
|
|
|
|
PREINIT: |
712
|
|
|
|
|
|
SV* sv; |
713
|
|
|
|
|
|
CODE: |
714
|
|
|
|
|
|
RETVAL = 0; |
715
|
2
|
|
|
|
|
sv = newSV_type(SVt_NULL); |
716
|
2
|
|
|
|
|
if (SvTYPE(sv) == SVt_NULL) |
717
|
|
|
|
|
|
{ |
718
|
|
|
|
|
|
RETVAL++; |
719
|
|
|
|
|
|
} |
720
|
2
|
|
|
|
|
SvREFCNT_dec(sv); |
721
|
|
|
|
|
|
|
722
|
2
|
|
|
|
|
sv = newSV_type(SVt_PVIV); |
723
|
2
|
|
|
|
|
if (SvTYPE(sv) == SVt_PVIV) |
724
|
|
|
|
|
|
{ |
725
|
2
|
|
|
|
|
RETVAL++; |
726
|
|
|
|
|
|
} |
727
|
2
|
|
|
|
|
SvREFCNT_dec(sv); |
728
|
|
|
|
|
|
|
729
|
2
|
|
|
|
|
sv = newSV_type(SVt_PVHV); |
730
|
2
|
|
|
|
|
if (SvTYPE(sv) == SVt_PVHV) |
731
|
|
|
|
|
|
{ |
732
|
2
|
|
|
|
|
RETVAL++; |
733
|
|
|
|
|
|
} |
734
|
2
|
|
|
|
|
SvREFCNT_dec(sv); |
735
|
|
|
|
|
|
|
736
|
2
|
|
|
|
|
sv = newSV_type(SVt_PVAV); |
737
|
2
|
|
|
|
|
if (SvTYPE(sv) == SVt_PVAV) |
738
|
|
|
|
|
|
{ |
739
|
2
|
|
|
|
|
RETVAL++; |
740
|
|
|
|
|
|
} |
741
|
2
|
|
|
|
|
SvREFCNT_dec(sv); |
742
|
|
|
|
|
|
OUTPUT: |
743
|
|
|
|
|
|
RETVAL |
744
|
|
|
|
|
|
|
745
|
|
|
|
|
|
##---------------------------------------------------------------------- |
746
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/Sv_set |
747
|
|
|
|
|
|
##---------------------------------------------------------------------- |
748
|
|
|
|
|
|
|
749
|
|
|
|
|
|
IV |
750
|
|
|
|
|
|
TestSvUV_set(sv, val) |
751
|
|
|
|
|
|
SV *sv |
752
|
|
|
|
|
|
UV val |
753
|
|
|
|
|
|
CODE: |
754
|
2
|
|
|
|
|
SvUV_set(sv, val); |
755
|
2
|
|
|
|
|
RETVAL = SvUVX(sv) == val ? 42 : -1; |
756
|
|
|
|
|
|
OUTPUT: |
757
|
|
|
|
|
|
RETVAL |
758
|
|
|
|
|
|
|
759
|
|
|
|
|
|
IV |
760
|
|
|
|
|
|
TestSvPVX_const(sv) |
761
|
|
|
|
|
|
SV *sv |
762
|
|
|
|
|
|
CODE: |
763
|
2
|
|
|
|
|
RETVAL = strEQ(SvPVX_const(sv), "mhx") ? 43 : -1; |
764
|
|
|
|
|
|
OUTPUT: |
765
|
|
|
|
|
|
RETVAL |
766
|
|
|
|
|
|
|
767
|
|
|
|
|
|
IV |
768
|
|
|
|
|
|
TestSvPVX_mutable(sv) |
769
|
|
|
|
|
|
SV *sv |
770
|
|
|
|
|
|
CODE: |
771
|
2
|
|
|
|
|
RETVAL = strEQ(SvPVX_mutable(sv), "mhx") ? 44 : -1; |
772
|
|
|
|
|
|
OUTPUT: |
773
|
|
|
|
|
|
RETVAL |
774
|
|
|
|
|
|
|
775
|
|
|
|
|
|
void |
776
|
|
|
|
|
|
TestSvSTASH_set(sv, name) |
777
|
|
|
|
|
|
SV *sv |
778
|
|
|
|
|
|
char *name |
779
|
|
|
|
|
|
CODE: |
780
|
2
|
|
|
|
|
sv = SvRV(sv); |
781
|
2
|
|
|
|
|
SvREFCNT_dec(SvSTASH(sv)); |
782
|
4
|
|
|
|
|
SvSTASH_set(sv, (HV*) SvREFCNT_inc(gv_stashpv(name, 0))); |
783
|
|
|
|
|
|
|
784
|
|
|
|
|
|
##---------------------------------------------------------------------- |
785
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/shared_pv |
786
|
|
|
|
|
|
##---------------------------------------------------------------------- |
787
|
|
|
|
|
|
|
788
|
|
|
|
|
|
int |
789
|
|
|
|
|
|
newSVpvn_share() |
790
|
|
|
|
|
|
PREINIT: |
791
|
|
|
|
|
|
const char *s; |
792
|
|
|
|
|
|
SV *sv; |
793
|
|
|
|
|
|
STRLEN len; |
794
|
|
|
|
|
|
U32 hash; |
795
|
|
|
|
|
|
CODE: |
796
|
|
|
|
|
|
RETVAL = 0; |
797
|
|
|
|
|
|
s = "mhx"; |
798
|
|
|
|
|
|
len = 3; |
799
|
2
|
|
|
|
|
PERL_HASH(hash, (char *) s, len); |
800
|
2
|
|
|
|
|
sv = newSVpvn_share(s, len, 0); |
801
|
|
|
|
|
|
s = 0; |
802
|
2
|
|
|
|
|
RETVAL += strEQ(SvPV_nolen_const(sv), "mhx"); |
803
|
2
|
|
|
|
|
RETVAL += SvCUR(sv) == len; |
804
|
2
|
|
|
|
|
RETVAL += SvSHARED_HASH(sv) == hash; |
805
|
2
|
|
|
|
|
SvREFCNT_dec(sv); |
806
|
|
|
|
|
|
s = "foobar"; |
807
|
|
|
|
|
|
len = 6; |
808
|
2
|
|
|
|
|
PERL_HASH(hash, (char *) s, len); |
809
|
2
|
|
|
|
|
sv = newSVpvn_share(s, -(I32) len, hash); |
810
|
|
|
|
|
|
s = 0; |
811
|
2
|
|
|
|
|
RETVAL += strEQ(SvPV_nolen_const(sv), "foobar"); |
812
|
2
|
|
|
|
|
RETVAL += SvCUR(sv) == len; |
813
|
2
|
|
|
|
|
RETVAL += SvSHARED_HASH(sv) == hash; |
814
|
2
|
|
|
|
|
SvREFCNT_dec(sv); |
815
|
|
|
|
|
|
OUTPUT: |
816
|
|
|
|
|
|
RETVAL |
817
|
|
|
|
|
|
|
818
|
|
|
|
|
|
##---------------------------------------------------------------------- |
819
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/strlfuncs |
820
|
|
|
|
|
|
##---------------------------------------------------------------------- |
821
|
|
|
|
|
|
|
822
|
|
|
|
|
|
void |
823
|
|
|
|
|
|
my_strlfunc() |
824
|
|
|
|
|
|
PREINIT: |
825
|
|
|
|
|
|
char buf[8]; |
826
|
|
|
|
|
|
int len; |
827
|
|
|
|
|
|
PPCODE: |
828
|
2
|
|
|
|
|
len = my_strlcpy(buf, "foo", sizeof(buf)); |
829
|
2
|
|
|
|
|
mXPUSHi(len); |
830
|
2
|
|
|
|
|
mXPUSHs(newSVpv(buf, 0)); |
831
|
2
|
|
|
|
|
len = my_strlcat(buf, "bar", sizeof(buf)); |
832
|
2
|
|
|
|
|
mXPUSHi(len); |
833
|
2
|
|
|
|
|
mXPUSHs(newSVpv(buf, 0)); |
834
|
2
|
|
|
|
|
len = my_strlcat(buf, "baz", sizeof(buf)); |
835
|
2
|
|
|
|
|
mXPUSHi(len); |
836
|
2
|
|
|
|
|
mXPUSHs(newSVpv(buf, 0)); |
837
|
2
|
|
|
|
|
len = my_strlcpy(buf, "1234567890", sizeof(buf)); |
838
|
2
|
|
|
|
|
mXPUSHi(len); |
839
|
2
|
|
|
|
|
mXPUSHs(newSVpv(buf, 0)); |
840
|
2
|
|
|
|
|
len = my_strlcpy(buf, "1234", sizeof(buf)); |
841
|
2
|
|
|
|
|
mXPUSHi(len); |
842
|
2
|
|
|
|
|
mXPUSHs(newSVpv(buf, 0)); |
843
|
2
|
|
|
|
|
len = my_strlcat(buf, "567890123456", sizeof(buf)); |
844
|
2
|
|
|
|
|
mXPUSHi(len); |
845
|
2
|
|
|
|
|
mXPUSHs(newSVpv(buf, 0)); |
846
|
2
|
|
|
|
|
XSRETURN(12); |
847
|
|
|
|
|
|
|
848
|
|
|
|
|
|
##---------------------------------------------------------------------- |
849
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/magic |
850
|
|
|
|
|
|
##---------------------------------------------------------------------- |
851
|
|
|
|
|
|
|
852
|
|
|
|
|
|
void |
853
|
|
|
|
|
|
sv_catpv_mg(sv, string) |
854
|
|
|
|
|
|
SV *sv; |
855
|
|
|
|
|
|
char *string; |
856
|
|
|
|
|
|
CODE: |
857
|
2
|
|
|
|
|
sv_catpv_mg(sv, string); |
858
|
|
|
|
|
|
|
859
|
|
|
|
|
|
void |
860
|
|
|
|
|
|
sv_catpvn_mg(sv, sv2) |
861
|
|
|
|
|
|
SV *sv; |
862
|
|
|
|
|
|
SV *sv2; |
863
|
|
|
|
|
|
PREINIT: |
864
|
|
|
|
|
|
char *str; |
865
|
|
|
|
|
|
STRLEN len; |
866
|
|
|
|
|
|
CODE: |
867
|
2
|
|
|
|
|
str = SvPV(sv2, len); |
868
|
2
|
|
|
|
|
sv_catpvn_mg(sv, str, len); |
869
|
|
|
|
|
|
|
870
|
|
|
|
|
|
void |
871
|
|
|
|
|
|
sv_catsv_mg(sv, sv2) |
872
|
|
|
|
|
|
SV *sv; |
873
|
|
|
|
|
|
SV *sv2; |
874
|
|
|
|
|
|
CODE: |
875
|
2
|
|
|
|
|
sv_catsv_mg(sv, sv2); |
876
|
|
|
|
|
|
|
877
|
|
|
|
|
|
void |
878
|
|
|
|
|
|
sv_setiv_mg(sv, iv) |
879
|
|
|
|
|
|
SV *sv; |
880
|
|
|
|
|
|
IV iv; |
881
|
|
|
|
|
|
CODE: |
882
|
2
|
|
|
|
|
sv_setiv_mg(sv, iv); |
883
|
|
|
|
|
|
|
884
|
|
|
|
|
|
void |
885
|
|
|
|
|
|
sv_setnv_mg(sv, nv) |
886
|
|
|
|
|
|
SV *sv; |
887
|
|
|
|
|
|
NV nv; |
888
|
|
|
|
|
|
CODE: |
889
|
2
|
|
|
|
|
sv_setnv_mg(sv, nv); |
890
|
|
|
|
|
|
|
891
|
|
|
|
|
|
void |
892
|
|
|
|
|
|
sv_setpv_mg(sv, pv) |
893
|
|
|
|
|
|
SV *sv; |
894
|
|
|
|
|
|
char *pv; |
895
|
|
|
|
|
|
CODE: |
896
|
2
|
|
|
|
|
sv_setpv_mg(sv, pv); |
897
|
|
|
|
|
|
|
898
|
|
|
|
|
|
void |
899
|
|
|
|
|
|
sv_setpvn_mg(sv, sv2) |
900
|
|
|
|
|
|
SV *sv; |
901
|
|
|
|
|
|
SV *sv2; |
902
|
|
|
|
|
|
PREINIT: |
903
|
|
|
|
|
|
char *str; |
904
|
|
|
|
|
|
STRLEN len; |
905
|
|
|
|
|
|
CODE: |
906
|
2
|
|
|
|
|
str = SvPV(sv2, len); |
907
|
2
|
|
|
|
|
sv_setpvn_mg(sv, str, len); |
908
|
|
|
|
|
|
|
909
|
|
|
|
|
|
void |
910
|
|
|
|
|
|
sv_setsv_mg(sv, sv2) |
911
|
|
|
|
|
|
SV *sv; |
912
|
|
|
|
|
|
SV *sv2; |
913
|
|
|
|
|
|
CODE: |
914
|
2
|
|
|
|
|
sv_setsv_mg(sv, sv2); |
915
|
|
|
|
|
|
|
916
|
|
|
|
|
|
void |
917
|
|
|
|
|
|
sv_setuv_mg(sv, uv) |
918
|
|
|
|
|
|
SV *sv; |
919
|
|
|
|
|
|
UV uv; |
920
|
|
|
|
|
|
CODE: |
921
|
2
|
|
|
|
|
sv_setuv_mg(sv, uv); |
922
|
|
|
|
|
|
|
923
|
|
|
|
|
|
void |
924
|
|
|
|
|
|
sv_usepvn_mg(sv, sv2) |
925
|
|
|
|
|
|
SV *sv; |
926
|
|
|
|
|
|
SV *sv2; |
927
|
|
|
|
|
|
PREINIT: |
928
|
|
|
|
|
|
char *str, *copy; |
929
|
|
|
|
|
|
STRLEN len; |
930
|
|
|
|
|
|
CODE: |
931
|
2
|
|
|
|
|
str = SvPV(sv2, len); |
932
|
2
|
|
|
|
|
New(42, copy, len+1, char); |
933
|
2
|
|
|
|
|
Copy(str, copy, len+1, char); |
934
|
2
|
|
|
|
|
sv_usepvn_mg(sv, copy, len); |
935
|
|
|
|
|
|
|
936
|
|
|
|
|
|
int |
937
|
|
|
|
|
|
SvVSTRING_mg(sv) |
938
|
|
|
|
|
|
SV *sv; |
939
|
|
|
|
|
|
CODE: |
940
|
4
|
|
|
|
|
RETVAL = SvVSTRING_mg(sv) != NULL; |
941
|
|
|
|
|
|
OUTPUT: |
942
|
|
|
|
|
|
RETVAL |
943
|
|
|
|
|
|
|
944
|
|
|
|
|
|
int |
945
|
|
|
|
|
|
sv_magic_portable(sv) |
946
|
|
|
|
|
|
SV *sv |
947
|
|
|
|
|
|
PREINIT: |
948
|
|
|
|
|
|
MAGIC *mg; |
949
|
|
|
|
|
|
const char *foo = "foo"; |
950
|
|
|
|
|
|
CODE: |
951
|
|
|
|
|
|
#if (PERL_BCDVERSION >= 0x5004000) |
952
|
2
|
|
|
|
|
sv_magic_portable(sv, 0, '~', foo, 0); |
953
|
2
|
|
|
|
|
mg = mg_find(sv, '~'); |
954
|
2
|
|
|
|
|
RETVAL = mg->mg_ptr == foo; |
955
|
|
|
|
|
|
#else |
956
|
|
|
|
|
|
sv_magic(sv, 0, '~', (char *) foo, strlen(foo)); |
957
|
|
|
|
|
|
mg = mg_find(sv, '~'); |
958
|
|
|
|
|
|
RETVAL = strEQ(mg->mg_ptr, foo); |
959
|
|
|
|
|
|
#endif |
960
|
2
|
|
|
|
|
sv_unmagic(sv, '~'); |
961
|
|
|
|
|
|
OUTPUT: |
962
|
|
|
|
|
|
RETVAL |
963
|
|
|
|
|
|
|
964
|
|
|
|
|
|
##---------------------------------------------------------------------- |
965
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/newSVpv |
966
|
|
|
|
|
|
##---------------------------------------------------------------------- |
967
|
|
|
|
|
|
|
968
|
|
|
|
|
|
void |
969
|
|
|
|
|
|
newSVpvn() |
970
|
|
|
|
|
|
PPCODE: |
971
|
2
|
|
|
|
|
mXPUSHs(newSVpvn("test", 4)); |
972
|
2
|
|
|
|
|
mXPUSHs(newSVpvn("test", 2)); |
973
|
2
|
|
|
|
|
mXPUSHs(newSVpvn("test", 0)); |
974
|
2
|
|
|
|
|
mXPUSHs(newSVpvn(NULL, 2)); |
975
|
2
|
|
|
|
|
mXPUSHs(newSVpvn(NULL, 0)); |
976
|
2
|
|
|
|
|
XSRETURN(5); |
977
|
|
|
|
|
|
|
978
|
|
|
|
|
|
void |
979
|
|
|
|
|
|
newSVpvn_flags() |
980
|
|
|
|
|
|
PPCODE: |
981
|
2
|
|
|
|
|
XPUSHs(newSVpvn_flags("test", 4, SVs_TEMP)); |
982
|
2
|
|
|
|
|
XPUSHs(newSVpvn_flags("test", 2, SVs_TEMP)); |
983
|
2
|
|
|
|
|
XPUSHs(newSVpvn_flags("test", 0, SVs_TEMP)); |
984
|
2
|
|
|
|
|
XPUSHs(newSVpvn_flags(NULL, 2, SVs_TEMP)); |
985
|
2
|
|
|
|
|
XPUSHs(newSVpvn_flags(NULL, 0, SVs_TEMP)); |
986
|
2
|
|
|
|
|
XSRETURN(5); |
987
|
|
|
|
|
|
|
988
|
|
|
|
|
|
void |
989
|
|
|
|
|
|
newSVpvn_utf8() |
990
|
|
|
|
|
|
PPCODE: |
991
|
2
|
|
|
|
|
XPUSHs(newSVpvn_flags("test", 4, SVs_TEMP|SVf_UTF8)); |
992
|
2
|
|
|
|
|
XSRETURN(1); |
993
|
|
|
|
|
|
|
994
|
|
|
|
|
|
##---------------------------------------------------------------------- |
995
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/cop |
996
|
|
|
|
|
|
##---------------------------------------------------------------------- |
997
|
|
|
|
|
|
|
998
|
|
|
|
|
|
char * |
999
|
|
|
|
|
|
CopSTASHPV() |
1000
|
|
|
|
|
|
CODE: |
1001
|
2
|
|
|
|
|
RETVAL = CopSTASHPV(PL_curcop); |
1002
|
|
|
|
|
|
OUTPUT: |
1003
|
|
|
|
|
|
RETVAL |
1004
|
|
|
|
|
|
|
1005
|
|
|
|
|
|
char * |
1006
|
|
|
|
|
|
CopFILE() |
1007
|
|
|
|
|
|
CODE: |
1008
|
2
|
|
|
|
|
RETVAL = CopFILE(PL_curcop); |
1009
|
|
|
|
|
|
OUTPUT: |
1010
|
|
|
|
|
|
RETVAL |
1011
|
|
|
|
|
|
|
1012
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1013
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/sv_xpvf |
1014
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1015
|
|
|
|
|
|
|
1016
|
|
|
|
|
|
SV * |
1017
|
|
|
|
|
|
vnewSVpvf() |
1018
|
|
|
|
|
|
CODE: |
1019
|
2
|
|
|
|
|
RETVAL = test_vnewSVpvf(aTHX_ "%s-%d", "Perl", 42); |
1020
|
|
|
|
|
|
OUTPUT: |
1021
|
|
|
|
|
|
RETVAL |
1022
|
|
|
|
|
|
|
1023
|
|
|
|
|
|
SV * |
1024
|
|
|
|
|
|
sv_vcatpvf(sv) |
1025
|
|
|
|
|
|
SV *sv |
1026
|
|
|
|
|
|
CODE: |
1027
|
2
|
|
|
|
|
RETVAL = newSVsv(sv); |
1028
|
2
|
|
|
|
|
test_sv_vcatpvf(aTHX_ RETVAL, "%s-%d", "Perl", 42); |
1029
|
|
|
|
|
|
OUTPUT: |
1030
|
|
|
|
|
|
RETVAL |
1031
|
|
|
|
|
|
|
1032
|
|
|
|
|
|
SV * |
1033
|
|
|
|
|
|
sv_vsetpvf(sv) |
1034
|
|
|
|
|
|
SV *sv |
1035
|
|
|
|
|
|
CODE: |
1036
|
2
|
|
|
|
|
RETVAL = newSVsv(sv); |
1037
|
2
|
|
|
|
|
test_sv_vsetpvf(aTHX_ RETVAL, "%s-%d", "Perl", 42); |
1038
|
|
|
|
|
|
OUTPUT: |
1039
|
|
|
|
|
|
RETVAL |
1040
|
|
|
|
|
|
|
1041
|
|
|
|
|
|
void |
1042
|
|
|
|
|
|
sv_catpvf_mg(sv) |
1043
|
|
|
|
|
|
SV *sv |
1044
|
|
|
|
|
|
CODE: |
1045
|
|
|
|
|
|
#if (PERL_BCDVERSION >= 0x5004000) |
1046
|
2
|
|
|
|
|
sv_catpvf_mg(sv, "%s-%d", "Perl", 42); |
1047
|
|
|
|
|
|
#endif |
1048
|
|
|
|
|
|
|
1049
|
|
|
|
|
|
void |
1050
|
|
|
|
|
|
Perl_sv_catpvf_mg(sv) |
1051
|
|
|
|
|
|
SV *sv |
1052
|
|
|
|
|
|
CODE: |
1053
|
|
|
|
|
|
#if (PERL_BCDVERSION >= 0x5004000) |
1054
|
2
|
|
|
|
|
Perl_sv_catpvf_mg(aTHX_ sv, "%s-%d", "-Perl", 43); |
1055
|
|
|
|
|
|
#endif |
1056
|
|
|
|
|
|
|
1057
|
|
|
|
|
|
void |
1058
|
|
|
|
|
|
sv_catpvf_mg_nocontext(sv) |
1059
|
|
|
|
|
|
SV *sv |
1060
|
|
|
|
|
|
CODE: |
1061
|
|
|
|
|
|
#if (PERL_BCDVERSION >= 0x5004000) |
1062
|
|
|
|
|
|
#ifdef PERL_IMPLICIT_CONTEXT |
1063
|
|
|
|
|
|
sv_catpvf_mg_nocontext(sv, "%s-%d", "-Perl", 44); |
1064
|
|
|
|
|
|
#else |
1065
|
2
|
|
|
|
|
sv_catpvf_mg(sv, "%s-%d", "-Perl", 44); |
1066
|
|
|
|
|
|
#endif |
1067
|
|
|
|
|
|
#endif |
1068
|
|
|
|
|
|
|
1069
|
|
|
|
|
|
void |
1070
|
|
|
|
|
|
sv_setpvf_mg(sv) |
1071
|
|
|
|
|
|
SV *sv |
1072
|
|
|
|
|
|
CODE: |
1073
|
|
|
|
|
|
#if (PERL_BCDVERSION >= 0x5004000) |
1074
|
2
|
|
|
|
|
sv_setpvf_mg(sv, "%s-%d", "mhx", 42); |
1075
|
|
|
|
|
|
#endif |
1076
|
|
|
|
|
|
|
1077
|
|
|
|
|
|
void |
1078
|
|
|
|
|
|
Perl_sv_setpvf_mg(sv) |
1079
|
|
|
|
|
|
SV *sv |
1080
|
|
|
|
|
|
CODE: |
1081
|
|
|
|
|
|
#if (PERL_BCDVERSION >= 0x5004000) |
1082
|
2
|
|
|
|
|
Perl_sv_setpvf_mg(aTHX_ sv, "%s-%d", "foo", 43); |
1083
|
|
|
|
|
|
#endif |
1084
|
|
|
|
|
|
|
1085
|
|
|
|
|
|
void |
1086
|
|
|
|
|
|
sv_setpvf_mg_nocontext(sv) |
1087
|
|
|
|
|
|
SV *sv |
1088
|
|
|
|
|
|
CODE: |
1089
|
|
|
|
|
|
#if (PERL_BCDVERSION >= 0x5004000) |
1090
|
|
|
|
|
|
#ifdef PERL_IMPLICIT_CONTEXT |
1091
|
|
|
|
|
|
sv_setpvf_mg_nocontext(sv, "%s-%d", "bar", 44); |
1092
|
|
|
|
|
|
#else |
1093
|
2
|
|
|
|
|
sv_setpvf_mg(sv, "%s-%d", "bar", 44); |
1094
|
|
|
|
|
|
#endif |
1095
|
|
|
|
|
|
#endif |
1096
|
|
|
|
|
|
|
1097
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1098
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/snprintf |
1099
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1100
|
|
|
|
|
|
|
1101
|
|
|
|
|
|
void |
1102
|
|
|
|
|
|
my_snprintf() |
1103
|
|
|
|
|
|
PREINIT: |
1104
|
|
|
|
|
|
char buf[128]; |
1105
|
|
|
|
|
|
int len; |
1106
|
|
|
|
|
|
PPCODE: |
1107
|
2
|
|
|
|
|
len = my_snprintf(buf, sizeof buf, "foo%s%d", "bar", 42); |
1108
|
2
|
|
|
|
|
mXPUSHi(len); |
1109
|
2
|
|
|
|
|
mXPUSHs(newSVpv(buf, 0)); |
1110
|
2
|
|
|
|
|
XSRETURN(2); |
1111
|
|
|
|
|
|
|
1112
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1113
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/HvNAME |
1114
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1115
|
|
|
|
|
|
|
1116
|
|
|
|
|
|
char* |
1117
|
|
|
|
|
|
HvNAME_get(hv) |
1118
|
|
|
|
|
|
HV *hv |
1119
|
|
|
|
|
|
|
1120
|
|
|
|
|
|
int |
1121
|
|
|
|
|
|
HvNAMELEN_get(hv) |
1122
|
|
|
|
|
|
HV *hv |
1123
|
|
|
|
|
|
|
1124
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1125
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/uv |
1126
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1127
|
|
|
|
|
|
|
1128
|
|
|
|
|
|
SV * |
1129
|
|
|
|
|
|
sv_setuv(uv) |
1130
|
|
|
|
|
|
UV uv |
1131
|
|
|
|
|
|
CODE: |
1132
|
2
|
|
|
|
|
RETVAL = newSViv(1); |
1133
|
2
|
|
|
|
|
sv_setuv(RETVAL, uv); |
1134
|
|
|
|
|
|
OUTPUT: |
1135
|
|
|
|
|
|
RETVAL |
1136
|
|
|
|
|
|
|
1137
|
|
|
|
|
|
SV * |
1138
|
|
|
|
|
|
newSVuv(uv) |
1139
|
|
|
|
|
|
UV uv |
1140
|
|
|
|
|
|
CODE: |
1141
|
2
|
|
|
|
|
RETVAL = newSVuv(uv); |
1142
|
|
|
|
|
|
OUTPUT: |
1143
|
|
|
|
|
|
RETVAL |
1144
|
|
|
|
|
|
|
1145
|
|
|
|
|
|
UV |
1146
|
|
|
|
|
|
sv_2uv(sv) |
1147
|
|
|
|
|
|
SV *sv |
1148
|
|
|
|
|
|
CODE: |
1149
|
4
|
|
|
|
|
RETVAL = sv_2uv(sv); |
1150
|
|
|
|
|
|
OUTPUT: |
1151
|
|
|
|
|
|
RETVAL |
1152
|
|
|
|
|
|
|
1153
|
|
|
|
|
|
UV |
1154
|
|
|
|
|
|
SvUVx(sv) |
1155
|
|
|
|
|
|
SV *sv |
1156
|
|
|
|
|
|
CODE: |
1157
|
|
|
|
|
|
sv--; |
1158
|
6
|
|
|
|
|
RETVAL = SvUVx(++sv); |
1159
|
|
|
|
|
|
OUTPUT: |
1160
|
|
|
|
|
|
RETVAL |
1161
|
|
|
|
|
|
|
1162
|
|
|
|
|
|
void |
1163
|
|
|
|
|
|
XSRETURN_UV() |
1164
|
|
|
|
|
|
PPCODE: |
1165
|
2
|
|
|
|
|
XSRETURN_UV(42); |
1166
|
|
|
|
|
|
|
1167
|
|
|
|
|
|
void |
1168
|
|
|
|
|
|
PUSHu() |
1169
|
|
|
|
|
|
PREINIT: |
1170
|
|
|
|
|
|
dTARG; |
1171
|
|
|
|
|
|
PPCODE: |
1172
|
2
|
|
|
|
|
TARG = sv_newmortal(); |
1173
|
2
|
|
|
|
|
EXTEND(SP, 1); |
1174
|
2
|
|
|
|
|
PUSHu(42); |
1175
|
2
|
|
|
|
|
XSRETURN(1); |
1176
|
|
|
|
|
|
|
1177
|
|
|
|
|
|
void |
1178
|
|
|
|
|
|
XPUSHu() |
1179
|
|
|
|
|
|
PREINIT: |
1180
|
|
|
|
|
|
dTARG; |
1181
|
|
|
|
|
|
PPCODE: |
1182
|
2
|
|
|
|
|
TARG = sv_newmortal(); |
1183
|
2
|
|
|
|
|
XPUSHu(43); |
1184
|
2
|
|
|
|
|
XSRETURN(1); |
1185
|
|
|
|
|
|
|
1186
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1187
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/exception |
1188
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1189
|
|
|
|
|
|
|
1190
|
|
|
|
|
|
int |
1191
|
|
|
|
|
|
exception(throw_e) |
1192
|
|
|
|
|
|
int throw_e |
1193
|
|
|
|
|
|
OUTPUT: |
1194
|
|
|
|
|
|
RETVAL |
1195
|
|
|
|
|
|
|
1196
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1197
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/newCONSTSUB |
1198
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1199
|
|
|
|
|
|
|
1200
|
|
|
|
|
|
void |
1201
|
|
|
|
|
|
call_newCONSTSUB_1() |
1202
|
|
|
|
|
|
|
1203
|
|
|
|
|
|
void |
1204
|
|
|
|
|
|
call_newCONSTSUB_2() |
1205
|
|
|
|
|
|
|
1206
|
|
|
|
|
|
void |
1207
|
|
|
|
|
|
call_newCONSTSUB_3() |
1208
|
|
|
|
|
|
|
1209
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1210
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/limits |
1211
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1212
|
|
|
|
|
|
|
1213
|
|
|
|
|
|
IV |
1214
|
|
|
|
|
|
iv_size() |
1215
|
|
|
|
|
|
CODE: |
1216
|
|
|
|
|
|
RETVAL = IVSIZE == sizeof(IV); |
1217
|
|
|
|
|
|
OUTPUT: |
1218
|
|
|
|
|
|
RETVAL |
1219
|
|
|
|
|
|
|
1220
|
|
|
|
|
|
IV |
1221
|
|
|
|
|
|
uv_size() |
1222
|
|
|
|
|
|
CODE: |
1223
|
|
|
|
|
|
RETVAL = UVSIZE == sizeof(UV); |
1224
|
|
|
|
|
|
OUTPUT: |
1225
|
|
|
|
|
|
RETVAL |
1226
|
|
|
|
|
|
|
1227
|
|
|
|
|
|
IV |
1228
|
|
|
|
|
|
iv_type() |
1229
|
|
|
|
|
|
CODE: |
1230
|
|
|
|
|
|
RETVAL = sizeof(IVTYPE) == sizeof(IV); |
1231
|
|
|
|
|
|
OUTPUT: |
1232
|
|
|
|
|
|
RETVAL |
1233
|
|
|
|
|
|
|
1234
|
|
|
|
|
|
IV |
1235
|
|
|
|
|
|
uv_type() |
1236
|
|
|
|
|
|
CODE: |
1237
|
|
|
|
|
|
RETVAL = sizeof(UVTYPE) == sizeof(UV); |
1238
|
|
|
|
|
|
OUTPUT: |
1239
|
|
|
|
|
|
RETVAL |
1240
|
|
|
|
|
|
|
1241
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1242
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/SvREFCNT |
1243
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1244
|
|
|
|
|
|
|
1245
|
|
|
|
|
|
void |
1246
|
|
|
|
|
|
SvREFCNT() |
1247
|
|
|
|
|
|
PREINIT: |
1248
|
|
|
|
|
|
SV *sv, *svr; |
1249
|
|
|
|
|
|
PPCODE: |
1250
|
2
|
|
|
|
|
sv = newSV(0); |
1251
|
2
|
|
|
|
|
mXPUSHi(SvREFCNT(sv) == 1); |
1252
|
|
|
|
|
|
svr = SvREFCNT_inc(sv); |
1253
|
2
|
|
|
|
|
mXPUSHi(sv == svr); |
1254
|
2
|
|
|
|
|
mXPUSHi(SvREFCNT(sv) == 2); |
1255
|
|
|
|
|
|
svr = SvREFCNT_inc_simple(sv); |
1256
|
2
|
|
|
|
|
mXPUSHi(sv == svr); |
1257
|
2
|
|
|
|
|
mXPUSHi(SvREFCNT(sv) == 3); |
1258
|
|
|
|
|
|
svr = SvREFCNT_inc_NN(sv); |
1259
|
2
|
|
|
|
|
mXPUSHi(sv == svr); |
1260
|
2
|
|
|
|
|
mXPUSHi(SvREFCNT(sv) == 4); |
1261
|
2
|
|
|
|
|
svr = SvREFCNT_inc_simple_NN(sv); |
1262
|
2
|
|
|
|
|
mXPUSHi(sv == svr); |
1263
|
2
|
|
|
|
|
mXPUSHi(SvREFCNT(sv) == 5); |
1264
|
|
|
|
|
|
SvREFCNT_inc_void(sv); |
1265
|
2
|
|
|
|
|
mXPUSHi(SvREFCNT(sv) == 6); |
1266
|
2
|
|
|
|
|
SvREFCNT_inc_simple_void(sv); |
1267
|
2
|
|
|
|
|
mXPUSHi(SvREFCNT(sv) == 7); |
1268
|
2
|
|
|
|
|
SvREFCNT_inc_void_NN(sv); |
1269
|
2
|
|
|
|
|
mXPUSHi(SvREFCNT(sv) == 8); |
1270
|
2
|
|
|
|
|
SvREFCNT_inc_simple_void_NN(sv); |
1271
|
2
|
|
|
|
|
mXPUSHi(SvREFCNT(sv) == 9); |
1272
|
20
|
|
|
|
|
while (SvREFCNT(sv) > 1) |
1273
|
16
|
|
|
|
|
SvREFCNT_dec(sv); |
1274
|
2
|
|
|
|
|
mXPUSHi(SvREFCNT(sv) == 1); |
1275
|
2
|
|
|
|
|
SvREFCNT_dec(sv); |
1276
|
2
|
|
|
|
|
XSRETURN(14); |
1277
|
|
|
|
|
|
|
1278
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1279
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/memory |
1280
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1281
|
|
|
|
|
|
|
1282
|
|
|
|
|
|
int |
1283
|
|
|
|
|
|
checkmem() |
1284
|
|
|
|
|
|
PREINIT: |
1285
|
|
|
|
|
|
char *p; |
1286
|
|
|
|
|
|
|
1287
|
|
|
|
|
|
CODE: |
1288
|
|
|
|
|
|
RETVAL = 0; |
1289
|
2
|
|
|
|
|
Newx(p, 6, char); |
1290
|
2
|
|
|
|
|
CopyD("Hello", p, 6, char); |
1291
|
2
|
|
|
|
|
if (memEQ(p, "Hello", 6)) |
1292
|
|
|
|
|
|
RETVAL++; |
1293
|
|
|
|
|
|
ZeroD(p, 6, char); |
1294
|
2
|
|
|
|
|
if (memEQ(p, "\0\0\0\0\0\0", 6)) |
1295
|
2
|
|
|
|
|
RETVAL++; |
1296
|
2
|
|
|
|
|
if (memEQs(p, 6, "\0\0\0\0\0\0")) |
1297
|
2
|
|
|
|
|
RETVAL++; |
1298
|
|
|
|
|
|
Poison(p, 6, char); |
1299
|
2
|
|
|
|
|
if (memNE(p, "\0\0\0\0\0\0", 6)) |
1300
|
2
|
|
|
|
|
RETVAL++; |
1301
|
2
|
|
|
|
|
if (memNEs(p, 6, "\0\0\0\0\0\0")) |
1302
|
2
|
|
|
|
|
RETVAL++; |
1303
|
2
|
|
|
|
|
Safefree(p); |
1304
|
|
|
|
|
|
|
1305
|
2
|
|
|
|
|
Newxz(p, 6, char); |
1306
|
2
|
|
|
|
|
if (memEQ(p, "\0\0\0\0\0\0", 6)) |
1307
|
2
|
|
|
|
|
RETVAL++; |
1308
|
2
|
|
|
|
|
Safefree(p); |
1309
|
|
|
|
|
|
|
1310
|
2
|
|
|
|
|
Newxc(p, 3, short, char); |
1311
|
2
|
|
|
|
|
Safefree(p); |
1312
|
|
|
|
|
|
|
1313
|
|
|
|
|
|
OUTPUT: |
1314
|
|
|
|
|
|
RETVAL |
1315
|
|
|
|
|
|
|
1316
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1317
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/newRV |
1318
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1319
|
|
|
|
|
|
|
1320
|
|
|
|
|
|
U32 |
1321
|
|
|
|
|
|
newRV_inc_REFCNT() |
1322
|
|
|
|
|
|
PREINIT: |
1323
|
|
|
|
|
|
SV *sv, *rv; |
1324
|
|
|
|
|
|
CODE: |
1325
|
2
|
|
|
|
|
sv = newSViv(42); |
1326
|
2
|
|
|
|
|
rv = newRV_inc(sv); |
1327
|
2
|
|
|
|
|
SvREFCNT_dec(sv); |
1328
|
2
|
|
|
|
|
RETVAL = SvREFCNT(sv); |
1329
|
2
|
|
|
|
|
sv_2mortal(rv); |
1330
|
|
|
|
|
|
OUTPUT: |
1331
|
|
|
|
|
|
RETVAL |
1332
|
|
|
|
|
|
|
1333
|
|
|
|
|
|
U32 |
1334
|
|
|
|
|
|
newRV_noinc_REFCNT() |
1335
|
|
|
|
|
|
PREINIT: |
1336
|
|
|
|
|
|
SV *sv, *rv; |
1337
|
|
|
|
|
|
CODE: |
1338
|
2
|
|
|
|
|
sv = newSViv(42); |
1339
|
2
|
|
|
|
|
rv = newRV_noinc(sv); |
1340
|
2
|
|
|
|
|
RETVAL = SvREFCNT(sv); |
1341
|
2
|
|
|
|
|
sv_2mortal(rv); |
1342
|
|
|
|
|
|
OUTPUT: |
1343
|
|
|
|
|
|
RETVAL |
1344
|
|
|
|
|
|
|
1345
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1346
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/format |
1347
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1348
|
|
|
|
|
|
|
1349
|
|
|
|
|
|
void |
1350
|
|
|
|
|
|
croak_NVgf(num) |
1351
|
|
|
|
|
|
NV num |
1352
|
|
|
|
|
|
PPCODE: |
1353
|
2
|
|
|
|
|
Perl_croak(aTHX_ "%.20" NVgf "\n", num); |
1354
|
|
|
|
|
|
|
1355
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1356
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/SvPV |
1357
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1358
|
|
|
|
|
|
|
1359
|
|
|
|
|
|
IV |
1360
|
|
|
|
|
|
SvPVbyte(sv) |
1361
|
|
|
|
|
|
SV *sv |
1362
|
|
|
|
|
|
PREINIT: |
1363
|
|
|
|
|
|
char *str; |
1364
|
|
|
|
|
|
STRLEN len; |
1365
|
|
|
|
|
|
CODE: |
1366
|
2
|
|
|
|
|
str = SvPVbyte(sv, len); |
1367
|
2
|
|
|
|
|
RETVAL = strEQ(str, "mhx") ? (IV) len : (IV) -1; |
1368
|
|
|
|
|
|
OUTPUT: |
1369
|
|
|
|
|
|
RETVAL |
1370
|
|
|
|
|
|
|
1371
|
|
|
|
|
|
IV |
1372
|
|
|
|
|
|
SvPV_nolen(sv) |
1373
|
|
|
|
|
|
SV *sv |
1374
|
|
|
|
|
|
PREINIT: |
1375
|
|
|
|
|
|
char *str; |
1376
|
|
|
|
|
|
CODE: |
1377
|
4
|
|
|
|
|
str = SvPV_nolen(sv); |
1378
|
4
|
|
|
|
|
RETVAL = strEQ(str, "mhx") ? 42 : 0; |
1379
|
|
|
|
|
|
OUTPUT: |
1380
|
|
|
|
|
|
RETVAL |
1381
|
|
|
|
|
|
|
1382
|
|
|
|
|
|
IV |
1383
|
|
|
|
|
|
SvPV_const(sv) |
1384
|
|
|
|
|
|
SV *sv |
1385
|
|
|
|
|
|
PREINIT: |
1386
|
|
|
|
|
|
const char *str; |
1387
|
|
|
|
|
|
STRLEN len; |
1388
|
|
|
|
|
|
CODE: |
1389
|
4
|
|
|
|
|
str = SvPV_const(sv, len); |
1390
|
4
|
|
|
|
|
RETVAL = len + (strEQ(str, "mhx") ? 40 : 0); |
1391
|
|
|
|
|
|
OUTPUT: |
1392
|
|
|
|
|
|
RETVAL |
1393
|
|
|
|
|
|
|
1394
|
|
|
|
|
|
IV |
1395
|
|
|
|
|
|
SvPV_mutable(sv) |
1396
|
|
|
|
|
|
SV *sv |
1397
|
|
|
|
|
|
PREINIT: |
1398
|
|
|
|
|
|
char *str; |
1399
|
|
|
|
|
|
STRLEN len; |
1400
|
|
|
|
|
|
CODE: |
1401
|
4
|
|
|
|
|
str = SvPV_mutable(sv, len); |
1402
|
4
|
|
|
|
|
RETVAL = len + (strEQ(str, "mhx") ? 41 : 0); |
1403
|
|
|
|
|
|
OUTPUT: |
1404
|
|
|
|
|
|
RETVAL |
1405
|
|
|
|
|
|
|
1406
|
|
|
|
|
|
IV |
1407
|
|
|
|
|
|
SvPV_flags(sv) |
1408
|
|
|
|
|
|
SV *sv |
1409
|
|
|
|
|
|
PREINIT: |
1410
|
|
|
|
|
|
char *str; |
1411
|
|
|
|
|
|
STRLEN len; |
1412
|
|
|
|
|
|
CODE: |
1413
|
4
|
|
|
|
|
str = SvPV_flags(sv, len, SV_GMAGIC); |
1414
|
4
|
|
|
|
|
RETVAL = len + (strEQ(str, "mhx") ? 42 : 0); |
1415
|
|
|
|
|
|
OUTPUT: |
1416
|
|
|
|
|
|
RETVAL |
1417
|
|
|
|
|
|
|
1418
|
|
|
|
|
|
IV |
1419
|
|
|
|
|
|
SvPV_flags_const(sv) |
1420
|
|
|
|
|
|
SV *sv |
1421
|
|
|
|
|
|
PREINIT: |
1422
|
|
|
|
|
|
const char *str; |
1423
|
|
|
|
|
|
STRLEN len; |
1424
|
|
|
|
|
|
CODE: |
1425
|
4
|
|
|
|
|
str = SvPV_flags_const(sv, len, SV_GMAGIC); |
1426
|
4
|
|
|
|
|
RETVAL = len + (strEQ(str, "mhx") ? 43 : 0); |
1427
|
|
|
|
|
|
OUTPUT: |
1428
|
|
|
|
|
|
RETVAL |
1429
|
|
|
|
|
|
|
1430
|
|
|
|
|
|
IV |
1431
|
|
|
|
|
|
SvPV_flags_const_nolen(sv) |
1432
|
|
|
|
|
|
SV *sv |
1433
|
|
|
|
|
|
PREINIT: |
1434
|
|
|
|
|
|
const char *str; |
1435
|
|
|
|
|
|
CODE: |
1436
|
4
|
|
|
|
|
str = SvPV_flags_const_nolen(sv, SV_GMAGIC); |
1437
|
4
|
|
|
|
|
RETVAL = strEQ(str, "mhx") ? 47 : 0; |
1438
|
|
|
|
|
|
OUTPUT: |
1439
|
|
|
|
|
|
RETVAL |
1440
|
|
|
|
|
|
|
1441
|
|
|
|
|
|
IV |
1442
|
|
|
|
|
|
SvPV_flags_mutable(sv) |
1443
|
|
|
|
|
|
SV *sv |
1444
|
|
|
|
|
|
PREINIT: |
1445
|
|
|
|
|
|
char *str; |
1446
|
|
|
|
|
|
STRLEN len; |
1447
|
|
|
|
|
|
CODE: |
1448
|
4
|
|
|
|
|
str = SvPV_flags_mutable(sv, len, SV_GMAGIC); |
1449
|
4
|
|
|
|
|
RETVAL = len + (strEQ(str, "mhx") ? 45 : 0); |
1450
|
|
|
|
|
|
OUTPUT: |
1451
|
|
|
|
|
|
RETVAL |
1452
|
|
|
|
|
|
|
1453
|
|
|
|
|
|
IV |
1454
|
|
|
|
|
|
SvPV_force(sv) |
1455
|
|
|
|
|
|
SV *sv |
1456
|
|
|
|
|
|
PREINIT: |
1457
|
|
|
|
|
|
char *str; |
1458
|
|
|
|
|
|
STRLEN len; |
1459
|
|
|
|
|
|
CODE: |
1460
|
8
|
|
|
|
|
str = SvPV_force(sv, len); |
1461
|
8
|
|
|
|
|
RETVAL = len + (strEQ(str, "mhx") ? 46 : 0); |
1462
|
|
|
|
|
|
OUTPUT: |
1463
|
|
|
|
|
|
RETVAL |
1464
|
|
|
|
|
|
|
1465
|
|
|
|
|
|
IV |
1466
|
|
|
|
|
|
SvPV_force_nolen(sv) |
1467
|
|
|
|
|
|
SV *sv |
1468
|
|
|
|
|
|
PREINIT: |
1469
|
|
|
|
|
|
char *str; |
1470
|
|
|
|
|
|
CODE: |
1471
|
4
|
|
|
|
|
str = SvPV_force_nolen(sv); |
1472
|
4
|
|
|
|
|
RETVAL = strEQ(str, "mhx") ? 50 : 0; |
1473
|
|
|
|
|
|
OUTPUT: |
1474
|
|
|
|
|
|
RETVAL |
1475
|
|
|
|
|
|
|
1476
|
|
|
|
|
|
IV |
1477
|
|
|
|
|
|
SvPV_force_mutable(sv) |
1478
|
|
|
|
|
|
SV *sv |
1479
|
|
|
|
|
|
PREINIT: |
1480
|
|
|
|
|
|
char *str; |
1481
|
|
|
|
|
|
STRLEN len; |
1482
|
|
|
|
|
|
CODE: |
1483
|
4
|
|
|
|
|
str = SvPV_force_mutable(sv, len); |
1484
|
4
|
|
|
|
|
RETVAL = len + (strEQ(str, "mhx") ? 48 : 0); |
1485
|
|
|
|
|
|
OUTPUT: |
1486
|
|
|
|
|
|
RETVAL |
1487
|
|
|
|
|
|
|
1488
|
|
|
|
|
|
IV |
1489
|
|
|
|
|
|
SvPV_force_nomg(sv) |
1490
|
|
|
|
|
|
SV *sv |
1491
|
|
|
|
|
|
PREINIT: |
1492
|
|
|
|
|
|
char *str; |
1493
|
|
|
|
|
|
STRLEN len; |
1494
|
|
|
|
|
|
CODE: |
1495
|
4
|
|
|
|
|
str = SvPV_force_nomg(sv, len); |
1496
|
4
|
|
|
|
|
RETVAL = len + (strEQ(str, "mhx") ? 49 : 0); |
1497
|
|
|
|
|
|
OUTPUT: |
1498
|
|
|
|
|
|
RETVAL |
1499
|
|
|
|
|
|
|
1500
|
|
|
|
|
|
IV |
1501
|
|
|
|
|
|
SvPV_force_nomg_nolen(sv) |
1502
|
|
|
|
|
|
SV *sv |
1503
|
|
|
|
|
|
PREINIT: |
1504
|
|
|
|
|
|
char *str; |
1505
|
|
|
|
|
|
CODE: |
1506
|
4
|
|
|
|
|
str = SvPV_force_nomg_nolen(sv); |
1507
|
4
|
|
|
|
|
RETVAL = strEQ(str, "mhx") ? 53 : 0; |
1508
|
|
|
|
|
|
OUTPUT: |
1509
|
|
|
|
|
|
RETVAL |
1510
|
|
|
|
|
|
|
1511
|
|
|
|
|
|
IV |
1512
|
|
|
|
|
|
SvPV_force_flags(sv) |
1513
|
|
|
|
|
|
SV *sv |
1514
|
|
|
|
|
|
PREINIT: |
1515
|
|
|
|
|
|
char *str; |
1516
|
|
|
|
|
|
STRLEN len; |
1517
|
|
|
|
|
|
CODE: |
1518
|
4
|
|
|
|
|
str = SvPV_force_flags(sv, len, SV_GMAGIC); |
1519
|
4
|
|
|
|
|
RETVAL = len + (strEQ(str, "mhx") ? 51 : 0); |
1520
|
|
|
|
|
|
OUTPUT: |
1521
|
|
|
|
|
|
RETVAL |
1522
|
|
|
|
|
|
|
1523
|
|
|
|
|
|
IV |
1524
|
|
|
|
|
|
SvPV_force_flags_nolen(sv) |
1525
|
|
|
|
|
|
SV *sv |
1526
|
|
|
|
|
|
PREINIT: |
1527
|
|
|
|
|
|
char *str; |
1528
|
|
|
|
|
|
CODE: |
1529
|
4
|
|
|
|
|
str = SvPV_force_flags_nolen(sv, SV_GMAGIC); |
1530
|
4
|
|
|
|
|
RETVAL = strEQ(str, "mhx") ? 55 : 0; |
1531
|
|
|
|
|
|
OUTPUT: |
1532
|
|
|
|
|
|
RETVAL |
1533
|
|
|
|
|
|
|
1534
|
|
|
|
|
|
IV |
1535
|
|
|
|
|
|
SvPV_force_flags_mutable(sv) |
1536
|
|
|
|
|
|
SV *sv |
1537
|
|
|
|
|
|
PREINIT: |
1538
|
|
|
|
|
|
char *str; |
1539
|
|
|
|
|
|
STRLEN len; |
1540
|
|
|
|
|
|
CODE: |
1541
|
4
|
|
|
|
|
str = SvPV_force_flags_mutable(sv, len, SV_GMAGIC); |
1542
|
4
|
|
|
|
|
RETVAL = len + (strEQ(str, "mhx") ? 53 : 0); |
1543
|
|
|
|
|
|
OUTPUT: |
1544
|
|
|
|
|
|
RETVAL |
1545
|
|
|
|
|
|
|
1546
|
|
|
|
|
|
IV |
1547
|
|
|
|
|
|
SvPV_nolen_const(sv) |
1548
|
|
|
|
|
|
SV *sv |
1549
|
|
|
|
|
|
PREINIT: |
1550
|
|
|
|
|
|
const char *str; |
1551
|
|
|
|
|
|
CODE: |
1552
|
4
|
|
|
|
|
str = SvPV_nolen_const(sv); |
1553
|
4
|
|
|
|
|
RETVAL = strEQ(str, "mhx") ? 57 : 0; |
1554
|
|
|
|
|
|
OUTPUT: |
1555
|
|
|
|
|
|
RETVAL |
1556
|
|
|
|
|
|
|
1557
|
|
|
|
|
|
IV |
1558
|
|
|
|
|
|
SvPV_nomg(sv) |
1559
|
|
|
|
|
|
SV *sv |
1560
|
|
|
|
|
|
PREINIT: |
1561
|
|
|
|
|
|
char *str; |
1562
|
|
|
|
|
|
STRLEN len; |
1563
|
|
|
|
|
|
CODE: |
1564
|
4
|
|
|
|
|
str = SvPV_nomg(sv, len); |
1565
|
4
|
|
|
|
|
RETVAL = len + (strEQ(str, "mhx") ? 55 : 0); |
1566
|
|
|
|
|
|
OUTPUT: |
1567
|
|
|
|
|
|
RETVAL |
1568
|
|
|
|
|
|
|
1569
|
|
|
|
|
|
IV |
1570
|
|
|
|
|
|
SvPV_nomg_const(sv) |
1571
|
|
|
|
|
|
SV *sv |
1572
|
|
|
|
|
|
PREINIT: |
1573
|
|
|
|
|
|
const char *str; |
1574
|
|
|
|
|
|
STRLEN len; |
1575
|
|
|
|
|
|
CODE: |
1576
|
4
|
|
|
|
|
str = SvPV_nomg_const(sv, len); |
1577
|
4
|
|
|
|
|
RETVAL = len + (strEQ(str, "mhx") ? 56 : 0); |
1578
|
|
|
|
|
|
OUTPUT: |
1579
|
|
|
|
|
|
RETVAL |
1580
|
|
|
|
|
|
|
1581
|
|
|
|
|
|
IV |
1582
|
|
|
|
|
|
SvPV_nomg_const_nolen(sv) |
1583
|
|
|
|
|
|
SV *sv |
1584
|
|
|
|
|
|
PREINIT: |
1585
|
|
|
|
|
|
const char *str; |
1586
|
|
|
|
|
|
CODE: |
1587
|
4
|
|
|
|
|
str = SvPV_nomg_const_nolen(sv); |
1588
|
4
|
|
|
|
|
RETVAL = strEQ(str, "mhx") ? 60 : 0; |
1589
|
|
|
|
|
|
OUTPUT: |
1590
|
|
|
|
|
|
RETVAL |
1591
|
|
|
|
|
|
|
1592
|
|
|
|
|
|
IV |
1593
|
|
|
|
|
|
SvPV_nomg_nolen(sv) |
1594
|
|
|
|
|
|
SV *sv |
1595
|
|
|
|
|
|
PREINIT: |
1596
|
|
|
|
|
|
char *str; |
1597
|
|
|
|
|
|
STRLEN len; |
1598
|
|
|
|
|
|
CODE: |
1599
|
4
|
|
|
|
|
str = SvPV_nomg_nolen(sv); |
1600
|
4
|
|
|
|
|
RETVAL = strEQ(str, "mhx") ? 61 : 0; |
1601
|
|
|
|
|
|
OUTPUT: |
1602
|
|
|
|
|
|
RETVAL |
1603
|
|
|
|
|
|
|
1604
|
|
|
|
|
|
void |
1605
|
|
|
|
|
|
SvPV_renew(sv, nlen, insv) |
1606
|
|
|
|
|
|
SV *sv |
1607
|
|
|
|
|
|
IV nlen |
1608
|
|
|
|
|
|
SV *insv |
1609
|
|
|
|
|
|
PREINIT: |
1610
|
|
|
|
|
|
STRLEN slen; |
1611
|
|
|
|
|
|
const char *str; |
1612
|
|
|
|
|
|
PPCODE: |
1613
|
4
|
|
|
|
|
str = SvPV_const(insv, slen); |
1614
|
4
|
|
|
|
|
XPUSHs(sv); |
1615
|
4
|
|
|
|
|
mXPUSHi(SvLEN(sv)); |
1616
|
4
|
|
|
|
|
SvPV_renew(sv, nlen); |
1617
|
4
|
|
|
|
|
Copy(str, SvPVX(sv), slen + 1, char); |
1618
|
4
|
|
|
|
|
SvCUR_set(sv, slen); |
1619
|
4
|
|
|
|
|
mXPUSHi(SvLEN(sv)); |
1620
|
|
|
|
|
|
|
1621
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1622
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/pv_tools |
1623
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1624
|
|
|
|
|
|
|
1625
|
|
|
|
|
|
void |
1626
|
|
|
|
|
|
pv_escape_can_unicode() |
1627
|
|
|
|
|
|
PPCODE: |
1628
|
|
|
|
|
|
#if defined(is_utf8_string) && defined(utf8_to_uvchr) |
1629
|
2
|
|
|
|
|
XSRETURN_YES; |
1630
|
|
|
|
|
|
#else |
1631
|
|
|
|
|
|
XSRETURN_NO; |
1632
|
|
|
|
|
|
#endif |
1633
|
|
|
|
|
|
|
1634
|
|
|
|
|
|
void |
1635
|
|
|
|
|
|
pv_pretty() |
1636
|
|
|
|
|
|
PREINIT: |
1637
|
|
|
|
|
|
char *rv; |
1638
|
|
|
|
|
|
PPCODE: |
1639
|
2
|
|
|
|
|
EXTEND(SP, 8); |
1640
|
2
|
|
|
|
|
ST(0) = sv_newmortal(); |
1641
|
2
|
|
|
|
|
rv = pv_pretty(ST(0), "foobarbaz", |
1642
|
|
|
|
|
|
9, 40, NULL, NULL, 0); |
1643
|
2
|
|
|
|
|
ST(1) = sv_2mortal(newSVpv(rv, 0)); |
1644
|
2
|
|
|
|
|
ST(2) = sv_newmortal(); |
1645
|
2
|
|
|
|
|
rv = pv_pretty(ST(2), "pv_p\retty\n", |
1646
|
|
|
|
|
|
10, 40, "left", "right", PERL_PV_PRETTY_LTGT); |
1647
|
2
|
|
|
|
|
ST(3) = sv_2mortal(newSVpv(rv, 0)); |
1648
|
2
|
|
|
|
|
ST(4) = sv_newmortal(); |
1649
|
2
|
|
|
|
|
rv = pv_pretty(ST(4), "N\303\275 Batter\303\255", |
1650
|
|
|
|
|
|
12, 20, NULL, NULL, PERL_PV_ESCAPE_UNI_DETECT); |
1651
|
2
|
|
|
|
|
ST(5) = sv_2mortal(newSVpv(rv, 0)); |
1652
|
2
|
|
|
|
|
ST(6) = sv_newmortal(); |
1653
|
2
|
|
|
|
|
rv = pv_pretty(ST(6), "\303\201g\303\246tis Byrjun", |
1654
|
|
|
|
|
|
15, 18, NULL, NULL, PERL_PV_ESCAPE_UNI_DETECT|PERL_PV_PRETTY_ELLIPSES); |
1655
|
2
|
|
|
|
|
ST(7) = sv_2mortal(newSVpv(rv, 0)); |
1656
|
2
|
|
|
|
|
XSRETURN(8); |
1657
|
|
|
|
|
|
|
1658
|
|
|
|
|
|
void |
1659
|
|
|
|
|
|
pv_display() |
1660
|
|
|
|
|
|
PREINIT: |
1661
|
|
|
|
|
|
char *rv; |
1662
|
|
|
|
|
|
PPCODE: |
1663
|
2
|
|
|
|
|
EXTEND(SP, 4); |
1664
|
2
|
|
|
|
|
ST(0) = sv_newmortal(); |
1665
|
2
|
|
|
|
|
rv = pv_display(ST(0), "foob\0rbaz", 9, 10, 20); |
1666
|
2
|
|
|
|
|
ST(1) = sv_2mortal(newSVpv(rv, 0)); |
1667
|
2
|
|
|
|
|
ST(2) = sv_newmortal(); |
1668
|
2
|
|
|
|
|
rv = pv_display(ST(2), "pv_display", 10, 11, 5); |
1669
|
2
|
|
|
|
|
ST(3) = sv_2mortal(newSVpv(rv, 0)); |
1670
|
2
|
|
|
|
|
XSRETURN(4); |
1671
|
|
|
|
|
|
|
1672
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1673
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/MY_CXT |
1674
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1675
|
|
|
|
|
|
|
1676
|
|
|
|
|
|
int |
1677
|
|
|
|
|
|
MY_CXT_1() |
1678
|
|
|
|
|
|
CODE: |
1679
|
|
|
|
|
|
dMY_CXT; |
1680
|
2
|
|
|
|
|
RETVAL = MY_CXT.dummy == 42; |
1681
|
2
|
|
|
|
|
++MY_CXT.dummy; |
1682
|
|
|
|
|
|
OUTPUT: |
1683
|
|
|
|
|
|
RETVAL |
1684
|
|
|
|
|
|
|
1685
|
|
|
|
|
|
int |
1686
|
|
|
|
|
|
MY_CXT_2() |
1687
|
|
|
|
|
|
CODE: |
1688
|
|
|
|
|
|
dMY_CXT; |
1689
|
2
|
|
|
|
|
RETVAL = MY_CXT.dummy == 43; |
1690
|
|
|
|
|
|
OUTPUT: |
1691
|
|
|
|
|
|
RETVAL |
1692
|
|
|
|
|
|
|
1693
|
|
|
|
|
|
int |
1694
|
|
|
|
|
|
MY_CXT_CLONE() |
1695
|
|
|
|
|
|
CODE: |
1696
|
|
|
|
|
|
MY_CXT_CLONE; |
1697
|
|
|
|
|
|
RETVAL = 42; |
1698
|
|
|
|
|
|
OUTPUT: |
1699
|
|
|
|
|
|
RETVAL |
1700
|
|
|
|
|
|
|
1701
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1702
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/misc |
1703
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1704
|
|
|
|
|
|
|
1705
|
|
|
|
|
|
int |
1706
|
|
|
|
|
|
ptrtests() |
1707
|
|
|
|
|
|
PREINIT: |
1708
|
|
|
|
|
|
int var, *p = &var; |
1709
|
|
|
|
|
|
|
1710
|
|
|
|
|
|
CODE: |
1711
|
|
|
|
|
|
RETVAL = 0; |
1712
|
|
|
|
|
|
RETVAL += PTR2nat(p) != 0 ? 1 : 0; |
1713
|
|
|
|
|
|
RETVAL += PTR2ul(p) != 0UL ? 2 : 0; |
1714
|
|
|
|
|
|
RETVAL += PTR2UV(p) != (UV) 0 ? 4 : 0; |
1715
|
|
|
|
|
|
RETVAL += PTR2IV(p) != (IV) 0 ? 8 : 0; |
1716
|
2
|
|
|
|
|
RETVAL += PTR2NV(p) != (NV) 0 ? 16 : 0; |
1717
|
2
|
|
|
|
|
RETVAL += p > NUM2PTR(int *, 0) ? 32 : 0; |
1718
|
|
|
|
|
|
|
1719
|
|
|
|
|
|
OUTPUT: |
1720
|
|
|
|
|
|
RETVAL |
1721
|
|
|
|
|
|
|
1722
|
|
|
|
|
|
int |
1723
|
|
|
|
|
|
gv_stashpvn(name, create) |
1724
|
|
|
|
|
|
char *name |
1725
|
|
|
|
|
|
I32 create |
1726
|
|
|
|
|
|
CODE: |
1727
|
6
|
|
|
|
|
RETVAL = gv_stashpvn(name, strlen(name), create) != NULL; |
1728
|
|
|
|
|
|
OUTPUT: |
1729
|
|
|
|
|
|
RETVAL |
1730
|
|
|
|
|
|
|
1731
|
|
|
|
|
|
int |
1732
|
|
|
|
|
|
get_sv(name, create) |
1733
|
|
|
|
|
|
char *name |
1734
|
|
|
|
|
|
I32 create |
1735
|
|
|
|
|
|
CODE: |
1736
|
6
|
|
|
|
|
RETVAL = get_sv(name, create) != NULL; |
1737
|
|
|
|
|
|
OUTPUT: |
1738
|
|
|
|
|
|
RETVAL |
1739
|
|
|
|
|
|
|
1740
|
|
|
|
|
|
int |
1741
|
|
|
|
|
|
get_av(name, create) |
1742
|
|
|
|
|
|
char *name |
1743
|
|
|
|
|
|
I32 create |
1744
|
|
|
|
|
|
CODE: |
1745
|
6
|
|
|
|
|
RETVAL = get_av(name, create) != NULL; |
1746
|
|
|
|
|
|
OUTPUT: |
1747
|
|
|
|
|
|
RETVAL |
1748
|
|
|
|
|
|
|
1749
|
|
|
|
|
|
int |
1750
|
|
|
|
|
|
get_hv(name, create) |
1751
|
|
|
|
|
|
char *name |
1752
|
|
|
|
|
|
I32 create |
1753
|
|
|
|
|
|
CODE: |
1754
|
6
|
|
|
|
|
RETVAL = get_hv(name, create) != NULL; |
1755
|
|
|
|
|
|
OUTPUT: |
1756
|
|
|
|
|
|
RETVAL |
1757
|
|
|
|
|
|
|
1758
|
|
|
|
|
|
int |
1759
|
|
|
|
|
|
get_cv(name, create) |
1760
|
|
|
|
|
|
char *name |
1761
|
|
|
|
|
|
I32 create |
1762
|
|
|
|
|
|
CODE: |
1763
|
6
|
|
|
|
|
RETVAL = get_cv(name, create) != NULL; |
1764
|
|
|
|
|
|
OUTPUT: |
1765
|
|
|
|
|
|
RETVAL |
1766
|
|
|
|
|
|
|
1767
|
|
|
|
|
|
void |
1768
|
|
|
|
|
|
xsreturn(two) |
1769
|
|
|
|
|
|
int two |
1770
|
|
|
|
|
|
PPCODE: |
1771
|
4
|
|
|
|
|
mXPUSHp("test1", 5); |
1772
|
4
|
|
|
|
|
if (two) |
1773
|
2
|
|
|
|
|
mXPUSHp("test2", 5); |
1774
|
4
|
|
|
|
|
if (two) |
1775
|
2
|
|
|
|
|
XSRETURN(2); |
1776
|
|
|
|
|
|
else |
1777
|
2
|
|
|
|
|
XSRETURN(1); |
1778
|
|
|
|
|
|
|
1779
|
|
|
|
|
|
SV* |
1780
|
|
|
|
|
|
boolSV(value) |
1781
|
|
|
|
|
|
int value |
1782
|
|
|
|
|
|
CODE: |
1783
|
4
|
|
|
|
|
RETVAL = newSVsv(boolSV(value)); |
1784
|
|
|
|
|
|
OUTPUT: |
1785
|
|
|
|
|
|
RETVAL |
1786
|
|
|
|
|
|
|
1787
|
|
|
|
|
|
SV* |
1788
|
|
|
|
|
|
DEFSV() |
1789
|
|
|
|
|
|
CODE: |
1790
|
6
|
|
|
|
|
RETVAL = newSVsv(DEFSV); |
1791
|
|
|
|
|
|
OUTPUT: |
1792
|
|
|
|
|
|
RETVAL |
1793
|
|
|
|
|
|
|
1794
|
|
|
|
|
|
void |
1795
|
|
|
|
|
|
DEFSV_modify() |
1796
|
|
|
|
|
|
PPCODE: |
1797
|
2
|
|
|
|
|
XPUSHs(sv_mortalcopy(DEFSV)); |
1798
|
2
|
|
|
|
|
ENTER; |
1799
|
2
|
|
|
|
|
SAVE_DEFSV; |
1800
|
2
|
|
|
|
|
DEFSV_set(newSVpvs("DEFSV")); |
1801
|
2
|
|
|
|
|
XPUSHs(sv_mortalcopy(DEFSV)); |
1802
|
|
|
|
|
|
/* Yes, this leaks the above scalar; 5.005 with threads for some reason */ |
1803
|
|
|
|
|
|
/* frees it upon LEAVE, thus mortalizing it causes "attempt to free..." */ |
1804
|
|
|
|
|
|
/* sv_2mortal(DEFSV); */ |
1805
|
2
|
|
|
|
|
LEAVE; |
1806
|
2
|
|
|
|
|
XPUSHs(sv_mortalcopy(DEFSV)); |
1807
|
2
|
|
|
|
|
XSRETURN(3); |
1808
|
|
|
|
|
|
|
1809
|
|
|
|
|
|
int |
1810
|
|
|
|
|
|
ERRSV() |
1811
|
|
|
|
|
|
CODE: |
1812
|
4
|
|
|
|
|
RETVAL = SvTRUE(ERRSV); |
1813
|
|
|
|
|
|
OUTPUT: |
1814
|
|
|
|
|
|
RETVAL |
1815
|
|
|
|
|
|
|
1816
|
|
|
|
|
|
SV* |
1817
|
|
|
|
|
|
UNDERBAR() |
1818
|
|
|
|
|
|
CODE: |
1819
|
|
|
|
|
|
{ |
1820
|
|
|
|
|
|
dUNDERBAR; |
1821
|
4
|
|
|
|
|
RETVAL = newSVsv(UNDERBAR); |
1822
|
|
|
|
|
|
} |
1823
|
|
|
|
|
|
OUTPUT: |
1824
|
|
|
|
|
|
RETVAL |
1825
|
|
|
|
|
|
|
1826
|
|
|
|
|
|
void |
1827
|
|
|
|
|
|
prepush() |
1828
|
|
|
|
|
|
CODE: |
1829
|
|
|
|
|
|
{ |
1830
|
2
|
|
|
|
|
dXSTARG; |
1831
|
2
|
|
|
|
|
XSprePUSH; |
1832
|
2
|
|
|
|
|
PUSHi(42); |
1833
|
2
|
|
|
|
|
XSRETURN(1); |
1834
|
|
|
|
|
|
} |
1835
|
|
|
|
|
|
|
1836
|
|
|
|
|
|
int |
1837
|
|
|
|
|
|
PERL_ABS(a) |
1838
|
|
|
|
|
|
int a |
1839
|
|
|
|
|
|
|
1840
|
|
|
|
|
|
void |
1841
|
|
|
|
|
|
SVf(x) |
1842
|
|
|
|
|
|
SV *x |
1843
|
|
|
|
|
|
PPCODE: |
1844
|
|
|
|
|
|
#if (PERL_BCDVERSION >= 0x5004000) |
1845
|
4
|
|
|
|
|
x = sv_2mortal(newSVpvf("[%"SVf"]", SVfARG(x))); |
1846
|
|
|
|
|
|
#endif |
1847
|
4
|
|
|
|
|
XPUSHs(x); |
1848
|
4
|
|
|
|
|
XSRETURN(1); |
1849
|
|
|
|
|
|
|
1850
|
|
|
|
|
|
void |
1851
|
|
|
|
|
|
Perl_ppaddr_t(string) |
1852
|
|
|
|
|
|
char *string |
1853
|
|
|
|
|
|
PREINIT: |
1854
|
|
|
|
|
|
Perl_ppaddr_t lower; |
1855
|
|
|
|
|
|
PPCODE: |
1856
|
2
|
|
|
|
|
lower = PL_ppaddr[OP_LC]; |
1857
|
2
|
|
|
|
|
mXPUSHs(newSVpv(string, 0)); |
1858
|
2
|
|
|
|
|
PUTBACK; |
1859
|
2
|
|
|
|
|
ENTER; |
1860
|
2
|
|
|
|
|
(void)*(lower)(aTHXR); |
1861
|
|
|
|
|
|
SPAGAIN; |
1862
|
2
|
|
|
|
|
LEAVE; |
1863
|
2
|
|
|
|
|
XSRETURN(1); |
1864
|
|
|
|
|
|
|
1865
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1866
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/grok |
1867
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1868
|
|
|
|
|
|
|
1869
|
|
|
|
|
|
UV |
1870
|
|
|
|
|
|
grok_number(string) |
1871
|
|
|
|
|
|
SV *string |
1872
|
|
|
|
|
|
PREINIT: |
1873
|
|
|
|
|
|
const char *pv; |
1874
|
|
|
|
|
|
STRLEN len; |
1875
|
|
|
|
|
|
CODE: |
1876
|
4
|
|
|
|
|
pv = SvPV(string, len); |
1877
|
4
|
|
|
|
|
if (!grok_number(pv, len, &RETVAL)) |
1878
|
2
|
|
|
|
|
XSRETURN_UNDEF; |
1879
|
|
|
|
|
|
OUTPUT: |
1880
|
|
|
|
|
|
RETVAL |
1881
|
|
|
|
|
|
|
1882
|
|
|
|
|
|
UV |
1883
|
|
|
|
|
|
grok_bin(string) |
1884
|
|
|
|
|
|
SV *string |
1885
|
|
|
|
|
|
PREINIT: |
1886
|
|
|
|
|
|
char *pv; |
1887
|
|
|
|
|
|
I32 flags; |
1888
|
|
|
|
|
|
STRLEN len; |
1889
|
|
|
|
|
|
CODE: |
1890
|
2
|
|
|
|
|
pv = SvPV(string, len); |
1891
|
2
|
|
|
|
|
RETVAL = grok_bin(pv, &len, &flags, NULL); |
1892
|
|
|
|
|
|
OUTPUT: |
1893
|
|
|
|
|
|
RETVAL |
1894
|
|
|
|
|
|
|
1895
|
|
|
|
|
|
UV |
1896
|
|
|
|
|
|
grok_hex(string) |
1897
|
|
|
|
|
|
SV *string |
1898
|
|
|
|
|
|
PREINIT: |
1899
|
|
|
|
|
|
char *pv; |
1900
|
|
|
|
|
|
I32 flags; |
1901
|
|
|
|
|
|
STRLEN len; |
1902
|
|
|
|
|
|
CODE: |
1903
|
2
|
|
|
|
|
pv = SvPV(string, len); |
1904
|
2
|
|
|
|
|
RETVAL = grok_hex(pv, &len, &flags, NULL); |
1905
|
|
|
|
|
|
OUTPUT: |
1906
|
|
|
|
|
|
RETVAL |
1907
|
|
|
|
|
|
|
1908
|
|
|
|
|
|
UV |
1909
|
|
|
|
|
|
grok_oct(string) |
1910
|
|
|
|
|
|
SV *string |
1911
|
|
|
|
|
|
PREINIT: |
1912
|
|
|
|
|
|
char *pv; |
1913
|
|
|
|
|
|
I32 flags; |
1914
|
|
|
|
|
|
STRLEN len; |
1915
|
|
|
|
|
|
CODE: |
1916
|
2
|
|
|
|
|
pv = SvPV(string, len); |
1917
|
2
|
|
|
|
|
RETVAL = grok_oct(pv, &len, &flags, NULL); |
1918
|
|
|
|
|
|
OUTPUT: |
1919
|
|
|
|
|
|
RETVAL |
1920
|
|
|
|
|
|
|
1921
|
|
|
|
|
|
UV |
1922
|
|
|
|
|
|
Perl_grok_number(string) |
1923
|
|
|
|
|
|
SV *string |
1924
|
|
|
|
|
|
PREINIT: |
1925
|
|
|
|
|
|
const char *pv; |
1926
|
|
|
|
|
|
STRLEN len; |
1927
|
|
|
|
|
|
CODE: |
1928
|
4
|
|
|
|
|
pv = SvPV(string, len); |
1929
|
4
|
|
|
|
|
if (!Perl_grok_number(aTHX_ pv, len, &RETVAL)) |
1930
|
2
|
|
|
|
|
XSRETURN_UNDEF; |
1931
|
|
|
|
|
|
OUTPUT: |
1932
|
|
|
|
|
|
RETVAL |
1933
|
|
|
|
|
|
|
1934
|
|
|
|
|
|
UV |
1935
|
|
|
|
|
|
Perl_grok_bin(string) |
1936
|
|
|
|
|
|
SV *string |
1937
|
|
|
|
|
|
PREINIT: |
1938
|
|
|
|
|
|
char *pv; |
1939
|
|
|
|
|
|
I32 flags; |
1940
|
|
|
|
|
|
STRLEN len; |
1941
|
|
|
|
|
|
CODE: |
1942
|
2
|
|
|
|
|
pv = SvPV(string, len); |
1943
|
2
|
|
|
|
|
RETVAL = Perl_grok_bin(aTHX_ pv, &len, &flags, NULL); |
1944
|
|
|
|
|
|
OUTPUT: |
1945
|
|
|
|
|
|
RETVAL |
1946
|
|
|
|
|
|
|
1947
|
|
|
|
|
|
UV |
1948
|
|
|
|
|
|
Perl_grok_hex(string) |
1949
|
|
|
|
|
|
SV *string |
1950
|
|
|
|
|
|
PREINIT: |
1951
|
|
|
|
|
|
char *pv; |
1952
|
|
|
|
|
|
I32 flags; |
1953
|
|
|
|
|
|
STRLEN len; |
1954
|
|
|
|
|
|
CODE: |
1955
|
2
|
|
|
|
|
pv = SvPV(string, len); |
1956
|
2
|
|
|
|
|
RETVAL = Perl_grok_hex(aTHX_ pv, &len, &flags, NULL); |
1957
|
|
|
|
|
|
OUTPUT: |
1958
|
|
|
|
|
|
RETVAL |
1959
|
|
|
|
|
|
|
1960
|
|
|
|
|
|
UV |
1961
|
|
|
|
|
|
Perl_grok_oct(string) |
1962
|
|
|
|
|
|
SV *string |
1963
|
|
|
|
|
|
PREINIT: |
1964
|
|
|
|
|
|
char *pv; |
1965
|
|
|
|
|
|
I32 flags; |
1966
|
|
|
|
|
|
STRLEN len; |
1967
|
|
|
|
|
|
CODE: |
1968
|
2
|
|
|
|
|
pv = SvPV(string, len); |
1969
|
2
|
|
|
|
|
RETVAL = Perl_grok_oct(aTHX_ pv, &len, &flags, NULL); |
1970
|
|
|
|
|
|
OUTPUT: |
1971
|
|
|
|
|
|
RETVAL |
1972
|
|
|
|
|
|
|
1973
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1974
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/sprintf |
1975
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1976
|
|
|
|
|
|
|
1977
|
|
|
|
|
|
void |
1978
|
|
|
|
|
|
my_sprintf() |
1979
|
|
|
|
|
|
PREINIT: |
1980
|
|
|
|
|
|
char buf[128]; |
1981
|
|
|
|
|
|
int len; |
1982
|
|
|
|
|
|
PPCODE: |
1983
|
|
|
|
|
|
len = my_sprintf(buf, "foo%s%d", "bar", 42); |
1984
|
2
|
|
|
|
|
mXPUSHi(len); |
1985
|
2
|
|
|
|
|
mXPUSHs(newSVpv(buf, 0)); |
1986
|
2
|
|
|
|
|
XSRETURN(2); |
1987
|
|
|
|
|
|
|
1988
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1989
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/mPUSH |
1990
|
|
|
|
|
|
##---------------------------------------------------------------------- |
1991
|
|
|
|
|
|
|
1992
|
|
|
|
|
|
void |
1993
|
|
|
|
|
|
mPUSHs() |
1994
|
|
|
|
|
|
PPCODE: |
1995
|
2
|
|
|
|
|
EXTEND(SP, 3); |
1996
|
2
|
|
|
|
|
mPUSHs(newSVpv("foo", 0)); |
1997
|
2
|
|
|
|
|
mPUSHs(newSVpv("bar13", 3)); |
1998
|
2
|
|
|
|
|
mPUSHs(newSViv(42)); |
1999
|
2
|
|
|
|
|
XSRETURN(3); |
2000
|
|
|
|
|
|
|
2001
|
|
|
|
|
|
void |
2002
|
|
|
|
|
|
mPUSHp() |
2003
|
|
|
|
|
|
PPCODE: |
2004
|
2
|
|
|
|
|
EXTEND(SP, 3); |
2005
|
2
|
|
|
|
|
mPUSHp("one", 3); |
2006
|
2
|
|
|
|
|
mPUSHp("two", 3); |
2007
|
2
|
|
|
|
|
mPUSHp("three", 5); |
2008
|
2
|
|
|
|
|
XSRETURN(3); |
2009
|
|
|
|
|
|
|
2010
|
|
|
|
|
|
void |
2011
|
|
|
|
|
|
mPUSHn() |
2012
|
|
|
|
|
|
PPCODE: |
2013
|
2
|
|
|
|
|
EXTEND(SP, 3); |
2014
|
2
|
|
|
|
|
mPUSHn(0.5); |
2015
|
2
|
|
|
|
|
mPUSHn(-0.25); |
2016
|
2
|
|
|
|
|
mPUSHn(0.125); |
2017
|
2
|
|
|
|
|
XSRETURN(3); |
2018
|
|
|
|
|
|
|
2019
|
|
|
|
|
|
void |
2020
|
|
|
|
|
|
mPUSHi() |
2021
|
|
|
|
|
|
PPCODE: |
2022
|
2
|
|
|
|
|
EXTEND(SP, 3); |
2023
|
2
|
|
|
|
|
mPUSHi(-1); |
2024
|
2
|
|
|
|
|
mPUSHi(2); |
2025
|
2
|
|
|
|
|
mPUSHi(-3); |
2026
|
2
|
|
|
|
|
XSRETURN(3); |
2027
|
|
|
|
|
|
|
2028
|
|
|
|
|
|
void |
2029
|
|
|
|
|
|
mPUSHu() |
2030
|
|
|
|
|
|
PPCODE: |
2031
|
2
|
|
|
|
|
EXTEND(SP, 3); |
2032
|
2
|
|
|
|
|
mPUSHu(1); |
2033
|
2
|
|
|
|
|
mPUSHu(2); |
2034
|
2
|
|
|
|
|
mPUSHu(3); |
2035
|
2
|
|
|
|
|
XSRETURN(3); |
2036
|
|
|
|
|
|
|
2037
|
|
|
|
|
|
void |
2038
|
|
|
|
|
|
mXPUSHs() |
2039
|
|
|
|
|
|
PPCODE: |
2040
|
2
|
|
|
|
|
mXPUSHs(newSVpv("foo", 0)); |
2041
|
2
|
|
|
|
|
mXPUSHs(newSVpv("bar13", 3)); |
2042
|
2
|
|
|
|
|
mXPUSHs(newSViv(42)); |
2043
|
2
|
|
|
|
|
XSRETURN(3); |
2044
|
|
|
|
|
|
|
2045
|
|
|
|
|
|
void |
2046
|
|
|
|
|
|
mXPUSHp() |
2047
|
|
|
|
|
|
PPCODE: |
2048
|
2
|
|
|
|
|
mXPUSHp("one", 3); |
2049
|
2
|
|
|
|
|
mXPUSHp("two", 3); |
2050
|
2
|
|
|
|
|
mXPUSHp("three", 5); |
2051
|
2
|
|
|
|
|
XSRETURN(3); |
2052
|
|
|
|
|
|
|
2053
|
|
|
|
|
|
void |
2054
|
|
|
|
|
|
mXPUSHn() |
2055
|
|
|
|
|
|
PPCODE: |
2056
|
2
|
|
|
|
|
mXPUSHn(0.5); |
2057
|
2
|
|
|
|
|
mXPUSHn(-0.25); |
2058
|
2
|
|
|
|
|
mXPUSHn(0.125); |
2059
|
2
|
|
|
|
|
XSRETURN(3); |
2060
|
|
|
|
|
|
|
2061
|
|
|
|
|
|
void |
2062
|
|
|
|
|
|
mXPUSHi() |
2063
|
|
|
|
|
|
PPCODE: |
2064
|
2
|
|
|
|
|
mXPUSHi(-1); |
2065
|
2
|
|
|
|
|
mXPUSHi(2); |
2066
|
2
|
|
|
|
|
mXPUSHi(-3); |
2067
|
2
|
|
|
|
|
XSRETURN(3); |
2068
|
|
|
|
|
|
|
2069
|
|
|
|
|
|
void |
2070
|
|
|
|
|
|
mXPUSHu() |
2071
|
|
|
|
|
|
PPCODE: |
2072
|
2
|
|
|
|
|
mXPUSHu(1); |
2073
|
2
|
|
|
|
|
mXPUSHu(2); |
2074
|
2
|
|
|
|
|
mXPUSHu(3); |
2075
|
2
|
|
|
|
|
XSRETURN(3); |
2076
|
|
|
|
|
|
|
2077
|
|
|
|
|
|
##---------------------------------------------------------------------- |
2078
|
|
|
|
|
|
## XSUBs for testing the implementation in parts/inc/pvs |
2079
|
|
|
|
|
|
##---------------------------------------------------------------------- |
2080
|
|
|
|
|
|
|
2081
|
|
|
|
|
|
void |
2082
|
|
|
|
|
|
newSVpvs() |
2083
|
|
|
|
|
|
PPCODE: |
2084
|
2
|
|
|
|
|
mXPUSHs(newSVpvs("newSVpvs")); |
2085
|
2
|
|
|
|
|
XSRETURN(1); |
2086
|
|
|
|
|
|
|
2087
|
|
|
|
|
|
void |
2088
|
|
|
|
|
|
newSVpvs_flags() |
2089
|
|
|
|
|
|
PPCODE: |
2090
|
2
|
|
|
|
|
XPUSHs(newSVpvs_flags("newSVpvs_flags", SVs_TEMP)); |
2091
|
2
|
|
|
|
|
XSRETURN(1); |
2092
|
|
|
|
|
|
|
2093
|
|
|
|
|
|
int |
2094
|
|
|
|
|
|
newSVpvs_share() |
2095
|
|
|
|
|
|
PREINIT: |
2096
|
|
|
|
|
|
SV *sv; |
2097
|
|
|
|
|
|
U32 hash; |
2098
|
|
|
|
|
|
CODE: |
2099
|
|
|
|
|
|
RETVAL = 0; |
2100
|
2
|
|
|
|
|
PERL_HASH(hash, "pvs", 3); |
2101
|
2
|
|
|
|
|
sv = newSVpvs_share("pvs"); |
2102
|
2
|
|
|
|
|
RETVAL += strEQ(SvPV_nolen_const(sv), "pvs"); |
2103
|
2
|
|
|
|
|
RETVAL += SvCUR(sv) == 3; |
2104
|
2
|
|
|
|
|
RETVAL += SvSHARED_HASH(sv) == hash; |
2105
|
2
|
|
|
|
|
SvREFCNT_dec(sv); |
2106
|
|
|
|
|
|
OUTPUT: |
2107
|
|
|
|
|
|
RETVAL |
2108
|
|
|
|
|
|
|
2109
|
|
|
|
|
|
void |
2110
|
|
|
|
|
|
sv_catpvs(sv) |
2111
|
|
|
|
|
|
SV *sv |
2112
|
|
|
|
|
|
PPCODE: |
2113
|
2
|
|
|
|
|
sv_catpvs(sv, "sv_catpvs"); |
2114
|
|
|
|
|
|
|
2115
|
|
|
|
|
|
void |
2116
|
|
|
|
|
|
sv_setpvs(sv) |
2117
|
|
|
|
|
|
SV *sv |
2118
|
|
|
|
|
|
PPCODE: |
2119
|
2
|
|
|
|
|
sv_setpvs(sv, "sv_setpvs"); |
2120
|
|
|
|
|
|
|
2121
|
|
|
|
|
|
void |
2122
|
|
|
|
|
|
hv_fetchs(hv) |
2123
|
|
|
|
|
|
SV *hv |
2124
|
|
|
|
|
|
PREINIT: |
2125
|
|
|
|
|
|
SV **s; |
2126
|
|
|
|
|
|
PPCODE: |
2127
|
2
|
|
|
|
|
s = hv_fetchs((HV *) SvRV(hv), "hv_fetchs", 0); |
2128
|
2
|
|
|
|
|
XPUSHs(sv_mortalcopy(*s)); |
2129
|
2
|
|
|
|
|
XSRETURN(1); |
2130
|
|
|
|
|
|
|
2131
|
|
|
|
|
|
void |
2132
|
|
|
|
|
|
hv_stores(hv, sv) |
2133
|
|
|
|
|
|
SV *hv |
2134
|
|
|
|
|
|
SV *sv |
2135
|
|
|
|
|
|
PPCODE: |
2136
|
2
|
|
|
|
|
(void) hv_stores((HV *) SvRV(hv), "hv_stores", SvREFCNT_inc_simple(sv)); |
2137
|
|
|
|
|
|
|
2138
|
|
|
|
|
|
SV* |
2139
|
|
|
|
|
|
gv_fetchpvs() |
2140
|
|
|
|
|
|
CODE: |
2141
|
2
|
|
|
|
|
RETVAL = newRV_inc((SV*)gv_fetchpvs("Devel::PPPort::VERSION", 0, SVt_PV)); |
2142
|
|
|
|
|
|
OUTPUT: |
2143
|
|
|
|
|
|
RETVAL |
2144
|
|
|
|
|
|
|
2145
|
|
|
|
|
|
SV* |
2146
|
|
|
|
|
|
gv_stashpvs() |
2147
|
|
|
|
|
|
CODE: |
2148
|
2
|
|
|
|
|
RETVAL = newRV_inc((SV*)gv_stashpvs("Devel::PPPort", 0)); |
2149
|
|
|
|
|
|
OUTPUT: |
2150
|
|
|
|
|
|
RETVAL |
2151
|
|
|
|
|
|
|
2152
|
|
|
|
|
|
int |
2153
|
|
|
|
|
|
get_cvs() |
2154
|
|
|
|
|
|
PREINIT: |
2155
|
|
|
|
|
|
CV* xv; |
2156
|
|
|
|
|
|
CODE: |
2157
|
|
|
|
|
|
RETVAL = 0; |
2158
|
2
|
|
|
|
|
xv = get_cvs("Devel::PPPort::foobar", 0); |
2159
|
2
|
|
|
|
|
if(xv == NULL) RETVAL++; |
2160
|
2
|
|
|
|
|
xv = get_cvs("Devel::PPPort::foobar", GV_ADDMULTI); |
2161
|
2
|
|
|
|
|
if(xv && SvTYPE(xv) == SVt_PVCV) RETVAL++; |
2162
|
2
|
|
|
|
|
xv = get_cvs("Devel::PPPort::get_cvs", 0); |
2163
|
2
|
|
|
|
|
if(xv && SvTYPE(xv) == SVt_PVCV) RETVAL++; |
2164
|
|
|
|
|
|
OUTPUT: |
2165
|
|
|
|
|
|
RETVAL |