From a5f8bb82300d08568180482c93e8b9a067cc715d Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 5 Oct 2008 20:54:11 -0700 Subject: song: replace printSong* with song_print_* This make argument order more consistent for iterators. Additionally, these now return ssize_t results for error checking. --- src/song.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/song.c') diff --git a/src/song.c b/src/song.c index 27f48ad03..61fe78a43 100644 --- a/src/song.c +++ b/src/song.c @@ -92,24 +92,24 @@ void freeJustSong(Song * song) free(song); } -void printSongUrl(int fd, Song * song) +ssize_t song_print_url(Song *song, int fd) { - if (song->parentDir && song->parentDir->path) { - fdprintf(fd, "%s%s/%s\n", SONG_FILE, - getDirectoryPath(song->parentDir), song->url); - } else { - fdprintf(fd, "%s%s\n", SONG_FILE, song->url); - } + if (song->parentDir && song->parentDir->path) + return fdprintf(fd, "%s%s/%s\n", SONG_FILE, + getDirectoryPath(song->parentDir), song->url); + return fdprintf(fd, "%s%s\n", SONG_FILE, song->url); } -int printSongInfo(int fd, Song * song) +ssize_t song_print_info(Song *song, int fd) { - printSongUrl(fd, song); + ssize_t ret = song_print_url(song, fd); + if (ret < 0) + return ret; if (song->tag) tag_print(fd, song->tag); - return 0; + return ret; } static void insertSongIntoList(struct songvec *sv, Song *newsong) -- cgit v1.2.3