From 09936358fa8098444019fc2a470b1685af1a19de Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 1 Jan 2008 10:09:31 +0000 Subject: storedPlaylist: cleanup API and avoid needless heap allocations + error checks git-svn-id: https://svn.musicpd.org/mpd/trunk@7119 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/storedPlaylist.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/storedPlaylist.h') diff --git a/src/storedPlaylist.h b/src/storedPlaylist.h index 1c30e814a..698e5bb2d 100644 --- a/src/storedPlaylist.h +++ b/src/storedPlaylist.h @@ -22,26 +22,22 @@ #include "song.h" #include "list.h" #include "playlist.h" +#include "path.h" typedef struct _storedPlaylist { List *list; - unsigned int length; - char *fspath; + char fs_path[MPD_PATH_MAX]; int fd; } StoredPlaylist; -StoredPlaylist *newStoredPlaylist(const char *filename, int fd, int ignoreExisting); -StoredPlaylist *loadStoredPlaylist(const char *utf8path, int fd); +int loadStoredPlaylist(int fd, StoredPlaylist *sp, const char *utf8path); void freeStoredPlaylist(StoredPlaylist *sp); int moveSongInStoredPlaylistByPath(int fd, const char *utf8path, int src, int dest); int removeAllFromStoredPlaylistByPath(int fd, const char *utf8path); int removeOneSongFromStoredPlaylistByPath(int fd, const char *utf8path, int pos); -int writeStoredPlaylist(StoredPlaylist *sp); - int appendSongToStoredPlaylistByPath(int fd, const char *utf8path, Song *song); -void appendPlaylistToStoredPlaylist(StoredPlaylist *sp, Playlist *playlist); int renameStoredPlaylist(int fd, const char *utf8from, const char *utf8to); -- cgit v1.2.3