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

Function make_single_base

internal/cbm/extract_defs.c:3859–3869  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

3857
3858// Build a single-element NULL-terminated base class array.
3859static const char **make_single_base(CBMArena *a, const char *text) {
3860 if (!text || !text[0]) {
3861 return NULL;
3862 }
3863 const char **result = (const char **)cbm_arena_alloc(a, sizeof(const char *) * RT_PAIR_SIZE);
3864 if (result) {
3865 result[0] = text;
3866 result[SKIP_CHAR] = NULL;
3867 }
3868 return result;
3869}
3870
3871// Search children for a child matching one of the base_types and return its text as single base.
3872static 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