Build star-projection columns: var.name, var.qualified_name, var.label, var.file_path */
| 3825 | |
| 3826 | /* Build star-projection columns: var.name, var.qualified_name, var.label, var.file_path */ |
| 3827 | static void build_star_columns(result_builder_t *rb, const char **vars, int vc) { |
| 3828 | int col_n = vc * CYP_NODE_COLS; |
| 3829 | const char *col_names[CBM_SZ_128]; |
| 3830 | for (int v = 0; v < vc; v++) { |
| 3831 | char buf[CBM_SZ_128]; |
| 3832 | snprintf(buf, sizeof(buf), "%s.name", vars[v]); |
| 3833 | col_names[(size_t)v * CYP_NODE_COLS] = heap_strdup(buf); |
| 3834 | snprintf(buf, sizeof(buf), "%s.qualified_name", vars[v]); |
| 3835 | col_names[((size_t)v * CYP_NODE_COLS) + SKIP_ONE] = heap_strdup(buf); |
| 3836 | snprintf(buf, sizeof(buf), "%s.label", vars[v]); |
| 3837 | col_names[((size_t)v * CYP_NODE_COLS) + PAIR_LEN] = heap_strdup(buf); |
| 3838 | snprintf(buf, sizeof(buf), "%s.file_path", vars[v]); |
| 3839 | col_names[((size_t)v * CYP_NODE_COLS) + CYP_TRIPLE] = heap_strdup(buf); |
| 3840 | } |
| 3841 | rb_set_columns(rb, col_names, col_n); |
| 3842 | for (int i = 0; i < col_n; i++) { |
| 3843 | safe_str_free(&col_names[i]); |
| 3844 | } |
| 3845 | } |
| 3846 | |
| 3847 | /* Project one variable's 4 columns for RETURN * */ |
| 3848 | static void project_star_var(binding_t *b, const char *var, const char **vals) { |
no test coverage detected