From 609f6ce66de4d100388531db5a420f155b7bf64d Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 27 Sep 2012 23:48:29 +0200 Subject: PlaylistFile: use std::list instead of GPtrArray --- src/PlaylistFile.h | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) (limited to 'src/PlaylistFile.h') diff --git a/src/PlaylistFile.h b/src/PlaylistFile.h index 35eda6d7b..ddd2a47ec 100644 --- a/src/PlaylistFile.h +++ b/src/PlaylistFile.h @@ -20,18 +20,32 @@ #ifndef MPD_STORED_PLAYLIST_H #define MPD_STORED_PLAYLIST_H +#ifdef __cplusplus +#include +#include +#include +#endif + #include #include #include struct song; -struct stored_playlist_info { - char *name; +#ifdef __cplusplus + +struct PlaylistFileInfo { + std::string name; time_t mtime; }; +typedef std::list PlaylistFileList; + +typedef std::vector PlaylistFileContents; + +#endif + extern bool playlist_saveAbsolutePaths; G_BEGIN_DECLS @@ -42,6 +56,10 @@ G_BEGIN_DECLS void spl_global_init(void); +G_END_DECLS + +#ifdef __cplusplus + /** * Determines whether the specified string is a valid name for a * stored playlist. @@ -53,17 +71,11 @@ spl_valid_name(const char *name_utf8); * Returns a list of stored_playlist_info struct pointers. Returns * NULL if an error occurred. */ -GPtrArray * -spl_list(GError **error_r); - -void -spl_list_free(GPtrArray *list); +PlaylistFileList +ListPlaylistFiles(GError **error_r); -GPtrArray * -spl_load(const char *utf8path, GError **error_r); - -void -spl_free(GPtrArray *list); +PlaylistFileContents +LoadPlaylistFile(const char *utf8path, GError **error_r); bool spl_move_index(const char *utf8path, unsigned src, unsigned dest, @@ -87,6 +99,6 @@ spl_append_uri(const char *file, const char *utf8file, GError **error_r); bool spl_rename(const char *utf8from, const char *utf8to, GError **error_r); -G_END_DECLS +#endif #endif -- cgit v1.2.3