summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-10-24 13:06:24 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-10-24 13:06:24 +0000
commit143014bf2594b56fdf762b3cf36b37c248c55291 (patch)
treeb94287463b3dfed26a85e4168652584f50edfc04
parentb3122bc4daf8abd219740b0090a596d8cd89f890 (diff)
downloadperl-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.c11
-rw-r--r--embed.h2
-rwxr-xr-xembed.pl2
-rw-r--r--proto.h1
4 files changed, 14 insertions, 2 deletions
diff --git a/dump.c b/dump.c
index b5e9fbfa53..0d87fab069 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 3a85dd4bde..4ac3878da5 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 f88a919828..44c5a4a41d 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 1dba98c3a9..dc96ebe45f 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