aboutsummaryrefslogtreecommitdiff
path: root/src/tag_table.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-02-11 10:37:59 +0100
committerMax Kellermann <max@duempel.org>2012-02-11 12:37:24 +0100
commit9e5a49b8cb6d655bdab52232f390a4faa9253f99 (patch)
treeb7d0cae68a9b2f7106d5952a64c2761611999d30 /src/tag_table.h
parent767ade02f4af8cdb6b7de293d0bd433bc7fd24cf (diff)
tag_id3: use the tag_table library for TXXX
Diffstat (limited to 'src/tag_table.h')
-rw-r--r--src/tag_table.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/tag_table.h b/src/tag_table.h
index ecb3805d..d87d4869 100644
--- a/src/tag_table.h
+++ b/src/tag_table.h
@@ -31,6 +31,22 @@ struct tag_table {
};
/**
+ * 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
* in the table.