From a434c35eb46ff71e2b0441595dcc7985e1b292c2 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 4 Nov 2009 18:47:42 +0100 Subject: tag: added function tag_name_parse() Convert a string into a tag_type enum. --- src/song_save.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'src/song_save.c') diff --git a/src/song_save.c b/src/song_save.c index d2c5175b3..075fb6e7a 100644 --- a/src/song_save.c +++ b/src/song_save.c @@ -61,19 +61,6 @@ void songvec_save(FILE *fp, struct songvec *sv) songvec_for_each(sv, song_save, fp); } -static enum tag_type -parse_tag_name(const char *name) -{ - int i; - - for (i = 0; i < TAG_NUM_OF_ITEM_TYPES; i++) { - if (strcmp(name, tag_item_names[i]) == 0) - return i; - } - - return TAG_NUM_OF_ITEM_TYPES; -} - struct song * song_load(FILE *fp, struct directory *parent, const char *uri, GString *buffer, GError **error_r) @@ -99,7 +86,7 @@ song_load(FILE *fp, struct directory *parent, const char *uri, *colon++ = 0; value = g_strchug(colon); - if ((type = parse_tag_name(line)) != TAG_NUM_OF_ITEM_TYPES) { + if ((type = tag_name_parse(line)) != TAG_NUM_OF_ITEM_TYPES) { if (!song->tag) { song->tag = tag_new(); tag_begin_add(song->tag); -- cgit v1.2.3