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

Function build_star_columns

src/cypher/cypher.c:5040–5058  ·  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

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

Callers 1

ret_sink_init_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