| 516 | } |
| 517 | |
| 518 | static void tree_render_table_direct(cbm_sb_t *sb, const char *key, int nrows, |
| 519 | const char *const *cols, int ncols, const char *const *cells, |
| 520 | const bool *string_cols) { |
| 521 | cbm_tree_table_header(sb, key, nrows, cols, ncols); |
| 522 | for (int row = 0; row < nrows; row++) { |
| 523 | cbm_tree_row_begin(sb); |
| 524 | for (int col = 0; col < ncols; col++) { |
| 525 | const char *value = cells[(size_t)row * (size_t)ncols + (size_t)col]; |
| 526 | if (tree_column_is_string(string_cols, col)) { |
| 527 | cbm_tree_cell_str(sb, value, col == 0); |
| 528 | } else { |
| 529 | if (col > 0) { |
| 530 | cbm_sb_append_n(sb, " ", 1); |
| 531 | } |
| 532 | cbm_sb_append(sb, value ? value : "null"); |
| 533 | } |
| 534 | } |
| 535 | cbm_tree_row_end(sb); |
| 536 | } |
| 537 | } |
| 538 | |
| 539 | static int tree_string_ptr_compare(const void *left, const void *right) { |
| 540 | const char *const *a = (const char *const *)left; |
no test coverage detected