From c8794b11f2d80a39cd3d7edd91406cafdffbb908 Mon Sep 17 00:00:00 2001 From: Robert Kessl Date: Wed, 25 Jun 2014 12:10:20 +0200 Subject: [PATCH] tableprinter: add of table_clean_row --- ucw/table.c | 8 ++++++++ ucw/table.h | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/ucw/table.c b/ucw/table.c index cc3c9add..b3d2ed20 100644 --- a/ucw/table.c +++ b/ucw/table.c @@ -321,6 +321,14 @@ void table_end_row(struct table *tbl) tbl->row_printing_started = 0; } +void table_clean_row(struct table *tbl) +{ + memset(tbl->col_str_ptrs, 0, sizeof(char *) * tbl->column_count); + mp_restore(tbl->pool, &tbl->pool_state); + tbl->last_printed_col = -1; + tbl->row_printing_started = 0; +} + /* Construction of a cell using a fastbuf */ struct fastbuf *table_col_fbstart(struct table *tbl, int col) diff --git a/ucw/table.h b/ucw/table.h index 1e771f86..0244d759 100644 --- a/ucw/table.h +++ b/ucw/table.h @@ -257,6 +257,11 @@ const char *table_set_col_order_by_name(struct table *tbl, const char *col_order **/ void table_end_row(struct table *tbl); +/** + * Cleans current row, When called. + **/ +void table_clean_row(struct table *tbl); + /** * Prints a string that is printf-like formated into a particular column. This function does not check the * type of the column, i.e., it can be used to print double into an int column -- 2.39.2