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

Function cbm_watcher_new

src/watcher/watcher.c:1093–1112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1091/* ── Watcher lifecycle ──────────────────────────────────────────── */
1092
1093cbm_watcher_t *cbm_watcher_new(cbm_store_t *store, cbm_index_fn index_fn, void *user_data) {
1094 cbm_watcher_t *w = calloc(CBM_ALLOC_ONE, sizeof(*w));
1095 if (!w) {
1096 return NULL;
1097 }
1098 w->store = store;
1099 w->index_fn = index_fn;
1100 w->user_data = user_data;
1101 w->projects = cbm_ht_create(CBM_SZ_32);
1102 if (!w->projects) {
1103 free(w);
1104 return NULL;
1105 }
1106 cbm_mutex_init(&w->projects_lock);
1107 cbm_mutex_init(&w->coordination_lock);
1108 atomic_init(&w->stopped, 0);
1109 atomic_init(&w->running, false);
1110 atomic_init(&w->poll_non_git, false);
1111 return w;
1112}
1113
1114void cbm_watcher_set_poll_non_git(cbm_watcher_t *w, bool enabled) {
1115 if (w) {

Callers 7

host_state_prepareFunction · 0.85
test_watcher.cFile · 0.85
ui_delete_fixture_initFunction · 0.85

Calls 2

cbm_ht_createFunction · 0.85
cbm_mutex_initFunction · 0.85

Tested by 4

ui_delete_fixture_initFunction · 0.68