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

Function build_default_columns

src/cypher/cypher.c:5452–5468  ·  view source on GitHub ↗

Build default 3-column headers (name, qualified_name, label) per variable */

Source from the content-addressed store, hash-verified

5450
5451/* Build default 3-column headers (name, qualified_name, label) per variable */
5452static 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 */
5471static void ret_sink_init_default(ret_sink_t *s, const cbm_pattern_t *pat0) {

Callers 1

ret_sink_init_defaultFunction · 0.85

Calls 3

rb_set_columnsFunction · 0.85
safe_str_freeFunction · 0.85
heap_strdupFunction · 0.70

Tested by

no test coverage detected