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

Function r964_file_node_exists

tests/repro/repro_issue964.c:49–61  ·  view source on GitHub ↗

True if a File-labelled node with exactly `name` exists. */

Source from the content-addressed store, hash-verified

47
48/* True if a File-labelled node with exactly `name` exists. */
49static int r964_file_node_exists(cbm_store_t *store, const char *project, const char *name) {
50 cbm_node_t *nodes = NULL;
51 int count = 0;
52 if (cbm_store_find_nodes_by_label(store, project, "File", &nodes, &count) != CBM_STORE_OK)
53 return 0;
54 int found = 0;
55 for (int i = 0; i < count; i++) {
56 if (nodes[i].name && strcmp(nodes[i].name, name) == 0)
57 found = 1;
58 }
59 cbm_store_free_nodes(nodes, count);
60 return found;
61}
62
63/* Count INBOUND edges (any of the reporter's connection types) landing on the
64 * File node named `name` — the exact disconnection metric from the issue's

Callers 1

repro_issue964.cFile · 0.85

Calls 2

cbm_store_free_nodesFunction · 0.85

Tested by

no test coverage detected