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

Function on_extract_progress

src/cli/progress_sink.c:171–183  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

169
170/* Handle parallel.extract.progress event — in-place counter. */
171static void on_extract_progress(const char *line) {
172 char done[CBM_SZ_32] = {0};
173 char total[CBM_SZ_32] = {0};
174 if (extract_kv(line, "done", done, (int)sizeof(done)) &&
175 extract_kv(line, "total", total, (int)sizeof(total))) {
176 long d = strtol(done, NULL, CBM_DECIMAL_BASE);
177 long t = strtol(total, NULL, CBM_DECIMAL_BASE);
178 int pct = (t > 0) ? (int)((d * PERCENT) / t) : 0;
179 (void)fprintf(s_out, "\r Extracting: %ld/%ld files (%d%%)", d, t, pct);
180 (void)fflush(s_out);
181 atomic_store(&s_needs_newline, SKIP_ONE);
182 }
183}
184
185/* Event dispatch table. */
186typedef struct {

Callers

nothing calls this directly

Calls 1

extract_kvFunction · 0.85

Tested by

no test coverage detected