ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/JSON-XS/XS.xs
(Generate patch)

Comparing JSON-XS/XS.xs (file contents):
Revision 1.13 by root, Sat Mar 24 22:55:16 2007 UTC vs.
Revision 1.15 by root, Sun Mar 25 02:32:40 2007 UTC

20 20
21#define INIT_SIZE 32 // initial scalar size to be allocated 21#define INIT_SIZE 32 // initial scalar size to be allocated
22#define INDENT_STEP 3 // spaces per indentation level 22#define INDENT_STEP 3 // spaces per indentation level
23 23
24#define UTF8_MAX_LEN 11 // for perls UTF-X: max. number of octets per character 24#define UTF8_MAX_LEN 11 // for perls UTF-X: max. number of octets per character
25#define SHORT_STRING_LEN 256 // special-case strings of up to this size 25#define SHORT_STRING_LEN 512 // special-case strings of up to this size
26 26
27#define SB do { 27#define SB do {
28#define SE } while (0) 28#define SE } while (0)
29 29
30static HV *json_stash; // JSON::XS:: 30static HV *json_stash; // JSON::XS::
1037 XPUSHs (decode_json (jsonstr, *SvJSON (self))); 1037 XPUSHs (decode_json (jsonstr, *SvJSON (self)));
1038 1038
1039PROTOTYPES: ENABLE 1039PROTOTYPES: ENABLE
1040 1040
1041void to_json (SV *scalar) 1041void to_json (SV *scalar)
1042 ALIAS:
1043 objToJson = 0
1042 PPCODE: 1044 PPCODE:
1043 XPUSHs (encode_json (scalar, F_UTF8)); 1045 XPUSHs (encode_json (scalar, F_UTF8));
1044 1046
1045void from_json (SV *jsonstr) 1047void from_json (SV *jsonstr)
1048 ALIAS:
1049 jsonToObj = 0
1046 PPCODE: 1050 PPCODE:
1047 XPUSHs (decode_json (jsonstr, F_UTF8)); 1051 XPUSHs (decode_json (jsonstr, F_UTF8));
1048 1052

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines