]> mj.ucw.cz Git - libucw.git/commitdiff
tableprinter: add of table_clean_row
authorRobert Kessl <kesslr@centrum.cz>
Wed, 25 Jun 2014 10:10:20 +0000 (12:10 +0200)
committerRobert Kessl <kesslr@centrum.cz>
Wed, 25 Jun 2014 10:10:20 +0000 (12:10 +0200)
ucw/table.c
ucw/table.h

index cc3c9add3701865b8e340bf54aa313b5c4b61217..b3d2ed20c0d73a8cac32424626a9c0448578386d 100644 (file)
@@ -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)
index 1e771f86b1be8cba42b3a36b60a328418ea1199d..0244d75978c62a1446046074953467df63f2cd48 100644 (file)
@@ -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