aboutsummaryrefslogtreecommitdiffstats
path: root/src/command.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-07-29 08:00:01 +0200
committerMax Kellermann <max@duempel.org>2009-07-29 08:00:01 +0200
commit6f060081be272d4a8b1bcf1ad0197de4ea5cd5e3 (patch)
tree1e74296a7dd107b9ecbac6153652d245e40ae19e /src/command.c
parent7f865f722c55dc7a2a27c7869030accc8ab9beb2 (diff)
downloadmpd-6f060081be272d4a8b1bcf1ad0197de4ea5cd5e3.tar.gz
mpd-6f060081be272d4a8b1bcf1ad0197de4ea5cd5e3.tar.xz
mpd-6f060081be272d4a8b1bcf1ad0197de4ea5cd5e3.zip
command: moved command_process_list() to client.c
Diffstat (limited to '')
-rw-r--r--src/command.c29
1 files changed, 3 insertions, 26 deletions
diff --git a/src/command.c b/src/command.c
index 9aff88567..c1c330765 100644
--- a/src/command.c
+++ b/src/command.c
@@ -1878,7 +1878,7 @@ command_checked_lookup(struct client *client, unsigned permission,
}
enum command_return
-command_process(struct client *client, char *line)
+command_process(struct client *client, unsigned num, char *line)
{
GError *error = NULL;
int argc;
@@ -1886,6 +1886,8 @@ command_process(struct client *client, char *line)
const struct command *cmd;
enum command_return ret = COMMAND_RETURN_ERROR;
+ command_list_num = num;
+
/* get the command name (first word on the line) */
argv[0] = tokenizer_next_word(&line, &error);
@@ -1940,32 +1942,7 @@ command_process(struct client *client, char *line)
ret = cmd->handler(client, argc, argv);
current_command = NULL;
-
- return ret;
-}
-
-enum command_return
-command_process_list(struct client *client,
- bool list_ok, GSList *list)
-{
- enum command_return ret = COMMAND_RETURN_OK;
-
command_list_num = 0;
- for (GSList *cur = list; cur != NULL; cur = g_slist_next(cur)) {
- char *cmd = cur->data;
-
- g_debug("command_process_list: process command \"%s\"",
- cmd);
- ret = command_process(client, cmd);
- g_debug("command_process_list: command returned %i", ret);
- if (ret != COMMAND_RETURN_OK || client_is_expired(client))
- break;
- else if (list_ok)
- client_puts(client, "list_OK\n");
- command_list_num++;
- }
-
- command_list_num = 0;
return ret;
}