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

Function cbm_progress_sink_fn

src/cli/progress_sink.c:341–361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

339enum { HANDLER_COUNT = sizeof(handlers) / sizeof(handlers[0]) };
340
341void cbm_progress_sink_fn(const char *line) {
342 progress_sink_mutex_ensure();
343 cbm_mutex_lock(&s_sink_mutex);
344 if (!line || !s_out) {
345 cbm_mutex_unlock(&s_sink_mutex);
346 return;
347 }
348 char msg[CBM_SZ_64] = {0};
349 if (!extract_kv(line, "msg", msg, (int)sizeof(msg))) {
350 cbm_mutex_unlock(&s_sink_mutex);
351 return;
352 }
353 for (int i = 0; i < HANDLER_COUNT; i++) {
354 if (strcmp(msg, handlers[i].msg) == 0) {
355 handlers[i].handler(line);
356 cbm_mutex_unlock(&s_sink_mutex);
357 return;
358 }
359 }
360 cbm_mutex_unlock(&s_sink_mutex);
361}

Callers 3

test_cli.cFile · 0.85
cli_progress_race_workerFunction · 0.85

Calls 4

cbm_mutex_lockFunction · 0.85
cbm_mutex_unlockFunction · 0.85
extract_kvFunction · 0.85

Tested by 2

cli_progress_race_workerFunction · 0.68