Lines Matching defs:sv

35 static I32 utf16_textfilter(pTHX_ int idx, SV *sv, int maxlen);
36 static I32 utf16rev_textfilter(pTHX_ int idx, SV *sv, int maxlen);
360 strip_return(SV *sv)
362 register char *s = SvPVX(sv);
363 register char *e = s + SvCUR(sv);
375 SvCUR(sv) -= s - d;
382 S_cr_textfilter(pTHX_ int idx, SV *sv, int maxlen)
384 I32 count = FILTER_READ(idx+1, sv, maxlen);
386 strip_return(sv);
647 SV *sv = NEWSV(85,0);
649 sv_upgrade(sv, SVt_PVMG);
650 sv_setpvn(sv,PL_bufptr,PL_bufend-PL_bufptr);
651 (void)SvIOK_on(sv);
652 SvIVX(sv) = 0;
653 av_store(CopFILEAV(PL_curcop),(I32)CopLINE(PL_curcop),sv);
827 Perl_str_to_version(pTHX_ SV *sv)
832 char *start = SvPVx(sv,len);
833 bool utf = SvUTF8(sv) ? TRUE : FALSE;
904 S_tokeq(pTHX_ SV *sv)
910 SV *pv = sv;
912 if (!SvLEN(sv))
915 s = SvPV_force(sv, len);
916 if (SvTYPE(sv) >= SVt_PVIV && SvIVX(sv) == -1)
926 if (SvUTF8(sv))
937 SvCUR_set(sv, d - SvPVX(sv));
940 return new_constant(NULL, 0, "q", sv, pv, "q");
941 return sv;
987 SV *sv = tokeq(PL_lex_stuff);
989 if (SvTYPE(sv) == SVt_PVIV) {
995 p = SvPV(sv, len);
997 if (SvUTF8(sv))
999 SvREFCNT_dec(sv);
1000 sv = nsv;
1002 yylval.opval = (OP*)newSVOP(op_type, 0, sv);
1092 SV *sv = newSVpvn("",0);
1094 SvUTF8_on(sv);
1096 yylval.opval = (OP*)newSVOP(OP_CONST, 0, sv);
1219 SV *sv = NEWSV(93, send - start); /* sv for the constant */
1221 register char *d = SvPVX(sv); /* destination for copies */
1261 i = d - SvPVX(sv); /* remember current offset */
1262 SvGROW(sv, SvLEN(sv) + 256); /* never more than 256 chars in a range */
1263 d = SvPVX(sv) + i; /* refresh d after realloc */
1464 * There will always enough room in sv since such
1482 for (c = (U8 *) SvPVX(sv); c < (U8 *)d; c++) {
1488 STRLEN offset = d - SvPVX(sv);
1490 d = SvGROW(sv, SvLEN(sv) + hicount + 1) + offset;
1494 while (src >= (U8 *)SvPVX(sv)) {
1578 char *ostart = SvPVX(sv);
1579 SvCUR_set(sv, d - ostart);
1580 SvPOK_on(sv);
1582 sv_utf8_upgrade(sv);
1584 SvGROW(sv, (STRLEN)(send - start));
1585 d = SvPVX(sv) + SvCUR(sv);
1589 char *odest = SvPVX(sv);
1591 SvGROW(sv, (SvLEN(sv) + len - (e - s + 4)));
1592 d = SvPVX(sv) + (d - odest);
1658 STRLEN off = d - SvPVX(sv);
1659 d = SvGROW(sv, SvLEN(sv) + (need-len)) + off;
1669 /* terminate the string and set up the sv */
1671 SvCUR_set(sv, d - SvPVX(sv));
1672 if (SvCUR(sv) >= SvLEN(sv))
1675 SvPOK_on(sv);
1677 sv_recode_to_utf8(sv, PL_encoding);
1678 if (SvUTF8(sv))
1682 SvUTF8_on(sv);
1689 /* shrink the sv if we allocated more than we used */
1690 if (SvCUR(sv) + 5 < SvLEN(sv)) {
1691 SvLEN_set(sv, SvCUR(sv) + 1);
1692 Renew(SvPVX(sv), SvLEN(sv), char);
1698 sv = new_constant(start, s - start, (PL_lex_inpat ? "qr" : "q"),
1699 sv, Nullsv,
1705 yylval.opval = (OP*)newSVOP(OP_CONST, 0, sv);
1707 SvREFCNT_dec(sv);
2092 S_filter_gets(pTHX_ register SV *sv, register PerlIO *fp, STRLEN append)
2102 SvCUR_set(sv, 0); /* start with empty line */
2103 if (FILTER_READ(0, sv, 0) > 0)
2104 return ( SvPVX(sv) ) ;
2109 return (sv_gets(sv, fp, append));
2129 SV *sv;
2130 if (GvCV(gv) && (sv = cv_const_sv(GvCV(gv)))) {
2131 pkgname = SvPV_nolen(sv);
2374 SV *sv = newSVsv(PL_linestr);
2376 sv = tokeq(sv);
2378 sv = new_constant(NULL, 0, "qr", sv, sv, "q");
2379 yylval.opval = (OP*)newSVOP(OP_CONST, 0, sv);
2495 SV *sv = NEWSV(85,0);
2497 sv_upgrade(sv, SVt_PVMG);
2498 sv_setsv(sv,PL_linestr);
2499 (void)SvIOK_on(sv);
2500 SvIVX(sv) = 0;
2501 av_store(CopFILEAV(PL_curcop),(I32)CopLINE(PL_curcop),sv);
2582 SV *sv = NEWSV(85,0);
2584 sv_upgrade(sv, SVt_PVMG);
2585 sv_setsv(sv,PL_linestr);
2586 (void)SvIOK_on(sv);
2587 SvIVX(sv) = 0;
2588 av_store(CopFILEAV(PL_curcop),(I32)CopLINE(PL_curcop),sv);
3031 SV *sv = newSVpvn(s, len);
3032 sv_catsv(sv, PL_lex_stuff);
3034 newSVOP(OP_CONST, 0, sv));
3902 SV *sv;
3954 sv = newSVpvn("CORE::GLOBAL::",14);
3955 sv_catpv(sv,PL_tokenbuf);
3958 sv = newSVpv(PL_tokenbuf,0);
3963 yylval.opval = (OP*)newSVOP(OP_CONST, 0, sv);
3967 is_utf8_string((U8*)SvPVX(sv), SvCUR(sv)))
3968 SvUTF8_on(sv);
4025 if (*d == ')' && (sv = cv_const_sv(GvCV(gv)))) {
4062 if ((sv = cv_const_sv(cv))) {
4065 ((SVOP*)yylval.opval)->op_sv = SvREFCNT_inc(sv);
4752 SV *sv;
4773 sv = newSVpvn(b, d-b);
4775 SvUTF8_on(sv);
4777 newSVOP(OP_CONST, 0, tokeq(sv)));
6049 /* Either returns sv, or mortalizes sv and returns a new SV*.
6050 Best used as sv=new_constant(..., sv, ...).
6055 S_new_constant(pTHX_ char *s, STRLEN len, const char *key, SV *sv, SV *pv,
6087 return sv;
6096 sv_2mortal(sv); /* Parent created it permanently */
6113 PUSHs(sv);
6127 res = SvREFCNT_inc(sv);
6143 sv = res;
6681 SV *sv = NEWSV(88,0);
6683 sv_upgrade(sv, SVt_PVMG);
6684 sv_setsv(sv,PL_linestr);
6685 (void)SvIOK_on(sv);
6686 SvIVX(sv) = 0;
6687 av_store(CopFILEAV(PL_curcop), (I32)CopLINE(PL_curcop),sv);
6925 SV *sv; /* scalar value: string */
6929 register char *to; /* current position in the sv's data */
6969 sv = NEWSV(87,79);
6970 sv_upgrade(sv, SVt_PVIV);
6971 SvIVX(sv) = termcode;
6972 (void)SvPOK_only(sv); /* validate pointer */
6976 sv_catpvn(sv, s, termlen);
6984 bool found = sv_cat_decode(sv, PL_encoding, PL_linestr,
6987 char *svlast = SvEND(sv) - 1;
6997 if (SvCUR(sv) > 1 && *(svlast-1) == '\\') {
6999 for (t = svlast-2; t >= SvPVX(sv) && *t == '\\';)
7005 SvCUR_set(sv, SvCUR(sv) - 1);
7016 last = SvPVX(sv);
7034 SvCUR_set(sv, w - SvPVX(sv));
7043 SvCUR_set(sv, SvCUR(sv) - 1);
7044 *SvEND(sv) = '\0';
7049 /* extend sv if need be */
7050 SvGROW(sv, SvCUR(sv) + (PL_bufend - s) + 1);
7051 /* set 'to' to the next character in the sv's string */
7052 to = SvPVX(sv)+SvCUR(sv);
7110 /* terminate the copied string and update the sv's end-of-string */
7112 SvCUR_set(sv, to - SvPVX(sv));
7122 if (to - SvPVX(sv) >= 2) {
7128 SvCUR_set(sv, to - SvPVX(sv));
7133 else if (to - SvPVX(sv) == 1 && to[-1] == '\r')
7143 sv_free(sv);
7152 SV *sv = NEWSV(88,0);
7154 sv_upgrade(sv, SVt_PVMG);
7155 sv_setsv(sv,PL_linestr);
7156 (void)SvIOK_on(sv);
7157 SvIVX(sv) = 0;
7158 av_store(CopFILEAV(PL_curcop), (I32)CopLINE(PL_curcop), sv);
7170 sv_catpvn(sv, s, termlen);
7174 SvUTF8_on(sv);
7179 if (SvCUR(sv) + 5 < SvLEN(sv)) {
7180 SvLEN_set(sv, SvCUR(sv) + 1);
7181 Renew(SvPVX(sv), SvLEN(sv), char);
7189 PL_lex_repl = sv;
7191 PL_lex_stuff = sv;
7224 SV *sv = Nullsv; /* place to put the converted number */
7384 sv = NEWSV(92,0);
7390 sv_setnv(sv, n);
7399 sv_setuv(sv, u);
7402 sv = new_constant(start, s - start, "binary", sv, Nullsv, NULL);
7533 /* make an sv from the string */
7534 sv = NEWSV(92,0);
7547 sv_setiv(sv, uv); /* Prefer IVs over UVs. */
7549 sv_setuv(sv, uv);
7552 sv_setiv(sv, -(IV)uv);
7562 sv_setnv(sv, nv);
7567 sv = new_constant(PL_tokenbuf, d - PL_tokenbuf,
7569 sv, Nullsv, NULL);
7575 sv = NEWSV(92,5); /* preallocate storage space */
7576 s = scan_vstring(s,sv);
7585 if (sv)
7586 lvalp->opval = newSVOP(OP_CONST, 0, sv);
7956 utf16_textfilter(pTHX_ int idx, SV *sv, int maxlen)
7958 I32 count = FILTER_READ(idx+1, sv, maxlen);
7963 New(898, tmps, SvCUR(sv) * 3 / 2 + 1, U8);
7964 if (!*SvPV_nolen(sv))
7968 tend = utf16_to_utf8((U8*)SvPVX(sv), tmps, SvCUR(sv), &newlen);
7969 sv_usepvn(sv, (char*)tmps, tend - tmps);
7975 utf16rev_textfilter(pTHX_ int idx, SV *sv, int maxlen)
7977 I32 count = FILTER_READ(idx+1, sv, maxlen);
7982 if (!*SvPV_nolen(sv))
7986 New(898, tmps, SvCUR(sv) * 3 / 2 + 1, U8);
7987 tend = utf16_to_utf8_reversed((U8*)SvPVX(sv), tmps, SvCUR(sv), &newlen);
7988 sv_usepvn(sv, (char*)tmps, tend - tmps);
7996 vstring, as well as updating the passed in sv.
8000 sv = NEWSV(92,5);
8001 s = scan_vstring(s,sv);
8003 The sv should already be large enough to store the vstring
8009 Perl_scan_vstring(pTHX_ char *s, SV *sv)
8023 sv_setpvn(sv,(char *)s,pos-s);
8035 sv_setpvn(sv, "", 0);
8061 sv_catpvn(sv, (const char*)tmpbuf, tmpend - tmpbuf);
8063 SvUTF8_on(sv);
8073 SvPOK_on(sv);
8074 sv_magic(sv,NULL,PERL_MAGIC_vstring,(const char*)start, pos-start);
8075 SvRMAGICAL_on(sv);