aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-10-07 02:06:01 -0700
committerEric Wong <normalperson@yhbt.net>2008-10-07 02:06:01 -0700
commita67facd051d817dd53bac1aebfc554b07420e8cd (patch)
tree840ce00f6dbb84e39463015552761ef3ab5bd687
parentd271b5f13090595b67de6f2161dc309bb43e6fbe (diff)
downloadmpd-a67facd051d817dd53bac1aebfc554b07420e8cd.tar.gz
mpd-a67facd051d817dd53bac1aebfc554b07420e8cd.tar.xz
mpd-a67facd051d817dd53bac1aebfc554b07420e8cd.zip
song: Add song_print_url_x
It'll be handy for passing throug songvec_for_each like song_print_info_x.
-rw-r--r--src/song.c5
-rw-r--r--src/song.h3
2 files changed, 8 insertions, 0 deletions
diff --git a/src/song.c b/src/song.c
index 71191c149..f967e3e17 100644
--- a/src/song.c
+++ b/src/song.c
@@ -117,6 +117,11 @@ int song_print_info_x(Song * song, void *data)
return song_print_info(song, (int)(size_t)data);
}
+int song_print_url_x(Song * song, void *data)
+{
+ return song_print_url(song, (int)(size_t)data);
+}
+
static void insertSongIntoList(struct songvec *sv, Song *newsong)
{
Song *existing = songvec_find(sv, newsong->url);
diff --git a/src/song.h b/src/song.h
index e65f70f38..d8189d42c 100644
--- a/src/song.h
+++ b/src/song.h
@@ -57,6 +57,9 @@ int updateSongInfo(Song * song);
ssize_t song_print_url(Song * song, int fd);
+/* like song_print_url_x, but casts data into an fd first */
+int song_print_url_x(Song * song, void *data);
+
/*
* get_song_url - Returns a path of a song in UTF8-encoded form
* path_max_tmp is the argument that the URL is written to, this