Commit d4f3c090 authored by Max Kellermann's avatar Max Kellermann

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.
parent d11ee658
...@@ -23,9 +23,12 @@ ...@@ -23,9 +23,12 @@
#include "sllist.h" #include "sllist.h"
#include "ack.h" #include "ack.h"
#define COMMAND_RETURN_KILL 10 enum command_return {
#define COMMAND_RETURN_CLOSE 20 COMMAND_RETURN_ERROR = -1,
#define COMMAND_MASTER_READY 30 COMMAND_RETURN_OK = 0,
COMMAND_RETURN_KILL = 10,
COMMAND_RETURN_CLOSE = 20,
};
struct client; struct client;
...@@ -33,11 +36,11 @@ void command_init(void); ...@@ -33,11 +36,11 @@ void command_init(void);
void command_finish(void); void command_finish(void);
int enum command_return
command_process_list(struct client *client, command_process_list(struct client *client,
int list_ok, struct strnode *list); int list_ok, struct strnode *list);
int enum command_return
command_process(struct client *client, char *commandString); command_process(struct client *client, char *commandString);
void command_success(struct client *client); void command_success(struct client *client);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment