aboutsummaryrefslogtreecommitdiffstats
path: root/src
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
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 'src')
-rw-r--r--src/dbUtils.c19
-rw-r--r--src/directory.c12
-rw-r--r--src/directory.h4
-rw-r--r--src/locate.c12
-rw-r--r--src/locate.h6
-rw-r--r--src/playlist.c27
-rw-r--r--src/playlist.h4
-rw-r--r--src/song.c28
-rw-r--r--src/song.h22
-rw-r--r--src/songvec.c22
-rw-r--r--src/songvec.h11
-rw-r--r--src/stats.c2
-rw-r--r--src/storedPlaylist.c4
-rw-r--r--src/storedPlaylist.h2
-rw-r--r--src/update.c14
15 files changed, 99 insertions, 90 deletions
diff --git a/src/dbUtils.c b/src/dbUtils.c
index 4c52fffc2..eb11ff19e 100644
--- a/src/dbUtils.c
+++ b/src/dbUtils.c
@@ -68,7 +68,7 @@ struct search_data {
LocateTagItemArray array;
};
-static int searchInDirectory(Song * song, void *_data)
+static int searchInDirectory(struct mpd_song * song, void *_data)
{
struct search_data *data = _data;
int fd = data->fd;
@@ -110,7 +110,7 @@ int searchForSongsIn(int fd, const char *name, int numItems,
return ret;
}
-static int findInDirectory(Song * song, void *_data)
+static int findInDirectory(struct mpd_song * song, void *_data)
{
struct search_data *data = _data;
int fd = data->fd;
@@ -139,7 +139,7 @@ static void printSearchStats(int fd, SearchStats *stats)
fdprintf(fd, "playtime: %li\n", stats->playTime);
}
-static int searchStatsInDirectory(Song * song, void *data)
+static int searchStatsInDirectory(struct mpd_song * song, void *data)
{
SearchStats *stats = data;
@@ -177,7 +177,8 @@ int printAllIn(int fd, const char *name)
printDirectoryInDirectory, (void*)(size_t)fd);
}
-static int directoryAddSongToPlaylist(Song * song, mpd_unused void *data)
+static int
+directoryAddSongToPlaylist(struct mpd_song * song, mpd_unused void *data)
{
return addSongToPlaylist(song, NULL);
}
@@ -186,7 +187,7 @@ struct add_data {
const char *path;
};
-static int directoryAddSongToStoredPlaylist(Song *song, void *_data)
+static int directoryAddSongToStoredPlaylist(struct mpd_song *song, void *_data)
{
struct add_data *data = _data;
@@ -209,7 +210,7 @@ int addAllInToStoredPlaylist(const char *name, const char *utf8file)
&data);
}
-static int sumSongTime(Song * song, void *data)
+static int sumSongTime(struct mpd_song * song, void *data)
{
unsigned long *sum_time = (unsigned long *)data;
@@ -263,7 +264,7 @@ static void freeListCommandItem(ListCommandItem * item)
}
static void visitTag(int fd, struct strset *set,
- Song * song, enum tag_type tagType)
+ struct mpd_song * song, enum tag_type tagType)
{
int i;
struct mpd_tag *tag = song->tag;
@@ -291,7 +292,7 @@ struct list_tags_data {
struct strset *set;
};
-static int listUniqueTagsInDirectory(Song * song, void *_data)
+static int listUniqueTagsInDirectory(struct mpd_song * song, void *_data)
{
struct list_tags_data *data = _data;
ListCommandItem *item = data->item;
@@ -348,7 +349,7 @@ static int sumSavedFilenameMemoryInDirectory(struct directory *dir, void *data)
return 0;
}
-static int sumSavedFilenameMemoryInSong(Song * song, void *data)
+static int sumSavedFilenameMemoryInSong(struct mpd_song * song, void *data)
{
int *sum = data;
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);
diff --git a/src/directory.h b/src/directory.h
index d604800e8..72de511e7 100644
--- a/src/directory.h
+++ b/src/directory.h
@@ -66,12 +66,12 @@ int writeDirectoryDB(void);
int readDirectoryDB(void);
-Song *getSongFromDB(const char *file);
+struct mpd_song *getSongFromDB(const char *file);
time_t getDbModTime(void);
int traverseAllIn(const char *name,
- int (*forEachSong) (Song *, void *),
+ int (*forEachSong) (struct mpd_song *, void *),
int (*forEachDir) (struct directory *, void *), void *data);
#define getDirectoryPath(dir) ((dir && dir->path) ? dir->path : "")
diff --git a/src/locate.c b/src/locate.c
index 6101dd95b..dfe1e2236 100644
--- a/src/locate.c
+++ b/src/locate.c
@@ -121,7 +121,8 @@ void freeLocateTagItem(LocateTagItem * item)
free(item);
}
-static int strstrSearchTag(Song * song, enum tag_type type, char *str)
+static int strstrSearchTag(struct mpd_song * song,
+ enum tag_type type, char *str)
{
int i;
char *duplicate;
@@ -166,7 +167,8 @@ static int strstrSearchTag(Song * song, enum tag_type type, char *str)
return ret;
}
-int strstrSearchTags(Song * song, int numItems, LocateTagItem * items)
+int
+strstrSearchTags(struct mpd_song * song, int numItems, LocateTagItem * items)
{
int i;
@@ -180,7 +182,8 @@ int strstrSearchTags(Song * song, int numItems, LocateTagItem * items)
return 1;
}
-static int tagItemFoundAndMatches(Song * song, enum tag_type type, char *str)
+static int
+tagItemFoundAndMatches(struct mpd_song * song, enum tag_type type, char *str)
{
int i;
int8_t visitedTypes[TAG_NUM_OF_ITEM_TYPES] = { 0 };
@@ -220,7 +223,8 @@ static int tagItemFoundAndMatches(Song * song, enum tag_type type, char *str)
}
-int tagItemsFoundAndMatches(Song * song, int numItems, LocateTagItem * items)
+int tagItemsFoundAndMatches(struct mpd_song * song,
+ int numItems, LocateTagItem * items)
{
int i;
diff --git a/src/locate.h b/src/locate.h
index 7a817828a..0ccc497ff 100644
--- a/src/locate.h
+++ b/src/locate.h
@@ -44,8 +44,10 @@ void freeLocateTagItemArray(int count, LocateTagItem * array);
void freeLocateTagItem(LocateTagItem * item);
-int strstrSearchTags(Song * song, int numItems, LocateTagItem * items);
+int strstrSearchTags(struct mpd_song * song,
+ int numItems, LocateTagItem * items);
-int tagItemsFoundAndMatches(Song * song, int numItems, LocateTagItem * items);
+int tagItemsFoundAndMatches(struct mpd_song * song,
+ int numItems, LocateTagItem * items);
#endif
diff --git a/src/playlist.c b/src/playlist.c
index 696636993..ea9f5719c 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -41,7 +41,7 @@ enum _playlist_state {
static enum _playlist_state playlist_state;
struct _playlist {
- Song **songs;
+ struct mpd_song **songs;
/* holds version a song was modified on */
uint32_t *songMod;
int *order;
@@ -157,7 +157,8 @@ void initPlaylist(void)
playlist_saveAbsolutePaths =
DEFAULT_PLAYLIST_SAVE_ABSOLUTE_PATHS;
- playlist.songs = xcalloc(playlist_max_length, sizeof(Song *));
+ playlist.songs = xcalloc(playlist_max_length,
+ sizeof(struct mpd_song *));
playlist.songMod = xmalloc(sizeof(uint32_t) * playlist_max_length);
playlist.order = xmalloc(sizeof(int) * playlist_max_length);
playlist.idToPosition = xmalloc(sizeof(int) * playlist_max_length *
@@ -440,7 +441,7 @@ enum playlist_result playlistId(int fd, int id)
static void swapSongs(int song1, int song2)
{
- Song *sTemp;
+ struct mpd_song *sTemp;
int iTemp;
assert(song1 < playlist.length);
@@ -463,7 +464,7 @@ static void swapSongs(int song1, int song2)
playlist.positionToId[song2] = iTemp;
}
-static Song *song_at(int order_num)
+static struct mpd_song *song_at(int order_num)
{
if (order_num >= 0 && order_num < playlist.length) {
assert(playlist.songs[playlist.order[order_num]]);
@@ -536,7 +537,7 @@ void playlist_queue_next(void)
char *playlist_queued_url(char utf8url[MPD_PATH_MAX])
{
- Song *song;
+ struct mpd_song *song;
assert(pthread_equal(pthread_self(), dc.thread));
pthread_mutex_lock(&queue_lock);
@@ -570,7 +571,7 @@ static int clear_queue(void)
enum playlist_result addToPlaylist(const char *url, int *added_id)
{
- Song *song;
+ struct mpd_song *song;
DEBUG("add to playlist: %s\n", url);
@@ -585,7 +586,7 @@ enum playlist_result addToPlaylist(const char *url, int *added_id)
int addToStoredPlaylist(const char *url, const char *utf8file)
{
- Song *song;
+ struct mpd_song *song;
DEBUG("add to stored playlist: %s\n", url);
@@ -604,7 +605,7 @@ int addToStoredPlaylist(const char *url, const char *utf8file)
return ACK_ERROR_NO_EXIST;
}
-enum playlist_result addSongToPlaylist(Song * song, int *added_id)
+enum playlist_result addSongToPlaylist(struct mpd_song * song, int *added_id)
{
int id;
@@ -798,7 +799,7 @@ enum playlist_result deleteFromPlaylistById(int id)
return deleteFromPlaylist(playlist.idToPosition[id]);
}
-void deleteASongFromPlaylist(const Song * song)
+void deleteASongFromPlaylist(const struct mpd_song * song)
{
int i;
@@ -917,7 +918,7 @@ enum playlist_result playPlaylistById(int id, int stopOnError)
/* This is used when we stream data out to shout while playing static files */
struct mpd_tag *playlist_current_tag(void)
{
- Song *song = song_at(playlist.current);
+ struct mpd_song *song = song_at(playlist.current);
/* Non-file song tags can get swept out from under us */
return (song && song_is_file(song)) ? song->tag : NULL;
@@ -926,7 +927,7 @@ struct mpd_tag *playlist_current_tag(void)
/* This receives dynamic metadata updates from streams */
static void sync_metadata(void)
{
- Song *song;
+ struct mpd_song *song;
struct mpd_tag *tag;
if (!(tag = metadata_pipe_current()))
@@ -998,7 +999,7 @@ void setPlaylistRepeatStatus(int status)
enum playlist_result moveSongInPlaylist(int from, int to)
{
int i;
- Song *tmpSong;
+ struct mpd_song *tmpSong;
int tmpId;
int currentSong;
int queued_is_current = (playlist.queued == playlist.current);
@@ -1361,7 +1362,7 @@ int PlaylistInfo(int fd, const char *utf8file, int detail)
int wrote = 0;
if (detail) {
- Song *song = getSongFromDB(temp);
+ struct mpd_song *song = getSongFromDB(temp);
if (song) {
song_print_info(song, fd);
wrote = 1;
diff --git a/src/playlist.h b/src/playlist.h
index 2be2711e5..f4df8ce41 100644
--- a/src/playlist.h
+++ b/src/playlist.h
@@ -57,7 +57,7 @@ enum playlist_result addToPlaylist(const char *file, int *added_id);
int addToStoredPlaylist(const char *file, const char *utf8file);
-enum playlist_result addSongToPlaylist(Song * song, int *added_id);
+enum playlist_result addSongToPlaylist(struct mpd_song * song, int *added_id);
void showPlaylist(int fd);
@@ -93,7 +93,7 @@ enum playlist_result savePlaylist(const char *utf8file);
enum playlist_result deletePlaylist(const char *utf8file);
-void deleteASongFromPlaylist(const Song * song);
+void deleteASongFromPlaylist(const struct mpd_song * song);
enum playlist_result moveSongInPlaylist(int from, int to);
diff --git a/src/song.c b/src/song.c
index f8a949578..be84bfa4b 100644
--- a/src/song.c
+++ b/src/song.c
@@ -29,10 +29,10 @@
#include "os_compat.h"
-static Song * song_alloc(const char *url, struct directory *parent)
+static struct mpd_song * song_alloc(const char *url, struct directory *parent)
{
size_t urllen;
- Song *song;
+ struct mpd_song *song;
assert(url);
urllen = strlen(url);
@@ -46,9 +46,9 @@ static Song * song_alloc(const char *url, struct directory *parent)
return song;
}
-Song *newSong(const char *url, struct directory *parentDir)
+struct mpd_song *newSong(const char *url, struct directory *parentDir)
{
- Song *song;
+ struct mpd_song *song;
assert(*url);
if (strchr(url, '\n')) {
@@ -79,14 +79,14 @@ Song *newSong(const char *url, struct directory *parentDir)
return song;
}
-void freeJustSong(Song * song)
+void freeJustSong(struct mpd_song * song)
{
if (song->tag)
tag_free(song->tag);
free(song);
}
-ssize_t song_print_url(Song *song, int fd)
+ssize_t song_print_url(struct mpd_song *song, int fd)
{
if (song->parentDir && song->parentDir->path)
return fdprintf(fd, "%s%s/%s\n", SONG_FILE,
@@ -94,7 +94,7 @@ ssize_t song_print_url(Song *song, int fd)
return fdprintf(fd, "%s%s\n", SONG_FILE, song->url);
}
-ssize_t song_print_info(Song *song, int fd)
+ssize_t song_print_info(struct mpd_song *song, int fd)
{
ssize_t ret = song_print_url(song, fd);
@@ -106,19 +106,19 @@ ssize_t song_print_info(Song *song, int fd)
return ret;
}
-int song_print_info_x(Song * song, void *data)
+int song_print_info_x(struct mpd_song * song, void *data)
{
return song_print_info(song, (int)(size_t)data);
}
-int song_print_url_x(Song * song, void *data)
+int song_print_url_x(struct mpd_song * song, void *data)
{
return song_print_url(song, (int)(size_t)data);
}
-static void insertSongIntoList(struct songvec *sv, Song *newsong)
+static void insertSongIntoList(struct songvec *sv, struct mpd_song *newsong)
{
- Song *existing = songvec_find(sv, newsong->url);
+ struct mpd_song *existing = songvec_find(sv, newsong->url);
if (!existing) {
songvec_add(sv, newsong);
@@ -164,7 +164,7 @@ void readSongInfoIntoList(FILE * fp, struct directory * parentDir)
{
char buffer[MPD_PATH_MAX + 1024];
int bufferSize = MPD_PATH_MAX + 1024;
- Song *song = NULL;
+ struct mpd_song *song = NULL;
struct songvec *sv = &parentDir->songs;
int itemType;
@@ -207,7 +207,7 @@ void readSongInfoIntoList(FILE * fp, struct directory * parentDir)
insertSongIntoList(sv, song);
}
-int updateSongInfo(Song * song)
+int updateSongInfo(struct mpd_song * song)
{
if (song_is_file(song)) {
InputPlugin *plugin;
@@ -238,7 +238,7 @@ int updateSongInfo(Song * song)
return 0;
}
-char *get_song_url(char *path_max_tmp, Song *song)
+char *get_song_url(char *path_max_tmp, struct mpd_song *song)
{
if (!song)
return NULL;
diff --git a/src/song.h b/src/song.h
index fcba961f0..eaccf7080 100644
--- a/src/song.h
+++ b/src/song.h
@@ -33,30 +33,30 @@
#define SONG_FILE "file: "
#define SONG_TIME "Time: "
-typedef struct _Song {
+struct mpd_song {
struct mpd_tag *tag;
struct directory *parentDir;
time_t mtime;
char url[sizeof(size_t)];
-} Song;
+};
-Song *newSong(const char *url, struct directory *parentDir);
+struct mpd_song *newSong(const char *url, struct directory *parentDir);
-void freeJustSong(Song *);
+void freeJustSong(struct mpd_song *);
-ssize_t song_print_info(Song * song, int fd);
+ssize_t song_print_info(struct mpd_song * song, int fd);
/* like song_print_info, but casts data into an fd first */
-int song_print_info_x(Song * song, void *data);
+int song_print_info_x(struct mpd_song * song, void *data);
void readSongInfoIntoList(FILE * fp, struct directory *parent);
-int updateSongInfo(Song * song);
+int updateSongInfo(struct mpd_song * song);
-ssize_t song_print_url(Song * song, int fd);
+ssize_t song_print_url(struct mpd_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);
+int song_print_url_x(struct mpd_song * song, void *data);
/*
* get_song_url - Returns a path of a song in UTF8-encoded form
@@ -64,9 +64,9 @@ int song_print_url_x(Song * song, void *data);
* buffer is assumed to be MPD_PATH_MAX or greater (including
* terminating '\0').
*/
-char *get_song_url(char *path_max_tmp, Song * song);
+char *get_song_url(char *path_max_tmp, struct mpd_song * song);
-static inline int song_is_file(const Song *song)
+static inline int song_is_file(const struct mpd_song *song)
{
return !!song->parentDir;
}
diff --git a/src/songvec.c b/src/songvec.c
index cf0991029..c4f702aef 100644
--- a/src/songvec.c
+++ b/src/songvec.c
@@ -7,27 +7,27 @@ static pthread_mutex_t nr_lock = PTHREAD_MUTEX_INITIALIZER;
/* Only used for sorting/searchin a songvec, not general purpose compares */
static int songvec_cmp(const void *s1, const void *s2)
{
- const Song *a = ((const Song * const *)s1)[0];
- const Song *b = ((const Song * const *)s2)[0];
+ const struct mpd_song *a = ((const struct mpd_song * const *)s1)[0];
+ const struct mpd_song *b = ((const struct mpd_song * const *)s2)[0];
return strcmp(a->url, b->url);
}
static size_t sv_size(struct songvec *sv)
{
- return sv->nr * sizeof(Song *);
+ return sv->nr * sizeof(struct mpd_song *);
}
void songvec_sort(struct songvec *sv)
{
pthread_mutex_lock(&nr_lock);
- qsort(sv->base, sv->nr, sizeof(Song *), songvec_cmp);
+ qsort(sv->base, sv->nr, sizeof(struct mpd_song *), songvec_cmp);
pthread_mutex_unlock(&nr_lock);
}
-Song *songvec_find(struct songvec *sv, const char *url)
+struct mpd_song *songvec_find(struct songvec *sv, const char *url)
{
int i;
- Song *ret = NULL;
+ struct mpd_song *ret = NULL;
pthread_mutex_lock(&nr_lock);
for (i = sv->nr; --i >= 0; ) {
@@ -40,7 +40,7 @@ Song *songvec_find(struct songvec *sv, const char *url)
return ret;
}
-int songvec_delete(struct songvec *sv, const Song *del)
+int songvec_delete(struct songvec *sv, const struct mpd_song *del)
{
int i;
@@ -54,7 +54,7 @@ int songvec_delete(struct songvec *sv, const Song *del)
sv->base = NULL;
} else {
memmove(&sv->base[i], &sv->base[i + 1],
- (sv->nr - i + 1) * sizeof(Song *));
+ (sv->nr - i + 1) * sizeof(struct mpd_song *));
sv->base = xrealloc(sv->base, sv_size(sv));
}
break;
@@ -64,7 +64,7 @@ int songvec_delete(struct songvec *sv, const Song *del)
return i;
}
-void songvec_add(struct songvec *sv, Song *add)
+void songvec_add(struct songvec *sv, struct mpd_song *add)
{
pthread_mutex_lock(&nr_lock);
++sv->nr;
@@ -84,13 +84,13 @@ void songvec_destroy(struct songvec *sv)
pthread_mutex_unlock(&nr_lock);
}
-int songvec_for_each(struct songvec *sv, int (*fn)(Song *, void *), void *arg)
+int songvec_for_each(struct songvec *sv, int (*fn)(struct mpd_song *, void *), void *arg)
{
size_t i;
pthread_mutex_lock(&nr_lock);
for (i = 0; i < sv->nr; ++i) {
- Song *song = sv->base[i];
+ struct mpd_song *song = sv->base[i];
assert(song);
assert(*song->url);
diff --git a/src/songvec.h b/src/songvec.h
index dbe6be508..341c404c7 100644
--- a/src/songvec.h
+++ b/src/songvec.h
@@ -5,20 +5,21 @@
#include "os_compat.h"
struct songvec {
- Song **base;
+ struct mpd_song **base;
size_t nr;
};
void songvec_sort(struct songvec *sv);
-Song *songvec_find(struct songvec *sv, const char *url);
+struct mpd_song *songvec_find(struct songvec *sv, const char *url);
-int songvec_delete(struct songvec *sv, const Song *del);
+int songvec_delete(struct songvec *sv, const struct mpd_song *del);
-void songvec_add(struct songvec *sv, Song *add);
+void songvec_add(struct songvec *sv, struct mpd_song *add);
void songvec_destroy(struct songvec *sv);
-int songvec_for_each(struct songvec *sv, int (*fn)(Song *, void *), void *arg);
+int songvec_for_each(struct songvec *sv,
+ int (*fn)(struct mpd_song *, void *), void *arg);
#endif /* SONGVEC_H */
diff --git a/src/stats.c b/src/stats.c
index 4555907db..f200a48b3 100644
--- a/src/stats.c
+++ b/src/stats.c
@@ -40,7 +40,7 @@ struct visit_data {
struct strset *set;
};
-static int visit_tag_items(Song *song, void *_data)
+static int visit_tag_items(struct mpd_song *song, void *_data)
{
const struct visit_data *data = _data;
unsigned i;
diff --git a/src/storedPlaylist.c b/src/storedPlaylist.c
index 265301392..482e9e241 100644
--- a/src/storedPlaylist.c
+++ b/src/storedPlaylist.c
@@ -110,7 +110,7 @@ List *loadStoredPlaylist(const char *utf8path)
while (myFgets(buffer, sizeof(buffer), file)) {
char *s = buffer;
- Song *song;
+ struct mpd_song *song;
if (*s == PLAYLIST_COMMENT)
continue;
@@ -263,7 +263,7 @@ removeOneSongFromStoredPlaylistByPath(const char *utf8path, int pos)
}
enum playlist_result
-appendSongToStoredPlaylistByPath(const char *utf8path, Song *song)
+appendSongToStoredPlaylistByPath(const char *utf8path, struct mpd_song *song)
{
FILE *file;
char *s;
diff --git a/src/storedPlaylist.h b/src/storedPlaylist.h
index 964669d35..4721bcc98 100644
--- a/src/storedPlaylist.h
+++ b/src/storedPlaylist.h
@@ -35,7 +35,7 @@ enum playlist_result
removeOneSongFromStoredPlaylistByPath(const char *utf8path, int pos);
enum playlist_result
-appendSongToStoredPlaylistByPath(const char *utf8path, Song *song);
+appendSongToStoredPlaylistByPath(const char *utf8path, struct mpd_song *song);
enum playlist_result
renameStoredPlaylist(const char *utf8from, const char *utf8to);
diff --git a/src/update.c b/src/update.c
index 00561cab1..674ad0519 100644
--- a/src/update.c
+++ b/src/update.c
@@ -45,7 +45,7 @@ static const int update_task_id_max = 1 << 15;
static int update_task_id;
-static Song *delete;
+static struct mpd_song *delete;
static struct condition delete_cond;
@@ -61,7 +61,7 @@ static void directory_set_stat(struct directory *dir, const struct stat *st)
dir->stat = 1;
}
-static void delete_song(struct directory *dir, Song *del)
+static void delete_song(struct directory *dir, struct mpd_song *del)
{
/* first, prevent traversers in main task from getting this */
songvec_delete(&dir->songs, del);
@@ -85,7 +85,7 @@ struct delete_data {
};
/* passed to songvec_for_each */
-static int delete_song_if_removed(Song *song, void *_data)
+static int delete_song_if_removed(struct mpd_song *song, void *_data)
{
struct delete_data *data = _data;
@@ -192,7 +192,7 @@ addToDirectory(struct directory *directory, const char *name)
}
if (S_ISREG(st.st_mode) &&
hasMusicSuffix(name, 0) && isMusic(name, NULL, 0)) {
- Song *song;
+ struct mpd_song *song;
const char *shortname = mpd_basename(name);
if (!(song = newSong(shortname, directory)))
@@ -212,7 +212,7 @@ addToDirectory(struct directory *directory, const char *name)
static enum update_return
updateInDirectory(struct directory *directory, const char *name)
{
- Song *song;
+ struct mpd_song *song;
struct stat st;
if (myStat(name, &st))
@@ -307,7 +307,7 @@ static struct directory * addDirectoryPathToDB(const char *utf8path)
char *parent;
struct directory *parentDirectory;
struct directory *directory;
- Song *conflicting;
+ struct mpd_song *conflicting;
parent = parent_path(path_max_tmp, utf8path);
@@ -365,7 +365,7 @@ static enum update_return updatePath(const char *utf8path)
{
struct directory *directory;
struct directory *parentDirectory;
- Song *song;
+ struct mpd_song *song;
time_t mtime;
enum update_return ret = UPDATE_RETURN_NOUPDATE;
char path_max_tmp[MPD_PATH_MAX];