aboutsummaryrefslogtreecommitdiffstats
path: root/src/conf.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-03 14:25:00 +0200
committerMax Kellermann <max@duempel.org>2008-10-03 14:25:00 +0200
commit88af2c3ace0fa42dbb816cc9fe8c4b54ce89233a (patch)
treef637ddd9f06c52890ffffe4910d410d4dd36d520 /src/conf.c
parent3e70743f5061573a2d9fff2fe4b232f38653d12b (diff)
downloadmpd-88af2c3ace0fa42dbb816cc9fe8c4b54ce89233a.tar.gz
mpd-88af2c3ace0fa42dbb816cc9fe8c4b54ce89233a.tar.xz
mpd-88af2c3ace0fa42dbb816cc9fe8c4b54ce89233a.zip
colors: make color support optional at compile time
Default is colors disabled. Those who love colorful terminals have the option to enable it with --enable-colors.
Diffstat (limited to 'src/conf.c')
-rw-r--r--src/conf.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/conf.c b/src/conf.c
index 5dff1ccdf..4485cda59 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -225,6 +225,7 @@ parse_timedisplay_type(const char *str)
}
}
+#ifdef ENABLE_COLORS
static int
parse_color(char *str)
{
@@ -312,6 +313,7 @@ parse_color_definition(char *str)
g_free(name);
return value;
}
+#endif
static char *
get_format(char *str)
@@ -438,13 +440,21 @@ read_rc_file(char *filename, options_t *options)
parse_key_definition(value);
/* enable colors */
else if(!strcasecmp(CONF_ENABLE_COLORS, name))
+#ifdef ENABLE_COLORS
options->enable_colors = str2bool(value);
+#else
+ {}
+#endif
/* auto center */
else if (!strcasecmp(CONF_AUTO_CENTER, name))
options->auto_center = str2bool(value);
/* color assignment */
else if (!strcasecmp(CONF_COLOR, name))
+#ifdef ENABLE_COLORS
parse_color(value);
+#else
+ {}
+#endif
/* wide cursor */
else if (!strcasecmp(CONF_WIDE_CURSOR, name))
options->wide_cursor = str2bool(value);
@@ -460,7 +470,11 @@ read_rc_file(char *filename, options_t *options)
options->timedisplay_type=g_strdup(parse_timedisplay_type(value));
/* color definition */
} else if (!strcasecmp(CONF_COLOR_DEFINITION, name))
+#ifdef ENABLE_COLORS
parse_color_definition(value);
+#else
+ {}
+#endif
/* list format string */
else if (!strcasecmp(CONF_LIST_FORMAT, name)) {
g_free(options->list_format);