diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2010-08-22 23:55:14 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2010-08-22 23:55:14 +0200 |
commit | 9aef30b0bc6eae8053969a6772d0dacadf0f6bab (patch) | |
tree | 29a15af3a4f47a59b60f17de6c7b7a2443df64ce | |
parent | 62a18a9e2bf67a83db4599459c55781d88e10e55 (diff) |
Implemented tag_get().
-rw-r--r-- | tag.c | 11 | ||||
-rw-r--r-- | tag.h | 1 |
2 files changed, 12 insertions, 0 deletions
@@ -70,3 +70,14 @@ struct tag *tag_read(const gchar *path) { return tag; } + +const gchar *tag_get(struct tag *tag, enum tag_type type) { + for(GSList *node = tag->fields; node; node = g_slist_next(node)) { + struct tag_field *field = node->data; + if(field->type == type) { + return field->string; + } + } + + return NULL; +} @@ -20,5 +20,6 @@ struct tag { void tag_list_all(const gchar *path); struct tag *tag_read(const gchar *path); +const gchar *tag_get(struct tag *tag, enum tag_type type); #endif |