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

Function copy_node

src/mcp/mcp.c:4011–4021  ·  view source on GitHub ↗

Copy a node from an array into a heap-allocated standalone node. */

Source from the content-addressed store, hash-verified

4009
4010/* Copy a node from an array into a heap-allocated standalone node. */
4011static void copy_node(const cbm_node_t *src, cbm_node_t *dst) {
4012 dst->id = src->id;
4013 dst->project = heap_strdup(src->project);
4014 dst->label = heap_strdup(src->label);
4015 dst->name = heap_strdup(src->name);
4016 dst->qualified_name = heap_strdup(src->qualified_name);
4017 dst->file_path = heap_strdup(src->file_path);
4018 dst->start_line = src->start_line;
4019 dst->end_line = src->end_line;
4020 dst->properties_json = src->properties_json ? heap_strdup(src->properties_json) : NULL;
4021}
4022
4023/* Build a JSON suggestions response for ambiguous or fuzzy results. */
4024static char *snippet_suggestions(const char *input, cbm_node_t *nodes, int count) {

Callers 1

handle_get_code_snippetFunction · 0.85

Calls 1

heap_strdupFunction · 0.70

Tested by

no test coverage detected