r62346 - in /trunk/libjson-xs-perl: Changes META.json META.yml XS.pm XS.xs bin/json_xs debian/changelog debian/control
periapt-guest at users.alioth.debian.org
periapt-guest at users.alioth.debian.org
Sun Sep 5 22:02:54 UTC 2010
Author: periapt-guest
Date: Sun Sep 5 22:02:31 2010
New Revision: 62346
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=62346
Log:
New upstream version
Modified:
trunk/libjson-xs-perl/Changes
trunk/libjson-xs-perl/META.json
trunk/libjson-xs-perl/META.yml
trunk/libjson-xs-perl/XS.pm
trunk/libjson-xs-perl/XS.xs
trunk/libjson-xs-perl/bin/json_xs
trunk/libjson-xs-perl/debian/changelog
trunk/libjson-xs-perl/debian/control
Modified: trunk/libjson-xs-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjson-xs-perl/Changes?rev=62346&op=diff
==============================================================================
--- trunk/libjson-xs-perl/Changes (original)
+++ trunk/libjson-xs-perl/Changes Sun Sep 5 22:02:31 2010
@@ -1,4 +1,11 @@
Revision history for Perl extension JSON::XS
+
+2.3 Wed Aug 18 01:26:47 CEST 2010
+ - make sure decoder doesn't change the decoding in the incremental
+ parser (testcase provided by Hendrik Schumacher).
+ - applied patch by DaTa for Data::Dumper support in json_xs.
+ - added -t dump support to json_xs, using Data::Dump.
+ - added -f eval support to json_xs.
2.29 Wed Mar 17 02:39:12 CET 2010
- fix a memory leak when callbacks set using filter_json_object
Modified: trunk/libjson-xs-perl/META.json
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjson-xs-perl/META.json?rev=62346&op=diff
==============================================================================
--- trunk/libjson-xs-perl/META.json (original)
+++ trunk/libjson-xs-perl/META.json Sun Sep 5 22:02:31 2010
@@ -1,1 +1,1 @@
-{"no_index":{"directory":["t","inc"]},"meta-spec":{"version":1.4,"url":"http://module-build.sourceforge.net/META-spec-v1.4.html"},"generated_by":"ExtUtils::MakeMaker version 6.54","distribution_type":"module","version":"2.29","name":"JSON-XS","author":[],"license":"unknown","build_requires":{"ExtUtils::MakeMaker":0},"requires":{"common::sense":0},"abstract":null,"configure_requires":{"ExtUtils::MakeMaker":0}}
+{"no_index":{"directory":["t","inc"]},"meta-spec":{"version":1.4,"url":"http://module-build.sourceforge.net/META-spec-v1.4.html"},"generated_by":"ExtUtils::MakeMaker version 6.56","distribution_type":"module","version":"2.3","name":"JSON-XS","author":[],"license":"unknown","build_requires":{"ExtUtils::MakeMaker":0},"requires":{"common::sense":0},"abstract":null,"configure_requires":{"ExtUtils::MakeMaker":0}}
Modified: trunk/libjson-xs-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjson-xs-perl/META.yml?rev=62346&op=diff
==============================================================================
--- trunk/libjson-xs-perl/META.yml (original)
+++ trunk/libjson-xs-perl/META.yml Sun Sep 5 22:02:31 2010
@@ -9,9 +9,9 @@
"version" : 1.4,
"url" : "http://module-build.sourceforge.net/META-spec-v1.4.html"
},
- "generated_by" : "ExtUtils::MakeMaker version 6.54",
+ "generated_by" : "ExtUtils::MakeMaker version 6.56",
"distribution_type" : "module",
- "version" : "2.29",
+ "version" : "2.3",
"name" : "JSON-XS",
"author" : [],
"license" : "unknown",
Modified: trunk/libjson-xs-perl/XS.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjson-xs-perl/XS.pm?rev=62346&op=diff
==============================================================================
--- trunk/libjson-xs-perl/XS.pm (original)
+++ trunk/libjson-xs-perl/XS.pm Sun Sep 5 22:02:31 2010
@@ -103,7 +103,7 @@
use common::sense;
-our $VERSION = '2.29';
+our $VERSION = '2.3';
our @ISA = qw(Exporter);
our @EXPORT = qw(encode_json decode_json to_json from_json);
Modified: trunk/libjson-xs-perl/XS.xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjson-xs-perl/XS.xs?rev=62346&op=diff
==============================================================================
--- trunk/libjson-xs-perl/XS.xs (original)
+++ trunk/libjson-xs-perl/XS.xs Sun Sep 5 22:02:31 2010
@@ -43,6 +43,8 @@
#define INDENT_STEP 3 // spaces per indentation level
#define SHORT_STRING_LEN 16384 // special-case strings of up to this size
+
+#define DECODE_WANTS_OCTETS(json) ((json)->flags & F_UTF8)
#define SB do {
#define SE } while (0)
@@ -1550,7 +1552,7 @@
(unsigned long)SvCUR (string), (unsigned long)json->max_size);
}
- if (json->flags & F_UTF8)
+ if (DECODE_WANTS_OCTETS (json))
sv_utf8_downgrade (string, 0);
else
sv_utf8_upgrade (string);
@@ -1931,24 +1933,36 @@
if (!self->incr_text)
self->incr_text = newSVpvn ("", 0);
+ /* if utf8-ness doesn't match the decoder, need to upgrade/downgrade */
+ if (!DECODE_WANTS_OCTETS (self) == !SvUTF8 (self->incr_text))
+ if (DECODE_WANTS_OCTETS (self))
+ {
+ if (self->incr_pos)
+ self->incr_pos = utf8_length ((U8 *)SvPVX (self->incr_text),
+ (U8 *)SvPVX (self->incr_text) + self->incr_pos);
+
+ sv_utf8_downgrade (self->incr_text, 0);
+ }
+ else
+ {
+ sv_utf8_upgrade (self->incr_text);
+
+ if (self->incr_pos)
+ self->incr_pos = utf8_hop ((U8 *)SvPVX (self->incr_text), self->incr_pos)
+ - (U8 *)SvPVX (self->incr_text);
+ }
+
// append data, if any
if (jsonstr)
{
- if (SvUTF8 (jsonstr))
- {
- if (!SvUTF8 (self->incr_text))
- {
- /* utf-8-ness differs, need to upgrade */
- sv_utf8_upgrade (self->incr_text);
-
- if (self->incr_pos)
- self->incr_pos = utf8_hop ((U8 *)SvPVX (self->incr_text), self->incr_pos)
- - (U8 *)SvPVX (self->incr_text);
- }
- }
- else if (SvUTF8 (self->incr_text))
- sv_utf8_upgrade (jsonstr);
-
+ /* make sure both strings have same encoding */
+ if (SvUTF8 (jsonstr) != SvUTF8 (self->incr_text))
+ if (SvUTF8 (jsonstr))
+ sv_utf8_downgrade (jsonstr, 0);
+ else
+ sv_utf8_upgrade (jsonstr);
+
+ /* and then just blindly append */
{
STRLEN len;
const char *str = SvPV (jsonstr, len);
Modified: trunk/libjson-xs-perl/bin/json_xs
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjson-xs-perl/bin/json_xs?rev=62346&op=diff
==============================================================================
--- trunk/libjson-xs-perl/bin/json_xs (original)
+++ trunk/libjson-xs-perl/bin/json_xs Sun Sep 5 22:02:31 2010
@@ -42,13 +42,15 @@
=item yaml - YAML (avoid at all costs, requires the YAML module :)
+=item eval - evaluate the given code as (non-utf-8) Perl, basically the reverse of "-t dump"
+
=back
=item -t toformat
Write the file in the given format to STDOUT.
-C<fromformat> can be one of:
+C<toformat> can be one of:
=over 4
@@ -67,6 +69,13 @@
=item clzf - Compress::LZF format
=item yaml - YAML
+
+=item dump - Data::Dump
+
+=item dumper - Data::Dumper
+
+Note that Data::Dumper doesn't handle self-referential data structures
+correctly - use "dump" instead.
=back
@@ -138,6 +147,7 @@
"storable-file" => sub { open my $fh, "<", \$_; Storable::fd_retrieve $fh },
"clzf" => sub { require Compress::LZF; Compress::LZF::sthaw ($_) },
"yaml" => sub { require YAML; YAML::Load ($_) },
+ "eval" => sub { my $v = eval "no strict; no warnings; no utf8;\n#line 1 \"input\"\n$_"; die "$@" if $@; $v },
);
my %T = (
@@ -155,6 +165,21 @@
"clzf" => sub { require Compress::LZF; Compress::LZF::sfreeze_cr ($_) },
"yaml" => sub { require YAML; YAML::Dump ($_) },
+ "dumper" => sub {
+ require Data::Dumper;
+ #local $Data::Dumper::Purity = 1; # hopeless case
+ local $Data::Dumper::Terse = 1;
+ local $Data::Dumper::Indent = 1;
+ local $Data::Dumper::Useqq = 1;
+ local $Data::Dumper::Quotekeys = 0;
+ local $Data::Dumper::Sortkeys = 1;
+ Data::Dumper::Dumper($_)
+ },
+ "dump" => sub {
+ require Data::Dump;
+ local $Data::Dump::TRY_BASE64 = 0;
+ Data::Dump::dump ($_) . "\n"
+ },
);
$F{$opt_from}
Modified: trunk/libjson-xs-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjson-xs-perl/debian/changelog?rev=62346&op=diff
==============================================================================
--- trunk/libjson-xs-perl/debian/changelog (original)
+++ trunk/libjson-xs-perl/debian/changelog Sun Sep 5 22:02:31 2010
@@ -1,8 +1,12 @@
-libjson-xs-perl (2.290-2) UNRELEASED; urgency=low
+libjson-xs-perl (2.300-1) UNRELEASED; urgency=low
+ [ gregor herrmann ]
* debian/rules: switch order of arguments to dh.
- -- gregor herrmann <gregoa at debian.org> Wed, 28 Jul 2010 14:32:48 -0400
+ [ Nicholas Bamber ]
+ * New upstream version
+
+ -- Nicholas Bamber <nicholas at periapt.co.uk> Sun, 05 Sep 2010 22:57:04 +0100
libjson-xs-perl (2.290-1) unstable; urgency=low
Modified: trunk/libjson-xs-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libjson-xs-perl/debian/control?rev=62346&op=diff
==============================================================================
--- trunk/libjson-xs-perl/debian/control (original)
+++ trunk/libjson-xs-perl/debian/control Sun Sep 5 22:02:31 2010
@@ -6,7 +6,7 @@
Uploaders: Angel Abad <angelabad at gmail.com>, Jonathan Yu <jawnsy at cpan.org>,
Ivan Kohler <ivan-debian at 420.am>, Niko Tyni <ntyni at debian.org>,
gregor herrmann <gregoa at debian.org>, Ansgar Burchardt <ansgar at 43-1.org>,
- Ryan Niebur <ryan at debian.org>
+ Ryan Niebur <ryan at debian.org>, Nicholas Bamber <nicholas at periapt.co.uk>
Standards-Version: 3.8.4
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libjson-xs-perl/
Vcs-Browser: http://svn.debian.org/viewsvn/pkg-perl/trunk/libjson-xs-perl/
More information about the Pkg-perl-cvs-commits
mailing list