aboutsummaryrefslogtreecommitdiff
path: root/src/command.c
Commit message (Collapse)AuthorAge
* command: don't allow adding local files on WIN32Max Kellermann2008-12-30
| | | | | | 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.
* removed os_compat.hMax Kellermann2008-12-29
| | | | | Only include headers which are really needed. os_compat.h aimed to make MPD easily portable, but was never actually made portable.
* command: use gmtime() on WIN32Max Kellermann2008-12-29
| | | | gmtime_r() is not available.
* command: reject unsupported URI schemesMax Kellermann2008-12-16
| | | | | | 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.
* ls: make printRemoteUrlHandlers() return voidMax Kellermann2008-12-16
| | | | | printRemoteUrlHandlers() cannot fail, and does not need a return value.
* replaced mpd_printf etc by G_GNUC_PRINTFThomas Jansen2008-12-02
| | | | | We want to remove gcc.h eventually. This takes care of all the G_GNUC_PRINTF macros.
* command.c: replaced mpd_unused by G_GNUC_UNUSEDThomas Jansen2008-11-24
|
* command: format strerror() with "%s"Max Kellermann2008-11-22
| | | | We shouldn't pass strerror() where a format string is expected.
* command: allow clients to subscribe to specific idle eventsMarc Pavot2008-11-22
| | | | | | 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.
* path: removed sanitizePathDup()Max Kellermann2008-10-31
| | | | | We don't need to sanitize the path, because the mapper already checks for malformed paths.
* client: use GSList instead of struct strnode for command listsMax Kellermann2008-10-31
| | | | Replace a custom data structure with a GLib one.
* command: removed range check from check_bool()Max Kellermann2008-10-26
| | | | check_bool() accepts only "0" or "1". The range check is superfluous.
* command: fix boolean value parserMax Kellermann2008-10-23
| | | | | Due to a logic error, no value was valid for the boolean value parser. Replace "||" with "&&".
* stored_playlist: renamed and moved spl_delete() to stored_playlist.cMax Kellermann2008-10-23
| | | | The function deletePlaylist() shouldn't be in playlist.c.
* command: check over/underflows in check_int()Max Kellermann2008-10-23
| | | | | The "long" result of strtol() was implicitly casted down to a 32 bit integer. Add some range checking instead.
* command: added check_unsigned() / check_bool()Max Kellermann2008-10-23
| | | | | | | 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().
* playlist: unsigned integersMax Kellermann2008-10-23
| | | | | | 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.
* command: use the bool datatype instead of intMax Kellermann2008-10-22
| | | | | Instead of returning 0 for success and -1 for failure, return true or false. This seems more natural.
* command: converted COMMAND_RETURN_* macros to enumMax Kellermann2008-10-22
| | | | | | | | 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.
* command: replaced "goto" with "break"Max Kellermann2008-10-22
| | | | http://xkcd.com/292/
* command: no CamelCaseMax Kellermann2008-10-22
| | | | Eliminate CamelCase in all public and static functions.
* command: removed CommandHandlerFunction typedefMax Kellermann2008-10-22
| | | | | The typedef CommandHandlerFunction is only used once. Move its type into the command struct.
* ack: converted ACK_ERROR_* macros to enumMax Kellermann2008-10-22
|
* stored_playlist: send timestampsMax Kellermann2008-10-22
| | | | | Send last modification timestamps to the client. This allows the client to see when another client modifies a stored playlist.
* command: added command "listplaylists"Max Kellermann2008-10-22
| | | | | "listplaylists" returns a list of all stored playlists. This command seems more elaborate than listing them below "lsinfo".
* command: added print_spl_list()Max Kellermann2008-10-22
| | | | | The function print_spl_list() replaces the old function lsPlaylists() from ls.c.
* stored_playlist: de-CamelCase moved functionMax Kellermann2008-10-22
| | | | | Rename addToStoredPlaylist() to spl_append_uri(), and remove the clearStoredPlaylist() macro.
* stored_playlist: no CamelCaseMax Kellermann2008-10-22
| | | | Renamed all public functions, prefix is "spl_".
* renamed storedPlaylist.c to stored_playlist.cMax Kellermann2008-10-22
| | | | No CamelCase in file names.
* command: added "commands" array instead of registering manuallyMax Kellermann2008-10-22
| | | | | | 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.
* command: make command pointers constantMax Kellermann2008-10-22
| | | | | | 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.
* command: renamed CommandEntry to struct commandMax Kellermann2008-10-22
| | | | No CamelCase and no struct typedefs.
* client: converted permissions to unsignedMax Kellermann2008-10-17
| | | | client->permission is a bit set, and should be unsigned.
* command: expect "file:///" url for local filesMax Kellermann2008-10-17
| | | | | | 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.
* command: special case for "add /"Max Kellermann2008-10-16
| | | | | The undocumented command "add /" adds the full music database to the playlist. Don't interpret this special path as a local file path.
* playlist: added support for adding songs not in the music databaseMax Kellermann2008-10-15
| | | | | Clients which have authenticated via unix socket may add local files to the MPD playlist, provided that they own the file.
* command: print error message on "addid" failureMax Kellermann2008-10-15
| | | | | | Returning the playlist_result value from a command handler does not make sense. Call print_playlist_result() there, and forward its return value.
* command: added command "idle"Max Kellermann2008-10-14
| | | | | | "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.
* player: added player_get_audio_format()Max Kellermann2008-10-10
| | | | | player_get_audio_format() replaces getPlayerSampleRate(), getPlayerBits(), getPlayerChannels().
* player: added player_control.audio_formatMax Kellermann2008-10-10
| | | | This replaces the attributes bits, channels, sampleRate.
* update: make the job id unsignedMax Kellermann2008-10-09
| | | | Since the return value cannot be -1 anymore, we can make it unsigned.
* update: job ID must be positiveMax Kellermann2008-10-09
| | | | | | | 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().
* diretory: moved code to directory_save.c, directory_print.cMax Kellermann2008-10-09
| | | | | | 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.
* Fix error code for "Playlist already exists"Qball Cow2008-10-09
| | | | | | | With commit 6dcd7fea (if I am not mistaken) the error returned when you try to save to an existing playlist is wrong. Instead of MPD_ACK_ERROR_EXIST, MPD_ACK_ERROR_NO_EXIST is returned. This is obviously wrong and breaks gmpc.
* database: renamed functions, "db_" prefix and no CamelCaseMax Kellermann2008-10-08
| | | | Yet another CamelCase removal patch.
* database: removed printDirectoryInfo()Max Kellermann2008-10-08
| | | | The same can be achieved with directory_print(db_get_directory()).
* directory: moved code to database.cMax Kellermann2008-10-08
| | | | | | Taming the directory.c monster, part II: move the database management stuff to database. directory.c should only contain code which works on directory objects.
* directory: moved code to update.cMax Kellermann2008-10-08
| | | | | | The source directory.c mixes several libraries: directory object management, database management and database update, resulting in a 1000+ line monster. Move the whole database update code to update.c.
* command: fix return statusEric Wong2008-10-06
| | | | | | This got broken when listHandlerFunc was removed. Since we no longer need it and it's confusing, remove processCommandInternal and just use process_command.
* command: get rid of specialized list handlersEric Wong2008-10-06
| | | | | | | | commands should really not behave differently if they're issued inside a command list or not; so stop having special handler functions to deal with them. "update" was the only command that used this functionality and I changed that in the last commit to serialize access.