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

Function cbm_app_local_dir

src/foundation/platform.c:494–513  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

492}
493
494const char *cbm_app_local_dir(void) {
495#ifdef _WIN32
496 static CBM_TLS char buf[CBM_SZ_1K];
497 char tmp[CBM_SZ_256] = "";
498 cbm_safe_getenv("LOCALAPPDATA", tmp, sizeof(tmp), NULL);
499 if (tmp[0]) {
500 snprintf(buf, sizeof(buf), "%s", tmp);
501 cbm_normalize_path_sep(buf);
502 return buf;
503 }
504 const char *home = cbm_get_home_dir();
505 if (home) {
506 snprintf(buf, sizeof(buf), "%s/AppData/Local", home);
507 return buf;
508 }
509 return NULL;
510#else
511 return cbm_app_config_dir();
512#endif
513}
514
515/* ── Cache directory ────────────────────────── */
516

Callers 1

Calls 4

cbm_safe_getenvFunction · 0.85
cbm_normalize_path_sepFunction · 0.85
cbm_get_home_dirFunction · 0.85
cbm_app_config_dirFunction · 0.85

Tested by 1