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

Function tf_def_node

src/pipeline/pass_terraform.c:718–723  ·  view source on GitHub ↗

The node of definition `name` in `file`, by the QN extract_defs gave it. */

Source from the content-addressed store, hash-verified

716
717/* The node of definition `name` in `file`, by the QN extract_defs gave it. */
718static int64_t tf_def_node(tf_mod_t *m, const char *file, const char *name) {
719 const char *qn = cbm_fqn_compute(m->arena, m->ctx->project_name, file, name);
720 const cbm_gbuf_node_t *n = qn ? cbm_gbuf_find_by_qn(m->ctx->gbuf, qn) : NULL;
721 atomic_fetch_add_explicit(&g_tf_candidates, SKIP_ONE, memory_order_relaxed);
722 return n && n->file_path && strcmp(n->file_path, file) == 0 ? n->id : 0;
723}
724
725/* Order paths by directory, then name: a directory's files are contiguous. */
726static int tf_cmp_dir_path(const void *x, const void *y) {

Callers 2

tf_mod_linkFunction · 0.85
tf_link_tfvarsFunction · 0.85

Calls 2

cbm_fqn_computeFunction · 0.85
cbm_gbuf_find_by_qnFunction · 0.85

Tested by

no test coverage detected