| 201 | enum { HANDLER_COUNT = sizeof(handlers) / sizeof(handlers[0]) }; |
| 202 | |
| 203 | void cbm_progress_sink_fn(const char *line) { |
| 204 | if (!line || !s_out) { |
| 205 | return; |
| 206 | } |
| 207 | char msg[CBM_SZ_64] = {0}; |
| 208 | if (!extract_kv(line, "msg", msg, (int)sizeof(msg))) { |
| 209 | return; |
| 210 | } |
| 211 | for (int i = 0; i < HANDLER_COUNT; i++) { |
| 212 | if (strcmp(msg, handlers[i].msg) == 0) { |
| 213 | handlers[i].handler(line); |
| 214 | return; |
| 215 | } |
| 216 | } |
| 217 | } |
nothing calls this directly
no test coverage detected