| 2960 | /* ── Handle JSON-RPC request ──────────────────────────────────── */ |
| 2961 | |
| 2962 | static yyjson_val *json_unique_member(yyjson_val *object, const char *name) { |
| 2963 | if (!yyjson_is_obj(object)) |
| 2964 | return NULL; |
| 2965 | yyjson_val *found = NULL; |
| 2966 | size_t index, maximum; |
| 2967 | yyjson_val *key, *value; |
| 2968 | yyjson_obj_foreach(object, index, maximum, key, value) { |
| 2969 | if (strcmp(yyjson_get_str(key), name) == 0) { |
| 2970 | if (found) |
| 2971 | return NULL; |
| 2972 | found = value; |
| 2973 | } |
| 2974 | } |
| 2975 | return found; |
| 2976 | } |
| 2977 | |
| 2978 | /* Tools the browser may call through /rpc: the read-only query surface and |
| 2979 | * nothing that mutates the index. Writes (index_repository, delete_project, |
no outgoing calls
no test coverage detected