DEPENDS_ON from the Dockerfile to the Image of resolved reference `ref`. */
| 440 | |
| 441 | /* DEPENDS_ON from the Dockerfile to the Image of resolved reference `ref`. */ |
| 442 | static 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 | |
| 456 | static int dk_line(TSNode n) { |
| 457 | return (int)ts_node_start_point(n).row + SKIP_ONE; |
no test coverage detected