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

Function make_single_base

internal/cbm/extract_defs.c:2103–2113  ·  view source on GitHub ↗

Build a single-element NULL-terminated base class array.

Source from the content-addressed store, hash-verified

2101
2102// Build a single-element NULL-terminated base class array.
2103static const char **make_single_base(CBMArena *a, const char *text) {
2104 if (!text || !text[0]) {
2105 return NULL;
2106 }
2107 const char **result = (const char **)cbm_arena_alloc(a, sizeof(const char *) * RT_PAIR_SIZE);
2108 if (result) {
2109 result[0] = text;
2110 result[SKIP_CHAR] = NULL;
2111 }
2112 return result;
2113}
2114
2115// Search children for a child matching one of the base_types and return its text as single base.
2116static const char **find_base_from_children(CBMArena *a, TSNode node, const char *source,

Callers 1

find_base_from_childrenFunction · 0.85

Calls 1

cbm_arena_allocFunction · 0.70

Tested by

no test coverage detected