aboutsummaryrefslogtreecommitdiffstats
path: root/src/command/AllCommands.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-08-11 22:11:28 +0200
committerMax Kellermann <max@duempel.org>2015-08-11 22:43:10 +0200
commit0f92d021a1dc2992352b635846428229d2c9ffbb (patch)
tree428bb5673728c67cf1fd29672609c9e367ad9da0 /src/command/AllCommands.cxx
parentcbdc3194cc20aa5abcce8b53c44d46a96002ad3a (diff)
downloadmpd-0f92d021a1dc2992352b635846428229d2c9ffbb.tar.gz
mpd-0f92d021a1dc2992352b635846428229d2c9ffbb.tar.xz
mpd-0f92d021a1dc2992352b635846428229d2c9ffbb.zip
command/Request: new struct wrapping ConstBuffer<const char *>
Diffstat (limited to '')
-rw-r--r--src/command/AllCommands.cxx17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/command/AllCommands.cxx b/src/command/AllCommands.cxx
index bd232efda..9f0b0a606 100644
--- a/src/command/AllCommands.cxx
+++ b/src/command/AllCommands.cxx
@@ -19,6 +19,7 @@
#include "config.h"
#include "AllCommands.hxx"
+#include "Request.hxx"
#include "QueueCommands.hxx"
#include "TagCommands.hxx"
#include "PlayerCommands.hxx"
@@ -62,15 +63,15 @@ struct command {
unsigned permission;
int min;
int max;
- CommandResult (*handler)(Client &client, ConstBuffer<const char *> args);
+ CommandResult (*handler)(Client &client, Request args);
};
/* don't be fooled, this is the command handler for "commands" command */
static CommandResult
-handle_commands(Client &client, ConstBuffer<const char *> args);
+handle_commands(Client &client, Request args);
static CommandResult
-handle_not_commands(Client &client, ConstBuffer<const char *> args);
+handle_not_commands(Client &client, Request args);
/**
* The command registry.
@@ -227,7 +228,7 @@ command_available(gcc_unused const Partition &partition,
/* don't be fooled, this is the command handler for "commands" command */
static CommandResult
-handle_commands(Client &client, gcc_unused ConstBuffer<const char *> args)
+handle_commands(Client &client, gcc_unused Request args)
{
const unsigned permission = client.GetPermission();
@@ -243,7 +244,7 @@ handle_commands(Client &client, gcc_unused ConstBuffer<const char *> args)
}
static CommandResult
-handle_not_commands(Client &client, gcc_unused ConstBuffer<const char *> args)
+handle_not_commands(Client &client, gcc_unused Request args)
{
const unsigned permission = client.GetPermission();
@@ -295,7 +296,7 @@ command_lookup(const char *name)
static bool
command_check_request(const struct command *cmd, Client &client,
- unsigned permission, ConstBuffer<const char *> args)
+ unsigned permission, Request args)
{
if (cmd->permission != (permission & cmd->permission)) {
command_error(client, ACK_ERROR_PERMISSION,
@@ -329,7 +330,7 @@ command_check_request(const struct command *cmd, Client &client,
static const struct command *
command_checked_lookup(Client &client, unsigned permission,
- const char *cmd_name, ConstBuffer<const char *> args)
+ const char *cmd_name, Request args)
{
current_command = "";
@@ -380,7 +381,7 @@ command_process(Client &client, unsigned num, char *line)
}
char *argv[COMMAND_ARGV_MAX];
- ConstBuffer<const char *> args(argv, 0);
+ Request args(argv, 0);
/* now parse the arguments (quoted or unquoted) */