Tree-syntax table header: `key: N (cols: a b c)` — count first (agents * read scale before rows), column names once, rows indented beneath. */
| 245 | /* Tree-syntax table header: `key: N (cols: a b c)` — count first (agents |
| 246 | * read scale before rows), column names once, rows indented beneath. */ |
| 247 | void cbm_tree_table_header(cbm_sb_t *sb, const char *key, int n, const char *const *cols, |
| 248 | int ncols) { |
| 249 | char num[32]; |
| 250 | snprintf(num, sizeof(num), ": %d (cols:", n); |
| 251 | cbm_sb_append(sb, key); |
| 252 | cbm_sb_append(sb, num); |
| 253 | for (int i = 0; i < ncols; i++) { |
| 254 | cbm_sb_append_n(sb, " ", 1); |
| 255 | cbm_sb_append(sb, cols[i]); |
| 256 | } |
| 257 | cbm_sb_append_n(sb, ")\n", 2); |
| 258 | } |
| 259 | |
| 260 | void cbm_tree_row_begin(cbm_sb_t *sb) { |
| 261 | cbm_sb_append_n(sb, " ", 2); |
no test coverage detected