From: Karel Zak Date: Fri, 22 Nov 2013 09:07:36 +0000 (+0100) Subject: include/tt: add tt_is_empty() X-Git-Tag: v2.25-rc1~541 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=11fd5edb9d59f25f549b98101a4ff69442ae0e4f;p=thirdparty%2Futil-linux.git include/tt: add tt_is_empty() Signed-off-by: Karel Zak --- 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 */