Lines Matching refs:uc

72 json_isspace(const unsigned char uc)
74 switch (uc) {
86 json_isdigit(unsigned char uc)
88 switch (uc) {
98 json_isxdigit(unsigned char uc)
100 if (json_isdigit(uc))
102 switch (uc) {
112 json_skip_space(const unsigned char *uc, const unsigned char *ue)
114 while (uc < ue && json_isspace(*uc))
115 uc++;
116 return uc;
122 const unsigned char *uc = *ucp;
125 DPRINTF("Parse string: ", uc, *ucp);
126 while (uc < ue) {
127 switch (*uc++) {
131 if (uc == ue)
133 switch (*uc++) {
146 if (ue - uc < 4) {
147 uc = ue;
151 if (!json_isxdigit(*uc++))
158 *ucp = uc;
159 DPRINTF("Good string: ", uc, *ucp);
166 DPRINTF("Bad string: ", uc, *ucp);
167 *ucp = uc;
175 const unsigned char *uc = *ucp;
177 DPRINTF("Parse array: ", uc, *ucp);
178 while (uc < ue) {
179 if (*uc == ']')
181 if (!json_parse(&uc, ue, st, lvl + 1))
183 if (uc == ue)
185 switch (*uc) {
187 uc++;
192 *ucp = uc + 1;
193 DPRINTF("Good array: ", uc, *ucp);
200 DPRINTF("Bad array: ", uc, *ucp);
201 *ucp = uc;
209 const unsigned char *uc = *ucp;
210 DPRINTF("Parse object: ", uc, *ucp);
211 while (uc < ue) {
212 uc = json_skip_space(uc, ue);
213 if (uc == ue)
215 if (*uc == '}') {
216 uc++;
219 if (*uc++ != '"') {
220 DPRINTF("not string", uc, *ucp);
223 DPRINTF("next field", uc, *ucp);
224 if (!json_parse_string(&uc, ue)) {
225 DPRINTF("not string", uc, *ucp);
228 uc = json_skip_space(uc, ue);
229 if (uc == ue)
231 if (*uc++ != ':') {
232 DPRINTF("not colon", uc, *ucp);
235 if (!json_parse(&uc, ue, st, lvl + 1)) {
236 DPRINTF("not json", uc, *ucp);
239 if (uc == ue)
241 switch (*uc++) {
246 *ucp = uc;
247 DPRINTF("Good object: ", uc, *ucp);
250 *ucp = uc - 1;
251 DPRINTF("not more", uc, *ucp);
256 DPRINTF("Bad object: ", uc, *ucp);
257 *ucp = uc;
264 const unsigned char *uc = *ucp;
267 DPRINTF("Parse number: ", uc, *ucp);
268 if (uc == ue)
270 if (*uc == '-')
271 uc++;
273 for (; uc < ue; uc++) {
274 if (!json_isdigit(*uc))
278 if (uc == ue)
280 if (*uc == '.')
281 uc++;
282 for (; uc < ue; uc++) {
283 if (!json_isdigit(*uc))
287 if (uc == ue)
289 if (got && (*uc == 'e' || *uc == 'E')) {
290 uc++;
292 if (uc == ue)
294 if (*uc == '+' || *uc == '-')
295 uc++;
296 for (; uc < ue; uc++) {
297 if (!json_isdigit(*uc))
304 DPRINTF("Bad number: ", uc, *ucp);
306 DPRINTF("Good number: ", uc, *ucp);
307 *ucp = uc;
315 const unsigned char *uc = *ucp;
317 DPRINTF("Parse const: ", uc, *ucp);
318 for (len--; uc < ue && --len;) {
319 if (*uc++ == *++str)
323 DPRINTF("Bad const: ", uc, *ucp);
324 *ucp = uc;
332 const unsigned char *uc;
336 uc = json_skip_space(*ucp, ue);
337 if (uc == ue)
349 DPRINTF("Parse general: ", uc, *ucp);
350 switch (*uc++) {
352 rv = json_parse_string(&uc, ue);
356 rv = json_parse_array(&uc, ue, st, lvl + 1);
360 rv = json_parse_object(&uc, ue, st, lvl + 1);
364 rv = json_parse_const(&uc, ue, "true", sizeof("true"));
368 rv = json_parse_const(&uc, ue, "false", sizeof("false"));
372 rv = json_parse_const(&uc, ue, "null", sizeof("null"));
376 --uc;
377 rv = json_parse_number(&uc, ue);
383 uc = json_skip_space(uc, ue);
385 *ucp = uc;
386 DPRINTF("End general: ", uc, *ucp);
396 const unsigned char *uc = CAST(const unsigned char *, b->fbuf);
397 const unsigned char *ue = uc + b->flen;
407 if (!json_parse(&uc, ue, st, 0))