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

Function cbm_doclink_portable_scope

internal/cbm/doclink.c:378–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

376/* ── Persisted scope ─────────────────────────────────────────────── */
377
378char *cbm_doclink_portable_scope(const char *scope) {
379 if (!scope) {
380 return NULL;
381 }
382 for (size_t i = 0; i < sizeof(DOCLINK_LANGS) / sizeof(DOCLINK_LANGS[0]); i++) {
383 const doclink_lang_t *L = &DOCLINK_LANGS[i];
384 if (!L->scope_tag || !L->portable_scope) {
385 continue;
386 }
387 size_t tl = strlen(L->scope_tag);
388 if (strncmp(scope, L->scope_tag, tl) == 0 && (scope[tl] == '\n' || scope[tl] == '\0')) {
389 return L->portable_scope(scope);
390 }
391 }
392 return cbm_mem_strdup(CBM_MEM_CLASS_OTHER, scope);
393}
394
395/* ── Driver ──────────────────────────────────────────────────────── */
396

Callers 8

surface_file_to_jsonFunction · 0.85
dm_scope_deltaFunction · 0.85
dm_control_deltaFunction · 0.85
dm_utf8_probe_surfaceFunction · 0.85

Calls 1

cbm_mem_strdupFunction · 0.85

Tested by 3

dm_scope_deltaFunction · 0.68
dm_control_deltaFunction · 0.68
dm_utf8_probe_surfaceFunction · 0.68