MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / sc_json_cell

Function sc_json_cell

tests/test_mcp.c:11434–11444  ·  view source on GitHub ↗

The search_code json row layout is column-ordered; find a cell by its * declared column name rather than by a fixed index. */

Source from the content-addressed store, hash-verified

11432/* The search_code json row layout is column-ordered; find a cell by its
11433 * declared column name rather than by a fixed index. */
11434static yyjson_val *sc_json_cell(yyjson_val *root, yyjson_val *row, const char *column) {
11435 yyjson_val *cols = yyjson_obj_get(root, "cols");
11436 size_t n = cols ? yyjson_arr_size(cols) : 0;
11437 for (size_t i = 0; i < n; i++) {
11438 const char *name = yyjson_get_str(yyjson_arr_get(cols, i));
11439 if (name && strcmp(name, column) == 0) {
11440 return yyjson_arr_get(row, i);
11441 }
11442 }
11443 return NULL;
11444}
11445
11446/* Regression guard: search_code full results must preserve valid UTF-8 source. */
11447static bool is_valid_json_response(const char *json);

Callers 1

test_mcp.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected