Build an enriched snippet response for a resolved node. */ Add a string array to a JSON object (no-op if count == 0). */
| 4215 | /* Build an enriched snippet response for a resolved node. */ |
| 4216 | /* Add a string array to a JSON object (no-op if count == 0). */ |
| 4217 | static void add_string_array(yyjson_mut_doc *doc, yyjson_mut_val *obj, const char *key, |
| 4218 | char **strings, int count) { |
| 4219 | if (count <= 0) { |
| 4220 | return; |
| 4221 | } |
| 4222 | yyjson_mut_val *arr = yyjson_mut_arr(doc); |
| 4223 | for (int i = 0; i < count; i++) { |
| 4224 | yyjson_mut_arr_add_str(doc, arr, strings[i]); |
| 4225 | } |
| 4226 | yyjson_mut_obj_add_val(doc, obj, key, arr); |
| 4227 | } |
| 4228 | |
| 4229 | static char *build_snippet_response(cbm_mcp_server_t *srv, cbm_node_t *node, |
| 4230 | const char *match_method, bool include_neighbors, |
no outgoing calls
no test coverage detected