Code

screen_lyrics.c: Add function delete_lyr_hd
authorJonathan Neuschäfer <j.neuschaefer@gmx.net>
Sat, 3 Apr 2010 19:35:35 +0000 (21:35 +0200)
committerMax Kellermann <max@duempel.org>
Mon, 5 Apr 2010 17:05:00 +0000 (19:05 +0200)
src/screen_lyrics.c

index 6cb7b46efddf71590f40d010936a701f18b80d46..173fc5a2814c4832d2189fc097dd4c7c1cda1e49 100644 (file)
@@ -138,6 +138,21 @@ store_lyr_hd(void)
        return 0;
 }
 
+static int
+delete_lyr_hd(void)
+{
+       char path[1024];
+
+       if (!exists_lyr_file(current.artist, current.title))
+               return -1;
+
+       path_lyr_file(path, 1024, current.artist, current.title);
+       if (unlink(path) != 0)
+               return -2;
+
+       return 0;
+}
+
 static void
 screen_lyrics_set(const GString *str)
 {