From a340bf0dee5bf134770f5d5f532efa90cdb08b3c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 7 Oct 2008 02:25:27 -0700 Subject: directory: use songvec_for_each for iterators Get rid of songvec_write so we can enforce proper locking --- src/songvec.c | 31 ------------------------------- 1 file changed, 31 deletions(-) (limited to 'src/songvec.c') diff --git a/src/songvec.c b/src/songvec.c index 640eff0a8..cf0991029 100644 --- a/src/songvec.c +++ b/src/songvec.c @@ -104,34 +104,3 @@ int songvec_for_each(struct songvec *sv, int (*fn)(Song *, void *), void *arg) return 0; } - -int songvec_write(struct songvec *sv, int fd, int extra) -{ - int i; - Song **sp = sv->base; - - if (extra) { - if (fdprintf(fd, SONG_BEGIN "\n") < 0) - return -1; - - for (i = sv->nr; --i >= 0; ) { - Song *song = *sp++; - if (fdprintf(fd, SONG_KEY "%s\n", song->url) < 0) - return -1; - if (song_print_info(song, fd) < 0) - return -1; - if (fdprintf(fd, - SONG_MTIME "%li\n", (long)song->mtime) < 0) - return -1; - } - - if (fdprintf(fd, SONG_END "\n") < 0) - return -1; - } else { - for (i = sv->nr; --i >= 0;) - if (song_print_info(*sp++, fd) < 0) - return -1; - } - - return 0; -} -- cgit v1.2.3