aboutsummaryrefslogtreecommitdiffstats
path: root/src/song_save.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-08 10:49:11 +0200
committerMax Kellermann <max@duempel.org>2008-10-08 10:49:11 +0200
commitd562ba5fbbe117585eaade40a8e9c6ef1bf7ca1f (patch)
tree1e82f7b4854c5d15c4ab59c48120da02e4b41be9 /src/song_save.c
parent25f67da58c671885c86ecfd991f28ec82b6ce1e2 (diff)
downloadmpd-d562ba5fbbe117585eaade40a8e9c6ef1bf7ca1f.tar.gz
mpd-d562ba5fbbe117585eaade40a8e9c6ef1bf7ca1f.tar.xz
mpd-d562ba5fbbe117585eaade40a8e9c6ef1bf7ca1f.zip
song: converted typedef Song to struct song
Again, a data type which can be forward-declared.
Diffstat (limited to 'src/song_save.c')
-rw-r--r--src/song_save.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/song_save.c b/src/song_save.c
index 14bce4ce0..00e4a8580 100644
--- a/src/song_save.c
+++ b/src/song_save.c
@@ -17,6 +17,7 @@
*/
#include "song_save.h"
+#include "song.h"
#include "tag_save.h"
#include "directory.h"
#include "path.h"
@@ -27,7 +28,8 @@
#define SONG_KEY "key: "
#define SONG_MTIME "mtime: "
-static void song_save_url(FILE *fp, Song * song)
+static void
+song_save_url(FILE *fp, struct song *song)
{
if (song->parentDir != NULL && song->parentDir->path != NULL)
fprintf(fp, SONG_FILE "%s/%s\n",
@@ -38,7 +40,7 @@ static void song_save_url(FILE *fp, Song * song)
}
static int
-song_save(Song *song, void *data)
+song_save(struct song *song, void *data)
{
FILE *fp = data;
@@ -61,9 +63,10 @@ void songvec_save(FILE *fp, struct songvec *sv)
fprintf(fp, "%s\n", SONG_END);
}
-static void insertSongIntoList(struct songvec *sv, Song *newsong)
+static void
+insertSongIntoList(struct songvec *sv, struct song *newsong)
{
- Song *existing = songvec_find(sv, newsong->url);
+ struct song *existing = songvec_find(sv, newsong->url);
if (!existing) {
songvec_add(sv, newsong);
@@ -102,7 +105,7 @@ void readSongInfoIntoList(FILE *fp, struct songvec *sv,
{
char buffer[MPD_PATH_MAX + 1024];
int bufferSize = MPD_PATH_MAX + 1024;
- Song *song = NULL;
+ struct song *song = NULL;
int itemType;
while (myFgets(buffer, bufferSize, fp) && 0 != strcmp(SONG_END, buffer)) {