From ccea3654945809932a7b85b365af11f91b5a1ded Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 15 Jan 2009 22:00:26 +0100 Subject: tag: added tag_is_defined() tag_is_defined() checks whether there is any information in the tag object. --- src/tag.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/tag.h') diff --git a/src/tag.h b/src/tag.h index 2347801e..0c525b24 100644 --- a/src/tag.h +++ b/src/tag.h @@ -109,6 +109,15 @@ tag_is_empty(const struct tag *tag) return tag->numOfItems == 0; } +/** + * Returns true if the tag contains any information. + */ +static inline bool +tag_is_defined(const struct tag *tag) +{ + return !tag_is_empty(tag) || tag->time >= 0; +} + /** * Returns the first value of the specified tag type, or NULL if none * is present in this tag object. -- cgit v1.2.3