aboutsummaryrefslogtreecommitdiffstats
path: root/src/song_save.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-04 18:47:42 +0100
committerMax Kellermann <max@duempel.org>2009-11-04 18:47:42 +0100
commita434c35eb46ff71e2b0441595dcc7985e1b292c2 (patch)
tree073d3e51ab3a11090afecda68d6530415908ef79 /src/song_save.c
parent7af8c88e37610fe7ebb167fadc28656385705d18 (diff)
downloadmpd-a434c35eb46ff71e2b0441595dcc7985e1b292c2.tar.gz
mpd-a434c35eb46ff71e2b0441595dcc7985e1b292c2.tar.xz
mpd-a434c35eb46ff71e2b0441595dcc7985e1b292c2.zip
tag: added function tag_name_parse()
Convert a string into a tag_type enum.
Diffstat (limited to 'src/song_save.c')
-rw-r--r--src/song_save.c15
1 files changed, 1 insertions, 14 deletions
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);