[C] Changed main header file
This commit is contained in:
@@ -7,10 +7,10 @@
|
||||
static FTABLE *create_basic_table()
|
||||
{
|
||||
FTABLE *table = ft_create_table();
|
||||
ft_set_cell_option(table, FT_ANY_ROW, 0, FT_OPT_TEXT_ALIGN, CenterAligned);
|
||||
ft_set_cell_option(table, FT_ANY_ROW, 1, FT_OPT_TEXT_ALIGN, LeftAligned);
|
||||
ft_set_option(table, FT_ANY_ROW, 0, FT_OPT_TEXT_ALIGN, CenterAligned);
|
||||
ft_set_option(table, FT_ANY_ROW, 1, FT_OPT_TEXT_ALIGN, LeftAligned);
|
||||
|
||||
ft_set_cell_option(table, 0, FT_ANY_COLUMN, FT_OPT_ROW_TYPE, Header);
|
||||
ft_set_option(table, 0, FT_ANY_COLUMN, FT_OPT_ROW_TYPE, Header);
|
||||
FT_NWRITE_LN(table, "Rank", "Title", "Year", "Rating");
|
||||
|
||||
FT_NWRITE_LN(table, "1", "The Shawshank Redemption", "1994", "9.5");
|
||||
@@ -33,10 +33,10 @@ int main()
|
||||
|
||||
|
||||
table = ft_create_table();
|
||||
ft_set_cell_option(table, FT_ANY_ROW, 0, FT_OPT_TEXT_ALIGN, CenterAligned);
|
||||
ft_set_cell_option(table, FT_ANY_ROW, 1, FT_OPT_TEXT_ALIGN, LeftAligned);
|
||||
ft_set_option(table, FT_ANY_ROW, 0, FT_OPT_TEXT_ALIGN, CenterAligned);
|
||||
ft_set_option(table, FT_ANY_ROW, 1, FT_OPT_TEXT_ALIGN, LeftAligned);
|
||||
|
||||
ft_set_cell_option(table, 0, FT_ANY_COLUMN, FT_OPT_ROW_TYPE, Header);
|
||||
ft_set_option(table, 0, FT_ANY_COLUMN, FT_OPT_ROW_TYPE, Header);
|
||||
FT_NWWRITE_LN(table, L"Rank", L"Title", L"Year", L"Rating");
|
||||
|
||||
FT_NWWRITE_LN(table, L"1", L"Побег из Шоушенка", L"1994", L"9.5");
|
||||
@@ -59,10 +59,10 @@ int main()
|
||||
|
||||
/*-------------------------------------------------------------*/
|
||||
table = ft_create_table();
|
||||
ft_set_cell_option(table, FT_ANY_ROW, 0, FT_OPT_TEXT_ALIGN, CenterAligned);
|
||||
ft_set_cell_option(table, FT_ANY_ROW, 1, FT_OPT_TEXT_ALIGN, LeftAligned);
|
||||
ft_set_option(table, FT_ANY_ROW, 0, FT_OPT_TEXT_ALIGN, CenterAligned);
|
||||
ft_set_option(table, FT_ANY_ROW, 1, FT_OPT_TEXT_ALIGN, LeftAligned);
|
||||
|
||||
ft_set_cell_option(table, 0, FT_ANY_COLUMN, FT_OPT_ROW_TYPE, Header);
|
||||
ft_set_option(table, 0, FT_ANY_COLUMN, FT_OPT_ROW_TYPE, Header);
|
||||
ft_printf_ln(table, "%d|%s|%5.2f km/s", 1, "Mercury", 47.362);
|
||||
|
||||
ft_printf_ln(table, "%d|%s|%5.2f km/s", 1, "Mercury", 47.362);
|
||||
@@ -76,10 +76,10 @@ int main()
|
||||
/*-------------------------------------------------------------*/
|
||||
|
||||
table = ft_create_table();
|
||||
ft_set_cell_option(table, FT_ANY_ROW, 0, FT_OPT_TEXT_ALIGN, CenterAligned);
|
||||
ft_set_cell_option(table, FT_ANY_ROW, 1, FT_OPT_TEXT_ALIGN, LeftAligned);
|
||||
ft_set_option(table, FT_ANY_ROW, 0, FT_OPT_TEXT_ALIGN, CenterAligned);
|
||||
ft_set_option(table, FT_ANY_ROW, 1, FT_OPT_TEXT_ALIGN, LeftAligned);
|
||||
|
||||
ft_set_cell_option(table, 0, FT_ANY_COLUMN, FT_OPT_ROW_TYPE, Header);
|
||||
ft_set_option(table, 0, FT_ANY_COLUMN, FT_OPT_ROW_TYPE, Header);
|
||||
ft_printf_ln(table, "Rank|Title|Year|Rating");
|
||||
|
||||
FT_NWRITE_LN(table, "1", "The Shawshank Redemption", "1994", "9.5");
|
||||
@@ -95,10 +95,10 @@ int main()
|
||||
/*-------------------------------------------------------------*/
|
||||
|
||||
table = ft_create_table();
|
||||
ft_set_cell_option(table, FT_ANY_ROW, 0, FT_OPT_TEXT_ALIGN, LeftAligned);
|
||||
ft_set_cell_option(table, FT_ANY_ROW, 1, FT_OPT_TEXT_ALIGN, CenterAligned);
|
||||
ft_set_option(table, FT_ANY_ROW, 0, FT_OPT_TEXT_ALIGN, LeftAligned);
|
||||
ft_set_option(table, FT_ANY_ROW, 1, FT_OPT_TEXT_ALIGN, CenterAligned);
|
||||
|
||||
ft_set_cell_option(table, 0, FT_ANY_COLUMN, FT_OPT_ROW_TYPE, Header);
|
||||
ft_set_option(table, 0, FT_ANY_COLUMN, FT_OPT_ROW_TYPE, Header);
|
||||
ft_printf_ln(table, "Commodity|Farm price|Avg. spread");
|
||||
|
||||
const char *row1[] = {"Potatoes", "$1.60", "200.94%"};
|
||||
@@ -113,10 +113,10 @@ int main()
|
||||
/*-------------------------------------------------------------*/
|
||||
|
||||
table = ft_create_table();
|
||||
ft_set_cell_option(table, FT_ANY_ROW, 0, FT_OPT_TEXT_ALIGN, LeftAligned);
|
||||
ft_set_cell_option(table, FT_ANY_ROW, 1, FT_OPT_TEXT_ALIGN, CenterAligned);
|
||||
ft_set_option(table, FT_ANY_ROW, 0, FT_OPT_TEXT_ALIGN, LeftAligned);
|
||||
ft_set_option(table, FT_ANY_ROW, 1, FT_OPT_TEXT_ALIGN, CenterAligned);
|
||||
|
||||
ft_set_cell_option(table, 0, FT_ANY_COLUMN, FT_OPT_ROW_TYPE, Header);
|
||||
ft_set_option(table, 0, FT_ANY_COLUMN, FT_OPT_ROW_TYPE, Header);
|
||||
ft_printf_ln(table, "No.|Name|Avg. Mark");
|
||||
const char *ctab[2][3] = {
|
||||
{"1", "Joe Public", "3.14"},
|
||||
@@ -133,10 +133,10 @@ int main()
|
||||
|
||||
|
||||
table = ft_create_table();
|
||||
ft_set_cell_option(table, FT_ANY_ROW, 0, FT_OPT_TEXT_ALIGN, CenterAligned);
|
||||
ft_set_cell_option(table, FT_ANY_ROW, 1, FT_OPT_TEXT_ALIGN, LeftAligned);
|
||||
ft_set_option(table, FT_ANY_ROW, 0, FT_OPT_TEXT_ALIGN, CenterAligned);
|
||||
ft_set_option(table, FT_ANY_ROW, 1, FT_OPT_TEXT_ALIGN, LeftAligned);
|
||||
|
||||
ft_set_cell_option(table, 0, FT_ANY_COLUMN, FT_OPT_ROW_TYPE, Header);
|
||||
ft_set_option(table, 0, FT_ANY_COLUMN, FT_OPT_ROW_TYPE, Header);
|
||||
ft_printf_ln(table, "No.|Name|Avg. Mark");
|
||||
const char **tab[2] = {
|
||||
row1,
|
||||
@@ -151,27 +151,27 @@ int main()
|
||||
|
||||
/*---------------- Different styles --------------------*/
|
||||
|
||||
ft_set_default_borders(FT_BASIC_STYLE);
|
||||
ft_set_default_border_style(FT_BASIC_STYLE);
|
||||
table = create_basic_table();
|
||||
printf("Table:\n%s\n", ft_to_string(table));
|
||||
ft_destroy_table(table);
|
||||
|
||||
ft_set_default_borders(FT_SIMPLE_STYLE);
|
||||
ft_set_default_border_style(FT_SIMPLE_STYLE);
|
||||
table = create_basic_table();
|
||||
printf("Table:\n%s\n", ft_to_string(table));
|
||||
ft_destroy_table(table);
|
||||
|
||||
ft_set_default_borders(FT_PLAIN_STYLE);
|
||||
ft_set_default_border_style(FT_PLAIN_STYLE);
|
||||
table = create_basic_table();
|
||||
printf("Table:\n%s\n", ft_to_string(table));
|
||||
ft_destroy_table(table);
|
||||
|
||||
ft_set_default_borders(FT_DOT_STYLE);
|
||||
ft_set_default_border_style(FT_DOT_STYLE);
|
||||
table = create_basic_table();
|
||||
printf("Table:\n%s\n", ft_to_string(table));
|
||||
ft_destroy_table(table);
|
||||
|
||||
ft_set_default_borders(FT_EMPTY_STYLE);
|
||||
ft_set_default_border_style(FT_EMPTY_STYLE);
|
||||
table = create_basic_table();
|
||||
printf("Table:\n%s\n", ft_to_string(table));
|
||||
ft_destroy_table(table);
|
||||
|
Reference in New Issue
Block a user