- 23 Oct, 2008 3 commits
-
-
Max Kellermann authored
Many command arguments must not be negative; add a separate parser/checker function for that. For the same reason, add check_bool(). This eliminates two strange special cases handlers from check_int().
-
Max Kellermann authored
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).
-
Max Kellermann authored
There are some integers which have a "magic" -1 value which means "undefined" or "nothing". All others can be converted to unsigned, since they must not contain a negative number.
-
- 22 Oct, 2008 18 commits
-
-
Max Kellermann authored
Instead of returning 0 for success and -1 for failure, return true or false. This seems more natural.
-
Max Kellermann authored
Also add names for "error" and "ok". I don't like passing anonymous integer codes around. This is not yet complete: lots of functions (e.g. in playlist.c) follow the same convention of -1/0, and these have to be adapted, too.
-
Max Kellermann authored
http://xkcd.com/292/
-
Max Kellermann authored
Eliminate CamelCase in all public and static functions.
-
Max Kellermann authored
The typedef CommandHandlerFunction is only used once. Move its type into the command struct.
-
Max Kellermann authored
-
Max Kellermann authored
Send last modification timestamps to the client. This allows the client to see when another client modifies a stored playlist.
-
Max Kellermann authored
"listplaylists" returns a list of all stored playlists. This command seems more elaborate than listing them below "lsinfo".
-
Max Kellermann authored
The function print_spl_list() replaces the old function lsPlaylists() from ls.c.
-
Max Kellermann authored
spl_list() provides an interface for enumerating all stored playlists. This separates the internal playlist logic from the protocol specific function lsPlaylists().
-
Max Kellermann authored
The return value of spl_append_uri() was somewhat buggy: some branches returned ACK_* values, and some an enum playlist_result. Unify this.
-
Max Kellermann authored
Rename addToStoredPlaylist() to spl_append_uri(), and remove the clearStoredPlaylist() macro.
-
Max Kellermann authored
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.
-
Max Kellermann authored
Renamed all public functions, prefix is "spl_".
-
Max Kellermann authored
No CamelCase in file names.
-
Max Kellermann authored
The list of commands is known at compile time. Instead of creating a linked list on startup, we can just register all commands in a static sorted array.
-
Max Kellermann authored
The command pointers which are passed around aren't being modified - in fact, no command pointer must be modified once it has been added to the commandList.
-
Max Kellermann authored
No CamelCase and no struct typedefs.
-
- 21 Oct, 2008 6 commits
-
-
Max Kellermann authored
Instead of manually calling memset(0) on the pcm_convert_state struct, client code should use a library function from pcm_utils.c. This way, we can change the semantics of the struct easily.
-
Max Kellermann authored
Renamed all functions which were still in CamelCase.
-
Max Kellermann authored
No CamelCase, and a struct instead of a typedef.
-
Max Kellermann authored
Casting a pointer to some sort of integer and formatting it into a string isn't valid. A pointer derived from this hex string won't work reliably. Since ffmpeg doesn't provide a nice API for passing our pointer, we have to think of a different hack: ffmpeg passes the exact URL pointer to mpdurl_open(), and we can make this string part of a struct. This reduces the problem to casting the string back to the struct. This is still a workaround, but this is "sort of portable", unless the ffmpeg people start messing with the URL pointer (which would be valid according to the API definition).
-
Max Kellermann authored
Since ffmpeg svn r13528, you have to link with libavutil manually.
-
Max Kellermann authored
Since ffmpeg svn r12865, you have to include libavcodec/avcodec.h instead of avcodec.h. This cannot be checked at compile time, instead we have to add a check to configure.ac. Viliam's original ffmpeg plugin was based on the newer ffmpeg library, while my Debian installation had the older version. My attempt to correct his include statements wasn't correct after all.
-
- 20 Oct, 2008 8 commits
-
-
Eric Wong authored
{song,dir}vec_for_each each failed to gracefully handle deleted files when iterating through. While we were thread-safe, we were not safe within the calling thread. If a callback we passed caused sv->nr to shring, our index would still increment; causing files to stay in the database. A way to test this is to remove 10 or so contiguous songs from a >10 song directory.
-
Eric Wong authored
Like the songvec nr_lock, only one lock is used for all traversals since they're rarely changed. This only projects traversals, but not the individual structures themselves.
-
Eric Wong authored
We definitely don't modify them here.
-
Eric Wong authored
This will make it easier to introduce locking
-
Max Kellermann authored
There was only one user of pathcpy_trunc(), which can be eliminated.
-
Max Kellermann authored
Again, GLib's version is more robust than ours.
-
Max Kellermann authored
GLib's g_path_get_basename() is much more reliable than mpd_basename(). The latter could be tricked into an assertion failure.
-
Max Kellermann authored
Identifiers with two leading underscores are reserved for the C compiler's internal use. Don't use them in the source.
-
- 18 Oct, 2008 5 commits
-
-
Max Kellermann authored
Due to an off-by-one bug in map_fs_to_utf8(), the function returned database paths with a leading slash.
-
Andrzej Rybczak authored
[mk: use AC_SUBST instead of appending to MPD_CFLAGS / MPD_LIBS]
-
Andrzej Rybczak authored
The macro name is HAVE_STRUCT_UCRED, not HAVE_UCRED.
-
Max Kellermann authored
The typedefs aren't using by anybody but struct input_stream. Remove them and declare the method type within struct input_stream.
-
Max Kellermann authored
The mpdurl_* code is internal, don't expose them. Also don't initialize struct members with NULL.
-