From: Juho Vähä-Herttua Date: Thu, 31 May 2012 17:56:35 +0000 (+0300) Subject: Add error pointer to raop_init, today API breaks in so many ways X-Git-Tag: upstream/0.9.0~4^2~57 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=1d0adde592594882b70c2bec3c6e11445205423d;p=deb_shairplay.git Add error pointer to raop_init, today API breaks in so many ways --- diff --git a/src/include/raop.h b/src/include/raop.h index 7328348..275ac40 100644 --- a/src/include/raop.h +++ b/src/include/raop.h @@ -43,8 +43,8 @@ struct raop_callbacks_s { }; typedef struct raop_callbacks_s raop_callbacks_t; -RAOP_API raop_t *raop_init(int max_clients, raop_callbacks_t *callbacks, const char *pemkey); -RAOP_API raop_t *raop_init_from_keyfile(int max_clients, raop_callbacks_t *callbacks, const char *keyfile); +RAOP_API raop_t *raop_init(int max_clients, raop_callbacks_t *callbacks, const char *pemkey, int *error); +RAOP_API raop_t *raop_init_from_keyfile(int max_clients, raop_callbacks_t *callbacks, const char *keyfile, int *error); RAOP_API void raop_set_log_level(raop_t *raop, int level); RAOP_API void raop_set_log_callback(raop_t *raop, raop_log_callback_t callback, void *cls); diff --git a/src/lib/raop.c b/src/lib/raop.c index 4f4f518..65830d6 100644 --- a/src/lib/raop.c +++ b/src/lib/raop.c @@ -349,7 +349,7 @@ conn_destroy(void *ptr) } raop_t * -raop_init(int max_clients, raop_callbacks_t *callbacks, const char *pemkey) +raop_init(int max_clients, raop_callbacks_t *callbacks, const char *pemkey, int *error) { raop_t *raop; httpd_t *httpd; @@ -414,7 +414,7 @@ raop_init(int max_clients, raop_callbacks_t *callbacks, const char *pemkey) } raop_t * -raop_init_from_keyfile(int max_clients, raop_callbacks_t *callbacks, const char *keyfile) +raop_init_from_keyfile(int max_clients, raop_callbacks_t *callbacks, const char *keyfile, int *error) { raop_t *raop; char *pemstr; @@ -422,7 +422,7 @@ raop_init_from_keyfile(int max_clients, raop_callbacks_t *callbacks, const char if (utils_read_file(&pemstr, keyfile) < 0) { return NULL; } - raop = raop_init(max_clients, callbacks, pemstr); + raop = raop_init(max_clients, callbacks, pemstr, error); free(pemstr); return raop; } diff --git a/src/test/example.c b/src/test/example.c index e857642..393b782 100644 --- a/src/test/example.c +++ b/src/test/example.c @@ -92,7 +92,7 @@ main(int argc, char *argv[]) raop_cbs.audio_flush = audio_flush; raop_cbs.audio_destroy = audio_destroy; - raop = raop_init_from_keyfile(10, &raop_cbs, "airport.key"); + raop = raop_init_from_keyfile(10, &raop_cbs, "airport.key", NULL); raop_set_log_level(raop, RAOP_LOG_DEBUG); raop_set_log_callback(raop, &raop_log_callback, NULL); raop_start(raop, &raop_port, hwaddr, sizeof(hwaddr), "test");