aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-11-18 22:57:36 +0100
committerMax Kellermann <max@duempel.org>2008-11-18 22:57:36 +0100
commit77b6145e75c6e1641002dd9675bcf3b5439c3718 (patch)
tree8fd579fd11183e68804d923be4cd66db4f3dc74e /src
parent94365df29c42615d139f32d1a465d6654a2af800 (diff)
downloadmpd-77b6145e75c6e1641002dd9675bcf3b5439c3718.tar.gz
mpd-77b6145e75c6e1641002dd9675bcf3b5439c3718.tar.xz
mpd-77b6145e75c6e1641002dd9675bcf3b5439c3718.zip
libmpdclient: converted MPD_ERROR_ constants to enum
Diffstat (limited to 'src')
-rw-r--r--src/libmpdclient.h46
1 files changed, 35 insertions, 11 deletions
diff --git a/src/libmpdclient.h b/src/libmpdclient.h
index 2170287fb..8935536f0 100644
--- a/src/libmpdclient.h
+++ b/src/libmpdclient.h
@@ -44,16 +44,40 @@
#define MPD_WELCOME_MESSAGE "OK MPD "
-#define MPD_ERROR_TIMEOUT 10 /* timeout trying to talk to mpd */
-#define MPD_ERROR_SYSTEM 11 /* system error */
-#define MPD_ERROR_UNKHOST 12 /* unknown host */
-#define MPD_ERROR_CONNPORT 13 /* problems connecting to port on host */
-#define MPD_ERROR_NOTMPD 14 /* mpd not running on port at host */
-#define MPD_ERROR_NORESPONSE 15 /* no response on attempting to connect */
-#define MPD_ERROR_SENDING 16 /* error sending command */
-#define MPD_ERROR_CONNCLOSED 17 /* connection closed by mpd */
-#define MPD_ERROR_ACK 18 /* ACK returned! */
-#define MPD_ERROR_BUFFEROVERRUN 19 /* Buffer was overrun! */
+enum mpd_error {
+ /** no error */
+ MPD_ERROR_SUCCESS = 0,
+
+ /** timeout trying to talk to mpd */
+ MPD_ERROR_TIMEOUT = 10,
+
+ /** system error */
+ MPD_ERROR_SYSTEM,
+
+ /** unknown host */
+ MPD_ERROR_UNKHOST,
+
+ /** problems connecting to port on host */
+ MPD_ERROR_CONNPORT,
+
+ /** mpd not running on port at host */
+ MPD_ERROR_NOTMPD,
+
+ /** no response on attempting to connect */
+ MPD_ERROR_NORESPONSE,
+
+ /** error sending command */
+ MPD_ERROR_SENDING,
+
+ /** connection closed by mpd */
+ MPD_ERROR_CONNCLOSED,
+
+ /** ACK returned! */
+ MPD_ERROR_ACK,
+
+ /** Buffer was overrun! */
+ MPD_ERROR_BUFFEROVERRUN,
+};
#define MPD_ERROR_AT_UNK -1
@@ -116,7 +140,7 @@ typedef struct _mpd_Connection {
enum mpd_ack errorCode;
int errorAt;
/* this will be set to MPD_ERROR_* if there is an error, 0 if not */
- int error;
+ enum mpd_error error;
/* DON'T TOUCH any of the rest of this stuff */
int sock;
char buffer[16384];