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

Function find_ref_edge

tests/test_doclinks.c:47–57  ·  view source on GitHub ↗

Find the REFERENCES_FILE edge between two node ids. NULL if absent. */

Source from the content-addressed store, hash-verified

45
46/* Find the REFERENCES_FILE edge between two node ids. NULL if absent. */
47static const cbm_gbuf_edge_t *find_ref_edge(cbm_gbuf_t *gb, int64_t src, int64_t tgt) {
48 const cbm_gbuf_edge_t **edges = NULL;
49 int count = 0;
50 cbm_gbuf_find_edges_by_type(gb, "REFERENCES_FILE", &edges, &count);
51 for (int i = 0; i < count; i++) {
52 if (edges[i]->source_id == src && edges[i]->target_id == tgt) {
53 return edges[i];
54 }
55 }
56 return NULL;
57}
58
59/* True when the edge's props JSON carries the given strategy. */
60static bool edge_has_strategy(const cbm_gbuf_edge_t *e, const char *strategy) {

Callers 1

test_doclinks.cFile · 0.85

Calls 1

Tested by

no test coverage detected