Build default 3-column headers (name, qualified_name, label) per variable */
| 5450 | |
| 5451 | /* Build default 3-column headers (name, qualified_name, label) per variable */ |
| 5452 | static void build_default_columns(result_builder_t *rb, const char **vars, int vc) { |
| 5453 | int col_n = vc * CYP_EDGE_COLS; |
| 5454 | const char *col_names[CYP_COL_BUF]; |
| 5455 | for (int v = 0; v < vc; v++) { |
| 5456 | char buf[CBM_SZ_128]; |
| 5457 | snprintf(buf, sizeof(buf), "%s.name", vars[v]); |
| 5458 | col_names[(size_t)v * CYP_EDGE_COLS] = heap_strdup(buf); |
| 5459 | snprintf(buf, sizeof(buf), "%s.qualified_name", vars[v]); |
| 5460 | col_names[((size_t)v * CYP_EDGE_COLS) + SKIP_ONE] = heap_strdup(buf); |
| 5461 | snprintf(buf, sizeof(buf), "%s.label", vars[v]); |
| 5462 | col_names[((size_t)v * CYP_EDGE_COLS) + PAIR_LEN] = heap_strdup(buf); |
| 5463 | } |
| 5464 | rb_set_columns(rb, col_names, col_n); |
| 5465 | for (int i = 0; i < col_n; i++) { |
| 5466 | safe_str_free(&col_names[i]); |
| 5467 | } |
| 5468 | } |
| 5469 | |
| 5470 | /* Default projection when no RETURN clause */ |
| 5471 | static void ret_sink_init_default(ret_sink_t *s, const cbm_pattern_t *pat0) { |
no test coverage detected