develooper Front page | perl.perl5.porters | Postings from October 2008

Re: Next API question for Devel::PPPort

Thread Previous | Thread Next
Marcus Holland-Moritz
October 23, 2008 10:41
Re: Next API question for Devel::PPPort
Message ID:
On 2008-10-23, at 16:19:00 +0200, H.Merijn Brand wrote:

> Can I haz Perl_pv_pretty () and Perl_pv_escape () in Devel::PPPort?

Patches welcome. :-)

No, really, pulling these in will be quite some work, as it's
not as easy as copying and pasting the functions. Currently
they depend on a couple of UTF8 functions, which I'm reluctant
to pull in simply because of their cumulative size.

I guess you know these functions far better than I do (I wasn't
even aware they existed), so it'll be much easier for you to
rewrite them without the UTF8 stuff and to write tests for them
than it would be for me.

If you can provide me with a new file that I can put into
parts/inc/ that implements both functions (as stripped down
and de-utf8'ed as possible), along with proper tests, I'll
be happy to integrate it and do the usual backwards compat
testing (and if necessary fixing).

You can have a look at the implementation of newSVpvn_flags
in parts/inc/newSVpv. I guess a copy of that file would make
a good starting point.


> $ grep -P '\bpv_' ppport.h
> pv_display||5.006000|
> pv_escape||5.009004|
> pv_pretty||5.009004|
> pv_uni_display||5.007003|
> $ grep PERL_PV perl.h
> #define PERL_PV_ESCAPE_QUOTE        0x0001
> #define PERL_PV_PRETTY_ELLIPSES     0x0002
> #define PERL_PV_PRETTY_LTGT         0x0004
> #define PERL_PV_ESCAPE_FIRSTCHAR    0x0008
> #define PERL_PV_ESCAPE_UNI          0x0100
> #define PERL_PV_ESCAPE_UNI_DETECT   0x0200
> #define PERL_PV_ESCAPE_ALL          0x1000
> #define PERL_PV_ESCAPE_NOCLEAR      0x4000
> #define PERL_PV_ESCAPE_RE           0x8000
> -- 
> H.Merijn Brand          Amsterdam Perl Mongers
> using & porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,
> 11.11, 11.23, and 11.31, SuSE 10.1, 10.2, and 10.3, AIX 5.2, and Cygwin.

Bugs, pl. n.:
	Small living things that small living boys throw on small living girls.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About