Build star-projection columns: var.name, var.qualified_name, var.label, var.file_path */
| 5038 | |
| 5039 | /* Build star-projection columns: var.name, var.qualified_name, var.label, var.file_path */ |
| 5040 | static void build_star_columns(result_builder_t *rb, const char **vars, int vc) { |
| 5041 | int col_n = vc * CYP_NODE_COLS; |
| 5042 | const char *col_names[CBM_SZ_128]; |
| 5043 | for (int v = 0; v < vc; v++) { |
| 5044 | char buf[CBM_SZ_128]; |
| 5045 | snprintf(buf, sizeof(buf), "%s.name", vars[v]); |
| 5046 | col_names[(size_t)v * CYP_NODE_COLS] = heap_strdup(buf); |
| 5047 | snprintf(buf, sizeof(buf), "%s.qualified_name", vars[v]); |
| 5048 | col_names[((size_t)v * CYP_NODE_COLS) + SKIP_ONE] = heap_strdup(buf); |
| 5049 | snprintf(buf, sizeof(buf), "%s.label", vars[v]); |
| 5050 | col_names[((size_t)v * CYP_NODE_COLS) + PAIR_LEN] = heap_strdup(buf); |
| 5051 | snprintf(buf, sizeof(buf), "%s.file_path", vars[v]); |
| 5052 | col_names[((size_t)v * CYP_NODE_COLS) + CYP_TRIPLE] = heap_strdup(buf); |
| 5053 | } |
| 5054 | rb_set_columns(rb, col_names, col_n); |
| 5055 | for (int i = 0; i < col_n; i++) { |
| 5056 | safe_str_free(&col_names[i]); |
| 5057 | } |
| 5058 | } |
| 5059 | |
| 5060 | /* Project one variable's 4 columns for RETURN * */ |
| 5061 | static void project_star_var(binding_t *b, const char *var, const char **vals) { |
no test coverage detected