aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-11-23 19:46:33 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-11-23 19:46:33 +0000
commit498fe127023a62c40c2fc059a73b0cd923ce2c3b (patch)
tree931583856becb3b273fc834304e0f0f42d904814 /src
parent3a89afdd80f228139554372a83a9d74486acf691 (diff)
downloadmpd-498fe127023a62c40c2fc059a73b0cd923ce2c3b.tar.gz
mpd-498fe127023a62c40c2fc059a73b0cd923ce2c3b.tar.xz
mpd-498fe127023a62c40c2fc059a73b0cd923ce2c3b.zip
added "notcommands" command
git-svn-id: https://svn.musicpd.org/mpd/trunk@2738 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/command.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/command.c b/src/command.c
index 637ef838e..818698fb2 100644
--- a/src/command.c
+++ b/src/command.c
@@ -87,6 +87,7 @@
#define COMMAND_DISABLE_DEV "disableoutput"
#define COMMAND_DEVICES "outputs"
#define COMMAND_COMMANDS "commands"
+#define COMMAND_NOTCOMMANDS "notcommands"
#define COMMAND_STATUS_VOLUME "volume"
#define COMMAND_STATUS_STATE "state"
@@ -892,6 +893,25 @@ int handleCommands(FILE * fp, unsigned int * permission, int argArrayLength,
return 0;
}
+int handleNotcommands(FILE * fp, unsigned int * permission, int argArrayLength,
+ char ** argArray)
+{
+ ListNode * node = commandList->firstNode;
+ CommandEntry * cmd;
+
+ while(node != NULL) {
+ cmd = (CommandEntry *) node->data;
+
+ if(!(*permission & cmd->reqPermission)) {
+ myfprintf(fp, "command: %s\n", cmd->cmd);
+ }
+
+ node = node->nextNode;
+ }
+
+ return 0;
+}
+
void initCommands() {
commandList = makeList(free, 1);
@@ -945,6 +965,7 @@ void initCommands() {
addCommand(COMMAND_DISABLE_DEV ,PERMISSION_ADMIN, 1, 1,handleDisableDevice,NULL);
addCommand(COMMAND_DEVICES ,PERMISSION_ADMIN, 0, 0,handleDevices,NULL);
addCommand(COMMAND_COMMANDS ,0, 0, 0,handleCommands,NULL);
+ addCommand(COMMAND_NOTCOMMANDS ,0, 0, 0,handleNotcommands,NULL);
sortList(commandList);
}