Tree-syntax table header: `key: N (cols: a b c)` — count first (agents * read scale before rows), column names once, rows indented beneath. */
| 392 | /* Tree-syntax table header: `key: N (cols: a b c)` — count first (agents |
| 393 | * read scale before rows), column names once, rows indented beneath. */ |
| 394 | void cbm_tree_table_header(cbm_sb_t *sb, const char *key, int n, const char *const *cols, |
| 395 | int ncols) { |
| 396 | char num[32]; |
| 397 | snprintf(num, sizeof(num), ": %d (cols:", n); |
| 398 | append_key(sb, key); |
| 399 | cbm_sb_append(sb, num); |
| 400 | for (int i = 0; i < ncols; i++) { |
| 401 | cbm_sb_append_n(sb, " ", 1); |
| 402 | append_key(sb, cols[i]); |
| 403 | } |
| 404 | cbm_sb_append_n(sb, ")\n", 2); |
| 405 | } |
| 406 | |
| 407 | void cbm_tree_row_begin(cbm_sb_t *sb) { |
| 408 | cbm_sb_append_n(sb, " ", 2); |
no test coverage detected