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

Function cbm_get_home_dir

src/foundation/platform.c:469–487  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

467/* ── Home directory (cross-platform) ───────────────────── */
468
469const char *cbm_get_home_dir(void) {
470 static CBM_TLS char buf[CBM_SZ_1K];
471 char tmp[CBM_SZ_256] = "";
472
473 cbm_safe_getenv("HOME", tmp, sizeof(tmp), NULL);
474 if (tmp[0]) {
475 snprintf(buf, sizeof(buf), "%s", tmp);
476 cbm_normalize_path_sep(buf);
477 return buf;
478 }
479
480 cbm_safe_getenv("USERPROFILE", tmp, sizeof(tmp), NULL);
481 if (tmp[0]) {
482 snprintf(buf, sizeof(buf), "%s", tmp);
483 cbm_normalize_path_sep(buf);
484 return buf;
485 }
486 return NULL;
487}
488
489/* ── App config directories (cross-platform) ────────── */
490

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