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

Function copy_node

src/mcp/mcp.c:8353–8363  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

8351
8352/* Copy a node from an array into a heap-allocated standalone node. */
8353static void copy_node(const cbm_node_t *src, cbm_node_t *dst) {
8354 dst->id = src->id;
8355 dst->project = heap_strdup(src->project);
8356 dst->label = heap_strdup(src->label);
8357 dst->name = heap_strdup(src->name);
8358 dst->qualified_name = heap_strdup(src->qualified_name);
8359 dst->file_path = heap_strdup(src->file_path);
8360 dst->start_line = src->start_line;
8361 dst->end_line = src->end_line;
8362 dst->properties_json = src->properties_json ? heap_strdup(src->properties_json) : NULL;
8363}
8364
8365/* Build a JSON suggestions response for ambiguous or fuzzy results. */
8366static 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