aboutsummaryrefslogtreecommitdiffstats
path: root/src/command.h
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-22 21:41:49 +0200
committerMax Kellermann <max@duempel.org>2008-10-22 21:41:49 +0200
commitd4f3c09081179cbe2b55a52549318949c5ede9e5 (patch)
treea7014a2d41cd69a78245531b08ee9f843c179646 /src/command.h
parentd11ee6580c2e61b67983e5378be62dde63cae25c (diff)
downloadmpd-d4f3c09081179cbe2b55a52549318949c5ede9e5.tar.gz
mpd-d4f3c09081179cbe2b55a52549318949c5ede9e5.tar.xz
mpd-d4f3c09081179cbe2b55a52549318949c5ede9e5.zip
command: converted COMMAND_RETURN_* macros to enum
Also add names for "error" and "ok". I don't like passing anonymous integer codes around. This is not yet complete: lots of functions (e.g. in playlist.c) follow the same convention of -1/0, and these have to be adapted, too.
Diffstat (limited to '')
-rw-r--r--src/command.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/command.h b/src/command.h
index bae804d3f..441b1685d 100644
--- a/src/command.h
+++ b/src/command.h
@@ -23,9 +23,12 @@
#include "sllist.h"
#include "ack.h"
-#define COMMAND_RETURN_KILL 10
-#define COMMAND_RETURN_CLOSE 20
-#define COMMAND_MASTER_READY 30
+enum command_return {
+ COMMAND_RETURN_ERROR = -1,
+ COMMAND_RETURN_OK = 0,
+ COMMAND_RETURN_KILL = 10,
+ COMMAND_RETURN_CLOSE = 20,
+};
struct client;
@@ -33,11 +36,11 @@ void command_init(void);
void command_finish(void);
-int
+enum command_return
command_process_list(struct client *client,
int list_ok, struct strnode *list);
-int
+enum command_return
command_process(struct client *client, char *commandString);
void command_success(struct client *client);