diff options
author | Max Kellermann <max@duempel.org> | 2008-11-07 08:30:18 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-11-07 08:30:18 +0100 |
commit | 25a07c795fdf275b85ccc3b6634f645a0eb1127e (patch) | |
tree | f1bc53d8ddf4255e0733258d4f54a2778d8948f4 | |
parent | c7a5ac5c3656074b78d826479959cb7425efadcd (diff) | |
download | mpd-25a07c795fdf275b85ccc3b6634f645a0eb1127e.tar.gz mpd-25a07c795fdf275b85ccc3b6634f645a0eb1127e.tar.xz mpd-25a07c795fdf275b85ccc3b6634f645a0eb1127e.zip |
options: don't store disabled options
Options which are disabled at compile time shouldn't reserve space for
their values in the options struct.
-rw-r--r-- | src/command.c | 2 | ||||
-rw-r--r-- | src/command.h | 3 | ||||
-rw-r--r-- | src/conf.c | 8 | ||||
-rw-r--r-- | src/options.c | 6 | ||||
-rw-r--r-- | src/options.h | 4 |
5 files changed, 23 insertions, 0 deletions
diff --git a/src/command.c b/src/command.c index fa7fe2e3a..92ee27ea0 100644 --- a/src/command.c +++ b/src/command.c @@ -200,11 +200,13 @@ static command_definition_t cmds[] = { { { -1, -1, -1 }, 0, CMD_NONE, NULL, NULL } }; +#ifdef ENABLE_KEYDEF_SCREEN command_definition_t * get_command_definitions(void) { return cmds; } +#endif const char * key2str(int key) diff --git a/src/command.h b/src/command.h index b48bf80f6..55d7a9cd8 100644 --- a/src/command.h +++ b/src/command.h @@ -81,7 +81,10 @@ typedef struct { const char *description; } command_definition_t; +#ifdef ENABLE_KEYDEF_SCREEN command_definition_t *get_command_definitions(void); +#endif + command_t find_key_command(int key, command_definition_t *cmds); void command_dump_keys(void); diff --git a/src/conf.c b/src/conf.c index 1630f6231..5b3ebb3f7 100644 --- a/src/conf.c +++ b/src/conf.c @@ -499,7 +499,11 @@ read_rc_file(char *filename) else if (!strcasecmp(CONF_XTERM_TITLE, name)) options.enable_xterm_title = str2bool(value); else if (!strcasecmp(CONF_ENABLE_MOUSE, name)) +#ifdef HAVE_GETMOUSE options.enable_mouse = str2bool(value); +#else + {} +#endif else if (!strcasecmp(CONF_CROSSFADE_TIME, name)) options.crossfade_time = atoi(value); else if (!strcasecmp(CONF_SEARCH_MODE, name)) @@ -520,7 +524,11 @@ read_rc_file(char *filename) else if (!strcasecmp(CONF_PASSWORD, name)) options.password = get_format(value); else if (!strcasecmp(CONF_LYRICS_TIMEOUT, name)) +#ifdef ENABLE_LYRICS_SCREEN options.lyrics_timeout = atoi(get_format(value)); +#else + {} +#endif else if (!strcasecmp(CONF_SCROLL, name)) options.scroll = str2bool(value); else if (!strcasecmp(CONF_SCROLL_SEP, name)) { diff --git a/src/options.c b/src/options.c index 853f10545..3c39bdaf6 100644 --- a/src/options.c +++ b/src/options.c @@ -49,7 +49,9 @@ options_t options = { .port = DEFAULT_PORT, .crossfade_time = DEFAULT_CROSSFADE_TIME, .seek_time = 1, +#ifdef ENABLE_LYRICS_SCREEN .lyrics_timeout = DEFAULT_LYRICS_TIMEOUT, +#endif .find_wrap = true, .wide_cursor = true, .audible_bell = true, @@ -190,10 +192,14 @@ handle_option(int c, const char *arg) #endif break; case 'm': /* --mouse */ +#ifdef HAVE_GETMOUSE options.enable_mouse = true; +#endif break; case 'M': /* --no-mouse */ +#ifdef HAVE_GETMOUSE options.enable_mouse = false; +#endif break; case 'e': /* --exit */ /* deprecated */ diff --git a/src/options.h b/src/options.h index 791ec2f09..5496e78ca 100644 --- a/src/options.h +++ b/src/options.h @@ -25,7 +25,9 @@ typedef struct { int search_mode; int hide_cursor; int seek_time; +#ifdef ENABLE_LYRICS_SCREEN int lyrics_timeout; +#endif bool find_wrap; bool find_show_last_pattern; bool list_wrap; @@ -37,7 +39,9 @@ typedef struct { bool audible_bell; bool visible_bell; bool enable_xterm_title; +#ifdef HAVE_GETMOUSE bool enable_mouse; +#endif bool scroll; bool visible_bitrate; bool welcome_screen_list; |