Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
scols_table_get_nlines
scols_table_get_stream
scols_table_is_ascii
+scols_table_is_empty
scols_table_is_export
scols_table_is_max
scols_table_is_no_headings
extern int scols_table_is_raw(struct libscols_table *tb);
extern int scols_table_is_ascii(struct libscols_table *tb);
extern int scols_table_is_no_headings(struct libscols_table *tb);
+extern int scols_table_is_empty(struct libscols_table *tb);
extern int scols_table_is_export(struct libscols_table *tb);
extern int scols_table_is_max(struct libscols_table *tb);
extern int scols_table_is_tree(struct libscols_table *tb);
scols_table_get_nlines;
scols_table_get_stream;
scols_table_is_ascii;
+ scols_table_is_empty;
scols_table_is_export;
scols_table_is_max;
scols_table_is_no_headings;
return -EINVAL;
return tb->colors_wanted;
}
+
+/**
+ * scols_table_is_empty:
+ * @tb: table
+ *
+ * Returns: 1 if empty, 0 if not (or in case of an error).
+ */
+int scols_table_is_empty(struct libscols_table *tb)
+{
+ return !tb || !tb->nlines;
+}
/**
* scols_table_is_raw:
* @tb: table