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

Function binding_set

src/cypher/cypher.c:2524–2539  ·  view source on GitHub ↗

Deep-copy a node into a binding (binding owns the strings) */

Source from the content-addressed store, hash-verified

2522
2523/* Deep-copy a node into a binding (binding owns the strings) */
2524static void binding_set(binding_t *b, const char *var, const cbm_node_t *node) {
2525 /* Check existing — free old fields first */
2526 for (int i = 0; i < b->var_count; i++) {
2527 if (strcmp(b->var_names[i], var) == 0) {
2528 node_fields_free(&b->var_nodes[i]);
2529 node_deep_copy(&b->var_nodes[i], node);
2530 return;
2531 }
2532 }
2533 if (b->var_count >= CYP_MAX_VARS) {
2534 return;
2535 }
2536 b->var_names[b->var_count] = var; /* not owned — points to AST string */
2537 node_deep_copy(&b->var_nodes[b->var_count], node);
2538 b->var_count++;
2539}
2540
2541static const char *eval_multiarg_func(binding_t *b, const cbm_return_item_t *item, char *buf,
2542 size_t bufsz);

Callers 6

process_edgesFunction · 0.85
expand_var_lengthFunction · 0.85
cross_join_nodesFunction · 0.85
cross_join_with_relsFunction · 0.85
execute_singleFunction · 0.85

Calls 2

node_fields_freeFunction · 0.85
node_deep_copyFunction · 0.85

Tested by

no test coverage detected