Lines Matching refs:ret

1090 	int ret;  in obj_parse()  local
1116 ret = decode_value(obj, &descr[i], &kv.value, in obj_parse()
1118 if (ret < 0) { in obj_parse()
1119 return ret; in obj_parse()
1128 ret = skip_field(obj, &kv); in obj_parse()
1129 if (ret < 0) { in obj_parse()
1130 return ret; in obj_parse()
1143 int64_t ret; in json_obj_parse() local
1145 __ASSERT_NO_MSG(descr_len < (sizeof(ret) * CHAR_BIT - 1)); in json_obj_parse()
1147 ret = obj_init(&obj, payload, len); in json_obj_parse()
1148 if (ret < 0) { in json_obj_parse()
1149 return ret; in json_obj_parse()
1159 int ret; in json_arr_parse() local
1161 ret = arr_init(&arr, payload, len); in json_arr_parse()
1162 if (ret < 0) { in json_arr_parse()
1163 return ret; in json_arr_parse()
1229 int ret = 0; in json_escape_internal() local
1232 return ret; in json_escape_internal()
1235 for (cur = str; ret == 0 && *cur; cur++) { in json_escape_internal()
1241 ret = append_bytes(bytes, 2, data); in json_escape_internal()
1243 ret = append_bytes(cur, 1, data); in json_escape_internal()
1247 return ret; in json_escape_internal()
1320 int ret; in arr_encode() local
1322 ret = append_bytes("[", 1, data); in arr_encode()
1323 if (ret < 0) { in arr_encode()
1324 return ret; in arr_encode()
1350 ret = encode(elem_descr, (char *)field - elem_descr->offset, in arr_encode()
1352 if (ret < 0) { in arr_encode()
1353 return ret; in arr_encode()
1357 ret = append_bytes(",", 1, data); in arr_encode()
1358 if (ret < 0) { in arr_encode()
1359 return ret; in arr_encode()
1372 int ret; in str_encode() local
1374 ret = append_bytes("\"", 1, data); in str_encode()
1375 if (ret < 0) { in str_encode()
1376 return ret; in str_encode()
1379 ret = json_escape_internal(str, append_bytes, data); in str_encode()
1380 if (!ret) { in str_encode()
1384 return ret; in str_encode()
1391 int ret; in int32_encode() local
1393 ret = snprintk(buf, sizeof(buf), "%d", *num); in int32_encode()
1394 if (ret < 0) { in int32_encode()
1395 return ret; in int32_encode()
1397 if (ret >= (int)sizeof(buf)) { in int32_encode()
1401 return append_bytes(buf, (size_t)ret, data); in int32_encode()
1408 int ret; in uint32_encode() local
1410 ret = snprintk(buf, sizeof(buf), "%u", *num); in uint32_encode()
1411 if (ret < 0) { in uint32_encode()
1412 return ret; in uint32_encode()
1414 if (ret >= (int)sizeof(buf)) { in uint32_encode()
1418 return append_bytes(buf, (size_t)ret, data); in uint32_encode()
1425 int ret; in int64_encode() local
1427 ret = snprintk(buf, sizeof(buf), "%" PRId64, *num); in int64_encode()
1428 if (ret < 0) { in int64_encode()
1429 return ret; in int64_encode()
1431 if (ret >= (int)sizeof(buf)) { in int64_encode()
1435 return append_bytes(buf, (size_t)ret, data); in int64_encode()
1442 int ret; in uint64_encode() local
1444 ret = snprintk(buf, sizeof(buf), "%" PRIu64, *num); in uint64_encode()
1445 if (ret < 0) { in uint64_encode()
1446 return ret; in uint64_encode()
1448 if (ret >= (int)sizeof(buf)) { in uint64_encode()
1452 return append_bytes(buf, (size_t)ret, data); in uint64_encode()
1483 int ret; in float_encode() local
1485 ret = print_double(buf, sizeof(buf), "%.9g", (double)*num); in float_encode()
1487 if (ret < 0) { in float_encode()
1488 return ret; in float_encode()
1490 if (ret >= (int)sizeof(buf)) { in float_encode()
1494 return append_bytes(buf, (size_t)ret, data); in float_encode()
1500 int ret; in double_encode() local
1502 ret = print_double(buf, sizeof(buf), "%.16g", *num); in double_encode()
1504 if (ret < 0) { in double_encode()
1505 return ret; in double_encode()
1507 if (ret >= (int)sizeof(buf)) { in double_encode()
1511 return append_bytes(buf, (size_t)ret, data); in double_encode()
1590 int ret; in opaque_string_encode() local
1592 ret = append_bytes("\"", 1, data); in opaque_string_encode()
1593 if (ret < 0) { in opaque_string_encode()
1594 return ret; in opaque_string_encode()
1597 ret = append_bytes(opaque->start, opaque->length, data); in opaque_string_encode()
1598 if (ret < 0) { in opaque_string_encode()
1599 return ret; in opaque_string_encode()
1675 int ret; in json_obj_encode() local
1677 ret = append_bytes("{", 1, data); in json_obj_encode()
1678 if (ret < 0) { in json_obj_encode()
1679 return ret; in json_obj_encode()
1683 ret = str_encode(descr[i].field_name, append_bytes, data); in json_obj_encode()
1684 if (ret < 0) { in json_obj_encode()
1685 return ret; in json_obj_encode()
1688 ret = append_bytes(":", 1, data); in json_obj_encode()
1689 if (ret < 0) { in json_obj_encode()
1690 return ret; in json_obj_encode()
1693 ret = encode(&descr[i], val, append_bytes, data); in json_obj_encode()
1694 if (ret < 0) { in json_obj_encode()
1695 return ret; in json_obj_encode()
1699 ret = append_bytes(",", 1, data); in json_obj_encode()
1700 if (ret < 0) { in json_obj_encode()
1701 return ret; in json_obj_encode()
1771 int ret; in json_calc_encoded_len() local
1773 ret = json_obj_encode(descr, descr_len, val, measure_bytes, &total); in json_calc_encoded_len()
1774 if (ret < 0) { in json_calc_encoded_len()
1775 return ret; in json_calc_encoded_len()
1785 int ret; in json_calc_encoded_arr_len() local
1787 ret = json_arr_encode(descr, val, measure_bytes, &total); in json_calc_encoded_arr_len()
1788 if (ret < 0) { in json_calc_encoded_arr_len()
1789 return ret; in json_calc_encoded_arr_len()
1818 int ret = skip_field(obj, &kv); in extract_raw_json_data() local
1820 if (ret < 0) { in extract_raw_json_data()
1821 return ret; in extract_raw_json_data()
2023 int ret; in mixed_arr_parse() local
2056 ret = decode_mixed_value(arr, &descr[elem_idx], &tok, field_ptr, val); in mixed_arr_parse()
2057 if (ret < 0) { in mixed_arr_parse()
2058 return ret; in mixed_arr_parse()
2072 int ret; in json_mixed_arr_parse() local
2074 ret = arr_init(&arr, json, len); in json_mixed_arr_parse()
2075 if (ret < 0) { in json_mixed_arr_parse()
2076 return ret; in json_mixed_arr_parse()
2089 int ret; in json_mixed_arr_encode() local
2098 ret = append_bytes("[", 1, data); in json_mixed_arr_encode()
2099 if (ret < 0) { in json_mixed_arr_encode()
2100 return ret; in json_mixed_arr_encode()
2119 ret = encode_mixed_value(&descr[i], field_ptr, val, append_bytes, data); in json_mixed_arr_encode()
2120 if (ret < 0) { in json_mixed_arr_encode()
2121 return ret; in json_mixed_arr_encode()
2125 ret = append_bytes(",", 1, data); in json_mixed_arr_encode()
2126 if (ret < 0) { in json_mixed_arr_encode()
2127 return ret; in json_mixed_arr_encode()
2148 int ret; in json_calc_mixed_arr_len() local
2150 ret = json_mixed_arr_encode(descr, descr_len, val, measure_bytes, &total); in json_calc_mixed_arr_len()
2151 if (ret < 0) { in json_calc_mixed_arr_len()
2152 return ret; in json_calc_mixed_arr_len()