| 4618 | } |
| 4619 | |
| 4620 | static yyjson_val *dm_preview_metadata(yyjson_val *report, size_t sample, const char *field) { |
| 4621 | yyjson_val *entries = yyjson_obj_get(report, "samples_preview"); |
| 4622 | for (size_t i = 0; i < yyjson_arr_size(entries); i++) { |
| 4623 | yyjson_val *entry = yyjson_arr_get(entries, i); |
| 4624 | const char *name = yyjson_get_str(yyjson_obj_get(entry, "field")); |
| 4625 | yyjson_val *index = yyjson_obj_get(entry, "sample_index"); |
| 4626 | if (name && yyjson_is_uint(index) && yyjson_get_uint(index) == sample && |
| 4627 | strcmp(name, field) == 0) { |
| 4628 | return entry; |
| 4629 | } |
| 4630 | } |
| 4631 | return NULL; |
| 4632 | } |
| 4633 | |
| 4634 | static bool dm_preview_metadata_matches(yyjson_val *entry, size_t original, size_t included, |
| 4635 | bool truncated, bool escaped) { |
no outgoing calls
no test coverage detected