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

Function canonical_cache_path

src/cli/runtime_settings.c:232–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

230}
231
232static bool canonical_cache_path(const char *cache, char out[SETTINGS_PATH_CAP], bool create) {
233 if (!cache || !cache[0])
234 return false;
235 bool ready = cbm_canonical_path(cache, out, SETTINGS_PATH_CAP);
236 if (!ready && create && cbm_mkdir_p(cache, 0700))
237 ready = cbm_canonical_path(cache, out, SETTINGS_PATH_CAP);
238 if (!ready || !cbm_is_dir(out))
239 return false;
240 cbm_normalize_path_sep(out);
241 return cbm_daemon_ipc_private_directory_secure(out);
242}
243
244static sqlite3 *settings_open(const char *cache) {
245 if (!cache || !cache[0] || strlen(cache) + 12 >= SETTINGS_PATH_CAP)

Callers 3

settings_openFunction · 0.85

Calls 5

cbm_canonical_pathFunction · 0.85
cbm_mkdir_pFunction · 0.85
cbm_is_dirFunction · 0.85
cbm_normalize_path_sepFunction · 0.85

Tested by

no test coverage detected