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.137 by root, Sun Feb 24 04:21:05 2019 UTC vs.
Revision 1.138 by root, Wed Mar 6 07:21:17 2019 UTC

2206 XPUSHs (ST (0)); 2206 XPUSHs (ST (0));
2207} 2207}
2208 2208
2209void encode (JSON *self, SV *scalar) 2209void encode (JSON *self, SV *scalar)
2210 PPCODE: 2210 PPCODE:
2211 PUTBACK; XPUSHs (encode_json (scalar, self)); 2211 PUTBACK; scalar = encode_json (scalar, self); SPAGAIN;
2212 XPUSHs (scalar);
2212 2213
2213void decode (JSON *self, SV *jsonstr) 2214void decode (JSON *self, SV *jsonstr)
2214 PPCODE: 2215 PPCODE:
2215 PUTBACK; XPUSHs (decode_json (jsonstr, self, 0)); 2216 PUTBACK; jsonstr = decode_json (jsonstr, self, 0); SPAGAIN;
2217 XPUSHs (jsonstr);
2216 2218
2217void decode_prefix (JSON *self, SV *jsonstr) 2219void decode_prefix (JSON *self, SV *jsonstr)
2218 PPCODE: 2220 PPCODE:
2219{ 2221{
2220 SV *sv; 2222 SV *sv;
2221 STRLEN offset; 2223 STRLEN offset;
2222 PUTBACK; sv = decode_json (jsonstr, self, &offset); 2224 PUTBACK; sv = decode_json (jsonstr, self, &offset); SPAGAIN;
2223 EXTEND (SP, 2); 2225 EXTEND (SP, 2);
2224 PUSHs (sv); 2226 PUSHs (sv);
2225 PUSHs (sv_2mortal (newSVuv (ptr_to_index (jsonstr, SvPV_nolen (jsonstr) + offset)))); 2227 PUSHs (sv_2mortal (newSVuv (ptr_to_index (jsonstr, SvPV_nolen (jsonstr) + offset))));
2226} 2228}
2227 2229
2300 2302
2301 break; 2303 break;
2302 } 2304 }
2303 } 2305 }
2304 2306
2305 PUTBACK; sv = decode_json (self->incr_text, self, &offset); 2307 PUTBACK; sv = decode_json (self->incr_text, self, &offset); SPAGAIN;
2306 XPUSHs (sv); 2308 XPUSHs (sv);
2307 2309
2308 self->incr_pos -= offset; 2310 self->incr_pos -= offset;
2309 self->incr_nest = 0; 2311 self->incr_nest = 0;
2310 self->incr_mode = 0; 2312 self->incr_mode = 0;
2362 PPCODE: 2364 PPCODE:
2363{ 2365{
2364 JSON json; 2366 JSON json;
2365 json_init (&json); 2367 json_init (&json);
2366 json.flags |= F_UTF8; 2368 json.flags |= F_UTF8;
2367 PUTBACK; XPUSHs (encode_json (scalar, &json)); 2369 PUTBACK; scalar = encode_json (scalar, &json); SPAGAIN;
2370 XPUSHs (scalar);
2368} 2371}
2369 2372
2370void decode_json (SV *jsonstr) 2373void decode_json (SV *jsonstr)
2371 PPCODE: 2374 PPCODE:
2372{ 2375{
2373 JSON json; 2376 JSON json;
2374 json_init (&json); 2377 json_init (&json);
2375 json.flags |= F_UTF8; 2378 json.flags |= F_UTF8;
2376 PUTBACK; XPUSHs (decode_json (jsonstr, &json, 0)); 2379 PUTBACK; jsonstr = decode_json (jsonstr, &json, 0); SPAGAIN;
2380 XPUSHs (jsonstr);
2377} 2381}
2378 2382

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines