diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-10-24 13:06:24 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-10-24 13:06:24 +0000 |
commit | 143014bf2594b56fdf762b3cf36b37c248c55291 (patch) | |
tree | b94287463b3dfed26a85e4168652584f50edfc04 | |
parent | b3122bc4daf8abd219740b0090a596d8cd89f890 (diff) | |
download | perl-143014bf2594b56fdf762b3cf36b37c248c55291.tar.gz |
Rewrite sv_uni_display() as pv_uni_display() as
reimplement sv_uni_display() using that.
p4raw-id: //depot/perl@12619
-rw-r--r-- | dump.c | 11 | ||||
-rw-r--r-- | embed.h | 2 | ||||
-rwxr-xr-x | embed.pl | 2 | ||||
-rw-r--r-- | proto.h | 1 |
4 files changed, 14 insertions, 2 deletions
@@ -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(); @@ -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) @@ -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 \ @@ -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 |