tag: added function tag_merge_replace()

Like tag_merge(), but can deal with NULL parameters, and frees both
tag objects.
This commit is contained in:
Max Kellermann
2010-03-17 23:12:21 +01:00
parent 96033e4b4e
commit 2e72a9b262
3 changed files with 26 additions and 21 deletions

View File

@@ -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.