diff options
-rw-r--r-- | src/command.c | 10 | ||||
-rw-r--r-- | src/command.h | 10 | ||||
-rw-r--r-- | src/main.c | 4 | ||||
-rw-r--r-- | src/options.c | 1 |
4 files changed, 23 insertions, 2 deletions
diff --git a/src/command.c b/src/command.c index 1b6519a53..663ab7ad2 100644 --- a/src/command.c +++ b/src/command.c @@ -297,6 +297,8 @@ command_dump_keys(void) } } +#ifndef NCMPC_MINI + static int set_key_flags(command_definition_t *cp, command_t command, int flags) { @@ -314,6 +316,8 @@ set_key_flags(command_definition_t *cp, command_t command, int flags) return 1; } +#endif + const char * get_key_names(command_t command, int all) { @@ -434,7 +438,9 @@ assign_keys(command_t command, int keys[MAX_COMMAND_KEYS]) while (cmds[i].name) { if (cmds[i].command == command) { memcpy(cmds[i].keys, keys, sizeof(int)*MAX_COMMAND_KEYS); +#ifndef NCMPC_MINI cmds[i].flags |= COMMAND_KEY_MODIFIED; +#endif return 0; } i++; @@ -442,6 +448,8 @@ assign_keys(command_t command, int keys[MAX_COMMAND_KEYS]) return -1; } +#ifndef NCMPC_MINI + int check_key_bindings(command_definition_t *cp, char *buf, size_t bufsize) { @@ -529,3 +537,5 @@ write_key_bindings(FILE *f, int flags) return ferror(f); } + +#endif diff --git a/src/command.h b/src/command.h index ef1fee2e8..4df7a30f0 100644 --- a/src/command.h +++ b/src/command.h @@ -23,7 +23,10 @@ #include "config.h" #include <stddef.h> + +#ifndef NCMPC_MINI #include <stdio.h> +#endif #define MAX_COMMAND_KEYS 3 @@ -88,9 +91,11 @@ typedef enum { } command_t; +#ifndef NCMPC_MINI /* command definition flags */ #define COMMAND_KEY_MODIFIED 0x01 #define COMMAND_KEY_CONFLICT 0x02 +#endif /* write key bindings flags */ #define KEYDEF_WRITE_HEADER 0x01 @@ -112,9 +117,14 @@ command_definition_t *get_command_definitions(void); command_t find_key_command(int key, 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); +#endif + const char *key2str(int key); const char *get_key_description(command_t command); const char *get_key_command_name(command_t command); diff --git a/src/main.c b/src/main.c index 11f16acb8..752ccdfbb 100644 --- a/src/main.c +++ b/src/main.c @@ -393,13 +393,13 @@ main(int argc, const char *argv[]) /* parse command line options - 1 pass get configuration files */ options_parse(argc, argv); - /* read configuration */ #ifndef NCMPC_MINI + /* read configuration */ read_configuration(); -#endif /* check key bindings */ check_key_bindings(NULL, NULL, 0); +#endif /* parse command line options - 2 pass */ options_parse(argc, argv); diff --git a/src/options.c b/src/options.c index 63674ef5c..8c62e4b83 100644 --- a/src/options.c +++ b/src/options.c @@ -24,6 +24,7 @@ #include "conf.h" #include <stdlib.h> +#include <stdio.h> #include <string.h> #include <glib.h> |