aboutsummaryrefslogtreecommitdiffstats
path: root/src/stored_playlist.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-23 09:54:32 +0200
committerMax Kellermann <max@duempel.org>2008-10-23 09:54:32 +0200
commit93598e28f48a6a2da332287a3b8c0966a99e66d9 (patch)
treec8c5a6b691d7c1b99f0555332ba344b485367f73 /src/stored_playlist.c
parent39f0c41fbf94f2ac078478867ff95a92a62480fb (diff)
downloadmpd-93598e28f48a6a2da332287a3b8c0966a99e66d9.tar.gz
mpd-93598e28f48a6a2da332287a3b8c0966a99e66d9.tar.xz
mpd-93598e28f48a6a2da332287a3b8c0966a99e66d9.zip
stored_playlist: renamed and moved spl_delete() to stored_playlist.c
The function deletePlaylist() shouldn't be in playlist.c.
Diffstat (limited to 'src/stored_playlist.c')
-rw-r--r--src/stored_playlist.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/stored_playlist.c b/src/stored_playlist.c
index cb81962d1..61d4d8cc3 100644
--- a/src/stored_playlist.c
+++ b/src/stored_playlist.c
@@ -266,6 +266,21 @@ spl_clear(const char *utf8path)
}
enum playlist_result
+spl_delete(const char *name_utf8)
+{
+ char filename[MPD_PATH_MAX];
+
+ utf8_to_fs_playlist_path(filename, name_utf8);
+
+ if (unlink(filename) < 0)
+ return errno == ENOENT
+ ? PLAYLIST_RESULT_NO_SUCH_LIST
+ : PLAYLIST_RESULT_ERRNO;
+
+ return PLAYLIST_RESULT_SUCCESS;
+}
+
+enum playlist_result
spl_remove_index(const char *utf8path, unsigned pos)
{
GPtrArray *list;