--- CBOR-XS/XS.xs 2016/04/24 19:51:41 1.53 +++ CBOR-XS/XS.xs 2016/04/24 20:08:41 1.54 @@ -102,8 +102,8 @@ #define F_ALLOW_SHARING 0x00000004UL #define F_ALLOW_CYCLES 0x00000008UL #define F_PACK_STRINGS 0x00000010UL -#define F_UTF8_STRINGS 0x00000020UL -#define F_UTF8_KEYS 0x00000040UL +#define F_TEXT_KEYS 0x00000020UL +#define F_TEXT_STRINGS 0x00000040UL #define F_VALIDATE_UTF8 0x00000080UL #define INIT_SIZE 32 // initial scalar size to be allocated @@ -319,7 +319,7 @@ enc->cur += len; } -ecb_inline +ecb_inline void encode_strref (enc_t *enc, int upgrade_utf8, int utf8, char *str, STRLEN len) { if (ecb_expect_false (enc->cbor.flags & F_PACK_STRINGS)) @@ -397,7 +397,7 @@ if (HeKLEN (he) == HEf_SVKEY) encode_sv (enc, HeSVKEY (he)); else - encode_strref (enc, enc->cbor.flags & (F_UTF8_KEYS | F_UTF8_STRINGS), HeKUTF8 (he), HeKEY (he), HeKLEN (he)); + encode_strref (enc, enc->cbor.flags & (F_TEXT_KEYS | F_TEXT_STRINGS), HeKUTF8 (he), HeKEY (he), HeKLEN (he)); encode_sv (enc, ecb_expect_false (mg) ? hv_iterval (hv, he) : HeVAL (he)); } @@ -594,7 +594,7 @@ { STRLEN len; char *str = SvPV (sv, len); - encode_strref (enc, enc->cbor.flags & F_UTF8_STRINGS, SvUTF8 (sv), str, len); + encode_strref (enc, enc->cbor.flags & F_TEXT_STRINGS, SvUTF8 (sv), str, len); } else if (SvNOKp (sv)) encode_nv (enc, sv); @@ -1424,7 +1424,8 @@ allow_sharing = F_ALLOW_SHARING allow_cycles = F_ALLOW_CYCLES pack_strings = F_PACK_STRINGS - utf8_strings = F_UTF8_STRINGS + text_keys = F_TEXT_KEYS + text_strings = F_TEXT_STRINGS validate_utf8 = F_VALIDATE_UTF8 PPCODE: { @@ -1443,6 +1444,8 @@ get_allow_sharing = F_ALLOW_SHARING get_allow_cycles = F_ALLOW_CYCLES get_pack_strings = F_PACK_STRINGS + get_text_keys = F_TEXT_KEYS + get_text_strings = F_TEXT_STRINGS get_validate_utf8 = F_VALIDATE_UTF8 PPCODE: XPUSHs (boolSV (self->flags & ix));