aboutsummaryrefslogtreecommitdiffstats
path: root/src/command.c
diff options
context:
space:
mode:
authorJ. Alexander Treuman <jat@spatialrift.net>2007-05-24 18:07:19 +0000
committerJ. Alexander Treuman <jat@spatialrift.net>2007-05-24 18:07:19 +0000
commit7ba357a04e75c51f898e9418cab24d10c74ab37c (patch)
treea607055f440379beb1ea54dc6eb116a796c39ed9 /src/command.c
parent0d7d2ebf80be04864eff70369d7aa88a5670806a (diff)
downloadmpd-7ba357a04e75c51f898e9418cab24d10c74ab37c.tar.gz
mpd-7ba357a04e75c51f898e9418cab24d10c74ab37c.tar.xz
mpd-7ba357a04e75c51f898e9418cab24d10c74ab37c.zip
Adding rename command, for renaming stored playlists.
git-svn-id: https://svn.musicpd.org/mpd/trunk@6246 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/command.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/command.c b/src/command.c
index c8f39472d..84a30db2b 100644
--- a/src/command.c
+++ b/src/command.c
@@ -100,6 +100,7 @@
#define COMMAND_PLAYLISTDELETE "playlistdelete"
#define COMMAND_TAGTYPES "tagtypes"
#define COMMAND_COUNT "count"
+#define COMMAND_RENAME "rename"
#define COMMAND_STATUS_VOLUME "volume"
#define COMMAND_STATUS_STATE "state"
@@ -421,6 +422,11 @@ static int handleRm(int fd, int *permission, int argc, char *argv[])
return deletePlaylist(fd, argv[1]);
}
+static int handleRename(int fd, int *permission, int argc, char *argv[])
+{
+ return renameStoredPlaylist(fd, argv[1], argv[2]);
+}
+
static int handlePlaylistChanges(int fd, int *permission,
int argc, char *argv[])
{
@@ -1117,6 +1123,7 @@ void initCommands(void)
addCommand(COMMAND_PLAYLISTDELETE, PERMISSION_CONTROL, 2, 2, handlePlaylistDelete, NULL);
addCommand(COMMAND_TAGTYPES, PERMISSION_READ, 0, 0, handleTagTypes, NULL);
addCommand(COMMAND_COUNT, PERMISSION_READ, 2, -1, handleCount, NULL);
+ addCommand(COMMAND_RENAME, PERMISSION_CONTROL, 2, 2, handleRename, NULL);
sortList(commandList);
}