]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
include/tt: add tt_is_empty()
authorKarel Zak <kzak@redhat.com>
Fri, 22 Nov 2013 09:07:36 +0000 (10:07 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 11 Mar 2014 10:35:11 +0000 (11:35 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
include/tt.h

index 0a16c207539e20a77c67907d640eebcd3f928002..6ae8de3b20fcd17bd55897d7fafbca31ab314973 100644 (file)
@@ -93,4 +93,9 @@ extern int tt_line_set_userdata(struct tt_line *ln, void *data);
 extern void tt_fputs_quoted(const char *data, FILE *out);
 extern void tt_fputs_nonblank(const char *data, FILE *out);
 
+static inline int tt_is_empty(struct tt *tb)
+{
+       return !tb || list_empty(&tb->tb_lines);
+}
+
 #endif /* UTIL_LINUX_TT_H */