diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-10-23 21:52:45 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-10-23 21:52:45 +0000 |
commit | b2ff9928c77b24737570b67197be87aa48019afe (patch) | |
tree | 97bc1d7c007e4068a875eeab5df93393d00f4337 | |
parent | 1edbfb88dca645450f44e4bcbb3df8372f66c904 (diff) | |
download | perl-b2ff9928c77b24737570b67197be87aa48019afe.tar.gz |
sv_uni_display(): do not add the "...", let the caller
do it if wanted, and be prepared for more display options.
p4raw-id: //depot/perl@12612
-rw-r--r-- | dump.c | 13 | ||||
-rw-r--r-- | embed.h | 2 | ||||
-rwxr-xr-x | embed.pl | 2 | ||||
-rw-r--r-- | proto.h | 2 |
4 files changed, 9 insertions, 10 deletions
@@ -143,12 +143,12 @@ 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) +Perl_sv_uni_display(pTHX_ SV *dsv, SV *ssv, STRLEN pvlim, UV flags) { int truncated = 0; char *s, *e; - sv_setpvn(dsv, "\"", 1); + sv_setpvn(dsv, "", 0); for (s = SvPVX(ssv), e = s + SvCUR(ssv); s < e; s += UTF8SKIP(s)) { UV u; if (pvlim && SvCUR(dsv) >= pvlim) { @@ -158,7 +158,6 @@ Perl_sv_uni_display(pTHX_ SV *dsv, SV *ssv, STRLEN pvlim) u = utf8_to_uvchr((U8*)s, 0); Perl_sv_catpvf(aTHX_ dsv, "\\x{%"UVxf"}", u); } - sv_catpvn(dsv, "\"", 1); if (truncated) sv_catpvn(dsv, "...", 3); @@ -301,8 +300,8 @@ Perl_sv_peek(pTHX_ SV *sv) Perl_sv_catpvf(aTHX_ t, "[%s]", pv_display(tmp, SvPVX(sv)-SvIVX(sv), SvIVX(sv), 0, 127)); Perl_sv_catpvf(aTHX_ t, "%s)", pv_display(tmp, SvPVX(sv), SvCUR(sv), SvLEN(sv), 127)); if (SvUTF8(sv)) - Perl_sv_catpvf(aTHX_ t, " [UTF8 %s]", - sv_uni_display(tmp, sv, 8 * sv_len_utf8(sv))); + Perl_sv_catpvf(aTHX_ t, " [UTF8 \"%s\"]", + sv_uni_display(tmp, sv, 8 * sv_len_utf8(sv), 0)); SvREFCNT_dec(tmp); } } @@ -1135,7 +1134,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo PerlIO_printf(file, "( %s . ) ", pv_display(d, SvPVX(sv)-SvIVX(sv), SvIVX(sv), 0, pvlim)); PerlIO_printf(file, "%s", pv_display(d, SvPVX(sv), SvCUR(sv), SvLEN(sv), pvlim)); if (SvUTF8(sv)) /* the 8? \x{....} */ - PerlIO_printf(file, " [UTF8 %s]", sv_uni_display(d, sv, 8 * sv_len_utf8(sv))); + PerlIO_printf(file, " [UTF8 \"%s\"]", sv_uni_display(d, sv, 8 * sv_len_utf8(sv), 0)); PerlIO_printf(file, "\n"); Perl_dump_indent(aTHX_ level, file, " CUR = %"IVdf"\n", (IV)SvCUR(sv)); Perl_dump_indent(aTHX_ level, file, " LEN = %"IVdf"\n", (IV)SvLEN(sv)); @@ -1267,7 +1266,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo elt = hv_iterval(hv, he); Perl_dump_indent(aTHX_ level+1, file, "Elt %s ", pv_display(d, keypv, len, 0, pvlim)); if (SvUTF8(keysv)) - PerlIO_printf(file, "[UTF8 %s] ", sv_uni_display(d, keysv, 8 * sv_len_utf8(keysv))); + PerlIO_printf(file, "[UTF8 \"%s\"] ", sv_uni_display(d, keysv, 8 * sv_len_utf8(keysv), 0)); PerlIO_printf(file, "HASH = 0x%"UVxf"\n", (UV)hash); do_sv_dump(level+1, file, elt, nest+1, maxnest, dumpops, pvlim); } @@ -2311,7 +2311,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 sv_uni_display(a,b,c) Perl_sv_uni_display(aTHX_ a,b,c) +#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) #define do_gvgv_dump(a,b,c,d) Perl_do_gvgv_dump(aTHX_ a,b,c,d) @@ -1904,7 +1904,7 @@ 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* |sv_uni_display |SV *dsv|SV *ssv|STRLEN pvlim +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 \ |va_list *args @@ -897,7 +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_sv_uni_display(pTHX_ SV *dsv, SV *ssv, STRLEN pvlim); +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 __attribute__((format(printf,pTHX_3,pTHX_4))) |