aboutsummaryrefslogtreecommitdiffstats
path: root/src/command.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-31 09:17:56 +0100
committerMax Kellermann <max@duempel.org>2008-10-31 09:17:56 +0100
commit90e9079142f533c9a30f3431e03b49bbf4f73a77 (patch)
tree517f7833796d96a67adf9e855cb43b254b04395d /src/command.c
parente5ef2d8a375865c8b5058c1107d2b32ce89b7c9d (diff)
downloadmpd-90e9079142f533c9a30f3431e03b49bbf4f73a77.tar.gz
mpd-90e9079142f533c9a30f3431e03b49bbf4f73a77.tar.xz
mpd-90e9079142f533c9a30f3431e03b49bbf4f73a77.zip
client: use GSList instead of struct strnode for command lists
Replace a custom data structure with a GLib one.
Diffstat (limited to '')
-rw-r--r--src/command.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/command.c b/src/command.c
index 9619355f6..452568238 100644
--- a/src/command.c
+++ b/src/command.c
@@ -31,7 +31,6 @@
#include "log.h"
#include "utils.h"
#include "stored_playlist.h"
-#include "sllist.h"
#include "ack.h"
#include "audio.h"
#include "dbUtils.h"
@@ -1497,24 +1496,24 @@ command_process(struct client *client, char *commandString)
enum command_return
command_process_list(struct client *client,
- bool list_ok, struct strnode *list)
+ bool list_ok, GSList *list)
{
- struct strnode *cur = list;
enum command_return ret = COMMAND_RETURN_OK;
command_list_num = 0;
- while (cur) {
+ for (GSList *cur = list; cur != NULL; cur = g_slist_next(cur)) {
+ char *cmd = cur->data;
+
DEBUG("command_process_list: process command \"%s\"\n",
- cur->data);
- ret = command_process(client, cur->data);
+ cmd);
+ ret = command_process(client, cmd);
DEBUG("command_process_list: command returned %i\n", ret);
if (ret != COMMAND_RETURN_OK || client_is_expired(client))
break;
else if (list_ok)
client_puts(client, "list_OK\n");
command_list_num++;
- cur = cur->next;
}
command_list_num = 0;