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

Function pc_env_restore

tests/test_pipeline_conventions.c:109–121  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

107 return ok;
108}
109static bool pc_env_restore(pc_env_t *env) {
110 bool ok = true;
111 if (!env->saved) return true;
112 for (size_t i = 0; i < 4; i++) {
113 pc_env_value_t *v = &env->values[i];
114 if (v->present) { if (cbm_setenv(v->name, v->value, 1) != 0) ok = false; }
115 else (void)cbm_unsetenv(v->name);
116 const char *now = getenv(v->name);
117 if (v->present ? (!now || strcmp(now, v->value) != 0) : now != NULL) ok = false;
118 }
119 env->saved = false;
120 return ok;
121}
122static bool pc_env_begin(pc_env_t *env, bool parallel) {
123 memset(env, 0, sizeof(*env));
124 const char *names[] = {"CBM_WORKERS", "CBM_INDEX_SINGLE_THREAD", "CBM_DISABLE_LSP_CROSS", "CBM_MEM_SPILL"};

Callers 2

pc_env_beginFunction · 0.85
pc_closeFunction · 0.85

Calls 2

cbm_setenvFunction · 0.85
cbm_unsetenvFunction · 0.85

Tested by

no test coverage detected