Signed-off-by: Karel Zak <kzak@redhat.com>
extern int scols_table_set_stream(struct libscols_table *tb, FILE *stream);
extern FILE *scols_table_get_stream(struct libscols_table *tb);
+extern int scols_table_reduce_termwidth(struct libscols_table *tb, size_t reduce);
/* table_print.c */
extern int scols_print_table(struct libscols_table *tb);
size_t ncols; /* number of columns */
size_t nlines; /* number of lines */
size_t termwidth; /* terminal width */
+ size_t termreduce; /* extra blank space */
int is_term; /* is a tty? */
int flags;
int first_run;
return tb ? tb->out: NULL;
}
+int scols_table_reduce_termwidth(struct libscols_table *tb, size_t reduce)
+{
+ assert(tb);
+ if (!tb)
+ return -EINVAL;
+
+ tb->termreduce = reduce;
+ return 0;
+}
+
/*
* @tb: table
* @: number of column (0..N)
tb->termwidth = get_terminal_width();
if (tb->termwidth <= 0)
tb->termwidth = 80;
+ tb->termwidth -= tb->termreduce;
}
line_sz = tb->termwidth;