Code

callbacks: rename functions
authorMax Kellermann <max.kellermann@gmail.com>
Fri, 17 Mar 2017 21:24:24 +0000 (22:24 +0100)
committerMax Kellermann <max.kellermann@gmail.com>
Fri, 17 Mar 2017 21:41:28 +0000 (22:41 +0100)
src/callbacks.c
src/callbacks.h
src/mpdclient.c

index dd5d15ba6cc1af9b5710be2972802d5761309ace..e12268227586640528e63cf7232913c2dea9bb55 100644 (file)
@@ -24,7 +24,7 @@
 #include "charset.h"
 
 static bool
-_screen_auth(struct mpdclient *c, gint recursion)
+_mpdclient_auth_callback(struct mpdclient *c, gint recursion)
 {
        struct mpd_connection *connection = mpdclient_get_connection(c);
        if (connection == NULL)
@@ -46,19 +46,19 @@ _screen_auth(struct mpdclient *c, gint recursion)
 
        if (mpd_connection_get_error(connection) == MPD_ERROR_SERVER &&
            mpd_connection_get_server_error(connection) == MPD_SERVER_ERROR_PASSWORD)
-               return  _screen_auth(c, ++recursion);
+               return _mpdclient_auth_callback(c, ++recursion);
 
        return true;
 }
 
 bool
-screen_auth(struct mpdclient *c)
+mpdclient_auth_callback(struct mpdclient *c)
 {
-       return _screen_auth(c, 0);
+       return _mpdclient_auth_callback(c, 0);
 }
 
 void
-mpdclient_ui_error(const char *message_utf8)
+mpdclient_error_callback(const char *message_utf8)
 {
        char *message_locale = utf8_to_locale(message_utf8);
        screen_status_printf("%s", message_locale);
index 2dbe9ba1fa942081de0df818ded9ac989833c400..2bc84732aaac373e067926127fdfee344972b337 100644 (file)
@@ -29,9 +29,9 @@ struct mpdclient;
  * display an error message.
  */
 void
-mpdclient_ui_error(const char *message);
+mpdclient_error_callback(const char *message);
 
 bool
-screen_auth(struct mpdclient *c);
+mpdclient_auth_callback(struct mpdclient *c);
 
 #endif
index 7ef34d2a592f0fd3f9e47ff1e9bb61fbcf913f11..582d302b7b5c78155708a38fac684933bb07be51 100644 (file)
@@ -73,10 +73,10 @@ mpdclient_handle_error(struct mpdclient *c)
 
        if (error == MPD_ERROR_SERVER &&
            mpd_connection_get_server_error(c->connection) == MPD_SERVER_ERROR_PERMISSION &&
-           screen_auth(c))
+           mpdclient_auth_callback(c))
                return true;
 
-       mpdclient_ui_error(mpd_connection_get_error_message(c->connection));
+       mpdclient_error_callback(mpd_connection_get_error_message(c->connection));
 
        if (!mpd_connection_clear_error(c->connection))
                mpdclient_disconnect(c);