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

Function tree_render_table_direct

src/mcp/compact_out.c:518–537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

516}
517
518static 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
539static int tree_string_ptr_compare(const void *left, const void *right) {
540 const char *const *a = (const char *const *)left;

Callers 1

tree_table_rows_implFunction · 0.85

Calls 7

cbm_tree_table_headerFunction · 0.85
cbm_tree_row_beginFunction · 0.85
tree_column_is_stringFunction · 0.85
cbm_tree_cell_strFunction · 0.85
cbm_sb_append_nFunction · 0.85
cbm_sb_appendFunction · 0.85
cbm_tree_row_endFunction · 0.85

Tested by

no test coverage detected