From 2e72a9b262ac71a8a7e8ed9b00efa80597d5f17d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 17 Mar 2010 23:12:21 +0100 Subject: tag: added function tag_merge_replace() Like tag_merge(), but can deal with NULL parameters, and frees both tag objects. --- 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 4b72dd18..75a86b38 100644 --- a/src/tag.h +++ b/src/tag.h @@ -165,6 +165,15 @@ struct tag *tag_dup(const struct tag *tag); struct tag * tag_merge(const struct tag *base, const struct tag *add); +/** + * Merges the data from two tags. Any of the two may be NULL. Both + * are freed by this function. + * + * @return a newly allocated tag, which must be freed with tag_free() + */ +struct tag * +tag_merge_replace(struct tag *base, struct tag *add); + /** * Returns true if the tag contains no items. This ignores the "time" * attribute. -- cgit v1.2.3