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

Function dk_link

src/pipeline/pass_docker.c:442–454  ·  view source on GitHub ↗

DEPENDS_ON from the Dockerfile to the Image of resolved reference `ref`. */

Source from the content-addressed store, hash-verified

440
441/* DEPENDS_ON from the Dockerfile to the Image of resolved reference `ref`. */
442static void dk_link(dk_t *d, const char *ref, const char *via, int line) {
443 int64_t img = cbm_pipeline_image_node(d->ctx, ref);
444 if (img <= 0) {
445 return;
446 }
447 char esc_ref[CBM_SZ_1K];
448 cbm_json_escape(esc_ref, (int)sizeof(esc_ref), ref);
449 char props[CBM_SZ_2K];
450 snprintf(props, sizeof(props), "{\"via\":\"%s\",\"image\":\"%s\",\"stage\":%d,\"line\":%d}",
451 via, esc_ref, d->stage, line);
452 cbm_gbuf_insert_edge(d->ctx->gbuf, d->module, img, "DEPENDS_ON", props);
453 d->edges++;
454}
455
456static int dk_line(TSNode n) {
457 return (int)ts_node_start_point(n).row + SKIP_ONE;

Callers 2

dk_fromFunction · 0.85
dk_copyFunction · 0.85

Calls 3

cbm_pipeline_image_nodeFunction · 0.85
cbm_json_escapeFunction · 0.85
cbm_gbuf_insert_edgeFunction · 0.85

Tested by

no test coverage detected