Create a File node the way pass_structure does: QN via fqn_compute with * "__file__", file_path = repo-relative path. Returns the node id. */
| 35 | /* Create a File node the way pass_structure does: QN via fqn_compute with |
| 36 | * "__file__", file_path = repo-relative path. Returns the node id. */ |
| 37 | static int64_t add_file_node(cbm_gbuf_t *gb, const char *project, const char *rel) { |
| 38 | char *qn = cbm_pipeline_fqn_compute(project, rel, "__file__"); |
| 39 | const char *slash = strrchr(rel, '/'); |
| 40 | const char *basename = slash ? slash + 1 : rel; |
| 41 | int64_t id = cbm_gbuf_upsert_node(gb, "File", basename, qn, rel, 0, 0, NULL); |
| 42 | free(qn); |
| 43 | return id; |
| 44 | } |
| 45 | |
| 46 | /* Find the REFERENCES_FILE edge between two node ids. NULL if absent. */ |
| 47 | static const cbm_gbuf_edge_t *find_ref_edge(cbm_gbuf_t *gb, int64_t src, int64_t tgt) { |
no test coverage detected