--- CBOR-XS/XS.xs 2013/10/27 10:17:12 1.9 +++ CBOR-XS/XS.xs 2013/10/27 20:40:25 1.10 @@ -62,8 +62,8 @@ # define CBOR_STASH cbor_stash #endif -static HV *cbor_stash, *cbor_boolean_stash, *cbor_tagged_stash; // CBOR::XS:: -static SV *cbor_true, *cbor_false; +static HV *cbor_stash, *types_boolean_stash, *types_error_stash, *cbor_tagged_stash; // CBOR::XS:: +static SV *types_true, *types_false, *types_error; typedef struct { U32 flags; @@ -261,15 +261,20 @@ if (ecb_expect_false (SvOBJECT (sv))) { - HV *boolean_stash = !CBOR_SLOW || cbor_boolean_stash - ? cbor_boolean_stash - : gv_stashpv ("CBOR::XS::Boolean", 1); + HV *boolean_stash = !CBOR_SLOW || types_boolean_stash + ? types_boolean_stash + : gv_stashpv ("Types::Serialiser::Boolean", 1); + HV *error_stash = !CBOR_SLOW || types_error_stash + ? types_error_stash + : gv_stashpv ("Types::Serialiser::Error", 1); HV *tagged_stash = !CBOR_SLOW || cbor_tagged_stash ? cbor_tagged_stash : gv_stashpv ("CBOR::XS::Tagged" , 1); if (SvSTASH (sv) == boolean_stash) encode_ch (enc, SvIV (sv) ? 0xe0 | 21 : 0xe0 | 20); + else if (SvSTASH (sv) == error_stash) + encode_ch (enc, 0xe0 | 23); else if (SvSTASH (sv) == tagged_stash) { if (svt != SVt_PVAV) @@ -695,16 +700,21 @@ { case 20: #if CBOR_SLOW - cbor_false = get_bool ("CBOR::XS::false"); + types_false = get_bool ("Types::Serialiser::false"); #endif - return newSVsv (cbor_false); + return newSVsv (types_false); case 21: #if CBOR_SLOW - cbor_true = get_bool ("CBOR::XS::true"); + types_true = get_bool ("Types::Serialiser::true"); #endif - return newSVsv (cbor_true); + return newSVsv (types_true); case 22: return newSVsv (&PL_sv_undef); + case 23: +#if CBOR_SLOW + types_error = get_bool ("Types::Serialiser::error"); +#endif + return newSVsv (types_error); case 25: { @@ -830,20 +840,24 @@ BOOT: { cbor_stash = gv_stashpv ("CBOR::XS" , 1); - cbor_boolean_stash = gv_stashpv ("CBOR::XS::Boolean", 1); cbor_tagged_stash = gv_stashpv ("CBOR::XS::Tagged" , 1); - cbor_true = get_bool ("CBOR::XS::true"); - cbor_false = get_bool ("CBOR::XS::false"); + types_boolean_stash = gv_stashpv ("Types::Serialiser::Boolean", 1); + types_error_stash = gv_stashpv ("Types::Serialiser::Error" , 1); + + types_true = get_bool ("Types::Serialiser::true" ); + types_false = get_bool ("Types::Serialiser::false"); + types_error = get_bool ("Types::Serialiser::error"); } PROTOTYPES: DISABLE void CLONE (...) CODE: - cbor_stash = 0; - cbor_boolean_stash = 0; - cbor_tagged_stash = 0; + cbor_stash = 0; + cbor_tagged_stash = 0; + types_error_stash = 0; + types_boolean_stash = 0; void new (char *klass) PPCODE: