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

Function cbm_runtime_getenv

src/foundation/platform.c:379–390  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

377}
378
379const char *cbm_runtime_getenv(const char *name) {
380 /* A small per-thread ring supports callers that inspect several inherited
381 * values together without exposing libc's mutable environment storage. */
382 static CBM_TLS char inherited[4][CBM_SZ_4K];
383 static CBM_TLS unsigned slot;
384 const char *value = NULL;
385 if (environment_resolver && environment_resolver(name, &value)) {
386 return value;
387 }
388 char *buffer = inherited[slot++ % 4U];
389 return cbm_native_getenv(name, buffer, CBM_SZ_4K, NULL);
390}
391
392const char *cbm_safe_getenv(const char *name, char *buf, size_t buf_sz, const char *fallback) {
393 const char *value = NULL;

Callers 14

ts_type_budget_resetFunction · 0.85
cbm_lsp_max_walk_depthFunction · 0.85
main_startup_timeout_msFunction · 0.85
cbm_sem_get_configFunction · 0.85
cbm_sem_is_enabledFunction · 0.85
prune_grace_sFunction · 0.85
cbm_log_init_from_envFunction · 0.85
cbm_max_file_bytesFunction · 0.85
env_positive_intFunction · 0.85
cbm_profile_initFunction · 0.85
ui_log_rotate_bytesFunction · 0.85
render_node_limitFunction · 0.85

Calls 1

cbm_native_getenvFunction · 0.85

Tested by

no test coverage detected