summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <PromyLOPh@gmail.com>2008-08-17 16:16:41 +0200
committerLars-Dominik Braun <PromyLOPh@gmail.com>2008-08-17 16:16:41 +0200
commit8beb2162be16ac4311ffdd397f0337e5ad0934d4 (patch)
tree873143969babe18c3398aeb0872cd8170880047f
parentf60ead4306546d28eeb7fc07e82e9b61707c4a89 (diff)
downloadpianobar-windows-8beb2162be16ac4311ffdd397f0337e5ad0934d4.tar.gz
pianobar-windows-8beb2162be16ac4311ffdd397f0337e5ad0934d4.tar.bz2
pianobar-windows-8beb2162be16ac4311ffdd397f0337e5ad0934d4.zip
piano: New return value _NOT_AUTHORIZED
-rw-r--r--libpiano/src/main.c4
-rw-r--r--libpiano/src/piano.h2
-rw-r--r--libpiano/src/xml.c3
3 files changed, 8 insertions, 1 deletions
diff --git a/libpiano/src/main.c b/libpiano/src/main.c
index 7eaba25..edee0d2 100644
--- a/libpiano/src/main.c
+++ b/libpiano/src/main.c
@@ -846,6 +846,10 @@ const char *PianoErrorToStr (PianoReturn_t ret) {
return "Connection failed.";
break;
+ case PIANO_RET_NOT_AUTHORIZED:
+ return "Not authorized.";
+ break;
+
default:
return "No error message available.";
break;
diff --git a/libpiano/src/piano.h b/libpiano/src/piano.h
index b0e741e..ae4b18b 100644
--- a/libpiano/src/piano.h
+++ b/libpiano/src/piano.h
@@ -152,7 +152,7 @@ typedef struct PianoSearchResult PianoSearchResult_t;
/* FIXME: more error types (http failed, e.g.) later */
enum PianoReturn {PIANO_RET_OK, PIANO_RET_ERR, PIANO_RET_XML_INVALID,
PIANO_RET_AUTH_TOKEN_INVALID, PIANO_RET_AUTH_USER_PASSWORD_INVALID,
- PIANO_RET_NET_ERROR};
+ PIANO_RET_NET_ERROR, PIANO_RET_NOT_AUTHORIZED};
typedef enum PianoReturn PianoReturn_t;
void PianoInit (PianoHandle_t *);
diff --git a/libpiano/src/xml.c b/libpiano/src/xml.c
index 4d945e7..25cd8f8 100644
--- a/libpiano/src/xml.c
+++ b/libpiano/src/xml.c
@@ -62,6 +62,9 @@ void PianoXmlIsFaultCb (const char *key, const xmlNode *value, void *data) {
} else if (strcmp ("AUTH_INVALID_USERNAME_PASSWORD",
matchStr) == 0) {
*ret = PIANO_RET_AUTH_USER_PASSWORD_INVALID;
+ } else if (strcmp ("LISTENER_NOT_AUTHORIZED",
+ matchStr) == 0) {
+ *ret = PIANO_RET_NOT_AUTHORIZED;
} else {
*ret = PIANO_RET_ERR;
printf (PACKAGE ": Unknown error %s in %s\n",