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

Function dk_env

src/pipeline/pass_docker.c:485–508  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

483}
484
485static void dk_env(dk_t *d, TSNode ins) {
486 if (d->stage < 0) {
487 return;
488 }
489 for (uint32_t i = 0; i < ts_node_named_child_count(ins); i++) {
490 TSNode pair = ts_node_named_child(ins, i);
491 if (!dk_type(pair, "env_pair")) {
492 continue;
493 }
494 TSNode nm = ts_node_child_by_field_name(pair, "name", (uint32_t)strlen("name"));
495 TSNode vl = ts_node_child_by_field_name(pair, "value", (uint32_t)strlen("value"));
496 if (ts_node_is_null(nm)) {
497 continue;
498 }
499 const char *raw = ts_node_is_null(vl) ? NULL : dk_value(d, vl);
500 const char *name = dk_text(d, nm);
501 dk_set(d, &d->local, name, raw ? dk_expand(d, d->local, raw) : NULL);
502 dk_envkey_t *k = d->stage < DK_MAX_STAGES ? cbm_arena_alloc(d->a, sizeof(*k)) : NULL;
503 if (k && name) {
504 *k = (dk_envkey_t){name, dk_line(pair), d->st[d->stage].envs};
505 d->st[d->stage].envs = k;
506 }
507 }
508}
509
510static void dk_from(dk_t *d, TSNode ins) {
511 TSNode spec = {0};

Callers 1

dk_fileFunction · 0.85

Calls 7

dk_typeFunction · 0.85
dk_valueFunction · 0.85
dk_textFunction · 0.85
dk_setFunction · 0.85
dk_expandFunction · 0.85
dk_lineFunction · 0.85
cbm_arena_allocFunction · 0.50

Tested by

no test coverage detected