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

Function dc_walk_row

tests/test_mcp.c:17555–17569  ·  view source on GitHub ↗

The impacted row whose qualified name ends in `.name`, from a format:"json" * answer. NULL when the row is absent. */

Source from the content-addressed store, hash-verified

17553/* The impacted row whose qualified name ends in `.name`, from a format:"json"
17554 * answer. NULL when the row is absent. */
17555static yyjson_val *dc_walk_row(yyjson_doc *doc, const char *name) {
17556 yyjson_val *rows = doc ? yyjson_obj_get(yyjson_doc_get_root(doc), "impacted") : NULL;
17557 size_t want = strlen(name);
17558 size_t idx;
17559 size_t max;
17560 yyjson_val *row;
17561 yyjson_arr_foreach(rows, idx, max, row) {
17562 const char *qn = yyjson_get_str(yyjson_obj_get(row, "qn"));
17563 size_t len = qn ? strlen(qn) : 0;
17564 if (len > want && qn[len - want - 1U] == '.' && strcmp(qn + len - want, name) == 0) {
17565 return row;
17566 }
17567 }
17568 return NULL;
17569}
17570
17571static int dc_walk_total(yyjson_doc *doc) {
17572 return doc ? (int)yyjson_get_int(yyjson_obj_get(yyjson_doc_get_root(doc), "impacted_total"))

Callers 1

test_mcp.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected