From: Jarkko Hietaniemi Date: Wed, 24 Oct 2001 13:06:24 +0000 (+0000) Subject: Rewrite sv_uni_display() as pv_uni_display() as X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=143014bf2594b56fdf762b3cf36b37c248c55291;p=p5sagit%2Fp5-mst-13.2.git Rewrite sv_uni_display() as pv_uni_display() as reimplement sv_uni_display() using that. p4raw-id: //depot/perl@12619 --- diff --git a/dump.c b/dump.c index b5e9fbf..0d87fab 100644 --- a/dump.c +++ b/dump.c @@ -143,13 +143,13 @@ Perl_pv_display(pTHX_ SV *dsv, char *pv, STRLEN cur, STRLEN len, STRLEN pvlim) } char * -Perl_sv_uni_display(pTHX_ SV *dsv, SV *ssv, STRLEN pvlim, UV flags) +Perl_pv_uni_display(pTHX_ SV *dsv, U8 *spv, STRLEN len, STRLEN pvlim, UV flags) { int truncated = 0; char *s, *e; sv_setpvn(dsv, "", 0); - for (s = SvPVX(ssv), e = s + SvCUR(ssv); s < e; s += UTF8SKIP(s)) { + for (s = (char *)spv, e = s + len; s < e; s += UTF8SKIP(s)) { UV u; if (pvlim && SvCUR(dsv) >= pvlim) { truncated++; @@ -165,6 +165,13 @@ Perl_sv_uni_display(pTHX_ SV *dsv, SV *ssv, STRLEN pvlim, UV flags) } char * +Perl_sv_uni_display(pTHX_ SV *dsv, SV *ssv, STRLEN pvlim, UV flags) +{ + return Perl_pv_uni_display(aTHX_ dsv, (U8*)SvPVX(ssv), SvCUR(ssv), + pvlim, flags); +} + +char * Perl_sv_peek(pTHX_ SV *sv) { SV *t = sv_newmortal(); diff --git a/embed.h b/embed.h index 3a85dd4..4ac3878 100644 --- a/embed.h +++ b/embed.h @@ -804,6 +804,7 @@ #define sv_usepvn_mg Perl_sv_usepvn_mg #define get_vtbl Perl_get_vtbl #define pv_display Perl_pv_display +#define pv_uni_display Perl_pv_uni_display #define sv_uni_display Perl_sv_uni_display #define dump_indent Perl_dump_indent #define dump_vindent Perl_dump_vindent @@ -2311,6 +2312,7 @@ #define sv_usepvn_mg(a,b,c) Perl_sv_usepvn_mg(aTHX_ a,b,c) #define get_vtbl(a) Perl_get_vtbl(aTHX_ a) #define pv_display(a,b,c,d,e) Perl_pv_display(aTHX_ a,b,c,d,e) +#define pv_uni_display(a,b,c,d,e) Perl_pv_uni_display(aTHX_ a,b,c,d,e) #define sv_uni_display(a,b,c,d) Perl_sv_uni_display(aTHX_ a,b,c,d) #define dump_vindent(a,b,c,d) Perl_dump_vindent(aTHX_ a,b,c,d) #define do_gv_dump(a,b,c,d) Perl_do_gv_dump(aTHX_ a,b,c,d) diff --git a/embed.pl b/embed.pl index f88a919..44c5a4a 100755 --- a/embed.pl +++ b/embed.pl @@ -1904,6 +1904,8 @@ Apd |void |sv_usepvn_mg |SV *sv|char *ptr|STRLEN len Ap |MGVTBL*|get_vtbl |int vtbl_id p |char* |pv_display |SV *dsv|char *pv|STRLEN cur|STRLEN len \ |STRLEN pvlim +p |char* |pv_uni_display |SV *dsv|U8 *spv|STRLEN len \ + |STRLEN pvlim|UV flags p |char* |sv_uni_display |SV *dsv|SV *ssv|STRLEN pvlim|UV flags Afp |void |dump_indent |I32 level|PerlIO *file|const char* pat|... Ap |void |dump_vindent |I32 level|PerlIO *file|const char* pat \ diff --git a/proto.h b/proto.h index 1dba98c..dc96ebe 100644 --- a/proto.h +++ b/proto.h @@ -897,6 +897,7 @@ PERL_CALLCONV void Perl_sv_setsv_mg(pTHX_ SV *dstr, SV *sstr); PERL_CALLCONV void Perl_sv_usepvn_mg(pTHX_ SV *sv, char *ptr, STRLEN len); PERL_CALLCONV MGVTBL* Perl_get_vtbl(pTHX_ int vtbl_id); PERL_CALLCONV char* Perl_pv_display(pTHX_ SV *dsv, char *pv, STRLEN cur, STRLEN len, STRLEN pvlim); +PERL_CALLCONV char* Perl_pv_uni_display(pTHX_ SV *dsv, U8 *spv, STRLEN len, STRLEN pvlim, UV flags); PERL_CALLCONV char* Perl_sv_uni_display(pTHX_ SV *dsv, SV *ssv, STRLEN pvlim, UV flags); PERL_CALLCONV void Perl_dump_indent(pTHX_ I32 level, PerlIO *file, const char* pat, ...) #ifdef CHECK_FORMAT