From 9e5a49b8cb6d655bdab52232f390a4faa9253f99 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 11 Feb 2012 10:37:59 +0100 Subject: tag_id3: use the tag_table library for TXXX --- src/tag_table.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/tag_table.h') diff --git a/src/tag_table.h b/src/tag_table.h index ecb3805d2..d87d4869a 100644 --- a/src/tag_table.h +++ b/src/tag_table.h @@ -30,6 +30,22 @@ struct tag_table { enum tag_type type; }; +/** + * Looks up a string in a tag translation table (case sensitive). + * Returns TAG_NUM_OF_ITEM_TYPES if the specified name was not found + * in the table. + */ +G_GNUC_PURE +static inline enum tag_type +tag_table_lookup(const struct tag_table *table, const char *name) +{ + for (; table->name != NULL; ++table) + if (strcmp(name, table->name) == 0) + return table->type; + + return TAG_NUM_OF_ITEM_TYPES; +} + /** * Looks up a string in a tag translation table (case insensitive). * Returns TAG_NUM_OF_ITEM_TYPES if the specified name was not found -- cgit v1.2.3