added "notcommands" command

git-svn-id: https://svn.musicpd.org/mpd/trunk@2738 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Warren Dukes 2004-11-23 19:46:33 +00:00
parent 3a89afdd80
commit 498fe12702
1 changed files with 21 additions and 0 deletions

View File

@ -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);
}