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.58 by root, Mon Aug 13 16:06:25 2007 UTC vs.
Revision 1.59 by root, Mon Aug 13 16:14:20 2007 UTC

60#define expect_false(expr) expect ((expr) != 0, 0) 60#define expect_false(expr) expect ((expr) != 0, 0)
61#define expect_true(expr) expect ((expr) != 0, 1) 61#define expect_true(expr) expect ((expr) != 0, 1)
62 62
63#ifdef USE_ITHREADS 63#ifdef USE_ITHREADS
64# define JSON_SLOW 1 64# define JSON_SLOW 1
65# define JSON_STASH (json_stash ? json_stash : gv_stashpv ("JSON::XS", 1))
65#else 66#else
66# define JSON_SLOW 0 67# define JSON_SLOW 0
68# define JSON_STASH json_stash
67#endif 69#endif
68 70
69static HV *json_stash, *json_boolean_stash; // JSON::XS:: 71static HV *json_stash, *json_boolean_stash; // JSON::XS::
70static SV *json_true, *json_false; 72static SV *json_true, *json_false;
71 73
1378 json_boolean_stash = 0; 1380 json_boolean_stash = 0;
1379 1381
1380void new (char *klass) 1382void new (char *klass)
1381 PPCODE: 1383 PPCODE:
1382{ 1384{
1383 HV *stash = !JSON_SLOW || json_stash
1384 ? json_stash
1385 : gv_stashpv ("JSON::XS", 1);
1386 SV *pv = NEWSV (0, sizeof (JSON)); 1385 SV *pv = NEWSV (0, sizeof (JSON));
1387 SvPOK_only (pv); 1386 SvPOK_only (pv);
1388 Zero (SvPVX (pv), 1, JSON); 1387 Zero (SvPVX (pv), 1, JSON);
1389 ((JSON *)SvPVX (pv))->flags = F_DEFAULT; 1388 ((JSON *)SvPVX (pv))->flags = F_DEFAULT;
1390 XPUSHs (sv_2mortal (sv_bless (newRV_noinc (pv), stash))); 1389 XPUSHs (sv_2mortal (sv_bless (newRV_noinc (pv), JSON_STASH)));
1391} 1390}
1392 1391
1393void ascii (JSON *self, int enable = 1) 1392void ascii (JSON *self, int enable = 1)
1394 ALIAS: 1393 ALIAS:
1395 ascii = F_ASCII 1394 ascii = F_ASCII

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines