… | |
… | |
12 | #if defined(__BORLANDC__) || defined(_MSC_VER) |
12 | #if defined(__BORLANDC__) || defined(_MSC_VER) |
13 | # define snprintf _snprintf // C compilers have this in stdio.h |
13 | # define snprintf _snprintf // C compilers have this in stdio.h |
14 | #endif |
14 | #endif |
15 | |
15 | |
16 | // some old perls do not have this, try to make it work, no |
16 | // some old perls do not have this, try to make it work, no |
17 | // guarentees, though. if it breaks, you get to keep the pieces. |
17 | // guarantees, though. if it breaks, you get to keep the pieces. |
18 | #ifndef UTF8_MAXBYTES |
18 | #ifndef UTF8_MAXBYTES |
19 | # define UTF8_MAXBYTES 13 |
19 | # define UTF8_MAXBYTES 13 |
20 | #endif |
20 | #endif |
21 | |
21 | |
22 | #define IVUV_MAXCHARS (sizeof (UV) * CHAR_BIT * 28 / 93 + 2) |
22 | #define IVUV_MAXCHARS (sizeof (UV) * CHAR_BIT * 28 / 93 + 2) |
… | |
… | |
759 | : enc.json.flags & F_LATIN1 ? 0x000100UL |
759 | : enc.json.flags & F_LATIN1 ? 0x000100UL |
760 | : 0x110000UL; |
760 | : 0x110000UL; |
761 | |
761 | |
762 | SvPOK_only (enc.sv); |
762 | SvPOK_only (enc.sv); |
763 | encode_sv (&enc, scalar); |
763 | encode_sv (&enc, scalar); |
|
|
764 | encode_nl (&enc); |
764 | |
765 | |
765 | SvCUR_set (enc.sv, enc.cur - SvPVX (enc.sv)); |
766 | SvCUR_set (enc.sv, enc.cur - SvPVX (enc.sv)); |
766 | *SvEND (enc.sv) = 0; // many xs functions expect a trailing 0 for text strings |
767 | *SvEND (enc.sv) = 0; // many xs functions expect a trailing 0 for text strings |
767 | |
768 | |
768 | if (!(enc.json.flags & (F_ASCII | F_LATIN1 | F_UTF8))) |
769 | if (!(enc.json.flags & (F_ASCII | F_LATIN1 | F_UTF8))) |
… | |
… | |
1655 | json_stash = gv_stashpv ("JSON::XS" , 1); |
1656 | json_stash = gv_stashpv ("JSON::XS" , 1); |
1656 | json_boolean_stash = gv_stashpv ("JSON::XS::Boolean", 1); |
1657 | json_boolean_stash = gv_stashpv ("JSON::XS::Boolean", 1); |
1657 | |
1658 | |
1658 | json_true = get_bool ("JSON::XS::true"); |
1659 | json_true = get_bool ("JSON::XS::true"); |
1659 | json_false = get_bool ("JSON::XS::false"); |
1660 | json_false = get_bool ("JSON::XS::false"); |
|
|
1661 | |
|
|
1662 | CvNODEBUG_on (get_cv ("JSON::XS::incr_text", 0)); /* the debugger completely breaks lvalue subs */ |
1660 | } |
1663 | } |
1661 | |
1664 | |
1662 | PROTOTYPES: DISABLE |
1665 | PROTOTYPES: DISABLE |
1663 | |
1666 | |
1664 | void CLONE (...) |
1667 | void CLONE (...) |