X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=ucw%2Ftable-test-align.c;h=eb22f2e24b511919ef908ce732c75ea7d729298b;hb=dbadbb6cd3cb9c845205b1dc3883a76dc36ac7fa;hp=f0ddfaf0199b99349b397f5254def3db1e77f76c;hpb=bcccb399f05d8b2cf90a1df330cb0a4b032ae8c8;p=libucw.git diff --git a/ucw/table-test-align.c b/ucw/table-test-align.c index f0ddfaf0..eb22f2e2 100644 --- a/ucw/table-test-align.c +++ b/ucw/table-test-align.c @@ -14,20 +14,19 @@ enum test_table_cols { test_col0_str, test_col1_int, test_col2_uint, test_col3_bool, test_col4_double }; -static struct table test_tbl = { +static struct table_template test_tbl = { TBL_COLUMNS { [test_col0_str] = TBL_COL_STR("col0_str", 30 | CELL_ALIGN_LEFT), [test_col1_int] = TBL_COL_INT("col1_int", 8), [test_col2_uint] = TBL_COL_UINT("col2_uint", 9), [test_col3_bool] = TBL_COL_BOOL("col3_bool", 9 | CELL_ALIGN_LEFT), - [test_col4_double] = TBL_COL_DOUBLE("col4_double", 11 | CELL_ALIGN_LEFT, 5), + [test_col4_double] = TBL_COL_DOUBLE_FMT("col4_double", 11 | CELL_ALIGN_LEFT, XTYPE_FMT_DEFAULT), TBL_COL_END }, TBL_OUTPUT_HUMAN_READABLE, TBL_COL_DELIMITER("\t"), }; -static int test_to_perform = -1; static char **cli_table_opts; static struct opt_section table_printer_opts = { @@ -99,11 +98,11 @@ int main(int argc UNUSED, char **argv) struct fastbuf *out; out = bfdopen_shared(1, 4096); - table_init(&test_tbl); - process_command_line_opts(argv, &test_tbl); + struct table *tbl = table_init(&test_tbl); + process_command_line_opts(argv, tbl); - print_table(&test_tbl, out); - table_cleanup(&test_tbl); + print_table(tbl, out); + table_cleanup(tbl); bclose(out); return 0;