X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fcommand.h;h=aa794c64cded5415e9c5cd521cb5c3eaddf6b00d;hb=63fc23f1c83f52eb47b5511e97bb1fe7cf7d82d5;hp=9e8b1664d2475d585be84d71e392753fa26b9d8f;hpb=dd83d47626fdef308c92839aca2c79a1ed51fdc4;p=ncmpc.git diff --git a/src/command.h b/src/command.h index 9e8b166..aa794c6 100644 --- a/src/command.h +++ b/src/command.h @@ -1,5 +1,5 @@ /* ncmpc (Ncurses MPD Client) - * (c) 2004-2010 The Music Player Daemon Project + * (c) 2004-2017 The Music Player Daemon Project * Project homepage: http://musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -21,6 +21,7 @@ #define COMMAND_H #include "config.h" +#include "Compiler.h" #include #include @@ -82,7 +83,6 @@ typedef enum { CMD_LIST_SCROLL_DOWN_LINE, CMD_LIST_SCROLL_UP_HALF, CMD_LIST_SCROLL_DOWN_HALF, - CMD_MOUSE_EVENT, CMD_SCREEN_UPDATE, CMD_SCREEN_PREVIOUS, CMD_SCREEN_NEXT, @@ -131,25 +131,51 @@ command_definition_t *get_command_definitions(void); size_t get_cmds_max_name_width(command_definition_t *cmds); #endif -command_t find_key_command(int key, command_definition_t *cmds); +gcc_pure +command_t +find_key_command(int key, const command_definition_t *cmds); void command_dump_keys(void); #ifndef NCMPC_MINI -int check_key_bindings(command_definition_t *cmds, char *buf, size_t size); -int write_key_bindings(FILE *f, int all); +/** + * @return true on success, false on error + */ +bool +check_key_bindings(command_definition_t *cmds, char *buf, size_t size); + +/** + * @return true on success, false on error + */ +bool +write_key_bindings(FILE *f, int all); #endif +gcc_pure const char *key2str(int key); + +gcc_pure const char *get_key_description(command_t command); + +gcc_pure const char *get_key_command_name(command_t command); + +gcc_pure const char *get_key_names(command_t command, bool all); + +gcc_pure command_t get_key_command(int key); -command_t get_key_command_from_name(char *name); -int assign_keys(command_t command, int keys[MAX_COMMAND_KEYS]); -command_t get_keyboard_command(void); +gcc_pure +command_t +get_key_command_from_name(const char *name); + +/** + * @return true on success, false on error + */ +bool +assign_keys(command_t command, int keys[MAX_COMMAND_KEYS]); #endif