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

Function tf_block_node

src/pipeline/pass_terraform.c:229–236  ·  view source on GitHub ↗

The node of block `resource.helm_release. ` in the file, by the QN * its definition got -- not among every block of that name: modules that * share a release name (`this`) would make each lookup scan all of them. */

Source from the content-addressed store, hash-verified

227 * its definition got -- not among every block of that name: modules that
228 * share a release name (`this`) would make each lookup scan all of them. */
229static int64_t tf_block_node(const tf_t *t, const char *name) {
230 char full[CBM_SZ_512];
231 snprintf(full, sizeof(full), "resource.helm_release.%s", name);
232 const char *qn = cbm_fqn_compute(t->arena, t->ctx->project_name, t->file, full);
233 const cbm_gbuf_node_t *n = qn ? cbm_gbuf_find_by_qn(t->ctx->gbuf, qn) : NULL;
234 atomic_fetch_add_explicit(&g_tf_candidates, SKIP_ONE, memory_order_relaxed);
235 return n && n->file_path && strcmp(n->file_path, t->file) == 0 ? n->id : 0;
236}
237
238static bool tf_plain_name(const char *s) {
239 if (!s[0]) {

Callers 1

tf_helm_releaseFunction · 0.85

Calls 2

cbm_fqn_computeFunction · 0.85
cbm_gbuf_find_by_qnFunction · 0.85

Tested by

no test coverage detected