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

Function cbm_get_home_dir

src/foundation/platform.c:440–458  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

438/* ── Home directory (cross-platform) ───────────────────── */
439
440const char *cbm_get_home_dir(void) {
441 static CBM_TLS char buf[CBM_SZ_1K];
442 char tmp[CBM_SZ_256] = "";
443
444 cbm_safe_getenv("HOME", tmp, sizeof(tmp), NULL);
445 if (tmp[0]) {
446 snprintf(buf, sizeof(buf), "%s", tmp);
447 cbm_normalize_path_sep(buf);
448 return buf;
449 }
450
451 cbm_safe_getenv("USERPROFILE", tmp, sizeof(tmp), NULL);
452 if (tmp[0]) {
453 snprintf(buf, sizeof(buf), "%s", tmp);
454 cbm_normalize_path_sep(buf);
455 return buf;
456 }
457 return NULL;
458}
459
460/* ── App config directories (cross-platform) ────────── */
461

Callers 15

expand_git_pathFunction · 0.85
cbm_agent_cli_existsFunction · 0.85
get_cache_dirFunction · 0.85
cbm_cmd_configFunction · 0.85
cbm_cmd_installFunction · 0.85
cbm_cmd_uninstallFunction · 0.85
cbm_cmd_updateFunction · 0.85
detect_sessionFunction · 0.85
maybe_auto_indexFunction · 0.85

Calls 2

cbm_safe_getenvFunction · 0.85
cbm_normalize_path_sepFunction · 0.85

Tested by 3

mcp_test_gitFunction · 0.68
app_test_gitFunction · 0.68