Lines Matching refs:val
14 spdk_json_val_len(const struct spdk_json_val *val) in spdk_json_val_len() argument
16 if (val == NULL) { in spdk_json_val_len()
20 if (val->type == SPDK_JSON_VAL_ARRAY_BEGIN || val->type == SPDK_JSON_VAL_OBJECT_BEGIN) { in spdk_json_val_len()
21 return val->len + 2; in spdk_json_val_len()
28 spdk_json_strequal(const struct spdk_json_val *val, const char *str) in spdk_json_strequal() argument
32 if (val->type != SPDK_JSON_VAL_STRING && val->type != SPDK_JSON_VAL_NAME) { in spdk_json_strequal()
37 if (val->len != len) { in spdk_json_strequal()
41 return memcmp(val->start, str, len) == 0; in spdk_json_strequal()
45 spdk_json_strdup(const struct spdk_json_val *val) in spdk_json_strdup() argument
50 if (val->type != SPDK_JSON_VAL_STRING && val->type != SPDK_JSON_VAL_NAME) { in spdk_json_strdup()
54 len = val->len; in spdk_json_strdup()
56 if (memchr(val->start, '\0', len)) { in spdk_json_strdup()
66 memcpy(s, val->start, len); in spdk_json_strdup()
79 json_number_split(const struct spdk_json_val *val, struct spdk_json_num *num) in json_number_split() argument
95 if (val->type != SPDK_JSON_VAL_NUMBER) { in json_number_split()
99 remaining = val->len; in json_number_split()
104 iter = val->start; in json_number_split()
180 spdk_json_number_to_uint8(const struct spdk_json_val *val, uint8_t *num) in spdk_json_number_to_uint8() argument
185 rc = json_number_split(val, &split_num); in spdk_json_number_to_uint8()
202 spdk_json_number_to_uint16(const struct spdk_json_val *val, uint16_t *num) in spdk_json_number_to_uint16() argument
207 rc = json_number_split(val, &split_num); in spdk_json_number_to_uint16()
224 spdk_json_number_to_int32(const struct spdk_json_val *val, int32_t *num) in spdk_json_number_to_int32() argument
229 rc = json_number_split(val, &split_num); in spdk_json_number_to_int32()
255 spdk_json_number_to_uint32(const struct spdk_json_val *val, uint32_t *num) in spdk_json_number_to_uint32() argument
260 rc = json_number_split(val, &split_num); in spdk_json_number_to_uint32()
277 spdk_json_number_to_uint64(const struct spdk_json_val *val, uint64_t *num) in spdk_json_number_to_uint64() argument
282 rc = json_number_split(val, &split_num); in spdk_json_number_to_uint64()
431 spdk_json_decode_bool(const struct spdk_json_val *val, void *out) in spdk_json_decode_bool() argument
435 if (val->type != SPDK_JSON_VAL_TRUE && val->type != SPDK_JSON_VAL_FALSE) { in spdk_json_decode_bool()
439 *f = val->type == SPDK_JSON_VAL_TRUE; in spdk_json_decode_bool()
444 spdk_json_decode_uint8(const struct spdk_json_val *val, void *out) in spdk_json_decode_uint8() argument
448 return spdk_json_number_to_uint8(val, i); in spdk_json_decode_uint8()
452 spdk_json_decode_uint16(const struct spdk_json_val *val, void *out) in spdk_json_decode_uint16() argument
456 return spdk_json_number_to_uint16(val, i); in spdk_json_decode_uint16()
460 spdk_json_decode_int32(const struct spdk_json_val *val, void *out) in spdk_json_decode_int32() argument
464 return spdk_json_number_to_int32(val, i); in spdk_json_decode_int32()
468 spdk_json_decode_uint32(const struct spdk_json_val *val, void *out) in spdk_json_decode_uint32() argument
472 return spdk_json_number_to_uint32(val, i); in spdk_json_decode_uint32()
476 spdk_json_decode_uint64(const struct spdk_json_val *val, void *out) in spdk_json_decode_uint64() argument
480 return spdk_json_number_to_uint64(val, i); in spdk_json_decode_uint64()
484 spdk_json_decode_string(const struct spdk_json_val *val, void *out) in spdk_json_decode_string() argument
490 *s = spdk_json_strdup(val); in spdk_json_decode_string()
500 spdk_json_decode_uuid(const struct spdk_json_val *val, void *out) in spdk_json_decode_uuid() argument
506 rc = spdk_json_decode_string(val, &str); in spdk_json_decode_uuid()
545 struct spdk_json_val **val, enum spdk_json_val_type type) in spdk_json_find() argument
588 if (val) { in spdk_json_find()
589 *val = _val; in spdk_json_find()
597 struct spdk_json_val **key, struct spdk_json_val **val) in spdk_json_find_string() argument
599 return spdk_json_find(object, key_name, key, val, SPDK_JSON_VAL_STRING); in spdk_json_find_string()
604 struct spdk_json_val **key, struct spdk_json_val **val) in spdk_json_find_array() argument
606 return spdk_json_find(object, key_name, key, val, SPDK_JSON_VAL_ARRAY_BEGIN); in spdk_json_find_array()
628 json_skip_object_or_array(struct spdk_json_val *val) in json_skip_object_or_array() argument
634 if (val->type == SPDK_JSON_VAL_OBJECT_BEGIN) { in json_skip_object_or_array()
636 } else if (val->type == SPDK_JSON_VAL_ARRAY_BEGIN) { in json_skip_object_or_array()
640 SPDK_JSON_VAL_OBJECT_BEGIN, SPDK_JSON_VAL_ARRAY_BEGIN, val->type); in json_skip_object_or_array()
645 for (it = val + 1; it->type != SPDK_JSON_VAL_INVALID && lvl != 0; it++) { in json_skip_object_or_array()
646 if (it->type == val->type) { in json_skip_object_or_array()
655 SPDK_JSON_DEBUG("Can't find end of object (type: %#x): lvl (%u) != 0)\n", val->type, lvl); in json_skip_object_or_array()
665 struct spdk_json_val *val, *next; in spdk_json_next() local
669 val = json_value(it); in spdk_json_next()
670 next = spdk_json_next(val); in spdk_json_next()
679 val = it + 1; in spdk_json_next()
680 return val; in spdk_json_next()