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

Function state_new

src/watcher/watcher.c:701–715  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

699static void state_free(project_state_t *s);
700
701static project_state_t *state_new(const char *name, const char *root_path) {
702 project_state_t *s = calloc(CBM_ALLOC_ONE, sizeof(*s));
703 if (!s) {
704 return NULL;
705 }
706 s->project_name = strdup(name);
707 s->root_path = strdup(root_path);
708 if (!s->project_name || !s->root_path) {
709 state_free(s);
710 return NULL;
711 }
712 atomic_init(&s->registered, true);
713 s->interval_ms = POLL_BASE_MS;
714 return s;
715}
716
717static void state_free(project_state_t *s) {
718 if (!s) {

Callers 1

cbm_watcher_watchFunction · 0.85

Calls 1

state_freeFunction · 0.85

Tested by

no test coverage detected