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

Function on_extract_progress

src/cli/progress_sink.c:309–321  ·  view source on GitHub ↗

Handle parallel.extract.progress event — in-place counter. */

Source from the content-addressed store, hash-verified

307
308/* Handle parallel.extract.progress event — in-place counter. */
309static void on_extract_progress(const char *line) {
310 char done[CBM_SZ_32] = {0};
311 char total[CBM_SZ_32] = {0};
312 if (extract_kv(line, "done", done, (int)sizeof(done)) &&
313 extract_kv(line, "total", total, (int)sizeof(total))) {
314 long d = strtol(done, NULL, CBM_DECIMAL_BASE);
315 long t = strtol(total, NULL, CBM_DECIMAL_BASE);
316 int pct = (t > 0) ? (int)((d * PERCENT) / t) : 0;
317 (void)fprintf(s_out, "\r Extracting: %ld/%ld files (%d%%)", d, t, pct);
318 (void)fflush(s_out);
319 atomic_store(&s_needs_newline, SKIP_ONE);
320 }
321}
322
323/* Event dispatch table. */
324typedef struct {

Callers

nothing calls this directly

Calls 1

extract_kvFunction · 0.85

Tested by

no test coverage detected