[A] Add function ft_row_count

This commit is contained in:
seleznevae
2020-01-10 21:22:41 +03:00
parent c81d23e468
commit 628b509991
10 changed files with 67 additions and 8 deletions

View File

@@ -224,10 +224,13 @@ void ft_set_cur_cell(ft_table_t *table, size_t row, size_t col)
int ft_is_empty(const ft_table_t *table)
{
assert(table);
if (table->rows == NULL || (vector_size(table->rows) == 0))
return 1;
else
return 0;
return ft_row_count(table) == 0;
}
size_t ft_row_count(const ft_table_t *table)
{
assert(table && table->rows);
return vector_size(table->rows);
}
static int ft_row_printf_impl_(ft_table_t *table, size_t row, const struct f_string_view *fmt, va_list *va)