--- JSON-XS/XS.xs 2007/11/25 19:02:42 1.66 +++ JSON-XS/XS.xs 2007/12/05 10:59:28 1.69 @@ -1459,7 +1459,10 @@ SvPOK_only (pv); Zero (SvPVX (pv), 1, JSON); ((JSON *)SvPVX (pv))->flags = F_DEFAULT; - XPUSHs (sv_2mortal (sv_bless (newRV_noinc (pv), JSON_STASH))); + XPUSHs (sv_2mortal (sv_bless ( + newRV_noinc (pv), + strEQ (klass, "JSON::XS") ? JSON_STASH : gv_stashpv (klass, 1) + ))); } void ascii (JSON *self, int enable = 1) @@ -1496,7 +1499,6 @@ get_canonical = F_CANONICAL get_space_before = F_SPACE_BEFORE get_space_after = F_SPACE_AFTER - get_pretty = F_PRETTY get_allow_nonref = F_ALLOW_NONREF get_shrink = F_SHRINK get_allow_blessed = F_ALLOW_BLESSED @@ -1520,7 +1522,7 @@ XPUSHs (ST (0)); } -int get_max_depth (JSON *self) +U32 get_max_depth (JSON *self) CODE: RETVAL = DEC_DEPTH (self->flags); OUTPUT: @@ -1603,14 +1605,14 @@ PROTOTYPES: ENABLE -void to_json (SV *scalar) +void encode_json (SV *scalar) PPCODE: { JSON json = { F_DEFAULT | F_UTF8 }; XPUSHs (encode_json (scalar, &json)); } -void from_json (SV *jsonstr) +void decode_json (SV *jsonstr) PPCODE: { JSON json = { F_DEFAULT | F_UTF8 };