| 1289 | } |
| 1290 | |
| 1291 | bool cbm_watcher_project_info(cbm_watcher_t *w, const char *project_name, |
| 1292 | cbm_watcher_project_info_t *out) { |
| 1293 | if (out) { |
| 1294 | memset(out, 0, sizeof(*out)); |
| 1295 | } |
| 1296 | if (!w || !project_name || !out) { |
| 1297 | return false; |
| 1298 | } |
| 1299 | cbm_mutex_lock(&w->projects_lock); |
| 1300 | project_state_t *s = cbm_ht_get(w->projects, project_name); |
| 1301 | if (s) { |
| 1302 | out->strategy = (cbm_watcher_strategy_t)atomic_load(&s->status_strategy); |
| 1303 | out->poll_interval_ms = atomic_load(&s->status_interval_ms); |
| 1304 | out->last_scan_unix_s = atomic_load(&s->status_last_scan_s); |
| 1305 | } |
| 1306 | cbm_mutex_unlock(&w->projects_lock); |
| 1307 | return s != NULL; |
| 1308 | } |
| 1309 | |
| 1310 | int cbm_watcher_watch_count(cbm_watcher_t *w) { |
| 1311 | if (!w) { |
no test coverage detected