aboutsummaryrefslogtreecommitdiffstats
path: root/src/command.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2009-01-04playlist: log errors during loadPlaylist()Max Kellermann1-1/+1
Don't call command_error() if loading a song from the playlist fails. This may result in assertion failures, since command_error() may be called more than once.
2009-01-04ls: renamed functions, no CamelCaseMax Kellermann1-4/+4
2009-01-04command: check URI scheme in "addid"Max Kellermann1-12/+22
Check if the URI scheme is supported by MPD, and print an error message if not. Optimize the checks in "add" and "playlistadd".
2009-01-04command: added variable "uri" to command handlersMax Kellermann1-20/+24
Don't work with argv[1], give it the better name "uri".
2009-01-03don't include utils.h when it isn't usedMax Kellermann1-1/+2
2009-01-03command: fix adding local files on !WIN32Max Kellermann1-1/+5
Due to a typo, adding local files was always denied. Disable the second playlist_append_file() invocation on WIN32.
2008-12-31Moving mixers to audio outputsViliam Mateicka1-3/+3
2008-12-30command: don't allow adding local files on WIN32Max Kellermann1-0/+4
There are no unix sockets on WIN32, and therefore no authentication. WIN32 might have similar capabilities, but until we implement them, disable that MPD feature.
2008-12-29removed os_compat.hMax Kellermann1-1/+3
Only include headers which are really needed. os_compat.h aimed to make MPD easily portable, but was never actually made portable.
2008-12-29command: use gmtime() on WIN32Max Kellermann1-1/+8
gmtime_r() is not available.
2008-12-16command: reject unsupported URI schemesMax Kellermann1-1/+11
When a client-specified URI has a scheme which is not supported, do not try to open it as a local file, but provide a meaningful error message.
2008-12-16ls: make printRemoteUrlHandlers() return voidMax Kellermann1-1/+2
printRemoteUrlHandlers() cannot fail, and does not need a return value.
2008-12-02replaced mpd_printf etc by G_GNUC_PRINTFThomas Jansen1-4/+4
We want to remove gcc.h eventually. This takes care of all the G_GNUC_PRINTF macros.
2008-11-24command.c: replaced mpd_unused by G_GNUC_UNUSEDThomas Jansen1-63/+63
2008-11-22command: format strerror() with "%s"Max Kellermann1-1/+1
We shouldn't pass strerror() where a format string is expected.
2008-11-22command: allow clients to subscribe to specific idle eventsMarc Pavot1-2/+23
The client may provide the names of idle events as arguments to the "idle" command to inform MPD that it is only interested in these events.
2008-10-31path: removed sanitizePathDup()Max Kellermann1-4/+2
We don't need to sanitize the path, because the mapper already checks for malformed paths.
2008-10-31client: use GSList instead of struct strnode for command listsMax Kellermann1-7/+6
Replace a custom data structure with a GLib one.
2008-10-26command: removed range check from check_bool()Max Kellermann1-6/+0
check_bool() accepts only "0" or "1". The range check is superfluous.
2008-10-23command: fix boolean value parserMax Kellermann1-1/+1
Due to a logic error, no value was valid for the boolean value parser. Replace "||" with "&&".
2008-10-23stored_playlist: renamed and moved spl_delete() to stored_playlist.cMax Kellermann1-1/+1
The function deletePlaylist() shouldn't be in playlist.c.
2008-10-23command: check over/underflows in check_int()Max Kellermann1-2/+13
The "long" result of strtol() was implicitly casted down to a 32 bit integer. Add some range checking instead.
2008-10-23command: added check_unsigned() / check_bool()Max Kellermann1-13/+57
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().
2008-10-23playlist: unsigned integersMax Kellermann1-3/+3
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.
2008-10-22command: use the bool datatype instead of intMax Kellermann1-50/+51
Instead of returning 0 for success and -1 for failure, return true or false. This seems more natural.
2008-10-22command: converted COMMAND_RETURN_* macros to enumMax Kellermann1-163/+165
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.
2008-10-22command: replaced "goto" with "break"Max Kellermann1-2/+2
http://xkcd.com/292/
2008-10-22command: no CamelCaseMax Kellermann1-227/+247
Eliminate CamelCase in all public and static functions.
2008-10-22command: removed CommandHandlerFunction typedefMax Kellermann1-3/+1
The typedef CommandHandlerFunction is only used once. Move its type into the command struct.
2008-10-22ack: converted ACK_ERROR_* macros to enumMax Kellermann1-2/+2
2008-10-22stored_playlist: send timestampsMax Kellermann1-0/+8
Send last modification timestamps to the client. This allows the client to see when another client modifies a stored playlist.
2008-10-22command: added command "listplaylists"Max Kellermann1-0/+17
"listplaylists" returns a list of all stored playlists. This command seems more elaborate than listing them below "lsinfo".
2008-10-22command: added print_spl_list()Max Kellermann1-2/+18
The function print_spl_list() replaces the old function lsPlaylists() from ls.c.
2008-10-22stored_playlist: de-CamelCase moved functionMax Kellermann1-2/+2
Rename addToStoredPlaylist() to spl_append_uri(), and remove the clearStoredPlaylist() macro.
2008-10-22stored_playlist: no CamelCaseMax Kellermann1-3/+3
Renamed all public functions, prefix is "spl_".
2008-10-22renamed storedPlaylist.c to stored_playlist.cMax Kellermann1-1/+1
No CamelCase in file names.
2008-10-22command: added "commands" array instead of registering manuallyMax Kellermann1-193/+145
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.
2008-10-22command: make command pointers constantMax Kellermann1-12/+13
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.
2008-10-22command: renamed CommandEntry to struct commandMax Kellermann1-12/+10
No CamelCase and no struct typedefs.
2008-10-17client: converted permissions to unsignedMax Kellermann1-7/+7
client->permission is a bit set, and should be unsigned.
2008-10-17command: expect "file:///" url for local filesMax Kellermann1-4/+7
When adding a local file, clients have to use the "file" URI schema described in RFC 1738 3.10. By adding this schema to "urlhandlers", a client can detect whether this feature is available.
2008-10-16command: special case for "add /"Max Kellermann1-1/+1
The undocumented command "add /" adds the full music database to the playlist. Don't interpret this special path as a local file path.
2008-10-15playlist: added support for adding songs not in the music databaseMax Kellermann1-1/+17
Clients which have authenticated via unix socket may add local files to the MPD playlist, provided that they own the file.
2008-10-15command: print error message on "addid" failureMax Kellermann1-1/+1
Returning the playlist_result value from a command handler does not make sense. Call print_playlist_result() there, and forward its return value.
2008-10-14command: added command "idle"Max Kellermann1-0/+12
"idle" waits until something noteworthy happens on the server, e.g. song change, playlist modified, database updated. This allows clients to keep up to date without polling.
2008-10-10player: added player_get_audio_format()Max Kellermann1-2/+3
player_get_audio_format() replaces getPlayerSampleRate(), getPlayerBits(), getPlayerChannels().
2008-10-10player: added player_control.audio_formatMax Kellermann1-1/+1
This replaces the attributes bits, channels, sampleRate.
2008-10-09update: make the job id unsignedMax Kellermann1-1/+1
Since the return value cannot be -1 anymore, we can make it unsigned.
2008-10-09update: job ID must be positiveMax Kellermann1-15/+11
The documentation for directory_update_init() was incorrect: a job ID must be positive, not non-negative. If the update queue is full and no job was created, it makes more sense to return 0 instead of -1, because it is more consistent with the return value of isUpdatingDB().
2008-10-09diretory: moved code to directory_save.c, directory_print.cMax Kellermann1-0/+1
Remove clutter from directory.c. Everything which saves or loads to/from the hard disk goes to directory_save.c, and code which sends directory information to the client is moved into directory_print.c.