Commit | Line | Data |
---|---|---|
7ee2227d SP |
1 | /* mathoms.c |
2 | * | |
1129b882 | 3 | * Copyright (C) 2005, 2006, 2007, 2008 by Larry Wall and others |
7ee2227d SP |
4 | * |
5 | * You may distribute under the terms of either the GNU General Public | |
6 | * License or the Artistic License, as specified in the README file. | |
7 | * | |
8 | */ | |
9 | ||
10 | /* | |
4ac71550 TC |
11 | * Anything that Hobbits had no immediate use for, but were unwilling to |
12 | * throw away, they called a mathom. Their dwellings were apt to become | |
13 | * rather crowded with mathoms, and many of the presents that passed from | |
14 | * hand to hand were of that sort. | |
15 | * | |
16 | * [p.5 of _The Lord of the Rings_: "Prologue"] | |
7ee2227d SP |
17 | */ |
18 | ||
359d40ba | 19 | |
20fac488 | 20 | |
7ee2227d SP |
21 | /* |
22 | * This file contains mathoms, various binary artifacts from previous | |
f2f0f092 NC |
23 | * versions of Perl. For binary or source compatibility reasons, though, |
24 | * we cannot completely remove them from the core code. | |
7ee2227d SP |
25 | * |
26 | * SMP - Oct. 24, 2005 | |
27 | * | |
28 | */ | |
29 | ||
30 | #include "EXTERN.h" | |
31 | #define PERL_IN_MATHOMS_C | |
32 | #include "perl.h" | |
33 | ||
359d40ba NC |
34 | #ifdef NO_MATHOMS |
35 | /* ..." warning: ISO C forbids an empty source file" | |
36 | So make sure we have something in here by processing the headers anyway. | |
37 | */ | |
38 | #else | |
39 | ||
a0c21aa1 JH |
40 | PERL_CALLCONV OP * Perl_ref(pTHX_ OP *o, I32 type); |
41 | PERL_CALLCONV void Perl_sv_unref(pTHX_ SV *sv); | |
42 | PERL_CALLCONV void Perl_sv_taint(pTHX_ SV *sv); | |
43 | PERL_CALLCONV IV Perl_sv_2iv(pTHX_ register SV *sv); | |
44 | PERL_CALLCONV UV Perl_sv_2uv(pTHX_ register SV *sv); | |
39d5de13 | 45 | PERL_CALLCONV NV Perl_sv_2nv(pTHX_ register SV *sv); |
a0c21aa1 JH |
46 | PERL_CALLCONV char * Perl_sv_2pv(pTHX_ register SV *sv, STRLEN *lp); |
47 | PERL_CALLCONV char * Perl_sv_2pv_nolen(pTHX_ register SV *sv); | |
48 | PERL_CALLCONV char * Perl_sv_2pvbyte_nolen(pTHX_ register SV *sv); | |
49 | PERL_CALLCONV char * Perl_sv_2pvutf8_nolen(pTHX_ register SV *sv); | |
50 | PERL_CALLCONV void Perl_sv_force_normal(pTHX_ register SV *sv); | |
51 | PERL_CALLCONV void Perl_sv_setsv(pTHX_ SV *dstr, register SV *sstr); | |
52 | PERL_CALLCONV void Perl_sv_catpvn(pTHX_ SV *dsv, const char* sstr, STRLEN slen); | |
53 | PERL_CALLCONV void Perl_sv_catpvn_mg(pTHX_ register SV *sv, register const char *ptr, register STRLEN len); | |
54 | PERL_CALLCONV void Perl_sv_catsv(pTHX_ SV *dstr, register SV *sstr); | |
55 | PERL_CALLCONV void Perl_sv_catsv_mg(pTHX_ SV *dsv, register SV *ssv); | |
56 | PERL_CALLCONV char * Perl_sv_pv(pTHX_ SV *sv); | |
57 | PERL_CALLCONV char * Perl_sv_pvn_force(pTHX_ SV *sv, STRLEN *lp); | |
58 | PERL_CALLCONV char * Perl_sv_pvbyte(pTHX_ SV *sv); | |
59 | PERL_CALLCONV char * Perl_sv_pvutf8(pTHX_ SV *sv); | |
60 | PERL_CALLCONV STRLEN Perl_sv_utf8_upgrade(pTHX_ register SV *sv); | |
61 | PERL_CALLCONV NV Perl_huge(void); | |
62 | PERL_CALLCONV void Perl_gv_fullname3(pTHX_ SV *sv, const GV *gv, const char *prefix); | |
63 | PERL_CALLCONV void Perl_gv_efullname3(pTHX_ SV *sv, const GV *gv, const char *prefix); | |
64 | PERL_CALLCONV GV * Perl_gv_fetchmethod(pTHX_ HV *stash, const char *name); | |
65 | PERL_CALLCONV HE * Perl_hv_iternext(pTHX_ HV *hv); | |
66 | PERL_CALLCONV void Perl_hv_magic(pTHX_ HV *hv, GV *gv, int how); | |
67 | PERL_CALLCONV bool Perl_do_open(pTHX_ GV *gv, register const char *name, I32 len, int as_raw, int rawmode, int rawperm, PerlIO *supplied_fp); | |
68 | PERL_CALLCONV bool Perl_do_aexec(pTHX_ SV *really, register SV **mark, register SV **sp); | |
a0c21aa1 JH |
69 | PERL_CALLCONV U8 * Perl_uvuni_to_utf8(pTHX_ U8 *d, UV uv); |
70 | PERL_CALLCONV bool Perl_is_utf8_string_loc(pTHX_ const U8 *s, STRLEN len, const U8 **ep); | |
71 | PERL_CALLCONV void Perl_sv_nolocking(pTHX_ SV *sv); | |
72 | PERL_CALLCONV void Perl_sv_usepvn_mg(pTHX_ SV *sv, char *ptr, STRLEN len); | |
73 | PERL_CALLCONV void Perl_sv_usepvn(pTHX_ SV *sv, char *ptr, STRLEN len); | |
74 | PERL_CALLCONV int Perl_fprintf_nocontext(PerlIO *stream, const char *format, ...); | |
75 | PERL_CALLCONV int Perl_printf_nocontext(const char *format, ...); | |
56d7a086 | 76 | PERL_CALLCONV int Perl_magic_setglob(pTHX_ SV* sv, MAGIC* mg); |
ac572bf4 | 77 | PERL_CALLCONV AV * Perl_newAV(pTHX); |
78ac7dd9 | 78 | PERL_CALLCONV HV * Perl_newHV(pTHX); |
85dca89a | 79 | PERL_CALLCONV IO * Perl_newIO(pTHX); |
0d7d409d DM |
80 | PERL_CALLCONV I32 Perl_my_stat(pTHX); |
81 | PERL_CALLCONV I32 Perl_my_lstat(pTHX); | |
078504b2 FC |
82 | PERL_CALLCONV I32 Perl_sv_eq(pTHX_ register SV *sv1, register SV *sv2); |
83 | PERL_CALLCONV char * Perl_sv_collxfrm(pTHX_ SV *const sv, STRLEN *const nxp); | |
06c841cf | 84 | PERL_CALLCONV bool Perl_sv_2bool(pTHX_ register SV *const sv); |
7bff8c33 | 85 | PERL_CALLCONV CV * Perl_newSUB(pTHX_ I32 floor, OP* o, OP* proto, OP* block); |
0c9b0438 KW |
86 | PERL_CALLCONV UV Perl_to_utf8_lower(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp); |
87 | PERL_CALLCONV UV Perl_to_utf8_title(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp); | |
88 | PERL_CALLCONV UV Perl_to_utf8_upper(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp); | |
89 | PERL_CALLCONV UV Perl_to_utf8_fold(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp); | |
b5445a23 | 90 | |
7ee2227d SP |
91 | /* ref() is now a macro using Perl_doref; |
92 | * this version provided for binary compatibility only. | |
93 | */ | |
94 | OP * | |
95 | Perl_ref(pTHX_ OP *o, I32 type) | |
96 | { | |
97 | return doref(o, type, TRUE); | |
98 | } | |
99 | ||
aae9cea0 | 100 | /* |
174c73e3 NC |
101 | =for apidoc sv_unref |
102 | ||
103 | Unsets the RV status of the SV, and decrements the reference count of | |
104 | whatever was being referenced by the RV. This can almost be thought of | |
105 | as a reversal of C<newSVrv>. This is C<sv_unref_flags> with the C<flag> | |
106 | being zero. See C<SvROK_off>. | |
107 | ||
108 | =cut | |
109 | */ | |
110 | ||
111 | void | |
112 | Perl_sv_unref(pTHX_ SV *sv) | |
113 | { | |
7918f24d NC |
114 | PERL_ARGS_ASSERT_SV_UNREF; |
115 | ||
174c73e3 NC |
116 | sv_unref_flags(sv, 0); |
117 | } | |
118 | ||
119 | /* | |
aae9cea0 NC |
120 | =for apidoc sv_taint |
121 | ||
122 | Taint an SV. Use C<SvTAINTED_on> instead. | |
dff47061 | 123 | |
aae9cea0 NC |
124 | =cut |
125 | */ | |
126 | ||
127 | void | |
128 | Perl_sv_taint(pTHX_ SV *sv) | |
129 | { | |
7918f24d NC |
130 | PERL_ARGS_ASSERT_SV_TAINT; |
131 | ||
a0714e2c | 132 | sv_magic((sv), NULL, PERL_MAGIC_taint, NULL, 0); |
aae9cea0 NC |
133 | } |
134 | ||
7ee2227d SP |
135 | /* sv_2iv() is now a macro using Perl_sv_2iv_flags(); |
136 | * this function provided for binary compatibility only | |
137 | */ | |
138 | ||
139 | IV | |
140 | Perl_sv_2iv(pTHX_ register SV *sv) | |
141 | { | |
142 | return sv_2iv_flags(sv, SV_GMAGIC); | |
143 | } | |
144 | ||
145 | /* sv_2uv() is now a macro using Perl_sv_2uv_flags(); | |
146 | * this function provided for binary compatibility only | |
147 | */ | |
148 | ||
149 | UV | |
150 | Perl_sv_2uv(pTHX_ register SV *sv) | |
151 | { | |
152 | return sv_2uv_flags(sv, SV_GMAGIC); | |
153 | } | |
154 | ||
39d5de13 DM |
155 | /* sv_2nv() is now a macro using Perl_sv_2nv_flags(); |
156 | * this function provided for binary compatibility only | |
157 | */ | |
158 | ||
159 | NV | |
160 | Perl_sv_2nv(pTHX_ register SV *sv) | |
161 | { | |
162 | return sv_2nv_flags(sv, SV_GMAGIC); | |
163 | } | |
164 | ||
165 | ||
7ee2227d SP |
166 | /* sv_2pv() is now a macro using Perl_sv_2pv_flags(); |
167 | * this function provided for binary compatibility only | |
168 | */ | |
169 | ||
170 | char * | |
171 | Perl_sv_2pv(pTHX_ register SV *sv, STRLEN *lp) | |
172 | { | |
173 | return sv_2pv_flags(sv, lp, SV_GMAGIC); | |
174 | } | |
175 | ||
5abc721d | 176 | /* |
cb2f1b7b NC |
177 | =for apidoc sv_2pv_nolen |
178 | ||
179 | Like C<sv_2pv()>, but doesn't return the length too. You should usually | |
180 | use the macro wrapper C<SvPV_nolen(sv)> instead. | |
dff47061 | 181 | |
cb2f1b7b NC |
182 | =cut |
183 | */ | |
184 | ||
185 | char * | |
186 | Perl_sv_2pv_nolen(pTHX_ register SV *sv) | |
187 | { | |
c85ae797 | 188 | PERL_ARGS_ASSERT_SV_2PV_NOLEN; |
b5445a23 | 189 | return sv_2pv(sv, NULL); |
cb2f1b7b NC |
190 | } |
191 | ||
192 | /* | |
193 | =for apidoc sv_2pvbyte_nolen | |
194 | ||
195 | Return a pointer to the byte-encoded representation of the SV. | |
196 | May cause the SV to be downgraded from UTF-8 as a side-effect. | |
197 | ||
198 | Usually accessed via the C<SvPVbyte_nolen> macro. | |
199 | ||
200 | =cut | |
201 | */ | |
202 | ||
203 | char * | |
204 | Perl_sv_2pvbyte_nolen(pTHX_ register SV *sv) | |
205 | { | |
7918f24d NC |
206 | PERL_ARGS_ASSERT_SV_2PVBYTE_NOLEN; |
207 | ||
b5445a23 | 208 | return sv_2pvbyte(sv, NULL); |
cb2f1b7b NC |
209 | } |
210 | ||
211 | /* | |
212 | =for apidoc sv_2pvutf8_nolen | |
213 | ||
214 | Return a pointer to the UTF-8-encoded representation of the SV. | |
215 | May cause the SV to be upgraded to UTF-8 as a side-effect. | |
216 | ||
217 | Usually accessed via the C<SvPVutf8_nolen> macro. | |
218 | ||
219 | =cut | |
220 | */ | |
221 | ||
222 | char * | |
223 | Perl_sv_2pvutf8_nolen(pTHX_ register SV *sv) | |
224 | { | |
7918f24d NC |
225 | PERL_ARGS_ASSERT_SV_2PVUTF8_NOLEN; |
226 | ||
b5445a23 | 227 | return sv_2pvutf8(sv, NULL); |
cb2f1b7b NC |
228 | } |
229 | ||
230 | /* | |
5abc721d NC |
231 | =for apidoc sv_force_normal |
232 | ||
233 | Undo various types of fakery on an SV: if the PV is a shared string, make | |
234 | a private copy; if we're a ref, stop refing; if we're a glob, downgrade to | |
235 | an xpvmg. See also C<sv_force_normal_flags>. | |
236 | ||
237 | =cut | |
238 | */ | |
239 | ||
240 | void | |
241 | Perl_sv_force_normal(pTHX_ register SV *sv) | |
242 | { | |
7918f24d NC |
243 | PERL_ARGS_ASSERT_SV_FORCE_NORMAL; |
244 | ||
5abc721d NC |
245 | sv_force_normal_flags(sv, 0); |
246 | } | |
7ee2227d SP |
247 | |
248 | /* sv_setsv() is now a macro using Perl_sv_setsv_flags(); | |
249 | * this function provided for binary compatibility only | |
250 | */ | |
251 | ||
252 | void | |
253 | Perl_sv_setsv(pTHX_ SV *dstr, register SV *sstr) | |
254 | { | |
7918f24d NC |
255 | PERL_ARGS_ASSERT_SV_SETSV; |
256 | ||
7ee2227d SP |
257 | sv_setsv_flags(dstr, sstr, SV_GMAGIC); |
258 | } | |
259 | ||
260 | /* sv_catpvn() is now a macro using Perl_sv_catpvn_flags(); | |
261 | * this function provided for binary compatibility only | |
262 | */ | |
263 | ||
264 | void | |
265 | Perl_sv_catpvn(pTHX_ SV *dsv, const char* sstr, STRLEN slen) | |
266 | { | |
7918f24d NC |
267 | PERL_ARGS_ASSERT_SV_CATPVN; |
268 | ||
7ee2227d SP |
269 | sv_catpvn_flags(dsv, sstr, slen, SV_GMAGIC); |
270 | } | |
271 | ||
b347df82 NC |
272 | /* |
273 | =for apidoc sv_catpvn_mg | |
274 | ||
275 | Like C<sv_catpvn>, but also handles 'set' magic. | |
276 | ||
277 | =cut | |
278 | */ | |
279 | ||
280 | void | |
281 | Perl_sv_catpvn_mg(pTHX_ register SV *sv, register const char *ptr, register STRLEN len) | |
282 | { | |
7918f24d NC |
283 | PERL_ARGS_ASSERT_SV_CATPVN_MG; |
284 | ||
b347df82 NC |
285 | sv_catpvn_flags(sv,ptr,len,SV_GMAGIC|SV_SMAGIC); |
286 | } | |
287 | ||
7ee2227d SP |
288 | /* sv_catsv() is now a macro using Perl_sv_catsv_flags(); |
289 | * this function provided for binary compatibility only | |
290 | */ | |
291 | ||
292 | void | |
293 | Perl_sv_catsv(pTHX_ SV *dstr, register SV *sstr) | |
294 | { | |
7918f24d NC |
295 | PERL_ARGS_ASSERT_SV_CATSV; |
296 | ||
7ee2227d SP |
297 | sv_catsv_flags(dstr, sstr, SV_GMAGIC); |
298 | } | |
299 | ||
0feed65a | 300 | /* |
b347df82 NC |
301 | =for apidoc sv_catsv_mg |
302 | ||
303 | Like C<sv_catsv>, but also handles 'set' magic. | |
304 | ||
305 | =cut | |
306 | */ | |
307 | ||
308 | void | |
309 | Perl_sv_catsv_mg(pTHX_ SV *dsv, register SV *ssv) | |
310 | { | |
7918f24d NC |
311 | PERL_ARGS_ASSERT_SV_CATSV_MG; |
312 | ||
b347df82 NC |
313 | sv_catsv_flags(dsv,ssv,SV_GMAGIC|SV_SMAGIC); |
314 | } | |
315 | ||
316 | /* | |
0feed65a NC |
317 | =for apidoc sv_iv |
318 | ||
319 | A private implementation of the C<SvIVx> macro for compilers which can't | |
320 | cope with complex macro expressions. Always use the macro instead. | |
321 | ||
322 | =cut | |
323 | */ | |
324 | ||
325 | IV | |
326 | Perl_sv_iv(pTHX_ register SV *sv) | |
327 | { | |
7918f24d NC |
328 | PERL_ARGS_ASSERT_SV_IV; |
329 | ||
0feed65a NC |
330 | if (SvIOK(sv)) { |
331 | if (SvIsUV(sv)) | |
332 | return (IV)SvUVX(sv); | |
333 | return SvIVX(sv); | |
334 | } | |
335 | return sv_2iv(sv); | |
336 | } | |
337 | ||
338 | /* | |
339 | =for apidoc sv_uv | |
340 | ||
341 | A private implementation of the C<SvUVx> macro for compilers which can't | |
342 | cope with complex macro expressions. Always use the macro instead. | |
343 | ||
344 | =cut | |
345 | */ | |
346 | ||
347 | UV | |
348 | Perl_sv_uv(pTHX_ register SV *sv) | |
349 | { | |
7918f24d NC |
350 | PERL_ARGS_ASSERT_SV_UV; |
351 | ||
0feed65a NC |
352 | if (SvIOK(sv)) { |
353 | if (SvIsUV(sv)) | |
354 | return SvUVX(sv); | |
355 | return (UV)SvIVX(sv); | |
356 | } | |
357 | return sv_2uv(sv); | |
358 | } | |
359 | ||
360 | /* | |
361 | =for apidoc sv_nv | |
362 | ||
363 | A private implementation of the C<SvNVx> macro for compilers which can't | |
364 | cope with complex macro expressions. Always use the macro instead. | |
365 | ||
366 | =cut | |
367 | */ | |
368 | ||
369 | NV | |
370 | Perl_sv_nv(pTHX_ register SV *sv) | |
371 | { | |
7918f24d NC |
372 | PERL_ARGS_ASSERT_SV_NV; |
373 | ||
0feed65a NC |
374 | if (SvNOK(sv)) |
375 | return SvNVX(sv); | |
376 | return sv_2nv(sv); | |
377 | } | |
378 | ||
379 | /* | |
380 | =for apidoc sv_pv | |
381 | ||
382 | Use the C<SvPV_nolen> macro instead | |
383 | ||
384 | =for apidoc sv_pvn | |
385 | ||
386 | A private implementation of the C<SvPV> macro for compilers which can't | |
387 | cope with complex macro expressions. Always use the macro instead. | |
388 | ||
389 | =cut | |
390 | */ | |
391 | ||
392 | char * | |
393 | Perl_sv_pvn(pTHX_ SV *sv, STRLEN *lp) | |
394 | { | |
7918f24d NC |
395 | PERL_ARGS_ASSERT_SV_PVN; |
396 | ||
0feed65a NC |
397 | if (SvPOK(sv)) { |
398 | *lp = SvCUR(sv); | |
399 | return SvPVX(sv); | |
400 | } | |
401 | return sv_2pv(sv, lp); | |
402 | } | |
403 | ||
404 | ||
405 | char * | |
406 | Perl_sv_pvn_nomg(pTHX_ register SV *sv, STRLEN *lp) | |
407 | { | |
7918f24d NC |
408 | PERL_ARGS_ASSERT_SV_PVN_NOMG; |
409 | ||
0feed65a NC |
410 | if (SvPOK(sv)) { |
411 | *lp = SvCUR(sv); | |
412 | return SvPVX(sv); | |
413 | } | |
414 | return sv_2pv_flags(sv, lp, 0); | |
415 | } | |
416 | ||
7ee2227d SP |
417 | /* sv_pv() is now a macro using SvPV_nolen(); |
418 | * this function provided for binary compatibility only | |
419 | */ | |
420 | ||
421 | char * | |
422 | Perl_sv_pv(pTHX_ SV *sv) | |
423 | { | |
7918f24d NC |
424 | PERL_ARGS_ASSERT_SV_PV; |
425 | ||
7ee2227d SP |
426 | if (SvPOK(sv)) |
427 | return SvPVX(sv); | |
428 | ||
b5445a23 | 429 | return sv_2pv(sv, NULL); |
7ee2227d SP |
430 | } |
431 | ||
432 | /* sv_pvn_force() is now a macro using Perl_sv_pvn_force_flags(); | |
433 | * this function provided for binary compatibility only | |
434 | */ | |
435 | ||
436 | char * | |
437 | Perl_sv_pvn_force(pTHX_ SV *sv, STRLEN *lp) | |
438 | { | |
7918f24d NC |
439 | PERL_ARGS_ASSERT_SV_PVN_FORCE; |
440 | ||
7ee2227d SP |
441 | return sv_pvn_force_flags(sv, lp, SV_GMAGIC); |
442 | } | |
443 | ||
444 | /* sv_pvbyte () is now a macro using Perl_sv_2pv_flags(); | |
445 | * this function provided for binary compatibility only | |
446 | */ | |
447 | ||
448 | char * | |
449 | Perl_sv_pvbyte(pTHX_ SV *sv) | |
450 | { | |
7918f24d NC |
451 | PERL_ARGS_ASSERT_SV_PVBYTE; |
452 | ||
b5445a23 | 453 | sv_utf8_downgrade(sv, FALSE); |
7ee2227d SP |
454 | return sv_pv(sv); |
455 | } | |
456 | ||
0feed65a NC |
457 | /* |
458 | =for apidoc sv_pvbyte | |
459 | ||
460 | Use C<SvPVbyte_nolen> instead. | |
461 | ||
462 | =for apidoc sv_pvbyten | |
463 | ||
464 | A private implementation of the C<SvPVbyte> macro for compilers | |
465 | which can't cope with complex macro expressions. Always use the macro | |
466 | instead. | |
467 | ||
468 | =cut | |
469 | */ | |
470 | ||
471 | char * | |
472 | Perl_sv_pvbyten(pTHX_ SV *sv, STRLEN *lp) | |
473 | { | |
7918f24d NC |
474 | PERL_ARGS_ASSERT_SV_PVBYTEN; |
475 | ||
b5445a23 | 476 | sv_utf8_downgrade(sv, FALSE); |
0feed65a NC |
477 | return sv_pvn(sv,lp); |
478 | } | |
479 | ||
7ee2227d SP |
480 | /* sv_pvutf8 () is now a macro using Perl_sv_2pv_flags(); |
481 | * this function provided for binary compatibility only | |
482 | */ | |
483 | ||
484 | char * | |
485 | Perl_sv_pvutf8(pTHX_ SV *sv) | |
486 | { | |
7918f24d NC |
487 | PERL_ARGS_ASSERT_SV_PVUTF8; |
488 | ||
7ee2227d SP |
489 | sv_utf8_upgrade(sv); |
490 | return sv_pv(sv); | |
491 | } | |
492 | ||
0feed65a NC |
493 | /* |
494 | =for apidoc sv_pvutf8 | |
495 | ||
496 | Use the C<SvPVutf8_nolen> macro instead | |
497 | ||
498 | =for apidoc sv_pvutf8n | |
499 | ||
500 | A private implementation of the C<SvPVutf8> macro for compilers | |
501 | which can't cope with complex macro expressions. Always use the macro | |
502 | instead. | |
503 | ||
504 | =cut | |
505 | */ | |
506 | ||
507 | char * | |
508 | Perl_sv_pvutf8n(pTHX_ SV *sv, STRLEN *lp) | |
509 | { | |
7918f24d NC |
510 | PERL_ARGS_ASSERT_SV_PVUTF8N; |
511 | ||
0feed65a NC |
512 | sv_utf8_upgrade(sv); |
513 | return sv_pvn(sv,lp); | |
514 | } | |
515 | ||
205c02c2 NC |
516 | /* sv_utf8_upgrade() is now a macro using sv_utf8_upgrade_flags(); |
517 | * this function provided for binary compatibility only | |
518 | */ | |
519 | ||
520 | STRLEN | |
521 | Perl_sv_utf8_upgrade(pTHX_ register SV *sv) | |
522 | { | |
7918f24d NC |
523 | PERL_ARGS_ASSERT_SV_UTF8_UPGRADE; |
524 | ||
205c02c2 NC |
525 | return sv_utf8_upgrade_flags(sv, SV_GMAGIC); |
526 | } | |
527 | ||
7ee2227d SP |
528 | int |
529 | Perl_fprintf_nocontext(PerlIO *stream, const char *format, ...) | |
530 | { | |
531 | dTHXs; | |
532 | va_list(arglist); | |
7918f24d NC |
533 | |
534 | /* Easier to special case this here than in embed.pl. (Look at what it | |
535 | generates for proto.h) */ | |
536 | #ifdef PERL_IMPLICIT_CONTEXT | |
537 | PERL_ARGS_ASSERT_FPRINTF_NOCONTEXT; | |
538 | #endif | |
539 | ||
7ee2227d SP |
540 | va_start(arglist, format); |
541 | return PerlIO_vprintf(stream, format, arglist); | |
542 | } | |
543 | ||
544 | int | |
545 | Perl_printf_nocontext(const char *format, ...) | |
546 | { | |
547 | dTHX; | |
548 | va_list(arglist); | |
7918f24d NC |
549 | |
550 | #ifdef PERL_IMPLICIT_CONTEXT | |
551 | PERL_ARGS_ASSERT_PRINTF_NOCONTEXT; | |
552 | #endif | |
553 | ||
7ee2227d SP |
554 | va_start(arglist, format); |
555 | return PerlIO_vprintf(PerlIO_stdout(), format, arglist); | |
556 | } | |
557 | ||
558 | #if defined(HUGE_VAL) || (defined(USE_LONG_DOUBLE) && defined(HUGE_VALL)) | |
559 | /* | |
560 | * This hack is to force load of "huge" support from libm.a | |
561 | * So it is in perl for (say) POSIX to use. | |
562 | * Needed for SunOS with Sun's 'acc' for example. | |
563 | */ | |
564 | NV | |
565 | Perl_huge(void) | |
566 | { | |
c773ee7a | 567 | # if defined(USE_LONG_DOUBLE) && defined(HUGE_VALL) |
7ee2227d | 568 | return HUGE_VALL; |
c773ee7a | 569 | # else |
7ee2227d | 570 | return HUGE_VAL; |
c773ee7a | 571 | # endif |
7ee2227d SP |
572 | } |
573 | #endif | |
574 | ||
f2f0f092 NC |
575 | /* compatibility with versions <= 5.003. */ |
576 | void | |
577 | Perl_gv_fullname(pTHX_ SV *sv, const GV *gv) | |
578 | { | |
7918f24d NC |
579 | PERL_ARGS_ASSERT_GV_FULLNAME; |
580 | ||
666ea192 | 581 | gv_fullname3(sv, gv, sv == (const SV*)gv ? "*" : ""); |
f2f0f092 NC |
582 | } |
583 | ||
584 | /* compatibility with versions <= 5.003. */ | |
585 | void | |
586 | Perl_gv_efullname(pTHX_ SV *sv, const GV *gv) | |
587 | { | |
7918f24d NC |
588 | PERL_ARGS_ASSERT_GV_EFULLNAME; |
589 | ||
666ea192 | 590 | gv_efullname3(sv, gv, sv == (const SV*)gv ? "*" : ""); |
f2f0f092 NC |
591 | } |
592 | ||
2674aeec NC |
593 | void |
594 | Perl_gv_fullname3(pTHX_ SV *sv, const GV *gv, const char *prefix) | |
595 | { | |
7918f24d NC |
596 | PERL_ARGS_ASSERT_GV_FULLNAME3; |
597 | ||
2674aeec NC |
598 | gv_fullname4(sv, gv, prefix, TRUE); |
599 | } | |
600 | ||
601 | void | |
602 | Perl_gv_efullname3(pTHX_ SV *sv, const GV *gv, const char *prefix) | |
603 | { | |
7918f24d NC |
604 | PERL_ARGS_ASSERT_GV_EFULLNAME3; |
605 | ||
2674aeec NC |
606 | gv_efullname4(sv, gv, prefix, TRUE); |
607 | } | |
608 | ||
887986eb NC |
609 | /* |
610 | =for apidoc gv_fetchmethod | |
611 | ||
ca8b95d7 | 612 | See L</gv_fetchmethod_autoload>. |
887986eb NC |
613 | |
614 | =cut | |
615 | */ | |
616 | ||
617 | GV * | |
618 | Perl_gv_fetchmethod(pTHX_ HV *stash, const char *name) | |
619 | { | |
7918f24d NC |
620 | PERL_ARGS_ASSERT_GV_FETCHMETHOD; |
621 | ||
887986eb NC |
622 | return gv_fetchmethod_autoload(stash, name, TRUE); |
623 | } | |
624 | ||
7a7b9979 NC |
625 | HE * |
626 | Perl_hv_iternext(pTHX_ HV *hv) | |
627 | { | |
7918f24d NC |
628 | PERL_ARGS_ASSERT_HV_ITERNEXT; |
629 | ||
7a7b9979 NC |
630 | return hv_iternext_flags(hv, 0); |
631 | } | |
632 | ||
bc5cdc23 NC |
633 | void |
634 | Perl_hv_magic(pTHX_ HV *hv, GV *gv, int how) | |
635 | { | |
7918f24d NC |
636 | PERL_ARGS_ASSERT_HV_MAGIC; |
637 | ||
ad64d0ec | 638 | sv_magic(MUTABLE_SV(hv), MUTABLE_SV(gv), how, NULL, 0); |
bc5cdc23 NC |
639 | } |
640 | ||
34d367cd | 641 | bool |
e4dba786 NC |
642 | Perl_do_open(pTHX_ GV *gv, register const char *name, I32 len, int as_raw, |
643 | int rawmode, int rawperm, PerlIO *supplied_fp) | |
644 | { | |
7918f24d NC |
645 | PERL_ARGS_ASSERT_DO_OPEN; |
646 | ||
e4dba786 NC |
647 | return do_openn(gv, name, len, as_raw, rawmode, rawperm, |
648 | supplied_fp, (SV **) NULL, 0); | |
649 | } | |
650 | ||
651 | bool | |
34d367cd SP |
652 | Perl_do_open9(pTHX_ GV *gv, register const char *name, I32 len, int |
653 | as_raw, | |
654 | int rawmode, int rawperm, PerlIO *supplied_fp, SV *svs, | |
655 | I32 num_svs) | |
656 | { | |
7918f24d NC |
657 | PERL_ARGS_ASSERT_DO_OPEN9; |
658 | ||
34d367cd SP |
659 | PERL_UNUSED_ARG(num_svs); |
660 | return do_openn(gv, name, len, as_raw, rawmode, rawperm, | |
661 | supplied_fp, &svs, 1); | |
662 | } | |
663 | ||
664 | int | |
665 | Perl_do_binmode(pTHX_ PerlIO *fp, int iotype, int mode) | |
666 | { | |
667 | /* The old body of this is now in non-LAYER part of perlio.c | |
668 | * This is a stub for any XS code which might have been calling it. | |
669 | */ | |
670 | const char *name = ":raw"; | |
7918f24d NC |
671 | |
672 | PERL_ARGS_ASSERT_DO_BINMODE; | |
673 | ||
34d367cd SP |
674 | #ifdef PERLIO_USING_CRLF |
675 | if (!(mode & O_BINARY)) | |
676 | name = ":crlf"; | |
677 | #endif | |
678 | return PerlIO_binmode(aTHX_ fp, iotype, mode, name); | |
679 | } | |
680 | ||
a9f96b3f NC |
681 | #ifndef OS2 |
682 | bool | |
683 | Perl_do_aexec(pTHX_ SV *really, register SV **mark, register SV **sp) | |
684 | { | |
7918f24d NC |
685 | PERL_ARGS_ASSERT_DO_AEXEC; |
686 | ||
a9f96b3f NC |
687 | return do_aexec5(really, mark, sp, 0, 0); |
688 | } | |
689 | #endif | |
690 | ||
89552e80 NC |
691 | /* Backwards compatibility. */ |
692 | int | |
693 | Perl_init_i18nl14n(pTHX_ int printwarn) | |
694 | { | |
695 | return init_i18nl10n(printwarn); | |
696 | } | |
697 | ||
038e8d3c NC |
698 | U8 * |
699 | Perl_uvuni_to_utf8(pTHX_ U8 *d, UV uv) | |
700 | { | |
7918f24d NC |
701 | PERL_ARGS_ASSERT_UVUNI_TO_UTF8; |
702 | ||
038e8d3c NC |
703 | return Perl_uvuni_to_utf8_flags(aTHX_ d, uv, 0); |
704 | } | |
705 | ||
814fafa7 NC |
706 | bool |
707 | Perl_is_utf8_string_loc(pTHX_ const U8 *s, STRLEN len, const U8 **ep) | |
708 | { | |
7918f24d NC |
709 | PERL_ARGS_ASSERT_IS_UTF8_STRING_LOC; |
710 | ||
814fafa7 NC |
711 | return is_utf8_string_loclen(s, len, ep, 0); |
712 | } | |
713 | ||
7ee2227d | 714 | /* |
d5b2b27b NC |
715 | =for apidoc sv_nolocking |
716 | ||
717 | Dummy routine which "locks" an SV when there is no locking module present. | |
718 | Exists to avoid test for a NULL function pointer and because it could | |
719 | potentially warn under some level of strict-ness. | |
720 | ||
721 | "Superseded" by sv_nosharing(). | |
722 | ||
723 | =cut | |
724 | */ | |
725 | ||
726 | void | |
727 | Perl_sv_nolocking(pTHX_ SV *sv) | |
728 | { | |
96a5add6 | 729 | PERL_UNUSED_CONTEXT; |
d5b2b27b NC |
730 | PERL_UNUSED_ARG(sv); |
731 | } | |
732 | ||
733 | ||
734 | /* | |
735 | =for apidoc sv_nounlocking | |
736 | ||
737 | Dummy routine which "unlocks" an SV when there is no locking module present. | |
738 | Exists to avoid test for a NULL function pointer and because it could | |
739 | potentially warn under some level of strict-ness. | |
740 | ||
741 | "Superseded" by sv_nosharing(). | |
742 | ||
743 | =cut | |
744 | */ | |
745 | ||
746 | void | |
747 | Perl_sv_nounlocking(pTHX_ SV *sv) | |
748 | { | |
96a5add6 | 749 | PERL_UNUSED_CONTEXT; |
d5b2b27b NC |
750 | PERL_UNUSED_ARG(sv); |
751 | } | |
752 | ||
2053acbf NC |
753 | void |
754 | Perl_save_long(pTHX_ long int *longp) | |
755 | { | |
756 | dVAR; | |
7918f24d NC |
757 | |
758 | PERL_ARGS_ASSERT_SAVE_LONG; | |
759 | ||
2053acbf NC |
760 | SSCHECK(3); |
761 | SSPUSHLONG(*longp); | |
762 | SSPUSHPTR(longp); | |
c6bf6a65 | 763 | SSPUSHUV(SAVEt_LONG); |
2053acbf NC |
764 | } |
765 | ||
766 | void | |
2053acbf NC |
767 | Perl_save_iv(pTHX_ IV *ivp) |
768 | { | |
769 | dVAR; | |
7918f24d NC |
770 | |
771 | PERL_ARGS_ASSERT_SAVE_IV; | |
772 | ||
2053acbf NC |
773 | SSCHECK(3); |
774 | SSPUSHIV(*ivp); | |
775 | SSPUSHPTR(ivp); | |
c6bf6a65 | 776 | SSPUSHUV(SAVEt_IV); |
2053acbf NC |
777 | } |
778 | ||
779 | void | |
780 | Perl_save_nogv(pTHX_ GV *gv) | |
781 | { | |
782 | dVAR; | |
7918f24d NC |
783 | |
784 | PERL_ARGS_ASSERT_SAVE_NOGV; | |
785 | ||
2053acbf NC |
786 | SSCHECK(2); |
787 | SSPUSHPTR(gv); | |
c6bf6a65 | 788 | SSPUSHUV(SAVEt_NSTAB); |
2053acbf NC |
789 | } |
790 | ||
791 | void | |
792 | Perl_save_list(pTHX_ register SV **sarg, I32 maxsarg) | |
793 | { | |
794 | dVAR; | |
795 | register I32 i; | |
796 | ||
7918f24d NC |
797 | PERL_ARGS_ASSERT_SAVE_LIST; |
798 | ||
2053acbf NC |
799 | for (i = 1; i <= maxsarg; i++) { |
800 | register SV * const sv = newSV(0); | |
801 | sv_setsv(sv,sarg[i]); | |
802 | SSCHECK(3); | |
803 | SSPUSHPTR(sarg[i]); /* remember the pointer */ | |
804 | SSPUSHPTR(sv); /* remember the value */ | |
c6bf6a65 | 805 | SSPUSHUV(SAVEt_ITEM); |
2053acbf NC |
806 | } |
807 | } | |
808 | ||
47518d95 NC |
809 | /* |
810 | =for apidoc sv_usepvn_mg | |
811 | ||
812 | Like C<sv_usepvn>, but also handles 'set' magic. | |
813 | ||
814 | =cut | |
815 | */ | |
816 | ||
817 | void | |
818 | Perl_sv_usepvn_mg(pTHX_ SV *sv, char *ptr, STRLEN len) | |
819 | { | |
7918f24d NC |
820 | PERL_ARGS_ASSERT_SV_USEPVN_MG; |
821 | ||
47518d95 NC |
822 | sv_usepvn_flags(sv,ptr,len, SV_SMAGIC); |
823 | } | |
824 | ||
825 | /* | |
826 | =for apidoc sv_usepvn | |
827 | ||
828 | Tells an SV to use C<ptr> to find its string value. Implemented by | |
829 | calling C<sv_usepvn_flags> with C<flags> of 0, hence does not handle 'set' | |
830 | magic. See C<sv_usepvn_flags>. | |
831 | ||
832 | =cut | |
833 | */ | |
834 | ||
835 | void | |
836 | Perl_sv_usepvn(pTHX_ SV *sv, char *ptr, STRLEN len) | |
837 | { | |
7918f24d NC |
838 | PERL_ARGS_ASSERT_SV_USEPVN; |
839 | ||
47518d95 NC |
840 | sv_usepvn_flags(sv,ptr,len, 0); |
841 | } | |
842 | ||
c03e83bf NC |
843 | /* |
844 | =for apidoc unpack_str | |
845 | ||
846 | The engine implementing unpack() Perl function. Note: parameters strbeg, new_s | |
847 | and ocnt are not used. This call should not be used, use unpackstring instead. | |
848 | ||
849 | =cut */ | |
850 | ||
851 | I32 | |
852 | Perl_unpack_str(pTHX_ const char *pat, const char *patend, const char *s, | |
853 | const char *strbeg, const char *strend, char **new_s, I32 ocnt, | |
854 | U32 flags) | |
855 | { | |
7918f24d NC |
856 | PERL_ARGS_ASSERT_UNPACK_STR; |
857 | ||
c03e83bf NC |
858 | PERL_UNUSED_ARG(strbeg); |
859 | PERL_UNUSED_ARG(new_s); | |
860 | PERL_UNUSED_ARG(ocnt); | |
861 | ||
862 | return unpackstring(pat, patend, s, strend, flags); | |
863 | } | |
b47163a2 NC |
864 | |
865 | /* | |
866 | =for apidoc pack_cat | |
867 | ||
868 | The engine implementing pack() Perl function. Note: parameters next_in_list and | |
869 | flags are not used. This call should not be used; use packlist instead. | |
870 | ||
871 | =cut | |
872 | */ | |
873 | ||
874 | void | |
875 | Perl_pack_cat(pTHX_ SV *cat, const char *pat, const char *patend, register SV **beglist, SV **endlist, SV ***next_in_list, U32 flags) | |
876 | { | |
7918f24d NC |
877 | PERL_ARGS_ASSERT_PACK_CAT; |
878 | ||
b47163a2 NC |
879 | PERL_UNUSED_ARG(next_in_list); |
880 | PERL_UNUSED_ARG(flags); | |
881 | ||
882 | packlist(cat, pat, patend, beglist, endlist); | |
883 | } | |
4c2df08c NC |
884 | |
885 | HE * | |
886 | Perl_hv_store_ent(pTHX_ HV *hv, SV *keysv, SV *val, U32 hash) | |
887 | { | |
59af68cc | 888 | return (HE *)hv_common(hv, keysv, NULL, 0, 0, HV_FETCH_ISSTORE, val, hash); |
4c2df08c NC |
889 | } |
890 | ||
891 | bool | |
892 | Perl_hv_exists_ent(pTHX_ HV *hv, SV *keysv, U32 hash) | |
893 | { | |
7918f24d NC |
894 | PERL_ARGS_ASSERT_HV_EXISTS_ENT; |
895 | ||
4c2df08c NC |
896 | return hv_common(hv, keysv, NULL, 0, 0, HV_FETCH_ISEXISTS, 0, hash) |
897 | ? TRUE : FALSE; | |
898 | } | |
899 | ||
900 | HE * | |
901 | Perl_hv_fetch_ent(pTHX_ HV *hv, SV *keysv, I32 lval, U32 hash) | |
902 | { | |
7918f24d NC |
903 | PERL_ARGS_ASSERT_HV_FETCH_ENT; |
904 | ||
59af68cc | 905 | return (HE *)hv_common(hv, keysv, NULL, 0, 0, |
4c2df08c NC |
906 | (lval ? HV_FETCH_LVALUE : 0), NULL, hash); |
907 | } | |
908 | ||
909 | SV * | |
910 | Perl_hv_delete_ent(pTHX_ HV *hv, SV *keysv, I32 flags, U32 hash) | |
911 | { | |
7918f24d NC |
912 | PERL_ARGS_ASSERT_HV_DELETE_ENT; |
913 | ||
ad64d0ec NC |
914 | return MUTABLE_SV(hv_common(hv, keysv, NULL, 0, 0, flags | HV_DELETE, NULL, |
915 | hash)); | |
4c2df08c NC |
916 | } |
917 | ||
a038e571 NC |
918 | SV** |
919 | Perl_hv_store_flags(pTHX_ HV *hv, const char *key, I32 klen, SV *val, U32 hash, | |
920 | int flags) | |
921 | { | |
922 | return (SV**) hv_common(hv, NULL, key, klen, flags, | |
923 | (HV_FETCH_ISSTORE|HV_FETCH_JUST_SV), val, hash); | |
924 | } | |
925 | ||
926 | SV** | |
927 | Perl_hv_store(pTHX_ HV *hv, const char *key, I32 klen_i32, SV *val, U32 hash) | |
928 | { | |
929 | STRLEN klen; | |
930 | int flags; | |
931 | ||
932 | if (klen_i32 < 0) { | |
933 | klen = -klen_i32; | |
934 | flags = HVhek_UTF8; | |
935 | } else { | |
936 | klen = klen_i32; | |
937 | flags = 0; | |
938 | } | |
939 | return (SV **) hv_common(hv, NULL, key, klen, flags, | |
940 | (HV_FETCH_ISSTORE|HV_FETCH_JUST_SV), val, hash); | |
941 | } | |
942 | ||
943 | bool | |
944 | Perl_hv_exists(pTHX_ HV *hv, const char *key, I32 klen_i32) | |
945 | { | |
946 | STRLEN klen; | |
947 | int flags; | |
948 | ||
7918f24d NC |
949 | PERL_ARGS_ASSERT_HV_EXISTS; |
950 | ||
a038e571 NC |
951 | if (klen_i32 < 0) { |
952 | klen = -klen_i32; | |
953 | flags = HVhek_UTF8; | |
954 | } else { | |
955 | klen = klen_i32; | |
956 | flags = 0; | |
957 | } | |
958 | return hv_common(hv, NULL, key, klen, flags, HV_FETCH_ISEXISTS, 0, 0) | |
959 | ? TRUE : FALSE; | |
960 | } | |
961 | ||
962 | SV** | |
963 | Perl_hv_fetch(pTHX_ HV *hv, const char *key, I32 klen_i32, I32 lval) | |
964 | { | |
965 | STRLEN klen; | |
966 | int flags; | |
967 | ||
7918f24d NC |
968 | PERL_ARGS_ASSERT_HV_FETCH; |
969 | ||
a038e571 NC |
970 | if (klen_i32 < 0) { |
971 | klen = -klen_i32; | |
972 | flags = HVhek_UTF8; | |
973 | } else { | |
974 | klen = klen_i32; | |
975 | flags = 0; | |
976 | } | |
977 | return (SV **) hv_common(hv, NULL, key, klen, flags, | |
978 | lval ? (HV_FETCH_JUST_SV | HV_FETCH_LVALUE) | |
979 | : HV_FETCH_JUST_SV, NULL, 0); | |
980 | } | |
981 | ||
982 | SV * | |
983 | Perl_hv_delete(pTHX_ HV *hv, const char *key, I32 klen_i32, I32 flags) | |
984 | { | |
985 | STRLEN klen; | |
986 | int k_flags; | |
987 | ||
7918f24d NC |
988 | PERL_ARGS_ASSERT_HV_DELETE; |
989 | ||
a038e571 NC |
990 | if (klen_i32 < 0) { |
991 | klen = -klen_i32; | |
992 | k_flags = HVhek_UTF8; | |
993 | } else { | |
994 | klen = klen_i32; | |
995 | k_flags = 0; | |
996 | } | |
ad64d0ec NC |
997 | return MUTABLE_SV(hv_common(hv, NULL, key, klen, k_flags, flags | HV_DELETE, |
998 | NULL, 0)); | |
a038e571 NC |
999 | } |
1000 | ||
56d7a086 | 1001 | /* Functions after here were made mathoms post 5.10.0 but pre 5.8.9 */ |
56d7a086 | 1002 | |
ac572bf4 NC |
1003 | AV * |
1004 | Perl_newAV(pTHX) | |
1005 | { | |
502c6561 | 1006 | return MUTABLE_AV(newSV_type(SVt_PVAV)); |
ac572bf4 NC |
1007 | /* sv_upgrade does AvREAL_only(): |
1008 | AvALLOC(av) = 0; | |
1009 | AvARRAY(av) = NULL; | |
1010 | AvMAX(av) = AvFILLp(av) = -1; */ | |
1011 | } | |
1012 | ||
78ac7dd9 NC |
1013 | HV * |
1014 | Perl_newHV(pTHX) | |
1015 | { | |
85fbaab2 | 1016 | HV * const hv = MUTABLE_HV(newSV_type(SVt_PVHV)); |
78ac7dd9 NC |
1017 | assert(!SvOK(hv)); |
1018 | ||
1019 | return hv; | |
1020 | } | |
1021 | ||
84335ee9 NC |
1022 | void |
1023 | Perl_sv_insert(pTHX_ SV *const bigstr, const STRLEN offset, const STRLEN len, | |
1024 | const char *const little, const STRLEN littlelen) | |
1025 | { | |
1026 | PERL_ARGS_ASSERT_SV_INSERT; | |
1027 | sv_insert_flags(bigstr, offset, len, little, littlelen, SV_GMAGIC); | |
1028 | } | |
1029 | ||
2fd8beea NC |
1030 | void |
1031 | Perl_save_freesv(pTHX_ SV *sv) | |
1032 | { | |
1033 | dVAR; | |
1034 | save_freesv(sv); | |
1035 | } | |
1036 | ||
1037 | void | |
1038 | Perl_save_mortalizesv(pTHX_ SV *sv) | |
1039 | { | |
1040 | dVAR; | |
1041 | ||
1042 | PERL_ARGS_ASSERT_SAVE_MORTALIZESV; | |
1043 | ||
1044 | save_mortalizesv(sv); | |
1045 | } | |
1046 | ||
1047 | void | |
1048 | Perl_save_freeop(pTHX_ OP *o) | |
1049 | { | |
1050 | dVAR; | |
1051 | save_freeop(o); | |
1052 | } | |
1053 | ||
1054 | void | |
1055 | Perl_save_freepv(pTHX_ char *pv) | |
1056 | { | |
1057 | dVAR; | |
1058 | save_freepv(pv); | |
1059 | } | |
1060 | ||
1061 | void | |
1062 | Perl_save_op(pTHX) | |
1063 | { | |
1064 | dVAR; | |
1065 | save_op(); | |
1066 | } | |
1067 | ||
d5713896 NC |
1068 | #ifdef PERL_DONT_CREATE_GVSV |
1069 | GV * | |
1070 | Perl_gv_SVadd(pTHX_ GV *gv) | |
1071 | { | |
d5713896 NC |
1072 | return gv_SVadd(gv); |
1073 | } | |
1074 | #endif | |
1075 | ||
1076 | GV * | |
1077 | Perl_gv_AVadd(pTHX_ GV *gv) | |
1078 | { | |
d5713896 NC |
1079 | return gv_AVadd(gv); |
1080 | } | |
1081 | ||
1082 | GV * | |
1083 | Perl_gv_HVadd(pTHX_ register GV *gv) | |
1084 | { | |
d5713896 NC |
1085 | return gv_HVadd(gv); |
1086 | } | |
1087 | ||
bb85b28a NC |
1088 | GV * |
1089 | Perl_gv_IOadd(pTHX_ register GV *gv) | |
1090 | { | |
1091 | return gv_IOadd(gv); | |
1092 | } | |
1093 | ||
85dca89a NC |
1094 | IO * |
1095 | Perl_newIO(pTHX) | |
1096 | { | |
1097 | return MUTABLE_IO(newSV_type(SVt_PVIO)); | |
1098 | } | |
1099 | ||
0d7d409d DM |
1100 | I32 |
1101 | Perl_my_stat(pTHX) | |
1102 | { | |
1103 | return my_stat_flags(SV_GMAGIC); | |
1104 | } | |
1105 | ||
1106 | I32 | |
1107 | Perl_my_lstat(pTHX) | |
1108 | { | |
1109 | return my_lstat_flags(SV_GMAGIC); | |
1110 | } | |
1111 | ||
078504b2 FC |
1112 | I32 |
1113 | Perl_sv_eq(pTHX_ register SV *sv1, register SV *sv2) | |
1114 | { | |
1115 | return sv_eq_flags(sv1, sv2, SV_GMAGIC); | |
1116 | } | |
1117 | ||
6129b56c | 1118 | #ifdef USE_LOCALE_COLLATE |
078504b2 FC |
1119 | char * |
1120 | Perl_sv_collxfrm(pTHX_ SV *const sv, STRLEN *const nxp) | |
1121 | { | |
1122 | return sv_collxfrm_flags(sv, nxp, SV_GMAGIC); | |
1123 | } | |
6129b56c | 1124 | #endif |
078504b2 | 1125 | |
06c841cf FC |
1126 | bool |
1127 | Perl_sv_2bool(pTHX_ register SV *const sv) | |
1128 | { | |
1129 | return sv_2bool_flags(sv, SV_GMAGIC); | |
1130 | } | |
1131 | ||
1830b3d9 | 1132 | |
9733086d BM |
1133 | /* |
1134 | =for apidoc custom_op_name | |
1135 | Return the name for a given custom op. This was once used by the OP_NAME | |
1136 | macro, but is no longer: it has only been kept for compatibility, and | |
1137 | should not be used. | |
1138 | ||
1139 | =for apidoc custom_op_desc | |
1140 | Return the description of a given custom op. This was once used by the | |
1141 | OP_DESC macro, but is no longer: it has only been kept for | |
1142 | compatibility, and should not be used. | |
1143 | ||
1144 | =cut | |
1145 | */ | |
1146 | ||
1830b3d9 BM |
1147 | const char* |
1148 | Perl_custom_op_name(pTHX_ const OP* o) | |
1149 | { | |
1150 | PERL_ARGS_ASSERT_CUSTOM_OP_NAME; | |
1151 | return XopENTRY(Perl_custom_op_xop(aTHX_ o), xop_name); | |
1152 | } | |
1153 | ||
1154 | const char* | |
1155 | Perl_custom_op_desc(pTHX_ const OP* o) | |
1156 | { | |
1157 | PERL_ARGS_ASSERT_CUSTOM_OP_DESC; | |
1158 | return XopENTRY(Perl_custom_op_xop(aTHX_ o), xop_desc); | |
1159 | } | |
7bff8c33 NC |
1160 | |
1161 | CV * | |
1162 | Perl_newSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *block) | |
1163 | { | |
1164 | return Perl_newATTRSUB(aTHX_ floor, o, proto, NULL, block); | |
1165 | } | |
0c9b0438 KW |
1166 | |
1167 | UV | |
1168 | Perl_to_utf8_fold(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp) | |
1169 | { | |
1170 | PERL_ARGS_ASSERT_TO_UTF8_FOLD; | |
1171 | ||
1172 | return _to_utf8_fold_flags(p, ustrp, lenp, FOLD_FLAGS_FULL, NULL); | |
1173 | } | |
1174 | ||
1175 | UV | |
1176 | Perl_to_utf8_lower(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp) | |
1177 | { | |
1178 | PERL_ARGS_ASSERT_TO_UTF8_LOWER; | |
1179 | ||
1180 | return _to_utf8_lower_flags(p, ustrp, lenp, FALSE, NULL); | |
1181 | } | |
1182 | ||
1183 | UV | |
1184 | Perl_to_utf8_title(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp) | |
1185 | { | |
1186 | PERL_ARGS_ASSERT_TO_UTF8_TITLE; | |
1187 | ||
1188 | return _to_utf8_title_flags(p, ustrp, lenp, FALSE, NULL); | |
1189 | } | |
1190 | ||
1191 | UV | |
1192 | Perl_to_utf8_upper(pTHX_ const U8 *p, U8* ustrp, STRLEN *lenp) | |
1193 | { | |
1194 | PERL_ARGS_ASSERT_TO_UTF8_UPPER; | |
1195 | ||
1196 | return _to_utf8_upper_flags(p, ustrp, lenp, FALSE, NULL); | |
1197 | } | |
1198 | ||
20fac488 GA |
1199 | #endif /* NO_MATHOMS */ |
1200 | ||
d5b2b27b | 1201 | /* |
7ee2227d SP |
1202 | * Local variables: |
1203 | * c-indentation-style: bsd | |
1204 | * c-basic-offset: 4 | |
1205 | * indent-tabs-mode: t | |
1206 | * End: | |
1207 | * | |
1208 | * ex: set ts=8 sts=4 sw=4 noet: | |
1209 | */ |