diff options
author | Max Kellermann <max@duempel.org> | 2008-10-08 10:49:11 +0200 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-10-11 19:21:47 -0700 |
commit | 79e8abb461fa848cce3717333ee5cfa55ee91c71 (patch) | |
tree | f8c3cc49a2503ebedeedcdec71e2d2eb91e1db96 /src/song.h | |
parent | c84c73df00e5e1710d84fdb4be6352d849da8f2b (diff) | |
download | mpd-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/song.h | 22 |
1 files changed, 11 insertions, 11 deletions
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; } |