MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / build_star_columns

Function build_star_columns

src/cypher/cypher.c:3827–3845  ·  view source on GitHub ↗

Build star-projection columns: var.name, var.qualified_name, var.label, var.file_path */

Source from the content-addressed store, hash-verified

3825
3826/* Build star-projection columns: var.name, var.qualified_name, var.label, var.file_path */
3827static 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 * */
3848static void project_star_var(binding_t *b, const char *var, const char **vals) {

Callers 1

execute_return_starFunction · 0.85

Calls 3

rb_set_columnsFunction · 0.85
safe_str_freeFunction · 0.85
heap_strdupFunction · 0.70

Tested by

no test coverage detected