From b48ac2dfa355206d0a49169451f86c964a4c3e30 Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Wed, 2 Jun 2004 23:22:37 +0000 Subject: add urlhandlers command, but prolly not needed git-svn-id: https://svn.musicpd.org/mpd/trunk@1307 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/command.c | 8 ++++++++ src/decode.c | 1 + src/ls.c | 11 +++++++++++ src/ls.h | 2 ++ 4 files changed, 22 insertions(+) (limited to 'src') diff --git a/src/command.c b/src/command.c index 09f869ee0..044c811ab 100644 --- a/src/command.c +++ b/src/command.c @@ -73,6 +73,7 @@ #define COMMAND_SETVOL "setvol" #define COMMAND_PASSWORD "password" #define COMMAND_CROSSFADE "crossfade" +#define COMMAND_URL_HANDLERS "urlhandlers" #define COMMAND_STATUS_VOLUME "volume" #define COMMAND_STATUS_STATE "state" @@ -135,6 +136,12 @@ void addCommand(char * name, unsigned int reqPermission, int minargs, insertInList(commandList, cmd->cmd, cmd); } +int handleUrlHandlers(FILE * fp, unsigned int * permission, int argArrayLength, + char ** argArray) +{ + return printRemoteUrlHandlers(fp); +} + int handlePlay(FILE * fp, unsigned int * permission, int argArrayLength, char ** argArray) { @@ -628,6 +635,7 @@ void initCommands() { addCommand(COMMAND_SETVOL ,PERMISSION_CONTROL, 1, 1,handleSetVol,NULL); addCommand(COMMAND_PASSWORD ,0, 1, 1,handlePassword,NULL); addCommand(COMMAND_CROSSFADE ,PERMISSION_CONTROL, 1, 1,handleCrossfade,NULL); + addCommand(COMMAND_URL_HANDLERS,PERMISSION_READ, 0, 0,handleUrlHandlers,NULL); sortList(commandList); } diff --git a/src/decode.c b/src/decode.c index e01e63f67..d8f2fa21f 100644 --- a/src/decode.c +++ b/src/decode.c @@ -27,6 +27,7 @@ #include "log.h" #include "sig_handlers.h" #include "ls.h" +#include "utf8.h" #include #include diff --git a/src/ls.c b/src/ls.c index a12608894..74f37629e 100644 --- a/src/ls.c +++ b/src/ls.c @@ -48,6 +48,17 @@ static char * remoteUrlPrefixes[] = NULL }; +int printRemoteUrlHandlers(FILE * fp) { + char ** prefixes = remoteUrlPrefixes; + + while (*prefixes) { + myfprintf(fp,"handler: %s\n", *prefixes); + prefixes++; + } + + return 0; +} + int isValidRemoteUtf8Url(char * utf8url) { int ret = 0; char * lat1 = utf8StrToLatin1Dup(utf8url); diff --git a/src/ls.h b/src/ls.h index c297e1670..ba0cfcaa6 100644 --- a/src/ls.h +++ b/src/ls.h @@ -44,5 +44,7 @@ InputPlugin * isMusic(char * utf8file, time_t * mtime); char * dupAndStripPlaylistSuffix(char * file); +int printRemoteUrlHandlers(FILE * fp); + #endif /* vim:set shiftwidth=4 tabstop=8 expandtab: */ -- cgit v1.2.3