This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
New authors
[perl5.git] / mathoms.c
CommitLineData
7ee2227d
SP
1/* mathoms.c
2 *
54ca4ee7 3 * Copyright (C) 2005, 2006, 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/*
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
20fac488
GA
17#ifndef NO_MATHOMS
18
7ee2227d
SP
19/*
20 * This file contains mathoms, various binary artifacts from previous
f2f0f092
NC
21 * versions of Perl. For binary or source compatibility reasons, though,
22 * we cannot completely remove them from the core code.
7ee2227d
SP
23 *
24 * SMP - Oct. 24, 2005
25 *
26 */
27
28#include "EXTERN.h"
29#define PERL_IN_MATHOMS_C
30#include "perl.h"
31
b5445a23
AL
32OP * Perl_ref(pTHX_ OP *o, I32 type);
33void Perl_sv_unref(pTHX_ SV *sv);
34void Perl_sv_taint(pTHX_ SV *sv);
35IV Perl_sv_2iv(pTHX_ register SV *sv);
36UV Perl_sv_2uv(pTHX_ register SV *sv);
37char * Perl_sv_2pv(pTHX_ register SV *sv, STRLEN *lp);
38char * Perl_sv_2pv_nolen(pTHX_ register SV *sv);
39char * Perl_sv_2pvbyte_nolen(pTHX_ register SV *sv);
40char * Perl_sv_2pvutf8_nolen(pTHX_ register SV *sv);
41void Perl_sv_force_normal(pTHX_ register SV *sv);
42void Perl_sv_setsv(pTHX_ SV *dstr, register SV *sstr);
43void Perl_sv_catpvn(pTHX_ SV *dsv, const char* sstr, STRLEN slen);
44void Perl_sv_catpvn_mg(pTHX_ register SV *sv, register const char *ptr, register STRLEN len);
45void Perl_sv_catsv(pTHX_ SV *dstr, register SV *sstr);
46void Perl_sv_catsv_mg(pTHX_ SV *dsv, register SV *ssv);
47char * Perl_sv_pv(pTHX_ SV *sv);
48char * Perl_sv_pvn_force(pTHX_ SV *sv, STRLEN *lp);
49char * Perl_sv_pvbyte(pTHX_ SV *sv);
50char * Perl_sv_pvutf8(pTHX_ SV *sv);
51STRLEN Perl_sv_utf8_upgrade(pTHX_ register SV *sv);
52NV Perl_huge(void);
53void Perl_gv_fullname3(pTHX_ SV *sv, const GV *gv, const char *prefix);
54void Perl_gv_efullname3(pTHX_ SV *sv, const GV *gv, const char *prefix);
55GV * Perl_gv_fetchmethod(pTHX_ HV *stash, const char *name);
56HE * Perl_hv_iternext(pTHX_ HV *hv);
57void Perl_hv_magic(pTHX_ HV *hv, GV *gv, int how);
58bool Perl_do_open(pTHX_ GV *gv, register const char *name, I32 len, int as_raw,
59 int rawmode, int rawperm, PerlIO *supplied_fp);
60bool Perl_do_aexec(pTHX_ SV *really, register SV **mark, register SV **sp);
61bool Perl_do_exec(pTHX_ const char *cmd);
62U8 * Perl_uvuni_to_utf8(pTHX_ U8 *d, UV uv);
63bool Perl_is_utf8_string_loc(pTHX_ const U8 *s, STRLEN len, const U8 **ep);
64void Perl_sv_nolocking(pTHX_ SV *sv);
65void Perl_sv_usepvn_mg(pTHX_ SV *sv, char *ptr, STRLEN len);
66void Perl_sv_usepvn(pTHX_ SV *sv, char *ptr, STRLEN len);
67
68
7ee2227d
SP
69/* ref() is now a macro using Perl_doref;
70 * this version provided for binary compatibility only.
71 */
72OP *
73Perl_ref(pTHX_ OP *o, I32 type)
74{
75 return doref(o, type, TRUE);
76}
77
aae9cea0 78/*
174c73e3
NC
79=for apidoc sv_unref
80
81Unsets the RV status of the SV, and decrements the reference count of
82whatever was being referenced by the RV. This can almost be thought of
83as a reversal of C<newSVrv>. This is C<sv_unref_flags> with the C<flag>
84being zero. See C<SvROK_off>.
85
86=cut
87*/
88
89void
90Perl_sv_unref(pTHX_ SV *sv)
91{
92 sv_unref_flags(sv, 0);
93}
94
95/*
aae9cea0
NC
96=for apidoc sv_taint
97
98Taint an SV. Use C<SvTAINTED_on> instead.
99=cut
100*/
101
102void
103Perl_sv_taint(pTHX_ SV *sv)
104{
a0714e2c 105 sv_magic((sv), NULL, PERL_MAGIC_taint, NULL, 0);
aae9cea0
NC
106}
107
7ee2227d
SP
108/* sv_2iv() is now a macro using Perl_sv_2iv_flags();
109 * this function provided for binary compatibility only
110 */
111
112IV
113Perl_sv_2iv(pTHX_ register SV *sv)
114{
115 return sv_2iv_flags(sv, SV_GMAGIC);
116}
117
118/* sv_2uv() is now a macro using Perl_sv_2uv_flags();
119 * this function provided for binary compatibility only
120 */
121
122UV
123Perl_sv_2uv(pTHX_ register SV *sv)
124{
125 return sv_2uv_flags(sv, SV_GMAGIC);
126}
127
128/* sv_2pv() is now a macro using Perl_sv_2pv_flags();
129 * this function provided for binary compatibility only
130 */
131
132char *
133Perl_sv_2pv(pTHX_ register SV *sv, STRLEN *lp)
134{
135 return sv_2pv_flags(sv, lp, SV_GMAGIC);
136}
137
5abc721d 138/*
cb2f1b7b
NC
139=for apidoc sv_2pv_nolen
140
141Like C<sv_2pv()>, but doesn't return the length too. You should usually
142use the macro wrapper C<SvPV_nolen(sv)> instead.
143=cut
144*/
145
146char *
147Perl_sv_2pv_nolen(pTHX_ register SV *sv)
148{
b5445a23 149 return sv_2pv(sv, NULL);
cb2f1b7b
NC
150}
151
152/*
153=for apidoc sv_2pvbyte_nolen
154
155Return a pointer to the byte-encoded representation of the SV.
156May cause the SV to be downgraded from UTF-8 as a side-effect.
157
158Usually accessed via the C<SvPVbyte_nolen> macro.
159
160=cut
161*/
162
163char *
164Perl_sv_2pvbyte_nolen(pTHX_ register SV *sv)
165{
b5445a23 166 return sv_2pvbyte(sv, NULL);
cb2f1b7b
NC
167}
168
169/*
170=for apidoc sv_2pvutf8_nolen
171
172Return a pointer to the UTF-8-encoded representation of the SV.
173May cause the SV to be upgraded to UTF-8 as a side-effect.
174
175Usually accessed via the C<SvPVutf8_nolen> macro.
176
177=cut
178*/
179
180char *
181Perl_sv_2pvutf8_nolen(pTHX_ register SV *sv)
182{
b5445a23 183 return sv_2pvutf8(sv, NULL);
cb2f1b7b
NC
184}
185
186/*
5abc721d
NC
187=for apidoc sv_force_normal
188
189Undo various types of fakery on an SV: if the PV is a shared string, make
190a private copy; if we're a ref, stop refing; if we're a glob, downgrade to
191an xpvmg. See also C<sv_force_normal_flags>.
192
193=cut
194*/
195
196void
197Perl_sv_force_normal(pTHX_ register SV *sv)
198{
199 sv_force_normal_flags(sv, 0);
200}
7ee2227d
SP
201
202/* sv_setsv() is now a macro using Perl_sv_setsv_flags();
203 * this function provided for binary compatibility only
204 */
205
206void
207Perl_sv_setsv(pTHX_ SV *dstr, register SV *sstr)
208{
209 sv_setsv_flags(dstr, sstr, SV_GMAGIC);
210}
211
212/* sv_catpvn() is now a macro using Perl_sv_catpvn_flags();
213 * this function provided for binary compatibility only
214 */
215
216void
217Perl_sv_catpvn(pTHX_ SV *dsv, const char* sstr, STRLEN slen)
218{
219 sv_catpvn_flags(dsv, sstr, slen, SV_GMAGIC);
220}
221
b347df82
NC
222/*
223=for apidoc sv_catpvn_mg
224
225Like C<sv_catpvn>, but also handles 'set' magic.
226
227=cut
228*/
229
230void
231Perl_sv_catpvn_mg(pTHX_ register SV *sv, register const char *ptr, register STRLEN len)
232{
233 sv_catpvn_flags(sv,ptr,len,SV_GMAGIC|SV_SMAGIC);
234}
235
7ee2227d
SP
236/* sv_catsv() is now a macro using Perl_sv_catsv_flags();
237 * this function provided for binary compatibility only
238 */
239
240void
241Perl_sv_catsv(pTHX_ SV *dstr, register SV *sstr)
242{
243 sv_catsv_flags(dstr, sstr, SV_GMAGIC);
244}
245
0feed65a 246/*
b347df82
NC
247=for apidoc sv_catsv_mg
248
249Like C<sv_catsv>, but also handles 'set' magic.
250
251=cut
252*/
253
254void
255Perl_sv_catsv_mg(pTHX_ SV *dsv, register SV *ssv)
256{
257 sv_catsv_flags(dsv,ssv,SV_GMAGIC|SV_SMAGIC);
258}
259
260/*
0feed65a
NC
261=for apidoc sv_iv
262
263A private implementation of the C<SvIVx> macro for compilers which can't
264cope with complex macro expressions. Always use the macro instead.
265
266=cut
267*/
268
269IV
270Perl_sv_iv(pTHX_ register SV *sv)
271{
272 if (SvIOK(sv)) {
273 if (SvIsUV(sv))
274 return (IV)SvUVX(sv);
275 return SvIVX(sv);
276 }
277 return sv_2iv(sv);
278}
279
280/*
281=for apidoc sv_uv
282
283A private implementation of the C<SvUVx> macro for compilers which can't
284cope with complex macro expressions. Always use the macro instead.
285
286=cut
287*/
288
289UV
290Perl_sv_uv(pTHX_ register SV *sv)
291{
292 if (SvIOK(sv)) {
293 if (SvIsUV(sv))
294 return SvUVX(sv);
295 return (UV)SvIVX(sv);
296 }
297 return sv_2uv(sv);
298}
299
300/*
301=for apidoc sv_nv
302
303A private implementation of the C<SvNVx> macro for compilers which can't
304cope with complex macro expressions. Always use the macro instead.
305
306=cut
307*/
308
309NV
310Perl_sv_nv(pTHX_ register SV *sv)
311{
312 if (SvNOK(sv))
313 return SvNVX(sv);
314 return sv_2nv(sv);
315}
316
317/*
318=for apidoc sv_pv
319
320Use the C<SvPV_nolen> macro instead
321
322=for apidoc sv_pvn
323
324A private implementation of the C<SvPV> macro for compilers which can't
325cope with complex macro expressions. Always use the macro instead.
326
327=cut
328*/
329
330char *
331Perl_sv_pvn(pTHX_ SV *sv, STRLEN *lp)
332{
333 if (SvPOK(sv)) {
334 *lp = SvCUR(sv);
335 return SvPVX(sv);
336 }
337 return sv_2pv(sv, lp);
338}
339
340
341char *
342Perl_sv_pvn_nomg(pTHX_ register SV *sv, STRLEN *lp)
343{
344 if (SvPOK(sv)) {
345 *lp = SvCUR(sv);
346 return SvPVX(sv);
347 }
348 return sv_2pv_flags(sv, lp, 0);
349}
350
7ee2227d
SP
351/* sv_pv() is now a macro using SvPV_nolen();
352 * this function provided for binary compatibility only
353 */
354
355char *
356Perl_sv_pv(pTHX_ SV *sv)
357{
358 if (SvPOK(sv))
359 return SvPVX(sv);
360
b5445a23 361 return sv_2pv(sv, NULL);
7ee2227d
SP
362}
363
364/* sv_pvn_force() is now a macro using Perl_sv_pvn_force_flags();
365 * this function provided for binary compatibility only
366 */
367
368char *
369Perl_sv_pvn_force(pTHX_ SV *sv, STRLEN *lp)
370{
371 return sv_pvn_force_flags(sv, lp, SV_GMAGIC);
372}
373
374/* sv_pvbyte () is now a macro using Perl_sv_2pv_flags();
375 * this function provided for binary compatibility only
376 */
377
378char *
379Perl_sv_pvbyte(pTHX_ SV *sv)
380{
b5445a23 381 sv_utf8_downgrade(sv, FALSE);
7ee2227d
SP
382 return sv_pv(sv);
383}
384
0feed65a
NC
385/*
386=for apidoc sv_pvbyte
387
388Use C<SvPVbyte_nolen> instead.
389
390=for apidoc sv_pvbyten
391
392A private implementation of the C<SvPVbyte> macro for compilers
393which can't cope with complex macro expressions. Always use the macro
394instead.
395
396=cut
397*/
398
399char *
400Perl_sv_pvbyten(pTHX_ SV *sv, STRLEN *lp)
401{
b5445a23 402 sv_utf8_downgrade(sv, FALSE);
0feed65a
NC
403 return sv_pvn(sv,lp);
404}
405
7ee2227d
SP
406/* sv_pvutf8 () is now a macro using Perl_sv_2pv_flags();
407 * this function provided for binary compatibility only
408 */
409
410char *
411Perl_sv_pvutf8(pTHX_ SV *sv)
412{
413 sv_utf8_upgrade(sv);
414 return sv_pv(sv);
415}
416
0feed65a
NC
417/*
418=for apidoc sv_pvutf8
419
420Use the C<SvPVutf8_nolen> macro instead
421
422=for apidoc sv_pvutf8n
423
424A private implementation of the C<SvPVutf8> macro for compilers
425which can't cope with complex macro expressions. Always use the macro
426instead.
427
428=cut
429*/
430
431char *
432Perl_sv_pvutf8n(pTHX_ SV *sv, STRLEN *lp)
433{
434 sv_utf8_upgrade(sv);
435 return sv_pvn(sv,lp);
436}
437
205c02c2
NC
438/* sv_utf8_upgrade() is now a macro using sv_utf8_upgrade_flags();
439 * this function provided for binary compatibility only
440 */
441
442STRLEN
443Perl_sv_utf8_upgrade(pTHX_ register SV *sv)
444{
445 return sv_utf8_upgrade_flags(sv, SV_GMAGIC);
446}
447
7ee2227d
SP
448int
449Perl_fprintf_nocontext(PerlIO *stream, const char *format, ...)
450{
451 dTHXs;
452 va_list(arglist);
453 va_start(arglist, format);
454 return PerlIO_vprintf(stream, format, arglist);
455}
456
457int
458Perl_printf_nocontext(const char *format, ...)
459{
460 dTHX;
461 va_list(arglist);
462 va_start(arglist, format);
463 return PerlIO_vprintf(PerlIO_stdout(), format, arglist);
464}
465
466#if defined(HUGE_VAL) || (defined(USE_LONG_DOUBLE) && defined(HUGE_VALL))
467/*
468 * This hack is to force load of "huge" support from libm.a
469 * So it is in perl for (say) POSIX to use.
470 * Needed for SunOS with Sun's 'acc' for example.
471 */
472NV
473Perl_huge(void)
474{
c773ee7a 475# if defined(USE_LONG_DOUBLE) && defined(HUGE_VALL)
7ee2227d 476 return HUGE_VALL;
c773ee7a 477# else
7ee2227d 478 return HUGE_VAL;
c773ee7a 479# endif
7ee2227d
SP
480}
481#endif
482
f2f0f092
NC
483/* compatibility with versions <= 5.003. */
484void
485Perl_gv_fullname(pTHX_ SV *sv, const GV *gv)
486{
666ea192 487 gv_fullname3(sv, gv, sv == (const SV*)gv ? "*" : "");
f2f0f092
NC
488}
489
490/* compatibility with versions <= 5.003. */
491void
492Perl_gv_efullname(pTHX_ SV *sv, const GV *gv)
493{
666ea192 494 gv_efullname3(sv, gv, sv == (const SV*)gv ? "*" : "");
f2f0f092
NC
495}
496
2674aeec
NC
497void
498Perl_gv_fullname3(pTHX_ SV *sv, const GV *gv, const char *prefix)
499{
500 gv_fullname4(sv, gv, prefix, TRUE);
501}
502
503void
504Perl_gv_efullname3(pTHX_ SV *sv, const GV *gv, const char *prefix)
505{
506 gv_efullname4(sv, gv, prefix, TRUE);
507}
508
887986eb
NC
509/*
510=for apidoc gv_fetchmethod
511
512See L<gv_fetchmethod_autoload>.
513
514=cut
515*/
516
517GV *
518Perl_gv_fetchmethod(pTHX_ HV *stash, const char *name)
519{
520 return gv_fetchmethod_autoload(stash, name, TRUE);
521}
522
7a7b9979
NC
523HE *
524Perl_hv_iternext(pTHX_ HV *hv)
525{
526 return hv_iternext_flags(hv, 0);
527}
528
bc5cdc23
NC
529void
530Perl_hv_magic(pTHX_ HV *hv, GV *gv, int how)
531{
bd61b366 532 sv_magic((SV*)hv, (SV*)gv, how, NULL, 0);
bc5cdc23
NC
533}
534
535#if 0 /* use the macro from hv.h instead */
536
537char*
538Perl_sharepvn(pTHX_ const char *sv, I32 len, U32 hash)
539{
540 return HEK_KEY(share_hek(sv, len, hash));
541}
542
543#endif
544
b966a812
SP
545AV *
546Perl_av_fake(pTHX_ register I32 size, register SV **strp)
547{
548 register SV** ary;
561b68a9 549 register AV * const av = (AV*)newSV(0);
b966a812
SP
550
551 sv_upgrade((SV *)av, SVt_PVAV);
552 Newx(ary,size+1,SV*);
553 AvALLOC(av) = ary;
554 Copy(strp,ary,size,SV*);
555 AvREIFY_only(av);
556 SvPV_set(av, (char*)ary);
557 AvFILLp(av) = size - 1;
558 AvMAX(av) = size - 1;
559 while (size--) {
560 assert (*strp);
561 SvTEMP_off(*strp);
562 strp++;
563 }
564 return av;
565}
566
34d367cd 567bool
e4dba786
NC
568Perl_do_open(pTHX_ GV *gv, register const char *name, I32 len, int as_raw,
569 int rawmode, int rawperm, PerlIO *supplied_fp)
570{
571 return do_openn(gv, name, len, as_raw, rawmode, rawperm,
572 supplied_fp, (SV **) NULL, 0);
573}
574
575bool
34d367cd
SP
576Perl_do_open9(pTHX_ GV *gv, register const char *name, I32 len, int
577as_raw,
578 int rawmode, int rawperm, PerlIO *supplied_fp, SV *svs,
579 I32 num_svs)
580{
581 PERL_UNUSED_ARG(num_svs);
582 return do_openn(gv, name, len, as_raw, rawmode, rawperm,
583 supplied_fp, &svs, 1);
584}
585
586int
587Perl_do_binmode(pTHX_ PerlIO *fp, int iotype, int mode)
588{
589 /* The old body of this is now in non-LAYER part of perlio.c
590 * This is a stub for any XS code which might have been calling it.
591 */
592 const char *name = ":raw";
593#ifdef PERLIO_USING_CRLF
594 if (!(mode & O_BINARY))
595 name = ":crlf";
596#endif
597 return PerlIO_binmode(aTHX_ fp, iotype, mode, name);
598}
599
a9f96b3f
NC
600#ifndef OS2
601bool
602Perl_do_aexec(pTHX_ SV *really, register SV **mark, register SV **sp)
603{
604 return do_aexec5(really, mark, sp, 0, 0);
605}
606#endif
607
9555a685
NC
608#ifdef PERL_DEFAULT_DO_EXEC3_IMPLEMENTATION
609bool
610Perl_do_exec(pTHX_ const char *cmd)
611{
612 return do_exec3(cmd,0,0);
613}
614#endif
615
f95f476d
NC
616#ifdef HAS_PIPE
617void
618Perl_do_pipe(pTHX_ SV *sv, GV *rgv, GV *wgv)
619{
97aff369 620 dVAR;
f95f476d
NC
621 register IO *rstio;
622 register IO *wstio;
623 int fd[2];
624
625 if (!rgv)
626 goto badexit;
627 if (!wgv)
628 goto badexit;
629
630 rstio = GvIOn(rgv);
631 wstio = GvIOn(wgv);
632
633 if (IoIFP(rstio))
634 do_close(rgv,FALSE);
635 if (IoIFP(wstio))
636 do_close(wgv,FALSE);
637
638 if (PerlProc_pipe(fd) < 0)
639 goto badexit;
640 IoIFP(rstio) = PerlIO_fdopen(fd[0], "r"PIPE_OPEN_MODE);
641 IoOFP(wstio) = PerlIO_fdopen(fd[1], "w"PIPE_OPEN_MODE);
642 IoOFP(rstio) = IoIFP(rstio);
643 IoIFP(wstio) = IoOFP(wstio);
644 IoTYPE(rstio) = IoTYPE_RDONLY;
645 IoTYPE(wstio) = IoTYPE_WRONLY;
646 if (!IoIFP(rstio) || !IoOFP(wstio)) {
647 if (IoIFP(rstio)) PerlIO_close(IoIFP(rstio));
648 else PerlLIO_close(fd[0]);
649 if (IoOFP(wstio)) PerlIO_close(IoOFP(wstio));
650 else PerlLIO_close(fd[1]);
651 goto badexit;
652 }
653
654 sv_setsv(sv,&PL_sv_yes);
655 return;
656
657badexit:
658 sv_setsv(sv,&PL_sv_undef);
659 return;
660}
661#endif
662
89552e80
NC
663/* Backwards compatibility. */
664int
665Perl_init_i18nl14n(pTHX_ int printwarn)
666{
667 return init_i18nl10n(printwarn);
668}
669
ad5d783e
NC
670/* XXX kept for BINCOMPAT only */
671void
672Perl_save_hints(pTHX)
673{
674 Perl_croak(aTHX_ "internal error: obsolete function save_hints() called");
675}
676
c78ff979
NC
677#if 0
678OP *
679Perl_ck_retarget(pTHX_ OP *o)
680{
681 Perl_croak(aTHX_ "NOT IMPL LINE %d",__LINE__);
682 /* STUB */
683 return o;
684}
685#endif
686
687OP *
688Perl_oopsCV(pTHX_ OP *o)
689{
690 Perl_croak(aTHX_ "NOT IMPL LINE %d",__LINE__);
691 /* STUB */
692 PERL_UNUSED_ARG(o);
693 NORETURN_FUNCTION_END;
694}
695
696PP(pp_padany)
697{
698 DIE(aTHX_ "NOT IMPL LINE %d",__LINE__);
699}
700
701PP(pp_threadsv)
702{
703 DIE(aTHX_ "tried to access per-thread data in non-threaded perl");
704}
705
706PP(pp_mapstart)
707{
708 DIE(aTHX_ "panic: mapstart"); /* uses grepstart */
709}
710
0b612f93
NC
711/* These ops all have the same body as pp_null. */
712PP(pp_scalar)
713{
97aff369 714 dVAR;
0b612f93
NC
715 return NORMAL;
716}
717
718PP(pp_regcmaybe)
719{
97aff369 720 dVAR;
0b612f93
NC
721 return NORMAL;
722}
723
724PP(pp_lineseq)
725{
97aff369 726 dVAR;
0b612f93
NC
727 return NORMAL;
728}
729
730PP(pp_scope)
731{
97aff369 732 dVAR;
0b612f93
NC
733 return NORMAL;
734}
735
736/* Ops that are calls to do_kv. */
737PP(pp_values)
738{
739 return do_kv();
740}
741
742PP(pp_keys)
743{
744 return do_kv();
745}
746
747/* Ops that are simply calls to other ops. */
748PP(pp_dump)
749{
750 return pp_goto();
751 /*NOTREACHED*/
752}
753
754PP(pp_dofile)
755{
756 return pp_require();
757}
758
759PP(pp_dbmclose)
760{
761 return pp_untie();
762}
763
764PP(pp_read)
765{
766 return pp_sysread();
767}
768
769PP(pp_recv)
770{
771 return pp_sysread();
772}
773
774PP(pp_seek)
775{
776 return pp_sysseek();
777}
778
779PP(pp_fcntl)
780{
781 return pp_ioctl();
782}
783
784PP(pp_gsockopt)
785{
786 return pp_ssockopt();
787}
788
789PP(pp_getsockname)
790{
791 return pp_getpeername();
792}
793
794PP(pp_lstat)
795{
796 return pp_stat();
797}
798
799PP(pp_fteowned)
800{
801 return pp_ftrowned();
802}
803
804PP(pp_ftbinary)
805{
806 return pp_fttext();
807}
808
809PP(pp_localtime)
810{
811 return pp_gmtime();
812}
813
814PP(pp_shmget)
815{
816 return pp_semget();
817}
818
819PP(pp_shmctl)
820{
821 return pp_semctl();
822}
823
824PP(pp_shmread)
825{
826 return pp_shmwrite();
827}
828
829PP(pp_msgget)
830{
831 return pp_semget();
832}
833
834PP(pp_msgctl)
835{
836 return pp_semctl();
837}
838
839PP(pp_ghbyname)
840{
841 return pp_ghostent();
842}
843
844PP(pp_ghbyaddr)
845{
846 return pp_ghostent();
847}
848
849PP(pp_gnbyname)
850{
851 return pp_gnetent();
852}
853
854PP(pp_gnbyaddr)
855{
856 return pp_gnetent();
857}
858
859PP(pp_gpbyname)
860{
861 return pp_gprotoent();
862}
863
864PP(pp_gpbynumber)
865{
866 return pp_gprotoent();
867}
868
869PP(pp_gsbyname)
870{
871 return pp_gservent();
872}
873
874PP(pp_gsbyport)
875{
876 return pp_gservent();
877}
878
879PP(pp_gpwnam)
880{
881 return pp_gpwent();
882}
883
884PP(pp_gpwuid)
885{
886 return pp_gpwent();
887}
888
889PP(pp_ggrnam)
890{
891 return pp_ggrent();
892}
893
894PP(pp_ggrgid)
895{
896 return pp_ggrent();
897}
898
957b0e1d
NC
899PP(pp_ftsize)
900{
4992681b 901 return pp_ftis();
957b0e1d
NC
902}
903
904PP(pp_ftmtime)
905{
4992681b 906 return pp_ftis();
957b0e1d
NC
907}
908
909PP(pp_ftatime)
910{
4992681b 911 return pp_ftis();
957b0e1d
NC
912}
913
914PP(pp_ftctime)
915{
4992681b 916 return pp_ftis();
957b0e1d
NC
917}
918
f1cb2d48
NC
919PP(pp_ftzero)
920{
921 return pp_ftrowned();
922}
923
924PP(pp_ftsock)
925{
926 return pp_ftrowned();
927}
928
929PP(pp_ftchr)
930{
931 return pp_ftrowned();
932}
933
934PP(pp_ftblk)
935{
936 return pp_ftrowned();
937}
938
939PP(pp_ftfile)
940{
941 return pp_ftrowned();
942}
943
944PP(pp_ftdir)
945{
946 return pp_ftrowned();
947}
948
949PP(pp_ftpipe)
950{
951 return pp_ftrowned();
952}
953
17ad201a
NC
954PP(pp_ftsuid)
955{
956 return pp_ftrowned();
957}
958
959PP(pp_ftsgid)
960{
961 return pp_ftrowned();
962}
963
964PP(pp_ftsvtx)
965{
966 return pp_ftrowned();
967}
968
605b9385
NC
969PP(pp_unlink)
970{
971 return pp_chown();
972}
973
974PP(pp_chmod)
975{
976 return pp_chown();
977}
978
979PP(pp_utime)
980{
981 return pp_chown();
982}
983
984PP(pp_kill)
985{
986 return pp_chown();
987}
988
ce6987d0
NC
989PP(pp_symlink)
990{
991 return pp_link();
992}
993
af9e49b4
NC
994PP(pp_ftrwrite)
995{
996 return pp_ftrread();
997}
998
999PP(pp_ftrexec)
1000{
1001 return pp_ftrread();
1002}
1003
1004PP(pp_fteread)
1005{
1006 return pp_ftrread();
1007}
1008
1009PP(pp_ftewrite)
1010{
1011 return pp_ftrread();
1012}
1013
1014PP(pp_fteexec)
1015{
1016 return pp_ftrread();
1017}
1018
c9f7ac20
NC
1019PP(pp_msgsnd)
1020{
1021 return pp_shmwrite();
1022}
1023
1024PP(pp_msgrcv)
1025{
1026 return pp_shmwrite();
1027}
1028
64a1bc8e
NC
1029PP(pp_syswrite)
1030{
1031 return pp_send();
1032}
1033
ca563b4e
NC
1034PP(pp_semop)
1035{
1036 return pp_shmwrite();
1037}
1038
25a55bd7
SP
1039PP(pp_dor)
1040{
f6a64177 1041 return pp_defined();
25a55bd7
SP
1042}
1043
c960fc3b
SP
1044PP(pp_andassign)
1045{
1046 return pp_and();
1047}
1048
1049PP(pp_orassign)
1050{
1051 return pp_or();
1052}
1053
1054PP(pp_dorassign)
1055{
1056 return pp_defined();
1057}
1058
12e9c124
NC
1059PP(pp_lcfirst)
1060{
1061 return pp_ucfirst();
1062}
1063
afd9910b
NC
1064PP(pp_slt)
1065{
1066 return pp_sle();
1067}
1068
1069PP(pp_sgt)
1070{
1071 return pp_sle();
1072}
1073
1074PP(pp_sge)
1075{
1076 return pp_sle();
1077}
1078
2723d216
NC
1079PP(pp_rindex)
1080{
1081 return pp_index();
1082}
1083
daa2adfd
NC
1084PP(pp_hex)
1085{
1086 return pp_oct();
1087}
1088
789b4bc9
NC
1089PP(pp_pop)
1090{
1091 return pp_shift();
1092}
1093
71302fe3
NC
1094PP(pp_cos)
1095{
1096 return pp_sin();
1097}
1098
1099PP(pp_exp)
1100{
1101 return pp_sin();
1102}
1103
1104PP(pp_log)
1105{
1106 return pp_sin();
1107}
1108
1109PP(pp_sqrt)
1110{
1111 return pp_sin();
1112}
1113
3658c1f1
NC
1114PP(pp_bit_xor)
1115{
1116 return pp_bit_or();
1117}
1118
038e8d3c
NC
1119U8 *
1120Perl_uvuni_to_utf8(pTHX_ U8 *d, UV uv)
1121{
1122 return Perl_uvuni_to_utf8_flags(aTHX_ d, uv, 0);
1123}
1124
814fafa7
NC
1125bool
1126Perl_is_utf8_string_loc(pTHX_ const U8 *s, STRLEN len, const U8 **ep)
1127{
1128 return is_utf8_string_loclen(s, len, ep, 0);
1129}
1130
7ee2227d 1131/*
d5b2b27b
NC
1132=for apidoc sv_nolocking
1133
1134Dummy routine which "locks" an SV when there is no locking module present.
1135Exists to avoid test for a NULL function pointer and because it could
1136potentially warn under some level of strict-ness.
1137
1138"Superseded" by sv_nosharing().
1139
1140=cut
1141*/
1142
1143void
1144Perl_sv_nolocking(pTHX_ SV *sv)
1145{
96a5add6 1146 PERL_UNUSED_CONTEXT;
d5b2b27b
NC
1147 PERL_UNUSED_ARG(sv);
1148}
1149
1150
1151/*
1152=for apidoc sv_nounlocking
1153
1154Dummy routine which "unlocks" an SV when there is no locking module present.
1155Exists to avoid test for a NULL function pointer and because it could
1156potentially warn under some level of strict-ness.
1157
1158"Superseded" by sv_nosharing().
1159
1160=cut
1161*/
1162
1163void
1164Perl_sv_nounlocking(pTHX_ SV *sv)
1165{
96a5add6 1166 PERL_UNUSED_CONTEXT;
d5b2b27b
NC
1167 PERL_UNUSED_ARG(sv);
1168}
1169
2053acbf
NC
1170void
1171Perl_save_long(pTHX_ long int *longp)
1172{
1173 dVAR;
1174 SSCHECK(3);
1175 SSPUSHLONG(*longp);
1176 SSPUSHPTR(longp);
1177 SSPUSHINT(SAVEt_LONG);
1178}
1179
1180void
1181Perl_save_I16(pTHX_ I16 *intp)
1182{
1183 dVAR;
1184 SSCHECK(3);
1185 SSPUSHINT(*intp);
1186 SSPUSHPTR(intp);
1187 SSPUSHINT(SAVEt_I16);
1188}
1189
1190void
1191Perl_save_I8(pTHX_ I8 *bytep)
1192{
1193 dVAR;
1194 SSCHECK(3);
1195 SSPUSHINT(*bytep);
1196 SSPUSHPTR(bytep);
1197 SSPUSHINT(SAVEt_I8);
1198}
1199
1200void
1201Perl_save_iv(pTHX_ IV *ivp)
1202{
1203 dVAR;
1204 SSCHECK(3);
1205 SSPUSHIV(*ivp);
1206 SSPUSHPTR(ivp);
1207 SSPUSHINT(SAVEt_IV);
1208}
1209
1210void
1211Perl_save_nogv(pTHX_ GV *gv)
1212{
1213 dVAR;
1214 SSCHECK(2);
1215 SSPUSHPTR(gv);
1216 SSPUSHINT(SAVEt_NSTAB);
1217}
1218
1219void
1220Perl_save_list(pTHX_ register SV **sarg, I32 maxsarg)
1221{
1222 dVAR;
1223 register I32 i;
1224
1225 for (i = 1; i <= maxsarg; i++) {
1226 register SV * const sv = newSV(0);
1227 sv_setsv(sv,sarg[i]);
1228 SSCHECK(3);
1229 SSPUSHPTR(sarg[i]); /* remember the pointer */
1230 SSPUSHPTR(sv); /* remember the value */
1231 SSPUSHINT(SAVEt_ITEM);
1232 }
1233}
1234
1235void
1236Perl_save_destructor(pTHX_ DESTRUCTORFUNC_NOCONTEXT_t f, void* p)
1237{
1238 dVAR;
1239 SSCHECK(3);
1240 SSPUSHDPTR(f);
1241 SSPUSHPTR(p);
1242 SSPUSHINT(SAVEt_DESTRUCTOR);
1243}
1244
47518d95
NC
1245
1246/*
1247=for apidoc sv_usepvn_mg
1248
1249Like C<sv_usepvn>, but also handles 'set' magic.
1250
1251=cut
1252*/
1253
1254void
1255Perl_sv_usepvn_mg(pTHX_ SV *sv, char *ptr, STRLEN len)
1256{
1257 sv_usepvn_flags(sv,ptr,len, SV_SMAGIC);
1258}
1259
1260/*
1261=for apidoc sv_usepvn
1262
1263Tells an SV to use C<ptr> to find its string value. Implemented by
1264calling C<sv_usepvn_flags> with C<flags> of 0, hence does not handle 'set'
1265magic. See C<sv_usepvn_flags>.
1266
1267=cut
1268*/
1269
1270void
1271Perl_sv_usepvn(pTHX_ SV *sv, char *ptr, STRLEN len)
1272{
1273 sv_usepvn_flags(sv,ptr,len, 0);
1274}
1275
cbf82dd0
NC
1276void
1277Perl_cv_ckproto(pTHX_ const CV *cv, const GV *gv, const char *p)
1278{
1279 cv_ckproto_len(cv, gv, p, p ? strlen(p) : 0);
1280}
c03e83bf
NC
1281
1282/*
1283=for apidoc unpack_str
1284
1285The engine implementing unpack() Perl function. Note: parameters strbeg, new_s
1286and ocnt are not used. This call should not be used, use unpackstring instead.
1287
1288=cut */
1289
1290I32
1291Perl_unpack_str(pTHX_ const char *pat, const char *patend, const char *s,
1292 const char *strbeg, const char *strend, char **new_s, I32 ocnt,
1293 U32 flags)
1294{
1295 PERL_UNUSED_ARG(strbeg);
1296 PERL_UNUSED_ARG(new_s);
1297 PERL_UNUSED_ARG(ocnt);
1298
1299 return unpackstring(pat, patend, s, strend, flags);
1300}
b47163a2
NC
1301
1302/*
1303=for apidoc pack_cat
1304
1305The engine implementing pack() Perl function. Note: parameters next_in_list and
1306flags are not used. This call should not be used; use packlist instead.
1307
1308=cut
1309*/
1310
1311void
1312Perl_pack_cat(pTHX_ SV *cat, const char *pat, const char *patend, register SV **beglist, SV **endlist, SV ***next_in_list, U32 flags)
1313{
1314 PERL_UNUSED_ARG(next_in_list);
1315 PERL_UNUSED_ARG(flags);
1316
1317 packlist(cat, pat, patend, beglist, endlist);
1318}
20fac488
GA
1319#endif /* NO_MATHOMS */
1320
d5b2b27b 1321/*
7ee2227d
SP
1322 * Local variables:
1323 * c-indentation-style: bsd
1324 * c-basic-offset: 4
1325 * indent-tabs-mode: t
1326 * End:
1327 *
1328 * ex: set ts=8 sts=4 sw=4 noet:
1329 */