aboutsummaryrefslogtreecommitdiffstats
path: root/src/directory.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-08 10:49:11 +0200
committerEric Wong <normalperson@yhbt.net>2008-10-11 19:21:47 -0700
commit79e8abb461fa848cce3717333ee5cfa55ee91c71 (patch)
treef8c3cc49a2503ebedeedcdec71e2d2eb91e1db96 /src/directory.c
parentc84c73df00e5e1710d84fdb4be6352d849da8f2b (diff)
downloadmpd-79e8abb461fa848cce3717333ee5cfa55ee91c71.tar.gz
mpd-79e8abb461fa848cce3717333ee5cfa55ee91c71.tar.xz
mpd-79e8abb461fa848cce3717333ee5cfa55ee91c71.zip
song: converted typedef Song to struct song
Again, a data type which can be forward-declared. [ew: * used "struct mpd_song" instead to avoid token duplication (like I did with "struct mpd_tag") as there's no good abbreviation for "song" and identical tokens on the same line don't read well * rewritten using perl -i -p -e 's/\bSong\b/struct mpd_song/g' src/*.[ch] since it was too hard to merge * also, I don't care much for forward declarations ]
Diffstat (limited to '')
-rw-r--r--src/directory.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/directory.c b/src/directory.c
index 2a49fe8ff..93bde7de9 100644
--- a/src/directory.c
+++ b/src/directory.c
@@ -173,7 +173,7 @@ int printDirectoryInfo(int fd, const char *name)
return 0;
}
-static int directory_song_write(Song *song, void *data)
+static int directory_song_write(struct mpd_song *song, void *data)
{
int fd = (int)(size_t)data;
@@ -463,7 +463,7 @@ int readDirectoryDB(void)
static int
traverseAllInSubDirectory(struct directory * directory,
- int (*forEachSong) (Song *, void *),
+ int (*forEachSong) (struct mpd_song *, void *),
int (*forEachDir) (struct directory *, void *),
void *data)
{
@@ -489,13 +489,13 @@ traverseAllInSubDirectory(struct directory * directory,
int
traverseAllIn(const char *name,
- int (*forEachSong) (Song *, void *),
+ int (*forEachSong) (struct mpd_song *, void *),
int (*forEachDir) (struct directory *, void *), void *data)
{
struct directory *directory;
if ((directory = getDirectory(name)) == NULL) {
- Song *song;
+ struct mpd_song *song;
if ((song = getSongFromDB(name)) && forEachSong) {
return forEachSong(song, data);
}
@@ -514,9 +514,9 @@ void directory_init(void)
stats.dbPlayTime = sumSongTimesIn(NULL);
}
-Song *getSongFromDB(const char *file)
+struct mpd_song *getSongFromDB(const char *file)
{
- Song *song = NULL;
+ struct mpd_song *song = NULL;
struct directory *directory;
char *dir = NULL;
char *duplicated = xstrdup(file);