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

Function binding_copy

src/cypher/cypher.c:2510–2522  ·  view source on GitHub ↗

Deep-copy a binding (so source and dest own separate string copies) */

Source from the content-addressed store, hash-verified

2508
2509/* Deep-copy a binding (so source and dest own separate string copies) */
2510static void binding_copy(binding_t *dst, const binding_t *src) {
2511 dst->var_count = src->var_count;
2512 for (int i = 0; i < src->var_count; i++) {
2513 dst->var_names[i] = src->var_names[i]; /* AST-owned, not freed */
2514 node_deep_copy(&dst->var_nodes[i], &src->var_nodes[i]);
2515 }
2516 dst->edge_var_count = src->edge_var_count;
2517 for (int i = 0; i < src->edge_var_count; i++) {
2518 dst->edge_var_names[i] = src->edge_var_names[i]; /* AST-owned */
2519 edge_deep_copy(&dst->edge_vars[i], &src->edge_vars[i]);
2520 }
2521 dst->store = src->store;
2522}
2523
2524/* Deep-copy a node into a binding (binding owns the strings) */
2525static void binding_set(binding_t *b, const char *var, const cbm_node_t *node) {

Callers 6

process_edgesFunction · 0.85
expand_var_lengthFunction · 0.85
expand_pattern_relsFunction · 0.85
cross_join_nodesFunction · 0.85
cross_join_with_relsFunction · 0.85

Calls 2

node_deep_copyFunction · 0.85
edge_deep_copyFunction · 0.85

Tested by

no test coverage detected