From 11fd5edb9d59f25f549b98101a4ff69442ae0e4f Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 22 Nov 2013 10:07:36 +0100 Subject: [PATCH] include/tt: add tt_is_empty() Signed-off-by: Karel Zak --- include/tt.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/tt.h b/include/tt.h index 0a16c20753..6ae8de3b20 100644 --- a/include/tt.h +++ b/include/tt.h @@ -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 */ -- 2.47.3