Lines Matching refs:p

115 static void nxt_conf_object_hash_free(void *data, void *p);
133 static u_char *nxt_conf_json_print_string(u_char *p, nxt_conf_value_t *value);
136 static u_char *nxt_conf_json_print_array(u_char *p, nxt_conf_value_t *value,
140 static u_char *nxt_conf_json_print_object(u_char *p, nxt_conf_value_t *value,
143 static size_t nxt_conf_json_escape_length(u_char *p, size_t size);
147 #define nxt_conf_json_newline(p) \ argument
148 ((p)[0] = '\r', (p)[1] = '\n', (p) + 2)
152 nxt_conf_json_indentation(u_char *p, uint32_t level) in nxt_conf_json_indentation() argument
155 *p++ = '\t'; in nxt_conf_json_indentation()
159 return p; in nxt_conf_json_indentation()
313 u_char *p, *end; in nxt_conf_set_member_integer() local
320 p = member->value.u.number; in nxt_conf_set_member_integer()
321 end = p + NXT_CONF_MAX_NUMBER_LEN; in nxt_conf_set_member_integer()
323 end = nxt_sprintf(p, end, "%L", value); in nxt_conf_set_member_integer()
495 u_char *p, *start, *end; in nxt_conf_path_next_token() local
500 p = start; in nxt_conf_path_next_token()
502 while (p < parse->end && *p != '/') { in nxt_conf_path_next_token()
503 p++; in nxt_conf_path_next_token()
506 parse->start = p; in nxt_conf_path_next_token()
507 parse->last = (p >= parse->end); in nxt_conf_path_next_token()
509 length = p - start; in nxt_conf_path_next_token()
1231 u_char *p; in nxt_conf_json_parse() local
1239 p = nxt_conf_json_skip_space(start, end); in nxt_conf_json_parse()
1241 if (nxt_slow_path(p == end)) { in nxt_conf_json_parse()
1252 p = nxt_conf_json_parse_value(mp, value, p, end, error); in nxt_conf_json_parse()
1254 if (nxt_slow_path(p == NULL)) { in nxt_conf_json_parse()
1258 p = nxt_conf_json_skip_space(p, end); in nxt_conf_json_parse()
1260 if (nxt_slow_path(p != end)) { in nxt_conf_json_parse()
1262 nxt_conf_json_parse_error(error, p, in nxt_conf_json_parse()
1276 u_char *p, ch; in nxt_conf_json_skip_space() local
1288 for (p = start; nxt_fast_path(p != end); p++) { in nxt_conf_json_skip_space()
1289 ch = *p; in nxt_conf_json_skip_space()
1301 start = p; in nxt_conf_json_skip_space()
1354 return p; in nxt_conf_json_skip_space()
1362 u_char ch, *p; in nxt_conf_json_parse_value() local
1420 p = nxt_conf_json_parse_number(mp, value, start, end, error); in nxt_conf_json_parse_value()
1422 if (nxt_slow_path(p == NULL)) { in nxt_conf_json_parse_value()
1426 if (p == end) { in nxt_conf_json_parse_value()
1430 switch (*p) { in nxt_conf_json_parse_value()
1442 return p; in nxt_conf_json_parse_value()
1472 u_char *p, *name; in nxt_conf_json_parse_object() local
1489 p = start; in nxt_conf_json_parse_object()
1492 p = nxt_conf_json_skip_space(p + 1, end); in nxt_conf_json_parse_object()
1494 if (nxt_slow_path(p == end)) { in nxt_conf_json_parse_object()
1496 nxt_conf_json_parse_error(error, p, in nxt_conf_json_parse_object()
1504 if (*p != '"') { in nxt_conf_json_parse_object()
1505 if (nxt_fast_path(*p == '}')) { in nxt_conf_json_parse_object()
1509 nxt_conf_json_parse_error(error, p, in nxt_conf_json_parse_object()
1518 name = p; in nxt_conf_json_parse_object()
1527 p = nxt_conf_json_parse_string(mp, &member->name, p, end, error); in nxt_conf_json_parse_object()
1529 if (nxt_slow_path(p == NULL)) { in nxt_conf_json_parse_object()
1547 p = nxt_conf_json_skip_space(p, end); in nxt_conf_json_parse_object()
1549 if (nxt_slow_path(p == end)) { in nxt_conf_json_parse_object()
1551 nxt_conf_json_parse_error(error, p, in nxt_conf_json_parse_object()
1559 if (nxt_slow_path(*p != ':')) { in nxt_conf_json_parse_object()
1561 nxt_conf_json_parse_error(error, p, in nxt_conf_json_parse_object()
1569 p = nxt_conf_json_skip_space(p + 1, end); in nxt_conf_json_parse_object()
1571 if (nxt_slow_path(p == end)) { in nxt_conf_json_parse_object()
1573 nxt_conf_json_parse_error(error, p, in nxt_conf_json_parse_object()
1581 p = nxt_conf_json_parse_value(mp, &member->value, p, end, error); in nxt_conf_json_parse_object()
1583 if (nxt_slow_path(p == NULL)) { in nxt_conf_json_parse_object()
1587 p = nxt_conf_json_skip_space(p, end); in nxt_conf_json_parse_object()
1589 if (nxt_slow_path(p == end)) { in nxt_conf_json_parse_object()
1591 nxt_conf_json_parse_error(error, p, in nxt_conf_json_parse_object()
1599 if (*p != ',') { in nxt_conf_json_parse_object()
1600 if (nxt_fast_path(*p == '}')) { in nxt_conf_json_parse_object()
1604 nxt_conf_json_parse_error(error, p, in nxt_conf_json_parse_object()
1640 return p + 1; in nxt_conf_json_parse_object()
1689 nxt_conf_object_hash_free(void *data, void *p) in nxt_conf_object_hash_free() argument
1691 nxt_mp_free(data, p); in nxt_conf_object_hash_free()
1699 u_char *p; in nxt_conf_json_parse_array() local
1717 p = start; in nxt_conf_json_parse_array()
1720 p = nxt_conf_json_skip_space(p + 1, end); in nxt_conf_json_parse_array()
1722 if (nxt_slow_path(p == end)) { in nxt_conf_json_parse_array()
1724 nxt_conf_json_parse_error(error, p, in nxt_conf_json_parse_array()
1732 if (*p == ']') { in nxt_conf_json_parse_array()
1743 p = nxt_conf_json_parse_value(mp, element, p, end, error); in nxt_conf_json_parse_array()
1745 if (nxt_slow_path(p == NULL)) { in nxt_conf_json_parse_array()
1749 p = nxt_conf_json_skip_space(p, end); in nxt_conf_json_parse_array()
1751 if (nxt_slow_path(p == end)) { in nxt_conf_json_parse_array()
1753 nxt_conf_json_parse_error(error, p, in nxt_conf_json_parse_array()
1761 if (*p != ',') { in nxt_conf_json_parse_array()
1762 if (nxt_fast_path(*p == ']')) { in nxt_conf_json_parse_array()
1766 nxt_conf_json_parse_error(error, p, in nxt_conf_json_parse_array()
1794 return p + 1; in nxt_conf_json_parse_array()
1807 u_char *p, ch, *last, *s; in nxt_conf_json_parse_string() local
1825 for (p = start; nxt_fast_path(p != end); p++) { in nxt_conf_json_parse_string()
1826 ch = *p; in nxt_conf_json_parse_string()
1845 nxt_conf_json_parse_error(error, p, in nxt_conf_json_parse_string()
1880 nxt_conf_json_parse_error(error, p - 1, in nxt_conf_json_parse_string()
1900 nxt_conf_json_parse_error(error, p, in nxt_conf_json_parse_string()
1912 if (nxt_slow_path(p == end)) { in nxt_conf_json_parse_string()
1914 nxt_conf_json_parse_error(error, p, in nxt_conf_json_parse_string()
1923 last = p; in nxt_conf_json_parse_string()
1962 p = start; in nxt_conf_json_parse_string()
1965 ch = *p++; in nxt_conf_json_parse_string()
1972 ch = *p++; in nxt_conf_json_parse_string()
2007 utf = (utf << 4) | (p[i] >= 'A' ? 10 + ((p[i] & ~0x20) - 'A') in nxt_conf_json_parse_string()
2008 : p[i] - '0'); in nxt_conf_json_parse_string()
2011 p += 4; in nxt_conf_json_parse_string()
2016 nxt_conf_json_parse_error(error, p - 12, in nxt_conf_json_parse_string()
2033 if (utf > 0xDBFF || p[0] != '\\' || p[1] != 'u') { in nxt_conf_json_parse_string()
2035 nxt_conf_json_parse_error(error, p - 6, in nxt_conf_json_parse_string()
2043 p += 2; in nxt_conf_json_parse_string()
2051 } while (p != last); in nxt_conf_json_parse_string()
2068 u_char *p, *s, ch, c, *dot_pos; in nxt_conf_json_parse_number() local
2081 for (p = s; nxt_fast_path(p != end); p++) { in nxt_conf_json_parse_number()
2082 ch = *p; in nxt_conf_json_parse_number()
2089 dot_pos = p; in nxt_conf_json_parse_number()
2098 if (nxt_slow_path(p - dot_pos <= 1)) { in nxt_conf_json_parse_number()
2108 dot_pos = p; in nxt_conf_json_parse_number()
2121 p++; in nxt_conf_json_parse_number()
2122 s = p; in nxt_conf_json_parse_number()
2131 for (p = s; nxt_fast_path(p != end); p++) { in nxt_conf_json_parse_number()
2132 ch = *p; in nxt_conf_json_parse_number()
2143 if (nxt_slow_path(p == s)) { in nxt_conf_json_parse_number()
2153 size = p - start; in nxt_conf_json_parse_number()
2192 return p; in nxt_conf_json_parse_number()
2242 nxt_conf_json_print(u_char *p, nxt_conf_value_t *value, in nxt_conf_json_print() argument
2248 return nxt_cpymem(p, "null", 4); in nxt_conf_json_print()
2251 return value->u.boolean ? nxt_cpymem(p, "true", 4) in nxt_conf_json_print()
2252 : nxt_cpymem(p, "false", 5); in nxt_conf_json_print()
2256 return nxt_cpystr(p, value->u.number); in nxt_conf_json_print()
2260 return nxt_conf_json_print_string(p, value); in nxt_conf_json_print()
2263 return nxt_conf_json_print_array(p, value, pretty); in nxt_conf_json_print()
2266 return nxt_conf_json_print_object(p, value, pretty); in nxt_conf_json_print()
2271 return p; in nxt_conf_json_print()
2287 nxt_conf_json_print_string(u_char *p, nxt_conf_value_t *value) in nxt_conf_json_print_string() argument
2293 *p++ = '"'; in nxt_conf_json_print_string()
2295 p = nxt_conf_json_escape(p, str.start, str.length); in nxt_conf_json_print_string()
2297 *p++ = '"'; in nxt_conf_json_print_string()
2299 return p; in nxt_conf_json_print_string()
2346 nxt_conf_json_print_array(u_char *p, nxt_conf_value_t *value, in nxt_conf_json_print_array() argument
2354 *p++ = '['; in nxt_conf_json_print_array()
2360 p = nxt_conf_json_newline(p); in nxt_conf_json_print_array()
2363 p = nxt_conf_json_indentation(p, pretty->level); in nxt_conf_json_print_array()
2366 p = nxt_conf_json_print(p, &value[0], pretty); in nxt_conf_json_print_array()
2369 *p++ = ','; in nxt_conf_json_print_array()
2372 p = nxt_conf_json_newline(p); in nxt_conf_json_print_array()
2373 p = nxt_conf_json_indentation(p, pretty->level); in nxt_conf_json_print_array()
2378 p = nxt_conf_json_print(p, &value[n], pretty); in nxt_conf_json_print_array()
2382 p = nxt_conf_json_newline(p); in nxt_conf_json_print_array()
2385 p = nxt_conf_json_indentation(p, pretty->level); in nxt_conf_json_print_array()
2391 *p++ = ']'; in nxt_conf_json_print_array()
2393 return p; in nxt_conf_json_print_array()
2442 nxt_conf_json_print_object(u_char *p, nxt_conf_value_t *value, in nxt_conf_json_print_object() argument
2451 *p++ = '{'; in nxt_conf_json_print_object()
2456 p = nxt_conf_json_newline(p); in nxt_conf_json_print_object()
2466 p = nxt_conf_json_indentation(p, pretty->level); in nxt_conf_json_print_object()
2469 p = nxt_conf_json_print_string(p, &member[n].name); in nxt_conf_json_print_object()
2471 *p++ = ':'; in nxt_conf_json_print_object()
2474 *p++ = ' '; in nxt_conf_json_print_object()
2477 p = nxt_conf_json_print(p, &member[n].value, pretty); in nxt_conf_json_print_object()
2485 *p++ = ','; in nxt_conf_json_print_object()
2488 p = nxt_conf_json_newline(p); in nxt_conf_json_print_object()
2492 p = nxt_conf_json_newline(p); in nxt_conf_json_print_object()
2498 p = nxt_conf_json_newline(p); in nxt_conf_json_print_object()
2501 p = nxt_conf_json_indentation(p, pretty->level); in nxt_conf_json_print_object()
2507 *p++ = '}'; in nxt_conf_json_print_object()
2509 return p; in nxt_conf_json_print_object()
2514 nxt_conf_json_escape_length(u_char *p, size_t size) in nxt_conf_json_escape_length() argument
2522 ch = *p++; in nxt_conf_json_escape_length()
2611 u_char *p; in nxt_conf_json_position() local
2617 for (p = start; p != pos; p++) { in nxt_conf_json_position()
2619 if (*p != '\n') { in nxt_conf_json_position()
2624 start = p + 1; in nxt_conf_json_position()
2627 symbols = nxt_utf8_length(start, p - start); in nxt_conf_json_position()