aboutsummaryrefslogtreecommitdiffstats
path: root/src/stored_playlist.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* stored_playlist: don't close NULL file on errorMax Kellermann2009-04-241-5/+1
| | | | | spl_append_song() can crash when fopen() fails, because it attempts to close the invalid file handle (NULL) in the error handler.
* all: Update copyright header.Avuton Olrich2009-03-131-6/+7
| | | | | | | | This updates the copyright header to all be the same, which is pretty much an update of where to mail request for a copy of the GPL and the years of the MPD project. This also puts all committers under 'The Music Player Project' umbrella. These entries should go individually in the AUTHORS file, for consistancy.
* ls: moved generic URI utilities to uri.cMax Kellermann2009-02-251-1/+1
| | | | | "ls" is a bad name for a library which parses URIs. We'll move the rest of the "ls" library later.
* playlist: moved is_valid_playlist_name() to stored_playlist.cMax Kellermann2009-01-251-5/+23
|
* stored_playlist: moved configuration variables from playlist.cMax Kellermann2009-01-251-0/+15
| | | | | Don't declare and export variables specific to stored playlists in playlist.c/playlist.h.
* mapper: added dot to PLAYLIST_FILE_SUFFIXMax Kellermann2009-01-251-7/+4
| | | | | Some code will be a little bit simpler if the dot is part of the string literal.
* mapper: make the playlist directory optionalMax Kellermann2009-01-181-1/+18
|
* path: allocate buffer in fs_charset conversion functionsMax Kellermann2009-01-081-3/+3
| | | | | Don't use fixed static buffers. GLib allocates a new string for us anyway, let's just return this one instead of copying it.
* path: removed pfx_dir()Max Kellermann2009-01-041-6/+4
| | | | Use GLib's g_build_filename() instead of pfx_dir().
* song: allocate the result of song_get_url()Max Kellermann2009-01-041-4/+4
|
* mapper: allocate the result of map_fs_to_utf8()Max Kellermann2009-01-041-2/+3
|
* playlist: use uri_has_scheme() instead of isRemoteUrl()Max Kellermann2009-01-041-12/+11
| | | | | | For internal checks (i.e. not in command.c), we need to check whether an URI is in the databse, in the local file system or a remote URI with a scheme.
* playlist: use GLib instead of utils.hMax Kellermann2009-01-021-2/+2
|
* playlist: use g_file_test() instead of stat()Max Kellermann2009-01-011-4/+2
| | | | | To find out whether a file exists, use g_file_test() instead of stat(), because it is more portable and easier to use.
* mapper: allocate playlist path from heapMax Kellermann2009-01-011-28/+41
| | | | Don't pass a static buffer to map_spl_utf8_to_fs().
* removed os_compat.hMax Kellermann2008-12-291-1/+7
| | | | | Only include headers which are really needed. os_compat.h aimed to make MPD easily portable, but was never actually made portable.
* utils: removed myFgets()Max Kellermann2008-12-281-1/+3
| | | | Replaced myFgets() with fgets() + g_strchomp().
* stored_playlist: fix integer overflow in length estimationMax Kellermann2008-12-241-1/+1
| | | | | | | With a large maximum playlist length, the integer multiplication "playlist_max_length * MPD_PATH_MAX" may overflow. Change that to a division. This was not a dangerous bug, since it was only used for a quick estimate.
* ls: removed isValidRemoteUtf8Url()Max Kellermann2008-12-161-2/+2
| | | | | The function didn't do anything useful, it was just several lines obfuscating that it was only forwarding isRemoteUrl()'s return value.
* path: moved playlist_dir to mapper.cMax Kellermann2008-10-311-17/+24
| | | | | Added the function map_spl_utf8_to_fs() which replaces utf8_to_fs_playlist_path().
* stored_playlist: fixed signed comparison warningMax Kellermann2008-10-261-1/+1
| | | | Cast playlist_max_length to off_t before comparing it to stat.st_size.
* stored_playlist: emit idle event on deleteMax Kellermann2008-10-231-0/+1
| | | | The "rm" command did not send notifications to idle clients. Add it.
* stored_playlist: renamed and moved spl_delete() to stored_playlist.cMax Kellermann2008-10-231-0/+15
| | | | The function deletePlaylist() shouldn't be in playlist.c.
* stored_playlist: spl_load() returns GPtrArrayMax Kellermann2008-10-231-128/+62
| | | | | Don't use our deprecated linked list library, use GLib's GPtrArray instead.
* stored_playlist: unsigned index argumentsMax Kellermann2008-10-231-4/+4
| | | | | | Pass index arguments as unsigned integers. They must not be negative, and even if some caller accidently passes -1, it won't pass the bound checks (since it's now 2**32-1).
* stored_playlist: added spl_list()Max Kellermann2008-10-221-0/+79
| | | | | | spl_list() provides an interface for enumerating all stored playlists. This separates the internal playlist logic from the protocol specific function lsPlaylists().
* stored_playlist: spl_append_uri() returns enum playlist_resultMax Kellermann2008-10-221-4/+3
| | | | | The return value of spl_append_uri() was somewhat buggy: some branches returned ACK_* values, and some an enum playlist_result. Unify this.
* stored_playlist: de-CamelCase moved functionMax Kellermann2008-10-221-1/+2
| | | | | Rename addToStoredPlaylist() to spl_append_uri(), and remove the clearStoredPlaylist() macro.
* stored_playlist: moved functions from playlist.cMax Kellermann2008-10-221-0/+22
| | | | | | The two functions clearStoredPlaylist() and addToStoredPlaylist() don't belong into playlist.c. clearStoredPlaylist() was a wrapper for spl_clear(), and is converted into a CPP macro for now.
* stored_playlist: no CamelCaseMax Kellermann2008-10-221-19/+23
| | | | Renamed all public functions, prefix is "spl_".
* renamed storedPlaylist.c to stored_playlist.cMax Kellermann2008-10-221-0/+340
No CamelCase in file names.