Code

mpdclient: pass const strings
authorMax Kellermann <max@duempel.org>
Sat, 15 Aug 2009 21:40:55 +0000 (23:40 +0200)
committerMax Kellermann <max@duempel.org>
Sat, 15 Aug 2009 21:40:55 +0000 (23:40 +0200)
The mpdclient library doesn't modify the parameter strings, let's make
them const.

src/mpdclient.c
src/mpdclient.h

index 4a12515752b9037366d99f1662022ea4269289e3..5f4632613632183bfb5c487c2589d5a60fa53202 100644 (file)
@@ -189,10 +189,10 @@ mpdclient_disconnect(mpdclient_t *c)
 
 gint
 mpdclient_connect(mpdclient_t *c,
-                 gchar *host,
+                 const gchar *host,
                  gint port,
                  gfloat _timeout,
-                 gchar *password)
+                 const gchar *password)
 {
        gint retval = 0;
 
@@ -419,7 +419,7 @@ mpdclient_cmd_crossfade(mpdclient_t *c, gint value)
 }
 
 gint
-mpdclient_cmd_db_update(mpdclient_t *c, gchar *path)
+mpdclient_cmd_db_update(mpdclient_t *c, const gchar *path)
 {
        gint ret;
 
@@ -471,7 +471,7 @@ gint mpdclient_cmd_volume_down(struct mpdclient *c)
 }
 
 gint
-mpdclient_cmd_add_path(mpdclient_t *c, gchar *path_utf8)
+mpdclient_cmd_add_path(mpdclient_t *c, const gchar *path_utf8)
 {
        mpd_sendAddCommand(c->connection, path_utf8);
        return mpdclient_finish_command(c);
@@ -591,7 +591,7 @@ mpdclient_cmd_move(mpdclient_t *c, gint old_index, gint new_index)
 }
 
 gint
-mpdclient_cmd_save_playlist(mpdclient_t *c, gchar *filename_utf8)
+mpdclient_cmd_save_playlist(mpdclient_t *c, const gchar *filename_utf8)
 {
        gint retval = 0;
 
@@ -602,7 +602,7 @@ mpdclient_cmd_save_playlist(mpdclient_t *c, gchar *filename_utf8)
 }
 
 gint
-mpdclient_cmd_load_playlist(mpdclient_t *c, gchar *filename_utf8)
+mpdclient_cmd_load_playlist(mpdclient_t *c, const gchar *filename_utf8)
 {
        mpd_sendLoadCommand(c->connection, filename_utf8);
        c->need_update = TRUE;
@@ -610,7 +610,7 @@ mpdclient_cmd_load_playlist(mpdclient_t *c, gchar *filename_utf8)
 }
 
 gint
-mpdclient_cmd_delete_playlist(mpdclient_t *c, gchar *filename_utf8)
+mpdclient_cmd_delete_playlist(mpdclient_t *c, const gchar *filename_utf8)
 {
        gint retval = 0;
 
@@ -880,7 +880,7 @@ mpdclient_get_artists(mpdclient_t *c)
 }
 
 GList *
-mpdclient_get_albums(mpdclient_t *c, gchar *artist_utf8)
+mpdclient_get_albums(mpdclient_t *c, const gchar *artist_utf8)
 {
        gchar *str = NULL;
        GList *list = NULL;
index e74722e607e01409273ca410f45c2399b8a9500e..42aa17c6877184e31a249f3a90e93139cae56d37 100644 (file)
@@ -40,8 +40,8 @@ mpdclient_finish_command(mpdclient_t *c);
 
 mpdclient_t *mpdclient_new(void);
 void mpdclient_free(mpdclient_t *c);
-gint mpdclient_connect(mpdclient_t *c, gchar *host, gint port,
-                      gfloat timeout_, gchar *password);
+gint mpdclient_connect(mpdclient_t *c, const gchar *host, gint port,
+                      gfloat timeout_, const gchar *password);
 gint mpdclient_disconnect(mpdclient_t *c);
 gint mpdclient_update(mpdclient_t *c);
 
@@ -63,23 +63,23 @@ gint mpdclient_cmd_random(mpdclient_t *c, gint value);
 gint mpdclient_cmd_single(mpdclient_t *c, gint value);
 gint mpdclient_cmd_consume(mpdclient_t *c, gint value);
 gint mpdclient_cmd_crossfade(mpdclient_t *c, gint value);
-gint mpdclient_cmd_db_update(mpdclient_t *c, gchar *path);
+gint mpdclient_cmd_db_update(mpdclient_t *c, const gchar *path);
 gint mpdclient_cmd_volume(mpdclient_t *c, gint value);
 gint mpdclient_cmd_volume_up(struct mpdclient *c);
 gint mpdclient_cmd_volume_down(struct mpdclient *c);
-gint mpdclient_cmd_add_path(mpdclient_t *c, gchar *path);
+gint mpdclient_cmd_add_path(mpdclient_t *c, const gchar *path);
 
 gint mpdclient_cmd_add(mpdclient_t *c, struct mpd_song *song);
 gint mpdclient_cmd_delete(mpdclient_t *c, gint index);
 gint mpdclient_cmd_move(mpdclient_t *c, gint old_index, gint new_index);
 
-gint mpdclient_cmd_save_playlist(mpdclient_t *c, gchar *filename);
-gint mpdclient_cmd_load_playlist(mpdclient_t *c, gchar *filename_utf8);
-gint mpdclient_cmd_delete_playlist(mpdclient_t *c, gchar *filename_utf8);
+gint mpdclient_cmd_save_playlist(mpdclient_t *c, const gchar *filename);
+gint mpdclient_cmd_load_playlist(mpdclient_t *c, const gchar *filename_utf8);
+gint mpdclient_cmd_delete_playlist(mpdclient_t *c, const gchar *filename_utf8);
 
 /* list functions */
 GList *mpdclient_get_artists(mpdclient_t *c);
-GList *mpdclient_get_albums(mpdclient_t *c, gchar *artist_utf8);
+GList *mpdclient_get_albums(mpdclient_t *c, const gchar *artist_utf8);
 
 
 /*** error callbacks *****************************************************/