line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
/* XS part of JSON::Create. */ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
#include "EXTERN.h" |
4
|
|
|
|
|
|
|
#include "perl.h" |
5
|
|
|
|
|
|
|
#include "XSUB.h" |
6
|
|
|
|
|
|
|
#include "ppport.h" |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#include |
9
|
|
|
|
|
|
|
#include "unicode.h" |
10
|
|
|
|
|
|
|
#include "qsort-r.c" |
11
|
|
|
|
|
|
|
#include "json-create-perl.c" |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
#define PERLJCCALL(x) { \ |
14
|
|
|
|
|
|
|
json_create_status_t jcs; \ |
15
|
|
|
|
|
|
|
jcs = x; \ |
16
|
|
|
|
|
|
|
if (jcs != json_create_ok) { \ |
17
|
|
|
|
|
|
|
warn ("%s:%d: bad status %d from %s", \ |
18
|
|
|
|
|
|
|
__FILE__, __LINE__, jcs, #x); \ |
19
|
|
|
|
|
|
|
} \ |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
typedef json_create_t * JSON__Create; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
#define JCSET \ |
25
|
|
|
|
|
|
|
if (items > 1) { \ |
26
|
|
|
|
|
|
|
if ((items - 1) % 2 != 0) { \ |
27
|
|
|
|
|
|
|
warn ("odd number of arguments ignored"); \ |
28
|
|
|
|
|
|
|
} \ |
29
|
|
|
|
|
|
|
else { \ |
30
|
|
|
|
|
|
|
int i; \ |
31
|
|
|
|
|
|
|
for (i = 1; i < items; i += 2) { \ |
32
|
|
|
|
|
|
|
json_create_set (jc, ST(i), ST(i+1)); \ |
33
|
|
|
|
|
|
|
} \ |
34
|
|
|
|
|
|
|
} \ |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
MODULE=JSON::Create PACKAGE=JSON::Create |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
PROTOTYPES: DISABLE |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
SV * |
43
|
|
|
|
|
|
|
create_json (input, ...) |
44
|
|
|
|
|
|
|
SV * input; |
45
|
|
|
|
|
|
|
PREINIT: |
46
|
38
|
|
|
|
|
|
json_create_t jc_stack = {0}; |
47
|
38
|
|
|
|
|
|
json_create_t * jc = & jc_stack; |
48
|
|
|
|
|
|
|
CODE: |
49
|
40
|
100
|
|
|
|
|
JCSET; |
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
50
|
38
|
|
|
|
|
|
RETVAL = json_create_create (jc, input); |
51
|
|
|
|
|
|
|
OUTPUT: |
52
|
|
|
|
|
|
|
RETVAL |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
SV * |
55
|
|
|
|
|
|
|
create_json_strict (input, ...) |
56
|
|
|
|
|
|
|
SV * input; |
57
|
|
|
|
|
|
|
PREINIT: |
58
|
23
|
|
|
|
|
|
json_create_t jc_stack = {0}; |
59
|
23
|
|
|
|
|
|
json_create_t * jc = & jc_stack; |
60
|
|
|
|
|
|
|
CODE: |
61
|
23
|
50
|
|
|
|
|
JCSET; |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
62
|
23
|
|
|
|
|
|
jc_stack.strict = 1; |
63
|
23
|
|
|
|
|
|
RETVAL = json_create_create (jc, input); |
64
|
|
|
|
|
|
|
OUTPUT: |
65
|
|
|
|
|
|
|
RETVAL |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
void |
68
|
|
|
|
|
|
|
DESTROY (jc) |
69
|
|
|
|
|
|
|
JSON::Create jc; |
70
|
|
|
|
|
|
|
CODE: |
71
|
24
|
50
|
|
|
|
|
PERLJCCALL (json_create_free (jc)); |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
JSON::Create |
74
|
|
|
|
|
|
|
jcnew () |
75
|
|
|
|
|
|
|
CODE: |
76
|
24
|
50
|
|
|
|
|
PERLJCCALL (json_create_new (& RETVAL)); |
77
|
|
|
|
|
|
|
OUTPUT: |
78
|
|
|
|
|
|
|
RETVAL |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
SV * |
81
|
|
|
|
|
|
|
create (jc, input) |
82
|
|
|
|
|
|
|
JSON::Create jc; |
83
|
|
|
|
|
|
|
SV * input |
84
|
|
|
|
|
|
|
CODE: |
85
|
51
|
|
|
|
|
|
RETVAL = json_create_create (jc, input); |
86
|
|
|
|
|
|
|
OUTPUT: |
87
|
|
|
|
|
|
|
RETVAL |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
void |
90
|
|
|
|
|
|
|
sort (jc, onoff) |
91
|
|
|
|
|
|
|
JSON::Create jc; |
92
|
|
|
|
|
|
|
SV * onoff; |
93
|
|
|
|
|
|
|
CODE: |
94
|
|
|
|
|
|
|
#ifdef INDENT |
95
|
2
|
50
|
|
|
|
|
jc->sort = SvTRUE (onoff) ? 1 : 0; |
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
96
|
|
|
|
|
|
|
#endif |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
void |
99
|
|
|
|
|
|
|
cmp (jc, cmp) |
100
|
|
|
|
|
|
|
JSON::Create jc; |
101
|
|
|
|
|
|
|
SV * cmp; |
102
|
|
|
|
|
|
|
CODE: |
103
|
1
|
50
|
|
|
|
|
PERLJCCALL (json_create_remove_cmp (jc)); |
104
|
1
|
50
|
|
|
|
|
if (SvTRUE (cmp)) { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
105
|
1
|
|
|
|
|
|
jc->cmp = cmp; |
106
|
1
|
|
|
|
|
|
SvREFCNT_inc (cmp); |
107
|
1
|
|
|
|
|
|
jc->n_mallocs++; |
108
|
|
|
|
|
|
|
} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
void |
111
|
|
|
|
|
|
|
set_fformat_unsafe (jc, fformat) |
112
|
|
|
|
|
|
|
JSON::Create jc; |
113
|
|
|
|
|
|
|
SV * fformat; |
114
|
|
|
|
|
|
|
CODE: |
115
|
4
|
50
|
|
|
|
|
PERLJCCALL (json_create_set_fformat (jc, fformat)); |
116
|
|
|
|
|
|
|
OUTPUT: |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
void |
119
|
|
|
|
|
|
|
escape_slash (jc, onoff) |
120
|
|
|
|
|
|
|
JSON::Create jc; |
121
|
|
|
|
|
|
|
SV * onoff; |
122
|
|
|
|
|
|
|
CODE: |
123
|
2
|
50
|
|
|
|
|
jc->escape_slash = SvTRUE (onoff) ? 1 : 0; |
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
void |
126
|
|
|
|
|
|
|
unicode_upper (jc, onoff) |
127
|
|
|
|
|
|
|
JSON::Create jc; |
128
|
|
|
|
|
|
|
SV * onoff; |
129
|
|
|
|
|
|
|
CODE: |
130
|
3
|
50
|
|
|
|
|
jc->unicode_upper = SvTRUE (onoff) ? 1 : 0; |
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
void |
133
|
|
|
|
|
|
|
unicode_escape_all (jc, onoff) |
134
|
|
|
|
|
|
|
JSON::Create jc; |
135
|
|
|
|
|
|
|
SV * onoff; |
136
|
|
|
|
|
|
|
CODE: |
137
|
3
|
50
|
|
|
|
|
jc->unicode_escape_all = SvTRUE (onoff) ? 1 : 0; |
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
void |
140
|
|
|
|
|
|
|
set_validate (jc, onoff) |
141
|
|
|
|
|
|
|
JSON::Create jc; |
142
|
|
|
|
|
|
|
SV * onoff; |
143
|
|
|
|
|
|
|
CODE: |
144
|
1
|
50
|
|
|
|
|
jc->validate = SvTRUE (onoff) ? 1 : 0; |
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
void |
147
|
|
|
|
|
|
|
no_javascript_safe (jc, onoff) |
148
|
|
|
|
|
|
|
JSON::Create jc; |
149
|
|
|
|
|
|
|
SV * onoff; |
150
|
|
|
|
|
|
|
CODE: |
151
|
2
|
50
|
|
|
|
|
jc->no_javascript_safe = SvTRUE (onoff) ? 1 : 0; |
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
void |
154
|
|
|
|
|
|
|
fatal_errors (jc, onoff) |
155
|
|
|
|
|
|
|
JSON::Create jc; |
156
|
|
|
|
|
|
|
SV * onoff; |
157
|
|
|
|
|
|
|
CODE: |
158
|
4
|
50
|
|
|
|
|
jc->fatal_errors = SvTRUE (onoff) ? 1 : 0; |
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
void |
161
|
|
|
|
|
|
|
replace_bad_utf8 (jc, onoff) |
162
|
|
|
|
|
|
|
JSON::Create jc; |
163
|
|
|
|
|
|
|
SV * onoff; |
164
|
|
|
|
|
|
|
CODE: |
165
|
1
|
50
|
|
|
|
|
jc->replace_bad_utf8 = SvTRUE (onoff) ? 1 : 0; |
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
void |
168
|
|
|
|
|
|
|
downgrade_utf8 (jc, onoff) |
169
|
|
|
|
|
|
|
JSON::Create jc; |
170
|
|
|
|
|
|
|
SV * onoff; |
171
|
|
|
|
|
|
|
CODE: |
172
|
2
|
50
|
|
|
|
|
jc->downgrade_utf8 = SvTRUE (onoff) ? 1 : 0; |
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
void |
175
|
|
|
|
|
|
|
strict (jc, onoff) |
176
|
|
|
|
|
|
|
JSON::Create jc; |
177
|
|
|
|
|
|
|
SV * onoff; |
178
|
|
|
|
|
|
|
CODE: |
179
|
2
|
50
|
|
|
|
|
jc->strict = SvTRUE (onoff) ? 1 : 0; |
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
void |
182
|
|
|
|
|
|
|
indent (jc, onoff) |
183
|
|
|
|
|
|
|
JSON::Create jc; |
184
|
|
|
|
|
|
|
SV * onoff; |
185
|
|
|
|
|
|
|
CODE: |
186
|
|
|
|
|
|
|
#ifdef INDENT |
187
|
3
|
50
|
|
|
|
|
jc->indent = SvTRUE (onoff) ? 1 : 0; |
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
188
|
|
|
|
|
|
|
#endif |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
HV * |
191
|
|
|
|
|
|
|
get_handlers (jc) |
192
|
|
|
|
|
|
|
JSON::Create jc |
193
|
|
|
|
|
|
|
CODE: |
194
|
8
|
100
|
|
|
|
|
if (! jc->handlers) { |
195
|
5
|
|
|
|
|
|
jc->handlers = newHV(); |
196
|
5
|
|
|
|
|
|
jc->n_mallocs++; |
197
|
|
|
|
|
|
|
} |
198
|
8
|
|
|
|
|
|
RETVAL = jc->handlers; |
199
|
|
|
|
|
|
|
OUTPUT: |
200
|
|
|
|
|
|
|
RETVAL |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
void |
203
|
|
|
|
|
|
|
obj_handler (jc, oh = & PL_sv_undef) |
204
|
|
|
|
|
|
|
JSON::Create jc; |
205
|
|
|
|
|
|
|
SV * oh; |
206
|
|
|
|
|
|
|
CODE: |
207
|
|
|
|
|
|
|
/* Remove a previous ref handler, if it exists. */ |
208
|
1
|
50
|
|
|
|
|
PERLJCCALL (json_create_remove_obj_handler (jc)); |
209
|
1
|
50
|
|
|
|
|
if (SvTRUE (oh)) { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
210
|
1
|
|
|
|
|
|
set_object_handler (jc, oh); |
211
|
|
|
|
|
|
|
} |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
void |
214
|
|
|
|
|
|
|
non_finite_handler (jc, oh = & PL_sv_undef) |
215
|
|
|
|
|
|
|
JSON::Create jc; |
216
|
|
|
|
|
|
|
SV * oh; |
217
|
|
|
|
|
|
|
CODE: |
218
|
|
|
|
|
|
|
/* Remove a previous ref handler, if it exists. */ |
219
|
1
|
50
|
|
|
|
|
PERLJCCALL (json_create_remove_non_finite_handler (jc)); |
220
|
1
|
50
|
|
|
|
|
if (SvTRUE (oh)) { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
221
|
1
|
|
|
|
|
|
set_non_finite_handler (jc, oh); |
222
|
|
|
|
|
|
|
} |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
void |
225
|
|
|
|
|
|
|
set (jc, ...) |
226
|
|
|
|
|
|
|
JSON::Create jc; |
227
|
|
|
|
|
|
|
CODE: |
228
|
29
|
100
|
|
|
|
|
JCSET; |
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
void |
231
|
|
|
|
|
|
|
set_handlers (jc, handlers) |
232
|
|
|
|
|
|
|
JSON::Create jc |
233
|
|
|
|
|
|
|
HV * handlers |
234
|
|
|
|
|
|
|
CODE: |
235
|
0
|
0
|
|
|
|
|
PERLJCCALL (json_create_remove_handlers (jc)); |
236
|
0
|
|
|
|
|
|
SvREFCNT_inc ((SV*) handlers); |
237
|
0
|
|
|
|
|
|
jc->n_mallocs++; |
238
|
0
|
|
|
|
|
|
jc->handlers = handlers; |
239
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
void |
241
|
|
|
|
|
|
|
type_handler (jc, crh = & PL_sv_undef) |
242
|
|
|
|
|
|
|
JSON::Create jc; |
243
|
|
|
|
|
|
|
SV * crh; |
244
|
|
|
|
|
|
|
CODE: |
245
|
|
|
|
|
|
|
/* Remove a previous ref handler, if it exists. */ |
246
|
2
|
50
|
|
|
|
|
PERLJCCALL (json_create_remove_type_handler (jc)); |
247
|
2
|
50
|
|
|
|
|
if (SvTRUE (crh)) { |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
248
|
2
|
|
|
|
|
|
set_type_handler (jc, crh); |
249
|
|
|
|
|
|
|
} |
250
|
|
|
|
|
|
|
|