Signed-off-by: Karel Zak <kzak@redhat.com>
extern void tt_fputs_quoted(const char *data, FILE *out);
extern void tt_fputs_nonblank(const char *data, FILE *out);
+extern size_t tb_get_nlines(struct tt *tb);
+
static inline int tt_is_empty(struct tt *tb)
{
return !tb || list_empty(&tb->tb_lines);
tb->out = out;
}
+size_t tb_get_nlines(struct tt *tb)
+{
+ struct list_head *p;
+ size_t ct = 0;
+
+ if (tt_is_empty(tb))
+ return 0;
+
+ list_for_each(p, &tb->tb_lines)
+ ct++;
+ return ct;
+}
+
void tt_remove_lines(struct tt *tb)
{
if (!tb)