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

Function tr_node

src/pipeline/doc_links_ts.c:419–428  ·  view source on GitHub ↗

The node at `qn`, when it belongs to file f (any file when f is NULL). */

Source from the content-addressed store, hash-verified

417
418/* The node at `qn`, when it belongs to file f (any file when f is NULL). */
419static const cbm_gbuf_node_t *tr_node(const tr_ctx_t *c, const char *qn, const tr_file_t *f) {
420 const cbm_gbuf_node_t *n = cbm_gbuf_find_by_qn(c->g, qn);
421 if (!n || !n->label) {
422 return NULL;
423 }
424 if (f && (!n->file_path || strcmp(n->file_path, f->path) != 0)) {
425 return NULL;
426 }
427 return n;
428}
429
430static bool tr_join(char *out, size_t cap, const char *a, const char *b, const char *c) {
431 int n = c ? snprintf(out, cap, "%s.%s.%s", a, b, c) : snprintf(out, cap, "%s.%s", a, b);

Callers 2

tr_decl_resFunction · 0.85
tr_headFunction · 0.85

Calls 1

cbm_gbuf_find_by_qnFunction · 0.85

Tested by

no test coverage detected