song: converted typedef Song to struct song

Again, a data type which can be forward-declared.
This commit is contained in:
Max Kellermann
2008-10-08 10:49:11 +02:00
parent 25f67da58c
commit d562ba5fbb
26 changed files with 196 additions and 118 deletions

View File

@@ -17,7 +17,7 @@
*/
#include "directory.h"
#include "song.h"
#include "conf.h"
#include "log.h"
#include "ls.h"
@@ -448,7 +448,7 @@ int readDirectoryDB(void)
static int
traverseAllInSubDirectory(struct directory * directory,
int (*forEachSong) (Song *, void *),
int (*forEachSong) (struct song *, void *),
int (*forEachDir) (struct directory *, void *),
void *data)
{
@@ -474,13 +474,13 @@ traverseAllInSubDirectory(struct directory * directory,
int
traverseAllIn(const char *name,
int (*forEachSong) (Song *, void *),
int (*forEachSong) (struct song *, void *),
int (*forEachDir) (struct directory *, void *), void *data)
{
struct directory *directory;
if ((directory = getDirectory(name)) == NULL) {
Song *song;
struct song *song;
if ((song = getSongFromDB(name)) && forEachSong) {
return forEachSong(song, data);
}
@@ -499,9 +499,10 @@ void directory_init(void)
stats.dbPlayTime = sumSongTimesIn(NULL);
}
Song *getSongFromDB(const char *file)
struct song *
getSongFromDB(const char *file)
{
Song *song = NULL;
struct song *song = NULL;
struct directory *directory;
char *dir = NULL;
char *duplicated = xstrdup(file);