- ASSERT_MSG(col < tbl->column_count && col >= 0, "Table column %d does not exist.", col);
- ASSERT(tbl->columns[col].type == COL_TYPE_ANY || COL_TYPE_SIZE == tbl->columns[col].type);
-
- tbl->last_printed_col = col;
- tbl->row_printing_started = 1;
-
- static u64 unit_div[] = {
- [UNIT_BYTE] = (u64) 1,
- [UNIT_KILOBYTE] = (u64) 1024LLU,
- [UNIT_MEGABYTE] = (u64) (1024LLU * 1024LLU),
- [UNIT_GIGABYTE] = (u64) (1024LLU * 1024LLU * 1024LLU),
- [UNIT_TERABYTE] = (u64) (1024LLU * 1024LLU * 1024LLU * 1024LLU)
- };
-
- TBL_COL_ITER(tbl, col, curr_col, curr_col_idx) {
- // FIXME: do some rounding?
- uint out_type = 0;
- if(curr_col->output_type == CELL_OUT_UNINITIALIZED) {
- val = val / unit_div[UNIT_BYTE];
- out_type = 0;
- } else {
- val = val / unit_div[curr_col->output_type];
- out_type = curr_col->output_type;
- }
-
- curr_col->cell_content = mp_printf(tbl->pool, "%lu%s", val, unit_suffix[out_type]);